aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-06-08 13:44:21 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-08 13:44:21 -0400
commitc0c33addcba2ce753b4e2746db99feaae2f82a85 (patch)
treedab480183ac0e64bfe9250e1f294705d1a424c78 /include
parentffbc03bc75b39c7bd412e7cc6d2185c11b0ffedd (diff)
parent931749bf78b969c54de9bbc67cf29b13a40bb73b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Diffstat (limited to 'include')
-rw-r--r--include/linux/bcma/bcma.h25
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h1
-rw-r--r--include/linux/cordic.h48
-rw-r--r--include/linux/crc8.h101
-rw-r--r--include/net/cfg80211.h11
-rw-r--r--include/net/mac80211.h21
6 files changed, 207 insertions, 0 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 08763e4e848f..6ff080eac0b2 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/ssb/ssb.h> /* SPROM sharing */
9 10
10#include "bcma_regs.h" 11#include "bcma_regs.h"
11 12
@@ -31,6 +32,12 @@ struct bcma_host_ops {
31 void (*write8)(struct bcma_device *core, u16 offset, u8 value); 32 void (*write8)(struct bcma_device *core, u16 offset, u8 value);
32 void (*write16)(struct bcma_device *core, u16 offset, u16 value); 33 void (*write16)(struct bcma_device *core, u16 offset, u16 value);
33 void (*write32)(struct bcma_device *core, u16 offset, u32 value); 34 void (*write32)(struct bcma_device *core, u16 offset, u32 value);
35#ifdef CONFIG_BCMA_BLOCKIO
36 void (*block_read)(struct bcma_device *core, void *buffer,
37 size_t count, u16 offset, u8 reg_width);
38 void (*block_write)(struct bcma_device *core, const void *buffer,
39 size_t count, u16 offset, u8 reg_width);
40#endif
34 /* Agent ops */ 41 /* Agent ops */
35 u32 (*aread32)(struct bcma_device *core, u16 offset); 42 u32 (*aread32)(struct bcma_device *core, u16 offset);
36 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); 43 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value);
@@ -117,6 +124,8 @@ struct bcma_device {
117 struct bcma_device_id id; 124 struct bcma_device_id id;
118 125
119 struct device dev; 126 struct device dev;
127 struct device *dma_dev;
128 unsigned int irq;
120 bool dev_registered; 129 bool dev_registered;
121 130
122 u8 core_index; 131 u8 core_index;
@@ -179,6 +188,10 @@ struct bcma_bus {
179 188
180 struct bcma_drv_cc drv_cc; 189 struct bcma_drv_cc drv_cc;
181 struct bcma_drv_pci drv_pci; 190 struct bcma_drv_pci drv_pci;
191
192 /* We decided to share SPROM struct with SSB as long as we do not need
193 * any hacks for BCMA. This simplifies drivers code. */
194 struct ssb_sprom sprom;
182}; 195};
183 196
184extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) 197extern inline u32 bcma_read8(struct bcma_device *core, u16 offset)
@@ -208,6 +221,18 @@ void bcma_write32(struct bcma_device *core, u16 offset, u32 value)
208{ 221{
209 core->bus->ops->write32(core, offset, value); 222 core->bus->ops->write32(core, offset, value);
210} 223}
224#ifdef CONFIG_BCMA_BLOCKIO
225extern inline void bcma_block_read(struct bcma_device *core, void *buffer,
226 size_t count, u16 offset, u8 reg_width)
227{
228 core->bus->ops->block_read(core, buffer, count, offset, reg_width);
229}
230extern inline void bcma_block_write(struct bcma_device *core, const void *buffer,
231 size_t count, u16 offset, u8 reg_width)
232{
233 core->bus->ops->block_write(core, buffer, count, offset, reg_width);
234}
235#endif
211extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) 236extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset)
212{ 237{
213 return core->bus->ops->aread32(core, offset); 238 return core->bus->ops->aread32(core, offset);
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 083c3b6cd5ce..9c5b69fc985a 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -244,6 +244,7 @@
244#define BCMA_CC_REGCTL_DATA 0x065C 244#define BCMA_CC_REGCTL_DATA 0x065C
245#define BCMA_CC_PLLCTL_ADDR 0x0660 245#define BCMA_CC_PLLCTL_ADDR 0x0660
246#define BCMA_CC_PLLCTL_DATA 0x0664 246#define BCMA_CC_PLLCTL_DATA 0x0664
247#define BCMA_CC_SPROM 0x0830 /* SPROM beginning */
247 248
248/* Data for the PMU, if available. 249/* Data for the PMU, if available.
249 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 250 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
diff --git a/include/linux/cordic.h b/include/linux/cordic.h
new file mode 100644
index 000000000000..f932093e20c2
--- /dev/null
+++ b/include/linux/cordic.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (c) 2011 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#ifndef __CORDIC_H_
17#define __CORDIC_H_
18
19#include <linux/types.h>
20
21/**
22 * struct cordic_iq - i/q coordinate.
23 *
24 * @i: real part of coordinate (in phase).
25 * @q: imaginary part of coordinate (quadrature).
26 */
27struct cordic_iq {
28 s32 i;
29 s32 q;
30};
31
32/**
33 * cordic_calc_iq() - calculates the i/q coordinate for given angle.
34 *
35 * @theta: angle in degrees for which i/q coordinate is to be calculated.
36 * @coord: function output parameter holding the i/q coordinate.
37 *
38 * The function calculates the i/q coordinate for a given angle using
39 * cordic algorithm. The coordinate consists of a real (i) and an
40 * imaginary (q) part. The real part is essentially the cosine of the
41 * angle and the imaginary part is the sine of the angle. The returned
42 * values are scaled by 2^16 for precision. The range for theta is
43 * for -180 degrees to +180 degrees. Passed values outside this range are
44 * converted before doing the actual calculation.
45 */
46struct cordic_iq cordic_calc_iq(s32 theta);
47
48#endif /* __CORDIC_H_ */
diff --git a/include/linux/crc8.h b/include/linux/crc8.h
new file mode 100644
index 000000000000..13c8dabb0441
--- /dev/null
+++ b/include/linux/crc8.h
@@ -0,0 +1,101 @@
1/*
2 * Copyright (c) 2011 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#ifndef __CRC8_H_
17#define __CRC8_H_
18
19#include <linux/types.h>
20
21/* see usage of this value in crc8() description */
22#define CRC8_INIT_VALUE 0xFF
23
24/*
25 * Return value of crc8() indicating valid message+crc. This is true
26 * if a CRC is inverted before transmission. The CRC computed over the
27 * whole received bitstream is _table[x], where x is the bit pattern
28 * of the modification (almost always 0xff).
29 */
30#define CRC8_GOOD_VALUE(_table) (_table[0xFF])
31
32/* required table size for crc8 algorithm */
33#define CRC8_TABLE_SIZE 256
34
35/* helper macro assuring right table size is used */
36#define DECLARE_CRC8_TABLE(_table) \
37 static u8 _table[CRC8_TABLE_SIZE]
38
39/**
40 * crc8_populate_lsb - fill crc table for given polynomial in regular bit order.
41 *
42 * @table: table to be filled.
43 * @polynomial: polynomial for which table is to be filled.
44 *
45 * This function fills the provided table according the polynomial provided for
46 * regular bit order (lsb first). Polynomials in CRC algorithms are typically
47 * represented as shown below.
48 *
49 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
50 *
51 * For lsb first direction x^7 maps to the lsb. So the polynomial is as below.
52 *
53 * - lsb first: poly = 10101011(1) = 0xAB
54 */
55void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
56
57/**
58 * crc8_populate_msb - fill crc table for given polynomial in reverse bit order.
59 *
60 * @table: table to be filled.
61 * @polynomial: polynomial for which table is to be filled.
62 *
63 * This function fills the provided table according the polynomial provided for
64 * reverse bit order (msb first). Polynomials in CRC algorithms are typically
65 * represented as shown below.
66 *
67 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
68 *
69 * For msb first direction x^7 maps to the msb. So the polynomial is as below.
70 *
71 * - msb first: poly = (1)11010101 = 0xD5
72 */
73void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
74
75/**
76 * crc8() - calculate a crc8 over the given input data.
77 *
78 * @table: crc table used for calculation.
79 * @pdata: pointer to data buffer.
80 * @nbytes: number of bytes in data buffer.
81 * @crc: previous returned crc8 value.
82 *
83 * The CRC8 is calculated using the polynomial given in crc8_populate_msb()
84 * or crc8_populate_lsb().
85 *
86 * The caller provides the initial value (either %CRC8_INIT_VALUE
87 * or the previous returned value) to allow for processing of
88 * discontiguous blocks of data. When generating the CRC the
89 * caller is responsible for complementing the final return value
90 * and inserting it into the byte stream. When validating a byte
91 * stream (including CRC8), a final return value of %CRC8_GOOD_VALUE
92 * indicates the byte stream data can be considered valid.
93 *
94 * Reference:
95 * "A Painless Guide to CRC Error Detection Algorithms", ver 3, Aug 1993
96 * Williams, Ross N., ross<at>ross.net
97 * (see URL http://www.ross.net/crc/download/crc_v3.txt).
98 */
99u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc);
100
101#endif /* __CRC8_H_ */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0589f554788a..6cb2543a2ee1 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1284,6 +1284,12 @@ struct cfg80211_wowlan {
1284 * frame on another channel 1284 * frame on another channel
1285 * 1285 *
1286 * @testmode_cmd: run a test mode command 1286 * @testmode_cmd: run a test mode command
1287 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
1288 * used by the function, but 0 and 1 must not be touched. Additionally,
1289 * return error codes other than -ENOBUFS and -ENOENT will terminate the
1290 * dump and return to userspace with an error, so be careful. If any data
1291 * was passed in from userspace then the data/len arguments will be present
1292 * and point to the data contained in %NL80211_ATTR_TESTDATA.
1287 * 1293 *
1288 * @set_bitrate_mask: set the bitrate mask configuration 1294 * @set_bitrate_mask: set the bitrate mask configuration
1289 * 1295 *
@@ -1433,6 +1439,9 @@ struct cfg80211_ops {
1433 1439
1434#ifdef CONFIG_NL80211_TESTMODE 1440#ifdef CONFIG_NL80211_TESTMODE
1435 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); 1441 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len);
1442 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
1443 struct netlink_callback *cb,
1444 void *data, int len);
1436#endif 1445#endif
1437 1446
1438 int (*set_bitrate_mask)(struct wiphy *wiphy, 1447 int (*set_bitrate_mask)(struct wiphy *wiphy,
@@ -2849,8 +2858,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
2849void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); 2858void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp);
2850 2859
2851#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), 2860#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
2861#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
2852#else 2862#else
2853#define CFG80211_TESTMODE_CMD(cmd) 2863#define CFG80211_TESTMODE_CMD(cmd)
2864#define CFG80211_TESTMODE_DUMP(cmd)
2854#endif 2865#endif
2855 2866
2856/** 2867/**
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e6d6a66a8f71..3b31ec95dd8e 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1816,6 +1816,7 @@ enum ieee80211_ampdu_mlme_action {
1816 * 1816 *
1817 * @testmode_cmd: Implement a cfg80211 test mode command. 1817 * @testmode_cmd: Implement a cfg80211 test mode command.
1818 * The callback can sleep. 1818 * The callback can sleep.
1819 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep.
1819 * 1820 *
1820 * @flush: Flush all pending frames from the hardware queue, making sure 1821 * @flush: Flush all pending frames from the hardware queue, making sure
1821 * that the hardware queues are empty. If the parameter @drop is set 1822 * that the hardware queues are empty. If the parameter @drop is set
@@ -1936,6 +1937,9 @@ struct ieee80211_ops {
1936 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); 1937 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
1937#ifdef CONFIG_NL80211_TESTMODE 1938#ifdef CONFIG_NL80211_TESTMODE
1938 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 1939 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
1940 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb,
1941 struct netlink_callback *cb,
1942 void *data, int len);
1939#endif 1943#endif
1940 void (*flush)(struct ieee80211_hw *hw, bool drop); 1944 void (*flush)(struct ieee80211_hw *hw, bool drop);
1941 void (*channel_switch)(struct ieee80211_hw *hw, 1945 void (*channel_switch)(struct ieee80211_hw *hw,
@@ -2965,6 +2969,23 @@ void ieee80211_ready_on_channel(struct ieee80211_hw *hw);
2965 */ 2969 */
2966void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); 2970void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
2967 2971
2972/**
2973 * ieee80211_stop_rx_ba_session - callback to stop existing BA sessions
2974 *
2975 * in order not to harm the system performance and user experience, the device
2976 * may request not to allow any rx ba session and tear down existing rx ba
2977 * sessions based on system constraints such as periodic BT activity that needs
2978 * to limit wlan activity (eg.sco or a2dp)."
2979 * in such cases, the intention is to limit the duration of the rx ppdu and
2980 * therefore prevent the peer device to use a-mpdu aggregation.
2981 *
2982 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2983 * @ba_rx_bitmap: Bit map of open rx ba per tid
2984 * @addr: & to bssid mac address
2985 */
2986void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
2987 const u8 *addr);
2988
2968/* Rate control API */ 2989/* Rate control API */
2969 2990
2970/** 2991/**