diff options
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 119 |
1 files changed, 111 insertions, 8 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 62c0ce2d1dc8..025d4cc7bbf8 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -341,6 +341,9 @@ struct ieee80211_bss_conf { | |||
341 | * the off-channel channel when a remain-on-channel offload is done | 341 | * the off-channel channel when a remain-on-channel offload is done |
342 | * in hardware -- normal packets still flow and are expected to be | 342 | * in hardware -- normal packets still flow and are expected to be |
343 | * handled properly by the device. | 343 | * handled properly by the device. |
344 | * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP | ||
345 | * testing. It will be sent out with incorrect Michael MIC key to allow | ||
346 | * TKIP countermeasures to be tested. | ||
344 | * | 347 | * |
345 | * Note: If you have to add new flags to the enumeration, then don't | 348 | * Note: If you have to add new flags to the enumeration, then don't |
346 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | 349 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. |
@@ -370,6 +373,7 @@ enum mac80211_tx_control_flags { | |||
370 | IEEE80211_TX_CTL_LDPC = BIT(22), | 373 | IEEE80211_TX_CTL_LDPC = BIT(22), |
371 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 374 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
372 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), | 375 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), |
376 | IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), | ||
373 | }; | 377 | }; |
374 | 378 | ||
375 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 379 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
@@ -595,9 +599,10 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
595 | * the frame. | 599 | * the frame. |
596 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on | 600 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on |
597 | * the frame. | 601 | * the frame. |
598 | * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field) | 602 | * @RX_FLAG_MACTIME_MPDU: The timestamp passed in the RX status (@mactime |
599 | * is valid. This is useful in monitor mode and necessary for beacon frames | 603 | * field) is valid and contains the time the first symbol of the MPDU |
600 | * to enable IBSS merging. | 604 | * was received. This is useful in monitor mode and for proper IBSS |
605 | * merging. | ||
601 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame | 606 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame |
602 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 607 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
603 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 608 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
@@ -610,7 +615,7 @@ enum mac80211_rx_flags { | |||
610 | RX_FLAG_IV_STRIPPED = 1<<4, | 615 | RX_FLAG_IV_STRIPPED = 1<<4, |
611 | RX_FLAG_FAILED_FCS_CRC = 1<<5, | 616 | RX_FLAG_FAILED_FCS_CRC = 1<<5, |
612 | RX_FLAG_FAILED_PLCP_CRC = 1<<6, | 617 | RX_FLAG_FAILED_PLCP_CRC = 1<<6, |
613 | RX_FLAG_TSFT = 1<<7, | 618 | RX_FLAG_MACTIME_MPDU = 1<<7, |
614 | RX_FLAG_SHORTPRE = 1<<8, | 619 | RX_FLAG_SHORTPRE = 1<<8, |
615 | RX_FLAG_HT = 1<<9, | 620 | RX_FLAG_HT = 1<<9, |
616 | RX_FLAG_40MHZ = 1<<10, | 621 | RX_FLAG_40MHZ = 1<<10, |
@@ -1069,6 +1074,13 @@ enum ieee80211_tkip_key_type { | |||
1069 | * to decrypt group addressed frames, then IBSS RSN support is still | 1074 | * to decrypt group addressed frames, then IBSS RSN support is still |
1070 | * possible but software crypto will be used. Advertise the wiphy flag | 1075 | * possible but software crypto will be used. Advertise the wiphy flag |
1071 | * only in that case. | 1076 | * only in that case. |
1077 | * | ||
1078 | * @IEEE80211_HW_AP_LINK_PS: When operating in AP mode the device | ||
1079 | * autonomously manages the PS status of connected stations. When | ||
1080 | * this flag is set mac80211 will not trigger PS mode for connected | ||
1081 | * stations based on the PM bit of incoming frames. | ||
1082 | * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure | ||
1083 | * the PS mode of connected stations. | ||
1072 | */ | 1084 | */ |
1073 | enum ieee80211_hw_flags { | 1085 | enum ieee80211_hw_flags { |
1074 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1086 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
@@ -1093,6 +1105,7 @@ enum ieee80211_hw_flags { | |||
1093 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, | 1105 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, |
1094 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, | 1106 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, |
1095 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | 1107 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, |
1108 | IEEE80211_HW_AP_LINK_PS = 1<<22, | ||
1096 | }; | 1109 | }; |
1097 | 1110 | ||
1098 | /** | 1111 | /** |
@@ -1147,6 +1160,17 @@ enum ieee80211_hw_flags { | |||
1147 | * @napi_weight: weight used for NAPI polling. You must specify an | 1160 | * @napi_weight: weight used for NAPI polling. You must specify an |
1148 | * appropriate value here if a napi_poll operation is provided | 1161 | * appropriate value here if a napi_poll operation is provided |
1149 | * by your driver. | 1162 | * by your driver. |
1163 | * | ||
1164 | * @max_rx_aggregation_subframes: maximum buffer size (number of | ||
1165 | * sub-frames) to be used for A-MPDU block ack receiver | ||
1166 | * aggregation. | ||
1167 | * This is only relevant if the device has restrictions on the | ||
1168 | * number of subframes, if it relies on mac80211 to do reordering | ||
1169 | * it shouldn't be set. | ||
1170 | * | ||
1171 | * @max_tx_aggregation_subframes: maximum number of subframes in an | ||
1172 | * aggregate an HT driver will transmit, used by the peer as a | ||
1173 | * hint to size its reorder buffer. | ||
1150 | */ | 1174 | */ |
1151 | struct ieee80211_hw { | 1175 | struct ieee80211_hw { |
1152 | struct ieee80211_conf conf; | 1176 | struct ieee80211_conf conf; |
@@ -1165,6 +1189,8 @@ struct ieee80211_hw { | |||
1165 | u8 max_rates; | 1189 | u8 max_rates; |
1166 | u8 max_report_rates; | 1190 | u8 max_report_rates; |
1167 | u8 max_rate_tries; | 1191 | u8 max_rate_tries; |
1192 | u8 max_rx_aggregation_subframes; | ||
1193 | u8 max_tx_aggregation_subframes; | ||
1168 | }; | 1194 | }; |
1169 | 1195 | ||
1170 | /** | 1196 | /** |
@@ -1268,7 +1294,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1268 | * acceleration (i.e. iwlwifi). Those drivers should provide update_tkip_key | 1294 | * acceleration (i.e. iwlwifi). Those drivers should provide update_tkip_key |
1269 | * handler. | 1295 | * handler. |
1270 | * The update_tkip_key() call updates the driver with the new phase 1 key. | 1296 | * The update_tkip_key() call updates the driver with the new phase 1 key. |
1271 | * This happens everytime the iv16 wraps around (every 65536 packets). The | 1297 | * This happens every time the iv16 wraps around (every 65536 packets). The |
1272 | * set_key() call will happen only once for each key (unless the AP did | 1298 | * set_key() call will happen only once for each key (unless the AP did |
1273 | * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is | 1299 | * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is |
1274 | * provided by update_tkip_key only. The trigger that makes mac80211 call this | 1300 | * provided by update_tkip_key only. The trigger that makes mac80211 call this |
@@ -1688,7 +1714,9 @@ enum ieee80211_ampdu_mlme_action { | |||
1688 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 1714 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
1689 | * | 1715 | * |
1690 | * @sta_notify: Notifies low level driver about power state transition of an | 1716 | * @sta_notify: Notifies low level driver about power state transition of an |
1691 | * associated station, AP, IBSS/WDS/mesh peer etc. Must be atomic. | 1717 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating |
1718 | * in AP mode, this callback will not be called when the flag | ||
1719 | * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic. | ||
1692 | * | 1720 | * |
1693 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 1721 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
1694 | * bursting) for a hardware TX queue. | 1722 | * bursting) for a hardware TX queue. |
@@ -1723,6 +1751,21 @@ enum ieee80211_ampdu_mlme_action { | |||
1723 | * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) | 1751 | * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) |
1724 | * is the first frame we expect to perform the action on. Notice | 1752 | * is the first frame we expect to perform the action on. Notice |
1725 | * that TX/RX_STOP can pass NULL for this parameter. | 1753 | * that TX/RX_STOP can pass NULL for this parameter. |
1754 | * The @buf_size parameter is only valid when the action is set to | ||
1755 | * %IEEE80211_AMPDU_TX_OPERATIONAL and indicates the peer's reorder | ||
1756 | * buffer size (number of subframes) for this session -- the driver | ||
1757 | * may neither send aggregates containing more subframes than this | ||
1758 | * nor send aggregates in a way that lost frames would exceed the | ||
1759 | * buffer size. If just limiting the aggregate size, this would be | ||
1760 | * possible with a buf_size of 8: | ||
1761 | * - TX: 1.....7 | ||
1762 | * - RX: 2....7 (lost frame #1) | ||
1763 | * - TX: 8..1... | ||
1764 | * which is invalid since #1 was now re-transmitted well past the | ||
1765 | * buffer size of 8. Correct ways to retransmit #1 would be: | ||
1766 | * - TX: 1 or 18 or 81 | ||
1767 | * Even "189" would be wrong since 1 could be lost again. | ||
1768 | * | ||
1726 | * Returns a negative error code on failure. | 1769 | * Returns a negative error code on failure. |
1727 | * The callback can sleep. | 1770 | * The callback can sleep. |
1728 | * | 1771 | * |
@@ -1767,9 +1810,18 @@ enum ieee80211_ampdu_mlme_action { | |||
1767 | * ieee80211_remain_on_channel_expired(). This callback may sleep. | 1810 | * ieee80211_remain_on_channel_expired(). This callback may sleep. |
1768 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is | 1811 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is |
1769 | * aborted before it expires. This callback may sleep. | 1812 | * aborted before it expires. This callback may sleep. |
1813 | * @offchannel_tx: Transmit frame on another channel, wait for a response | ||
1814 | * and return. Reliable TX status must be reported for the frame. If the | ||
1815 | * return value is 1, then the @remain_on_channel will be used with a | ||
1816 | * regular transmission (if supported.) | ||
1817 | * @offchannel_tx_cancel_wait: cancel wait associated with offchannel TX | ||
1818 | * | ||
1819 | * @set_ringparam: Set tx and rx ring sizes. | ||
1820 | * | ||
1821 | * @get_ringparam: Get tx and rx ring current and maximum sizes. | ||
1770 | */ | 1822 | */ |
1771 | struct ieee80211_ops { | 1823 | struct ieee80211_ops { |
1772 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1824 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
1773 | int (*start)(struct ieee80211_hw *hw); | 1825 | int (*start)(struct ieee80211_hw *hw); |
1774 | void (*stop)(struct ieee80211_hw *hw); | 1826 | void (*stop)(struct ieee80211_hw *hw); |
1775 | int (*add_interface)(struct ieee80211_hw *hw, | 1827 | int (*add_interface)(struct ieee80211_hw *hw, |
@@ -1825,7 +1877,8 @@ struct ieee80211_ops { | |||
1825 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1877 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1826 | struct ieee80211_vif *vif, | 1878 | struct ieee80211_vif *vif, |
1827 | enum ieee80211_ampdu_mlme_action action, | 1879 | enum ieee80211_ampdu_mlme_action action, |
1828 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1880 | struct ieee80211_sta *sta, u16 tid, u16 *ssn, |
1881 | u8 buf_size); | ||
1829 | int (*get_survey)(struct ieee80211_hw *hw, int idx, | 1882 | int (*get_survey)(struct ieee80211_hw *hw, int idx, |
1830 | struct survey_info *survey); | 1883 | struct survey_info *survey); |
1831 | void (*rfkill_poll)(struct ieee80211_hw *hw); | 1884 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
@@ -1845,6 +1898,14 @@ struct ieee80211_ops { | |||
1845 | enum nl80211_channel_type channel_type, | 1898 | enum nl80211_channel_type channel_type, |
1846 | int duration); | 1899 | int duration); |
1847 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 1900 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
1901 | int (*offchannel_tx)(struct ieee80211_hw *hw, struct sk_buff *skb, | ||
1902 | struct ieee80211_channel *chan, | ||
1903 | enum nl80211_channel_type channel_type, | ||
1904 | unsigned int wait); | ||
1905 | int (*offchannel_tx_cancel_wait)(struct ieee80211_hw *hw); | ||
1906 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | ||
1907 | void (*get_ringparam)(struct ieee80211_hw *hw, | ||
1908 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); | ||
1848 | }; | 1909 | }; |
1849 | 1910 | ||
1850 | /** | 1911 | /** |
@@ -2113,6 +2174,48 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | |||
2113 | local_bh_enable(); | 2174 | local_bh_enable(); |
2114 | } | 2175 | } |
2115 | 2176 | ||
2177 | /** | ||
2178 | * ieee80211_sta_ps_transition - PS transition for connected sta | ||
2179 | * | ||
2180 | * When operating in AP mode with the %IEEE80211_HW_AP_LINK_PS | ||
2181 | * flag set, use this function to inform mac80211 about a connected station | ||
2182 | * entering/leaving PS mode. | ||
2183 | * | ||
2184 | * This function may not be called in IRQ context or with softirqs enabled. | ||
2185 | * | ||
2186 | * Calls to this function for a single hardware must be synchronized against | ||
2187 | * each other. | ||
2188 | * | ||
2189 | * The function returns -EINVAL when the requested PS mode is already set. | ||
2190 | * | ||
2191 | * @sta: currently connected sta | ||
2192 | * @start: start or stop PS | ||
2193 | */ | ||
2194 | int ieee80211_sta_ps_transition(struct ieee80211_sta *sta, bool start); | ||
2195 | |||
2196 | /** | ||
2197 | * ieee80211_sta_ps_transition_ni - PS transition for connected sta | ||
2198 | * (in process context) | ||
2199 | * | ||
2200 | * Like ieee80211_sta_ps_transition() but can be called in process context | ||
2201 | * (internally disables bottom halves). Concurrent call restriction still | ||
2202 | * applies. | ||
2203 | * | ||
2204 | * @sta: currently connected sta | ||
2205 | * @start: start or stop PS | ||
2206 | */ | ||
2207 | static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, | ||
2208 | bool start) | ||
2209 | { | ||
2210 | int ret; | ||
2211 | |||
2212 | local_bh_disable(); | ||
2213 | ret = ieee80211_sta_ps_transition(sta, start); | ||
2214 | local_bh_enable(); | ||
2215 | |||
2216 | return ret; | ||
2217 | } | ||
2218 | |||
2116 | /* | 2219 | /* |
2117 | * The TX headroom reserved by mac80211 for its own tx_status functions. | 2220 | * The TX headroom reserved by mac80211 for its own tx_status functions. |
2118 | * This is enough for the radiotap header. | 2221 | * This is enough for the radiotap header. |