diff options
| author | John W. Linville <linville@tuxdriver.com> | 2013-04-24 10:54:20 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2013-04-24 10:54:20 -0400 |
| commit | 6ed0e321a0aef14a894e26658108bf7e895c36a6 (patch) | |
| tree | f49428d68ebcb1beb757296ea1559079210babbe /include | |
| parent | 3dec2246c2ff11beb24ca1950f074b2bcbc85953 (diff) | |
| parent | b006ed545cbadf1ebd4683719554742d20dbcede (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/bcma/bcma.h | 1 | ||||
| -rw-r--r-- | include/linux/bcma/bcma_driver_chipcommon.h | 3 | ||||
| -rw-r--r-- | include/linux/bcma/bcma_regs.h | 1 | ||||
| -rw-r--r-- | include/linux/ieee80211.h | 73 | ||||
| -rw-r--r-- | include/linux/platform_data/brcmfmac-sdio.h | 124 | ||||
| -rw-r--r-- | include/net/bluetooth/bluetooth.h | 5 | ||||
| -rw-r--r-- | include/net/bluetooth/hci.h | 9 | ||||
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 98 | ||||
| -rw-r--r-- | include/net/bluetooth/l2cap.h | 15 | ||||
| -rw-r--r-- | include/net/cfg80211.h | 38 | ||||
| -rw-r--r-- | include/net/mac80211.h | 127 | ||||
| -rw-r--r-- | include/net/nfc/nfc.h | 2 | ||||
| -rw-r--r-- | include/uapi/linux/nfc.h | 7 | ||||
| -rw-r--r-- | include/uapi/linux/nl80211.h | 39 | ||||
| -rw-r--r-- | include/uapi/linux/rfkill.h | 2 |
15 files changed, 480 insertions, 64 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 0ab6712fd76b..f14a98a79c9d 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -134,6 +134,7 @@ struct bcma_host_ops { | |||
| 134 | #define BCMA_CORE_I2S 0x834 | 134 | #define BCMA_CORE_I2S 0x834 |
| 135 | #define BCMA_CORE_SDR_DDR1_MEM_CTL 0x835 /* SDR/DDR1 memory controller core */ | 135 | #define BCMA_CORE_SDR_DDR1_MEM_CTL 0x835 /* SDR/DDR1 memory controller core */ |
| 136 | #define BCMA_CORE_SHIM 0x837 /* SHIM component in ubus/6362 */ | 136 | #define BCMA_CORE_SHIM 0x837 /* SHIM component in ubus/6362 */ |
| 137 | #define BCMA_CORE_ARM_CR4 0x83e | ||
| 137 | #define BCMA_CORE_DEFAULT 0xFFF | 138 | #define BCMA_CORE_DEFAULT 0xFFF |
| 138 | 139 | ||
| 139 | #define BCMA_MAX_NR_CORES 16 | 140 | #define BCMA_MAX_NR_CORES 16 |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 453fcc914683..b8b09eac60a4 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -316,6 +316,9 @@ | |||
| 316 | #define BCMA_CC_PMU_CTL 0x0600 /* PMU control */ | 316 | #define BCMA_CC_PMU_CTL 0x0600 /* PMU control */ |
| 317 | #define BCMA_CC_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */ | 317 | #define BCMA_CC_PMU_CTL_ILP_DIV 0xFFFF0000 /* ILP div mask */ |
| 318 | #define BCMA_CC_PMU_CTL_ILP_DIV_SHIFT 16 | 318 | #define BCMA_CC_PMU_CTL_ILP_DIV_SHIFT 16 |
| 319 | #define BCMA_CC_PMU_CTL_RES 0x00006000 /* reset control mask */ | ||
| 320 | #define BCMA_CC_PMU_CTL_RES_SHIFT 13 | ||
| 321 | #define BCMA_CC_PMU_CTL_RES_RELOAD 0x2 /* reload POR values */ | ||
| 319 | #define BCMA_CC_PMU_CTL_PLL_UPD 0x00000400 | 322 | #define BCMA_CC_PMU_CTL_PLL_UPD 0x00000400 |
| 320 | #define BCMA_CC_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */ | 323 | #define BCMA_CC_PMU_CTL_NOILPONW 0x00000200 /* No ILP on wait */ |
| 321 | #define BCMA_CC_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */ | 324 | #define BCMA_CC_PMU_CTL_HTREQEN 0x00000100 /* HT req enable */ |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index 7e8104bb7a7e..917dcd7965e7 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #define BCMA_IOST_BIST_DONE 0x8000 | 37 | #define BCMA_IOST_BIST_DONE 0x8000 |
| 38 | #define BCMA_RESET_CTL 0x0800 | 38 | #define BCMA_RESET_CTL 0x0800 |
| 39 | #define BCMA_RESET_CTL_RESET 0x0001 | 39 | #define BCMA_RESET_CTL_RESET 0x0001 |
| 40 | #define BCMA_RESET_ST 0x0804 | ||
| 40 | 41 | ||
| 41 | /* BCMA PCI config space registers. */ | 42 | /* BCMA PCI config space registers. */ |
| 42 | #define BCMA_PCI_PMCSR 0x44 | 43 | #define BCMA_PCI_PMCSR 0x44 |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4cf0c9e4dd99..06b0ed0154a4 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -673,6 +673,36 @@ struct ieee80211_channel_sw_ie { | |||
| 673 | } __packed; | 673 | } __packed; |
| 674 | 674 | ||
| 675 | /** | 675 | /** |
| 676 | * struct ieee80211_ext_chansw_ie | ||
| 677 | * | ||
| 678 | * This structure represents the "Extended Channel Switch Announcement element" | ||
| 679 | */ | ||
| 680 | struct ieee80211_ext_chansw_ie { | ||
| 681 | u8 mode; | ||
| 682 | u8 new_operating_class; | ||
| 683 | u8 new_ch_num; | ||
| 684 | u8 count; | ||
| 685 | } __packed; | ||
| 686 | |||
| 687 | /** | ||
| 688 | * struct ieee80211_sec_chan_offs_ie - secondary channel offset IE | ||
| 689 | * @sec_chan_offs: secondary channel offset, uses IEEE80211_HT_PARAM_CHA_SEC_* | ||
| 690 | * values here | ||
| 691 | * This structure represents the "Secondary Channel Offset element" | ||
| 692 | */ | ||
| 693 | struct ieee80211_sec_chan_offs_ie { | ||
| 694 | u8 sec_chan_offs; | ||
| 695 | } __packed; | ||
| 696 | |||
| 697 | /** | ||
| 698 | * struct ieee80211_wide_bw_chansw_ie - wide bandwidth channel switch IE | ||
| 699 | */ | ||
| 700 | struct ieee80211_wide_bw_chansw_ie { | ||
| 701 | u8 new_channel_width; | ||
| 702 | u8 new_center_freq_seg0, new_center_freq_seg1; | ||
| 703 | } __packed; | ||
| 704 | |||
| 705 | /** | ||
| 676 | * struct ieee80211_tim | 706 | * struct ieee80211_tim |
| 677 | * | 707 | * |
| 678 | * This structure refers to "Traffic Indication Map information element" | 708 | * This structure refers to "Traffic Indication Map information element" |
| @@ -840,12 +870,15 @@ struct ieee80211_mgmt { | |||
| 840 | } __packed wme_action; | 870 | } __packed wme_action; |
| 841 | struct{ | 871 | struct{ |
| 842 | u8 action_code; | 872 | u8 action_code; |
| 843 | u8 element_id; | 873 | u8 variable[0]; |
| 844 | u8 length; | ||
| 845 | struct ieee80211_channel_sw_ie sw_elem; | ||
| 846 | } __packed chan_switch; | 874 | } __packed chan_switch; |
| 847 | struct{ | 875 | struct{ |
| 848 | u8 action_code; | 876 | u8 action_code; |
| 877 | struct ieee80211_ext_chansw_ie data; | ||
| 878 | u8 variable[0]; | ||
| 879 | } __packed ext_chan_switch; | ||
| 880 | struct{ | ||
| 881 | u8 action_code; | ||
| 849 | u8 dialog_token; | 882 | u8 dialog_token; |
| 850 | u8 element_id; | 883 | u8 element_id; |
| 851 | u8 length; | 884 | u8 length; |
| @@ -1027,6 +1060,26 @@ enum ieee80211_p2p_attr_id { | |||
| 1027 | IEEE80211_P2P_ATTR_MAX | 1060 | IEEE80211_P2P_ATTR_MAX |
| 1028 | }; | 1061 | }; |
| 1029 | 1062 | ||
| 1063 | /* Notice of Absence attribute - described in P2P spec 4.1.14 */ | ||
| 1064 | /* Typical max value used here */ | ||
| 1065 | #define IEEE80211_P2P_NOA_DESC_MAX 4 | ||
| 1066 | |||
| 1067 | struct ieee80211_p2p_noa_desc { | ||
| 1068 | u8 count; | ||
| 1069 | __le32 duration; | ||
| 1070 | __le32 interval; | ||
| 1071 | __le32 start_time; | ||
| 1072 | } __packed; | ||
| 1073 | |||
| 1074 | struct ieee80211_p2p_noa_attr { | ||
| 1075 | u8 index; | ||
| 1076 | u8 oppps_ctwindow; | ||
| 1077 | struct ieee80211_p2p_noa_desc desc[IEEE80211_P2P_NOA_DESC_MAX]; | ||
| 1078 | } __packed; | ||
| 1079 | |||
| 1080 | #define IEEE80211_P2P_OPPPS_ENABLE_BIT BIT(7) | ||
| 1081 | #define IEEE80211_P2P_OPPPS_CTWINDOW_MASK 0x7F | ||
| 1082 | |||
| 1030 | /** | 1083 | /** |
| 1031 | * struct ieee80211_bar - HT Block Ack Request | 1084 | * struct ieee80211_bar - HT Block Ack Request |
| 1032 | * | 1085 | * |
| @@ -1618,6 +1671,7 @@ enum ieee80211_eid { | |||
| 1618 | 1671 | ||
| 1619 | WLAN_EID_HT_CAPABILITY = 45, | 1672 | WLAN_EID_HT_CAPABILITY = 45, |
| 1620 | WLAN_EID_HT_OPERATION = 61, | 1673 | WLAN_EID_HT_OPERATION = 61, |
| 1674 | WLAN_EID_SECONDARY_CHANNEL_OFFSET = 62, | ||
| 1621 | 1675 | ||
| 1622 | WLAN_EID_RSN = 48, | 1676 | WLAN_EID_RSN = 48, |
| 1623 | WLAN_EID_MMIE = 76, | 1677 | WLAN_EID_MMIE = 76, |
| @@ -1652,6 +1706,8 @@ enum ieee80211_eid { | |||
| 1652 | WLAN_EID_VHT_CAPABILITY = 191, | 1706 | WLAN_EID_VHT_CAPABILITY = 191, |
| 1653 | WLAN_EID_VHT_OPERATION = 192, | 1707 | WLAN_EID_VHT_OPERATION = 192, |
| 1654 | WLAN_EID_OPMODE_NOTIF = 199, | 1708 | WLAN_EID_OPMODE_NOTIF = 199, |
| 1709 | WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194, | ||
| 1710 | WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196, | ||
| 1655 | 1711 | ||
| 1656 | /* 802.11ad */ | 1712 | /* 802.11ad */ |
| 1657 | WLAN_EID_NON_TX_BSSID_CAP = 83, | 1713 | WLAN_EID_NON_TX_BSSID_CAP = 83, |
| @@ -1775,6 +1831,7 @@ enum ieee80211_key_len { | |||
| 1775 | 1831 | ||
| 1776 | /* Public action codes */ | 1832 | /* Public action codes */ |
| 1777 | enum ieee80211_pub_actioncode { | 1833 | enum ieee80211_pub_actioncode { |
| 1834 | WLAN_PUB_ACTION_EXT_CHANSW_ANN = 4, | ||
| 1778 | WLAN_PUB_ACTION_TDLS_DISCOVER_RES = 14, | 1835 | WLAN_PUB_ACTION_TDLS_DISCOVER_RES = 14, |
| 1779 | }; | 1836 | }; |
| 1780 | 1837 | ||
| @@ -1935,6 +1992,16 @@ enum ieee80211_timeout_interval_type { | |||
| 1935 | WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */, | 1992 | WLAN_TIMEOUT_ASSOC_COMEBACK = 3 /* 802.11w */, |
| 1936 | }; | 1993 | }; |
| 1937 | 1994 | ||
| 1995 | /** | ||
| 1996 | * struct ieee80211_timeout_interval_ie - Timeout Interval element | ||
| 1997 | * @type: type, see &enum ieee80211_timeout_interval_type | ||
| 1998 | * @value: timeout interval value | ||
| 1999 | */ | ||
| 2000 | struct ieee80211_timeout_interval_ie { | ||
| 2001 | u8 type; | ||
| 2002 | __le32 value; | ||
| 2003 | } __packed; | ||
| 2004 | |||
| 1938 | /* BACK action code */ | 2005 | /* BACK action code */ |
| 1939 | enum ieee80211_back_actioncode { | 2006 | enum ieee80211_back_actioncode { |
| 1940 | WLAN_ACTION_ADDBA_REQ = 0, | 2007 | WLAN_ACTION_ADDBA_REQ = 0, |
diff --git a/include/linux/platform_data/brcmfmac-sdio.h b/include/linux/platform_data/brcmfmac-sdio.h new file mode 100644 index 000000000000..1ade657d5fc1 --- /dev/null +++ b/include/linux/platform_data/brcmfmac-sdio.h | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2013 Broadcom Corporation | ||
| 3 | * | ||
| 4 | * Permission to use, copy, modify, and/or distribute this software for any | ||
| 5 | * purpose with or without fee is hereby granted, provided that the above | ||
| 6 | * copyright notice and this permission notice appear in all copies. | ||
| 7 | * | ||
| 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | ||
| 11 | * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION | ||
| 13 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | ||
| 14 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef _LINUX_BRCMFMAC_PLATFORM_H | ||
| 18 | #define _LINUX_BRCMFMAC_PLATFORM_H | ||
| 19 | |||
| 20 | /* | ||
| 21 | * Platform specific driver functions and data. Through the platform specific | ||
| 22 | * device data functions can be provided to help the brcmfmac driver to | ||
| 23 | * operate with the device in combination with the used platform. | ||
| 24 | * | ||
| 25 | * Use the platform data in the following (similar) way: | ||
| 26 | * | ||
| 27 | * | ||
| 28 | #include <brcmfmac_platform.h> | ||
| 29 | |||
| 30 | |||
| 31 | static void brcmfmac_power_on(void) | ||
| 32 | { | ||
| 33 | } | ||
| 34 | |||
| 35 | static void brcmfmac_power_off(void) | ||
| 36 | { | ||
| 37 | } | ||
| 38 | |||
| 39 | static void brcmfmac_reset(void) | ||
| 40 | { | ||
| 41 | } | ||
| 42 | |||
| 43 | static struct brcmfmac_sdio_platform_data brcmfmac_sdio_pdata = { | ||
| 44 | .power_on = brcmfmac_power_on, | ||
| 45 | .power_off = brcmfmac_power_off, | ||
| 46 | .reset = brcmfmac_reset | ||
| 47 | }; | ||
| 48 | |||
| 49 | static struct platform_device brcmfmac_device = { | ||
| 50 | .name = BRCMFMAC_SDIO_PDATA_NAME, | ||
| 51 | .id = PLATFORM_DEVID_NONE, | ||
| 52 | .dev.platform_data = &brcmfmac_sdio_pdata | ||
| 53 | }; | ||
| 54 | |||
| 55 | void __init brcmfmac_init_pdata(void) | ||
| 56 | { | ||
| 57 | brcmfmac_sdio_pdata.oob_irq_supported = true; | ||
| 58 | brcmfmac_sdio_pdata.oob_irq_nr = gpio_to_irq(GPIO_BRCMF_SDIO_OOB); | ||
| 59 | brcmfmac_sdio_pdata.oob_irq_flags = IORESOURCE_IRQ | | ||
| 60 | IORESOURCE_IRQ_HIGHLEVEL; | ||
| 61 | platform_device_register(&brcmfmac_device); | ||
| 62 | } | ||
| 63 | * | ||
| 64 | * | ||
| 65 | * Note: the brcmfmac can be loaded as module or be statically built-in into | ||
| 66 | * the kernel. If built-in then do note that it uses module_init (and | ||
| 67 | * module_exit) routines which equal device_initcall. So if you intend to | ||
| 68 | * create a module with the platform specific data for the brcmfmac and have | ||
| 69 | * it built-in to the kernel then use a higher initcall then device_initcall | ||
| 70 | * (see init.h). If this is not done then brcmfmac will load without problems | ||
| 71 | * but will not pickup the platform data. | ||
| 72 | * | ||
| 73 | * When the driver does not "detect" platform driver data then it will continue | ||
| 74 | * without reporting anything and just assume there is no data needed. Which is | ||
| 75 | * probably true for most platforms. | ||
| 76 | * | ||
| 77 | * Explanation of the platform_data fields: | ||
| 78 | * | ||
| 79 | * drive_strength: is the preferred drive_strength to be used for the SDIO | ||
| 80 | * pins. If 0 then a default value will be used. This is the target drive | ||
| 81 | * strength, the exact drive strength which will be used depends on the | ||
| 82 | * capabilities of the device. | ||
| 83 | * | ||
| 84 | * oob_irq_supported: does the board have support for OOB interrupts. SDIO | ||
| 85 | * in-band interrupts are relatively slow and for having less overhead on | ||
| 86 | * interrupt processing an out of band interrupt can be used. If the HW | ||
| 87 | * supports this then enable this by setting this field to true and configure | ||
| 88 | * the oob related fields. | ||
| 89 | * | ||
| 90 | * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are | ||
| 91 | * used for registering the irq using request_irq function. | ||
| 92 | * | ||
| 93 | * power_on: This function is called by the brcmfmac when the module gets | ||
| 94 | * loaded. This can be particularly useful for low power devices. The platform | ||
| 95 | * spcific routine may for example decide to power up the complete device. | ||
| 96 | * If there is no use-case for this function then provide NULL. | ||
| 97 | * | ||
| 98 | * power_off: This function is called by the brcmfmac when the module gets | ||
| 99 | * unloaded. At this point the device can be powered down or otherwise be reset. | ||
| 100 | * So if an actual power_off is not supported but reset is then reset the device | ||
| 101 | * when this function gets called. This can be particularly useful for low power | ||
| 102 | * devices. If there is no use-case for this function (either power-down or | ||
| 103 | * reset) then provide NULL. | ||
| 104 | * | ||
| 105 | * reset: This function can get called if the device communication broke down. | ||
| 106 | * This functionality is particularly useful in case of SDIO type devices. It is | ||
| 107 | * possible to reset a dongle via sdio data interface, but it requires that | ||
| 108 | * this is fully functional. This function is chip/module specific and this | ||
| 109 | * function should return only after the complete reset has completed. | ||
| 110 | */ | ||
| 111 | |||
| 112 | #define BRCMFMAC_SDIO_PDATA_NAME "brcmfmac_sdio" | ||
| 113 | |||
| 114 | struct brcmfmac_sdio_platform_data { | ||
| 115 | unsigned int drive_strength; | ||
| 116 | bool oob_irq_supported; | ||
| 117 | unsigned int oob_irq_nr; | ||
| 118 | unsigned long oob_irq_flags; | ||
| 119 | void (*power_on)(void); | ||
| 120 | void (*power_off)(void); | ||
| 121 | void (*reset)(void); | ||
| 122 | }; | ||
| 123 | |||
| 124 | #endif /* _LINUX_BRCMFMAC_PLATFORM_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index ed6e9552252e..6912ef9a1881 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -193,11 +193,11 @@ static inline bool bdaddr_type_is_le(__u8 type) | |||
| 193 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) | 193 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) |
| 194 | 194 | ||
| 195 | /* Copy, swap, convert BD Address */ | 195 | /* Copy, swap, convert BD Address */ |
| 196 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) | 196 | static inline int bacmp(const bdaddr_t *ba1, const bdaddr_t *ba2) |
| 197 | { | 197 | { |
| 198 | return memcmp(ba1, ba2, sizeof(bdaddr_t)); | 198 | return memcmp(ba1, ba2, sizeof(bdaddr_t)); |
| 199 | } | 199 | } |
| 200 | static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) | 200 | static inline void bacpy(bdaddr_t *dst, const bdaddr_t *src) |
| 201 | { | 201 | { |
| 202 | memcpy(dst, src, sizeof(bdaddr_t)); | 202 | memcpy(dst, src, sizeof(bdaddr_t)); |
| 203 | } | 203 | } |
| @@ -266,6 +266,7 @@ typedef void (*hci_req_complete_t)(struct hci_dev *hdev, u8 status); | |||
| 266 | 266 | ||
| 267 | struct hci_req_ctrl { | 267 | struct hci_req_ctrl { |
| 268 | bool start; | 268 | bool start; |
| 269 | u8 event; | ||
| 269 | hci_req_complete_t complete; | 270 | hci_req_complete_t complete; |
| 270 | }; | 271 | }; |
| 271 | 272 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index b3308927a0a1..e0512aaef4b8 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -984,6 +984,9 @@ struct hci_cp_le_set_adv_data { | |||
| 984 | 984 | ||
| 985 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a | 985 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a |
| 986 | 986 | ||
| 987 | #define LE_SCAN_PASSIVE 0x00 | ||
| 988 | #define LE_SCAN_ACTIVE 0x01 | ||
| 989 | |||
| 987 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | 990 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
| 988 | struct hci_cp_le_set_scan_param { | 991 | struct hci_cp_le_set_scan_param { |
| 989 | __u8 type; | 992 | __u8 type; |
| @@ -993,8 +996,10 @@ struct hci_cp_le_set_scan_param { | |||
| 993 | __u8 filter_policy; | 996 | __u8 filter_policy; |
| 994 | } __packed; | 997 | } __packed; |
| 995 | 998 | ||
| 996 | #define LE_SCANNING_DISABLED 0x00 | 999 | #define LE_SCAN_DISABLE 0x00 |
| 997 | #define LE_SCANNING_ENABLED 0x01 | 1000 | #define LE_SCAN_ENABLE 0x01 |
| 1001 | #define LE_SCAN_FILTER_DUP_DISABLE 0x00 | ||
| 1002 | #define LE_SCAN_FILTER_DUP_ENABLE 0x01 | ||
| 998 | 1003 | ||
| 999 | #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c | 1004 | #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c |
| 1000 | struct hci_cp_le_set_scan_enable { | 1005 | struct hci_cp_le_set_scan_enable { |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 358a6983d3bb..80d718a9b31f 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -134,6 +134,8 @@ struct amp_assoc { | |||
| 134 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; | 134 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; |
| 135 | }; | 135 | }; |
| 136 | 136 | ||
| 137 | #define HCI_MAX_PAGES 3 | ||
| 138 | |||
| 137 | #define NUM_REASSEMBLY 4 | 139 | #define NUM_REASSEMBLY 4 |
| 138 | struct hci_dev { | 140 | struct hci_dev { |
| 139 | struct list_head list; | 141 | struct list_head list; |
| @@ -151,8 +153,8 @@ struct hci_dev { | |||
| 151 | __u8 dev_class[3]; | 153 | __u8 dev_class[3]; |
| 152 | __u8 major_class; | 154 | __u8 major_class; |
| 153 | __u8 minor_class; | 155 | __u8 minor_class; |
| 154 | __u8 features[8]; | 156 | __u8 max_page; |
| 155 | __u8 host_features[8]; | 157 | __u8 features[HCI_MAX_PAGES][8]; |
| 156 | __u8 le_features[8]; | 158 | __u8 le_features[8]; |
| 157 | __u8 le_white_list_size; | 159 | __u8 le_white_list_size; |
| 158 | __u8 le_states[8]; | 160 | __u8 le_states[8]; |
| @@ -244,6 +246,7 @@ struct hci_dev { | |||
| 244 | struct sk_buff_head raw_q; | 246 | struct sk_buff_head raw_q; |
| 245 | struct sk_buff_head cmd_q; | 247 | struct sk_buff_head cmd_q; |
| 246 | 248 | ||
| 249 | struct sk_buff *recv_evt; | ||
| 247 | struct sk_buff *sent_cmd; | 250 | struct sk_buff *sent_cmd; |
| 248 | struct sk_buff *reassembly[NUM_REASSEMBLY]; | 251 | struct sk_buff *reassembly[NUM_REASSEMBLY]; |
| 249 | 252 | ||
| @@ -268,8 +271,6 @@ struct hci_dev { | |||
| 268 | 271 | ||
| 269 | struct hci_dev_stats stat; | 272 | struct hci_dev_stats stat; |
| 270 | 273 | ||
| 271 | struct sk_buff_head driver_init; | ||
| 272 | |||
| 273 | atomic_t promisc; | 274 | atomic_t promisc; |
| 274 | 275 | ||
| 275 | struct dentry *debugfs; | 276 | struct dentry *debugfs; |
| @@ -292,6 +293,7 @@ struct hci_dev { | |||
| 292 | int (*open)(struct hci_dev *hdev); | 293 | int (*open)(struct hci_dev *hdev); |
| 293 | int (*close)(struct hci_dev *hdev); | 294 | int (*close)(struct hci_dev *hdev); |
| 294 | int (*flush)(struct hci_dev *hdev); | 295 | int (*flush)(struct hci_dev *hdev); |
| 296 | int (*setup)(struct hci_dev *hdev); | ||
| 295 | int (*send)(struct sk_buff *skb); | 297 | int (*send)(struct sk_buff *skb); |
| 296 | void (*notify)(struct hci_dev *hdev, unsigned int evt); | 298 | void (*notify)(struct hci_dev *hdev, unsigned int evt); |
| 297 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); | 299 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); |
| @@ -313,7 +315,7 @@ struct hci_conn { | |||
| 313 | bool out; | 315 | bool out; |
| 314 | __u8 attempt; | 316 | __u8 attempt; |
| 315 | __u8 dev_class[3]; | 317 | __u8 dev_class[3]; |
| 316 | __u8 features[8]; | 318 | __u8 features[HCI_MAX_PAGES][8]; |
| 317 | __u16 interval; | 319 | __u16 interval; |
| 318 | __u16 pkt_type; | 320 | __u16 pkt_type; |
| 319 | __u16 link_policy; | 321 | __u16 link_policy; |
| @@ -345,7 +347,6 @@ struct hci_conn { | |||
| 345 | struct timer_list auto_accept_timer; | 347 | struct timer_list auto_accept_timer; |
| 346 | 348 | ||
| 347 | struct device dev; | 349 | struct device dev; |
| 348 | atomic_t devref; | ||
| 349 | 350 | ||
| 350 | struct hci_dev *hdev; | 351 | struct hci_dev *hdev; |
| 351 | void *l2cap_data; | 352 | void *l2cap_data; |
| @@ -584,7 +585,6 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); | |||
| 584 | int hci_conn_del(struct hci_conn *conn); | 585 | int hci_conn_del(struct hci_conn *conn); |
| 585 | void hci_conn_hash_flush(struct hci_dev *hdev); | 586 | void hci_conn_hash_flush(struct hci_dev *hdev); |
| 586 | void hci_conn_check_pending(struct hci_dev *hdev); | 587 | void hci_conn_check_pending(struct hci_dev *hdev); |
| 587 | void hci_conn_accept(struct hci_conn *conn, int mask); | ||
| 588 | 588 | ||
| 589 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | 589 | struct hci_chan *hci_chan_create(struct hci_conn *conn); |
| 590 | void hci_chan_del(struct hci_chan *chan); | 590 | void hci_chan_del(struct hci_chan *chan); |
| @@ -601,8 +601,36 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8 role); | |||
| 601 | 601 | ||
| 602 | void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active); | 602 | void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active); |
| 603 | 603 | ||
| 604 | void hci_conn_hold_device(struct hci_conn *conn); | 604 | /* |
| 605 | void hci_conn_put_device(struct hci_conn *conn); | 605 | * hci_conn_get() and hci_conn_put() are used to control the life-time of an |
| 606 | * "hci_conn" object. They do not guarantee that the hci_conn object is running, | ||
| 607 | * working or anything else. They just guarantee that the object is available | ||
| 608 | * and can be dereferenced. So you can use its locks, local variables and any | ||
| 609 | * other constant data. | ||
| 610 | * Before accessing runtime data, you _must_ lock the object and then check that | ||
| 611 | * it is still running. As soon as you release the locks, the connection might | ||
| 612 | * get dropped, though. | ||
| 613 | * | ||
| 614 | * On the other hand, hci_conn_hold() and hci_conn_drop() are used to control | ||
| 615 | * how long the underlying connection is held. So every channel that runs on the | ||
| 616 | * hci_conn object calls this to prevent the connection from disappearing. As | ||
| 617 | * long as you hold a device, you must also guarantee that you have a valid | ||
| 618 | * reference to the device via hci_conn_get() (or the initial reference from | ||
| 619 | * hci_conn_add()). | ||
| 620 | * The hold()/drop() ref-count is known to drop below 0 sometimes, which doesn't | ||
| 621 | * break because nobody cares for that. But this means, we cannot use | ||
| 622 | * _get()/_drop() in it, but require the caller to have a valid ref (FIXME). | ||
| 623 | */ | ||
| 624 | |||
| 625 | static inline void hci_conn_get(struct hci_conn *conn) | ||
| 626 | { | ||
| 627 | get_device(&conn->dev); | ||
| 628 | } | ||
| 629 | |||
| 630 | static inline void hci_conn_put(struct hci_conn *conn) | ||
| 631 | { | ||
| 632 | put_device(&conn->dev); | ||
| 633 | } | ||
| 606 | 634 | ||
| 607 | static inline void hci_conn_hold(struct hci_conn *conn) | 635 | static inline void hci_conn_hold(struct hci_conn *conn) |
| 608 | { | 636 | { |
| @@ -612,7 +640,7 @@ static inline void hci_conn_hold(struct hci_conn *conn) | |||
| 612 | cancel_delayed_work(&conn->disc_work); | 640 | cancel_delayed_work(&conn->disc_work); |
| 613 | } | 641 | } |
| 614 | 642 | ||
| 615 | static inline void hci_conn_put(struct hci_conn *conn) | 643 | static inline void hci_conn_drop(struct hci_conn *conn) |
| 616 | { | 644 | { |
| 617 | BT_DBG("hcon %p orig refcnt %d", conn, atomic_read(&conn->refcnt)); | 645 | BT_DBG("hcon %p orig refcnt %d", conn, atomic_read(&conn->refcnt)); |
| 618 | 646 | ||
| @@ -760,29 +788,29 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
| 760 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) | 788 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
| 761 | 789 | ||
| 762 | /* ----- LMP capabilities ----- */ | 790 | /* ----- LMP capabilities ----- */ |
| 763 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) | 791 | #define lmp_encrypt_capable(dev) ((dev)->features[0][0] & LMP_ENCRYPT) |
| 764 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | 792 | #define lmp_rswitch_capable(dev) ((dev)->features[0][0] & LMP_RSWITCH) |
| 765 | #define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD) | 793 | #define lmp_hold_capable(dev) ((dev)->features[0][0] & LMP_HOLD) |
| 766 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 794 | #define lmp_sniff_capable(dev) ((dev)->features[0][0] & LMP_SNIFF) |
| 767 | #define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK) | 795 | #define lmp_park_capable(dev) ((dev)->features[0][1] & LMP_PARK) |
| 768 | #define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ) | 796 | #define lmp_inq_rssi_capable(dev) ((dev)->features[0][3] & LMP_RSSI_INQ) |
| 769 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 797 | #define lmp_esco_capable(dev) ((dev)->features[0][3] & LMP_ESCO) |
| 770 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | 798 | #define lmp_bredr_capable(dev) (!((dev)->features[0][4] & LMP_NO_BREDR)) |
| 771 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | 799 | #define lmp_le_capable(dev) ((dev)->features[0][4] & LMP_LE) |
| 772 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 800 | #define lmp_sniffsubr_capable(dev) ((dev)->features[0][5] & LMP_SNIFF_SUBR) |
| 773 | #define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC) | 801 | #define lmp_pause_enc_capable(dev) ((dev)->features[0][5] & LMP_PAUSE_ENC) |
| 774 | #define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ) | 802 | #define lmp_ext_inq_capable(dev) ((dev)->features[0][6] & LMP_EXT_INQ) |
| 775 | #define lmp_le_br_capable(dev) !!((dev)->features[6] & LMP_SIMUL_LE_BR) | 803 | #define lmp_le_br_capable(dev) (!!((dev)->features[0][6] & LMP_SIMUL_LE_BR)) |
| 776 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | 804 | #define lmp_ssp_capable(dev) ((dev)->features[0][6] & LMP_SIMPLE_PAIR) |
| 777 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) | 805 | #define lmp_no_flush_capable(dev) ((dev)->features[0][6] & LMP_NO_FLUSH) |
| 778 | #define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO) | 806 | #define lmp_lsto_capable(dev) ((dev)->features[0][7] & LMP_LSTO) |
| 779 | #define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR) | 807 | #define lmp_inq_tx_pwr_capable(dev) ((dev)->features[0][7] & LMP_INQ_TX_PWR) |
| 780 | #define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES) | 808 | #define lmp_ext_feat_capable(dev) ((dev)->features[0][7] & LMP_EXTFEATURES) |
| 781 | 809 | ||
| 782 | /* ----- Extended LMP capabilities ----- */ | 810 | /* ----- Extended LMP capabilities ----- */ |
| 783 | #define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP) | 811 | #define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) |
| 784 | #define lmp_host_le_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE) | 812 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) |
| 785 | #define lmp_host_le_br_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE_BREDR) | 813 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) |
| 786 | 814 | ||
| 787 | /* returns true if at least one AMP active */ | 815 | /* returns true if at least one AMP active */ |
| 788 | static inline bool hci_amp_capable(void) | 816 | static inline bool hci_amp_capable(void) |
| @@ -1054,8 +1082,14 @@ struct hci_request { | |||
| 1054 | void hci_req_init(struct hci_request *req, struct hci_dev *hdev); | 1082 | void hci_req_init(struct hci_request *req, struct hci_dev *hdev); |
| 1055 | int hci_req_run(struct hci_request *req, hci_req_complete_t complete); | 1083 | int hci_req_run(struct hci_request *req, hci_req_complete_t complete); |
| 1056 | void hci_req_add(struct hci_request *req, u16 opcode, u32 plen, void *param); | 1084 | void hci_req_add(struct hci_request *req, u16 opcode, u32 plen, void *param); |
| 1085 | void hci_req_add_ev(struct hci_request *req, u16 opcode, u32 plen, void *param, | ||
| 1086 | u8 event); | ||
| 1057 | void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); | 1087 | void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status); |
| 1058 | void hci_req_cmd_status(struct hci_dev *hdev, u16 opcode, u8 status); | 1088 | |
| 1089 | struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen, | ||
| 1090 | void *param, u32 timeout); | ||
| 1091 | struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen, | ||
| 1092 | void *param, u8 event, u32 timeout); | ||
| 1059 | 1093 | ||
| 1060 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); | 1094 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); |
| 1061 | void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); | 1095 | void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index cdd33021f831..fb94cf13c777 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -583,6 +583,14 @@ struct l2cap_conn { | |||
| 583 | 583 | ||
| 584 | struct list_head chan_l; | 584 | struct list_head chan_l; |
| 585 | struct mutex chan_lock; | 585 | struct mutex chan_lock; |
| 586 | struct kref ref; | ||
| 587 | struct list_head users; | ||
| 588 | }; | ||
| 589 | |||
| 590 | struct l2cap_user { | ||
| 591 | struct list_head list; | ||
| 592 | int (*probe) (struct l2cap_conn *conn, struct l2cap_user *user); | ||
| 593 | void (*remove) (struct l2cap_conn *conn, struct l2cap_user *user); | ||
| 586 | }; | 594 | }; |
| 587 | 595 | ||
| 588 | #define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 | 596 | #define L2CAP_INFO_CL_MTU_REQ_SENT 0x01 |
| @@ -786,6 +794,7 @@ extern bool disable_ertm; | |||
| 786 | 794 | ||
| 787 | int l2cap_init_sockets(void); | 795 | int l2cap_init_sockets(void); |
| 788 | void l2cap_cleanup_sockets(void); | 796 | void l2cap_cleanup_sockets(void); |
| 797 | bool l2cap_is_socket(struct socket *sock); | ||
| 789 | 798 | ||
| 790 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); | 799 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); |
| 791 | int __l2cap_wait_ack(struct sock *sk); | 800 | int __l2cap_wait_ack(struct sock *sk); |
| @@ -812,4 +821,10 @@ void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, | |||
| 812 | u8 status); | 821 | u8 status); |
| 813 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); | 822 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); |
| 814 | 823 | ||
| 824 | void l2cap_conn_get(struct l2cap_conn *conn); | ||
| 825 | void l2cap_conn_put(struct l2cap_conn *conn); | ||
| 826 | |||
| 827 | int l2cap_register_user(struct l2cap_conn *conn, struct l2cap_user *user); | ||
| 828 | void l2cap_unregister_user(struct l2cap_conn *conn, struct l2cap_user *user); | ||
| 829 | |||
| 815 | #endif /* __L2CAP_H */ | 830 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index bdba9b619064..26b5b692c22b 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -1998,6 +1998,16 @@ struct cfg80211_update_ft_ies_params { | |||
| 1998 | * advertise the support for MAC based ACL have to implement this callback. | 1998 | * advertise the support for MAC based ACL have to implement this callback. |
| 1999 | * | 1999 | * |
| 2000 | * @start_radar_detection: Start radar detection in the driver. | 2000 | * @start_radar_detection: Start radar detection in the driver. |
| 2001 | * | ||
| 2002 | * @update_ft_ies: Provide updated Fast BSS Transition information to the | ||
| 2003 | * driver. If the SME is in the driver/firmware, this information can be | ||
| 2004 | * used in building Authentication and Reassociation Request frames. | ||
| 2005 | * | ||
| 2006 | * @crit_proto_start: Indicates a critical protocol needs more link reliability | ||
| 2007 | * for a given duration (milliseconds). The protocol is provided so the | ||
| 2008 | * driver can take the most appropriate actions. | ||
| 2009 | * @crit_proto_stop: Indicates critical protocol no longer needs increased link | ||
| 2010 | * reliability. This operation can not fail. | ||
| 2001 | */ | 2011 | */ |
| 2002 | struct cfg80211_ops { | 2012 | struct cfg80211_ops { |
| 2003 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 2013 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
| @@ -2227,6 +2237,12 @@ struct cfg80211_ops { | |||
| 2227 | struct cfg80211_chan_def *chandef); | 2237 | struct cfg80211_chan_def *chandef); |
| 2228 | int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, | 2238 | int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, |
| 2229 | struct cfg80211_update_ft_ies_params *ftie); | 2239 | struct cfg80211_update_ft_ies_params *ftie); |
| 2240 | int (*crit_proto_start)(struct wiphy *wiphy, | ||
| 2241 | struct wireless_dev *wdev, | ||
| 2242 | enum nl80211_crit_proto_id protocol, | ||
| 2243 | u16 duration); | ||
| 2244 | void (*crit_proto_stop)(struct wiphy *wiphy, | ||
| 2245 | struct wireless_dev *wdev); | ||
| 2230 | }; | 2246 | }; |
| 2231 | 2247 | ||
| 2232 | /* | 2248 | /* |
| @@ -4020,6 +4036,17 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy, | |||
| 4020 | void cfg80211_ch_switch_notify(struct net_device *dev, | 4036 | void cfg80211_ch_switch_notify(struct net_device *dev, |
| 4021 | struct cfg80211_chan_def *chandef); | 4037 | struct cfg80211_chan_def *chandef); |
| 4022 | 4038 | ||
| 4039 | /** | ||
| 4040 | * ieee80211_operating_class_to_band - convert operating class to band | ||
| 4041 | * | ||
| 4042 | * @operating_class: the operating class to convert | ||
| 4043 | * @band: band pointer to fill | ||
| 4044 | * | ||
| 4045 | * Returns %true if the conversion was successful, %false otherwise. | ||
| 4046 | */ | ||
| 4047 | bool ieee80211_operating_class_to_band(u8 operating_class, | ||
| 4048 | enum ieee80211_band *band); | ||
| 4049 | |||
| 4023 | /* | 4050 | /* |
| 4024 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation | 4051 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation |
| 4025 | * @dev: the device on which the operation is requested | 4052 | * @dev: the device on which the operation is requested |
| @@ -4122,6 +4149,17 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
| 4122 | struct cfg80211_wowlan_wakeup *wakeup, | 4149 | struct cfg80211_wowlan_wakeup *wakeup, |
| 4123 | gfp_t gfp); | 4150 | gfp_t gfp); |
| 4124 | 4151 | ||
| 4152 | /** | ||
| 4153 | * cfg80211_crit_proto_stopped() - indicate critical protocol stopped by driver. | ||
| 4154 | * | ||
| 4155 | * @wdev: the wireless device for which critical protocol is stopped. | ||
| 4156 | * | ||
| 4157 | * This function can be called by the driver to indicate it has reverted | ||
| 4158 | * operation back to normal. One reason could be that the duration given | ||
| 4159 | * by .crit_proto_start() has expired. | ||
| 4160 | */ | ||
| 4161 | void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp); | ||
| 4162 | |||
| 4125 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 4163 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
| 4126 | 4164 | ||
| 4127 | /* wiphy_printk helpers, similar to dev_printk */ | 4165 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index dd73b8c6746b..04c2d4670dc6 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -128,6 +128,7 @@ enum ieee80211_ac_numbers { | |||
| 128 | * 2^n-1 in the range 1..32767] | 128 | * 2^n-1 in the range 1..32767] |
| 129 | * @cw_max: maximum contention window [like @cw_min] | 129 | * @cw_max: maximum contention window [like @cw_min] |
| 130 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled | 130 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled |
| 131 | * @acm: is mandatory admission control required for the access category | ||
| 131 | * @uapsd: is U-APSD mode enabled for the queue | 132 | * @uapsd: is U-APSD mode enabled for the queue |
| 132 | */ | 133 | */ |
| 133 | struct ieee80211_tx_queue_params { | 134 | struct ieee80211_tx_queue_params { |
| @@ -135,6 +136,7 @@ struct ieee80211_tx_queue_params { | |||
| 135 | u16 cw_min; | 136 | u16 cw_min; |
| 136 | u16 cw_max; | 137 | u16 cw_max; |
| 137 | u8 aifs; | 138 | u8 aifs; |
| 139 | bool acm; | ||
| 138 | bool uapsd; | 140 | bool uapsd; |
| 139 | }; | 141 | }; |
| 140 | 142 | ||
| @@ -209,7 +211,7 @@ struct ieee80211_chanctx_conf { | |||
| 209 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note | 211 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note |
| 210 | * that it is only ever disabled for station mode. | 212 | * that it is only ever disabled for station mode. |
| 211 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. | 213 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. |
| 212 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 214 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP and IBSS mode) |
| 213 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) | 215 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) |
| 214 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) | 216 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) |
| 215 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface | 217 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface |
| @@ -326,12 +328,11 @@ enum ieee80211_rssi_event { | |||
| 326 | * your driver/device needs to do. | 328 | * your driver/device needs to do. |
| 327 | * @ps: power-save mode (STA only). This flag is NOT affected by | 329 | * @ps: power-save mode (STA only). This flag is NOT affected by |
| 328 | * offchannel/dynamic_ps operations. | 330 | * offchannel/dynamic_ps operations. |
| 329 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | 331 | * @ssid: The SSID of the current vif. Valid in AP and IBSS mode. |
| 330 | * @ssid_len: Length of SSID given in @ssid. | 332 | * @ssid_len: Length of SSID given in @ssid. |
| 331 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 333 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
| 332 | * @txpower: TX power in dBm | 334 | * @txpower: TX power in dBm |
| 333 | * @p2p_ctwindow: P2P CTWindow, only for P2P client interfaces | 335 | * @p2p_noa_attr: P2P NoA attribute for P2P powersave |
| 334 | * @p2p_oppps: P2P opportunistic PS is enabled | ||
| 335 | */ | 336 | */ |
| 336 | struct ieee80211_bss_conf { | 337 | struct ieee80211_bss_conf { |
| 337 | const u8 *bssid; | 338 | const u8 *bssid; |
| @@ -365,8 +366,7 @@ struct ieee80211_bss_conf { | |||
| 365 | size_t ssid_len; | 366 | size_t ssid_len; |
| 366 | bool hidden_ssid; | 367 | bool hidden_ssid; |
| 367 | int txpower; | 368 | int txpower; |
| 368 | u8 p2p_ctwindow; | 369 | struct ieee80211_p2p_noa_attr p2p_noa_attr; |
| 369 | bool p2p_oppps; | ||
| 370 | }; | 370 | }; |
| 371 | 371 | ||
| 372 | /** | 372 | /** |
| @@ -563,6 +563,9 @@ enum mac80211_rate_control_flags { | |||
| 563 | /* maximum number of rate stages */ | 563 | /* maximum number of rate stages */ |
| 564 | #define IEEE80211_TX_MAX_RATES 4 | 564 | #define IEEE80211_TX_MAX_RATES 4 |
| 565 | 565 | ||
| 566 | /* maximum number of rate table entries */ | ||
| 567 | #define IEEE80211_TX_RATE_TABLE_SIZE 4 | ||
| 568 | |||
| 566 | /** | 569 | /** |
| 567 | * struct ieee80211_tx_rate - rate selection/status | 570 | * struct ieee80211_tx_rate - rate selection/status |
| 568 | * | 571 | * |
| @@ -603,8 +606,8 @@ static inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *rate, | |||
| 603 | u8 mcs, u8 nss) | 606 | u8 mcs, u8 nss) |
| 604 | { | 607 | { |
| 605 | WARN_ON(mcs & ~0xF); | 608 | WARN_ON(mcs & ~0xF); |
| 606 | WARN_ON(nss & ~0x7); | 609 | WARN_ON((nss - 1) & ~0x7); |
| 607 | rate->idx = (nss << 4) | mcs; | 610 | rate->idx = ((nss - 1) << 4) | mcs; |
| 608 | } | 611 | } |
| 609 | 612 | ||
| 610 | static inline u8 | 613 | static inline u8 |
| @@ -616,7 +619,7 @@ ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *rate) | |||
| 616 | static inline u8 | 619 | static inline u8 |
| 617 | ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate) | 620 | ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate) |
| 618 | { | 621 | { |
| 619 | return rate->idx >> 4; | 622 | return (rate->idx >> 4) + 1; |
| 620 | } | 623 | } |
| 621 | 624 | ||
| 622 | /** | 625 | /** |
| @@ -657,7 +660,11 @@ struct ieee80211_tx_info { | |||
| 657 | struct ieee80211_tx_rate rates[ | 660 | struct ieee80211_tx_rate rates[ |
| 658 | IEEE80211_TX_MAX_RATES]; | 661 | IEEE80211_TX_MAX_RATES]; |
| 659 | s8 rts_cts_rate_idx; | 662 | s8 rts_cts_rate_idx; |
| 660 | /* 3 bytes free */ | 663 | u8 use_rts:1; |
| 664 | u8 use_cts_prot:1; | ||
| 665 | u8 short_preamble:1; | ||
| 666 | u8 skip_table:1; | ||
| 667 | /* 2 bytes free */ | ||
| 661 | }; | 668 | }; |
| 662 | /* only needed before rate control */ | 669 | /* only needed before rate control */ |
| 663 | unsigned long jiffies; | 670 | unsigned long jiffies; |
| @@ -678,6 +685,8 @@ struct ieee80211_tx_info { | |||
| 678 | struct { | 685 | struct { |
| 679 | struct ieee80211_tx_rate driver_rates[ | 686 | struct ieee80211_tx_rate driver_rates[ |
| 680 | IEEE80211_TX_MAX_RATES]; | 687 | IEEE80211_TX_MAX_RATES]; |
| 688 | u8 pad[4]; | ||
| 689 | |||
| 681 | void *rate_driver_data[ | 690 | void *rate_driver_data[ |
| 682 | IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE / sizeof(void *)]; | 691 | IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE / sizeof(void *)]; |
| 683 | }; | 692 | }; |
| @@ -976,8 +985,7 @@ enum ieee80211_smps_mode { | |||
| 976 | * @power_level: requested transmit power (in dBm), backward compatibility | 985 | * @power_level: requested transmit power (in dBm), backward compatibility |
| 977 | * value only that is set to the minimum of all interfaces | 986 | * value only that is set to the minimum of all interfaces |
| 978 | * | 987 | * |
| 979 | * @channel: the channel to tune to | 988 | * @chandef: the channel definition to tune to |
| 980 | * @channel_type: the channel (HT) type | ||
| 981 | * @radar_enabled: whether radar detection is enabled | 989 | * @radar_enabled: whether radar detection is enabled |
| 982 | * | 990 | * |
| 983 | * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame | 991 | * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame |
| @@ -1003,8 +1011,7 @@ struct ieee80211_conf { | |||
| 1003 | 1011 | ||
| 1004 | u8 long_frame_max_tx_count, short_frame_max_tx_count; | 1012 | u8 long_frame_max_tx_count, short_frame_max_tx_count; |
| 1005 | 1013 | ||
| 1006 | struct ieee80211_channel *channel; | 1014 | struct cfg80211_chan_def chandef; |
| 1007 | enum nl80211_channel_type channel_type; | ||
| 1008 | bool radar_enabled; | 1015 | bool radar_enabled; |
| 1009 | enum ieee80211_smps_mode smps_mode; | 1016 | enum ieee80211_smps_mode smps_mode; |
| 1010 | }; | 1017 | }; |
| @@ -1021,13 +1028,13 @@ struct ieee80211_conf { | |||
| 1021 | * the driver passed into mac80211. | 1028 | * the driver passed into mac80211. |
| 1022 | * @block_tx: Indicates whether transmission must be blocked before the | 1029 | * @block_tx: Indicates whether transmission must be blocked before the |
| 1023 | * scheduled channel switch, as indicated by the AP. | 1030 | * scheduled channel switch, as indicated by the AP. |
| 1024 | * @channel: the new channel to switch to | 1031 | * @chandef: the new channel to switch to |
| 1025 | * @count: the number of TBTT's until the channel switch event | 1032 | * @count: the number of TBTT's until the channel switch event |
| 1026 | */ | 1033 | */ |
| 1027 | struct ieee80211_channel_switch { | 1034 | struct ieee80211_channel_switch { |
| 1028 | u64 timestamp; | 1035 | u64 timestamp; |
| 1029 | bool block_tx; | 1036 | bool block_tx; |
| 1030 | struct ieee80211_channel *channel; | 1037 | struct cfg80211_chan_def chandef; |
| 1031 | u8 count; | 1038 | u8 count; |
| 1032 | }; | 1039 | }; |
| 1033 | 1040 | ||
| @@ -1225,6 +1232,24 @@ enum ieee80211_sta_rx_bandwidth { | |||
| 1225 | }; | 1232 | }; |
| 1226 | 1233 | ||
| 1227 | /** | 1234 | /** |
| 1235 | * struct ieee80211_sta_rates - station rate selection table | ||
| 1236 | * | ||
| 1237 | * @rcu_head: RCU head used for freeing the table on update | ||
| 1238 | * @rates: transmit rates/flags to be used by default. | ||
| 1239 | * Overriding entries per-packet is possible by using cb tx control. | ||
| 1240 | */ | ||
| 1241 | struct ieee80211_sta_rates { | ||
| 1242 | struct rcu_head rcu_head; | ||
| 1243 | struct { | ||
| 1244 | s8 idx; | ||
| 1245 | u8 count; | ||
| 1246 | u8 count_cts; | ||
| 1247 | u8 count_rts; | ||
| 1248 | u16 flags; | ||
| 1249 | } rate[IEEE80211_TX_RATE_TABLE_SIZE]; | ||
| 1250 | }; | ||
| 1251 | |||
| 1252 | /** | ||
| 1228 | * struct ieee80211_sta - station table entry | 1253 | * struct ieee80211_sta - station table entry |
| 1229 | * | 1254 | * |
| 1230 | * A station table entry represents a station we are possibly | 1255 | * A station table entry represents a station we are possibly |
| @@ -1251,6 +1276,7 @@ enum ieee80211_sta_rx_bandwidth { | |||
| 1251 | * notifications and capabilities. The value is only valid after | 1276 | * notifications and capabilities. The value is only valid after |
| 1252 | * the station moves to associated state. | 1277 | * the station moves to associated state. |
| 1253 | * @smps_mode: current SMPS mode (off, static or dynamic) | 1278 | * @smps_mode: current SMPS mode (off, static or dynamic) |
| 1279 | * @tx_rates: rate control selection table | ||
| 1254 | */ | 1280 | */ |
| 1255 | struct ieee80211_sta { | 1281 | struct ieee80211_sta { |
| 1256 | u32 supp_rates[IEEE80211_NUM_BANDS]; | 1282 | u32 supp_rates[IEEE80211_NUM_BANDS]; |
| @@ -1264,6 +1290,7 @@ struct ieee80211_sta { | |||
| 1264 | u8 rx_nss; | 1290 | u8 rx_nss; |
| 1265 | enum ieee80211_sta_rx_bandwidth bandwidth; | 1291 | enum ieee80211_sta_rx_bandwidth bandwidth; |
| 1266 | enum ieee80211_smps_mode smps_mode; | 1292 | enum ieee80211_smps_mode smps_mode; |
| 1293 | struct ieee80211_sta_rates __rcu *rates; | ||
| 1267 | 1294 | ||
| 1268 | /* must be last */ | 1295 | /* must be last */ |
| 1269 | u8 drv_priv[0] __aligned(sizeof(void *)); | 1296 | u8 drv_priv[0] __aligned(sizeof(void *)); |
| @@ -1419,6 +1446,9 @@ struct ieee80211_tx_control { | |||
| 1419 | * for different virtual interfaces. See the doc section on HW queue | 1446 | * for different virtual interfaces. See the doc section on HW queue |
| 1420 | * control for more details. | 1447 | * control for more details. |
| 1421 | * | 1448 | * |
| 1449 | * @IEEE80211_HW_SUPPORTS_RC_TABLE: The driver supports using a rate | ||
| 1450 | * selection table provided by the rate control algorithm. | ||
| 1451 | * | ||
| 1422 | * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any | 1452 | * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any |
| 1423 | * P2P Interface. This will be honoured even if more than one interface | 1453 | * P2P Interface. This will be honoured even if more than one interface |
| 1424 | * is supported. | 1454 | * is supported. |
| @@ -1451,6 +1481,7 @@ enum ieee80211_hw_flags { | |||
| 1451 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | 1481 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, |
| 1452 | IEEE80211_HW_AP_LINK_PS = 1<<22, | 1482 | IEEE80211_HW_AP_LINK_PS = 1<<22, |
| 1453 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, | 1483 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, |
| 1484 | IEEE80211_HW_SUPPORTS_RC_TABLE = 1<<24, | ||
| 1454 | IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, | 1485 | IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, |
| 1455 | IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, | 1486 | IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, |
| 1456 | }; | 1487 | }; |
| @@ -1536,6 +1567,17 @@ enum ieee80211_hw_flags { | |||
| 1536 | * @netdev_features: netdev features to be set in each netdev created | 1567 | * @netdev_features: netdev features to be set in each netdev created |
| 1537 | * from this HW. Note only HW checksum features are currently | 1568 | * from this HW. Note only HW checksum features are currently |
| 1538 | * compatible with mac80211. Other feature bits will be rejected. | 1569 | * compatible with mac80211. Other feature bits will be rejected. |
| 1570 | * | ||
| 1571 | * @uapsd_queues: This bitmap is included in (re)association frame to indicate | ||
| 1572 | * for each access category if it is uAPSD trigger-enabled and delivery- | ||
| 1573 | * enabled. Use IEEE80211_WMM_IE_STA_QOSINFO_AC_* to set this bitmap. | ||
| 1574 | * Each bit corresponds to different AC. Value '1' in specific bit means | ||
| 1575 | * that corresponding AC is both trigger- and delivery-enabled. '0' means | ||
| 1576 | * neither enabled. | ||
| 1577 | * | ||
| 1578 | * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may | ||
| 1579 | * deliver to a WMM STA during any Service Period triggered by the WMM STA. | ||
| 1580 | * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. | ||
| 1539 | */ | 1581 | */ |
| 1540 | struct ieee80211_hw { | 1582 | struct ieee80211_hw { |
| 1541 | struct ieee80211_conf conf; | 1583 | struct ieee80211_conf conf; |
| @@ -1561,6 +1603,8 @@ struct ieee80211_hw { | |||
| 1561 | u8 radiotap_mcs_details; | 1603 | u8 radiotap_mcs_details; |
| 1562 | u16 radiotap_vht_details; | 1604 | u16 radiotap_vht_details; |
| 1563 | netdev_features_t netdev_features; | 1605 | netdev_features_t netdev_features; |
| 1606 | u8 uapsd_queues; | ||
| 1607 | u8 uapsd_max_sp_len; | ||
| 1564 | }; | 1608 | }; |
| 1565 | 1609 | ||
| 1566 | /** | 1610 | /** |
| @@ -3124,6 +3168,25 @@ void ieee80211_sta_set_buffered(struct ieee80211_sta *sta, | |||
| 3124 | u8 tid, bool buffered); | 3168 | u8 tid, bool buffered); |
| 3125 | 3169 | ||
| 3126 | /** | 3170 | /** |
| 3171 | * ieee80211_get_tx_rates - get the selected transmit rates for a packet | ||
| 3172 | * | ||
| 3173 | * Call this function in a driver with per-packet rate selection support | ||
| 3174 | * to combine the rate info in the packet tx info with the most recent | ||
| 3175 | * rate selection table for the station entry. | ||
| 3176 | * | ||
| 3177 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 3178 | * @sta: the receiver station to which this packet is sent. | ||
| 3179 | * @skb: the frame to be transmitted. | ||
| 3180 | * @dest: buffer for extracted rate/retry information | ||
| 3181 | * @max_rates: maximum number of rates to fetch | ||
| 3182 | */ | ||
| 3183 | void ieee80211_get_tx_rates(struct ieee80211_vif *vif, | ||
| 3184 | struct ieee80211_sta *sta, | ||
| 3185 | struct sk_buff *skb, | ||
| 3186 | struct ieee80211_tx_rate *dest, | ||
| 3187 | int max_rates); | ||
| 3188 | |||
| 3189 | /** | ||
| 3127 | * ieee80211_tx_status - transmit status callback | 3190 | * ieee80211_tx_status - transmit status callback |
| 3128 | * | 3191 | * |
| 3129 | * Call this function for all transmitted frames after they have been | 3192 | * Call this function for all transmitted frames after they have been |
| @@ -4098,7 +4161,7 @@ void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn); | |||
| 4098 | * (deprecated; this will be removed once drivers get updated to use | 4161 | * (deprecated; this will be removed once drivers get updated to use |
| 4099 | * rate_idx_mask) | 4162 | * rate_idx_mask) |
| 4100 | * @rate_idx_mask: user-requested (legacy) rate mask | 4163 | * @rate_idx_mask: user-requested (legacy) rate mask |
| 4101 | * @rate_idx_mcs_mask: user-requested MCS rate mask | 4164 | * @rate_idx_mcs_mask: user-requested MCS rate mask (NULL if not in use) |
| 4102 | * @bss: whether this frame is sent out in AP or IBSS mode | 4165 | * @bss: whether this frame is sent out in AP or IBSS mode |
| 4103 | */ | 4166 | */ |
| 4104 | struct ieee80211_tx_rate_control { | 4167 | struct ieee80211_tx_rate_control { |
| @@ -4110,7 +4173,7 @@ struct ieee80211_tx_rate_control { | |||
| 4110 | bool rts, short_preamble; | 4173 | bool rts, short_preamble; |
| 4111 | u8 max_rate_idx; | 4174 | u8 max_rate_idx; |
| 4112 | u32 rate_idx_mask; | 4175 | u32 rate_idx_mask; |
| 4113 | u8 rate_idx_mcs_mask[IEEE80211_HT_MCS_MASK_LEN]; | 4176 | u8 *rate_idx_mcs_mask; |
| 4114 | bool bss; | 4177 | bool bss; |
| 4115 | }; | 4178 | }; |
| 4116 | 4179 | ||
| @@ -4199,37 +4262,55 @@ bool rate_usable_index_exists(struct ieee80211_supported_band *sband, | |||
| 4199 | return false; | 4262 | return false; |
| 4200 | } | 4263 | } |
| 4201 | 4264 | ||
| 4265 | /** | ||
| 4266 | * rate_control_set_rates - pass the sta rate selection to mac80211/driver | ||
| 4267 | * | ||
| 4268 | * When not doing a rate control probe to test rates, rate control should pass | ||
| 4269 | * its rate selection to mac80211. If the driver supports receiving a station | ||
| 4270 | * rate table, it will use it to ensure that frames are always sent based on | ||
| 4271 | * the most recent rate control module decision. | ||
| 4272 | * | ||
| 4273 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
| 4274 | * @pubsta: &struct ieee80211_sta pointer to the target destination. | ||
| 4275 | * @rates: new tx rate set to be used for this station. | ||
| 4276 | */ | ||
| 4277 | int rate_control_set_rates(struct ieee80211_hw *hw, | ||
| 4278 | struct ieee80211_sta *pubsta, | ||
| 4279 | struct ieee80211_sta_rates *rates); | ||
| 4280 | |||
| 4202 | int ieee80211_rate_control_register(struct rate_control_ops *ops); | 4281 | int ieee80211_rate_control_register(struct rate_control_ops *ops); |
| 4203 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); | 4282 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); |
| 4204 | 4283 | ||
| 4205 | static inline bool | 4284 | static inline bool |
| 4206 | conf_is_ht20(struct ieee80211_conf *conf) | 4285 | conf_is_ht20(struct ieee80211_conf *conf) |
| 4207 | { | 4286 | { |
| 4208 | return conf->channel_type == NL80211_CHAN_HT20; | 4287 | return conf->chandef.width == NL80211_CHAN_WIDTH_20; |
| 4209 | } | 4288 | } |
| 4210 | 4289 | ||
| 4211 | static inline bool | 4290 | static inline bool |
| 4212 | conf_is_ht40_minus(struct ieee80211_conf *conf) | 4291 | conf_is_ht40_minus(struct ieee80211_conf *conf) |
| 4213 | { | 4292 | { |
| 4214 | return conf->channel_type == NL80211_CHAN_HT40MINUS; | 4293 | return conf->chandef.width == NL80211_CHAN_WIDTH_40 && |
| 4294 | conf->chandef.center_freq1 < conf->chandef.chan->center_freq; | ||
| 4215 | } | 4295 | } |
| 4216 | 4296 | ||
| 4217 | static inline bool | 4297 | static inline bool |
| 4218 | conf_is_ht40_plus(struct ieee80211_conf *conf) | 4298 | conf_is_ht40_plus(struct ieee80211_conf *conf) |
| 4219 | { | 4299 | { |
| 4220 | return conf->channel_type == NL80211_CHAN_HT40PLUS; | 4300 | return conf->chandef.width == NL80211_CHAN_WIDTH_40 && |
| 4301 | conf->chandef.center_freq1 > conf->chandef.chan->center_freq; | ||
| 4221 | } | 4302 | } |
| 4222 | 4303 | ||
| 4223 | static inline bool | 4304 | static inline bool |
| 4224 | conf_is_ht40(struct ieee80211_conf *conf) | 4305 | conf_is_ht40(struct ieee80211_conf *conf) |
| 4225 | { | 4306 | { |
| 4226 | return conf_is_ht40_minus(conf) || conf_is_ht40_plus(conf); | 4307 | return conf->chandef.width == NL80211_CHAN_WIDTH_40; |
| 4227 | } | 4308 | } |
| 4228 | 4309 | ||
| 4229 | static inline bool | 4310 | static inline bool |
| 4230 | conf_is_ht(struct ieee80211_conf *conf) | 4311 | conf_is_ht(struct ieee80211_conf *conf) |
| 4231 | { | 4312 | { |
| 4232 | return conf->channel_type != NL80211_CHAN_NO_HT; | 4313 | return conf->chandef.width != NL80211_CHAN_WIDTH_20_NOHT; |
| 4233 | } | 4314 | } |
| 4234 | 4315 | ||
| 4235 | static inline enum nl80211_iftype | 4316 | static inline enum nl80211_iftype |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index 87a6417fc934..5eb80bb3cbb2 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -122,6 +122,8 @@ struct nfc_dev { | |||
| 122 | 122 | ||
| 123 | bool shutting_down; | 123 | bool shutting_down; |
| 124 | 124 | ||
| 125 | struct rfkill *rfkill; | ||
| 126 | |||
| 125 | struct nfc_ops *ops; | 127 | struct nfc_ops *ops; |
| 126 | }; | 128 | }; |
| 127 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) | 129 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index 7440bc81a04b..7c6f627a717d 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
| @@ -233,7 +233,10 @@ struct sockaddr_nfc_llcp { | |||
| 233 | #define NFC_LLCP_DIRECTION_TX 0x01 | 233 | #define NFC_LLCP_DIRECTION_TX 0x01 |
| 234 | 234 | ||
| 235 | /* socket option names */ | 235 | /* socket option names */ |
| 236 | #define NFC_LLCP_RW 0 | 236 | #define NFC_LLCP_RW 0 |
| 237 | #define NFC_LLCP_MIUX 1 | 237 | #define NFC_LLCP_MIUX 1 |
| 238 | #define NFC_LLCP_REMOTE_MIU 2 | ||
| 239 | #define NFC_LLCP_REMOTE_LTO 3 | ||
| 240 | #define NFC_LLCP_REMOTE_RW 4 | ||
| 238 | 241 | ||
| 239 | #endif /*__LINUX_NFC_H */ | 242 | #endif /*__LINUX_NFC_H */ |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 79da8710448e..d1e48b5e348f 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
| @@ -639,6 +639,13 @@ | |||
| 639 | * with the relevant Information Elements. This event is used to report | 639 | * with the relevant Information Elements. This event is used to report |
| 640 | * received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE). | 640 | * received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE). |
| 641 | * | 641 | * |
| 642 | * @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running | ||
| 643 | * a critical protocol that needs more reliability in the connection to | ||
| 644 | * complete. | ||
| 645 | * | ||
| 646 | * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can | ||
| 647 | * return back to normal. | ||
| 648 | * | ||
| 642 | * @NL80211_CMD_MAX: highest used command number | 649 | * @NL80211_CMD_MAX: highest used command number |
| 643 | * @__NL80211_CMD_AFTER_LAST: internal use | 650 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 644 | */ | 651 | */ |
| @@ -798,6 +805,9 @@ enum nl80211_commands { | |||
| 798 | NL80211_CMD_UPDATE_FT_IES, | 805 | NL80211_CMD_UPDATE_FT_IES, |
| 799 | NL80211_CMD_FT_EVENT, | 806 | NL80211_CMD_FT_EVENT, |
| 800 | 807 | ||
| 808 | NL80211_CMD_CRIT_PROTOCOL_START, | ||
| 809 | NL80211_CMD_CRIT_PROTOCOL_STOP, | ||
| 810 | |||
| 801 | /* add new commands above here */ | 811 | /* add new commands above here */ |
| 802 | 812 | ||
| 803 | /* used to define NL80211_CMD_MAX below */ | 813 | /* used to define NL80211_CMD_MAX below */ |
| @@ -1414,6 +1424,11 @@ enum nl80211_commands { | |||
| 1414 | * @NL80211_ATTR_IE_RIC: Resource Information Container Information | 1424 | * @NL80211_ATTR_IE_RIC: Resource Information Container Information |
| 1415 | * Element | 1425 | * Element |
| 1416 | * | 1426 | * |
| 1427 | * @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased | ||
| 1428 | * reliability, see &enum nl80211_crit_proto_id (u16). | ||
| 1429 | * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which | ||
| 1430 | * the connection should have increased reliability (u16). | ||
| 1431 | * | ||
| 1417 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1432 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 1418 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1433 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 1419 | */ | 1434 | */ |
| @@ -1709,6 +1724,9 @@ enum nl80211_attrs { | |||
| 1709 | NL80211_ATTR_MDID, | 1724 | NL80211_ATTR_MDID, |
| 1710 | NL80211_ATTR_IE_RIC, | 1725 | NL80211_ATTR_IE_RIC, |
| 1711 | 1726 | ||
| 1727 | NL80211_ATTR_CRIT_PROT_ID, | ||
| 1728 | NL80211_ATTR_MAX_CRIT_PROT_DURATION, | ||
| 1729 | |||
| 1712 | /* add attributes here, update the policy in nl80211.c */ | 1730 | /* add attributes here, update the policy in nl80211.c */ |
| 1713 | 1731 | ||
| 1714 | __NL80211_ATTR_AFTER_LAST, | 1732 | __NL80211_ATTR_AFTER_LAST, |
| @@ -3682,4 +3700,25 @@ enum nl80211_protocol_features { | |||
| 3682 | NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0, | 3700 | NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0, |
| 3683 | }; | 3701 | }; |
| 3684 | 3702 | ||
| 3703 | /** | ||
| 3704 | * enum nl80211_crit_proto_id - nl80211 critical protocol identifiers | ||
| 3705 | * | ||
| 3706 | * @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified. | ||
| 3707 | * @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol. | ||
| 3708 | * @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol. | ||
| 3709 | * @NL80211_CRIT_PROTO_APIPA: APIPA protocol. | ||
| 3710 | * @NUM_NL80211_CRIT_PROTO: must be kept last. | ||
| 3711 | */ | ||
| 3712 | enum nl80211_crit_proto_id { | ||
| 3713 | NL80211_CRIT_PROTO_UNSPEC, | ||
| 3714 | NL80211_CRIT_PROTO_DHCP, | ||
| 3715 | NL80211_CRIT_PROTO_EAPOL, | ||
| 3716 | NL80211_CRIT_PROTO_APIPA, | ||
| 3717 | /* add other protocols before this one */ | ||
| 3718 | NUM_NL80211_CRIT_PROTO | ||
| 3719 | }; | ||
| 3720 | |||
| 3721 | /* maximum duration for critical protocol measures */ | ||
| 3722 | #define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ | ||
| 3723 | |||
| 3685 | #endif /* __LINUX_NL80211_H */ | 3724 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/uapi/linux/rfkill.h b/include/uapi/linux/rfkill.h index 2753c6cc9740..058757f7a733 100644 --- a/include/uapi/linux/rfkill.h +++ b/include/uapi/linux/rfkill.h | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device. | 37 | * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device. |
| 38 | * @RFKILL_TYPE_GPS: switch is on a GPS device. | 38 | * @RFKILL_TYPE_GPS: switch is on a GPS device. |
| 39 | * @RFKILL_TYPE_FM: switch is on a FM radio device. | 39 | * @RFKILL_TYPE_FM: switch is on a FM radio device. |
| 40 | * @RFKILL_TYPE_NFC: switch is on an NFC device. | ||
| 40 | * @NUM_RFKILL_TYPES: number of defined rfkill types | 41 | * @NUM_RFKILL_TYPES: number of defined rfkill types |
| 41 | */ | 42 | */ |
| 42 | enum rfkill_type { | 43 | enum rfkill_type { |
| @@ -48,6 +49,7 @@ enum rfkill_type { | |||
| 48 | RFKILL_TYPE_WWAN, | 49 | RFKILL_TYPE_WWAN, |
| 49 | RFKILL_TYPE_GPS, | 50 | RFKILL_TYPE_GPS, |
| 50 | RFKILL_TYPE_FM, | 51 | RFKILL_TYPE_FM, |
| 52 | RFKILL_TYPE_NFC, | ||
| 51 | NUM_RFKILL_TYPES, | 53 | NUM_RFKILL_TYPES, |
| 52 | }; | 54 | }; |
| 53 | 55 | ||
