diff options
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 153 |
1 files changed, 146 insertions, 7 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9fdf982d1286..5b3fd5add7a4 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -97,6 +97,20 @@ enum ieee80211_max_queues { | |||
97 | }; | 97 | }; |
98 | 98 | ||
99 | /** | 99 | /** |
100 | * enum ieee80211_ac_numbers - AC numbers as used in mac80211 | ||
101 | * @IEEE80211_AC_VO: voice | ||
102 | * @IEEE80211_AC_VI: video | ||
103 | * @IEEE80211_AC_BE: best effort | ||
104 | * @IEEE80211_AC_BK: background | ||
105 | */ | ||
106 | enum ieee80211_ac_numbers { | ||
107 | IEEE80211_AC_VO = 0, | ||
108 | IEEE80211_AC_VI = 1, | ||
109 | IEEE80211_AC_BE = 2, | ||
110 | IEEE80211_AC_BK = 3, | ||
111 | }; | ||
112 | |||
113 | /** | ||
100 | * struct ieee80211_tx_queue_params - transmit queue configuration | 114 | * struct ieee80211_tx_queue_params - transmit queue configuration |
101 | * | 115 | * |
102 | * The information provided in this structure is required for QoS | 116 | * The information provided in this structure is required for QoS |
@@ -205,6 +219,7 @@ enum ieee80211_bss_change { | |||
205 | * @basic_rates: bitmap of basic rates, each bit stands for an | 219 | * @basic_rates: bitmap of basic rates, each bit stands for an |
206 | * index into the rate table configured by the driver in | 220 | * index into the rate table configured by the driver in |
207 | * the current band. | 221 | * the current band. |
222 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | ||
208 | * @bssid: The BSSID for this BSS | 223 | * @bssid: The BSSID for this BSS |
209 | * @enable_beacon: whether beaconing should be enabled or not | 224 | * @enable_beacon: whether beaconing should be enabled or not |
210 | * @channel_type: Channel type for this BSS -- the hardware might be | 225 | * @channel_type: Channel type for this BSS -- the hardware might be |
@@ -244,6 +259,7 @@ struct ieee80211_bss_conf { | |||
244 | u16 assoc_capability; | 259 | u16 assoc_capability; |
245 | u64 timestamp; | 260 | u64 timestamp; |
246 | u32 basic_rates; | 261 | u32 basic_rates; |
262 | int mcast_rate[IEEE80211_NUM_BANDS]; | ||
247 | u16 ht_operation_mode; | 263 | u16 ht_operation_mode; |
248 | s32 cqm_rssi_thold; | 264 | s32 cqm_rssi_thold; |
249 | u32 cqm_rssi_hyst; | 265 | u32 cqm_rssi_hyst; |
@@ -349,6 +365,7 @@ enum mac80211_tx_control_flags { | |||
349 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 365 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
350 | IEEE80211_TX_CTL_LDPC = BIT(22), | 366 | IEEE80211_TX_CTL_LDPC = BIT(22), |
351 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 367 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
368 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), | ||
352 | }; | 369 | }; |
353 | 370 | ||
354 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 371 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
@@ -1652,6 +1669,11 @@ enum ieee80211_ampdu_mlme_action { | |||
1652 | * and IV16) for the given key from hardware. | 1669 | * and IV16) for the given key from hardware. |
1653 | * The callback must be atomic. | 1670 | * The callback must be atomic. |
1654 | * | 1671 | * |
1672 | * @set_frag_threshold: Configuration of fragmentation threshold. Assign this | ||
1673 | * if the device does fragmentation by itself; if this callback is | ||
1674 | * implemented then the stack will not do fragmentation. | ||
1675 | * The callback can sleep. | ||
1676 | * | ||
1655 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) | 1677 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) |
1656 | * The callback can sleep. | 1678 | * The callback can sleep. |
1657 | * | 1679 | * |
@@ -1724,6 +1746,13 @@ enum ieee80211_ampdu_mlme_action { | |||
1724 | * completion of the channel switch. | 1746 | * completion of the channel switch. |
1725 | * | 1747 | * |
1726 | * @napi_poll: Poll Rx queue for incoming data frames. | 1748 | * @napi_poll: Poll Rx queue for incoming data frames. |
1749 | * | ||
1750 | * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device. | ||
1751 | * Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may | ||
1752 | * reject TX/RX mask combinations they cannot support by returning -EINVAL | ||
1753 | * (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX). | ||
1754 | * | ||
1755 | * @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant). | ||
1727 | */ | 1756 | */ |
1728 | struct ieee80211_ops { | 1757 | struct ieee80211_ops { |
1729 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1758 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
@@ -1765,6 +1794,7 @@ struct ieee80211_ops { | |||
1765 | struct ieee80211_low_level_stats *stats); | 1794 | struct ieee80211_low_level_stats *stats); |
1766 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1795 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
1767 | u32 *iv32, u16 *iv16); | 1796 | u32 *iv32, u16 *iv16); |
1797 | int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); | ||
1768 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); | 1798 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); |
1769 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1799 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1770 | struct ieee80211_sta *sta); | 1800 | struct ieee80211_sta *sta); |
@@ -1793,6 +1823,14 @@ struct ieee80211_ops { | |||
1793 | void (*channel_switch)(struct ieee80211_hw *hw, | 1823 | void (*channel_switch)(struct ieee80211_hw *hw, |
1794 | struct ieee80211_channel_switch *ch_switch); | 1824 | struct ieee80211_channel_switch *ch_switch); |
1795 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); | 1825 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); |
1826 | int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); | ||
1827 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | ||
1828 | |||
1829 | int (*remain_on_channel)(struct ieee80211_hw *hw, | ||
1830 | struct ieee80211_channel *chan, | ||
1831 | enum nl80211_channel_type channel_type, | ||
1832 | int duration); | ||
1833 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | ||
1796 | }; | 1834 | }; |
1797 | 1835 | ||
1798 | /** | 1836 | /** |
@@ -1821,11 +1859,39 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
1821 | */ | 1859 | */ |
1822 | int ieee80211_register_hw(struct ieee80211_hw *hw); | 1860 | int ieee80211_register_hw(struct ieee80211_hw *hw); |
1823 | 1861 | ||
1862 | /** | ||
1863 | * struct ieee80211_tpt_blink - throughput blink description | ||
1864 | * @throughput: throughput in Kbit/sec | ||
1865 | * @blink_time: blink time in milliseconds | ||
1866 | * (full cycle, ie. one off + one on period) | ||
1867 | */ | ||
1868 | struct ieee80211_tpt_blink { | ||
1869 | int throughput; | ||
1870 | int blink_time; | ||
1871 | }; | ||
1872 | |||
1873 | /** | ||
1874 | * enum ieee80211_tpt_led_trigger_flags - throughput trigger flags | ||
1875 | * @IEEE80211_TPT_LEDTRIG_FL_RADIO: enable blinking with radio | ||
1876 | * @IEEE80211_TPT_LEDTRIG_FL_WORK: enable blinking when working | ||
1877 | * @IEEE80211_TPT_LEDTRIG_FL_CONNECTED: enable blinking when at least one | ||
1878 | * interface is connected in some way, including being an AP | ||
1879 | */ | ||
1880 | enum ieee80211_tpt_led_trigger_flags { | ||
1881 | IEEE80211_TPT_LEDTRIG_FL_RADIO = BIT(0), | ||
1882 | IEEE80211_TPT_LEDTRIG_FL_WORK = BIT(1), | ||
1883 | IEEE80211_TPT_LEDTRIG_FL_CONNECTED = BIT(2), | ||
1884 | }; | ||
1885 | |||
1824 | #ifdef CONFIG_MAC80211_LEDS | 1886 | #ifdef CONFIG_MAC80211_LEDS |
1825 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); | 1887 | extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); |
1826 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); | 1888 | extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); |
1827 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); | 1889 | extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); |
1828 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); | 1890 | extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); |
1891 | extern char *__ieee80211_create_tpt_led_trigger( | ||
1892 | struct ieee80211_hw *hw, unsigned int flags, | ||
1893 | const struct ieee80211_tpt_blink *blink_table, | ||
1894 | unsigned int blink_table_len); | ||
1829 | #endif | 1895 | #endif |
1830 | /** | 1896 | /** |
1831 | * ieee80211_get_tx_led_name - get name of TX LED | 1897 | * ieee80211_get_tx_led_name - get name of TX LED |
@@ -1904,6 +1970,30 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw) | |||
1904 | } | 1970 | } |
1905 | 1971 | ||
1906 | /** | 1972 | /** |
1973 | * ieee80211_create_tpt_led_trigger - create throughput LED trigger | ||
1974 | * @hw: the hardware to create the trigger for | ||
1975 | * @flags: trigger flags, see &enum ieee80211_tpt_led_trigger_flags | ||
1976 | * @blink_table: the blink table -- needs to be ordered by throughput | ||
1977 | * @blink_table_len: size of the blink table | ||
1978 | * | ||
1979 | * This function returns %NULL (in case of error, or if no LED | ||
1980 | * triggers are configured) or the name of the new trigger. | ||
1981 | * This function must be called before ieee80211_register_hw(). | ||
1982 | */ | ||
1983 | static inline char * | ||
1984 | ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags, | ||
1985 | const struct ieee80211_tpt_blink *blink_table, | ||
1986 | unsigned int blink_table_len) | ||
1987 | { | ||
1988 | #ifdef CONFIG_MAC80211_LEDS | ||
1989 | return __ieee80211_create_tpt_led_trigger(hw, flags, blink_table, | ||
1990 | blink_table_len); | ||
1991 | #else | ||
1992 | return NULL; | ||
1993 | #endif | ||
1994 | } | ||
1995 | |||
1996 | /** | ||
1907 | * ieee80211_unregister_hw - Unregister a hardware device | 1997 | * ieee80211_unregister_hw - Unregister a hardware device |
1908 | * | 1998 | * |
1909 | * This function instructs mac80211 to free allocated resources | 1999 | * This function instructs mac80211 to free allocated resources |
@@ -2024,8 +2114,8 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | |||
2024 | * | 2114 | * |
2025 | * This function may not be called in IRQ context. Calls to this function | 2115 | * This function may not be called in IRQ context. Calls to this function |
2026 | * for a single hardware must be synchronized against each other. Calls | 2116 | * for a single hardware must be synchronized against each other. Calls |
2027 | * to this function and ieee80211_tx_status_irqsafe() may not be mixed | 2117 | * to this function, ieee80211_tx_status_ni() and ieee80211_tx_status_irqsafe() |
2028 | * for a single hardware. | 2118 | * may not be mixed for a single hardware. |
2029 | * | 2119 | * |
2030 | * @hw: the hardware the frame was transmitted by | 2120 | * @hw: the hardware the frame was transmitted by |
2031 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 2121 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
@@ -2034,13 +2124,33 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, | |||
2034 | struct sk_buff *skb); | 2124 | struct sk_buff *skb); |
2035 | 2125 | ||
2036 | /** | 2126 | /** |
2127 | * ieee80211_tx_status_ni - transmit status callback (in process context) | ||
2128 | * | ||
2129 | * Like ieee80211_tx_status() but can be called in process context. | ||
2130 | * | ||
2131 | * Calls to this function, ieee80211_tx_status() and | ||
2132 | * ieee80211_tx_status_irqsafe() may not be mixed | ||
2133 | * for a single hardware. | ||
2134 | * | ||
2135 | * @hw: the hardware the frame was transmitted by | ||
2136 | * @skb: the frame that was transmitted, owned by mac80211 after this call | ||
2137 | */ | ||
2138 | static inline void ieee80211_tx_status_ni(struct ieee80211_hw *hw, | ||
2139 | struct sk_buff *skb) | ||
2140 | { | ||
2141 | local_bh_disable(); | ||
2142 | ieee80211_tx_status(hw, skb); | ||
2143 | local_bh_enable(); | ||
2144 | } | ||
2145 | |||
2146 | /** | ||
2037 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback | 2147 | * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback |
2038 | * | 2148 | * |
2039 | * Like ieee80211_tx_status() but can be called in IRQ context | 2149 | * Like ieee80211_tx_status() but can be called in IRQ context |
2040 | * (internally defers to a tasklet.) | 2150 | * (internally defers to a tasklet.) |
2041 | * | 2151 | * |
2042 | * Calls to this function and ieee80211_tx_status() may not be mixed for a | 2152 | * Calls to this function, ieee80211_tx_status() and |
2043 | * single hardware. | 2153 | * ieee80211_tx_status_ni() may not be mixed for a single hardware. |
2044 | * | 2154 | * |
2045 | * @hw: the hardware the frame was transmitted by | 2155 | * @hw: the hardware the frame was transmitted by |
2046 | * @skb: the frame that was transmitted, owned by mac80211 after this call | 2156 | * @skb: the frame that was transmitted, owned by mac80211 after this call |
@@ -2384,6 +2494,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2384 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 2494 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
2385 | * @sta: the station for which to start a BA session | 2495 | * @sta: the station for which to start a BA session |
2386 | * @tid: the TID to BA on. | 2496 | * @tid: the TID to BA on. |
2497 | * @timeout: session timeout value (in TUs) | ||
2387 | * | 2498 | * |
2388 | * Return: success if addBA request was sent, failure otherwise | 2499 | * Return: success if addBA request was sent, failure otherwise |
2389 | * | 2500 | * |
@@ -2391,7 +2502,8 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
2391 | * the need to start aggregation on a certain RA/TID, the session level | 2502 | * the need to start aggregation on a certain RA/TID, the session level |
2392 | * will be managed by the mac80211. | 2503 | * will be managed by the mac80211. |
2393 | */ | 2504 | */ |
2394 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); | 2505 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid, |
2506 | u16 timeout); | ||
2395 | 2507 | ||
2396 | /** | 2508 | /** |
2397 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2509 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
@@ -2501,6 +2613,21 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
2501 | struct ieee80211_sta *pubsta, bool block); | 2613 | struct ieee80211_sta *pubsta, bool block); |
2502 | 2614 | ||
2503 | /** | 2615 | /** |
2616 | * ieee80211_ap_probereq_get - retrieve a Probe Request template | ||
2617 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
2618 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
2619 | * | ||
2620 | * Creates a Probe Request template which can, for example, be uploaded to | ||
2621 | * hardware. The template is filled with bssid, ssid and supported rate | ||
2622 | * information. This function must only be called from within the | ||
2623 | * .bss_info_changed callback function and only in managed mode. The function | ||
2624 | * is only useful when the interface is associated, otherwise it will return | ||
2625 | * NULL. | ||
2626 | */ | ||
2627 | struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, | ||
2628 | struct ieee80211_vif *vif); | ||
2629 | |||
2630 | /** | ||
2504 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2631 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
2505 | * | 2632 | * |
2506 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2633 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
@@ -2609,6 +2736,18 @@ void ieee80211_request_smps(struct ieee80211_vif *vif, | |||
2609 | */ | 2736 | */ |
2610 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); | 2737 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); |
2611 | 2738 | ||
2739 | /** | ||
2740 | * ieee80211_ready_on_channel - notification of remain-on-channel start | ||
2741 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2742 | */ | ||
2743 | void ieee80211_ready_on_channel(struct ieee80211_hw *hw); | ||
2744 | |||
2745 | /** | ||
2746 | * ieee80211_remain_on_channel_expired - remain_on_channel duration expired | ||
2747 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2748 | */ | ||
2749 | void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); | ||
2750 | |||
2612 | /* Rate control API */ | 2751 | /* Rate control API */ |
2613 | 2752 | ||
2614 | /** | 2753 | /** |
@@ -2640,7 +2779,7 @@ enum rate_control_changed { | |||
2640 | * @rate_idx_mask: user-requested rate mask (not MCS for now) | 2779 | * @rate_idx_mask: user-requested rate mask (not MCS for now) |
2641 | * @skb: the skb that will be transmitted, the control information in it needs | 2780 | * @skb: the skb that will be transmitted, the control information in it needs |
2642 | * to be filled in | 2781 | * to be filled in |
2643 | * @ap: whether this frame is sent out in AP mode | 2782 | * @bss: whether this frame is sent out in AP or IBSS mode |
2644 | */ | 2783 | */ |
2645 | struct ieee80211_tx_rate_control { | 2784 | struct ieee80211_tx_rate_control { |
2646 | struct ieee80211_hw *hw; | 2785 | struct ieee80211_hw *hw; |
@@ -2651,7 +2790,7 @@ struct ieee80211_tx_rate_control { | |||
2651 | bool rts, short_preamble; | 2790 | bool rts, short_preamble; |
2652 | u8 max_rate_idx; | 2791 | u8 max_rate_idx; |
2653 | u32 rate_idx_mask; | 2792 | u32 rate_idx_mask; |
2654 | bool ap; | 2793 | bool bss; |
2655 | }; | 2794 | }; |
2656 | 2795 | ||
2657 | struct rate_control_ops { | 2796 | struct rate_control_ops { |