mac80211: update to version 2015-06-22
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 600-0005-rt2x00-rt2800lib-add-hw_beacon_count-field-to-struct.patch
1 From a058825fa7b53fab3b003d8928b60e5b686b3421 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Sun, 4 Aug 2013 14:36:11 +0200
4 Subject: [PATCH] rt2x00: rt2800lib: add hw_beacon_count field to struct
5 rt2800_drv_data
6
7 Some chipsets can handle more than 8 beacons at once.
8 Add a new field to the rt2800_drv_data structure which
9 will hold the number of supported beacons of the given
10 chipset.
11
12 Update the rt2x00_init_registers function to get the
13 beacon count from the new field instead of using a
14 hardcoded value.
15
16 In order to keep the current behaviour, initialize the
17 new field with the actually used value.
18
19 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
20 ---
21 drivers/net/wireless/rt2x00/rt2800lib.c | 5 ++++-
22 drivers/net/wireless/rt2x00/rt2800lib.h | 1 +
23 2 files changed, 5 insertions(+), 1 deletion(-)
24
25 --- a/drivers/net/wireless/rt2x00/rt2800lib.c
26 +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
27 @@ -4614,6 +4614,7 @@ EXPORT_SYMBOL_GPL(rt2800_link_tuner);
28 */
29 static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)
30 {
31 + struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
32 u32 reg;
33 u16 eeprom;
34 unsigned int i;
35 @@ -4979,7 +4980,7 @@ static int rt2800_init_registers(struct
36 /*
37 * Clear all beacons
38 */
39 - for (i = 0; i < 8; i++)
40 + for (i = 0; i < drv_data->hw_beacon_count; i++)
41 rt2800_clear_beacon_register(rt2x00dev, i);
42
43 if (rt2x00_is_usb(rt2x00dev)) {
44 @@ -7826,6 +7827,8 @@ int rt2800_probe_hw(struct rt2x00_dev *r
45 if (rt2x00_rt(rt2x00dev, RT3593))
46 __set_bit(RT2800_HAS_HIGH_SHARED_MEM, &drv_data->rt2800_flags);
47
48 + drv_data->hw_beacon_count = 8;
49 +
50 /*
51 * Allocate eeprom data.
52 */
53 --- a/drivers/net/wireless/rt2x00/rt2800lib.h
54 +++ b/drivers/net/wireless/rt2x00/rt2800lib.h
55 @@ -35,6 +35,7 @@ struct rt2800_drv_data {
56 u8 txmixer_gain_24g;
57 u8 txmixer_gain_5g;
58 unsigned int tbtt_tick;
59 + unsigned int hw_beacon_count;
60 DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
61
62 unsigned long rt2800_flags;