aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-27 07:18:36 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-03 07:50:34 -0400
commita1845fc7c552977e23fe552ad3f5c6c279e3d550 (patch)
tree6d2789387757141044dbbaf3c361bcc58809aa13 /net/mac80211
parent1b083ea4c072e49a6b0d4a1a6d5d9a6e4b3606b1 (diff)
mac80211: add TX prepare API
Some drivers require setup before being able to send management frames in managed mode, in particular in multi-channel cases. Introduce API to allow the drivers to do such setup while being able to sleep waiting for the setup to finish in the device. This isn't possible inside the TX call since that can't sleep. A future patch may also restructure the TX retry to wait for the driver to report the frame status, as suggested by Arik in http://mid.gmane.org/CA+XVXffKSEL6ZQPQ98x-zO-NL2=TNF1uN==mprRyUmAaRn254g@mail.gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/driver-ops.h14
-rw-r--r--net/mac80211/mlme.c8
-rw-r--r--net/mac80211/trace.h7
3 files changed, 29 insertions, 0 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 5042151a3325..df9203199102 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -852,4 +852,18 @@ static inline int drv_get_rssi(struct ieee80211_local *local,
852 852
853 return ret; 853 return ret;
854} 854}
855
856static inline void drv_mgd_prepare_tx(struct ieee80211_local *local,
857 struct ieee80211_sub_if_data *sdata)
858{
859 might_sleep();
860
861 check_sdata_in_driver(sdata);
862 WARN_ON_ONCE(sdata->vif.type != NL80211_IFTYPE_STATION);
863
864 trace_drv_mgd_prepare_tx(local, sdata);
865 if (local->ops->mgd_prepare_tx)
866 local->ops->mgd_prepare_tx(&local->hw, &sdata->vif);
867 trace_drv_return_void(local);
868}
855#endif /* __MAC80211_DRIVER_OPS */ 869#endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e9c0d1b68fc8..d563f7c55531 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -541,6 +541,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
541 memcpy(pos, assoc_data->ie + offset, noffset - offset); 541 memcpy(pos, assoc_data->ie + offset, noffset - offset);
542 } 542 }
543 543
544 drv_mgd_prepare_tx(local, sdata);
545
544 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 546 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
545 ieee80211_tx_skb(sdata, skb); 547 ieee80211_tx_skb(sdata, skb);
546} 548}
@@ -580,6 +582,9 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
580 if (!(ifmgd->flags & IEEE80211_STA_MFP_ENABLED)) 582 if (!(ifmgd->flags & IEEE80211_STA_MFP_ENABLED))
581 IEEE80211_SKB_CB(skb)->flags |= 583 IEEE80211_SKB_CB(skb)->flags |=
582 IEEE80211_TX_INTFL_DONT_ENCRYPT; 584 IEEE80211_TX_INTFL_DONT_ENCRYPT;
585
586 drv_mgd_prepare_tx(local, sdata);
587
583 ieee80211_tx_skb(sdata, skb); 588 ieee80211_tx_skb(sdata, skb);
584 } 589 }
585} 590}
@@ -1756,6 +1761,7 @@ static void ieee80211_auth_challenge(struct ieee80211_sub_if_data *sdata,
1756 if (!elems.challenge) 1761 if (!elems.challenge)
1757 return; 1762 return;
1758 auth_data->expected_transaction = 4; 1763 auth_data->expected_transaction = 4;
1764 drv_mgd_prepare_tx(sdata->local, sdata);
1759 ieee80211_send_auth(sdata, 3, auth_data->algorithm, 1765 ieee80211_send_auth(sdata, 3, auth_data->algorithm,
1760 elems.challenge - 2, elems.challenge_len + 2, 1766 elems.challenge - 2, elems.challenge_len + 2,
1761 auth_data->bss->bssid, auth_data->bss->bssid, 1767 auth_data->bss->bssid, auth_data->bss->bssid,
@@ -2641,6 +2647,8 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)
2641 return -ETIMEDOUT; 2647 return -ETIMEDOUT;
2642 } 2648 }
2643 2649
2650 drv_mgd_prepare_tx(local, sdata);
2651
2644 if (auth_data->bss->proberesp_ies) { 2652 if (auth_data->bss->proberesp_ies) {
2645 sdata_info(sdata, "send auth to %pM (try %d/%d)\n", 2653 sdata_info(sdata, "send auth to %pM (try %d/%d)\n",
2646 auth_data->bss->bssid, auth_data->tries, 2654 auth_data->bss->bssid, auth_data->tries,
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 2e60f4acd027..e1e9d10ec2e7 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1244,6 +1244,13 @@ TRACE_EVENT(drv_get_rssi,
1244 ) 1244 )
1245); 1245);
1246 1246
1247DEFINE_EVENT(local_sdata_evt, drv_mgd_prepare_tx,
1248 TP_PROTO(struct ieee80211_local *local,
1249 struct ieee80211_sub_if_data *sdata),
1250
1251 TP_ARGS(local, sdata)
1252);
1253
1247/* 1254/*
1248 * Tracing for API calls that drivers call. 1255 * Tracing for API calls that drivers call.
1249 */ 1256 */