patches for mac80211/cfg80211 2016-10-18
Subsystems (4)
cover patches for mac80211/cfg80211 2016-10-18
From: Luca Coelho <[email protected]>
Hi Johannes,
Here are a few patches for mac80211/cfg80211 from our internal tree. You're probably familiar with most of them, I'm just adding a cover letter to make it easier for you to reply "Applied all" (hopefully).:)
Cheers,
Luca.
Emmanuel Grumbach (2):
mac80211: allow the driver not to pass the tid to
ieee80211_sta_uapsd_trigger
mac80211: uapsd_queues is in QoS IE order
Ilan Peer (1):
cfg80211: Call rdev_disconnect() when connection is in progress
Johannes Berg (3):
wireless: radiotap: fix timestamp sampling position values
mac80211: fix tid_agg_rx NULL dereference
mac80211: improve RX aggregation data in debugfs
Sara Sharon (1):
mac80211: add a HW flag for supporting HW TX fragmentation
drivers/net/wireless/ath/ath10k/mac.c | 1 + drivers/net/wireless/ti/wlcore/main.c | 1 + include/net/cfg80211.h | 10 ++++++---- include/net/ieee80211_radiotap.h | 4 ++-- include/net/mac80211.h | 17 ++++++++++++++--- net/mac80211/agg-rx.c | 8 ++------ net/mac80211/debugfs.c | 1 + net/mac80211/debugfs_sta.c | 9 +++++++-- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/main.c | 4 ++++ net/mac80211/mlme.c | 2 +- net/mac80211/rx.c | 6 ++++-- net/mac80211/sta_info.c | 13 ++++++++----- net/mac80211/sta_info.h | 4 ++-- net/mac80211/tx.c | 4 ++-- net/mac80211/util.c | 7 +++++++ net/mac80211/wpa.c | 2 +- net/wireless/sme.c | 2 +- 18 files changed, 66 insertions(+), 31 deletions(-)
Signature · 1 line
2.9.3
PATCH 1/7 wireless: radiotap: fix timestamp sampling position values
From: Johannes Berg <[email protected]>
The values don't match the radiotap spec, corrected that.
--- include/net/ieee80211_radiotap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/net/ieee80211_radiotap.h +2 -2
@@ -333,9 +333,9 @@ enum ieee80211_radiotap_type {#define IEEE80211_RADIOTAP_TIMESTAMP_UNIT_NS 0x0003#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_MASK 0x00F0#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_BEGIN_MDPU 0x0000 -#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_MPDU 0x0010 +#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_PLCP_SIG_ACQ 0x0010#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_PPDU 0x0020 -#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_PLCP_SIG_ACQ 0x0030 +#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_EO_MPDU 0x0030#define IEEE80211_RADIOTAP_TIMESTAMP_SPOS_UNKNOWN 0x00F0#define IEEE80211_RADIOTAP_TIMESTAMP_FLAG_64BIT 0x00
Signature · 1 line
2.9.3
PATCH 2/7 mac80211: fix tid_agg_rx NULL dereference
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
On drivers setting the SUPPORTS_REORDERING_BUFFER hardware flag, we crash when the peer sends an AddBA request while we already have a session open on the seame TID; this is because on those drivers, the tid_agg_rx is left NULL even though the session is valid, and the agg_session_valid bit is set.
To fix this, store the dialog tokens outside the tid_agg_rx to be able to compare them to the received AddBA request.
--- net/mac80211/agg-rx.c | 8 ++------ net/mac80211/debugfs_sta.c | 2 +- net/mac80211/sta_info.h | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-)
net/mac80211/agg-rx.c +2 -6
@@ -315,11 +315,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,mutex_lock (&sta->ampdu_mlme.mtx);if (test_bit (tid, sta->ampdu_mlme.agg_session_valid)) { - tid_agg_rx =rcu_dereference_protected ( - sta->ampdu_mlme.tid_rx[tid], -lockdep_is_held (&sta->ampdu_mlme.mtx)); - -if (tid_agg_rx->dialog_token == dialog_token) { +if (sta->ampdu_mlme.tid_rx_token[tid] == dialog_token) {ht_dbg_ratelimited (sta->sdata,"updated AddBA Req from %pM on tid %u\n" , sta->sta.addr, tid);
@@ -396,7 +392,6 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, }/* update data */ - tid_agg_rx->dialog_token = dialog_token; tid_agg_rx->ssn = start_seq_num; tid_agg_rx->head_seq_num = start_seq_num; tid_agg_rx->buf_size = buf_size;
@@ -418,6 +413,7 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,if (status ==WLAN_STATUS_SUCCESS ) {__set_bit (tid, sta->ampdu_mlme.agg_session_valid);__clear_bit (tid, sta->ampdu_mlme.unexpected_agg); + sta->ampdu_mlme.tid_rx_token[tid] = dialog_token; }mutex_unlock (&sta->ampdu_mlme.mtx);
net/mac80211/debugfs_sta.c +1 -1
@@ -205,7 +205,7 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, p +=scnprintf (p,sizeof (buf) + buf - p,"%02d" , i); p +=scnprintf (p,sizeof (buf) + buf - p,"\t\t%x" , !!tid_rx); p +=scnprintf (p,sizeof (buf) + buf - p,"\t%#.2x" , - tid_rx ? tid_rx->dialog_token :0 ); + tid_rx ? sta->ampdu_mlme.tid_rx_token[i] :0 ); p +=scnprintf (p,sizeof (buf) + buf - p,"\t%#.3x" , tid_rx ? tid_rx->ssn :0 );
net/mac80211/sta_info.h +2 -2
@@ -184,7 +184,6 @@ struct tid_ampdu_tx {* @ssn: Starting Sequence Number expected to be aggregated. * @buf_size: buffer size for incoming A-MPDUs * @timeout: reset timer value (in TUs). -* @dialog_token: dialog token for aggregation session * @rcu_head: RCU head used for freeing this struct * @reorder_lock: serializes access to reorder buffer, see below. * @auto_seq: used for offloaded BA sessions to automatically pick head_seq_and
@@ -213,7 +212,6 @@ struct tid_ampdu_rx {u16 ssn;u16 buf_size;u16 timeout; -u8 dialog_token;bool auto_seq;bool removed; };
@@ -225,6 +223,7 @@ struct tid_ampdu_rx {* to tid_tx[idx], which are protected by the sta spinlock) * tid_start_tx is also protected by sta->lock. * @tid_rx: aggregation info for Rx per TID -- RCU protected +* @tid_rx_token: dialog tokens for valid aggregation sessions * @tid_rx_timer_expired: bitmap indicating on which TIDs the * RX timer expired until the work for it runs * @tid_rx_stop_requested: bitmap indicating which BA sessions per TID the
@@ -243,6 +242,7 @@ struct sta_ampdu_mlme {struct mutex mtx;/* rx */ struct tid_ampdu_rx __rcu *tid_rx[IEEE80211_NUM_TIDS ]; +u8 tid_rx_token[IEEE80211_NUM_TIDS ];unsigned long tid_rx_timer_expired[BITS_TO_LONGS (IEEE80211_NUM_TIDS )];unsigned long tid_rx_stop_requested[BITS_TO_LONGS (IEEE80211_NUM_TIDS )];unsigned long agg_session_valid[BITS_TO_LONGS (IEEE80211_NUM_TIDS )];
Signature · 1 line
2.9.3
PATCH 3/7 mac80211: improve RX aggregation data in debugfs
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
When the driver sets the SUPPORTS_REORDERING_BUFFER hardware flag, the debugfs data for RX aggregation sessions won't even indicate that a session is open. Since the previous fix to store the dialog token separately, we can indicate that it's open and add the token so that there's at least some data (ssn is not available.)
--- net/mac80211/debugfs_sta.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
net/mac80211/debugfs_sta.c +7 -2
@@ -199,13 +199,18 @@ static ssize_t sta_agg_status_read(struct file *file, char __user *userbuf, "TID\t\tRX\tDTKN\tSSN\t\tTX\tDTKN\tpending\n");for (i =0 ; i <IEEE80211_NUM_TIDS ; i++) { +bool tid_rx_valid; + tid_rx =rcu_dereference (sta->ampdu_mlme.tid_rx[i]); tid_tx =rcu_dereference (sta->ampdu_mlme.tid_tx[i]); + tid_rx_valid =test_bit (i, sta->ampdu_mlme.agg_session_valid); p +=scnprintf (p,sizeof (buf) + buf - p,"%02d" , i); - p +=scnprintf (p,sizeof (buf) + buf - p,"\t\t%x" , !!tid_rx); + p +=scnprintf (p,sizeof (buf) + buf - p,"\t\t%x" , + tid_rx_valid); p +=scnprintf (p,sizeof (buf) + buf - p,"\t%#.2x" , - tid_rx ? sta->ampdu_mlme.tid_rx_token[i] :0 ); + tid_rx_valid ? + sta->ampdu_mlme.tid_rx_token[i] :0 ); p +=scnprintf (p,sizeof (buf) + buf - p,"\t%#.3x" , tid_rx ? tid_rx->ssn :0 );
Signature · 1 line
2.9.3
PATCH 4/7 mac80211: allow the driver not to pass the tid to ieee80211_sta_uapsd_trigger
In reply to Luca CoelhoFrom: Emmanuel Grumbach <[email protected]>
iwlwifi will check internally that the tid maps to an AC that is trigger enabled, but can't know what tid exactly. Allow the driver to pass a generic tid and make mac80211 assume that a trigger frame was received.
--- include/net/mac80211.h | 4 ++++ net/mac80211/rx.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-)
include/net/mac80211.h +4 -0
@@ -4087,6 +4087,10 @@ void ieee80211_sta_pspoll(struct ieee80211_sta *sta);* This must be used in conjunction with ieee80211_sta_ps_transition() * and possibly ieee80211_sta_pspoll(); calls to all three must be * serialized. +* %IEEE80211_NUM_TIDS can be passed as the tid if the tid is unknown. +* In this case, mac80211 will not check that this tid maps to an AC +* that is trigger enabled and assume that the caller did the proper +* checks. */ void ieee80211_sta_uapsd_trigger (struct ieee80211_sta *sta,u8 tid);
net/mac80211/rx.c +3 -2
@@ -1394,13 +1394,14 @@ void ieee80211_sta_uapsd_trigger(struct ieee80211_sta *pubsta, u8 tid)u8 ac = ieee802_1d_to_ac[tid &7 ];/* -* If this AC is not trigger-enabled do nothing. +* If this AC is not trigger-enabled do nothing unless the +* driver is calling us after it already checked. * * NB: This could/should check a separate bitmap of trigger- * enabled queues, but for now we only implement uAPSD w/o * TSPEC changes to the ACs, so they're always the same. */ -if (!(sta->sta.uapsd_queues &BIT (ac))) +if (!(sta->sta.uapsd_queues &BIT (ac)) && tid !=IEEE80211_NUM_TIDS )return ;/* if we are in a service period, do nothing */
Signature · 1 line
2.9.3
PATCH 5/7 mac80211: add a HW flag for supporting HW TX fragmentation
In reply to Luca CoelhoFrom: Sara Sharon <[email protected]>
Currently mac80211 determines whether HW does fragmentation by checking whether the set_frag_threshold callback is set or not.
However, some drivers may want to set the HW fragmentation capability depending on HW generation.
Allow this by checking a HW flag instead of checking the callback.
--- drivers/net/wireless/ath/ath10k/mac.c | 1 + drivers/net/wireless/ti/wlcore/main.c | 1 + include/net/mac80211.h | 10 ++++++++-- net/mac80211/debugfs.c | 1 + net/mac80211/main.c | 4 ++++ net/mac80211/tx.c | 4 ++-- net/mac80211/wpa.c | 2 +- 7 files changed, 18 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +1 -0
@@ -7881,6 +7881,7 @@ int ath10k_mac_register(struct ath10k *ar)ieee80211_hw_set (ar->hw,WANT_MONITOR_VIF );ieee80211_hw_set (ar->hw,CHANCTX_STA_CSA );ieee80211_hw_set (ar->hw,QUEUE_CONTROL ); +ieee80211_hw_set (ar->hw,SUPPORTS_TX_FRAG );if (!test_bit (ATH10K_FLAG_RAW_MODE , &ar->dev_flags))ieee80211_hw_set (ar->hw,SW_CRYPTO_CONTROL );
drivers/net/wireless/ti/wlcore/main.c +1 -0
@@ -6086,6 +6086,7 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)ieee80211_hw_set (wl->hw,SUPPORTS_DYNAMIC_PS );ieee80211_hw_set (wl->hw,SIGNAL_DBM );ieee80211_hw_set (wl->hw,SUPPORTS_PS ); +ieee80211_hw_set (wl->hw,SUPPORTS_TX_FRAG ); wl->hw->wiphy->cipher_suites = cipher_suites; wl->hw->wiphy->n_cipher_suites =ARRAY_SIZE (cipher_suites);
include/net/mac80211.h +8 -2
@@ -2025,6 +2025,10 @@ struct ieee80211_txq {* drivers, mac80211 packet loss mechanism will not be triggered and driver * is completely depending on firmware event for station kickout. * +* @IEEE80211_HW_SUPPORTS_TX_FRAG: Hardware does fragmentation by itself. +* The stack will not do fragmentation. +* The callback for @set_frag_threshold should be set as well. +* * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags {
@@ -2066,6 +2070,7 @@ enum ieee80211_hw_flags {IEEE80211_HW_TX_AMSDU ,IEEE80211_HW_TX_FRAG_LIST ,IEEE80211_HW_REPORTS_LOW_ACK , +IEEE80211_HW_SUPPORTS_TX_FRAG ,/* keep last, obviously */ NUM_IEEE80211_HW_FLAGS
@@ -3093,8 +3098,9 @@ enum ieee80211_reconfig_type {* The callback must be atomic. * * @set_frag_threshold: Configuration of fragmentation threshold. Assign this -* if the device does fragmentation by itself; if this callback is -* implemented then the stack will not do fragmentation. +* if the device does fragmentation by itself. Note that to prevent the +* stack from doing fragmentation IEEE80211_HW_SUPPORTS_TX_FRAG +* should be set as well. * The callback can sleep. * * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
net/mac80211/debugfs.c +1 -0
@@ -210,6 +210,7 @@ static const char *hw_flag_names[] = {FLAG (TX_AMSDU ),FLAG (TX_FRAG_LIST ),FLAG (REPORTS_LOW_ACK ), +FLAG (SUPPORTS_TX_FRAG ), #undef FLAG };
net/mac80211/main.c +4 -0
@@ -821,6 +821,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) !local->ops->tdls_recv_channel_switch))return -EOPNOTSUPP ; +if (WARN_ON (ieee80211_hw_check (hw,SUPPORTS_TX_FRAG ) && + !local->ops->set_frag_threshold)) +return -EINVAL ; +if (WARN_ON (local->hw.wiphy->interface_modes &BIT (NL80211_IFTYPE_NAN ) && (!local->ops->start_nan || !local->ops->stop_nan)))
net/mac80211/tx.c +2 -2
@@ -934,7 +934,7 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)if (info->flags &IEEE80211_TX_CTL_DONTFRAG )return TX_CONTINUE ; -if (tx->local->ops->set_frag_threshold) +if (ieee80211_hw_check (&tx->local->hw,SUPPORTS_TX_FRAG ))return TX_CONTINUE ;/*
@@ -2800,7 +2800,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)/* fast-xmit doesn't handle fragmentation at all */ if (local->hw.wiphy->frag_threshold != (u32)-1 && - !local->ops->set_frag_threshold) + !ieee80211_hw_check (&local->hw,SUPPORTS_TX_FRAG )) goto out;rcu_read_lock ();
net/mac80211/wpa.c +1 -1
@@ -57,7 +57,7 @@ ieee80211_tx_h_michael_mic_add(struct ieee80211_tx_data *tx)if (info->control.hw_key && (info->flags &IEEE80211_TX_CTL_DONTFRAG || - tx->local->ops->set_frag_threshold) && +ieee80211_hw_check (&tx->local->hw,SUPPORTS_TX_FRAG )) && !(tx->key->conf.flags &IEEE80211_KEY_FLAG_GENERATE_MMIC )) {/* hwaccel - with no need for SW-generated MMIC */ return TX_CONTINUE ;
Signature · 1 line
2.9.3
PATCH 6/7 mac80211: uapsd_queues is in QoS IE order
In reply to Luca CoelhoFrom: Emmanuel Grumbach <[email protected]>
The uapsd_queue field is in QoS IE order and not in IEEE80211_AC_*'s order.
This means that mac80211 would get confused between BK and BE which is certainly not such a big deal but needs to be fixed.
--- include/net/cfg80211.h | 3 ++- include/net/mac80211.h | 3 ++- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/mlme.c | 2 +- net/mac80211/rx.c | 3 ++- net/mac80211/sta_info.c | 13 ++++++++----- net/mac80211/util.c | 7 +++++++ 7 files changed, 24 insertions(+), 9 deletions(-)
include/net/cfg80211.h +2 -1
@@ -4574,7 +4574,8 @@ void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr);* moves to cfg80211 in this call * @buf: authentication frame (header + body) * @len: length of the frame data -* @uapsd_queues: bitmap of ACs configured to uapsd. -1 if n/a. +* @uapsd_queues: bitmap of queues configured for uapsd. Same format +* as the AC bitmap in the QoS info field * * After being asked to associate via cfg80211_ops::assoc() the driver must * call either this function or cfg80211_auth_timeout().
include/net/mac80211.h +2 -1
@@ -1745,7 +1745,8 @@ struct ieee80211_sta_rates {* @drv_priv: data area for driver use, will always be aligned to * sizeof(void *), size is determined in hw information. * @uapsd_queues: bitmap of queues configured for uapsd. Only valid -* if wme is supported. +* if wme is supported. The bits order is like in +* IEEE80211_WMM_IE_STA_QOSINFO_AC_*. * @max_sp: max Service Period. Only valid if wme is supported. * @bandwidth: current bandwidth the station can receive with * @rx_nss: in HT/VHT, the maximum number of spatial streams the
net/mac80211/ieee80211_i.h +2 -0
@@ -84,6 +84,8 @@ struct ieee80211_local;#define IEEE80211_DEFAULT_MAX_SP_LEN \ IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL +extern const u8 ieee80211_ac_to_qos_mask[IEEE80211_NUM_ACS ]; + #define IEEE80211_DEAUTH_FRAME_LEN (24 /* hdr */ + 2 /* reason */)#define IEEE80211_MAX_NAN_INSTANCE_ID 255
net/mac80211/mlme.c +1 -1
@@ -3193,7 +3193,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, uapsd_queues =0 ;for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++)if (sdata->tx_conf[ac].uapsd) - uapsd_queues |=BIT (ac); + uapsd_queues |= ieee80211_ac_to_qos_mask[ac]; }cfg80211_rx_assoc_resp (sdata->dev, bss, (u8 *)mgmt, len, uapsd_queues);
net/mac80211/rx.c +2 -1
@@ -1401,7 +1401,8 @@ void ieee80211_sta_uapsd_trigger(struct ieee80211_sta *pubsta, u8 tid)* enabled queues, but for now we only implement uAPSD w/o * TSPEC changes to the ACs, so they're always the same. */ -if (!(sta->sta.uapsd_queues &BIT (ac)) && tid !=IEEE80211_NUM_TIDS ) +if (!(sta->sta.uapsd_queues & ieee80211_ac_to_qos_mask[ac]) && + tid !=IEEE80211_NUM_TIDS )return ;/* if we are in a service period, do nothing */
net/mac80211/sta_info.c +8 -5
@@ -709,7 +709,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) {unsigned long tids; -if (ignore_for_tim &BIT (ac)) +if (ignore_for_tim & ieee80211_ac_to_qos_mask[ac])continue ; indicate_tim |= !skb_queue_empty(&sta->tx_filtered[ac]) ||
@@ -1389,7 +1389,7 @@ ieee80211_sta_ps_more_data(struct sta_info *sta, u8 ignored_acs,return true;for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) { -if (ignored_acs &BIT (ac)) +if (ignored_acs & ieee80211_ac_to_qos_mask[ac])continue ; if (!skb_queue_empty(&sta->tx_filtered[ac]) ||
@@ -1414,7 +1414,7 @@ ieee80211_sta_ps_get_frames(struct sta_info *sta, int n_frames, u8 ignored_acs,for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) {unsigned long tids; -if (ignored_acs &BIT (ac)) +if (ignored_acs & ieee80211_ac_to_qos_mask[ac])continue ; tids =ieee80211_tids_for_ac (ac);
@@ -1482,7 +1482,7 @@ ieee80211_sta_ps_deliver_response(struct sta_info *sta,BIT (find_highest_prio_tid (driver_release_tids));if (skb_queue_empty (&frames) && !driver_release_tids) { -int tid; +int tid, ac;/* * For PS-Poll, this can only happen due to a race condition
@@ -1500,7 +1500,10 @@ ieee80211_sta_ps_deliver_response(struct sta_info *sta,*/ /* This will evaluate to 1, 3, 5 or 7. */ - tid =7 - ((ffs (~ignored_acs) -1 ) <<1 ); +for (ac =IEEE80211_AC_VO ; ac <IEEE80211_NUM_ACS ; ac++) +if (ignored_acs &BIT (ac)) +continue ; + tid =7 -2 * ac;ieee80211_send_null_response (sta, tid, reason, true, false); }else if (!driver_release_tids) {
net/mac80211/util.c +7 -0
@@ -3452,3 +3452,10 @@ void ieee80211_txq_get_depth(struct ieee80211_txq *txq, *byte_cnt = txqi->tin.backlog_bytes + frag_bytes; }EXPORT_SYMBOL (ieee80211_txq_get_depth); + +const u8 ieee80211_ac_to_qos_mask[IEEE80211_NUM_ACS ] = { +IEEE80211_WMM_IE_STA_QOSINFO_AC_VO , +IEEE80211_WMM_IE_STA_QOSINFO_AC_VI , +IEEE80211_WMM_IE_STA_QOSINFO_AC_BE , +IEEE80211_WMM_IE_STA_QOSINFO_AC_BK +};
Signature · 1 line
2.9.3
PATCH 7/7 cfg80211: Call rdev_disconnect() when connection is in progress
In reply to Luca CoelhoFrom: Ilan Peer <[email protected]>
On a disconnect request from user space, cfg80211 would have called rdev_disconnect() only in case that 'current_bss' was set, i.e., connection has been established.
Change this, so rdev_disconnect() would be called also in case that connection is in progress, so the connection attempt would be stopped.
--- include/net/cfg80211.h | 7 ++++--- net/wireless/sme.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-)
include/net/cfg80211.h +4 -3
@@ -2564,9 +2564,10 @@ struct cfg80211_nan_func {* cases, the result of roaming is indicated with a call to * cfg80211_roamed() or cfg80211_roamed_bss(). * (invoked with the wireless_dev mutex held) -* @disconnect: Disconnect from the BSS/ESS. Once done, call -* cfg80211_disconnected(). -* (invoked with the wireless_dev mutex held) +* @disconnect: Disconnect from the BSS/ESS or stop connection attempts if +* connection is in progress. Once done, call cfg80211_disconnected() in +* case connection was already established (invoked with the +* wireless_dev mutex held), otherwise call cfg80211_connect_timeout(). * * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call * cfg80211_ibss_joined(), also call that function when changing BSSID due
net/wireless/sme.c +1 -1
@@ -1088,7 +1088,7 @@ int cfg80211_disconnect(struct cfg80211_registered_device *rdev, err =cfg80211_sme_disconnect (wdev, reason); else if (!rdev->ops->disconnect)cfg80211_mlme_down (rdev, dev); - else if (wdev->current_bss) + else if (wdev->ssid_len) err =rdev_disconnect (rdev, dev, reason);return err;
Signature · 1 line
2.9.3
Johannes Berg
maintainerQuoted 8 lines · Luca Coelho
From: Luca Coelho <[email protected]>
Hi Johannes,
Here are a few patches for mac80211/cfg80211 from our internal tree. You're probably familiar with most of them, I'm just adding a cover letter to make it easier for you to reply "Applied all" (hopefully).:)
Heh, ok, done; all are in mac80211-next, I didn't think they were important for mac80211. My NULL deref fix is debatable, but the hardware that supports this isn't shipping yet, and will never work with this kernel due to firmware release/compatibility anyway.
Also the NAN patch you sent separately.
johannes