Stagging: rtl8187se updates
cover Stagging: rtl8187se updates
- more ifdefs removals
- switch it to use <linux/ieee80211.h>
- more preparations for LIBRTL
diffstat:
Makefile | 2 TODO | 6 ieee80211/ieee80211.h | 527 ++++++++++++++------------------------- ieee80211/ieee80211_crypt_ccmp.c | 15 - ieee80211/ieee80211_crypt_tkip.c | 31 -- ieee80211/ieee80211_crypt_wep.c | 5 ieee80211/ieee80211_rx.c | 270 ++----------------- ieee80211/ieee80211_softmac.c | 38 -- ieee80211/ieee80211_tx.c | 29 -- ieee80211/ieee80211_wx.c | 6 r8180_core.c | 8 r8180_wx.c | 6 r8185b_init.c | 2 13 files changed, 275 insertions(+), 670 deletions(-)
PATCH 1/10 Staging: rtl8187se/ieee80211: remove OPENSUSE_SLED ifdefs
From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se/ieee80211: remove OPENSUSE_SLED ifdefs
--- drivers/staging/rtl8187se/TODO | 1 - drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c | 5 ----- drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_tkip.c | 5 ----- drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c | 5 ----- 4 files changed, 16 deletions(-)
drivers/staging/rtl8187se/TODO +0 -1
@@ -1,6 +1,5 @@ TODO: - prepare private ieee80211 stack for merge with rtl8192su's version: - - remove [IN]_OPENSUSE_SLED definitions - remove ENABLE_IPS ifdefs - rename struct ieee80211_hdr to struct ieee80211_hdr_4addr - rename struct ieee80211_hdr_3addr_QOS to struct ieee80211_hdr_3addrqos
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c +0 -5
@@ -31,11 +31,6 @@ MODULE_AUTHOR("Jouni Malinen");MODULE_DESCRIPTION ("Host AP crypt: CCMP" );MODULE_LICENSE ("GPL" ); -#ifdef OPENSUSE_SLED -#ifndef IN_OPENSUSE_SLED -#define IN_OPENSUSE_SLED 1 -#endif -#endif #define AES_BLOCK_LEN 16#define CCMP_HDR_LEN 8
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_tkip.c +0 -5
@@ -31,11 +31,6 @@ MODULE_AUTHOR("Jouni Malinen");MODULE_DESCRIPTION ("Host AP crypt: TKIP" );MODULE_LICENSE ("GPL" ); -#ifdef OPENSUSE_SLED -#ifndef IN_OPENSUSE_SLED -#define IN_OPENSUSE_SLED 1 -#endif -#endif struct ieee80211_tkip_data {#define TKIP_KEY_LEN 32
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_wep.c +0 -5
@@ -28,11 +28,6 @@ MODULE_AUTHOR("Jouni Malinen");MODULE_DESCRIPTION ("Host AP crypt: WEP" );MODULE_LICENSE ("GPL" ); -#ifdef OPENSUSE_SLED -#ifndef IN_OPENSUSE_SLED -#define IN_OPENSUSE_SLED 1 -#endif -#endif struct prism2_wep_data {
PATCH 2/10 Staging: rtl8187se/ieee80211: remove FEDORACORE_9 ifdef
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se/ieee80211: remove FEDORACORE_9 ifdef
--- drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c +0 -6
@@ -39,12 +39,6 @@ static const char *ieee80211_modes[] = {"?" ,"a" ,"b" ,"ab" ,"g" ,"ag" ,"bg" ,"abg" }; -#ifdef FEDORACORE_9 -#define IN_FEDORACORE_9 1 -#else -#define IN_FEDORACORE_9 0 -#endif -#define MAX_CUSTOM_LEN 64 static inline char *rtl818x_translate_scan(struct ieee80211_device *ieee, char *start, char *stop,
PATCH 3/10 Staging: rtl8187se/ieee80211: remove NOT_YET ifdefs
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se/ieee80211: remove NOT_YET ifdefs
--- drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c | 190 --------------------- 1 file changed, 190 deletions(-)
drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c +0 -190
@@ -237,51 +237,6 @@ ieee80211_rx_frame_mgmt(struct ieee80211return 0 ; -#ifdef NOT_YET -if (ieee->iw_mode ==IW_MODE_MASTER ) { -printk (KERN_DEBUG "%s: Master mode not yet suppported.\n" , - ieee->dev->name); -return 0 ; -/* -hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr *) -skb->data);*/ - } - -if (ieee->hostapd && type ==IEEE80211_TYPE_MGMT ) { -if (stype ==WLAN_FC_STYPE_BEACON && - ieee->iw_mode ==IW_MODE_MASTER ) { -struct sk_buff *skb2; -/* Process beacon frames also in kernel driver to -* update STA(AP) table statistics */ - skb2 =skb_clone (skb,GFP_ATOMIC ); -if (skb2) -hostap_rx (skb2->dev, skb2, rx_stats); - } - -/* send management frames to the user space daemon for -* processing */ - ieee->apdevstats.rx_packets++; - ieee->apdevstats.rx_bytes += skb->len; -prism2_rx_80211 (ieee->apdev, skb, rx_stats,PRISM2_RX_MGMT ); -return 0 ; - } - -if (ieee->iw_mode ==IW_MODE_MASTER ) { -if (type !=WLAN_FC_TYPE_MGMT && type !=WLAN_FC_TYPE_CTRL ) { -printk (KERN_DEBUG "%s: unknown management frame " -"(type=0x%02x, stype=0x%02x) dropped\n" , - skb->dev->name, type, stype); -return -1 ; - } - -hostap_rx (skb->dev, skb, rx_stats); -return 0 ; - } - -printk (KERN_DEBUG "%s: hostap_rx_frame_mgmt: management frame " -"received in non-Host AP mode\n" , skb->dev->name); -return -1 ; -#endif }
@@ -527,14 +482,6 @@ int ieee80211_rx(struct ieee80211_deviceunsigned int frag;u8 *payload;u16 ethertype; -#ifdef NOT_YET -struct net_device *wds =NULL ; -struct sk_buff *skb2 =NULL ; -struct net_device *wds =NULL ; -int frame_authorized =0 ; -int from_assoc_ap =0 ; -void *sta =NULL ; -#endif // u16 QOS_ctl = 0; u8 dst[ETH_ALEN ];u8 src[ETH_ALEN ];
@@ -578,22 +525,6 @@ int ieee80211_rx(struct ieee80211_device hdrlen =ieee80211_get_hdrlen (fc); -#ifdef NOT_YET -/* Put this code here so that we avoid duplicating it in all -* Rx paths. - Jean II */ -#ifdef IW_WIRELESS_SPY /* defined in iw_handler.h */ -/* If spy monitoring on */ -if (iface->spy_data.spy_number >0 ) { -struct iw_quality wstats; - wstats.level = rx_stats->signal; - wstats.noise = rx_stats->noise; - wstats.updated =6 ;/* No qual value */ -/* Update spy records */ -wireless_spy_update (dev, hdr->addr2, &wstats); - } -#endif /* IW_WIRELESS_SPY */ -hostap_update_rx_stats (local->ap, hdr, rx_stats); -#endif if (ieee->iw_mode ==IW_MODE_MONITOR ) {ieee80211_monitor_rx (ieee, skb, rx_stats);
@@ -607,20 +538,6 @@ int ieee80211_rx(struct ieee80211_deviceif (skb->len >= hdrlen +3 ) idx = skb->data[hdrlen +3 ] >>6 ; crypt = ieee->crypt[idx]; -#ifdef NOT_YET - sta =NULL ; - -/* Use station specific key to override default keys if the -* receiver address is a unicast address ("individual RA"). If -* bcrx_sta_key parameter is set, station specific key is used -* even with broad/multicast targets (this is against IEEE -* 802.11, but makes it easier to use different keys with -* stations that do not support WEP key mapping). */ - -if (!(hdr->addr1[0 ] &0x01 ) || local->bcrx_sta_key) - (void )hostap_handle_sta_crypto (local, hdr, &crypt, - &sta); -#endif /* allow NULL decrypt to indicate an station specific override * for default encryption */
@@ -682,46 +599,9 @@ int ieee80211_rx(struct ieee80211_devicebreak ; } -#ifdef NOT_YET -if (hostap_rx_frame_wds (ieee, hdr, fc, &wds)) - goto rx_dropped; -if (wds) { - skb->dev = dev = wds; - stats =hostap_get_stats (dev); - } - -if (ieee->iw_mode ==IW_MODE_MASTER && !wds && - (fc & (IEEE80211_FCTL_TODS |IEEE80211_FCTL_FROMDS )) ==IEEE80211_FCTL_FROMDS && - ieee->stadev && -memcmp (hdr->addr2, ieee->assoc_ap_addr,ETH_ALEN ) ==0 ) { -/* Frame from BSSID of the AP for which we are a client */ - skb->dev = dev = ieee->stadev; - stats =hostap_get_stats (dev); - from_assoc_ap =1 ; - } -#endif dev->last_rx = jiffies; -#ifdef NOT_YET -if ((ieee->iw_mode ==IW_MODE_MASTER || - ieee->iw_mode ==IW_MODE_REPEAT ) && - !from_assoc_ap) { -switch (hostap_handle_sta_rx (ieee, dev, skb, rx_stats, - wds !=NULL )) { -case AP_RX_CONTINUE_NOT_AUTHORIZED : - frame_authorized =0 ; -break ; -case AP_RX_CONTINUE : - frame_authorized =1 ; -break ; -case AP_RX_DROP : - goto rx_dropped; -case AP_RX_EXIT : - goto rx_exit; - } - } -#endif /* Nullfunc frames may have PS-bit set, so they must be passed to * hostap_handle_sta_rx() before being dropped here. */
@@ -864,31 +744,6 @@ int ieee80211_rx(struct ieee80211_device payload = skb->data + hdrlen; ethertype = (payload[6 ] <<8 ) | payload[7 ]; -#ifdef NOT_YET -/* If IEEE 802.1X is used, check whether the port is authorized to send -* the received frame. */ -if (ieee->ieee802_1x && ieee->iw_mode ==IW_MODE_MASTER ) { -if (ethertype ==ETH_P_PAE ) { -printk (KERN_DEBUG "%s: RX: IEEE 802.1X frame\n" , - dev->name); -if (ieee->hostapd && ieee->apdev) { -/* Send IEEE 802.1X frames to the user -* space daemon for processing */ -prism2_rx_80211 (ieee->apdev, skb, rx_stats, -PRISM2_RX_MGMT ); - ieee->apdevstats.rx_packets++; - ieee->apdevstats.rx_bytes += skb->len; - goto rx_exit; - } - }else if (!frame_authorized) { -printk (KERN_DEBUG "%s: dropped frame from " -"unauthorized port (IEEE 802.1X): " -"ethertype=0x%04x\n" , - dev->name, ethertype); - goto rx_dropped; - } - } -#endif /* convert hdr + possible LLC headers into Ethernet header */ if (skb->len - hdrlen >= 8 &&
@@ -910,51 +765,10 @@ int ieee80211_rx(struct ieee80211_devicememcpy (skb_push (skb,ETH_ALEN ), dst,ETH_ALEN ); } -#ifdef NOT_YET -if (wds && ((fc & (IEEE80211_FCTL_TODS |IEEE80211_FCTL_FROMDS )) == -IEEE80211_FCTL_TODS ) && - skb->len >=ETH_HLEN +ETH_ALEN ) { -/* Non-standard frame: get addr4 from its bogus location after -* the payload */ -memcpy (skb->data +ETH_ALEN , - skb->data + skb->len -ETH_ALEN ,ETH_ALEN ); -skb_trim (skb, skb->len -ETH_ALEN ); - } -#endif stats->rx_packets++; stats->rx_bytes += skb->len; -#ifdef NOT_YET -if (ieee->iw_mode ==IW_MODE_MASTER && !wds && - ieee->ap->bridge_packets) { -if (dst[0 ] &0x01 ) { -/* copy multicast frame both to the higher layers and -* to the wireless media */ - ieee->ap->bridged_multicast++; - skb2 =skb_clone (skb,GFP_ATOMIC ); -if (skb2 ==NULL ) -printk (KERN_DEBUG "%s: skb_clone failed for " -"multicast frame\n" , dev->name); - }else if (hostap_is_sta_assoc (ieee->ap, dst)) { -/* send frame directly to the associated STA using -* wireless media and not passing to higher layers */ - ieee->ap->bridged_unicast++; - skb2 = skb; - skb =NULL ; - } - } - -if (skb2 !=NULL ) { -/* send to wireless media */ - skb2->protocol =__constant_htons (ETH_P_802_3 ); - skb2->mac.raw = skb2->nh.raw = skb2->data; -/* skb2->nh.raw = skb2->data + ETH_HLEN; */ - skb2->dev = dev; -dev_queue_xmit (skb2); - } - -#endif if (skb) { skb->protocol =eth_type_trans (skb, dev);memset (skb->cb,0 ,sizeof (skb->cb));
@@ -965,10 +779,6 @@ int ieee80211_rx(struct ieee80211_device } rx_exit: -#ifdef NOT_YET -if (sta) -hostap_handle_sta_release (sta); -#endif return 1 ; rx_dropped:
PATCH 4/10 Staging: rtl8187se: remove ENABLE_IPS ifdefs
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se: remove ENABLE_IPS ifdefs
--- drivers/staging/rtl8187se/Makefile | 2 drivers/staging/rtl8187se/TODO | 1 drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c | 38 ---------------- drivers/staging/rtl8187se/r8180_core.c | 4 - drivers/staging/rtl8187se/r8180_wx.c | 6 -- drivers/staging/rtl8187se/r8185b_init.c | 2 6 files changed, 53 deletions(-)
drivers/staging/rtl8187se/Makefile +0 -2
@@ -4,8 +4,6 @@ #EXTRA_CFLAGS += -O2 #CC = gcc -#added for EeePC testing -EXTRA_CFLAGS += -DENABLE_IPS EXTRA_CFLAGS += -DSW_ANTE EXTRA_CFLAGS += -DTX_TRACK EXTRA_CFLAGS += -DHIGH_POWER
drivers/staging/rtl8187se/TODO +0 -1
@@ -1,6 +1,5 @@ TODO: - prepare private ieee80211 stack for merge with rtl8192su's version: - - remove ENABLE_IPS ifdefs - 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
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c +0 -38
@@ -574,7 +574,6 @@ out:DOT11D_ScanComplete (ieee); } -#ifdef ENABLE_IPS void ieee80211_softmac_scan_wq (struct work_struct *work) {struct delayed_work *dwork =to_delayed_work (work);
@@ -617,43 +616,6 @@ out:DOT11D_ScanComplete (ieee);return ; } -#else -void ieee80211_softmac_scan_wq (struct work_struct *work) -{ -struct delayed_work *dwork =to_delayed_work (work); - struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, softmac_scan_wq); -short watchdog =0 ; -u8 channel_map[MAX_CHANNEL_NUMBER +1 ]; -memcpy (channel_map,GET_DOT11D_INFO (ieee)->channel_map,MAX_CHANNEL_NUMBER +1 ); -// printk("enter scan wq,watchdog is %d\n",watchdog); -down (&ieee->scan_sem); - -do { - ieee->current_network.channel = - (ieee->current_network.channel +1 ) %MAX_CHANNEL_NUMBER ; -if (watchdog++ >MAX_CHANNEL_NUMBER ) - goto out;/* no good chans */ - - }while (!channel_map[ieee->current_network.channel]); - -// printk("current_network.channel:%d\n", ieee->current_network.channel); -if (ieee->scanning ==0 ) - { -printk ("error out, scanning = 0\n" ); - goto out; - } - ieee->set_chan (ieee->dev, ieee->current_network.channel); -if (channel_map[ieee->current_network.channel] ==1 ) -ieee80211_send_probe_requests (ieee); - -queue_delayed_work (ieee->wq, &ieee->softmac_scan_wq,IEEE80211_SOFTMAC_SCAN_TIME ); -out: -up (&ieee->scan_sem); -if (IS_DOT11D_ENABLE (ieee)) -DOT11D_ScanComplete (ieee); -} - -#endif void ieee80211_beacons_start (struct ieee80211_device *ieee) {
drivers/staging/rtl8187se/r8180_core.c +0 -4
@@ -3598,13 +3598,11 @@ void rtl8180_watch_dog(struct net_deviceu32 TotalRxNum =0 ;u16 SlotIndex =0 ;u16 i =0 ; -#ifdef ENABLE_IPS if (priv->ieee80211->actscanning == false){if ((priv->ieee80211->iw_mode !=IW_MODE_ADHOC ) && (priv->ieee80211->state ==IEEE80211_NOLINK ) && (priv->ieee80211->beinretry == false) && (priv->eRFPowerState == eRfOn)){IPSEnter (dev); } } -#endif //YJ,add,080828,for link state check if ((priv->ieee80211->state ==IEEE80211_LINKED ) && (priv->ieee80211->iw_mode ==IW_MODE_INFRA )){ SlotIndex = (priv->link_detect.SlotIndex++) % priv->link_detect.SlotNum;
@@ -3667,12 +3665,10 @@ int _rtl8180_up(struct net_device *dev)rtl8185b_adapter_start (dev);rtl8185b_rx_enable (dev);rtl8185b_tx_enable (dev); -#ifdef ENABLE_IPS if (priv->bInactivePs){if (priv->ieee80211->iw_mode ==IW_MODE_ADHOC )IPSLeave (dev); } -#endif #ifdef RATE_ADAPT timer_rate_adaptive ((unsigned long )dev);#endif
drivers/staging/rtl8187se/r8180_wx.c +0 -6
@@ -194,13 +194,11 @@ static int r8180_wx_set_mode(struct net_return 0 ;down (&priv->wx_sem); -#ifdef ENABLE_IPS // printk("set mode ENABLE_IPS\n"); if (priv->bInactivePs){if (wrqu->mode ==IW_MODE_ADHOC )IPSLeave (dev); } -#endif ret =ieee80211_wx_set_mode (priv->ieee80211,a,wrqu,b);//rtl8180_commit(dev);
@@ -363,7 +361,6 @@ static int r8180_wx_set_scan(struct net_down (&priv->wx_sem);if (priv->up){ -#ifdef ENABLE_IPS // printk("set scan ENABLE_IPS\n"); priv->ieee80211->actscanning = true;if (priv->bInactivePs && (priv->ieee80211->state !=IEEE80211_LINKED )){
@@ -386,7 +383,6 @@ static int r8180_wx_set_scan(struct net_ ret =0 ; }else -#endif {//YJ,add,080828, prevent scan in BusyTraffic //FIXME: Need to consider last scan time
@@ -439,11 +435,9 @@ static int r8180_wx_set_essid(struct netreturn 0 ;down (&priv->wx_sem); -#ifdef ENABLE_IPS //printk("set essid ENABLE_IPS\n"); if (priv->bInactivePs)IPSLeave (dev); -#endif // printk("haha:set essid %s essid_len = %d essid_flgs = %d\n",b, wrqu->essid.length, wrqu->essid.flags); ret =ieee80211_wx_set_essid (priv->ieee80211,a,wrqu,b);
drivers/staging/rtl8187se/r8185b_init.c +0 -2
@@ -2546,7 +2546,6 @@ void rtl8185b_adapter_start(struct net_d InitWirelessMode = ieee->mode; }//by amy for power save -#ifdef ENABLE_IPS // printk("initialize ENABLE_IPS\n"); priv->eRFPowerState = eRfOff; priv->RfOffReason =0 ;
@@ -2571,7 +2570,6 @@ void rtl8185b_adapter_start(struct net_d// printk("rf off cost jiffies:%lx\n", (tmp2-tmp)*1000/HZ); } -#endif // IPSEnter(dev); //by amy for power save #ifdef TODO
PATCH 5/10 Staging: rtl8187se: rename struct ieee80211_hdr to struct ieee80211_hdr_4addr
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] 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).
--- drivers/staging/rtl8187se/TODO | 1 drivers/staging/rtl8187se/ieee80211/ieee80211.h | 4 - drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c | 10 +-- drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_tkip.c | 26 ++++---- drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c | 42 ++++++------- drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c | 8 -- drivers/staging/rtl8187se/r8180_core.c | 4 - 7 files changed, 46 insertions(+), 49 deletions(-)
drivers/staging/rtl8187se/TODO +0 -1
@@ -1,6 +1,5 @@ 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
drivers/staging/rtl8187se/ieee80211/ieee80211.h +2 -2
@@ -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 ieextern 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 */
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c +5 -5
@@ -114,7 +114,7 @@ static inline void xor_block(u8 *b, u8 * }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(structstruct 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 *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 {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(structreturn -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 ))) {
drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_tkip.c +13 -13
@@ -310,7 +310,7 @@ static int ieee80211_tkip_encrypt(structstruct 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 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(structu8 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(structif (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_hasstatic 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(str {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(str }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 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(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),
drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c +22 -20
155 lines not on this page · raw message
drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c +2 -6
@@ -192,11 +192,11 @@ int ieee80211_encrypt_fragment(return -1 ;#ifdef CONFIG_IEEE80211_CRYPT_TKIP -struct ieee80211_hdr *header; +struct ieee80211_hdr_4addr *header;if (ieee->tkip_countermeasures && crypt && crypt->ops &&strcmp (crypt->ops->name,"TKIP" ) ==0 ) { - header = (struct ieee80211_hdr *) frag->data; + header = (struct ieee80211_hdr_4addr *)frag->data;if (net_ratelimit ()) { printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " "TX packet to " MAC_FMT "\n",
@@ -317,10 +317,6 @@ int ieee80211_xmit(struct sk_buff *skb,int ether_type, encrypt;int bytes, fc, QOS_ctl, hdr_len;struct sk_buff *skb_frag; -//struct ieee80211_hdr header = { /* Ensure zero initialized */ -// .duration_id = 0, -// .seq_ctl = 0 -//}; struct ieee80211_hdr_3addr_QOS header = {/* Ensure zero initialized */ .duration_id =0 , .seq_ctl =0 ,
drivers/staging/rtl8187se/r8180_core.c +2 -2
@@ -1540,7 +1540,7 @@ void rtl8180_rx(struct net_device *dev)u8 LNA =0 ,BB =0 ;u8 LNA_gain[4 ]={02 ,17 ,29 ,39 };u8 Antenna =0 ; -struct ieee80211_hdr *hdr; +struct ieee80211_hdr_4addr *hdr;u16 fc,type;u8 bHwError =0 ,bCRC =0 ,bICV =0 ;bool bCckRate = false;
@@ -1736,7 +1736,7 @@ void rtl8180_rx(struct net_device *dev) | (((*(priv->rxringtail))& (0x08000000)) != 0 )| (((~(*(priv->rxringtail)))& (0x10000000)) != 0 )| (((~(*(priv->rxringtail)))& (0x20000000)) != 0 ); bCRC = ((*(priv->rxringtail)) & (0x00002000 )) >>13 ; bICV = ((*(priv->rxringtail)) & (0x00001000 )) >>12 ; - hdr = (struct ieee80211_hdr *)priv->rxbuffer->buf; + hdr = (struct ieee80211_hdr_4addr *)priv->rxbuffer->buf; fc =le16_to_cpu (hdr->frame_ctl); type =WLAN_FC_GET_TYPE (fc);
PATCH 6/10 Staging: rtl8187se: rename struct ieee80211_hdr_3addr_qos to struct ieee80211_hdr_3addrqos
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se: rename struct ieee80211_hdr_3addr_qos to struct ieee80211_hdr_3addrqos
Rename struct ieee80211_hdr_3addr_QOS to struct ieee80211_hdr_3addrqos and QOS_ctl field to qos_ctl (to match the naming used by rtl8192su).
--- drivers/staging/rtl8187se/TODO | 1 - drivers/staging/rtl8187se/ieee80211/ieee80211.h | 4 ++-- drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c | 20 +++++++++----------- drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c | 21 +++++++++++---------- 4 files changed, 22 insertions(+), 24 deletions(-)
drivers/staging/rtl8187se/TODO +0 -1
@@ -1,6 +1,5 @@ TODO: - prepare private ieee80211 stack for merge with rtl8192su's version: - - 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 - add bHwSec flag to cb_desc structure
drivers/staging/rtl8187se/ieee80211/ieee80211.h +2 -2
@@ -200,14 +200,14 @@ struct ieee80211_hdr_3addr {u16 seq_ctl; } __attribute__ ((packed)); -struct ieee80211_hdr_3addr_QOS { +struct ieee80211_hdr_3addrqos {u16 frame_ctl;u16 duration_id;u8 addr1[ETH_ALEN ];u8 addr2[ETH_ALEN ];u8 addr3[ETH_ALEN ];u16 seq_ctl; -u16 QOS_ctl; +u16 qos_ctl; } __attribute__ ((packed));enum eap_type {
drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c +9 -11
@@ -104,7 +104,7 @@ ieee80211_frag_cache_get(struct ieee8021unsigned int frag =WLAN_GET_SEQ_FRAG (sc);unsigned int seq =WLAN_GET_SEQ_SEQ (sc);struct ieee80211_frag_entry *entry; -struct ieee80211_hdr_3addr_QOS *hdr_3addr_QoS; +struct ieee80211_hdr_3addrqos *hdr_3addrqos;struct ieee80211_hdr_QOS *hdr_4addr_QoS;u8 tid;
@@ -114,8 +114,8 @@ ieee80211_frag_cache_get(struct ieee8021 tid =UP2AC (tid); tid ++; }else if (IEEE80211_QOS_HAS_SEQ (fc)) { - hdr_3addr_QoS = (struct ieee80211_hdr_3addr_QOS *)hdr; - tid =le16_to_cpu (hdr_3addr_QoS->QOS_ctl) &IEEE80211_QOS_TID ; + hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr; + tid =le16_to_cpu (hdr_3addrqos->qos_ctl) &IEEE80211_QOS_TID ; tid =UP2AC (tid); tid ++; }else {
@@ -171,7 +171,7 @@ static int ieee80211_frag_cache_invalidau16 sc =le16_to_cpu (hdr->seq_ctl);unsigned int seq =WLAN_GET_SEQ_SEQ (sc);struct ieee80211_frag_entry *entry; -struct ieee80211_hdr_3addr_QOS *hdr_3addr_QoS; +struct ieee80211_hdr_3addrqos *hdr_3addrqos;struct ieee80211_hdr_QOS *hdr_4addr_QoS;u8 tid;
@@ -181,8 +181,8 @@ static int ieee80211_frag_cache_invalida tid =UP2AC (tid); tid ++; }else if (IEEE80211_QOS_HAS_SEQ (fc)) { - hdr_3addr_QoS = (struct ieee80211_hdr_3addr_QOS *)hdr; - tid =le16_to_cpu (hdr_3addr_QoS->QOS_ctl) &IEEE80211_QOS_TID ; + hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr; + tid =le16_to_cpu (hdr_3addrqos->qos_ctl) &IEEE80211_QOS_TID ; tid =UP2AC (tid); tid ++; }else {
@@ -377,7 +377,7 @@ static int is_duplicate_packet(struct ieu16 frag =WLAN_GET_SEQ_FRAG (sc);u16 *last_seq, *last_frag;unsigned long *last_time; -struct ieee80211_hdr_3addr_QOS *hdr_3addr_QoS; +struct ieee80211_hdr_3addrqos *hdr_3addrqos;struct ieee80211_hdr_QOS *hdr_4addr_QoS;u8 tid;
@@ -388,8 +388,8 @@ static int is_duplicate_packet(struct ie tid =UP2AC (tid); tid ++; }else if (IEEE80211_QOS_HAS_SEQ (fc)) {//QoS - hdr_3addr_QoS = (struct ieee80211_hdr_3addr_QOS *)header; - tid =le16_to_cpu (hdr_3addr_QoS->QOS_ctl) &IEEE80211_QOS_TID ; + hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)header; + tid =le16_to_cpu (hdr_3addrqos->qos_ctl) &IEEE80211_QOS_TID ; tid =UP2AC (tid); tid ++; }else {// no QoS
@@ -476,7 +476,6 @@ int ieee80211_rx(struct ieee80211_devicestruct net_device *dev = ieee->dev;//struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); struct ieee80211_hdr_4addr *hdr; -//struct ieee80211_hdr_3addr_QOS *hdr; size_t hdrlen;u16 fc, type, stype, sc;
@@ -484,7 +483,6 @@ int ieee80211_rx(struct ieee80211_deviceunsigned int frag;u8 *payload;u16 ethertype; -// u16 QOS_ctl = 0; u8 dst[ETH_ALEN ];u8 src[ETH_ALEN ];u8 bssid[ETH_ALEN ];
drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c +11 -10
@@ -310,17 +310,17 @@ int ieee80211_xmit(struct sk_buff *skb, {struct ieee80211_device *ieee =netdev_priv (dev);struct ieee80211_txb *txb =NULL ; -struct ieee80211_hdr_3addr_QOS *frag_hdr; +struct ieee80211_hdr_3addrqos *frag_hdr;int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size;unsigned long flags;struct net_device_stats *stats = &ieee->stats;int ether_type, encrypt; -int bytes, fc, QOS_ctl, hdr_len; +int bytes, fc, qos_ctl, hdr_len;struct sk_buff *skb_frag; -struct ieee80211_hdr_3addr_QOS header = {/* Ensure zero initialized */ +struct ieee80211_hdr_3addrqos header = {/* Ensure zero initialized */ .duration_id =0 , .seq_ctl =0 , - .QOS_ctl =0 + .qos_ctl =0 };u8 dest[ETH_ALEN ], src[ETH_ALEN ];
@@ -419,22 +419,23 @@ int ieee80211_xmit(struct sk_buff *skb,if (is_multicast_ether_addr (header.addr1) ||is_broadcast_ether_addr (header.addr1)) { frag_size =MAX_FRAG_THRESHOLD ; - QOS_ctl =QOS_CTL_NOTCONTAIN_ACK ; + qos_ctl =QOS_CTL_NOTCONTAIN_ACK ; }else {//printk(KERN_WARNING "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&frag_size = %d\n", frag_size); frag_size = ieee->fts;//default:392 - QOS_ctl =0 ; + qos_ctl =0 ; }if (ieee->current_network.QoS_Enable) { hdr_len =IEEE80211_3ADDR_LEN +2 ; - QOS_ctl |= skb->priority;//set in the ieee80211_classify - header.QOS_ctl =cpu_to_le16 (QOS_ctl); +/* skb->priority is set in the ieee80211_classify() */ + qos_ctl |= skb->priority; + header.qos_ctl =cpu_to_le16 (qos_ctl); }else { hdr_len =IEEE80211_3ADDR_LEN ; } -//printk(KERN_WARNING "header size = %d, QOS_ctl = %x\n", hdr_len,QOS_ctl); +/* Determine amount of payload per fragment. Regardless of if * this stack is providing the full 802.11 header, one will * eventually be affixed to this fragment -- so we must account for
@@ -477,7 +478,7 @@ int ieee80211_xmit(struct sk_buff *skb,if (encrypt)skb_reserve (skb_frag, crypt->ops->extra_prefix_len); - frag_hdr = (struct ieee80211_hdr_3addr_QOS *)skb_put (skb_frag, hdr_len); + frag_hdr = (struct ieee80211_hdr_3addrqos *)skb_put (skb_frag, hdr_len);memcpy (frag_hdr, &header, hdr_len);/* If this is not the last fragment, then add the MOREFRAGS
PATCH 7/10 Staging: rtl8187se: rename struct ieee80211_hdr_QOS to struct ieee80211_hdr_4addrqos
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se: rename struct ieee80211_hdr_QOS to struct ieee80211_hdr_4addrqos
Rename struct ieee80211_hdr_QOS to struct ieee80211_hdr_4addrqos and QOS_ctl field to qos_ctl (to match the naming used by rtl8192su).
--- drivers/staging/rtl8187se/TODO | 1 - drivers/staging/rtl8187se/ieee80211/ieee80211.h | 4 ++-- drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c | 18 +++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-)
drivers/staging/rtl8187se/TODO +0 -1
@@ -1,6 +1,5 @@ TODO: - prepare private ieee80211 stack for merge with rtl8192su's version: - - rename struct ieee80211_hdr_QOS to struct ieee80211_hdr_4addrqos - add hwsec_active flag to struct ieee80211_device - add bHwSec flag to cb_desc structure - switch ieee80211.h to use <linux/ieee80211.h>
drivers/staging/rtl8187se/ieee80211/ieee80211.h +2 -2
@@ -180,7 +180,7 @@ struct ieee80211_hdr_4addr {u8 addr4[ETH_ALEN ]; } __attribute__ ((packed)); -struct ieee80211_hdr_QOS { +struct ieee80211_hdr_4addrqos {u16 frame_ctl;u16 duration_id;u8 addr1[ETH_ALEN ];
@@ -188,7 +188,7 @@ struct ieee80211_hdr_QOS {u8 addr3[ETH_ALEN ];u16 seq_ctl;u8 addr4[ETH_ALEN ]; -u16 QOS_ctl; +u16 qos_ctl; } __attribute__ ((packed));struct ieee80211_hdr_3addr {
drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c +9 -9
@@ -105,12 +105,12 @@ ieee80211_frag_cache_get(struct ieee8021unsigned int seq =WLAN_GET_SEQ_SEQ (sc);struct ieee80211_frag_entry *entry;struct ieee80211_hdr_3addrqos *hdr_3addrqos; -struct ieee80211_hdr_QOS *hdr_4addr_QoS; +struct ieee80211_hdr_4addrqos *hdr_4addrqos;u8 tid;if (((fc &IEEE80211_FCTL_DSTODS ) ==IEEE80211_FCTL_DSTODS )&&IEEE80211_QOS_HAS_SEQ (fc)) { - hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)hdr; - tid =le16_to_cpu (hdr_4addr_QoS->QOS_ctl) &IEEE80211_QOS_TID ; + hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr; + tid =le16_to_cpu (hdr_4addrqos->qos_ctl) &IEEE80211_QOS_TID ; tid =UP2AC (tid); tid ++; }else if (IEEE80211_QOS_HAS_SEQ (fc)) {
@@ -172,12 +172,12 @@ static int ieee80211_frag_cache_invalidaunsigned int seq =WLAN_GET_SEQ_SEQ (sc);struct ieee80211_frag_entry *entry;struct ieee80211_hdr_3addrqos *hdr_3addrqos; -struct ieee80211_hdr_QOS *hdr_4addr_QoS; +struct ieee80211_hdr_4addrqos *hdr_4addrqos;u8 tid;if (((fc &IEEE80211_FCTL_DSTODS ) ==IEEE80211_FCTL_DSTODS )&&IEEE80211_QOS_HAS_SEQ (fc)) { - hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)hdr; - tid =le16_to_cpu (hdr_4addr_QoS->QOS_ctl) &IEEE80211_QOS_TID ; + hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr; + tid =le16_to_cpu (hdr_4addrqos->qos_ctl) &IEEE80211_QOS_TID ; tid =UP2AC (tid); tid ++; }else if (IEEE80211_QOS_HAS_SEQ (fc)) {
@@ -378,13 +378,13 @@ static int is_duplicate_packet(struct ieu16 *last_seq, *last_frag;unsigned long *last_time;struct ieee80211_hdr_3addrqos *hdr_3addrqos; -struct ieee80211_hdr_QOS *hdr_4addr_QoS; +struct ieee80211_hdr_4addrqos *hdr_4addrqos;u8 tid;//TO2DS and QoS if (((fc &IEEE80211_FCTL_DSTODS ) ==IEEE80211_FCTL_DSTODS )&&IEEE80211_QOS_HAS_SEQ (fc)) { - hdr_4addr_QoS = (struct ieee80211_hdr_QOS *)header; - tid =le16_to_cpu (hdr_4addr_QoS->QOS_ctl) &IEEE80211_QOS_TID ; + hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)header; + tid =le16_to_cpu (hdr_4addrqos->qos_ctl) &IEEE80211_QOS_TID ; tid =UP2AC (tid); tid ++; }else if (IEEE80211_QOS_HAS_SEQ (fc)) {//QoS
PATCH 8/10 Staging: rtl8187se/ieee80211: switch to use <linux/ieee80211.h>
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se/ieee80211: switch to use <linux/ieee80211.h>
While at it:
* remove some commented out code
* remove some unused definitions
--- drivers/staging/rtl8187se/TODO | 1 drivers/staging/rtl8187se/ieee80211/ieee80211.h | 122 ------------------------ 2 files changed, 1 insertion(+), 122 deletions(-)
drivers/staging/rtl8187se/TODO +0 -1
@@ -2,7 +2,6 @@ TODO: - prepare private ieee80211 stack for merge with rtl8192su's version: - add hwsec_active flag to struct ieee80211_device - add bHwSec flag to cb_desc structure - - switch ieee80211.h to use <linux/ieee80211.h> - switch to use shared "librtl" instead of private ieee80211 stack - switch to use LIB80211 - switch to use MAC80211
drivers/staging/rtl8187se/ieee80211/ieee80211.h +1 -121
145 lines not on this page · raw message
PATCH 9/10 Staging: rtl8187se/ieee80211: ieee80211.h reorderings
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se/ieee80211: ieee80211.h reorderings
Reorder the code in ieee80211.h for easier comparisions with rtl8192su's version of the file.
While at it:
* use IEEE80211_4ADDR_LEN for IEEE80211_LEN definition
* remove unused country_code_type_t typedef
* make some minor coding style fixes
--- drivers/staging/rtl8187se/ieee80211/ieee80211.h | 391 +++++++++++------------- 1 file changed, 193 insertions(+), 198 deletions(-)
drivers/staging/rtl8187se/ieee80211/ieee80211.h +193 -198
@@ -133,102 +133,14 @@ typedef struct ieee_param {represents the 2304 bytes of real data, plus a possible 8 bytes of WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */ - -#define IEEE80211_HLEN 30 -#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) - -/* this is stolen and modified from the madwifi driver*/ -#define IEEE80211_FC0_TYPE_MASK 0x0c -#define IEEE80211_FC0_TYPE_DATA 0x08 -#define IEEE80211_FC0_SUBTYPE_MASK 0xB0 -#define IEEE80211_FC0_SUBTYPE_QOS 0x80 - -#define IEEE80211_QOS_HAS_SEQ (fc) \ - (((fc) & (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == \ - (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS)) - -/* this is stolen from ipw2200 driver */ -#define IEEE_IBSS_MAC_HASH_SIZE 31 -struct ieee_ibss_seq { -u8 mac[ETH_ALEN ]; -u16 seq_num[17 ]; -u16 frag_num[17 ]; -unsigned long packet_time[17 ]; -struct list_head list; -}; - -struct ieee80211_hdr_4addr { -u16 frame_ctl; -u16 duration_id; -u8 addr1[ETH_ALEN ]; -u8 addr2[ETH_ALEN ]; -u8 addr3[ETH_ALEN ]; -u16 seq_ctl; -u8 addr4[ETH_ALEN ]; -} __attribute__ ((packed)); - -struct ieee80211_hdr_4addrqos { -u16 frame_ctl; -u16 duration_id; -u8 addr1[ETH_ALEN ]; -u8 addr2[ETH_ALEN ]; -u8 addr3[ETH_ALEN ]; -u16 seq_ctl; -u8 addr4[ETH_ALEN ]; -u16 qos_ctl; -} __attribute__ ((packed)); - -struct ieee80211_hdr_3addr { -u16 frame_ctl; -u16 duration_id; -u8 addr1[ETH_ALEN ]; -u8 addr2[ETH_ALEN ]; -u8 addr3[ETH_ALEN ]; -u16 seq_ctl; -} __attribute__ ((packed)); - -struct ieee80211_hdr_3addrqos { -u16 frame_ctl; -u16 duration_id; -u8 addr1[ETH_ALEN ]; -u8 addr2[ETH_ALEN ]; -u8 addr3[ETH_ALEN ]; -u16 seq_ctl; -u16 qos_ctl; -} __attribute__ ((packed)); - -enum eap_type { -EAP_PACKET =0 , -EAPOL_START , -EAPOL_LOGOFF , -EAPOL_KEY , -EAPOL_ENCAP_ASF_ALERT -}; - -static const char *eap_types[] = { - [EAP_PACKET ] ="EAP-Packet" , - [EAPOL_START ] ="EAPOL-Start" , - [EAPOL_LOGOFF ] ="EAPOL-Logoff" , - [EAPOL_KEY ] ="EAPOL-Key" , - [EAPOL_ENCAP_ASF_ALERT ] ="EAPOL-Encap-ASF-Alert" -}; - -static inline const char *eap_get_type (int type) -{ -return (type >=ARRAY_SIZE (eap_types)) ?"Unknown" : eap_types[type]; -} - -struct eapol { -u8 snap[6 ]; -u16 ethertype; -u8 version; -u8 type; -u16 length; -} __attribute__ ((packed)); -#define IEEE80211_3ADDR_LEN 24#define IEEE80211_4ADDR_LEN 30#define IEEE80211_FCS_LEN 4 +#define IEEE80211_HLEN IEEE80211_4ADDR_LEN +#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) +#define IEEE80211_MGMT_HDR_LEN 24 +#define IEEE80211_DATA_HDR3_LEN 24 +#define IEEE80211_DATA_HDR4_LEN 30#define MIN_FRAG_THRESHOLD 256U#define MAX_FRAG_THRESHOLD 2346U
@@ -249,6 +161,10 @@ do { if (ieee80211_debug_level & (level) #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)#endif /* CONFIG_IEEE80211_DEBUG */ +#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" +#define MAC_ARG (x) ((u8 *)(x))[0], ((u8 *)(x))[1], ((u8 *)(x))[2], \ + ((u8 *)(x))[3], ((u8 *)(x))[4], ((u8 *)(x))[5] +/* * To use the debug system; *
@@ -344,11 +260,6 @@ struct ieee80211_snap_hdr {#define WLAN_CAPABILITY_BSS (1<<0)#define WLAN_CAPABILITY_SHORT_SLOT (1<<10) -#define IEEE80211_MGMT_HDR_LEN 24 -#define IEEE80211_DATA_HDR3_LEN 24 -#define IEEE80211_DATA_HDR4_LEN 30 - -#define IEEE80211_STATMASK_SIGNAL (1<<0)#define IEEE80211_STATMASK_RSSI (1<<1)#define IEEE80211_STATMASK_NOISE (1<<2)
@@ -415,8 +326,25 @@ struct ieee80211_snap_hdr {#define IEEE80211_NUM_CCK_RATES 4#define IEEE80211_OFDM_SHIFT_MASK_A 4 +/* this is stolen and modified from the madwifi driver*/ +#define IEEE80211_FC0_TYPE_MASK 0x0c +#define IEEE80211_FC0_TYPE_DATA 0x08 +#define IEEE80211_FC0_SUBTYPE_MASK 0xB0 +#define IEEE80211_FC0_SUBTYPE_QOS 0x80 +#define IEEE80211_QOS_HAS_SEQ (fc) \ + (((fc) & (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == \ + (IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS)) +/* this is stolen from ipw2200 driver */ +#define IEEE_IBSS_MAC_HASH_SIZE 31 +struct ieee_ibss_seq { +u8 mac[ETH_ALEN ]; +u16 seq_num[17 ]; +u16 frag_num[17 ]; +unsigned long packet_time[17 ]; +struct list_head list; +};/* NOTE: This data is for statistical purposes; not all hardware provides this * information for frames received. Not setting these will not cause
@@ -475,26 +403,6 @@ struct ieee80211_stats {unsigned int rx_message_in_bad_msg_fragments; }; -struct ieee80211_softmac_stats { -unsigned int rx_ass_ok; -unsigned int rx_ass_err; -unsigned int rx_probe_rq; -unsigned int tx_probe_rs; -unsigned int tx_beacons; -unsigned int rx_auth_rq; -unsigned int rx_auth_rs_ok; -unsigned int rx_auth_rs_err; -unsigned int tx_auth_rq; -unsigned int no_auth_rs; -unsigned int no_ass_rs; -unsigned int tx_ass_rq; -unsigned int rx_ass_rq; -unsigned int tx_probe_rq; -unsigned int reassoc; -unsigned int swtxstop; -unsigned int swtxawake; -}; -struct ieee80211_device ;#include "ieee80211_crypt.h"
@@ -548,17 +456,6 @@ Total: 28-2340 bytes*/ -struct ieee80211_header_data { -u16 frame_ctl; -u16 duration_id; -u8 addr1[6 ]; -u8 addr2[6 ]; -u8 addr3[6 ]; -u16 seq_ctrl; -}; - -#define BEACON_PROBE_SSID_ID_POSITION 12 -/* Management Frame Information Element Types */ #define MFIE_TYPE_SSID 0#define MFIE_TYPE_RATES 1
@@ -574,20 +471,54 @@ struct ieee80211_header_data {#define MFIE_TYPE_RATES_EX 50#define MFIE_TYPE_GENERIC 221 -typedef enum -{ -COUNTRY_CODE_FCC =0 , -COUNTRY_CODE_IC =1 , -COUNTRY_CODE_ETSI =2 , -COUNTRY_CODE_SPAIN =3 , -COUNTRY_CODE_FRANCE =4 , -COUNTRY_CODE_MKK =5 , -COUNTRY_CODE_MKK1 =6 , -COUNTRY_CODE_ISRAEL =7 , -COUNTRY_CODE_TELEC =8 , -COUNTRY_CODE_GLOBAL_DOMAIN =9 , -COUNTRY_CODE_WORLD_WIDE_13_INDEX =10 -}country_code_type_t ; +struct ieee80211_header_data { +u16 frame_ctl; +u16 duration_id; +u8 addr1[6 ]; +u8 addr2[6 ]; +u8 addr3[6 ]; +u16 seq_ctrl; +}; + +struct ieee80211_hdr_3addr { +u16 frame_ctl; +u16 duration_id; +u8 addr1[ETH_ALEN ]; +u8 addr2[ETH_ALEN ]; +u8 addr3[ETH_ALEN ]; +u16 seq_ctl; +} __attribute__ ((packed)); + +struct ieee80211_hdr_4addr { +u16 frame_ctl; +u16 duration_id; +u8 addr1[ETH_ALEN ]; +u8 addr2[ETH_ALEN ]; +u8 addr3[ETH_ALEN ]; +u16 seq_ctl; +u8 addr4[ETH_ALEN ]; +} __attribute__ ((packed)); + +struct ieee80211_hdr_3addrqos { +u16 frame_ctl; +u16 duration_id; +u8 addr1[ETH_ALEN ]; +u8 addr2[ETH_ALEN ]; +u8 addr3[ETH_ALEN ]; +u16 seq_ctl; +u16 qos_ctl; +} __attribute__ ((packed)); + +struct ieee80211_hdr_4addrqos { +u16 frame_ctl; +u16 duration_id; +u8 addr1[ETH_ALEN ]; +u8 addr2[ETH_ALEN ]; +u8 addr3[ETH_ALEN ]; +u16 seq_ctl; +u8 addr4[ETH_ALEN ]; +u16 qos_ctl; +} __attribute__ ((packed));struct ieee80211_info_element_hdr {u8 id;
@@ -600,26 +531,6 @@ struct ieee80211_info_element {u8 data[0 ]; } __attribute__ ((packed)); -/* -* These are the data types that can make up management packets -* -u16 auth_algorithm; -u16 auth_sequence; -u16 beacon_interval; -u16 capability; -u8 current_ap[ETH_ALEN]; -u16 listen_interval; -struct { -u16 association_id:14, reserved:2; -} __attribute__ ((packed)); -u32 time_stamp[2]; -u16 reason; -u16 status; -*/ - -#define IEEE80211_DEFAULT_TX_ESSID "Penguin" -#define IEEE80211_DEFAULT_BASIC_RATE 10 -struct ieee80211_authentication {struct ieee80211_header_data header;u16 algorithm;
@@ -628,6 +539,15 @@ struct ieee80211_authentication {//struct ieee80211_info_element_hdr info_element; } __attribute__ ((packed)); +struct ieee80211_disassoc_frame { +struct ieee80211_hdr_3addr header; +u16 reasoncode; +} __attribute__ ((packed)); + +struct ieee80211_probe_request { +struct ieee80211_header_data header; +/* struct ieee80211_info_element info_element; */ +} __attribute__ ((packed));struct ieee80211_probe_response {struct ieee80211_header_data header;
@@ -637,11 +557,6 @@ struct ieee80211_probe_response {struct ieee80211_info_element info_element; } __attribute__ ((packed)); -struct ieee80211_probe_request { -struct ieee80211_header_data header; -/*struct ieee80211_info_element info_element;*/ -} __attribute__ ((packed)); -struct ieee80211_assoc_request_frame {struct ieee80211_hdr_3addr header;u16 capability;
@@ -658,11 +573,6 @@ struct ieee80211_assoc_response_frame {struct ieee80211_info_element info_element;/* supported rates */ } __attribute__ ((packed)); -struct ieee80211_disassoc_frame { -struct ieee80211_hdr_3addr header; -u16 reasoncode; -}__attribute__ ((packed)); -struct ieee80211_txb {u8 nr_frags;u8 encrypted;
@@ -672,6 +582,32 @@ struct ieee80211_txb {struct sk_buff *fragments[0 ]; }; +/* SWEEP TABLE ENTRIES NUMBER */ +#define MAX_SWEEP_TAB_ENTRIES 42 +#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 + +/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs +* only use 8, and then use extended rates for the remaining supported +* rates. Other APs, however, stick all of their supported rates on the +* main rates information element... */ +#define MAX_RATES_LENGTH ((u8)12) +#define MAX_RATES_EX_LENGTH ((u8)16) + +#define MAX_NETWORK_COUNT 128 + +#define MAX_CHANNEL_NUMBER 165 + +#define IEEE80211_SOFTMAC_SCAN_TIME 100/* (HZ / 2) */ +#define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2) + +#define CRC_LENGTH 4U + +#define MAX_WPA_IE_LEN 64 + +#define NETWORK_EMPTY_ESSID (1 << 0) +#define NETWORK_HAS_OFDM (1 << 1) +#define NETWORK_HAS_CCK (1 << 2) +struct ieee80211_wmm_ac_param {u8 ac_aci_acm_aifsn;u8 ac_ecwmin_ecwmax;
@@ -703,23 +639,82 @@ struct ieee80211_wmm_tspec_elem {u16 medium_time; }__attribute__((packed)); +enum eap_type { +EAP_PACKET =0 , +EAPOL_START , +EAPOL_LOGOFF , +EAPOL_KEY , +EAPOL_ENCAP_ASF_ALERT +}; + +static const char *eap_types[] = { + [EAP_PACKET ] ="EAP-Packet" , + [EAPOL_START ] ="EAPOL-Start" , + [EAPOL_LOGOFF ] ="EAPOL-Logoff" , + [EAPOL_KEY ] ="EAPOL-Key" , + [EAPOL_ENCAP_ASF_ALERT ] ="EAPOL-Encap-ASF-Alert" +}; + +static inline const char *eap_get_type (int type) +{ +return (type >=ARRAY_SIZE (eap_types)) ?"Unknown" : eap_types[type]; +} + +struct eapol { +u8 snap[6 ]; +u16 ethertype; +u8 version; +u8 type; +u16 length; +} __attribute__ ((packed)); + +struct ieee80211_softmac_stats { +unsigned int rx_ass_ok; +unsigned int rx_ass_err; +unsigned int rx_probe_rq; +unsigned int tx_probe_rs; +unsigned int tx_beacons; +unsigned int rx_auth_rq; +unsigned int rx_auth_rs_ok; +unsigned int rx_auth_rs_err; +unsigned int tx_auth_rq; +unsigned int no_auth_rs; +unsigned int no_ass_rs; +unsigned int tx_ass_rq; +unsigned int rx_ass_rq; +unsigned int tx_probe_rq; +unsigned int reassoc; +unsigned int swtxstop; +unsigned int swtxawake; +}; + +#define BEACON_PROBE_SSID_ID_POSITION 12 + +/* +* These are the data types that can make up management packets +* +u16 auth_algorithm; +u16 auth_sequence; +u16 beacon_interval; +u16 capability; +u8 current_ap[ETH_ALEN]; +u16 listen_interval; +struct { +u16 association_id:14, reserved:2; +} __attribute__ ((packed)); +u32 time_stamp[2]; +u16 reason; +u16 status; +*/ + +#define IEEE80211_DEFAULT_TX_ESSID "Penguin" +#define IEEE80211_DEFAULT_BASIC_RATE 10 +enum {WMM_all_frame, WMM_two_frame, WMM_four_frame, WMM_six_frame};#define MAX_SP_Len (WMM_all_frame << 4)#define IEEE80211_QOS_TID 0x0f#define QOS_CTL_NOTCONTAIN_ACK (0x01 << 5) -/* SWEEP TABLE ENTRIES NUMBER*/ -#define MAX_SWEEP_TAB_ENTRIES 42 -#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 -/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs -* only use 8, and then use extended rates for the remaining supported -* rates. Other APs, however, stick all of their supported rates on the -* main rates information element... */ -#define MAX_RATES_LENGTH ((u8)12) -#define MAX_RATES_EX_LENGTH ((u8)16) -#define MAX_NETWORK_COUNT 128 -//#define MAX_CHANNEL_NUMBER 161 -#define MAX_CHANNEL_NUMBER 165 //YJ,modified,080625#define MAX_IE_LEN 0xFF //+YJ,080625 typedef struct _CHANNEL_LIST{
@@ -727,23 +722,12 @@ typedef struct _CHANNEL_LIST{u8 Len; }CHANNEL_LIST , *PCHANNEL_LIST ; -#define IEEE80211_SOFTMAC_SCAN_TIME 100//400 -//(HZ / 2) //by amy for ps #define IEEE80211_WATCH_DOG_TIME 2000//by amy for ps //by amy for antenna #define ANTENNA_DIVERSITY_TIMER_PERIOD 1000 // 1000 m//by amy for antenna -#define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2) - -#define CRC_LENGTH 4U - -#define MAX_WPA_IE_LEN 64 - -#define NETWORK_EMPTY_ESSID (1<<0) -#define NETWORK_HAS_OFDM (1<<1) -#define NETWORK_HAS_CCK (1<<2)#define IEEE80211_DTIM_MBCAST 4#define IEEE80211_DTIM_UCAST 2
@@ -882,8 +866,6 @@ enum ieee80211_state {#define DEFAULT_MAX_SCAN_AGE (15 * HZ)#define DEFAULT_FTS 2346 -#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" -#define MAC_ARG (x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]#define CFG_IEEE80211_RESERVE_FCS (1<<0)#define CFG_IEEE80211_COMPUTE_FCS (1<<1)
@@ -893,6 +875,19 @@ typedef struct tx_pending_t{struct ieee80211_txb *txb; }tx_pending_t; +enum { +COUNTRY_CODE_FCC =0 , +COUNTRY_CODE_IC =1 , +COUNTRY_CODE_ETSI =2 , +COUNTRY_CODE_SPAIN =3 , +COUNTRY_CODE_FRANCE =4 , +COUNTRY_CODE_MKK =5 , +COUNTRY_CODE_MKK1 =6 , +COUNTRY_CODE_ISRAEL =7 , +COUNTRY_CODE_TELEC =8 , +COUNTRY_CODE_GLOBAL_DOMAIN =9 , +COUNTRY_CODE_WORLD_WIDE_13_INDEX =10 +};struct ieee80211_device {struct net_device *dev;
PATCH 10/10 Staging: rtl8187se/ieee80211: convert MMIE_TYPE_* defines to enums
In reply to Bartlomiej ZolnierkiewiczFrom: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] Staging: rtl8187se/ieee80211: convert MMIE_TYPE_* defines to enums
--- drivers/staging/rtl8187se/ieee80211/ieee80211.h | 28 ++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-)
drivers/staging/rtl8187se/ieee80211/ieee80211.h +15 -13
@@ -457,19 +457,21 @@ Total: 28-2340 bytes*/ /* Management Frame Information Element Types */ -#define MFIE_TYPE_SSID 0 -#define MFIE_TYPE_RATES 1 -#define MFIE_TYPE_FH_SET 2 -#define MFIE_TYPE_DS_SET 3 -#define MFIE_TYPE_CF_SET 4 -#define MFIE_TYPE_TIM 5 -#define MFIE_TYPE_IBSS_SET 6 -#define MFIE_TYPE_COUNTRY 7 //+YJ,080625 -#define MFIE_TYPE_CHALLENGE 16 -#define MFIE_TYPE_ERP 42 -#define MFIE_TYPE_RSN 48 -#define MFIE_TYPE_RATES_EX 50 -#define MFIE_TYPE_GENERIC 221 +enum { +MFIE_TYPE_SSID =0 , +MFIE_TYPE_RATES =1 , +MFIE_TYPE_FH_SET =2 , +MFIE_TYPE_DS_SET =3 , +MFIE_TYPE_CF_SET =4 , +MFIE_TYPE_TIM =5 , +MFIE_TYPE_IBSS_SET =6 , +MFIE_TYPE_COUNTRY =7 , +MFIE_TYPE_CHALLENGE =16 , +MFIE_TYPE_ERP =42 , +MFIE_TYPE_RSN =48 , +MFIE_TYPE_RATES_EX =50 , +MFIE_TYPE_GENERIC =221 , +};struct ieee80211_header_data {u16 frame_ctl;