diff options
Diffstat (limited to 'include/net/mac80211.h')
| -rw-r--r-- | include/net/mac80211.h | 209 |
1 files changed, 166 insertions, 43 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index c75b960c8ac8..2aff4906b2ae 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -219,7 +219,7 @@ struct ieee80211_bss_conf { | |||
| 219 | * | 219 | * |
| 220 | * These flags are used with the @flags member of &ieee80211_tx_info. | 220 | * These flags are used with the @flags member of &ieee80211_tx_info. |
| 221 | * | 221 | * |
| 222 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. | 222 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame. |
| 223 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence | 223 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence |
| 224 | * number to this frame, taking care of not overwriting the fragment | 224 | * number to this frame, taking care of not overwriting the fragment |
| 225 | * number and increasing the sequence number only when the | 225 | * number and increasing the sequence number only when the |
| @@ -390,10 +390,12 @@ struct ieee80211_tx_rate { | |||
| 390 | * @control: union for control data | 390 | * @control: union for control data |
| 391 | * @status: union for status data | 391 | * @status: union for status data |
| 392 | * @driver_data: array of driver_data pointers | 392 | * @driver_data: array of driver_data pointers |
| 393 | * @ampdu_ack_len: number of aggregated frames. | 393 | * @ampdu_ack_len: number of acked aggregated frames. |
| 394 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 394 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
| 395 | * @ampdu_ack_map: block ack bit map for the aggregation. | 395 | * @ampdu_ack_map: block ack bit map for the aggregation. |
| 396 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 396 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
| 397 | * @ampdu_len: number of aggregated frames. | ||
| 398 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
| 397 | * @ack_signal: signal strength of the ACK frame | 399 | * @ack_signal: signal strength of the ACK frame |
| 398 | */ | 400 | */ |
| 399 | struct ieee80211_tx_info { | 401 | struct ieee80211_tx_info { |
| @@ -428,7 +430,8 @@ struct ieee80211_tx_info { | |||
| 428 | u8 ampdu_ack_len; | 430 | u8 ampdu_ack_len; |
| 429 | u64 ampdu_ack_map; | 431 | u64 ampdu_ack_map; |
| 430 | int ack_signal; | 432 | int ack_signal; |
| 431 | /* 8 bytes free */ | 433 | u8 ampdu_len; |
| 434 | /* 7 bytes free */ | ||
| 432 | } status; | 435 | } status; |
| 433 | struct { | 436 | struct { |
| 434 | struct ieee80211_tx_rate driver_rates[ | 437 | struct ieee80211_tx_rate driver_rates[ |
| @@ -494,7 +497,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
| 494 | * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame. | 497 | * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame. |
| 495 | * Use together with %RX_FLAG_MMIC_STRIPPED. | 498 | * Use together with %RX_FLAG_MMIC_STRIPPED. |
| 496 | * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware. | 499 | * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware. |
| 497 | * @RX_FLAG_RADIOTAP: This frame starts with a radiotap header. | ||
| 498 | * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame, | 500 | * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame, |
| 499 | * verification has been done by the hardware. | 501 | * verification has been done by the hardware. |
| 500 | * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame. | 502 | * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame. |
| @@ -511,11 +513,13 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
| 511 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 513 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
| 512 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 514 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
| 513 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 515 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
| 516 | * @RX_FLAG_INTERNAL_CMTR: set internally after frame was reported | ||
| 517 | * on cooked monitor to avoid double-reporting it for multiple | ||
| 518 | * virtual interfaces | ||
| 514 | */ | 519 | */ |
| 515 | enum mac80211_rx_flags { | 520 | enum mac80211_rx_flags { |
| 516 | RX_FLAG_MMIC_ERROR = 1<<0, | 521 | RX_FLAG_MMIC_ERROR = 1<<0, |
| 517 | RX_FLAG_DECRYPTED = 1<<1, | 522 | RX_FLAG_DECRYPTED = 1<<1, |
| 518 | RX_FLAG_RADIOTAP = 1<<2, | ||
| 519 | RX_FLAG_MMIC_STRIPPED = 1<<3, | 523 | RX_FLAG_MMIC_STRIPPED = 1<<3, |
| 520 | RX_FLAG_IV_STRIPPED = 1<<4, | 524 | RX_FLAG_IV_STRIPPED = 1<<4, |
| 521 | RX_FLAG_FAILED_FCS_CRC = 1<<5, | 525 | RX_FLAG_FAILED_FCS_CRC = 1<<5, |
| @@ -525,6 +529,7 @@ enum mac80211_rx_flags { | |||
| 525 | RX_FLAG_HT = 1<<9, | 529 | RX_FLAG_HT = 1<<9, |
| 526 | RX_FLAG_40MHZ = 1<<10, | 530 | RX_FLAG_40MHZ = 1<<10, |
| 527 | RX_FLAG_SHORT_GI = 1<<11, | 531 | RX_FLAG_SHORT_GI = 1<<11, |
| 532 | RX_FLAG_INTERNAL_CMTR = 1<<12, | ||
| 528 | }; | 533 | }; |
| 529 | 534 | ||
| 530 | /** | 535 | /** |
| @@ -554,7 +559,7 @@ struct ieee80211_rx_status { | |||
| 554 | int freq; | 559 | int freq; |
| 555 | int signal; | 560 | int signal; |
| 556 | int noise; | 561 | int noise; |
| 557 | int qual; | 562 | int __deprecated qual; |
| 558 | int antenna; | 563 | int antenna; |
| 559 | int rate_idx; | 564 | int rate_idx; |
| 560 | int flag; | 565 | int flag; |
| @@ -565,7 +570,9 @@ struct ieee80211_rx_status { | |||
| 565 | * | 570 | * |
| 566 | * Flags to define PHY configuration options | 571 | * Flags to define PHY configuration options |
| 567 | * | 572 | * |
| 568 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) | 573 | * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this |
| 574 | * to determine for example whether to calculate timestamps for packets | ||
| 575 | * or not, do not use instead of filter flags! | ||
| 569 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) | 576 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) |
| 570 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set | 577 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set |
| 571 | * the driver should be prepared to handle configuration requests but | 578 | * the driver should be prepared to handle configuration requests but |
| @@ -574,7 +581,7 @@ struct ieee80211_rx_status { | |||
| 574 | * it can also be unset in that case when monitor interfaces are active. | 581 | * it can also be unset in that case when monitor interfaces are active. |
| 575 | */ | 582 | */ |
| 576 | enum ieee80211_conf_flags { | 583 | enum ieee80211_conf_flags { |
| 577 | IEEE80211_CONF_RADIOTAP = (1<<0), | 584 | IEEE80211_CONF_MONITOR = (1<<0), |
| 578 | IEEE80211_CONF_PS = (1<<1), | 585 | IEEE80211_CONF_PS = (1<<1), |
| 579 | IEEE80211_CONF_IDLE = (1<<2), | 586 | IEEE80211_CONF_IDLE = (1<<2), |
| 580 | }; | 587 | }; |
| @@ -584,7 +591,7 @@ enum ieee80211_conf_flags { | |||
| 584 | * enum ieee80211_conf_changed - denotes which configuration changed | 591 | * enum ieee80211_conf_changed - denotes which configuration changed |
| 585 | * | 592 | * |
| 586 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed | 593 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed |
| 587 | * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed | 594 | * @IEEE80211_CONF_CHANGE_MONITOR: the monitor flag changed |
| 588 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed | 595 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed |
| 589 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed | 596 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed |
| 590 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed | 597 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed |
| @@ -593,7 +600,7 @@ enum ieee80211_conf_flags { | |||
| 593 | */ | 600 | */ |
| 594 | enum ieee80211_conf_changed { | 601 | enum ieee80211_conf_changed { |
| 595 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), | 602 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), |
| 596 | IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), | 603 | IEEE80211_CONF_CHANGE_MONITOR = BIT(3), |
| 597 | IEEE80211_CONF_CHANGE_PS = BIT(4), | 604 | IEEE80211_CONF_CHANGE_PS = BIT(4), |
| 598 | IEEE80211_CONF_CHANGE_POWER = BIT(5), | 605 | IEEE80211_CONF_CHANGE_POWER = BIT(5), |
| 599 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), | 606 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), |
| @@ -852,6 +859,19 @@ enum ieee80211_tkip_key_type { | |||
| 852 | * any particular flags. There are some exceptions to this rule, | 859 | * any particular flags. There are some exceptions to this rule, |
| 853 | * however, so you are advised to review these flags carefully. | 860 | * however, so you are advised to review these flags carefully. |
| 854 | * | 861 | * |
| 862 | * @IEEE80211_HW_HAS_RATE_CONTROL: | ||
| 863 | * The hardware or firmware includes rate control, and cannot be | ||
| 864 | * controlled by the stack. As such, no rate control algorithm | ||
| 865 | * should be instantiated, and the TX rate reported to userspace | ||
| 866 | * will be taken from the TX status instead of the rate control | ||
| 867 | * algorithm. | ||
| 868 | * Note that this requires that the driver implement a number of | ||
| 869 | * callbacks so it has the correct information, it needs to have | ||
| 870 | * the @set_rts_threshold callback and must look at the BSS config | ||
| 871 | * @use_cts_prot for G/N protection, @use_short_slot for slot | ||
| 872 | * timing in 2.4 GHz and @use_short_preamble for preambles for | ||
| 873 | * CCK frames. | ||
| 874 | * | ||
| 855 | * @IEEE80211_HW_RX_INCLUDES_FCS: | 875 | * @IEEE80211_HW_RX_INCLUDES_FCS: |
| 856 | * Indicates that received frames passed to the stack include | 876 | * Indicates that received frames passed to the stack include |
| 857 | * the FCS at the end. | 877 | * the FCS at the end. |
| @@ -910,6 +930,7 @@ enum ieee80211_tkip_key_type { | |||
| 910 | * avoid waking up cpu. | 930 | * avoid waking up cpu. |
| 911 | */ | 931 | */ |
| 912 | enum ieee80211_hw_flags { | 932 | enum ieee80211_hw_flags { |
| 933 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | ||
| 913 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, | 934 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, |
| 914 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, | 935 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, |
| 915 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, | 936 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
| @@ -1283,6 +1304,12 @@ enum ieee80211_filter_flags { | |||
| 1283 | * | 1304 | * |
| 1284 | * These flags are used with the ampdu_action() callback in | 1305 | * These flags are used with the ampdu_action() callback in |
| 1285 | * &struct ieee80211_ops to indicate which action is needed. | 1306 | * &struct ieee80211_ops to indicate which action is needed. |
| 1307 | * | ||
| 1308 | * Note that drivers MUST be able to deal with a TX aggregation | ||
| 1309 | * session being stopped even before they OK'ed starting it by | ||
| 1310 | * calling ieee80211_start_tx_ba_cb(_irqsafe), because the peer | ||
| 1311 | * might receive the addBA frame and send a delBA right away! | ||
| 1312 | * | ||
| 1286 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation | 1313 | * @IEEE80211_AMPDU_RX_START: start Rx aggregation |
| 1287 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation | 1314 | * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation |
| 1288 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation | 1315 | * @IEEE80211_AMPDU_TX_START: start Tx aggregation |
| @@ -1505,6 +1532,7 @@ struct ieee80211_ops { | |||
| 1505 | void (*reset_tsf)(struct ieee80211_hw *hw); | 1532 | void (*reset_tsf)(struct ieee80211_hw *hw); |
| 1506 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1533 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
| 1507 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1534 | int (*ampdu_action)(struct ieee80211_hw *hw, |
| 1535 | struct ieee80211_vif *vif, | ||
| 1508 | enum ieee80211_ampdu_mlme_action action, | 1536 | enum ieee80211_ampdu_mlme_action action, |
| 1509 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1537 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
| 1510 | 1538 | ||
| @@ -1661,15 +1689,14 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw); | |||
| 1661 | * ieee80211_rx - receive frame | 1689 | * ieee80211_rx - receive frame |
| 1662 | * | 1690 | * |
| 1663 | * Use this function to hand received frames to mac80211. The receive | 1691 | * Use this function to hand received frames to mac80211. The receive |
| 1664 | * buffer in @skb must start with an IEEE 802.11 header or a radiotap | 1692 | * buffer in @skb must start with an IEEE 802.11 header. |
| 1665 | * header if %RX_FLAG_RADIOTAP is set in the @status flags. | ||
| 1666 | * | 1693 | * |
| 1667 | * This function may not be called in IRQ context. Calls to this function | 1694 | * This function may not be called in IRQ context. Calls to this function |
| 1668 | * for a single hardware must be synchronized against each other. Calls | 1695 | * for a single hardware must be synchronized against each other. Calls to |
| 1669 | * to this function and ieee80211_rx_irqsafe() may not be mixed for a | 1696 | * this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be |
| 1670 | * single hardware. | 1697 | * mixed for a single hardware. |
| 1671 | * | 1698 | * |
| 1672 | * Note that right now, this function must be called with softirqs disabled. | 1699 | * In process context use instead ieee80211_rx_ni(). |
| 1673 | * | 1700 | * |
| 1674 | * @hw: the hardware this frame came in on | 1701 | * @hw: the hardware this frame came in on |
| 1675 | * @skb: the buffer to receive, owned by mac80211 after this call | 1702 | * @skb: the buffer to receive, owned by mac80211 after this call |
| @@ -1682,8 +1709,8 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
| 1682 | * Like ieee80211_rx() but can be called in IRQ context | 1709 | * Like ieee80211_rx() but can be called in IRQ context |
| 1683 | * (internally defers to a tasklet.) | 1710 | * (internally defers to a tasklet.) |
| 1684 | * | 1711 | * |
| 1685 | * Calls to this function and ieee80211_rx() may not be mixed for a | 1712 | * Calls to this function, ieee80211_rx() or ieee80211_rx_ni() may not |
| 1686 | * single hardware. | 1713 | * be mixed for a single hardware. |
| 1687 | * | 1714 | * |
| 1688 | * @hw: the hardware this frame came in on | 1715 | * @hw: the hardware this frame came in on |
| 1689 | * @skb: the buffer to receive, owned by mac80211 after this call | 1716 | * @skb: the buffer to receive, owned by mac80211 after this call |
| @@ -1691,6 +1718,26 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
| 1691 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); | 1718 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); |
| 1692 | 1719 | ||
| 1693 | /** | 1720 | /** |
| 1721 | * ieee80211_rx_ni - receive frame (in process context) | ||
| 1722 | * | ||
| 1723 | * Like ieee80211_rx() but can be called in process context | ||
| 1724 | * (internally disables bottom halves). | ||
| 1725 | * | ||
| 1726 | * Calls to this function, ieee80211_rx() and ieee80211_rx_irqsafe() may | ||
| 1727 | * not be mixed for a single hardware. | ||
| 1728 | * | ||
| 1729 | * @hw: the hardware this frame came in on | ||
| 1730 | * @skb: the buffer to receive, owned by mac80211 after this call | ||
| 1731 | */ | ||
| 1732 | static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | ||
| 1733 | struct sk_buff *skb) | ||
| 1734 | { | ||
| 1735 | local_bh_disable(); | ||
| 1736 | ieee80211_rx(hw, skb); | ||
| 1737 | local_bh_enable(); | ||
| 1738 | } | ||
| 1739 | |||
| 1740 | /** | ||
| 1694 | * ieee80211_tx_status - transmit status callback | 1741 | * ieee80211_tx_status - transmit status callback |
| 1695 | * | 1742 | * |
| 1696 | * Call this function for all transmitted frames after they have been | 1743 | * Call this function for all transmitted frames after they have been |
| @@ -1724,19 +1771,45 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
| 1724 | struct sk_buff *skb); | 1771 | struct sk_buff *skb); |
| 1725 | 1772 | ||
| 1726 | /** | 1773 | /** |
| 1727 | * ieee80211_beacon_get - beacon generation function | 1774 | * ieee80211_beacon_get_tim - beacon generation function |
| 1728 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1775 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1729 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1776 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
| 1777 | * @tim_offset: pointer to variable that will receive the TIM IE offset. | ||
| 1778 | * Set to 0 if invalid (in non-AP modes). | ||
| 1779 | * @tim_length: pointer to variable that will receive the TIM IE length, | ||
| 1780 | * (including the ID and length bytes!). | ||
| 1781 | * Set to 0 if invalid (in non-AP modes). | ||
| 1782 | * | ||
| 1783 | * If the driver implements beaconing modes, it must use this function to | ||
| 1784 | * obtain the beacon frame/template. | ||
| 1730 | * | 1785 | * |
| 1731 | * If the beacon frames are generated by the host system (i.e., not in | 1786 | * If the beacon frames are generated by the host system (i.e., not in |
| 1732 | * hardware/firmware), the low-level driver uses this function to receive | 1787 | * hardware/firmware), the driver uses this function to get each beacon |
| 1733 | * the next beacon frame from the 802.11 code. The low-level is responsible | 1788 | * frame from mac80211 -- it is responsible for calling this function |
| 1734 | * for calling this function before beacon data is needed (e.g., based on | 1789 | * before the beacon is needed (e.g. based on hardware interrupt). |
| 1735 | * hardware interrupt). Returned skb is used only once and low-level driver | 1790 | * |
| 1736 | * is responsible for freeing it. | 1791 | * If the beacon frames are generated by the device, then the driver |
| 1792 | * must use the returned beacon as the template and change the TIM IE | ||
| 1793 | * according to the current DTIM parameters/TIM bitmap. | ||
| 1794 | * | ||
| 1795 | * The driver is responsible for freeing the returned skb. | ||
| 1737 | */ | 1796 | */ |
| 1738 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | 1797 | struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, |
| 1739 | struct ieee80211_vif *vif); | 1798 | struct ieee80211_vif *vif, |
| 1799 | u16 *tim_offset, u16 *tim_length); | ||
| 1800 | |||
| 1801 | /** | ||
| 1802 | * ieee80211_beacon_get - beacon generation function | ||
| 1803 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
| 1804 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | ||
| 1805 | * | ||
| 1806 | * See ieee80211_beacon_get_tim(). | ||
| 1807 | */ | ||
| 1808 | static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | ||
| 1809 | struct ieee80211_vif *vif) | ||
| 1810 | { | ||
| 1811 | return ieee80211_beacon_get_tim(hw, vif, NULL, NULL); | ||
| 1812 | } | ||
| 1740 | 1813 | ||
| 1741 | /** | 1814 | /** |
| 1742 | * ieee80211_rts_get - RTS frame generation function | 1815 | * ieee80211_rts_get - RTS frame generation function |
| @@ -1981,8 +2054,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
| 1981 | 2054 | ||
| 1982 | /** | 2055 | /** |
| 1983 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 2056 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
| 1984 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2057 | * @sta: the station for which to start a BA session |
| 1985 | * @ra: receiver address of the BA session recipient | ||
| 1986 | * @tid: the TID to BA on. | 2058 | * @tid: the TID to BA on. |
| 1987 | * | 2059 | * |
| 1988 | * Return: success if addBA request was sent, failure otherwise | 2060 | * Return: success if addBA request was sent, failure otherwise |
| @@ -1991,22 +2063,22 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
| 1991 | * the need to start aggregation on a certain RA/TID, the session level | 2063 | * the need to start aggregation on a certain RA/TID, the session level |
| 1992 | * will be managed by the mac80211. | 2064 | * will be managed by the mac80211. |
| 1993 | */ | 2065 | */ |
| 1994 | int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid); | 2066 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); |
| 1995 | 2067 | ||
| 1996 | /** | 2068 | /** |
| 1997 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. | 2069 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. |
| 1998 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2070 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
| 1999 | * @ra: receiver address of the BA session recipient. | 2071 | * @ra: receiver address of the BA session recipient. |
| 2000 | * @tid: the TID to BA on. | 2072 | * @tid: the TID to BA on. |
| 2001 | * | 2073 | * |
| 2002 | * This function must be called by low level driver once it has | 2074 | * This function must be called by low level driver once it has |
| 2003 | * finished with preparations for the BA session. | 2075 | * finished with preparations for the BA session. |
| 2004 | */ | 2076 | */ |
| 2005 | void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | 2077 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); |
| 2006 | 2078 | ||
| 2007 | /** | 2079 | /** |
| 2008 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2080 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
| 2009 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2081 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
| 2010 | * @ra: receiver address of the BA session recipient. | 2082 | * @ra: receiver address of the BA session recipient. |
| 2011 | * @tid: the TID to BA on. | 2083 | * @tid: the TID to BA on. |
| 2012 | * | 2084 | * |
| @@ -2014,13 +2086,12 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | |||
| 2014 | * finished with preparations for the BA session. | 2086 | * finished with preparations for the BA session. |
| 2015 | * This version of the function is IRQ-safe. | 2087 | * This version of the function is IRQ-safe. |
| 2016 | */ | 2088 | */ |
| 2017 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 2089 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
| 2018 | u16 tid); | 2090 | u16 tid); |
| 2019 | 2091 | ||
| 2020 | /** | 2092 | /** |
| 2021 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. | 2093 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. |
| 2022 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2094 | * @sta: the station whose BA session to stop |
| 2023 | * @ra: receiver address of the BA session recipient | ||
| 2024 | * @tid: the TID to stop BA. | 2095 | * @tid: the TID to stop BA. |
| 2025 | * @initiator: if indicates initiator DELBA frame will be sent. | 2096 | * @initiator: if indicates initiator DELBA frame will be sent. |
| 2026 | * | 2097 | * |
| @@ -2030,24 +2101,23 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
| 2030 | * the need to stop aggregation on a certain RA/TID, the session level | 2101 | * the need to stop aggregation on a certain RA/TID, the session level |
| 2031 | * will be managed by the mac80211. | 2102 | * will be managed by the mac80211. |
| 2032 | */ | 2103 | */ |
| 2033 | int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw, | 2104 | int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid, |
| 2034 | u8 *ra, u16 tid, | ||
| 2035 | enum ieee80211_back_parties initiator); | 2105 | enum ieee80211_back_parties initiator); |
| 2036 | 2106 | ||
| 2037 | /** | 2107 | /** |
| 2038 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. | 2108 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. |
| 2039 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2109 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
| 2040 | * @ra: receiver address of the BA session recipient. | 2110 | * @ra: receiver address of the BA session recipient. |
| 2041 | * @tid: the desired TID to BA on. | 2111 | * @tid: the desired TID to BA on. |
| 2042 | * | 2112 | * |
| 2043 | * This function must be called by low level driver once it has | 2113 | * This function must be called by low level driver once it has |
| 2044 | * finished with preparations for the BA session tear down. | 2114 | * finished with preparations for the BA session tear down. |
| 2045 | */ | 2115 | */ |
| 2046 | void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | 2116 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); |
| 2047 | 2117 | ||
| 2048 | /** | 2118 | /** |
| 2049 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. | 2119 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. |
| 2050 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2120 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
| 2051 | * @ra: receiver address of the BA session recipient. | 2121 | * @ra: receiver address of the BA session recipient. |
| 2052 | * @tid: the desired TID to BA on. | 2122 | * @tid: the desired TID to BA on. |
| 2053 | * | 2123 | * |
| @@ -2055,22 +2125,75 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | |||
| 2055 | * finished with preparations for the BA session tear down. | 2125 | * finished with preparations for the BA session tear down. |
| 2056 | * This version of the function is IRQ-safe. | 2126 | * This version of the function is IRQ-safe. |
| 2057 | */ | 2127 | */ |
| 2058 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 2128 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
| 2059 | u16 tid); | 2129 | u16 tid); |
| 2060 | 2130 | ||
| 2061 | /** | 2131 | /** |
| 2062 | * ieee80211_find_sta - find a station | 2132 | * ieee80211_find_sta - find a station |
| 2063 | * | 2133 | * |
| 2064 | * @hw: pointer as obtained from ieee80211_alloc_hw() | 2134 | * @vif: virtual interface to look for station on |
| 2065 | * @addr: station's address | 2135 | * @addr: station's address |
| 2066 | * | 2136 | * |
| 2067 | * This function must be called under RCU lock and the | 2137 | * This function must be called under RCU lock and the |
| 2068 | * resulting pointer is only valid under RCU lock as well. | 2138 | * resulting pointer is only valid under RCU lock as well. |
| 2069 | */ | 2139 | */ |
| 2070 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, | 2140 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, |
| 2071 | const u8 *addr); | 2141 | const u8 *addr); |
| 2072 | 2142 | ||
| 2073 | /** | 2143 | /** |
| 2144 | * ieee80211_find_sta_by_hw - find a station on hardware | ||
| 2145 | * | ||
| 2146 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
| 2147 | * @addr: station's address | ||
| 2148 | * | ||
| 2149 | * This function must be called under RCU lock and the | ||
| 2150 | * resulting pointer is only valid under RCU lock as well. | ||
| 2151 | * | ||
| 2152 | * NOTE: This function should not be used! When mac80211 is converted | ||
| 2153 | * internally to properly keep track of stations on multiple | ||
| 2154 | * virtual interfaces, it will not always know which station to | ||
| 2155 | * return here since a single address might be used by multiple | ||
| 2156 | * logical stations (e.g. consider a station connecting to another | ||
| 2157 | * BSSID on the same AP hardware without disconnecting first). | ||
| 2158 | * | ||
| 2159 | * DO NOT USE THIS FUNCTION. | ||
| 2160 | */ | ||
| 2161 | struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, | ||
| 2162 | const u8 *addr); | ||
| 2163 | |||
| 2164 | /** | ||
| 2165 | * ieee80211_sta_block_awake - block station from waking up | ||
| 2166 | * @hw: the hardware | ||
| 2167 | * @pubsta: the station | ||
| 2168 | * @block: whether to block or unblock | ||
| 2169 | * | ||
| 2170 | * Some devices require that all frames that are on the queues | ||
| 2171 | * for a specific station that went to sleep are flushed before | ||
| 2172 | * a poll response or frames after the station woke up can be | ||
| 2173 | * delivered to that it. Note that such frames must be rejected | ||
| 2174 | * by the driver as filtered, with the appropriate status flag. | ||
| 2175 | * | ||
| 2176 | * This function allows implementing this mode in a race-free | ||
| 2177 | * manner. | ||
| 2178 | * | ||
| 2179 | * To do this, a driver must keep track of the number of frames | ||
| 2180 | * still enqueued for a specific station. If this number is not | ||
| 2181 | * zero when the station goes to sleep, the driver must call | ||
| 2182 | * this function to force mac80211 to consider the station to | ||
| 2183 | * be asleep regardless of the station's actual state. Once the | ||
| 2184 | * number of outstanding frames reaches zero, the driver must | ||
| 2185 | * call this function again to unblock the station. That will | ||
| 2186 | * cause mac80211 to be able to send ps-poll responses, and if | ||
| 2187 | * the station queried in the meantime then frames will also | ||
| 2188 | * be sent out as a result of this. Additionally, the driver | ||
| 2189 | * will be notified that the station woke up some time after | ||
| 2190 | * it is unblocked, regardless of whether the station actually | ||
| 2191 | * woke up while blocked or not. | ||
| 2192 | */ | ||
| 2193 | void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | ||
| 2194 | struct ieee80211_sta *pubsta, bool block); | ||
| 2195 | |||
| 2196 | /** | ||
| 2074 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2197 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
| 2075 | * | 2198 | * |
| 2076 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2199 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
