d80211: pull request
Subsystems (2)
cover d80211: pull request
Please pull fromgit://git.kernel.org/pub/scm/linux/kernel/git/jbenc/dscape.git up2 to obtain following patches:
David Kimdon:
d80211: clear ifsta->associated flag when authentication starts
d80211: inhibit duplicate authentication requests when setting bssid
Jan Kiszka:
d80211: Reinit keys on mode change
Jiri Benc:
d80211: simplify classify_1d
d80211: small documentation fix
d80211: do not cancel uninitialized work
Johannes Berg:
d80211: add missing \n in skb queue warning
Michael Buesch:
d80211: Fix passing of invalid pointer
d80211: Fix 64bit printk warnings
d80211: Turn PHYmode list from an array into a linked list
d80211: constify ieee80211_ops pointer
Zhu Yi:
d80211: fix classify_1d() priority selection
include/net/d80211.h | 31 +++++++-------- net/d80211/ieee80211.c | 89 +++++++++++++++++------------------------- net/d80211/ieee80211_i.h | 9 +++- net/d80211/ieee80211_iface.c | 5 +- net/d80211/ieee80211_ioctl.c | 69 ++++++++++++++++----------------- net/d80211/ieee80211_scan.c | 83 ++++++++++++++++++--------------------- net/d80211/ieee80211_sta.c | 55 +++++++++++++++----------- net/d80211/ieee80211_sysfs.c | 10 ++--- net/d80211/wme.c | 19 +-------- 9 files changed, 170 insertions(+), 200 deletions(-)
Signature · 2 lines
Jiri Benc SUSE Labs
PATCH 1/12 d80211: Fix passing of invalid pointer
From: Michael Buesch <[email protected]>
ieee80211_hw pointers have to be passed to ops->set_key() and ops->get_tsf().
---
net/d80211/ieee80211_iface.c | 4 ++-- net/d80211/ieee80211_sta.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
0690925f2f99f6d43322ec8507eaabdcf1435c3c
net/d80211/ieee80211_iface.c +2 -2
@@ -227,8 +227,8 @@ #if 0* really much point in disabling the keys at this point. */ memset (addr,0xff ,ETH_ALEN );if (local->ops->set_key) - local->ops->set_key (dev,DISABLE_KEY , addr, - local->keys[i],0 ); + local->ops->set_key (local_to_hw (local),DISABLE_KEY , addr, + local->keys[i],0 );#endif ieee80211_key_free (sdata->keys[i]); }
net/d80211/ieee80211_sta.c +1 -1
@@ -1362,7 +1362,7 @@ #ifdef CONFIG_D80211_IBSS_DEBUGstatic unsigned long last_tsf_debug =0 ;u64 tsf;if (local->ops->get_tsf) - tsf = local->ops->get_tsf (local->mdev); + tsf = local->ops->get_tsf (local_to_hw (local));else tsf =-1LLU ;if (time_after (jiffies, last_tsf_debug +5 *HZ )) {
Signature · 1 line
1.3.0
PATCH 2/12 d80211: Fix 64bit printk warnings
In reply to Jiri BencFrom: Michael Buesch <[email protected]>
Fix several warnings due to incompatible datatypes on 64bit platforms.
---
net/d80211/ieee80211_sta.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
eabaa6c4f7b0546bbb5dcb9835d70d2858035bc0
net/d80211/ieee80211_sta.c +6 -3
@@ -1368,9 +1368,12 @@ #ifdef CONFIG_D80211_IBSS_DEBUGif (time_after (jiffies, last_tsf_debug +5 *HZ )) {printk (KERN_DEBUG "RX beacon SA=" MAC_FMT " BSSID=" MAC_FMT " TSF=0x%llx BCN=0x%llx diff=%lld " -"@%ld\n" , +"@%lu\n" ,MAC_ARG (mgmt->sa),MAC_ARG (mgmt->bssid), - tsf, timestamp, tsf - timestamp, jiffies); + (unsigned long long )tsf, + (unsigned long long )timestamp, + (unsigned long long )(tsf - timestamp), + jiffies); last_tsf_debug = jiffies; }#endif /* CONFIG_D80211_IBSS_DEBUG */
@@ -2693,7 +2696,7 @@ ieee80211_sta_scan_result(struct net_devif (buf) {memset (&iwe,0 ,sizeof (iwe)); iwe.cmd =IWEVCUSTOM ; -sprintf (buf,"tsf=%016llx" , bss->timestamp); +sprintf (buf,"tsf=%016llx" , (unsigned long long )(bss->timestamp)); iwe.u.data.length =strlen (buf); current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, buf);
Signature · 1 line
1.3.0
PATCH 3/12 d80211: fix classify_1d() priority selection
In reply to Jiri BencFrom: Zhu Yi <[email protected]>
I don't see any reason why packets with DSCP=0x40 should have lower IEEE 802.1D priority than packets with DSCP=0x20. Spare > Background. No?
---
net/d80211/wme.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
d131a5bef49c2d56e0a7063aaa8753b4749144d1
net/d80211/wme.c +2 -2
@@ -131,9 +131,9 @@ #endif /* CONFIG_NET_SCHED */ dscp = ip->tos &0xfc ;switch (dscp) {case 0x20 : -return 2 ; -case 0x40 :return 1 ; +case 0x40 : +return 2 ;case 0x60 :return 3 ;case 0x80 :
Signature · 1 line
1.3.0
PATCH 4/12 d80211: simplify classify_1d
In reply to Jiri BencThe switch in classify_1d can be simplified to a bit operation.
---
net/d80211/wme.c | 19 ++----------------- 1 files changed, 2 insertions(+), 17 deletions(-)
e874890656210a235fbcfe0935717f86e5d179d9
net/d80211/wme.c +2 -17
@@ -129,24 +129,9 @@ #endif /* CONFIG_NET_SCHED */ ip = (struct iphdr *) (skb->data + offset); dscp = ip->tos &0xfc ; -switch (dscp) { -case 0x20 : -return 1 ; -case 0x40 : -return 2 ; -case 0x60 : -return 3 ; -case 0x80 : -return 4 ; -case 0xa0 : -return 5 ; -case 0xc0 : -return 6 ; -case 0xe0 : -return 7 ; -default : +if (dscp &0x1c )return 0 ; - } +return dscp >>5 ; }
Signature · 1 line
1.3.0
PATCH 5/12 d80211: Turn PHYmode list from an array into a linked list
In reply to Jiri BencFrom: Michael Buesch <[email protected]>
This turns the PHY-modes list into a linked list.
The advantage is that drivers can add modes dynamically, as they probe them and don't have to settle to a given arraysize at the beginning of probing.
---
include/net/d80211.h | 27 ++++++-------- net/d80211/ieee80211.c | 80 ++++++++++++++++------------------------ net/d80211/ieee80211_i.h | 7 +++- net/d80211/ieee80211_ioctl.c | 69 +++++++++++++++++------------------ net/d80211/ieee80211_scan.c | 83 ++++++++++++++++++++---------------------- net/d80211/ieee80211_sta.c | 40 +++++++++++--------- net/d80211/ieee80211_sysfs.c | 10 ++--- 7 files changed, 148 insertions(+), 168 deletions(-)
65f2120cf1b41abd6720604ab6c41b80017d6227
include/net/d80211.h +12 -15
@@ -107,12 +107,14 @@ enum {NUM_IEEE80211_MODES =5 }; -struct ieee80211_hw_modes { -int mode; -int num_channels; -struct ieee80211_channel *channels; -int num_rates; -struct ieee80211_rate *rates; +struct ieee80211_hw_mode { +int mode;/* MODE_IEEE80211... */ +int num_channels;/* Number of channels (below) */ +struct ieee80211_channel *channels;/* Array of supported channels */ +int num_rates;/* Number of rates (below) */ +struct ieee80211_rate *rates;/* Array of supported rates */ + +struct list_head list;/* Internal, don't touch */ };struct ieee80211_tx_queue_params {
@@ -450,9 +452,7 @@ typedef enum { SET_KEY, DISABLE_KEY, REMOVE_ALL_KEYS, } set_key_cmd; -/* This is driver-visible part of the per-hw state the stack keeps. -* If you change something in here, call ieee80211_update_hw() to -* notify the stack about the change. */ +/* This is driver-visible part of the per-hw state the stack keeps. */ struct ieee80211_hw {/* these are assigned by d80211, don't write */ int index;
@@ -542,9 +542,6 @@ #define IEEE80211_HW_TKIP_REQ_PHASE2_KEY/* This is maximum value for rssi reported by this device */ int maxssi; -int num_modes; -struct ieee80211_hw_modes *modes; -/* Number of available hardware TX queues for data packets. * WMM requires at least four queues. */ int queues;
@@ -780,9 +777,9 @@ #else#endif } -/* Call this function if you changed the hardware description after -* ieee80211_register_hw */ -int ieee80211_update_hw (struct ieee80211_hw *hw); +/* Register a new hardware PHYMODE capability to the stack. */ +int ieee80211_register_hwmode (struct ieee80211_hw *hw, +struct ieee80211_hw_mode *mode);/* Unregister a hardware device. This function instructs 802.11 code to free * allocated resources and unregister netdevices from the kernel. */
net/d80211/ieee80211.c +32 -48
141 lines not on this page · raw message
net/d80211/ieee80211_i.h +5 -2
@@ -180,7 +180,7 @@ struct ieee80211_passive_scan {int channel;/* channel to be scanned */ int tries; -int mode_idx; +struct ieee80211_hw_mode *mode;int chan_idx;int freq;
@@ -335,6 +335,9 @@ struct ieee80211_local {struct ieee80211_ops *ops; +/* List of registered struct ieee80211_hw_mode */ +struct list_head modes_list; +struct net_device *mdev;/* wmaster# - "master" 802.11 device */ struct net_device *apdev;/* wlan#ap - management frames (hostapd) */ int open_count;
@@ -424,7 +427,7 @@ #define IEEE80211_IRQSAFE_QUEUE_LIMIT 12spinlock_t sub_if_lock;/* mutex for STA data structures */ struct list_head sub_if_list;int sta_scanning; -int scan_hw_mode_idx; +struct ieee80211_hw_mode *scan_hw_mode;int scan_channel_idx;enum {SCAN_SET_CHANNEL ,SCAN_SEND_PROBE } scan_state;unsigned long last_scan_completed;
net/d80211/ieee80211_ioctl.c +34 -35
139 lines not on this page · raw message
net/d80211/ieee80211_scan.c +39 -44
161 lines not on this page · raw message
net/d80211/ieee80211_sta.c +22 -18
@@ -1386,6 +1386,7 @@ #endif /* CONFIG_D80211_IBSS_DEBUG */if (sdata->type ==IEEE80211_IF_TYPE_IBSS && elems.supp_rates &&memcmp (mgmt->bssid, sdata->u.sta.bssid,ETH_ALEN ) ==0 && (sta =sta_info_get (local, mgmt->sa))) { +struct ieee80211_hw_mode *mode;struct ieee80211_rate *rates;size_t num_rates;u32 supp_rates, prev_rates;
@@ -1395,8 +1396,7 @@ #endif /* CONFIG_D80211_IBSS_DEBUG */ num_rates = local->num_curr_rates; oper_mode = local->sta_scanning ? local->scan_oper_phymode : local->hw.conf.phymode; -for (i =0 ; i < local->hw.num_modes; i++) { -struct ieee80211_hw_modes *mode = &local->hw.modes[i]; +list_for_each_entry (mode, &local->modes_list, list) {if (oper_mode == mode->mode) { rates = mode->rates; num_rates = mode->num_rates;
@@ -1930,10 +1930,10 @@ static void ieee80211_sta_new_auth(strucstatic int ieee80211_ibss_allowed (struct ieee80211_local *local) { -int m, c; +struct ieee80211_hw_mode *mode; +int c; -for (m =0 ; m < local->hw.num_modes; m++) { -struct ieee80211_hw_modes *mode = &local->hw.modes[m]; +list_for_each_entry (mode, &local->modes_list, list) {if (mode->mode != local->hw.conf.phymode)continue ;for (c =0 ; c < mode->num_channels; c++) {
@@ -2388,10 +2388,10 @@ static int ieee80211_sta_restore_oper_chstatic int ieee80211_active_scan (struct ieee80211_local *local) { -int m, c; +struct ieee80211_hw_mode *mode; +int c; -for (m =0 ; m < local->hw.num_modes; m++) { -struct ieee80211_hw_modes *mode = &local->hw.modes[m]; +list_for_each_entry (mode, &local->modes_list, list) {if (mode->mode != local->hw.conf.phymode)continue ;for (c =0 ; c < mode->num_channels; c++) {
@@ -2438,7 +2438,7 @@ static void ieee80211_sta_scan_work(voidstruct net_device *dev = ptr;struct ieee80211_local *local = dev->ieee80211_ptr;struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); -struct ieee80211_hw_modes *mode; +struct ieee80211_hw_mode *mode;struct ieee80211_channel *chan;int skip;unsigned long next_delay =0 ;
@@ -2448,10 +2448,9 @@ static void ieee80211_sta_scan_work(voidswitch (local->scan_state) {case SCAN_SET_CHANNEL : - mode = &local->hw.modes[local->scan_hw_mode_idx]; -if (local->scan_hw_mode_idx >= local->hw.num_modes || - (local->scan_hw_mode_idx +1 == local->hw.num_modes && - local->scan_channel_idx >= mode->num_channels)) { + mode = local->scan_hw_mode; +if (local->scan_hw_mode->list.next == &local->modes_list && + local->scan_channel_idx >= mode->num_channels) {if (ieee80211_sta_restore_oper_chan (dev)) { printk(KERN_DEBUG "%s: failed to restore " "operational channel after scan\n",
@@ -2491,10 +2490,13 @@ #endif } local->scan_channel_idx++; -if (local->scan_channel_idx >= - local->hw.modes[local->scan_hw_mode_idx].num_channels) { - local->scan_hw_mode_idx++; - local->scan_channel_idx =0 ; +if (local->scan_channel_idx >= local->scan_hw_mode->num_channels) { +if (local->scan_hw_mode->list.next != &local->modes_list) { + local->scan_hw_mode =list_entry (local->scan_hw_mode->list.next, + struct ieee80211_hw_mode, + list); + local->scan_channel_idx =0 ; + } }if (skip)
@@ -2580,7 +2582,9 @@ int ieee80211_sta_req_scan(struct net_de }else local->scan_ssid_len =0 ; local->scan_state =SCAN_SET_CHANNEL ; - local->scan_hw_mode_idx =0 ; + local->scan_hw_mode =list_entry (local->modes_list.next, + struct ieee80211_hw_mode, + list); local->scan_channel_idx =0 ;INIT_WORK (&local->scan_work, ieee80211_sta_scan_work, dev);schedule_work (&local->scan_work);
net/d80211/ieee80211_sysfs.c +4 -6
@@ -189,15 +189,13 @@ __IEEE80211_LOCAL_SHOW(tx_power_reductiostatic ssize_t ieee80211_local_fmt_modes (struct ieee80211_local *local,char *buf) { -int i; -struct ieee80211_hw_modes *mode; +struct ieee80211_hw_mode *mode;char *p = buf; -/* FIXME: locking against ieee80211_update_hw? */ -for (i =0 ; i < local->hw.num_modes; i++) { - mode = &local->hw.modes[i]; +/* FIXME: Locking? Could register a mode in the meantime. */ +list_for_each_entry (mode, &local->modes_list, list) p +=sprintf (p,"%s\n" ,ieee80211_mode_str_short (mode->mode)); - } +return (p - buf); }__IEEE80211_LOCAL_SHOW (modes);
Signature · 1 line
1.3.0
PATCH 6/12 d80211: add missing \n in skb queue warning
In reply to Jiri BencFrom: Johannes Berg <[email protected]>
This just adds a missing \n I noticed when I got the warning (see my other mail)
---
net/d80211/ieee80211.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
f069487d2f2a306471ed1d5fca0ed5a00730ddef
net/d80211/ieee80211.c +1 -1
@@ -4683,7 +4683,7 @@ void ieee80211_unregister_hw(struct ieeeif (skb_queue_len (&local->skb_queue) ||skb_queue_len (&local->skb_queue_unreliable)) -printk (KERN_WARNING "%s: skb_queue not empty" , +printk (KERN_WARNING "%s: skb_queue not empty\n" , local->mdev->name);skb_queue_purge (&local->skb_queue);skb_queue_purge (&local->skb_queue_unreliable);
Signature · 1 line
1.3.0
PATCH 7/12 d80211: constify ieee80211_ops pointer
In reply to Jiri BencFrom: Michael Buesch <[email protected]>
const-ify the ieee80211_ops pointer to allow
* The compiler to do opimizations
* The drivers to declare this structure const.
---
include/net/d80211.h | 2 +- net/d80211/ieee80211.c | 2 +- net/d80211/ieee80211_i.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
9d037dc28e7f453a2dbda17284d78ae18d15f646
include/net/d80211.h +1 -1
@@ -740,7 +740,7 @@ struct ieee80211_ops {* priv_data_len. */ struct ieee80211_hw *ieee80211_alloc_hw (size_t priv_data_len, -struct ieee80211_ops *ops); +const struct ieee80211_ops *ops);/* Register hardware device to the IEEE 802.11 code and kernel. Low-level * drivers must call this function before using any other IEEE 802.11
net/d80211/ieee80211.c +1 -1
@@ -4392,7 +4392,7 @@ static void rate_control_deinitialize(st }struct ieee80211_hw *ieee80211_alloc_hw (size_t priv_data_len, -struct ieee80211_ops *ops) +const struct ieee80211_ops *ops) {struct net_device *mdev;struct ieee80211_local *local;
net/d80211/ieee80211_i.h +1 -1
@@ -333,7 +333,7 @@ struct ieee80211_local {* it first anyway so they become a no-op */ struct ieee80211_hw hw; -struct ieee80211_ops *ops; +const struct ieee80211_ops *ops;/* List of registered struct ieee80211_hw_mode */ struct list_head modes_list;
Signature · 1 line
1.3.0
PATCH 8/12 d80211: small documentation fix
In reply to Jiri Bencieee80211_register_hwmode is allowed to be called before ieee80211_register_hw.
---
include/net/d80211.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
acc7a635825dfc3b077630d8be621504ac71637e
include/net/d80211.h +1 -1
@@ -744,7 +744,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(/* Register hardware device to the IEEE 802.11 code and kernel. Low-level * drivers must call this function before using any other IEEE 802.11 -* function. */ +* function except ieee80211_register_hwmode. */ int ieee80211_register_hw (struct ieee80211_hw *hw);/* driver can use this and ieee80211_get_rx_led_name to get the
Signature · 1 line
1.3.0
PATCH 9/12 d80211: do not cancel uninitialized work
In reply to Jiri BencWhen ops->hw_scan is set, scan_work is never initialized thus canceling it causes weird problems.
---
net/d80211/ieee80211.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
82c4e75463da9d3f38540198c4594cafe336b3e1
net/d80211/ieee80211.c +3 -2
@@ -2082,7 +2082,8 @@ void ieee80211_if_shutdown(struct net_decase IEEE80211_IF_TYPE_IBSS : sdata->u.sta.state =IEEE80211_DISABLED ;cancel_delayed_work (&sdata->u.sta.work); -if (local->scan_work.data == sdata->dev) { +if (!local->ops->hw_scan && + local->scan_work.data == sdata->dev) { local->sta_scanning =0 ;cancel_delayed_work (&local->scan_work);flush_scheduled_work ();
@@ -4660,7 +4661,7 @@ void ieee80211_unregister_hw(struct ieeeif (local->stat_time)del_timer_sync (&local->stat_timer); -if (local->scan_work.data) { +if (!local->ops->hw_scan && local->scan_work.data) { local->sta_scanning =0 ;cancel_delayed_work (&local->scan_work);flush_scheduled_work ();
Signature · 1 line
1.3.0
PATCH 10/12 d80211: clear ifsta->associated flag when authentication starts
In reply to Jiri BencFrom: David Kimdon <[email protected]>
The 'associated' flag might be set if a previous association did not end cleanly. If the 'associated' flag is left set here then when association succeeds ieee80211_set_associated() will think there is nothing to report and will not inform userspace of the event.
---
net/d80211/ieee80211_sta.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
90be57e78c95bd0e66a2047c39d91156d63d6f4c
net/d80211/ieee80211_sta.c +1 -1
@@ -1923,7 +1923,7 @@ static void ieee80211_sta_new_auth(strucprintk (KERN_DEBUG "%s: Initial auth_alg=%d\n" , dev->name, ifsta->auth_alg); ifsta->auth_transaction =-1 ; - ifsta->auth_tries = ifsta->assoc_tries =0 ; + ifsta->associated = ifsta->auth_tries = ifsta->assoc_tries =0 ;ieee80211_authenticate (dev, ifsta); }
Signature · 1 line
1.3.0
PATCH 11/12 d80211: inhibit duplicate authentication requests when setting bssid
In reply to Jiri BencFrom: David Kimdon <[email protected]>
If we are already authenticating don't send another authentication request.
---
net/d80211/ieee80211_sta.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
ca363cfd2c934d40dd0c24a52e58921d355b3c01
net/d80211/ieee80211_sta.c +1 -1
@@ -2354,7 +2354,7 @@ int ieee80211_sta_set_bssid(struct net_d ifsta->bssid_set =0 ; else ifsta->bssid_set = 1; -if (ifsta->ssid_set) +if (ifsta->ssid_set && ifsta->state !=IEEE80211_AUTHENTICATE )ieee80211_sta_new_auth (dev, ifsta);return 0 ;
Signature · 1 line
1.3.0
PATCH 12/12 d80211: Reinit keys on mode change
In reply to Jiri BencFrom: Jan Kiszka <[email protected]>
Switching the interface mode with some encryption keys set and then later touching any key, triggers an oops because ieee80211_if_reinit fails to NULL'ify the related pointers after free'ing the key on mode change. Long explanation, simple fix below.
---
net/d80211/ieee80211_iface.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
ff6a6797032d232d07be32594fdd7369cd927382
net/d80211/ieee80211_iface.c +1 -0
@@ -231,6 +231,7 @@ #if 0 local->keys[i], 0);#endif ieee80211_key_free (sdata->keys[i]); + sdata->keys[i] =NULL ; }/* Shouldn't be necessary but won't hurt */
Signature · 1 line
1.3.0