d80211: pull request
Subsystems (2)
cover d80211: pull request
Please pull fromgit://git.kernel.org/pub/scm/linux/kernel/git/jbenc/dscape.git master to obtain following patches:
David Kimdon:
d80211: allow for large scan results
d80211: fix multiple device support
d80211: fix interface removal
Jiri Benc:
d80211: remove useless and wrong check for interface type
Johannes Berg:
d80211: relax sysfs permissions
d80211: master link
d80211: pointers as extended booleans
d80211: use kzalloc()
d80211: get rid of WME bitfield
d80211: get rid of sta_aid in favour of keeping track of TIM
d80211: clean up exports
d80211: clean up includes
d80211: fix some sparse warnings
d80211: make lowlevel TX framedump option visible
d80211: surface IBSS debug
d80211: get rid of MICHAEL_MIC_HWACCEL define
d80211: surface powersave debug switch
d80211: fix some documentation
Michael Buesch:
d80211: add ieee80211_stop_queues()
Michael Wu:
d80211: switch status codes, reason codes, and EIDs to enums
d80211: Group EIDs by standard, add remaining 802.11d EIDs
include/net/d80211.h | 144 ++++++++++++---------- include/net/d80211_mgmt.h | 158 ++++++++++++++---------- net/d80211/Kconfig | 26 ++++ net/d80211/aes_ccm.c | 3 net/d80211/aes_ccm.h | 2 net/d80211/fifo_qdisc.c | 5 - net/d80211/ieee80211.c | 276 +++++++++++++++++++++--------------------- net/d80211/ieee80211_i.h | 68 ++++++---- net/d80211/ieee80211_iface.c | 8 + net/d80211/ieee80211_ioctl.c | 79 ++++++------ net/d80211/ieee80211_key.h | 7 + net/d80211/ieee80211_scan.c | 12 +- net/d80211/ieee80211_sta.c | 113 ++++++++--------- net/d80211/ieee80211_sysfs.c | 6 - net/d80211/rate_control.c | 18 +-- net/d80211/rate_control.h | 2 net/d80211/sta_info.c | 31 ++--- net/d80211/sta_info.h | 14 +- net/d80211/tkip.c | 15 -- net/d80211/tkip.h | 1 net/d80211/wep.c | 14 +- net/d80211/wme.c | 24 ++-- net/d80211/wme.h | 25 ---- net/d80211/wpa.c | 17 --- 24 files changed, 537 insertions(+), 531 deletions(-)
Signature · 2 lines
Jiri Benc SUSE Labs
PATCH 1/21 d80211: relax sysfs permissions
From: Johannes Berg <[email protected]>
The sysfs attributes add_iface and remove_iface both check for CAP_NET_ADMIN whenever something is written. Hence, permissions for the files should be relaxed so that someone who is not root but happens to have CAP_NET_ADMIN can do things.
---
net/d80211/ieee80211_sysfs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
b8fa453a5bff1710a6e170e9d50fa337bee5ebdf
net/d80211/ieee80211_sysfs.c +2 -2
@@ -195,8 +195,8 @@ static ssize_t ieee80211_local_fmt_rate___IEEE80211_LOCAL_SHOW (rate_ctrl_alg);static struct class_device_attribute ieee80211_class_dev_attrs[] = { -__ATTR (add_iface,S_IWUSR ,NULL , store_add_iface), -__ATTR (remove_iface,S_IWUSR ,NULL , store_remove_iface), +__ATTR (add_iface,S_IWUGO ,NULL , store_add_iface), +__ATTR (remove_iface,S_IWUGO ,NULL , store_remove_iface),__ATTR (channel,S_IRUGO , ieee80211_local_show_channel,NULL ),__ATTR (frequency,S_IRUGO , ieee80211_local_show_frequency,NULL ),__ATTR (radar_detect,S_IRUGO , ieee80211_local_show_radar_detect,NULL ),
Signature · 1 line
1.3.0
PATCH 2/21 d80211: master link
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch adds a link from the wiphy to the master device in sysfs.
---
net/d80211/ieee80211.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
a648a95b7eb82496b6a2148105228cbc1724e2f1
net/d80211/ieee80211.c +9 -0
@@ -4462,6 +4462,11 @@ int ieee80211_register_hw(struct net_devrtnl_unlock (); goto fail_dev; } + result =sysfs_create_link (&local->class_dev.kobj, + &dev->class_dev.kobj, +"master" ); +if (result <0 ) + goto fail_masterlink; result =ieee80211_sysfs_add_netdevice (dev);rtnl_unlock ();if (result <0 )
@@ -4507,6 +4512,8 @@ fail_rate_attrs: fail_rate:ieee80211_sysfs_remove_netdevice (dev); fail_if_sysfs: +sysfs_remove_link (&local->class_dev.kobj,"master" ); +fail_masterlink:unregister_netdev (dev); fail_dev:sta_info_stop (local);
@@ -4563,6 +4570,8 @@ void ieee80211_unregister_hw(struct net_if (local->apdev)ieee80211_if_del_mgmt (local->apdev); +sysfs_remove_link (&local->class_dev.kobj,"master" ); +list_for_each_safe (ptr, n, &local->sub_if_list) {struct ieee80211_sub_if_data *sdata = list_entry(ptr, struct ieee80211_sub_if_data, list);
Signature · 1 line
1.3.0
PATCH 3/21 d80211: pointers as extended booleans
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This huge patch changes d80211 to treat pointers as "extended booleans", using "if (!ptr)" and "if (ptr)" instead of comparisons with NULL.
---
net/d80211/aes_ccm.c | 2 + net/d80211/ieee80211.c | 60 ++++++++++++++++------------------- net/d80211/ieee80211_iface.c | 6 ++-- net/d80211/ieee80211_ioctl.c | 48 ++++++++++++++-------------- net/d80211/ieee80211_scan.c | 10 +++--- net/d80211/ieee80211_sta.c | 72 ++++++++++++++++++++---------------------- net/d80211/rate_control.c | 8 ++--- net/d80211/rate_control.h | 2 + net/d80211/sta_info.c | 13 ++++---- net/d80211/wep.c | 12 ++++--- net/d80211/wme.c | 4 +- net/d80211/wpa.c | 2 + 12 files changed, 116 insertions(+), 123 deletions(-)
3ee6077477530a8082c8eb62de350c30f703e2a2
net/d80211/aes_ccm.c +1 -1
@@ -149,7 +149,7 @@ struct crypto_tfm * ieee80211_aes_key_sestruct crypto_tfm *tfm; tfm =crypto_alloc_tfm ("aes" ,0 ); -if (tfm ==NULL ) +if (!tfm)return NULL ;crypto_cipher_setkey (tfm, key,ALG_CCMP_KEY_LEN );
net/d80211/ieee80211.c +28 -32
206 lines not on this page · raw message
net/d80211/ieee80211_iface.c +3 -3
@@ -49,7 +49,7 @@ int ieee80211_if_add(struct net_device *ASSERT_RTNL (); ndev = *new_dev =alloc_netdev (sizeof (struct ieee80211_sub_if_data ),"" , ieee80211_if_setup); -if (ndev ==NULL ) +if (!ndev)return -ENOMEM ; ndev->ieee80211_ptr = local;
@@ -58,7 +58,7 @@ int ieee80211_if_add(struct net_device *do {sprintf (ndev->name,"%s.%d" , dev->name, i++); tmp_dev =dev_get_by_name (ndev->name); -if (tmp_dev ==NULL ) +if (!tmp_dev)break ;dev_put (tmp_dev); }while (i <10000 );
@@ -119,7 +119,7 @@ int ieee80211_if_add_mgmt(struct net_dev ndev =alloc_netdev (sizeof (struct ieee80211_sub_if_data ),"" , ieee80211_if_mgmt_setup); -if (ndev ==NULL ) +if (!ndev)return -ENOMEM ; ret =dev_alloc_name (ndev,"wmgmt%d" );if (ret)
net/d80211/ieee80211_ioctl.c +24 -24
187 lines not on this page · raw message
net/d80211/ieee80211_scan.c +5 -5
@@ -117,7 +117,7 @@ static void ieee80211_scan_start(structstruct ieee80211_channel *chan =NULL ;int ret; -if (local->hw->passive_scan ==0 ) { +if (!local->hw->passive_scan) {printk (KERN_DEBUG "%s: Scan handler called, yet the hardware " "does not support passive scanning. Disabled.\n" , dev->name);
@@ -136,7 +136,7 @@ static void ieee80211_scan_start(structreturn ; } -if (local->scan.skb ==NULL ) { +if (!local->scan.skb) {printk (KERN_DEBUG "%s: Scan start called even though scan.skb " "is not set\n" , dev->name); }
@@ -214,7 +214,7 @@ static void ieee80211_scan_stop(struct nstruct ieee80211_channel *chan;int wait; -if (local->hw->passive_scan ==NULL ) +if (!local->hw->passive_scan)return ;if (local->scan.mode_idx >= local->hw->num_modes) {
@@ -313,7 +313,7 @@ void ieee80211_init_scan(struct net_devi/* Create a CTS from for broadcasting before * the low level changes channels */ local->scan.skb =alloc_skb (len,GFP_KERNEL ); -if (local->scan.skb ==NULL ) { +if (!local->scan.skb) {printk (KERN_WARNING "%s: Failed to allocate CTS packet for " "passive scan\n" , dev->name);return ;
@@ -344,7 +344,7 @@ void ieee80211_stop_scan(struct net_devi {struct ieee80211_local *local = dev->ieee80211_ptr; -if (local->hw->passive_scan !=0 ) { +if (local->hw->passive_scan) {del_timer_sync (&local->scan.timer);dev_kfree_skb (local->scan.skb); local->scan.skb =NULL ;
net/d80211/ieee80211_sta.c +35 -37
266 lines not on this page · raw message
net/d80211/rate_control.c +4 -4
@@ -288,9 +288,9 @@ static void * rate_control_simple_alloc(struct global_rate_control *rctrl; rctrl =kmalloc (sizeof (*rctrl),GFP_ATOMIC ); -if (rctrl ==NULL ) { +if (!rctrl)return NULL ; - } +memset (rctrl,0 ,sizeof (*rctrl));return rctrl; }
@@ -313,9 +313,9 @@ static void * rate_control_simple_alloc_struct sta_rate_control *rctrl; rctrl =kmalloc (sizeof (*rctrl),GFP_ATOMIC ); -if (rctrl ==NULL ) { +if (!rctrl)return NULL ; - } +memset (rctrl,0 ,sizeof (*rctrl));return rctrl; }
net/d80211/rate_control.h +1 -1
@@ -101,7 +101,7 @@ static inline void * rate_control_alloc(static inline void rate_control_free (struct ieee80211_local *local) { -if (local->rate_ctrl ==NULL || local->rate_ctrl_priv ==NULL ) +if (!local->rate_ctrl || !local->rate_ctrl_priv)return ; local->rate_ctrl->free (local->rate_ctrl_priv); local->rate_ctrl_priv =NULL ;
net/d80211/sta_info.c +6 -7
@@ -38,17 +38,16 @@ static void sta_info_hash_del(struct ieestruct sta_info *s; s = local->sta_hash[STA_HASH (sta->addr)]; -if (s ==NULL ) +if (!s)return ;if (memcmp (s->addr, sta->addr,ETH_ALEN ) ==0 ) { local->sta_hash[STA_HASH (sta->addr)] = s->hnext;return ; } -while (s->hnext !=NULL && -memcmp (s->hnext->addr, sta->addr,ETH_ALEN ) !=0 ) +while (s->hnext &&memcmp (s->hnext->addr, sta->addr,ETH_ALEN ) !=0 ) s = s->hnext; -if (s->hnext !=NULL ) +if (s->hnext) s->hnext = s->hnext->hnext;else printk(KERN_ERR "%s: could not remove STA " MAC_FMT " from "
@@ -147,7 +146,7 @@ struct sta_info * sta_info_add(struct iekobject_init (&sta->kobj); sta->rate_ctrl_priv =rate_control_alloc_sta (local); -if (sta->rate_ctrl_priv ==NULL ) { +if (!sta->rate_ctrl_priv) {kobject_put (&sta->kobj);kfree (sta);return NULL ;
@@ -429,7 +428,7 @@ void sta_info_remove_aid_ptr(struct sta_ sdata->bss->sta_aid[sta->aid -1 ] =NULL ;if (sta->aid == sdata->bss->max_aid) {while (sdata->bss->max_aid >0 && - sdata->bss->sta_aid[sdata->bss->max_aid -1 ] ==NULL ) + !sdata->bss->sta_aid[sdata->bss->max_aid -1 ]) sdata->bss->max_aid--; } }
@@ -448,7 +447,7 @@ void sta_info_flush(struct ieee80211_loclist_for_each_safe (ptr, n, &local->sta_list) { struct sta_info *sta = list_entry(ptr, struct sta_info, list); -if (dev ==NULL || dev == sta->dev) +if (!dev || dev == sta->dev)sta_info_free (sta,1 ); }spin_unlock_bh (&local->sta_lock);
net/d80211/wep.c +6 -6
@@ -61,7 +61,7 @@ void ieee80211_wep_get_iv(struct ieee802if (ieee80211_wep_weak_iv (local->wep_iv, key->keylen)) local->wep_iv +=0x0100 ; -if (iv ==NULL ) +if (!iv)return ; *iv++ = (local->wep_iv >>16 ) &0xff ;
@@ -149,16 +149,16 @@ int ieee80211_wep_encrypt(struct ieee802u8 *rc4key, *iv;size_t len; -if (key ==NULL || key->alg !=ALG_WEP ) +if (!key || key->alg !=ALG_WEP )return -1 ; klen =3 + key->keylen; rc4key =kmalloc (klen,GFP_ATOMIC ); -if (rc4key ==NULL ) +if (!rc4key)return -1 ; iv =ieee80211_wep_add_iv (local, skb, key); -if (iv ==NULL ) { +if (!iv) {kfree (rc4key);return -1 ; }
@@ -239,13 +239,13 @@ int ieee80211_wep_decrypt(struct ieee802 keyidx = skb->data[hdrlen +3 ] >>6 ; -if (key ==NULL || keyidx != key->keyidx || key->alg !=ALG_WEP ) +if (!key || keyidx != key->keyidx || key->alg !=ALG_WEP )return -1 ; klen =3 + key->keylen; rc4key =kmalloc (klen,GFP_ATOMIC ); -if (rc4key ==NULL ) +if (!rc4key)return -1 ;/* Prepend 24-bit IV to RC4 key */
net/d80211/wme.c +2 -2
@@ -470,7 +470,7 @@ static int wme_classop_graft(struct Qdisif (queue >= hw->queues)return -EINVAL ; -if (new ==NULL ) +if (!new) new = &noop_qdisc;sch_tree_lock (qd);
@@ -660,7 +660,7 @@ void ieee80211_install_qdisc(struct net_struct Qdisc *qdisc; qdisc =qdisc_create_dflt (dev, &wme_qdisc_ops); -if (qdisc ==NULL ) { +if (!qdisc) {printk (KERN_ERR "%s: qdisc installation failed\n" , dev->name);return ; }
net/d80211/wpa.c +1 -1
@@ -260,7 +260,7 @@ #endif /* CONFIG_HOSTAPD_WPA_TESTING */struct ieee80211_hdr *hdr;union iwreq_data wrqu;char *buf =kmalloc (128 ,GFP_ATOMIC ); -if (buf ==NULL ) +if (!buf)break ;/* TODO: needed parameters: count, key type, TSC */
Signature · 1 line
1.3.0
PATCH 4/21 d80211: use kzalloc()
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This changes d80211 to use kzalloc() where applicable.
---
net/d80211/ieee80211.c | 7 ++----- net/d80211/rate_control.c | 10 ++-------- 2 files changed, 4 insertions(+), 13 deletions(-)
ce05baacb2a48dfc5f917c63fcb52537991bbb1a
net/d80211/ieee80211.c +2 -5
@@ -454,11 +454,9 @@ ieee80211_tx_h_fragment(struct ieee80211 per_fragm = frag_threshold - hdrlen -4 /* FCS */ ; num_fragm = (payload_len + per_fragm -1 ) / per_fragm; - frags = (struct sk_buff **) -kmalloc (num_fragm *sizeof (struct sk_buff *),GFP_ATOMIC ); + frags =kzalloc (num_fragm *sizeof (struct sk_buff *),GFP_ATOMIC );if (!frags) goto fail; -memset (frags,0 , num_fragm *sizeof (struct sk_buff *)); hdr->frame_control |=cpu_to_le16 (IEEE80211_FCTL_MOREFRAGS ); pos = first->data + hdrlen + per_fragm;
@@ -4714,11 +4712,10 @@ int ieee80211_rate_control_register(stru {struct rate_control_algs *alg; - alg =kmalloc (sizeof (*alg),GFP_KERNEL ); + alg =kzalloc (sizeof (*alg),GFP_KERNEL );if (!alg)return -1 ; -memset (alg,0 ,sizeof (*alg)); alg->next = ieee80211_rate_ctrl_algs; alg->ops = ops; ieee80211_rate_ctrl_algs = alg;
net/d80211/rate_control.c +2 -8
@@ -287,11 +287,8 @@ static void * rate_control_simple_alloc( {struct global_rate_control *rctrl; - rctrl =kmalloc (sizeof (*rctrl),GFP_ATOMIC ); -if (!rctrl) -return NULL ; + rctrl =kzalloc (sizeof (*rctrl),GFP_ATOMIC ); -memset (rctrl,0 ,sizeof (*rctrl));return rctrl; }
@@ -312,11 +309,8 @@ static void * rate_control_simple_alloc_ {struct sta_rate_control *rctrl; - rctrl =kmalloc (sizeof (*rctrl),GFP_ATOMIC ); -if (!rctrl) -return NULL ; + rctrl =kzalloc (sizeof (*rctrl),GFP_ATOMIC ); -memset (rctrl,0 ,sizeof (*rctrl));return rctrl; }
Signature · 1 line
1.3.0
PATCH 5/21 d80211: get rid of WME bitfield
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch gets rid of the endian-ness dependent bitfield used for WME. It cleans up wme includes and adds some necessary includes in other files that got them implicitly through wme.h
---
net/d80211/fifo_qdisc.c | 1 + net/d80211/ieee80211.c | 1 + net/d80211/wme.c | 18 ++++++++++-------- net/d80211/wme.h | 25 ++----------------------- 4 files changed, 14 insertions(+), 31 deletions(-)
94df2a4b3e67e47058b8f58b4705edb9ed7b447a
net/d80211/fifo_qdisc.c +1 -0
@@ -13,6 +13,7 @@#include <linux/config.h> #include <linux/version.h> #include <linux/netdevice.h> +#include <net/pkt_sched.h> #include <net/d80211.h> #include "ieee80211_i.h" #include "wme.h"
net/d80211/ieee80211.c +1 -0
@@ -18,6 +18,7 @@ #include <linux/skbuff.h>#include <linux/etherdevice.h> #include <linux/if_arp.h> #include <linux/wireless.h> +#include <linux/rtnetlink.h> #include <net/iw_handler.h> #include <linux/compiler.h>
net/d80211/wme.c +10 -8
@@ -12,7 +12,9 @@ #include <linux/netdevice.h>#include <linux/skbuff.h> #include <linux/module.h> #include <linux/if_arp.h> +#include <linux/types.h> #include <net/ip.h> +#include <net/pkt_sched.h> #include <net/d80211.h> #include "ieee80211_i.h"
@@ -246,15 +248,15 @@ static int wme_qdiscop_enqueue(struct sk/* now we know the 1d priority, fill in the QoS header if there is one */ if (WLAN_FC_IS_QOS_DATA (fc)) { -struct qos_control *qc = (struct qos_control *) - (skb->data +ieee80211_get_hdrlen (fc) -2 ); -u8 *p = (u8 *) qc; - *p++ =0 ;/* do this due to gcc's lack of optimization on -* bitfield ops */ - *p =0 ; - qc->tag1d = skb->priority; +u8 *p = skb->data +ieee80211_get_hdrlen (fc) -2 ; +u8 qos_hdr = skb->priority &QOS_CONTROL_TAG1D_MASK ;if (local->wifi_wme_noack_test) - qc->ack_policy =1 ; + qos_hdr |=QOS_CONTROL_ACK_POLICY_NOACK << +QOS_CONTROL_ACK_POLICY_SHIFT ; +/* qos header is 2 bytes, second reserved */ + *p = qos_hdr; + p++; + *p =0 ; }if (unlikely (queue >= local->hw->queues)) {
net/d80211/wme.h +2 -23
@@ -11,10 +11,8 @@#ifndef _WME_H#define _WME_H -#include <asm/byteorder.h> #include <linux/netdevice.h> -#include <linux/types.h> -#include <net/pkt_sched.h> +#include "ieee80211_i.h" #define QOS_CONTROL_LEN 2
@@ -24,26 +22,7 @@ #define QOS_CONTROL_ACK_POLICY_NOACK 1#define QOS_CONTROL_TID_MASK 0x0f#define QOS_CONTROL_ACK_POLICY_SHIFT 5 -/* This bit field structure should not be used; it can cause compiler to -* generate unaligned accesses and inefficient code. */ -struct qos_control { -#if defined(__LITTLE_ENDIAN_BITFIELD) -u8 tag1d:3 ,/* bits 0-2 */ - reserved1:1 , - eosp:1 , - ack_policy:2 , - reserved2:1 ; -#elif defined (__BIG_ENDIAN_BITFIELD) -u8 reserved2:1 , - ack_policy:2 , - eosp:1 , - reserved1:1 , - tag1d:3 ;/* bits 0-2 */ -#else -#error "Please fix <asm/byteorder.h>" -#endif -u8 reserved; -} __attribute__ ((packed)); +#define QOS_CONTROL_TAG1D_MASK 0x07ieee80211_txrx_result ieee80211_rx_h_parse_qos (struct ieee80211_txrx_data *rx);
Signature · 1 line
1.3.0
PATCH 6/21 d80211: get rid of sta_aid in favour of keeping track of TIM
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch gets rid of the HUGE sta_aid array that was there in the access point structure and instead keeps track of the TIM. Also reduces stack usage of the ieee80211_beacon_add_tim() function considerably, and fixes a bug where removing a station that had frames buffered wouldn't update the hardware TIM (if necessary).
It also removes the MAX_AID_TABLE_SIZE pseudo-configuration option (it was a define with a comment indicating it could be changed) since now having all AIDs available is no longer expensive.
---
include/net/d80211.h | 3 ++ net/d80211/ieee80211.c | 68 ++++++++++++++++++++++-------------------- net/d80211/ieee80211_i.h | 28 +++++++++++++---- net/d80211/ieee80211_ioctl.c | 6 +--- net/d80211/ieee80211_sysfs.c | 2 - net/d80211/sta_info.c | 15 ++++----- net/d80211/sta_info.h | 4 -- 7 files changed, 68 insertions(+), 58 deletions(-)
358fd4b6115683d3a8f88308268cfd6062c31f47
include/net/d80211.h +3 -0
@@ -967,8 +967,11 @@ #define IEEE80211_STYPE_QOS_CFPOLL 0x00#define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 +/* miscellaneous IEEE 802.11 constants */ #define IEEE80211_MAX_FRAG_THRESHOLD 2346#define IEEE80211_MAX_RTS_THRESHOLD 2347 +#define IEEE80211_MAX_AID 2007 +#define IEEE80211_MAX_TIM_LEN 251struct ieee80211_hdr {__le16 frame_control;
net/d80211/ieee80211.c +36 -32
131 lines not on this page · raw message
net/d80211/ieee80211_i.h +21 -7
@@ -18,6 +18,8 @@ #include <linux/list.h>#include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/workqueue.h> +#include <linux/types.h> +#include <linux/spinlock.h> #include "ieee80211_key.h" #include "sta_info.h"
@@ -211,13 +213,10 @@ struct ieee80211_if_ap {u8 *generic_elem;size_t generic_elem_len; -/* TODO: sta_aid could be replaced by 2008-bit large bitfield of -* that could be used in TIM element generation. This would also -* make TIM element generation a bit faster. */ -/* AID mapping to station data. NULL, if AID is free. AID is in the -* range 1..2007 and sta_aid[i] corresponds to AID i+1. */ -struct sta_info *sta_aid[MAX_AID_TABLE_SIZE ]; -int max_aid;/* largest aid currently in use */ +/* yes, this looks ugly, but guarantees that we can later use +* bitmap_empty :) +* NB: don't ever use set_bit, use bss_tim_set/bss_tim_clear! */ +u8 tim[sizeof (unsigned long ) *BITS_TO_LONGS (IEEE80211_MAX_AID +1 )];atomic_t num_sta_ps;/* number of stations in PS mode */ struct sk_buff_head ps_bc_buf;int dtim_period, dtim_count;
@@ -545,6 +544,21 @@ struct sta_attribute {ssize_t (*store)(struct sta_info *,const char *buf,size_t count); }; +static inline void bss_tim_set (struct ieee80211_local *local, +struct ieee80211_if_ap *bss,int aid) +{ +spin_lock (&local->sta_lock); + bss->tim[(aid)/8 ] |=1 <<((aid) %8 ); +spin_unlock (&local->sta_lock); +} + +static inline void bss_tim_clear (struct ieee80211_local *local, +struct ieee80211_if_ap *bss,int aid) +{ +spin_lock (&local->sta_lock); + bss->tim[(aid)/8 ] &= !(1 <<((aid) %8 )); +spin_unlock (&local->sta_lock); +}/* ieee80211.c */ void ieee80211_release_hw (struct ieee80211_local *local);
net/d80211/ieee80211_ioctl.c +1 -5
@@ -296,12 +296,8 @@ static int ieee80211_ioctl_add_sta(struc sta->flags |=WLAN_STA_AUTH |WLAN_STA_ASSOC ; sta->aid = param->u.add_sta.aid; -if (sta->aid >MAX_AID_TABLE_SIZE ) +if (sta->aid >IEEE80211_MAX_AID ) sta->aid =0 ; -if (sta->aid >0 && sdata->bss) - sdata->bss->sta_aid[sta->aid -1 ] = sta; -if (sdata->bss && sta->aid > sdata->bss->max_aid) - sdata->bss->max_aid = sta->aid; rates =0 ;for (i =0 ; i <sizeof (param->u.add_sta.supp_rates); i++) {
net/d80211/ieee80211_sysfs.c +0 -2
@@ -471,7 +471,6 @@ static ssize_t ieee80211_if_fmt_flags(co__IEEE80211_IF_SHOW (flags);/* AP attributes */ -IEEE80211_IF_SHOW (max_aid, u.ap.max_aid,DEC );IEEE80211_IF_SHOW (num_sta_ps, u.ap.num_sta_ps,ATOMIC );IEEE80211_IF_SHOW (dtim_period, u.ap.dtim_period,DEC );IEEE80211_IF_SHOW (dtim_count, u.ap.dtim_count,DEC );
@@ -549,7 +548,6 @@ static struct attribute *ieee80211_ap_at &class_device_attr_drop_unencrypted.attr, &class_device_attr_eapol.attr, &class_device_attr_ieee8021_x.attr, - &class_device_attr_max_aid.attr, &class_device_attr_num_sta_ps.attr, &class_device_attr_dtim_period.attr, &class_device_attr_dtim_count.attr,
net/d80211/sta_info.c +7 -8
@@ -421,16 +421,15 @@ void sta_info_remove_aid_ptr(struct sta_ {struct ieee80211_sub_if_data *sdata; - sdata =IEEE80211_DEV_TO_SUB_IF (sta->dev); -if (sta->aid <=0 || !sdata->bss) +if (sta->aid <=0 )return ; - sdata->bss->sta_aid[sta->aid -1 ] =NULL ; -if (sta->aid == sdata->bss->max_aid) { -while (sdata->bss->max_aid >0 && - !sdata->bss->sta_aid[sdata->bss->max_aid -1 ]) - sdata->bss->max_aid--; - } + sdata =IEEE80211_DEV_TO_SUB_IF (sta->dev); + +if (sdata->local->hw->set_tim) + sdata->local->hw->set_tim (sta->dev, sta->aid,0 ); +if (sdata->bss) +bss_tim_clear (sdata->local, sdata->bss, sta->aid); }
net/d80211/sta_info.h +0 -4
@@ -114,10 +114,6 @@ #endif /* CONFIG_D80211_DEBUG_COUNTERS */* Maximum number of concurrently registered stations */ #define MAX_STA_COUNT 2007 -/* Maximum number of AIDs to use for STAs; must be 2007 or lower -* (IEEE 802.11 beacon format limitation) */ -#define MAX_AID_TABLE_SIZE 2007 -#define STA_HASH_SIZE 256#define STA_HASH (sta) (sta[5])
Signature · 1 line
1.3.0
PATCH 7/21 d80211: clean up exports
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This puts all EXPORT_SYMBOL() macros along with the function being exported.
---
net/d80211/ieee80211.c | 69 +++++++++++++++++------------------------------- net/d80211/sta_info.c | 2 + 2 files changed, 27 insertions(+), 44 deletions(-)
d7d4b1971ecdd40b8a0b210ddd06d9d8ac972255
net/d80211/ieee80211.c +25 -44
@@ -270,7 +270,7 @@ int ieee80211_get_hdrlen(u16 fc)return hdrlen; } - +EXPORT_SYMBOL (ieee80211_get_hdrlen);int ieee80211_get_hdrlen_from_skb (struct sk_buff *skb) {
@@ -284,7 +284,7 @@ int ieee80211_get_hdrlen_from_skb(structreturn 0 ;return hdrlen; } - +EXPORT_SYMBOL (ieee80211_get_hdrlen_from_skb);#ifdef IEEE80211_VERBOSE_DEBUG_FRAME_DUMP static void ieee80211_dump_frame(const char *ifname, const char *title,
@@ -1827,7 +1827,7 @@ #endif /* CONFIG_D80211_VERBOSE_DEBUG */ ap->num_beacons++;return skb; } - +EXPORT_SYMBOL (ieee80211_beacon_get);struct sk_buff * ieee80211_get_buffered_bc(struct net_device *dev, int if_id,
@@ -1893,6 +1893,7 @@ ieee80211_get_buffered_bc(struct net_devreturn skb; } +EXPORT_SYMBOL (ieee80211_get_buffered_bc);static int __ieee80211_if_config (struct net_device *dev,struct sk_buff *beacon)
@@ -1977,7 +1978,7 @@ struct ieee80211_conf *ieee80211_get_hw_struct ieee80211_local *local = dev->ieee80211_ptr;return &local->conf; } - +EXPORT_SYMBOL (ieee80211_get_hw_conf);static int ieee80211_change_mtu (struct net_device *dev,int new_mtu) {
@@ -2108,6 +2109,7 @@ struct dev_mc_list *ieee80211_get_mc_lis *ptr = sdata;return mc; } +EXPORT_SYMBOL (ieee80211_get_mc_list_item);static struct net_device_stats *ieee80211_get_stats (struct net_device *dev) {
@@ -2655,7 +2657,7 @@ int ieee80211_radar_status(struct net_deieee80211_rx_mgmt (dev, skb,0 , ieee80211_msg_radar);return 0 ; } - +EXPORT_SYMBOL (ieee80211_radar_status);int ieee80211_set_aid_for_sta (struct net_device *dev,u8 *peer_address,u16 aid)
@@ -2678,7 +2680,7 @@ int ieee80211_set_aid_for_sta(struct netieee80211_rx_mgmt (dev, skb,0 , ieee80211_msg_set_aid_for_sta);return 0 ; } - +EXPORT_SYMBOL (ieee80211_set_aid_for_sta);static void ap_sta_ps_start (struct net_device *dev,struct sta_info *sta) {
@@ -3705,7 +3707,7 @@ void __ieee80211_rx(struct net_device *dif (sta)sta_info_put (sta); } - +EXPORT_SYMBOL (__ieee80211_rx);static ieee80211_txrx_result ieee80211_tx_h_load_stats (struct ieee80211_txrx_data *tx)
@@ -3878,7 +3880,7 @@ void ieee80211_rx_irqsafe(struct net_devskb_queue_tail (&local->skb_queue, skb);tasklet_schedule (&local->tasklet); } - +EXPORT_SYMBOL (ieee80211_rx_irqsafe);void ieee80211_tx_status_irqsafe (struct net_device *dev,struct sk_buff *skb,struct ieee80211_tx_status *status)
@@ -3907,7 +3909,7 @@ void ieee80211_tx_status_irqsafe(struct }tasklet_schedule (&local->tasklet); } - +EXPORT_SYMBOL (ieee80211_tx_status_irqsafe);static void ieee80211_tasklet_handler (unsigned long data) {
@@ -4161,7 +4163,7 @@ #endif /* IEEE80211_LEDS *//* Send frame to hostapd */ ieee80211_rx_mgmt (dev, skb,NULL , msg_type); } - +EXPORT_SYMBOL (ieee80211_tx_status);/* TODO: implement register/unregister functions for adding TX/RX handlers * into ordered list */
@@ -4413,7 +4415,7 @@ struct net_device *ieee80211_alloc_hw(sireturn mdev; } - +EXPORT_SYMBOL (ieee80211_alloc_hw);int ieee80211_register_hw (struct net_device *dev,struct ieee80211_hw *hw) {
@@ -4522,6 +4524,7 @@ fail_sysfs:ieee80211_dev_free_index (local);return result; } +EXPORT_SYMBOL (ieee80211_register_hw);int ieee80211_update_hw (struct net_device *dev,struct ieee80211_hw *hw) {
@@ -4553,7 +4556,7 @@ int ieee80211_update_hw(struct net_devicreturn 0 ; } - +EXPORT_SYMBOL (ieee80211_update_hw);void ieee80211_unregister_hw (struct net_device *dev) {
@@ -4612,6 +4615,7 @@ void ieee80211_unregister_hw(struct net_ieee80211_dev_free_index (local); } +EXPORT_SYMBOL (ieee80211_unregister_hw);void ieee80211_free_hw (struct net_device *dev) {
@@ -4621,6 +4625,7 @@ void ieee80211_free_hw(struct net_deviceieee80211_wep_free (local);ieee80211_dev_free (local); } +EXPORT_SYMBOL (ieee80211_free_hw);void ieee80211_release_hw (struct ieee80211_local *local) {
@@ -4667,6 +4672,7 @@ #endifreturn 0 ; } +EXPORT_SYMBOL (ieee80211_netif_oper);void ieee80211_wake_queue (struct net_device *dev,int queue) {
@@ -4681,6 +4687,7 @@ void ieee80211_wake_queue(struct net_dev__netif_schedule (dev); } } +EXPORT_SYMBOL (ieee80211_wake_queue);void ieee80211_stop_queue (struct net_device *dev,int queue) {
@@ -4688,6 +4695,7 @@ void ieee80211_stop_queue(struct net_devset_bit (IEEE80211_LINK_STATE_XOFF , &local->state[queue]); } +EXPORT_SYMBOL (ieee80211_stop_queue);void ieee80211_start_queues (struct net_device *dev) {
@@ -4697,13 +4705,14 @@ void ieee80211_start_queues(struct net_dfor (i =0 ; i < local->hw->queues; i++)clear_bit (IEEE80211_LINK_STATE_XOFF , &local->state[i]); } +EXPORT_SYMBOL (ieee80211_start_queues);void *ieee80211_dev_hw_data (struct net_device *dev) {struct ieee80211_local *local = dev->ieee80211_ptr;return local->hw_priv; } - +EXPORT_SYMBOL (ieee80211_dev_hw_data);void *ieee80211_dev_stats (struct net_device *dev) {
@@ -4711,7 +4720,7 @@ void * ieee80211_dev_stats(struct net_de sdata =IEEE80211_DEV_TO_SUB_IF (dev);return &(sdata->stats); } - +EXPORT_SYMBOL (ieee80211_dev_stats);int ieee80211_rate_control_register (struct rate_control_ops *ops) {
@@ -4727,7 +4736,7 @@ int ieee80211_rate_control_register(strureturn 0 ; } - +EXPORT_SYMBOL (ieee80211_rate_control_register);void ieee80211_rate_control_unregister (struct rate_control_ops *ops) {
@@ -4748,7 +4757,7 @@ void ieee80211_rate_control_unregister(s alg = alg->next; } } - +EXPORT_SYMBOL (ieee80211_rate_control_unregister);static int rate_control_initialize (struct ieee80211_local *local) {
@@ -4813,34 +4822,6 @@ static void __exit ieee80211_exit(void) } -EXPORT_SYMBOL (ieee80211_alloc_hw); -EXPORT_SYMBOL (ieee80211_register_hw); -EXPORT_SYMBOL (ieee80211_update_hw); -EXPORT_SYMBOL (ieee80211_unregister_hw); -EXPORT_SYMBOL (ieee80211_free_hw); -EXPORT_SYMBOL (__ieee80211_rx); -EXPORT_SYMBOL (ieee80211_tx_status); -EXPORT_SYMBOL (ieee80211_beacon_get); -EXPORT_SYMBOL (ieee80211_get_buffered_bc); -EXPORT_SYMBOL (ieee80211_netif_oper); -EXPORT_SYMBOL (ieee80211_wake_queue); -EXPORT_SYMBOL (ieee80211_stop_queue); -EXPORT_SYMBOL (ieee80211_start_queues); -EXPORT_SYMBOL (ieee80211_dev_hw_data); -EXPORT_SYMBOL (ieee80211_dev_stats); -EXPORT_SYMBOL (ieee80211_get_hw_conf); -EXPORT_SYMBOL (ieee80211_set_aid_for_sta); -EXPORT_SYMBOL (ieee80211_rx_irqsafe); -EXPORT_SYMBOL (ieee80211_tx_status_irqsafe); -EXPORT_SYMBOL (ieee80211_get_hdrlen); -EXPORT_SYMBOL (ieee80211_get_hdrlen_from_skb); -EXPORT_SYMBOL (ieee80211_rate_control_register); -EXPORT_SYMBOL (ieee80211_rate_control_unregister); -EXPORT_SYMBOL (sta_info_get); -EXPORT_SYMBOL (sta_info_put); -EXPORT_SYMBOL (ieee80211_radar_status); -EXPORT_SYMBOL (ieee80211_get_mc_list_item); -module_init (ieee80211_init);module_exit (ieee80211_exit);
net/d80211/sta_info.c +2 -0
@@ -76,6 +76,7 @@ struct sta_info * sta_info_get(struct iereturn sta; } +EXPORT_SYMBOL (sta_info_get);int sta_info_min_txrate_get (struct ieee80211_local *local) {
@@ -104,6 +105,7 @@ void sta_info_put(struct sta_info *sta) {kobject_put (&sta->kobj); } +EXPORT_SYMBOL (sta_info_put);void sta_info_release (struct kobject *kobj) {
Signature · 1 line
1.3.0
PATCH 8/21 d80211: clean up includes
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch cleans up includes all over d80211. It might not be complete, but this was the best I could do without analysing it completely.
---
net/d80211/aes_ccm.c | 1 - net/d80211/aes_ccm.h | 2 +- net/d80211/fifo_qdisc.c | 4 +--- net/d80211/ieee80211.c | 2 -- net/d80211/ieee80211_ioctl.c | 2 -- net/d80211/ieee80211_key.h | 1 + net/d80211/ieee80211_scan.c | 2 -- net/d80211/ieee80211_sta.c | 2 -- net/d80211/rate_control.c | 2 -- net/d80211/sta_info.c | 3 +-- net/d80211/sta_info.h | 4 ++-- net/d80211/tkip.c | 15 --------------- net/d80211/tkip.h | 1 + net/d80211/wep.c | 2 -- net/d80211/wme.c | 2 -- net/d80211/wpa.c | 4 ---- 16 files changed, 7 insertions(+), 42 deletions(-)
681294dce73ff7ea535636dd0a5aeb288744db2d
net/d80211/aes_ccm.c +0 -1
@@ -8,7 +8,6 @@*/ #include <linux/types.h> -#include <linux/netdevice.h> #include <linux/crypto.h> #include <asm/scatterlist.h>
net/d80211/aes_ccm.h +1 -1
@@ -10,7 +10,7 @@#ifndef AES_CCM_H #define AES_CCM_H -#include <linux/types.h> +#include <linux/crypto.h> #define AES_BLOCK_LEN 16
net/d80211/fifo_qdisc.c +1 -3
@@ -10,9 +10,7 @@* This is a simple replacement for sch_fifo. */ -#include <linux/config.h> -#include <linux/version.h> -#include <linux/netdevice.h> +#include <linux/skbuff.h> #include <net/pkt_sched.h> #include <net/d80211.h> #include "ieee80211_i.h"
net/d80211/ieee80211.c +0 -2
@@ -7,8 +7,6 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/module.h> #include <linux/init.h> #include <linux/netdevice.h>
net/d80211/ieee80211_ioctl.c +0 -2
@@ -7,8 +7,6 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/module.h> #include <linux/init.h> #include <linux/netdevice.h>
net/d80211/ieee80211_key.h +1 -0
@@ -11,6 +11,7 @@ #ifndef IEEE80211_KEY_H#define IEEE80211_KEY_H #include <linux/types.h> +#include <linux/kobject.h> #include <net/d80211.h> /* ALG_TKIP
net/d80211/ieee80211_scan.c +0 -2
@@ -6,8 +6,6 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/types.h>
net/d80211/ieee80211_sta.c +0 -2
@@ -15,8 +15,6 @@* scan result table filtering (by capability (privacy, IBSS/BSS, WPA/RSN IE, * SSID) */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/if_ether.h> #include <linux/skbuff.h> #include <linux/netdevice.h>
net/d80211/rate_control.c +0 -2
@@ -7,8 +7,6 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/module.h> #include <linux/init.h> #include <linux/netdevice.h>
net/d80211/sta_info.c +1 -2
@@ -6,8 +6,6 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/module.h> #include <linux/init.h> #include <linux/kobject.h>
@@ -20,6 +18,7 @@ #include <linux/if_arp.h>#include <net/d80211.h> #include "ieee80211_i.h" #include "rate_control.h" +#include "sta_info.h" /* Caller must hold local->sta_lock */
net/d80211/sta_info.h +2 -2
@@ -9,9 +9,9 @@#ifndef STA_INFO_H #define STA_INFO_H -#include <linux/if_ether.h> +#include <linux/list.h> #include <linux/types.h> -#include "ieee80211_i.h" +#include <linux/if_ether.h> #include "ieee80211_key.h" /* Stations flags (struct sta_info::flags) */
net/d80211/tkip.c +0 -15
@@ -7,28 +7,13 @@* published by the Free Software Foundation. */ -#ifdef CONFIG_TKIP_DEBUG -#include <linux/config.h> -#include <linux/version.h> -#include <linux/module.h> #include <linux/kernel.h> -#include <linux/skbuff.h> -#endif /* CONFIG_TKIP_DEBUG */ -#include <linux/types.h> #include <linux/netdevice.h> #include <net/d80211.h> #include "ieee80211_key.h" -#ifdef CONFIG_TKIP_DEBUG -#include "ieee80211_i.h" -#endif /* CONFIG_TKIP_DEBUG */ #include "tkip.h" - -/* Dummy prototypes for structures used in wep.h, but not really needed for -* TKIP. */ -struct ieee80211_local ; -struct sk_buff ;#include "wep.h"
net/d80211/tkip.h +1 -0
@@ -10,6 +10,7 @@ #ifndef TKIP_H#define TKIP_H #include <linux/types.h> +#include <linux/crypto.h> #include "ieee80211_key.h" u8 * ieee80211_tkip_add_iv(u8 *pos, struct ieee80211_key *key,
net/d80211/wep.c +0 -2
@@ -8,8 +8,6 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/netdevice.h> #include <linux/types.h> #include <linux/random.h>
net/d80211/wme.c +0 -2
@@ -6,8 +6,6 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> #include <linux/netdevice.h> #include <linux/skbuff.h> #include <linux/module.h>
net/d80211/wpa.c +0 -4
@@ -6,15 +6,11 @@* published by the Free Software Foundation. */ -#include <linux/config.h> -#include <linux/version.h> -#include <linux/module.h> #include <linux/netdevice.h> #include <linux/types.h> #include <linux/slab.h> #include <linux/skbuff.h> #include <linux/compiler.h> -#include <linux/wireless.h> #include <net/iw_handler.h> #include <net/d80211.h>
Signature · 1 line
1.3.0
PATCH 9/21 d80211: fix some sparse warnings
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch fixes some warnings from sparse in d80211. Also fixes indentation in places near where the changes were.
---
include/net/d80211.h | 38 +++++++++++++++++++------------------- net/d80211/ieee80211.c | 16 ++++++++-------- net/d80211/ieee80211_i.h | 40 ++++++++++++++++++++-------------------- net/d80211/ieee80211_key.h | 6 +++--- net/d80211/rate_control.c | 2 +- net/d80211/sta_info.h | 6 +++--- 6 files changed, 54 insertions(+), 54 deletions(-)
5b188f3e93922150f3bee76e4980340db099a272
include/net/d80211.h +19 -19
@@ -246,10 +246,10 @@ struct ieee80211_conf {/* Bitfields, grouped together */ - int sw_encrypt:1; - int sw_decrypt:1; - int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ - int ssid_hidden:1; /* do not broadcast the ssid */ + unsigned int sw_encrypt:1; + unsigned int sw_decrypt:1; + unsigned int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ + unsigned int ssid_hidden:1; /* do not broadcast the ssid */u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */
@@ -376,13 +376,13 @@ struct ieee80211_key_conf {ieee80211_key_alg alg;int keylen; - int force_sw_encrypt:1; /* to be cleared by low-level driver */ + unsigned int force_sw_encrypt:1;/* to be cleared by low-level driver */ int keyidx:8; /* WEP key index */ - int default_tx_key:1; /* This key is the new default TX key + unsigned int default_tx_key:1; /* This key is the new default TX key* (used only for broadcast keys). */ - int default_wep_only:1; /* static WEP is the only configured security -* policy; this allows some low-level drivers -* to determine when hwaccel can be used */ + unsigned int default_wep_only:1;/* static WEP is the only configured security +* policy; this allows some low-level drivers +* to determine when hwaccel can be used */ u8 key[0 ]; };
@@ -441,20 +441,20 @@ struct ieee80211_hw {* configure upper layer IEEE 802.11 module to generate beacons. The * low-level driver can use ieee80211_beacon_get() to fetch next * beacon frame. */ - int host_gen_beacon:1; + unsigned int host_gen_beacon:1;/* The device needs to be supplied with a beacon template only. */ - int host_gen_beacon_template:1; + unsigned int host_gen_beacon_template:1;/* Some devices handle decryption internally and do not * indicate whether the frame was encrypted (unencrypted frames * will be dropped by the hardware, unless specifically allowed * through) */ - int device_hides_wep:1; + unsigned int device_hides_wep:1;/* Whether RX frames passed to ieee80211_rx() include FCS in the end */ - int rx_includes_fcs:1; + unsigned int rx_includes_fcs:1;/* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on
@@ -462,19 +462,19 @@ struct ieee80211_hw {* configure upper layer IEEE 802.11 to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ - int host_broadcast_ps_buffering:1; + unsigned int host_broadcast_ps_buffering:1; - int wep_include_iv:1; - int data_nullfunc_ack:1; /* will data nullfunc frames get proper -* TX status callback */ + unsigned int wep_include_iv:1; + unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper +* TX status callback */ /* Force sw version of encryption for TKIP packets if WMM is enabled. */ - int no_tkip_wmm_hwaccel:1; + unsigned int no_tkip_wmm_hwaccel:1;/* 1 if the payload needs to be padded at even boundaries after the * header */ - unsigned int extra_hdr_room:1; + unsigned int extra_hdr_room:1;/* Some devices handle Michael MIC internally and do not include MIC in * the received packets given to 80211.o. device_strips_mic must be set
net/d80211/ieee80211.c +8 -8
@@ -237,7 +237,7 @@ static void ieee80211_key_threshold_noti key->tx_rx_count =0 ; -ieee80211_rx_mgmt (dev, skb,0 , +ieee80211_rx_mgmt (dev, skb,NULL , ieee80211_msg_key_threshold_notification); }
@@ -2652,7 +2652,7 @@ int ieee80211_radar_status(struct net_de msg->radar = radar; msg->radar_type = radar_type; -ieee80211_rx_mgmt (dev, skb,0 , ieee80211_msg_radar); +ieee80211_rx_mgmt (dev, skb,NULL , ieee80211_msg_radar);return 0 ; }EXPORT_SYMBOL (ieee80211_radar_status);
@@ -2660,8 +2660,8 @@ EXPORT_SYMBOL(ieee80211_radar_status);int ieee80211_set_aid_for_sta (struct net_device *dev,u8 *peer_address,u16 aid) { -struct sk_buff *skb; -struct ieee80211_msg_set_aid_for_sta *msg; +struct sk_buff *skb; +struct ieee80211_msg_set_aid_for_sta *msg; skb =dev_alloc_skb (sizeof (struct ieee80211_frame_info ) +sizeof (struct ieee80211_msg_set_aid_for_sta ));
@@ -2670,13 +2670,13 @@ int ieee80211_set_aid_for_sta(struct netreturn -ENOMEM ;skb_reserve (skb,sizeof (struct ieee80211_frame_info )); - msg = (struct ieee80211_msg_set_aid_for_sta *) + msg = (struct ieee80211_msg_set_aid_for_sta *)skb_put (skb,sizeof (struct ieee80211_msg_set_aid_for_sta ));memcpy (msg->sta_address, peer_address,ETH_ALEN ); - msg->aid = aid; + msg->aid = aid; -ieee80211_rx_mgmt (dev, skb,0 , ieee80211_msg_set_aid_for_sta); -return 0 ; +ieee80211_rx_mgmt (dev, skb,NULL , ieee80211_msg_set_aid_for_sta); +return 0 ; }EXPORT_SYMBOL (ieee80211_set_aid_for_sta);
net/d80211/ieee80211_i.h +20 -20
@@ -115,10 +115,10 @@ struct ieee80211_txrx_data {union {struct {struct ieee80211_tx_control *control; -int unicast:1 ; -int ps_buffered:1 ; -int short_preamble:1 ; -int probe_last_frag:1 ; +unsigned int unicast:1 ; +unsigned int ps_buffered:1 ; +unsigned int short_preamble:1 ; +unsigned int probe_last_frag:1 ;struct ieee80211_rate *rate;/* use this rate (if set) for last fragment; rate can * be set to lower rate for the first fragments, e.g.,
@@ -138,10 +138,10 @@ struct ieee80211_txrx_data {int sent_ps_buffered;int queue;int load; - int in_scan:1; - int ra_match:1; /* frame is destined to interface -* currently processed (including -* multicast frames) */ + unsigned int in_scan:1; +/* frame is destined to interface currently processed +* (including multicast frames) */ + unsigned int ra_match:1; } rx; } u;#ifdef CONFIG_HOSTAPD_WPA_TESTING
@@ -255,16 +255,16 @@ struct ieee80211_if_sta {int auth_tries, assoc_tries; - int ssid_set:1; - int bssid_set:1; - int prev_bssid_set:1; - int authenticated:1; - int associated:1; - int probereq_poll:1; - int use_protection:1; - int create_ibss:1; - int mixed_cell:1; - int wmm_enabled:1; + unsigned int ssid_set:1; + unsigned int bssid_set:1; + unsigned int prev_bssid_set:1; + unsigned int authenticated:1; + unsigned int associated:1; + unsigned int probereq_poll:1; + unsigned int use_protection:1; + unsigned int create_ibss:1; + unsigned int mixed_cell:1; + unsigned int wmm_enabled:1;int key_mgmt;unsigned long last_probe;
@@ -293,8 +293,8 @@ struct ieee80211_sub_if_data {struct ieee80211_local *local;int mc_count; - unsigned allmulti:1; - unsigned promisc:1; + unsigned int allmulti:1; + unsigned int promisc:1;struct net_device_stats stats;int drop_unencrypted;
net/d80211/ieee80211_key.h +3 -3
@@ -77,10 +77,10 @@ #endif/* if the low level driver can provide hardware acceleration it should * clear this flag */ - int force_sw_encrypt:1; + unsigned int force_sw_encrypt:1; int keyidx:8; /* WEP key index */ - int default_tx_key:1; /* This key is the new default TX key -* (used only for broadcast keys). */ + unsigned int default_tx_key:1; /* This key is the new default TX key +* (used only for broadcast keys). */ u8 key[0 ]; };
net/d80211/rate_control.c +1 -1
@@ -375,7 +375,7 @@ static struct rate_control_ops rate_cont }; -int __init rate_control_simple_init (void ) +static int __init rate_control_simple_init (void ) {return ieee80211_rate_control_register (&rate_control_simple); }
net/d80211/sta_info.h +3 -3
@@ -94,9 +94,9 @@ struct sta_info {* filtering; used only if sta->key is not * set */ - int sysfs_registered:1; - int assoc_ap:1; /* whether this is an AP that we are associated with -* as a client */ + unsigned int sysfs_registered:1; + unsigned int assoc_ap:1; /* whether this is an AP that we are +* associated with as a client */ #ifdef CONFIG_HOSTAPD_WPA_TESTING u32 wpa_trigger;
Signature · 1 line
1.3.0
PATCH 10/21 d80211: make lowlevel TX framedump option visible
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch surfaces the lowlevel TX framedump option in Kconfig.
---
net/d80211/Kconfig | 13 +++++++++++++ net/d80211/ieee80211.c | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-)
bebc14745291105672e2cc3c46821e1c0731b330
net/d80211/Kconfig +13 -0
@@ -21,6 +21,19 @@ config D80211_VERBOSE_DEBUG bool "Verbose debugging output" depends on D80211_DEBUG +config D80211_LOWTX_FRAME_DUMP + bool "Debug frame dumping" + depends on D80211_DEBUG + ---help--- + Selecting this option will cause the stack to + print a message for each frame that is handed + to the lowlevel driver for transmission. This + message includes all MAC addresses and the + frame control field. + + If unsure, say N and insert the debugging code + you require into the driver you are debugging. + config TKIP_DEBUG bool "TKIP debugging" depends on D80211_DEBUG
net/d80211/ieee80211.c +3 -3
@@ -284,7 +284,7 @@ int ieee80211_get_hdrlen_from_skb(struct }EXPORT_SYMBOL (ieee80211_get_hdrlen_from_skb); -#ifdef IEEE80211_VERBOSE_DEBUG_FRAME_DUMP +#ifdef CONFIG_D80211_LOWTX_FRAME_DUMP static void ieee80211_dump_frame (const char *ifname,const char *title,struct sk_buff *skb) {
@@ -315,12 +315,12 @@ static void ieee80211_dump_frame(const cprintk (" A4=" MAC_FMT ,MAC_ARG (hdr->addr4)); printk("\n"); } -#else /* IEEE80211_VERBOSE_DEBUG_FRAME_DUMP */ +#else /* CONFIG_D80211_LOWTX_FRAME_DUMP */ static inline void ieee80211_dump_frame (const char *ifname,const char *title,struct sk_buff *skb) { } -#endif /* IEEE80211_VERBOSE_DEBUG_FRAME_DUMP */ +#endif /* CONFIG_D80211_LOWTX_FRAME_DUMP */ static int ieee80211_is_eapol (struct sk_buff *skb)
Signature · 1 line
1.3.0
PATCH 11/21 d80211: surface IBSS debug
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch surfaces the IBSS debug switch in Kconfig.
---
net/d80211/Kconfig | 6 ++++++ net/d80211/ieee80211_sta.c | 30 ++++++++++++++---------------- 2 files changed, 20 insertions(+), 16 deletions(-)
9b827dcb576bb80d8dc837d777812fa69b8af438
net/d80211/Kconfig +6 -0
@@ -45,3 +45,9 @@ config D80211_DEBUG_COUNTERS config HOSTAPD_WPA_TESTING bool "Support for TKIP countermeasures testing" depends on D80211_DEBUG + +config D80211_IBSS_DEBUG + bool "Support for IBSS testing" + depends on D80211_DEBUG + ---help--- + Say Y here if you intend to debug the IBSS code.
net/d80211/ieee80211_sta.c +14 -16
@@ -31,8 +31,6 @@ #include "ieee80211_i.h"#include "rate_control.h" #include "hostapd_ioctl.h" -/* #define IEEE80211_IBSS_DEBUG */ -#define IEEE80211_AUTH_TIMEOUT (HZ / 5)#define IEEE80211_AUTH_MAX_TRIES 3#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
@@ -1359,7 +1357,7 @@ #endifif (sdata->type ==IEEE80211_IF_TYPE_IBSS && beacon &&memcmp (mgmt->bssid, sdata->u.sta.bssid,ETH_ALEN ) ==0 ) { -#ifdef IEEE80211_IBSS_DEBUG +#ifdef CONFIG_D80211_IBSS_DEBUG static unsigned long last_tsf_debug =0 ;u64 tsf;if (local->hw->get_tsf)
@@ -1374,7 +1372,7 @@ #ifdef IEEE80211_IBSS_DEBUG tsf, timestamp, tsf - timestamp, jiffies); last_tsf_debug = jiffies; } -#endif /* IEEE80211_IBSS_DEBUG */ +#endif /* CONFIG_D80211_IBSS_DEBUG */ } if (ieee802_11_parse_elems(mgmt->u.beacon.variable, len - baselen,
@@ -1654,12 +1652,12 @@ static void ieee80211_rx_mgmt_probe_req(else tx_last_beacon =1 ; -#ifdef IEEE80211_IBSS_DEBUG +#ifdef CONFIG_D80211_IBSS_DEBUG printk (KERN_DEBUG "%s: RX ProbeReq SA=" MAC_FMT " DA=" MAC_FMT " BSSID=" MAC_FMT " (tx_last_beacon=%d)\n" , dev->name,MAC_ARG (mgmt->sa),MAC_ARG (mgmt->da),MAC_ARG (mgmt->bssid), tx_last_beacon); -#endif /* IEEE80211_IBSS_DEBUG */ +#endif /* CONFIG_D80211_IBSS_DEBUG */ if (!tx_last_beacon)return ;
@@ -1693,10 +1691,10 @@ #endif /* IEEE80211_IBSS_DEBUG */ resp = (struct ieee80211_mgmt *) skb->data;memcpy (resp->da, mgmt->sa,ETH_ALEN ); -#ifdef IEEE80211_IBSS_DEBUG +#ifdef CONFIG_D80211_IBSS_DEBUG printk (KERN_DEBUG "%s: Sending ProbeResp to " MAC_FMT "\n" , dev->name,MAC_ARG (resp->da)); -#endif /* IEEE80211_IBSS_DEBUG */ +#endif /* CONFIG_D80211_IBSS_DEBUG */ ieee80211_sta_tx (dev, skb,0 ,1 ); }
@@ -2193,10 +2191,10 @@ static int ieee80211_sta_find_ibss(strucreturn -EINVAL ; active_ibss =ieee80211_sta_active_ibss (dev); -#ifdef IEEE80211_IBSS_DEBUG +#ifdef CONFIG_D80211_IBSS_DEBUG printk (KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n" , dev->name, active_ibss); -#endif /* IEEE80211_IBSS_DEBUG */ +#endif /* CONFIG_D80211_IBSS_DEBUG */ spin_lock_bh (&local->sta_bss_lock);list_for_each (ptr, &local->sta_bss_list) { bss = list_entry(ptr, struct ieee80211_sta_bss, list);
@@ -2204,10 +2202,10 @@ #endif /* IEEE80211_IBSS_DEBUG */memcmp (ifsta->ssid, bss->ssid, bss->ssid_len) !=0 || !(bss->capability & WLAN_CAPABILITY_IBSS)) continue; -#ifdef IEEE80211_IBSS_DEBUG +#ifdef CONFIG_D80211_IBSS_DEBUG printk (KERN_DEBUG " bssid=" MAC_FMT " found\n" ,MAC_ARG (bss->bssid)); -#endif /* IEEE80211_IBSS_DEBUG */ +#endif /* CONFIG_D80211_IBSS_DEBUG */ memcpy (bssid, bss->bssid,ETH_ALEN ); found =1 ;if (active_ibss ||memcmp (bssid, ifsta->bssid,ETH_ALEN ) !=0 )
@@ -2215,10 +2213,10 @@ #endif /* IEEE80211_IBSS_DEBUG */ }spin_unlock_bh (&local->sta_bss_lock); -#ifdef IEEE80211_IBSS_DEBUG +#ifdef CONFIG_D80211_IBSS_DEBUG printk (KERN_DEBUG " sta_find_ibss: selected " MAC_FMT " current " MAC_FMT "\n" ,MAC_ARG (bssid),MAC_ARG (ifsta->bssid)); -#endif /* IEEE80211_IBSS_DEBUG */ +#endif /* CONFIG_D80211_IBSS_DEBUG */ if (found &&memcmp (ifsta->bssid, bssid,ETH_ALEN ) !=0 && (bss =ieee80211_rx_bss_get (dev, bssid))) { printk(KERN_DEBUG "%s: Selected IBSS BSSID " MAC_FMT
@@ -2226,9 +2224,9 @@ #endif /* IEEE80211_IBSS_DEBUG */ dev->name, MAC_ARG(bssid));return ieee80211_sta_join_ibss (dev, ifsta, bss); } -#ifdef IEEE80211_IBSS_DEBUG +#ifdef CONFIG_D80211_IBSS_DEBUG printk (KERN_DEBUG " did not try to join ibss\n" ); -#endif /* IEEE80211_IBSS_DEBUG */ +#endif /* CONFIG_D80211_IBSS_DEBUG */ /* Selected IBSS not found in current scan results - try to scan */ if (ifsta->state == IEEE80211_IBSS_JOINED &&
Signature · 1 line
1.3.0
PATCH 12/21 d80211: get rid of MICHAEL_MIC_HWACCEL define
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
The symbol MICHAEL_MIC_HWACCEL is always defined and hence all the ifdefs using it are useless. This patch removes it.
---
net/d80211/wpa.c | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-)
0c2bf906ecdf3c6fda21aa83afb07f015dd7ec20
net/d80211/wpa.c +0 -11
@@ -25,9 +25,6 @@ #include "hostapd_ioctl.h"#endif /* CONFIG_HOSTAPD_WPA_TESTING */ -#define MICHAEL_MIC_HWACCEL - -int ieee80211_get_hdr_info (const struct sk_buff *skb,u8 **sa,u8 **da,u8 *qos_tid,u8 **data,size_t *data_len) {
@@ -87,9 +84,7 @@ ieee80211_tx_h_michael_mic_add(struct ieu16 fc;struct sk_buff *skb = tx->skb;int authenticator; -#if defined(CONFIG_HOSTAPD_WPA_TESTING ) || defined(MICHAEL_MIC_HWACCEL )int wpa_test =0 ; -#endif fc = tx->fc;
@@ -108,14 +103,12 @@ #ifdef CONFIG_HOSTAPD_WPA_TESTING }#endif /* CONFIG_HOSTAPD_WPA_TESTING */ -#ifdef MICHAEL_MIC_HWACCEL if (!tx->key->force_sw_encrypt && !tx->local->conf.sw_decrypt && !tx->fragmented && !wpa_test) {/* hwaccel - with no need for preallocated room for Michael MIC */ return TXRX_CONTINUE ; } -#endif /* MICHAEL_MIC_HWACCEL */ if (skb_tailroom (skb) <MICHAEL_MIC_LEN ) {I802_DEBUG_INC (tx->local->tx_expand_skb_head);
@@ -189,7 +182,6 @@ #ifdef CONFIG_HOSTAPD_WPA_TESTING }#endif /* CONFIG_HOSTAPD_WPA_TESTING */ -#ifdef MICHAEL_MIC_HWACCEL if ((rx->u.rx.status->flag &RX_FLAG_DECRYPTED ) && !rx->key->force_sw_encrypt && !rx->local->conf.sw_decrypt) {if (rx->local->hw->wep_include_iv) {
@@ -202,7 +194,6 @@ #ifdef MICHAEL_MIC_HWACCELif (!rx->fragmented && !wpa_test) goto remove_mic; } -#endif /* MICHAEL_MIC_HWACCEL */ if (ieee80211_get_hdr_info (skb, &sa, &da, &qos_tid, &data, &data_len) || data_len <MICHAEL_MIC_LEN )
@@ -278,9 +269,7 @@ #endif /* CONFIG_HOSTAPD_WPA_TESTING */return TXRX_QUEUED ; } -#ifdef MICHAEL_MIC_HWACCEL remove_mic: -#endif /* MICHAEL_MIC_HWACCEL */ /* remove Michael MIC from payload */ skb_trim (skb, skb->len -MICHAEL_MIC_LEN );
Signature · 1 line
1.3.0
PATCH 13/21 d80211: surface powersave debug switch
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch makes the verbose powersave debugging
visible in Kconfig.
---
net/d80211/Kconfig | 7 +++++++ net/d80211/ieee80211.c | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 14 deletions(-)
505c84c433dd4185c987844a10baf24fada3620d
net/d80211/Kconfig +7 -0
@@ -51,3 +51,10 @@ config D80211_IBSS_DEBUG depends on D80211_DEBUG ---help--- Say Y here if you intend to debug the IBSS code. + +config D80211_VERBOSE_PS_DEBUG + bool "Verbose powersave mode debugging" + depends on D80211_DEBUG + ---help--- + Say Y here to print out verbose powersave + mode debug messages.
net/d80211/ieee80211.c +14 -14
@@ -1026,12 +1026,12 @@ ieee80211_tx_h_unicast_ps_buf(struct ieeif (unlikely ((sta->flags &WLAN_STA_PS ) && !sta->pspoll)) {struct ieee80211_tx_packet_data *pkt_data; -#ifdef IEEE80211_VERBOSE_DEBUG_PS +#ifdef CONFIG_D80211_VERBOSE_PS_DEBUG printk (KERN_DEBUG "STA " MAC_FMT " aid %d: PS buffer (entries " "before %d)\n" ,MAC_ARG (sta->addr), sta->aid,skb_queue_len (&sta->ps_tx_buf)); -#endif /* IEEE80211_VERBOSE_DEBUG_PS */ +#endif /* CONFIG_D80211_VERBOSE_PS_DEBUG */ sta->flags |=WLAN_STA_TIM ;if (tx->local->total_ps_buffered >=TOTAL_MAX_TX_BUFFER )purge_old_ps_buffers (tx->local);
@@ -1057,13 +1057,13 @@ #endif /* IEEE80211_VERBOSE_DEBUG_PS */skb_queue_tail (&sta->ps_tx_buf, tx->skb);return TXRX_QUEUED ; } -#ifdef IEEE80211_VERBOSE_DEBUG_PS +#ifdef CONFIG_D80211_VERBOSE_PS_DEBUG else if (unlikely(sta->flags & WLAN_STA_PS)) {printk (KERN_DEBUG "%s: STA " MAC_FMT " in PS mode, but pspoll " "set -> send frame\n" , tx->dev->name,MAC_ARG (sta->addr)); } -#endif /* IEEE80211_VERBOSE_DEBUG_PS */ +#endif /* CONFIG_D80211_VERBOSE_PS_DEBUG */ sta->pspoll =0 ;return TXRX_CONTINUE ;
@@ -2689,10 +2689,10 @@ static void ap_sta_ps_start(struct net_datomic_inc (&sdata->bss->num_sta_ps); sta->flags |=WLAN_STA_PS ; sta->pspoll =0 ; -#ifdef IEEE80211_VERBOSE_DEBUG_PS +#ifdef CONFIG_D80211_VERBOSE_PS_DEBUG printk (KERN_DEBUG "%s: STA " MAC_FMT " aid %d enters power " "save mode\n" , dev->name,MAC_ARG (sta->addr), sta->aid); -#endif /* IEEE80211_VERBOSE_DEBUG_PS */ +#endif /* CONFIG_D80211_VERBOSE_PS_DEBUG */ }
@@ -2715,10 +2715,10 @@ static int ap_sta_ps_end(struct net_deviif (sdata->bss)bss_tim_clear (local, sdata->bss, sta->aid); } -#ifdef IEEE80211_VERBOSE_DEBUG_PS +#ifdef CONFIG_D80211_VERBOSE_PS_DEBUG printk (KERN_DEBUG "%s: STA " MAC_FMT " aid %d exits power " "save mode\n" , dev->name,MAC_ARG (sta->addr), sta->aid); -#endif /* IEEE80211_VERBOSE_DEBUG_PS */ +#endif /* CONFIG_D80211_VERBOSE_PS_DEBUG */ /* Send all buffered frames to the station */ while ((skb =skb_dequeue (&sta->tx_filtered)) !=NULL ) { pkt_data = (struct ieee80211_tx_packet_data *) skb->cb;
@@ -2730,11 +2730,11 @@ #endif /* IEEE80211_VERBOSE_DEBUG_PS */ pkt_data = (struct ieee80211_tx_packet_data *) skb->cb; local->total_ps_buffered--; sent++; -#ifdef IEEE80211_VERBOSE_DEBUG_PS +#ifdef CONFIG_D80211_VERBOSE_PS_DEBUG printk (KERN_DEBUG "%s: STA " MAC_FMT " aid %d send PS frame " "since STA not sleeping anymore\n" , dev->name,MAC_ARG (sta->addr), sta->aid); -#endif /* IEEE80211_VERBOSE_DEBUG_PS */ +#endif /* CONFIG_D80211_VERBOSE_PS_DEBUG */ pkt_data->requeue =1 ;dev_queue_xmit (skb); }
@@ -2772,12 +2772,12 @@ ieee80211_rx_h_ps_poll(struct ieee80211_* still remain is PS mode after this frame exchange */ rx->sta->pspoll =1 ; -#ifdef IEEE80211_VERBOSE_DEBUG_PS +#ifdef CONFIG_D80211_VERBOSE_PS_DEBUG printk (KERN_DEBUG "STA " MAC_FMT " aid %d: PS Poll (entries " "after %d)\n" ,MAC_ARG (rx->sta->addr), rx->sta->aid,skb_queue_len (&rx->sta->ps_tx_buf)); -#endif /* IEEE80211_VERBOSE_DEBUG_PS */ +#endif /* CONFIG_D80211_VERBOSE_PS_DEBUG */ /* Use MoreData flag to indicate whether there are more * buffered frames for this STA */
@@ -2795,12 +2795,12 @@ #endif /* IEEE80211_VERBOSE_DEBUG_PS */if (rx->sdata->bss)bss_tim_clear (rx->local, rx->sdata->bss, rx->sta->aid); } -#ifdef IEEE80211_VERBOSE_DEBUG_PS +#ifdef CONFIG_D80211_VERBOSE_PS_DEBUG }else if (!rx->u.rx.sent_ps_buffered) {printk (KERN_DEBUG "%s: STA " MAC_FMT " sent PS Poll even " "though there is no buffered frames for it\n" , rx->dev->name,MAC_ARG (rx->sta->addr)); -#endif /* IEEE80211_VERBOSE_DEBUG_PS */ +#endif /* CONFIG_D80211_VERBOSE_PS_DEBUG */ }
Signature · 1 line
1.3.0
PATCH 14/21 d80211: fix some documentation
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This patch fixes some spelling errors, typos etc. in d80211.h
---
include/net/d80211.h | 94 ++++++++++++++++++++++++++------------------------ 1 files changed, 49 insertions(+), 45 deletions(-)
30aca4fb6d72c86a693016ca8f9eeb46a7ad9dee
include/net/d80211.h +49 -45
@@ -17,7 +17,7 @@ #include <linux/skbuff.h>#include <linux/wireless.h> #include "d80211_shared.h" -/* Note! Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsave() can be +/* Note! Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsafe() can be * called in hardware interrupt context. The low-level driver must not call any * other functions in hardware interrupt context. If there is a need for such * call, the low-level driver should first ACK the interrupt and perform the
@@ -131,8 +131,8 @@ struct ieee80211_low_level_stats { };/* Transmit control fields. This data structure is passed to low-level driver -* with each TX frame. The low-level driver is responsible of configuring -* hardware to use given values (depending on what is supported). */ +* with each TX frame. The low-level driver is responsible for configuring +* the hardware to use given values (depending on what is supported). */ #define HW_KEY_IDX_INVALID -1struct ieee80211_tx_control {
@@ -162,7 +162,7 @@ struct ieee80211_tx_control {* frame */ /* following three flags are only used with Atheros Super A/G */ unsigned int compress:1; - unsigned int turbo_prime_notify:1; /* notify HostaAPd after frame + unsigned int turbo_prime_notify:1; /* notify HostAPd after frame* transmission */ unsigned int fast_frame:1;
@@ -230,7 +230,10 @@ struct ieee80211_tx_status {/** -* struct ieee80211_conf - configuration of a hardware +* struct ieee80211_conf - configuration of the device +* +* This struct indicates how the driver shall configure the hardware. +* * @radio_enabled: when zero, driver is required to switch off the radio. */ struct ieee80211_conf {
@@ -290,7 +293,8 @@ struct ieee80211_conf { };/** -* enum ieee80211_if_types - types of 802.11 network interface +* enum ieee80211_if_types - types of 802.11 network interfaces +* * @IEEE80211_IF_TYPE_AP: interface in AP mode. * @IEEE80211_IF_TYPE_MGMT: special interface for communication with hostap * daemon. Drivers should never see this type.
@@ -312,6 +316,7 @@ enum ieee80211_if_types {/** * struct ieee80211_if_init_conf - initial configuration of an interface +* * @if_id: internal interface ID. This number has no particular meaning to * drivers and the only allowed usage is to pass it to * ieee80211_beacon_get() and ieee80211_get_buffered_bc() functions.
@@ -334,26 +339,27 @@ struct ieee80211_if_init_conf {/** * struct ieee80211_if_conf - configuration of an interface +* * @type: type of the interface. This is always the same as was specified in -* &struct ieee80211_if_init_conf. The type of interface never change -* during the live of the interface; this field is present only for +* &struct ieee80211_if_init_conf. The type of an interface never changes +* during the life of the interface; this field is present only for * convenience. * @bssid: BSSID of the network we are associated to/creating. * @ssid: used (together with @ssid_len) by drivers for hardware that -* generate beacons independently. The pointer is valid only during -* config_interface() callback (so copy the value somewhere if you need -* it). +* generate beacons independently. The pointer is valid only during the +* config_interface() call, so copy the value somewhere if you need +* it. * @ssid_len: length of the @ssid field. * @generic_elem: used (together with @generic_elem_len) by drivers for * hardware that generate beacons independently. The pointer is valid -* only during config_interface() callback (so copy the value somewhere -* if you need it). +* only during the config_interface() call, so copy the value somewhere +* if you need it. * @generic_elem_len: length of the generic element. * @beacon: beacon template. Valid only if @host_gen_beacon_template in * &struct ieee80211_hw is set. The driver is responsible of freeing * the sk_buff. * -* This structure is passed to config_interface() callback of +* This structure is passed to the config_interface() callback of * &struct ieee80211_hw. */ struct ieee80211_if_conf {
@@ -425,8 +431,8 @@ typedef enum { ENABLE_COMPRESSION, DISABLE_COMPRESSION } set_key_cmd; -/* Configuration block used by the low-level driver to tell 802.11 code about -* supported hardware features and to pass function pointers for callback +/* Configuration block used by the low-level driver to tell the 802.11 code +* about supported hardware features and to pass function pointers to callback * functions. */ struct ieee80211_hw {int version;/* IEEE80211_VERSION */
@@ -438,9 +444,9 @@ struct ieee80211_hw {/* Some wireless LAN chipsets generate beacons in the hardware/firmware * and others rely on host generated beacons. This option is used to -* configure upper layer IEEE 802.11 module to generate beacons. The -* low-level driver can use ieee80211_beacon_get() to fetch next -* beacon frame. */ +* configure the upper layer IEEE 802.11 module to generate beacons. +* The low-level driver can use ieee80211_beacon_get() to fetch the +* next beacon frame. */ unsigned int host_gen_beacon:1;/* The device needs to be supplied with a beacon template only. */
@@ -452,14 +458,13 @@ struct ieee80211_hw {* through) */ unsigned int device_hides_wep:1; -/* Whether RX frames passed to ieee80211_rx() include FCS in the end -*/ +/* Whether RX frames passed to ieee80211_rx() include FCS in the end */ unsigned int rx_includes_fcs:1;/* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on * the host system for such buffering. This option is used to -* configure upper layer IEEE 802.11 to buffer broadcast/multicast +* configure the IEEE 802.11 upper layer to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ unsigned int host_broadcast_ps_buffering:1;
@@ -468,18 +473,18 @@ struct ieee80211_hw { unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper* TX status callback */ -/* Force sw version of encryption for TKIP packets if WMM is enabled. -*/ +/* Force software encryption for TKIP packets if WMM is enabled. */ unsigned int no_tkip_wmm_hwaccel:1; -/* 1 if the payload needs to be padded at even boundaries after the +/* set if the payload needs to be padded at even boundaries after the * header */ unsigned int extra_hdr_room:1;/* Some devices handle Michael MIC internally and do not include MIC in -* the received packets given to 80211.o. device_strips_mic must be set -* for such devices. ISWEP bit is still expected to be set in the IEEE -* 802.11 header with this option unlike with device_hides_wep option. +* the received packets passed up. device_strips_mic must be set +* for such devices. The 'encryption' frame control bit is expected to +* be still set in the IEEE 802.11 header with this option unlike with +* the device_hides_wep configuration option. */ unsigned int device_strips_mic:1;
@@ -487,9 +492,9 @@ struct ieee80211_hw {* normal operation. */ unsigned int monitor_during_oper:1; -/* 1 = low-level driver supports skb fraglist (NETIF_F_FRAGLIST), i.e., -* more than one skb per frame */ -unsigned int fraglist; +/* Set if the low-level driver supports skb fraglist (NETIF_F_FRAGLIST), +* i.e. more than one skb per frame */ + unsigned int fraglist:1;/* This is the time in us to change channels */
@@ -521,17 +526,17 @@ struct ieee80211_hw {/* Handler for asking a driver if a new interface can be added (or, * more exactly, set UP). If the handler returns zero, the interface * is added. Driver should perform any initialization it needs prior -* to returning zero. By returning non-zero, adding of the interface -* is not permitted. Unless monitor_during_oper is set, it is -* guaranteed that monitor interfaces and normal interfaces are -* mutually exclusive. The open() handler is called after -* add_interface() if this is the first device added. At least one -* of open() and add_interface() handler has to be non-NULL. If +* to returning zero. By returning non-zero addition of the interface +* is inhibited. Unless monitor_during_oper is set, it is guaranteed +* that monitor interfaces and normal interfaces are mutually +* exclusive. The open() handler is called after add_interface() +* if this is the first device added. At least one of the open() +* open() and add_interface() callbacks has to be assigned. If * add_interface() is NULL, one STA interface is permitted only. */ int (*add_interface)(struct net_device *dev,struct ieee80211_if_init_conf *conf); -/* Notify a driver that interface is going down. The stop() handler +/* Notify a driver that an interface is going down. The stop() handler * is called prior to this if this is a last interface. */ void (*remove_interface)(struct net_device *dev,struct ieee80211_if_init_conf *conf);
@@ -545,9 +550,9 @@ struct ieee80211_hw {int (*config_interface)(struct net_device *dev,int if_id,struct ieee80211_if_conf *conf); -/* ieee80211 drivers should use this and not the function in -* net_device. dev->flags, dev->mc_count and dev->mc_list must not -* be used; use passed parameters and ieee80211_get_mc_list_item() +/* ieee80211 drivers must assign this instead of the callback in +* &struct net_device. dev->flags, dev->mc_count and dev->mc_list must +* not be used; use passed parameters and ieee80211_get_mc_list_item() * instead. */ void (*set_multicast_list)(struct net_device *dev,unsigned short flags,int mc_count);
@@ -571,14 +576,14 @@ struct ieee80211_hw {/* Set TX key index for default/broadcast keys. This is needed in cases * where wlan card is doing full WEP/TKIP encapsulation (wep_include_iv * is not set), in other cases, this function pointer can be set to -* NULL since 80211.o takes care of selecting the key index for each -* TX frame. */ +* NULL since the IEEE 802. 11 module takes care of selecting the key +* index for each TX frame. */ int (*set_key_idx)(struct net_device *dev,int idx);/* Enable/disable IEEE 802.1X. This item requests wlan card to pass * unencrypted EAPOL-Key frames even when encryption is configured. * If the wlan card does not require such a configuration, this -* function pointer can be set to NULL. 80211.o */ +* function pointer can be set to NULL. */ int (*set_ieee8021x)(struct net_device *dev,int use_ieee8021x);/* Set port authorization state (IEEE 802.1X PAE) to be authorized
@@ -608,7 +613,6 @@ struct ieee80211_hw {/* For devices that generate their own beacons and probe response * or association responses this updates the state of privacy_invoked * returns 0 for success or an error number */ -int (*set_privacy_invoked)(struct net_device *dev,int privacy_invoked);
Signature · 1 line
1.3.0
PATCH 15/21 d80211: switch status codes, reason codes, and EIDs to enums
In reply to Jiri BencFrom: Michael Wu <[email protected]>
This patch converts the status code, reason code, and EID defines in d80211_mgmt.h to enums. It also adds some status and reason codes, fixes some typos (DENOED, QUITE), and uses the ieee80211.h version of the name where reasonable.
---
include/net/d80211_mgmt.h | 149 ++++++++++++++++++++++++++------------------- 1 files changed, 87 insertions(+), 62 deletions(-)
7bac23cee8567c27c42f460cf7e7d9c340674b31
include/net/d80211_mgmt.h +87 -62
@@ -119,76 +119,101 @@ #define WLAN_CAPABILITY_SHORT_SLOT_TIME#define WLAN_CAPABILITY_DSSS_OFDM BIT(13)/* Status codes */ -#define WLAN_STATUS_SUCCESS 0 -#define WLAN_STATUS_UNSPECIFIED_FAILURE 1 -#define WLAN_STATUS_CAPS_UNSUPPORTED 10 -#define WLAN_STATUS_REASSOC_NO_ASSOC 11 -#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12 -#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13 -#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14 -#define WLAN_STATUS_CHALLENGE_FAIL 15 -#define WLAN_STATUS_AUTH_TIMEOUT 16 -#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17 -#define WLAN_STATUS_ASSOC_DENIED_RATES 18 -/* 802.11b */ -#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19 -#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20 -#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21 -/* 802.11h */ -#define WLAN_STATUS_SPEC_MGMT_REQUIRED 22 -#define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23 -#define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24 -/* 802.11g */ -#define WLAN_STATUS_ASSOC_DENOED_NO_SHORT_SLOT_TIME 25 -#define WLAN_STATUS_ASSOC_DENOED_NO_ER_PBCC 26 -#define WLAN_STATUS_ASSOC_DENOED_NO_DSSS_OFDM 27 +enum ieee80211_statuscode { +WLAN_STATUS_SUCCESS =0 , +WLAN_STATUS_UNSPECIFIED_FAILURE =1 , +WLAN_STATUS_CAPS_UNSUPPORTED =10 , +WLAN_STATUS_REASSOC_NO_ASSOC =11 , +WLAN_STATUS_ASSOC_DENIED_UNSPEC =12 , +WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG =13 , +WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION =14 , +WLAN_STATUS_CHALLENGE_FAIL =15 , +WLAN_STATUS_AUTH_TIMEOUT =16 , +WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA =17 , +WLAN_STATUS_ASSOC_DENIED_RATES =18 , +/* 802.11b */ +WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE =19 , +WLAN_STATUS_ASSOC_DENIED_NOPBCC =20 , +WLAN_STATUS_ASSOC_DENIED_NOAGILITY =21 , +/* 802.11h */ +WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM =22 , +WLAN_STATUS_ASSOC_REJECTED_BAD_POWER =23 , +WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN =24 , +/* 802.11g */ +WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME =25 , +WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM =26 , +/* 802.11i */ +WLAN_STATUS_INVALID_IE =40 , +WLAN_STATUS_INVALID_GROUP_CIPHER =41 , +WLAN_STATUS_INVALID_PAIRWISE_CIPHER =42 , +WLAN_STATUS_INVALID_AKMP =43 , +WLAN_STATUS_UNSUPP_RSN_VERSION =44 , +WLAN_STATUS_INVALID_RSN_IE_CAP =45 , +WLAN_STATUS_CIPHER_SUITE_REJECTED =46 , +};/* Reason codes */ -#define WLAN_REASON_UNSPECIFIED 1 -#define WLAN_REASON_PREV_AUTH_NOT_VALID 2 -#define WLAN_REASON_DEAUTH_LEAVING 3 -#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4 -#define WLAN_REASON_DISASSOC_AP_BUSY 5 -#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 -#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7 -#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8 -#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 -/* 802.11h */ -#define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10 -#define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11 - -#define WLAN_REASON_MIC_FAILURE 14 +enum ieee80211_reasoncode { +WLAN_REASON_UNSPECIFIED =1 , +WLAN_REASON_PREV_AUTH_NOT_VALID =2 , +WLAN_REASON_DEAUTH_LEAVING =3 , +WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY =4 , +WLAN_REASON_DISASSOC_AP_BUSY =5 , +WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA =6 , +WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA =7 , +WLAN_REASON_DISASSOC_STA_HAS_LEFT =8 , +WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH =9 , +/* 802.11h */ +WLAN_REASON_DISASSOC_BAD_POWER =10 , +WLAN_REASON_DISASSOC_BAD_SUPP_CHAN =11 , +/* 802.11i */ +WLAN_REASON_INVALID_IE =13 , +WLAN_REASON_MIC_FAILURE =14 , +WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT =15 , +WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT =16 , +WLAN_REASON_IE_DIFFERENT =17 , +WLAN_REASON_INVALID_GROUP_CIPHER =18 , +WLAN_REASON_INVALID_PAIRWISE_CIPHER =19 , +WLAN_REASON_INVALID_AKMP =20 , +WLAN_REASON_UNSUPP_RSN_VERSION =21 , +WLAN_REASON_INVALID_RSN_IE_CAP =22 , +WLAN_REASON_IEEE8021X_FAILED =23 , +WLAN_REASON_CIPHER_SUITE_REJECTED =24 , +};/* Information Element IDs */ -#define WLAN_EID_SSID 0 -#define WLAN_EID_SUPP_RATES 1 -#define WLAN_EID_FH_PARAMS 2 -#define WLAN_EID_DS_PARAMS 3 -#define WLAN_EID_CF_PARAMS 4 -#define WLAN_EID_TIM 5 -#define WLAN_EID_IBSS_PARAMS 6 -#define WLAN_EID_COUNTRY 7 -#define WLAN_EID_CHALLENGE 16 +enum ieee80211_eid { +WLAN_EID_SSID =0 , +WLAN_EID_SUPP_RATES =1 , +WLAN_EID_FH_PARAMS =2 , +WLAN_EID_DS_PARAMS =3 , +WLAN_EID_CF_PARAMS =4 , +WLAN_EID_TIM =5 , +WLAN_EID_IBSS_PARAMS =6 , +WLAN_EID_COUNTRY =7 , +WLAN_EID_CHALLENGE =16 ,/* EIDs defined as part fo 11h - starts */ -#define WLAN_EID_PWR_CONSTRAINT 32 -#define WLAN_EID_PWR_CAPABILITY 33 -#define WLAN_EID_TPC_REQUEST 34 -#define WLAN_EID_TPC_REPORT 35 -#define WLAN_EID_SUPPORTED_CHANNELS 36 -#define WLAN_EID_CHANNEL_SWITCH 37 -#define WLAN_EID_MEASURE_REQUEST 38 -#define WLAN_EID_MEASURE_REPORT 39 -#define WLAN_EID_QUITE 40 -#define WLAN_EID_IBSS_DFS 41 +WLAN_EID_PWR_CONSTRAINT =32 , +WLAN_EID_PWR_CAPABILITY =33 , +WLAN_EID_TPC_REQUEST =34 , +WLAN_EID_TPC_REPORT =35 , +WLAN_EID_SUPPORTED_CHANNELS =36 , +WLAN_EID_CHANNEL_SWITCH =37 , +WLAN_EID_MEASURE_REQUEST =38 , +WLAN_EID_MEASURE_REPORT =39 , +WLAN_EID_QUIET =40 , +WLAN_EID_IBSS_DFS =41 ,/* EIDs defined as part fo 11h - ends */ -#define WLAN_EID_ERP_INFO 42 -#define WLAN_EID_RSN 48 -#define WLAN_EID_EXT_SUPP_RATES 50 -#define WLAN_EID_WPA 221 -#define WLAN_EID_GENERIC 221 -#define WLAN_EID_VENDOR_SPECIFIC 221 +WLAN_EID_ERP_INFO =42 , +WLAN_EID_RSN =48 , +WLAN_EID_EXT_SUPP_RATES =50 , +WLAN_EID_WPA =221 , +WLAN_EID_GENERIC =221 , +WLAN_EID_VENDOR_SPECIFIC =221 , +WLAN_EID_QOS_PARAMETER =222 +};
Signature · 1 line
1.3.0
PATCH 16/21 d80211: Group EIDs by standard, add remaining 802.11d EIDs
In reply to Jiri BencFrom: Michael Wu <[email protected]>
This patch groups EIDs together by the 802.11 standard they were introduced in and adds the remaining 802.11d EIDs. The spec where the QoS EID was introduced still needs to be found. (does not appear to be 802.11e..) This patch depends on the previous patch that converts the status/reason codes and EIDs to enums.
---
include/net/d80211_mgmt.h | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
6b31161b5dbf014abc07eadfa473f921d9c313ea
include/net/d80211_mgmt.h +9 -4
@@ -192,9 +192,13 @@ enum ieee80211_eid {WLAN_EID_CF_PARAMS =4 ,WLAN_EID_TIM =5 ,WLAN_EID_IBSS_PARAMS =6 , -WLAN_EID_COUNTRY =7 ,WLAN_EID_CHALLENGE =16 , -/* EIDs defined as part fo 11h - starts */ +/* 802.11d */ +WLAN_EID_COUNTRY =7 , +WLAN_EID_HP_PARAMS =8 , +WLAN_EID_HP_TABLE =9 , +WLAN_EID_REQUEST =10 , +/* 802.11h */ WLAN_EID_PWR_CONSTRAINT =32 ,WLAN_EID_PWR_CAPABILITY =33 , WLAN_EID_TPC_REQUEST = 34,
@@ -205,10 +209,11 @@ enum ieee80211_eid {WLAN_EID_MEASURE_REPORT =39 ,WLAN_EID_QUIET =40 ,WLAN_EID_IBSS_DFS =41 , -/* EIDs defined as part fo 11h - ends */ +/* 802.11g */ WLAN_EID_ERP_INFO =42 , -WLAN_EID_RSN =48 ,WLAN_EID_EXT_SUPP_RATES =50 , +/* 802.11i */ +WLAN_EID_RSN =48 ,WLAN_EID_WPA =221 ,WLAN_EID_GENERIC =221 , WLAN_EID_VENDOR_SPECIFIC = 221,
Signature · 1 line
1.3.0
PATCH 17/21 d80211: remove useless and wrong check for interface type
In reply to Jiri BencThe check for interface type in ieee80211_sta_rx_mgmt was wrong (it must allow IBSS interface as well) and unnecessary, because the check is already done in ieee80211_rx_h_mgmt.
---
net/d80211/ieee80211_sta.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
d0c2e2f74781b478f708d58aa83cb83812705af1
net/d80211/ieee80211_sta.c +0 -5
@@ -1711,11 +1711,6 @@ void ieee80211_sta_rx_mgmt(struct net_de goto fail; sdata =IEEE80211_DEV_TO_SUB_IF (dev); -if (sdata->type !=IEEE80211_IF_TYPE_STA ) { -printk (KERN_DEBUG "%s: ieee80211_sta_rx_mgmt: non-STA " -"interface (type=%d)\n" , dev->name, sdata->type); - goto fail; - } ifsta = &sdata->u.sta; mgmt = (struct ieee80211_mgmt *) skb->data;
Signature · 1 line
1.3.0
PATCH 18/21 d80211: allow for large scan results
In reply to Jiri BencFrom: David Kimdon <[email protected]>
Fix a problem where incomplete scan results could be returned if the environment includes a large number of devices. Do not truncate the scan results and allow a result to contain more than IW_SCAN_MAX_DATA bytes.
---
net/d80211/ieee80211_ioctl.c | 2 +- net/d80211/ieee80211_sta.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletions(-)
fb6433e836927581362d71532f010b0d5aa7587b
net/d80211/ieee80211_ioctl.c +1 -1
@@ -1992,7 +1992,7 @@ static int ieee80211_ioctl_giwscan(strucstruct ieee80211_local *local = dev->ieee80211_ptr;if (local->sta_scanning)return -EAGAIN ; - res =ieee80211_sta_scan_results (dev, extra,IW_SCAN_MAX_DATA ); + res =ieee80211_sta_scan_results (dev, extra, data->length);if (res >=0 ) { data->length = res;return 0 ;
net/d80211/ieee80211_sta.c +4 -0
@@ -2743,6 +2743,10 @@ int ieee80211_sta_scan_results(struct nespin_lock_bh (&local->sta_bss_lock);list_for_each (ptr, &local->sta_bss_list) { bss = list_entry(ptr, struct ieee80211_sta_bss, list); +if (buf + len - current_ev <=IW_EV_ADDR_LEN ) { +spin_unlock_bh (&local->sta_bss_lock); +return -E2BIG ; + } current_ev =ieee80211_sta_scan_result (dev, bss, current_ev, end_buf); }
Signature · 1 line
1.3.0
PATCH 19/21 d80211: fix multiple device support
In reply to Jiri BencFrom: David Kimdon <[email protected]>
Fix interpretation of dev_alloc_name() return value. dev_alloc_name() returns the number of the unit assigned or a negative errno code.
---
net/d80211/ieee80211_iface.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
a13193956bee479d72bad1bc1ccbcb831182b3d3
net/d80211/ieee80211_iface.c +1 -1
@@ -64,7 +64,7 @@ int ieee80211_if_add(struct net_device * }while (i <10000 ); }else if (format) { ret =dev_alloc_name (ndev, name); -if (ret) +if (ret <0 ) goto fail; }else {snprintf (ndev->name,IFNAMSIZ ,"%s" , name);
Signature · 1 line
1.3.0
PATCH 20/21 d80211: fix interface removal
In reply to Jiri BencFrom: David Kimdon <[email protected]>
Calls to ieee80211_if_remove() should use the ieee80211 interface types. Convert interface type from hostapd to ieee80211 format.
---
net/d80211/ieee80211_ioctl.c | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-)
6014cc141587c2c7e73abb985f7741dc7e24c105
net/d80211/ieee80211_ioctl.c +14 -7
@@ -1070,14 +1070,21 @@ #endifstatic int ieee80211_ioctl_remove_if (struct net_device *dev,struct prism2_hostapd_param *param) { -if (param->u.if_info.type !=HOSTAP_IF_WDS && - param->u.if_info.type !=HOSTAP_IF_VLAN && - param->u.if_info.type !=HOSTAP_IF_BSS && - param->u.if_info.type !=HOSTAP_IF_STA ) { -return -EINVAL ; +unsigned int type; + +if (param->u.if_info.type ==HOSTAP_IF_WDS ) { + type =IEEE80211_IF_TYPE_WDS ; + }else if (param->u.if_info.type ==HOSTAP_IF_VLAN ) { + type =IEEE80211_IF_TYPE_VLAN ; + }else if (param->u.if_info.type ==HOSTAP_IF_BSS ) { + type =IEEE80211_IF_TYPE_AP ; + }else if (param->u.if_info.type ==HOSTAP_IF_STA ) { + type =IEEE80211_IF_TYPE_STA ; + }else { +return -EINVAL ; } -return ieee80211_if_remove (dev, param->u.if_info.name, - param->u.if_info.type); + +return ieee80211_if_remove (dev, param->u.if_info.name, type); }
Signature · 1 line
1.3.0
PATCH 21/21 d80211: add ieee80211_stop_queues()
In reply to Jiri BencFrom: Michael Buesch <[email protected]>
Add ieee80211_stop_queues() to stop all queues with a single call.
I will submit a patch for bcm43xx to use this function as soon as this got merged.
---
include/net/d80211.h | 9 +++++++++ net/d80211/ieee80211.c | 10 ++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-)
414f928269a9d41642e85abc8fe47e5bc90eed6b
include/net/d80211.h +9 -0
@@ -830,6 +830,15 @@ void ieee80211_stop_queue(struct net_devvoid ieee80211_start_queues (struct net_device *dev);/** +* ieee80211_stop_queues - stop all queues +* @dev: pointer to $struct net_device as obtained from +* ieee80211_alloc_hw(). +* +* Drivers should use this function instead of netif_stop_queue. +*/ +void ieee80211_stop_queues (struct net_device *dev); + +/** * ieee80211_get_mc_list_item - iteration over items in multicast list * @dev: pointer to &struct net_device as obtained from * ieee80211_alloc_hw().
net/d80211/ieee80211.c +10 -0
@@ -4705,6 +4705,16 @@ void ieee80211_start_queues(struct net_d }EXPORT_SYMBOL (ieee80211_start_queues); +void ieee80211_stop_queues (struct net_device *dev) +{ +struct ieee80211_local *local = dev->ieee80211_ptr; +int i; + +for (i =0 ; i < local->hw->queues; i++) +ieee80211_stop_queue (dev, i); +} +EXPORT_SYMBOL (ieee80211_stop_queues); +void *ieee80211_dev_hw_data (struct net_device *dev) {struct ieee80211_local *local = dev->ieee80211_ptr;
Signature · 1 line
1.3.0
I'm also aware of these patches that need more work:
Johannes Berg:
d80211: LED triggers
add nl80211
make d80211 use nl80211
d80211: rework rate control registration
d80211: move out rate control registration codeDavid Kimdon:
d80211: add ioctl to stop data frame tx
Larry Finger:
Add wireless statics to d80211
(Add wireless statics to bcm43xx-d80211)
(Add wireless statistics code to d80211 versions of adm8211 and rt2x00)
Mohamed Abbas:
d80211: add support for SIOCSIWRATE, SIOCSIWTXPOW and SIOCSIWPOWER
d80211: iwlist scan
If a d80211 patch you sent in last three weeks is not listed above or below (and we didn't agree that we would drop it), please scream.
Thanks,
Jiri
Quoted 34 lines · Jiri Benc
Please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/jbenc/dscape.gitmaster to obtain following patches:David Kimdon:
d80211: allow for large scan results
d80211: fix multiple device support
d80211: fix interface removalJiri Benc:
d80211: remove useless and wrong check for interface typeJohannes Berg:
d80211: relax sysfs permissions
d80211: master link
d80211: pointers as extended booleans
d80211: usekzalloc()
d80211: get rid of WME bitfield
d80211: get rid ofsta_aidin favour of keeping track of TIM
d80211: clean up exports
d80211: clean up includes
d80211: fix some sparse warnings
d80211: make lowlevel TX framedump option visible
d80211: surface IBSS debug
d80211: get rid ofMICHAEL_MIC_HWACCELdefine
d80211: surface powersave debug switch
d80211: fix some documentationMichael Buesch:
d80211: add ieee80211_stop_queues()Michael Wu:
d80211: switch status codes, reason codes, and EIDs to enums
d80211: Group EIDs by standard, add remaining 802.11d EIDs
Signature · 2 lines
Jiri Benc SUSE Labs
Quoted 2 lines · Jiri Benc
Johannes Berg:
d80211: LED triggers
Yep, as noted, the fix for this is to include some more things in include/linux/leds.h, which is in -mm:
http://kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.18-rc4/2.6.18-rc4-mm2/broken-out/make-ledsh-include-relevant-headers.patch
Quoted 1 line
add nl80211
Yeah, I need to repost a fixed version.
Quoted 1 line
make d80211 use nl80211
Ditto, but would appreciate feedback on both of these.
Quoted 2 lines
d80211: rework rate control registration
d80211: move out rate control registration code
Thought you wanted to drop them?
johannes