aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-04-24 10:54:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-04-24 10:54:20 -0400
commit6ed0e321a0aef14a894e26658108bf7e895c36a6 (patch)
treef49428d68ebcb1beb757296ea1559079210babbe /include/linux
parent3dec2246c2ff11beb24ca1950f074b2bcbc85953 (diff)
parentb006ed545cbadf1ebd4683719554742d20dbcede (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bcma/bcma.h1
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h3
-rw-r--r--include/linux/bcma/bcma_regs.h1
-rw-r--r--include/linux/ieee80211.h73
-rw-r--r--include/linux/platform_data/brcmfmac-sdio.h124
5 files changed, 199 insertions, 3 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 */
680struct 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 */
693struct 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 */
700struct 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
1067struct ieee80211_p2p_noa_desc {
1068 u8 count;
1069 __le32 duration;
1070 __le32 interval;
1071 __le32 start_time;
1072} __packed;
1073
1074struct 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 */
1777enum ieee80211_pub_actioncode { 1833enum 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 */
2000struct ieee80211_timeout_interval_ie {
2001 u8 type;
2002 __le32 value;
2003} __packed;
2004
1938/* BACK action code */ 2005/* BACK action code */
1939enum ieee80211_back_actioncode { 2006enum 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
31static void brcmfmac_power_on(void)
32{
33}
34
35static void brcmfmac_power_off(void)
36{
37}
38
39static void brcmfmac_reset(void)
40{
41}
42
43static 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
49static 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
55void __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
114struct 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 */