aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ce7cb1b5d453..7dd67a1ff4d5 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -241,6 +241,8 @@ struct ieee80211_bss_conf {
241 * it can be sent out. 241 * it can be sent out.
242 * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211, 242 * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211,
243 * used to indicate that a frame was already retried due to PS 243 * used to indicate that a frame was already retried due to PS
244 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
245 * used to indicate frame should not be encrypted
244 */ 246 */
245enum mac80211_tx_control_flags { 247enum mac80211_tx_control_flags {
246 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 248 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
@@ -259,6 +261,7 @@ enum mac80211_tx_control_flags {
259 IEEE80211_TX_INTFL_RCALGO = BIT(13), 261 IEEE80211_TX_INTFL_RCALGO = BIT(13),
260 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 262 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
261 IEEE80211_TX_INTFL_RETRIED = BIT(15), 263 IEEE80211_TX_INTFL_RETRIED = BIT(15),
264 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
262}; 265};
263 266
264/** 267/**
@@ -2094,6 +2097,29 @@ static inline int rate_supported(struct ieee80211_sta *sta,
2094 return (sta == NULL || sta->supp_rates[band] & BIT(index)); 2097 return (sta == NULL || sta->supp_rates[band] & BIT(index));
2095} 2098}
2096 2099
2100/**
2101 * rate_control_send_low - helper for drivers for management/no-ack frames
2102 *
2103 * Rate control algorithms that agree to use the lowest rate to
2104 * send management frames and NO_ACK data with the respective hw
2105 * retries should use this in the beginning of their mac80211 get_rate
2106 * callback. If true is returned the rate control can simply return.
2107 * If false is returned we guarantee that sta and sta and priv_sta is
2108 * not null.
2109 *
2110 * Rate control algorithms wishing to do more intelligent selection of
2111 * rate for multicast/broadcast frames may choose to not use this.
2112 *
2113 * @sta: &struct ieee80211_sta pointer to the target destination. Note
2114 * that this may be null.
2115 * @priv_sta: private rate control structure. This may be null.
2116 * @txrc: rate control information we sholud populate for mac80211.
2117 */
2118bool rate_control_send_low(struct ieee80211_sta *sta,
2119 void *priv_sta,
2120 struct ieee80211_tx_rate_control *txrc);
2121
2122
2097static inline s8 2123static inline s8
2098rate_lowest_index(struct ieee80211_supported_band *sband, 2124rate_lowest_index(struct ieee80211_supported_band *sband,
2099 struct ieee80211_sta *sta) 2125 struct ieee80211_sta *sta)
@@ -2110,6 +2136,17 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
2110 return 0; 2136 return 0;
2111} 2137}
2112 2138
2139static inline
2140bool rate_usable_index_exists(struct ieee80211_supported_band *sband,
2141 struct ieee80211_sta *sta)
2142{
2143 unsigned int i;
2144
2145 for (i = 0; i < sband->n_bitrates; i++)
2146 if (rate_supported(sta, sband->band, i))
2147 return true;
2148 return false;
2149}
2113 2150
2114int ieee80211_rate_control_register(struct rate_control_ops *ops); 2151int ieee80211_rate_control_register(struct rate_control_ops *ops);
2115void ieee80211_rate_control_unregister(struct rate_control_ops *ops); 2152void ieee80211_rate_control_unregister(struct rate_control_ops *ops);