Commit 0604384d authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman
Browse files

Staging: rtl8187se: rename struct ieee80211_hdr to struct ieee80211_hdr_4addr



ieee80211_hdr name is too generic so use ieee80211_hdr_4addr one instead
(which matches the naming used by rtl8192su driver).

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f5ce8fe1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
TODO:
- prepare private ieee80211 stack for merge with rtl8192su's version:
  - rename struct ieee80211_hdr to struct ieee80211_hdr_4addr
  - rename struct ieee80211_hdr_3addr_QOS to struct ieee80211_hdr_3addrqos
  - rename struct ieee80211_hdr_QOS to struct ieee80211_hdr_4addrqos
  - add hwsec_active flag to struct ieee80211_device
+2 −2
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ struct ieee_ibss_seq {
	struct list_head list;
};

struct ieee80211_hdr {
struct ieee80211_hdr_4addr {
	u16 frame_ctl;
	u16 duration_id;
	u8 addr1[ETH_ALEN];
@@ -1450,7 +1450,7 @@ extern void ieee80211_txb_free(struct ieee80211_txb *);
extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
			struct ieee80211_rx_stats *rx_stats);
extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
			     struct ieee80211_hdr *header,
			     struct ieee80211_hdr_4addr *header,
			     struct ieee80211_rx_stats *stats);

/* ieee80211_wx.c */
+5 −5
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ static inline void xor_block(u8 *b, u8 *a, size_t len)
}

static void ccmp_init_blocks(struct crypto_tfm *tfm,
			     struct ieee80211_hdr *hdr,
			     struct ieee80211_hdr_4addr *hdr,
			     u8 *pn, size_t dlen, u8 *b0, u8 *auth,
			     u8 *s0)
{
@@ -196,7 +196,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
	struct ieee80211_ccmp_data *key = priv;
	int data_len, i;
	u8 *pos;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	int blocks, last, len;
	u8 *mic;
	u8 *b0 = key->tx_b0;
@@ -232,7 +232,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
	*pos++ = key->tx_pn[1];
	*pos++ = key->tx_pn[0];

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	//mic is moved to here by john
	mic = skb_put(skb, CCMP_MIC_LEN);

@@ -265,7 +265,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
{
	struct ieee80211_ccmp_data *key = priv;
	u8 keyidx, *pos;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	u8 pn[6];
	size_t data_len = skb->len - hdr_len - CCMP_HDR_LEN - CCMP_MIC_LEN;
	u8 *mic = skb->data + skb->len - CCMP_MIC_LEN;
@@ -279,7 +279,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
		return -1;
	}

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	pos = skb->data + hdr_len;
	keyidx = pos[3];
	if (!(keyidx & (1 << 5))) {
+13 −13
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
        struct blkcipher_desc desc = {.tfm = tkey->tx_tfm_arc4};
	int len;
	u8  *pos;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	u8 rc4key[16],*icv;
	u32 crc;
	struct scatterlist sg;
@@ -321,7 +321,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
	    skb->len < hdr_len)
		return -1;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;

	if (!tkey->tx_phase1_done) {
		tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2,
@@ -369,7 +369,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
	u8 keyidx, *pos;
	u32 iv32;
	u16 iv16;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	u8 icv[4];
	u32 crc;
	struct scatterlist sg;
@@ -379,7 +379,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
	if (skb->len < hdr_len + 8 + 4)
		return -1;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	pos = skb->data + hdr_len;
	keyidx = pos[3];
	if (!(keyidx & (1 << 5))) {
@@ -494,9 +494,9 @@ static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr,

static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr)
{
	struct ieee80211_hdr *hdr11;
	struct ieee80211_hdr_4addr *hdr11;

	hdr11 = (struct ieee80211_hdr *) skb->data;
	hdr11 = (struct ieee80211_hdr_4addr *)skb->data;
	switch (le16_to_cpu(hdr11->frame_ctl) &
		(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) {
	case IEEE80211_FCTL_TODS:
@@ -527,9 +527,9 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri
{
	struct ieee80211_tkip_data *tkey = priv;
	u8 *pos;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;

	if (skb_tailroom(skb) < 8 || skb->len < hdr_len) {
		printk(KERN_DEBUG "Invalid packet for Michael MIC add "
@@ -556,7 +556,7 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri
}

static void ieee80211_michael_mic_failure(struct net_device *dev,
				       struct ieee80211_hdr *hdr,
				       struct ieee80211_hdr_4addr *hdr,
				       int keyidx)
{
	union iwreq_data wrqu;
@@ -581,9 +581,9 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
{
	struct ieee80211_tkip_data *tkey = priv;
	u8 mic[8];
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;

	if (!tkey->key_set)
		return -1;
@@ -601,8 +601,8 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
		return -1;

	if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) {
		struct ieee80211_hdr *hdr;
		hdr = (struct ieee80211_hdr *) skb->data;
		struct ieee80211_hdr_4addr *hdr;
		hdr = (struct ieee80211_hdr_4addr *)skb->data;
		printk(KERN_DEBUG "%s: Michael MIC verification failed for "
		       "MSDU from " MAC_FMT " keyidx=%d\n",
		       skb->dev ? skb->dev->name : "N/A", MAC_ARG(hdr->addr2),
+22 −20
Original line number Diff line number Diff line
@@ -49,7 +49,8 @@ static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee,
					struct sk_buff *skb,
					struct ieee80211_rx_stats *rx_stats)
{
	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
	struct ieee80211_hdr_4addr *hdr =
		(struct ieee80211_hdr_4addr *)skb->data;
	u16 fc = le16_to_cpu(hdr->frame_ctl);

	skb->dev = ieee->dev;
@@ -95,7 +96,7 @@ ieee80211_frag_cache_find(struct ieee80211_device *ieee, unsigned int seq,
/* Called only as a tasklet (software IRQ) */
static struct sk_buff *
ieee80211_frag_cache_get(struct ieee80211_device *ieee,
			 struct ieee80211_hdr *hdr)
			 struct ieee80211_hdr_4addr *hdr)
{
	struct sk_buff *skb = NULL;
	u16 fc = le16_to_cpu(hdr->frame_ctl);
@@ -124,7 +125,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,
	if (frag == 0) {
		/* Reserve enough space to fit maximum frame length */
		skb = dev_alloc_skb(ieee->dev->mtu +
				    sizeof(struct ieee80211_hdr) +
				    sizeof(struct ieee80211_hdr_4addr) +
				    8 /* LLC */ +
				    2 /* alignment */ +
				    8 /* WEP */ +
@@ -164,7 +165,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee,

/* Called only as a tasklet (software IRQ) */
static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee,
					   struct ieee80211_hdr *hdr)
					   struct ieee80211_hdr_4addr *hdr)
{
	u16 fc = le16_to_cpu(hdr->frame_ctl);
	u16 sc = le16_to_cpu(hdr->seq_ctl);
@@ -214,17 +215,18 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb,
			struct ieee80211_rx_stats *rx_stats, u16 type,
			u16 stype)
{
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;

	// cheat the the hdr type
	hdr = (struct ieee80211_hdr *)skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;

	/* On the struct stats definition there is written that
	 * this is not mandatory.... but seems that the probe
	 * response parser uses it
	 */
	rx_stats->len = skb->len;
	ieee80211_rx_mgt(ieee,(struct ieee80211_hdr *)skb->data,rx_stats);
	ieee80211_rx_mgt(ieee, (struct ieee80211_hdr_4addr *)skb->data,
			 rx_stats);

	if((ieee->state == IEEE80211_LINKED)&&(memcmp(hdr->addr3,ieee->current_network.bssid,ETH_ALEN))) {
		dev_kfree_skb_any(skb);
@@ -256,13 +258,13 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee,
{
	struct net_device *dev = ieee->dev;
	u16 fc, ethertype;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	u8 *pos;

	if (skb->len < 24)
		return 0;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	fc = le16_to_cpu(hdr->frame_ctl);

	/* check that the frame is unicast frame to us */
@@ -296,13 +298,13 @@ static inline int
ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb,
			   struct ieee80211_crypt_data *crypt)
{
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	int res, hdrlen;

	if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
		return 0;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));

#ifdef CONFIG_IEEE80211_CRYPT_TKIP
@@ -341,13 +343,13 @@ static inline int
ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device* ieee, struct sk_buff *skb,
			     int keyidx, struct ieee80211_crypt_data *crypt)
{
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	int res, hdrlen;

	if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
		return 0;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));

	atomic_inc(&crypt->refcnt);
@@ -367,7 +369,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device* ieee, struct sk_buff *s
/* this function is stolen from ipw2200 driver*/
#define IEEE_PACKET_RETRY_TIME (5*HZ)
static int is_duplicate_packet(struct ieee80211_device *ieee,
				      struct ieee80211_hdr *header)
				      struct ieee80211_hdr_4addr *header)
{
	u16 fc = le16_to_cpu(header->frame_ctl);
	u16 sc = le16_to_cpu(header->seq_ctl);
@@ -473,7 +475,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
{
	struct net_device *dev = ieee->dev;
	//struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr_4addr *hdr;
	//struct ieee80211_hdr_3addr_QOS *hdr;

	size_t hdrlen;
@@ -490,7 +492,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
	int keyidx = 0;

	// cheat the the hdr type
	hdr = (struct ieee80211_hdr *)skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	stats = &ieee->stats;

	if (skb->len < 10) {
@@ -631,7 +633,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
	    (keyidx = ieee80211_rx_frame_decrypt(ieee, skb, crypt)) < 0)
		goto rx_dropped;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;

	/* skb: hdr + (possibly fragmented) plaintext payload */
	// PR: FIXME: hostap has additional conditions in the "if" below:
@@ -684,7 +686,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
		/* this was the last fragment and the frame will be
		 * delivered, so remove skb from fragment cache */
		skb = frag_skb;
		hdr = (struct ieee80211_hdr *) skb->data;
		hdr = (struct ieee80211_hdr_4addr *)skb->data;
		ieee80211_frag_cache_invalidate(ieee, hdr);
	}

@@ -694,7 +696,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
	    ieee80211_rx_frame_decrypt_msdu(ieee, skb, keyidx, crypt))
		goto rx_dropped;

	hdr = (struct ieee80211_hdr *) skb->data;
	hdr = (struct ieee80211_hdr_4addr *)skb->data;
	if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep) {
		if (/*ieee->ieee802_1x &&*/
		    ieee80211_is_eapol_frame(ieee, skb, hdrlen)) {
@@ -1525,7 +1527,7 @@ inline void ieee80211_process_probe_response(
}

void ieee80211_rx_mgt(struct ieee80211_device *ieee,
		      struct ieee80211_hdr *header,
		      struct ieee80211_hdr_4addr *header,
		      struct ieee80211_rx_stats *stats)
{
	switch (WLAN_FC_GET_STYPE(header->frame_ctl)) {
Loading