hostap: fix sparse warnings
PATCH 1/5 hostap: fix sparse warnings
Rewrite AID calculation in handle_pspoll() to avoid truncating bits. Make hostap_80211_header_parse() static, don't export it. Avoid shadowing variables.
---
drivers/net/wireless/hostap/hostap_ap.c | 2 +- drivers/net/wireless/hostap/hostap_cs.c | 8 ++++---- drivers/net/wireless/hostap/hostap_hw.c | 10 +++++----- drivers/net/wireless/hostap/hostap_main.c | 5 ++--- 4 files changed, 12 insertions(+), 13 deletions(-)
drivers/net/wireless/hostap/hostap_ap.c +1 -1
@@ -1930,7 +1930,7 @@ static void handle_pspoll(local_info_t *local,PDEBUG (DEBUG_PS ," PSPOLL and AID[15:14] not set\n" );return ; } - aid &= ~BIT (15 ) & ~BIT (14 ); + aid &= ~(BIT (15 ) |BIT (14 ));if (aid ==0 || aid >MAX_AID_TABLE_SIZE ) {PDEBUG (DEBUG_PS ," invalid aid=%d\n" , aid);return ;
drivers/net/wireless/hostap/hostap_cs.c +4 -4
@@ -533,10 +533,10 @@ static void prism2_detach(struct pcmcia_device *link) do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)#define CFG_CHECK2 (fn, retf) \ -do { int ret = (retf); \ -if (ret != 0) { \ - PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", ret); \ - cs_error(link, fn, ret); \ +do { int _ret = (retf); \ +if (_ret != 0) { \ + PDEBUG(DEBUG_EXTRA, "CardServices(" #fn ") returned %d\n", _ret); \ + cs_error(link, fn, _ret); \ goto next_entry; \ } \ } while (0)
drivers/net/wireless/hostap/hostap_hw.c +5 -5
@@ -2835,7 +2835,7 @@ static void hostap_passive_scan(unsigned long data) {local_info_t *local = (local_info_t *) data;struct net_device *dev = local->dev; -u16 channel; +u16 chan;if (local->passive_scan_interval <=0 )return ;
@@ -2872,11 +2872,11 @@ static void hostap_passive_scan(unsigned long data)printk (KERN_DEBUG "%s: passive scan channel %d\n" , dev->name, local->passive_scan_channel); - channel = local->passive_scan_channel; + chan = local->passive_scan_channel; local->passive_scan_state =PASSIVE_SCAN_WAIT ; local->passive_scan_timer.expires = jiffies +HZ /10 ; }else { - channel = local->channel; + chan = local->channel; local->passive_scan_state =PASSIVE_SCAN_LISTEN ; local->passive_scan_timer.expires = jiffies + local->passive_scan_interval *HZ ;
@@ -2884,9 +2884,9 @@ static void hostap_passive_scan(unsigned long data)if (hfa384x_cmd_callback (dev,HFA384X_CMDCODE_TEST | (HFA384X_TEST_CHANGE_CHANNEL <<8 ), - channel,NULL ,0 )) + chan,NULL ,0 ))printk (KERN_ERR "%s: passive scan channel set %d " -"failed\n" , dev->name, channel); +"failed\n" , dev->name, chan);add_timer (&local->passive_scan_timer); }
drivers/net/wireless/hostap/hostap_main.c +2 -3
@@ -594,7 +594,8 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx) } -int hostap_80211_header_parse (const struct sk_buff *skb,unsigned char *haddr) +static int hostap_80211_header_parse (const struct sk_buff *skb, +unsigned char *haddr) {struct hostap_interface *iface =netdev_priv (skb->dev);local_info_t *local = iface->local;
@@ -851,7 +852,6 @@ const struct header_ops hostap_80211_ops = { .rebuild = eth_rebuild_header, .cache = eth_header_cache, .cache_update = eth_header_cache_update, - .parse = hostap_80211_header_parse, };EXPORT_SYMBOL (hostap_80211_ops);
@@ -1144,7 +1144,6 @@ EXPORT_SYMBOL(hostap_set_roaming);EXPORT_SYMBOL (hostap_set_auth_algs);EXPORT_SYMBOL (hostap_dump_rx_header);EXPORT_SYMBOL (hostap_dump_tx_header); -EXPORT_SYMBOL (hostap_80211_header_parse);EXPORT_SYMBOL (hostap_80211_get_hdrlen);EXPORT_SYMBOL (hostap_get_stats);EXPORT_SYMBOL (hostap_setup_dev);
PATCH 2/5 hostap: fix references to 8802.11
802.11 is meant in all cases. The section numbers match the actual 802.11 standard.
---
drivers/net/wireless/hostap/hostap_ap.c | 8 ++++---- drivers/net/wireless/hostap/hostap_ap.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/hostap/hostap_ap.c +4 -4
@@ -9,11 +9,11 @@* * AP: FIX: * - if unicast Class 2 (assoc,reassoc,disassoc) frame received from -* unauthenticated STA, send deauth. frame (8802.11: 5.5) +* unauthenticated STA, send deauth. frame (802.11: 5.5) * - if unicast Class 3 (data with to/from DS,deauth,pspoll) frame received -* from authenticated, but unassoc STA, send disassoc frame (8802.11: 5.5) +* from authenticated, but unassoc STA, send disassoc frame (802.11: 5.5) * - if unicast Class 3 received from unauthenticated STA, send deauth. frame -* (8802.11: 5.5) +* (802.11: 5.5) */ #include <linux/proc_fs.h>
@@ -1956,7 +1956,7 @@ static void handle_pspoll(local_info_t *local,/* FIX: todo: * - add timeout for buffering (clear aid in TIM vector if buffer timed * out (expiry time must be longer than ListenInterval for -* the corresponding STA; "8802-11: 11.2.1.9 AP aging function" +* the corresponding STA; "802.11: 11.2.1.9 AP aging function" * - what to do, if buffered, pspolled, and sent frame is not ACKed by * sta; store buffer for later use and leave TIM aid bit set? use * TX event to check whether frame was ACKed?
drivers/net/wireless/hostap/hostap_ap.h +1 -1
@@ -103,7 +103,7 @@ struct sta_info {#define MAX_STA_COUNT 1024/* Maximum number of AIDs to use for STAs; must be 2007 or lower -* (8802.11 limitation) */ +* (802.11 limitation) */ #define MAX_AID_TABLE_SIZE 128#define STA_HASH_SIZE 256
Re: [PATCH 2/5] hostap: fix references to 8802.11
Quoted 2 lines · Pavel Roskin
802.11 is meant in all cases. The section numbers match the actual 802.11 standard.
Actually, 8802.11 was referring to ISO/IEC 8802-11, not IEEE 802.11.. Anyway, I do not have anything against changing this to refer to the IEEE standard instead of ISO version of it.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
PATCH 3/5 hostap: remove private "monitor" ioctl
In reply to Pavel RoskinThis is an ioctl obsoleted by the monitor mode years ago. Using it would trigger a deprecation warning. As the wireless drivers standardize on the radiotap standard, the "monitor" ioctl cannot be preserved to work as obsolete software expects.
---
drivers/net/wireless/hostap/hostap_common.h | 2 + drivers/net/wireless/hostap/hostap_ioctl.c | 53 --------------------------- 2 files changed, 1 insertions(+), 54 deletions(-)
drivers/net/wireless/hostap/hostap_common.h +1 -1
@@ -239,7 +239,7 @@ struct hfa384x_comms_quality {#define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1)#define PRISM2_IOCTL_WRITEMIF (SIOCIWFIRSTPRIV + 2)#define PRISM2_IOCTL_READMIF (SIOCIWFIRSTPRIV + 3) -#define PRISM2_IOCTL_MONITOR (SIOCIWFIRSTPRIV + 4) +/* #define PRISM2_IOCTL_MONITOR (SIOCIWFIRSTPRIV + 4) */ #define PRISM2_IOCTL_RESET (SIOCIWFIRSTPRIV + 6)#define PRISM2_IOCTL_INQUIRE (SIOCIWFIRSTPRIV + 8)#define PRISM2_IOCTL_WDS_ADD (SIOCIWFIRSTPRIV + 10)
drivers/net/wireless/hostap/hostap_ioctl.c +0 -53
71 lines not on this page · raw message
Re: [PATCH 3/5] hostap: remove private "monitor" ioctl
Quoted 4 lines · Pavel Roskin
This is an ioctl obsoleted by the monitor mode years ago. Using it would trigger a deprecation warning. As the wireless drivers standardize on the radiotap standard, the "monitor" ioctl cannot be preserved to work as obsolete software expects.
I don't follow the login here... Why "cannot be preserved"? I might go with "we do not want to preserve this", but I do not see any technical reason that would prevent us from supporting existing user space interface that has been used in the past and may still be in use. Since this may break existing user space programs, I do not think this should go in. Obviously, same goes for removal of the actual use of this parameter and support for different header formats in patch 5/5. Adding support for radiotap format is of course reasonable, but I would be more careful with removing existing functionality which may still be in use.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Re: [PATCH 3/5] hostap: remove private "monitor" ioctl
Quoted 10 lines · Jouni Malinen
Quoted 4 lines · Pavel Roskin
This is an ioctl obsoleted by the monitor mode years ago. Using it would trigger a deprecation warning. As the wireless drivers standardize on the radiotap standard, the "monitor" ioctl cannot be preserved to work as obsolete software expects.
I don't follow the login here... Why "cannot be preserved"? I might go with "we do not want to preserve this", but I do not see any technical reason that would prevent us from supporting existing user space interface that has been used in the past and may still be in use.
The old ioctl was supporting bare 802.11, prism and AVS headers. I want to replace all three of them with radiotap. I had to leave bare 802.11 support for the AP interface (wlan0ap) for hostapd compatibility, but the main interface should only support radiotap.
Suppose we want to support the old ioctl. All three types of headers that could be requested are going away now. Can we expect the software that doesn't know of "iwconfig mode monitor" to know radiotap headers? I don't think so.
Quoted 6 lines
Since
this may break existing user space programs, I do not think this should go in. Obviously, same goes for removal of the actual use of this parameter and support for different header formats in patch 5/5. Adding support for radiotap format is of course reasonable, but I would be more careful with removing existing functionality which may still be in use.
OK, if that's what you prefer, I can do it.
Signature · 2 lines
Regards, Pavel Roskin
Re: [PATCH 3/5] hostap: remove private "monitor" ioctl
Quoted 9 lines · Pavel Roskin
The old ioctl was supporting bare 802.11, prism and AVS headers. I want to replace all three of them with radiotap. I had to leave bare 802.11 support for the AP interface (wlan0ap) for hostapd compatibility, but the main interface should only support radiotap.
Suppose we want to support the old ioctl. All three types of headers that could be requested are going away now. Can we expect the software that doesn't know of "iwconfig mode monitor" to know radiotap headers? I don't think so.
Where is this "are going away now" statement coming from? I see no technical reason for this apart from simplifying the implementation.
Quoted 7 lines
Quoted 5 lines
this may break existing user space programs, I do not think this should go in. Obviously, same goes for removal of the actual use of this parameter and support for different header formats in patch 5/5. Adding support for radiotap format is of course reasonable, but I would be more careful with removing existing functionality which may still be in use.
OK, if that's what you prefer, I can do it.
I'm not strongly against replacing the old formats with radiotap, but I just do not follow the logic given as reasons for doing this as a simple replacement instead of doing it in steps (add radiotap now; remove deprecated formats later).
I do not know how common user space programs that do not support radiotap, but would support one (or more) of the old formats (and similarly for the private ioctl vs. generic mode ioctl). If these kinds of cases are very rare, I could see better justification for simple replacement. If such programs are still in active use in systems that could be expected to upgrade to the new kernel version, there is much more justification to keep the old formats available and just make it clearer that they are deprecated and will be removed at a certain point in the future.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
PATCH 4/5 hostap: don't report useless WDS frames by default
In reply to Pavel RoskinDEBUG_EXTRA is reported to the kernel log by default, but DEBUG_EXTRA2 is not. Unrelated WDS frames pollute the log unnecessarily.
---
drivers/net/wireless/hostap/hostap_80211_rx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/hostap/hostap_80211_rx.c +1 -1
@@ -551,7 +551,7 @@ hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr, hdr->addr1[2] != 0xff || hdr->addr1[3] != 0xff || hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) {/* RA (or BSSID) is not ours - drop */ - PDEBUG(DEBUG_EXTRA, "%s: received WDS frame with " + PDEBUG(DEBUG_EXTRA2, "%s: received WDS frame with " "not own or broadcast %s=%s\n", local->dev->name, fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID",
PATCH 5/5 hostap: add radiotap support, always use it in monitor mode
In reply to Pavel RoskinProvide MAC time, rate, channel, signal and noise. Remove "monitor_type" and "getmonitor_type" ioctl. Never add bogus CRC at the end, as radiotap aware software would never need it.
Keep support for "no header" for the master and AP devices. Simplify hostap_80211_header_parse(), as it's never used on interfaces in monitor mode.
---
drivers/net/wireless/hostap/hostap_80211_rx.c | 126 ++++++++----------------- drivers/net/wireless/hostap/hostap_common.h | 2 drivers/net/wireless/hostap/hostap_ioctl.c | 27 ----- drivers/net/wireless/hostap/hostap_main.c | 21 +--- drivers/net/wireless/hostap/hostap_wlan.h | 44 ++------- 5 files changed, 53 insertions(+), 167 deletions(-)
drivers/net/wireless/hostap/hostap_80211_rx.c +38 -88
@@ -54,35 +54,22 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb, } -/* Send RX frame to netif with 802.11 (and possible prism) header. +/* Send RX frame to netif with 802.11 and possibly radiotap header. * Called from hardware or software IRQ context. */ int prism2_rx_80211 (struct net_device *dev,struct sk_buff *skb,struct hostap_80211_rx_status *rx_stats,int type) {struct hostap_interface *iface;local_info_t *local; -int hdrlen, phdrlen, head_need, tail_need; +int hdrlen, rt_hdrlen;u16 fc; -int prism_header, ret; +int ret;struct ieee80211_hdr_4addr *hdr; iface =netdev_priv (dev); local = iface->local; dev->last_rx = jiffies; -if (dev->type ==ARPHRD_IEEE80211_PRISM ) { -if (local->monitor_type ==PRISM2_MONITOR_PRISM ) { - prism_header =1 ; - phdrlen =sizeof (struct linux_wlan_ng_prism_hdr ); - }else {/* local->monitor_type == PRISM2_MONITOR_CAPHDR */ - prism_header =2 ; - phdrlen =sizeof (struct linux_wlan_ng_cap_hdr ); - } - }else { - prism_header =0 ; - phdrlen =0 ; - } - hdr = (struct ieee80211_hdr_4addr *) skb->data; fc =le16_to_cpu (hdr->frame_ctl);
@@ -95,84 +82,47 @@ int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb, hdrlen =hostap_80211_get_hdrlen (fc); -/* check if there is enough room for extra data; if not, expand skb -* buffer to be large enough for the changes */ - head_need = phdrlen; - tail_need =0 ; -#ifdef PRISM2_ADD_BOGUS_CRC - tail_need +=4 ; -#endif /* PRISM2_ADD_BOGUS_CRC */ - - head_need -=skb_headroom (skb); - tail_need -=skb_tailroom (skb); - -if (head_need >0 || tail_need >0 ) { -if (pskb_expand_head (skb, head_need >0 ? head_need :0 , - tail_need >0 ? tail_need :0 , -GFP_ATOMIC )) { -printk (KERN_DEBUG "%s: prism2_rx_80211 failed to " -"reallocate skb buffer\n" , dev->name); -dev_kfree_skb_any (skb); -return 0 ; +if (dev->type ==ARPHRD_IEEE80211_RADIOTAP ) { +int head_need; +struct hostap_radiotap_rx *rt_hdr; + +/* if needed, expand skb buffer to accomodate radiotap header */ + rt_hdrlen =sizeof (struct hostap_radiotap_rx ); + head_need = rt_hdrlen -skb_headroom (skb); + +if (head_need >0 ) { +if (pskb_expand_head (skb, head_need,0 ,GFP_ATOMIC )) { +printk (KERN_DEBUG "%s: prism2_rx_80211 failed " +"to reallocate skb buffer\n" , dev->name); +dev_kfree_skb_any (skb); +return 0 ; + } } - } -/* We now have an skb with enough head and tail room, so just insert -* the extra data */ - -#ifdef PRISM2_ADD_BOGUS_CRC -memset (skb_put (skb,4 ),0xff ,4 );/* Prism2 strips CRC */ -#endif /* PRISM2_ADD_BOGUS_CRC */ - -if (prism_header ==1 ) { -struct linux_wlan_ng_prism_hdr *hdr; - hdr = (struct linux_wlan_ng_prism_hdr *) -skb_push (skb, phdrlen); -memset (hdr,0 , phdrlen); - hdr->msgcode =LWNG_CAP_DID_BASE ; - hdr->msglen =sizeof (*hdr); -memcpy (hdr->devname, dev->name,sizeof (hdr->devname)); -#define LWNG_SETVAL (f,i,s,l,d) \ -hdr->f.did = LWNG_CAP_DID_BASE | (i << 12); \ -hdr->f.status = s; hdr->f.len = l; hdr->f.data = d -LWNG_SETVAL (hosttime,1 ,0 ,4 , jiffies); -LWNG_SETVAL (mactime,2 ,0 ,4 , rx_stats->mac_time); -LWNG_SETVAL (channel,3 ,1 /* no value */ ,4 ,0 ); -LWNG_SETVAL (rssi,4 ,1 /* no value */ ,4 ,0 ); -LWNG_SETVAL (sq,5 ,1 /* no value */ ,4 ,0 ); -LWNG_SETVAL (signal,6 ,0 ,4 , rx_stats->signal); -LWNG_SETVAL (noise,7 ,0 ,4 , rx_stats->noise); -LWNG_SETVAL (rate,8 ,0 ,4 , rx_stats->rate /5 ); -LWNG_SETVAL (istx,9 ,0 ,4 ,0 ); -LWNG_SETVAL (frmlen,10 ,0 ,4 , skb->len - phdrlen); -#undef LWNG_SETVAL - }else if (prism_header ==2 ) { -struct linux_wlan_ng_cap_hdr *hdr; - hdr = (struct linux_wlan_ng_cap_hdr *) -skb_push (skb, phdrlen); -memset (hdr,0 , phdrlen); - hdr->version =htonl (LWNG_CAPHDR_VERSION ); - hdr->length =htonl (phdrlen); - hdr->mactime =__cpu_to_be64 (rx_stats->mac_time); - hdr->hosttime =__cpu_to_be64 (jiffies); - hdr->phytype =htonl (4 );/* dss_dot11_b */ - hdr->channel =htonl (local->channel); - hdr->datarate =htonl (rx_stats->rate); - hdr->antenna =htonl (0 );/* unknown */ - hdr->priority =htonl (0 );/* unknown */ - hdr->ssi_type =htonl (3 );/* raw */ - hdr->ssi_signal =htonl (rx_stats->signal); - hdr->ssi_noise =htonl (rx_stats->noise); - hdr->preamble =htonl (0 );/* unknown */ - hdr->encoding =htonl (1 );/* cck */ + rt_hdr = (struct hostap_radiotap_rx *)skb_push (skb, rt_hdrlen); +memset (rt_hdr,0 , rt_hdrlen); + rt_hdr->hdr.it_len =cpu_to_le16 (rt_hdrlen); + rt_hdr->hdr.it_present = +cpu_to_le32 ((1 <<IEEE80211_RADIOTAP_TSFT ) | + (1 <<IEEE80211_RADIOTAP_CHANNEL ) | + (1 <<IEEE80211_RADIOTAP_RATE ) | + (1 <<IEEE80211_RADIOTAP_DBM_ANTSIGNAL ) | + (1 <<IEEE80211_RADIOTAP_DBM_ANTNOISE )); + rt_hdr->tsft =cpu_to_le64 (rx_stats->mac_time); + rt_hdr->chan_freq =cpu_to_le16 (freq_list[local->channel -1 ]); + rt_hdr->chan_flags =cpu_to_le16 (IEEE80211_CHAN_CCK | +IEEE80211_CHAN_2GHZ ); + rt_hdr->rate = rx_stats->rate /5 ; + rt_hdr->dbm_antsignal = rx_stats->signal; + rt_hdr->dbm_antnoise = rx_stats->noise; + }else { + rt_hdrlen =0 ; } - ret = skb->len - phdrlen; + ret = skb->len - rt_hdrlen; skb->dev = dev;skb_reset_mac_header (skb); -skb_pull (skb, hdrlen); -if (prism_header) -skb_pull (skb, phdrlen); +skb_pull (skb, rt_hdrlen + hdrlen); skb->pkt_type =PACKET_OTHERHOST ; skb->protocol =__constant_htons (ETH_P_802_2 );memset (skb->cb,0 ,sizeof (skb->cb));
drivers/net/wireless/hostap/hostap_common.h +1 -1
@@ -283,7 +283,7 @@ enum {PRISM2_PARAM_IEEE_802_1X =23 ,PRISM2_PARAM_ANTSEL_TX =24 ,PRISM2_PARAM_ANTSEL_RX =25 , -PRISM2_PARAM_MONITOR_TYPE =26 , +/* PRISM2_PARAM_MONITOR_TYPE = 26, */ PRISM2_PARAM_WDS_TYPE =27 ,PRISM2_PARAM_HOSTSCAN =28 , PRISM2_PARAM_AP_SCAN = 29,
drivers/net/wireless/hostap/hostap_ioctl.c +1 -26
@@ -894,12 +894,7 @@ static void hostap_monitor_set_type(local_info_t *local)if (dev ==NULL )return ; -if (local->monitor_type ==PRISM2_MONITOR_PRISM || - local->monitor_type ==PRISM2_MONITOR_CAPHDR ) { - dev->type =ARPHRD_IEEE80211_PRISM ; - }else { - dev->type =ARPHRD_IEEE80211 ; - } + dev->type =ARPHRD_IEEE80211_RADIOTAP ; }
@@ -2247,10 +2242,6 @@ static const struct iw_priv_args prism2_priv[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "antsel_rx" }, {PRISM2_PARAM_ANTSEL_RX , 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getantsel_rx" }, - { PRISM2_PARAM_MONITOR_TYPE, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "monitor_type" }, - { PRISM2_PARAM_MONITOR_TYPE, - 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getmonitor_type" }, { PRISM2_PARAM_WDS_TYPE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "wds_type" }, { PRISM2_PARAM_WDS_TYPE,
@@ -2511,18 +2502,6 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,hostap_set_antsel (local);break ; -case PRISM2_PARAM_MONITOR_TYPE : -if (value !=PRISM2_MONITOR_80211 && - value !=PRISM2_MONITOR_CAPHDR && - value !=PRISM2_MONITOR_PRISM ) { - ret = -EINVAL ; -break ; - } - local->monitor_type = value; -if (local->iw_mode ==IW_MODE_MONITOR ) -hostap_monitor_set_type (local); -break ; -case PRISM2_PARAM_WDS_TYPE : local->wds_type = value;break ;
@@ -2789,10 +2768,6 @@ static int prism2_ioctl_priv_get_prism2_param(struct net_device *dev, *param = local->antsel_rx;break ; -case PRISM2_PARAM_MONITOR_TYPE : - *param = local->monitor_type; -break ; -case PRISM2_PARAM_WDS_TYPE : *param = local->wds_type;break ;
drivers/net/wireless/hostap/hostap_main.c +3 -18
@@ -597,25 +597,10 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)static int hostap_80211_header_parse (const struct sk_buff *skb,unsigned char *haddr) { -struct hostap_interface *iface =netdev_priv (skb->dev); -local_info_t *local = iface->local; - -if (local->monitor_type ==PRISM2_MONITOR_PRISM || - local->monitor_type ==PRISM2_MONITOR_CAPHDR ) { -const unsigned char *mac =skb_mac_header (skb); - -if (*(u32 *)mac ==LWNG_CAP_DID_BASE ) { -memcpy (haddr, - mac +sizeof (struct linux_wlan_ng_prism_hdr ) +10 , -ETH_ALEN );/* addr2 */ - }else {/* (*(u32 *)mac == htonl(LWNG_CAPHDR_VERSION)) */ -memcpy (haddr, - mac +sizeof (struct linux_wlan_ng_cap_hdr ) +10 , -ETH_ALEN );/* addr2 */ - } - }else -memcpy (haddr,skb_mac_header (skb) +10 ,ETH_ALEN );/* addr2 */ +struct ieee80211_hdr_4addr *hdr = + (struct ieee80211_hdr_4addr *)skb_mac_header (skb); +memcpy (haddr, hdr->addr2,ETH_ALEN );return ETH_ALEN ; }
drivers/net/wireless/hostap/hostap_wlan.h +10 -34
62 lines not on this page · raw message