diff options
-rw-r--r-- | include/net/mac80211.h | 4 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 5 | ||||
-rw-r--r-- | net/mac80211/rate.c | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index bc799304be71..135e897b61c7 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -372,6 +372,9 @@ struct ieee80211_bss_conf { | |||
372 | * an SP that mac80211 transmits, it is already set; for driver frames | 372 | * an SP that mac80211 transmits, it is already set; for driver frames |
373 | * the driver may set this flag. It is also used to do the same for | 373 | * the driver may set this flag. It is also used to do the same for |
374 | * PS-Poll responses. | 374 | * PS-Poll responses. |
375 | * @IEEE80211_TX_CTL_USE_MINRATE: This frame will be sent at lowest rate. | ||
376 | * This flag is used to send nullfunc frame at minimum rate when | ||
377 | * the nullfunc is used for connection monitoring purpose. | ||
375 | * | 378 | * |
376 | * Note: If you have to add new flags to the enumeration, then don't | 379 | * Note: If you have to add new flags to the enumeration, then don't |
377 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | 380 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. |
@@ -404,6 +407,7 @@ enum mac80211_tx_control_flags { | |||
404 | IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), | 407 | IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), |
405 | IEEE80211_TX_CTL_NO_CCK_RATE = BIT(27), | 408 | IEEE80211_TX_CTL_NO_CCK_RATE = BIT(27), |
406 | IEEE80211_TX_STATUS_EOSP = BIT(28), | 409 | IEEE80211_TX_STATUS_EOSP = BIT(28), |
410 | IEEE80211_TX_CTL_USE_MINRATE = BIT(29), | ||
407 | }; | 411 | }; |
408 | 412 | ||
409 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 413 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index c4e8901c96f6..0e5d8daba1ee 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -348,6 +348,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local, | |||
348 | { | 348 | { |
349 | struct sk_buff *skb; | 349 | struct sk_buff *skb; |
350 | struct ieee80211_hdr_3addr *nullfunc; | 350 | struct ieee80211_hdr_3addr *nullfunc; |
351 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
351 | 352 | ||
352 | skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif); | 353 | skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif); |
353 | if (!skb) | 354 | if (!skb) |
@@ -358,6 +359,10 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local, | |||
358 | nullfunc->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM); | 359 | nullfunc->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM); |
359 | 360 | ||
360 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; | 361 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; |
362 | if (ifmgd->flags & (IEEE80211_STA_BEACON_POLL | | ||
363 | IEEE80211_STA_CONNECTION_POLL)) | ||
364 | IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_USE_MINRATE; | ||
365 | |||
361 | ieee80211_tx_skb(sdata, skb); | 366 | ieee80211_tx_skb(sdata, skb); |
362 | } | 367 | } |
363 | 368 | ||
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index f61244c0e0a2..ff5c3aa48a15 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c | |||
@@ -199,7 +199,7 @@ static void rate_control_release(struct kref *kref) | |||
199 | kfree(ctrl_ref); | 199 | kfree(ctrl_ref); |
200 | } | 200 | } |
201 | 201 | ||
202 | static bool rc_no_data_or_no_ack(struct ieee80211_tx_rate_control *txrc) | 202 | static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc) |
203 | { | 203 | { |
204 | struct sk_buff *skb = txrc->skb; | 204 | struct sk_buff *skb = txrc->skb; |
205 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 205 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
@@ -208,7 +208,9 @@ static bool rc_no_data_or_no_ack(struct ieee80211_tx_rate_control *txrc) | |||
208 | 208 | ||
209 | fc = hdr->frame_control; | 209 | fc = hdr->frame_control; |
210 | 210 | ||
211 | return (info->flags & IEEE80211_TX_CTL_NO_ACK) || !ieee80211_is_data(fc); | 211 | return (info->flags & (IEEE80211_TX_CTL_NO_ACK | |
212 | IEEE80211_TX_CTL_USE_MINRATE)) || | ||
213 | !ieee80211_is_data(fc); | ||
212 | } | 214 | } |
213 | 215 | ||
214 | static void rc_send_low_broadcast(s8 *idx, u32 basic_rates, | 216 | static void rc_send_low_broadcast(s8 *idx, u32 basic_rates, |
@@ -262,7 +264,7 @@ bool rate_control_send_low(struct ieee80211_sta *sta, | |||
262 | struct ieee80211_supported_band *sband = txrc->sband; | 264 | struct ieee80211_supported_band *sband = txrc->sband; |
263 | int mcast_rate; | 265 | int mcast_rate; |
264 | 266 | ||
265 | if (!sta || !priv_sta || rc_no_data_or_no_ack(txrc)) { | 267 | if (!sta || !priv_sta || rc_no_data_or_no_ack_use_min(txrc)) { |
266 | if ((sband->band != IEEE80211_BAND_2GHZ) || | 268 | if ((sband->band != IEEE80211_BAND_2GHZ) || |
267 | !(info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)) | 269 | !(info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)) |
268 | info->control.rates[0].idx = | 270 | info->control.rates[0].idx = |