Skip to content

Commit c0c33ad

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
2 parents ffbc03b + 931749b commit c0c33ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+3173
-1293
lines changed

drivers/bcma/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ config BCMA
1313
Bus driver for Broadcom specific Advanced Microcontroller Bus
1414
Architecture.
1515

16+
# Support for Block-I/O. SELECT this from the driver that needs it.
17+
config BCMA_BLOCKIO
18+
bool
19+
depends on BCMA
20+
1621
config BCMA_HOST_PCI_POSSIBLE
1722
bool
1823
depends on BCMA && PCI = y

drivers/bcma/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bcma-y += main.o scan.o core.o
1+
bcma-y += main.o scan.o core.o sprom.o
22
bcma-y += driver_chipcommon.o driver_chipcommon_pmu.o
33
bcma-y += driver_pci.o
44
bcma-$(CONFIG_BCMA_HOST_PCI) += host_pci.o

drivers/bcma/bcma_private.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ extern void bcma_bus_unregister(struct bcma_bus *bus);
1919
/* scan.c */
2020
int bcma_bus_scan(struct bcma_bus *bus);
2121

22+
/* sprom.c */
23+
int bcma_sprom_get(struct bcma_bus *bus);
24+
2225
#ifdef CONFIG_BCMA_HOST_PCI
2326
/* host_pci.c */
2427
extern int __init bcma_host_pci_init(void);

drivers/bcma/driver_pci.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,26 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc)
161161
{
162162
bcma_pcicore_serdes_workaround(pc);
163163
}
164+
165+
int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
166+
bool enable)
167+
{
168+
struct pci_dev *pdev = pc->core->bus->host_pci;
169+
u32 coremask, tmp;
170+
int err;
171+
172+
err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
173+
if (err)
174+
goto out;
175+
176+
coremask = BIT(core->core_index) << 8;
177+
if (enable)
178+
tmp |= coremask;
179+
else
180+
tmp &= ~coremask;
181+
182+
err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp);
183+
184+
out:
185+
return err;
186+
}

drivers/bcma/host_pci.c

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,54 @@ static void bcma_host_pci_write32(struct bcma_device *core, u16 offset,
6565
iowrite32(value, core->bus->mmio + offset);
6666
}
6767

68+
#ifdef CONFIG_BCMA_BLOCKIO
69+
void bcma_host_pci_block_read(struct bcma_device *core, void *buffer,
70+
size_t count, u16 offset, u8 reg_width)
71+
{
72+
void __iomem *addr = core->bus->mmio + offset;
73+
if (core->bus->mapped_core != core)
74+
bcma_host_pci_switch_core(core);
75+
switch (reg_width) {
76+
case sizeof(u8):
77+
ioread8_rep(addr, buffer, count);
78+
break;
79+
case sizeof(u16):
80+
WARN_ON(count & 1);
81+
ioread16_rep(addr, buffer, count >> 1);
82+
break;
83+
case sizeof(u32):
84+
WARN_ON(count & 3);
85+
ioread32_rep(addr, buffer, count >> 2);
86+
break;
87+
default:
88+
WARN_ON(1);
89+
}
90+
}
91+
92+
void bcma_host_pci_block_write(struct bcma_device *core, const void *buffer,
93+
size_t count, u16 offset, u8 reg_width)
94+
{
95+
void __iomem *addr = core->bus->mmio + offset;
96+
if (core->bus->mapped_core != core)
97+
bcma_host_pci_switch_core(core);
98+
switch (reg_width) {
99+
case sizeof(u8):
100+
iowrite8_rep(addr, buffer, count);
101+
break;
102+
case sizeof(u16):
103+
WARN_ON(count & 1);
104+
iowrite16_rep(addr, buffer, count >> 1);
105+
break;
106+
case sizeof(u32):
107+
WARN_ON(count & 3);
108+
iowrite32_rep(addr, buffer, count >> 2);
109+
break;
110+
default:
111+
WARN_ON(1);
112+
}
113+
}
114+
#endif
115+
68116
static u32 bcma_host_pci_aread32(struct bcma_device *core, u16 offset)
69117
{
70118
if (core->bus->mapped_core != core)
@@ -87,6 +135,10 @@ const struct bcma_host_ops bcma_host_pci_ops = {
87135
.write8 = bcma_host_pci_write8,
88136
.write16 = bcma_host_pci_write16,
89137
.write32 = bcma_host_pci_write32,
138+
#ifdef CONFIG_BCMA_BLOCKIO
139+
.block_read = bcma_host_pci_block_read,
140+
.block_write = bcma_host_pci_block_write,
141+
#endif
90142
.aread32 = bcma_host_pci_aread32,
91143
.awrite32 = bcma_host_pci_awrite32,
92144
};

drivers/bcma/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ static int bcma_register_cores(struct bcma_bus *bus)
8989
switch (bus->hosttype) {
9090
case BCMA_HOSTTYPE_PCI:
9191
core->dev.parent = &bus->host_pci->dev;
92+
core->dma_dev = &bus->host_pci->dev;
93+
core->irq = bus->host_pci->irq;
9294
break;
9395
case BCMA_HOSTTYPE_NONE:
9496
case BCMA_HOSTTYPE_SDIO:
@@ -144,6 +146,13 @@ int bcma_bus_register(struct bcma_bus *bus)
144146
bcma_core_pci_init(&bus->drv_pci);
145147
}
146148

149+
/* Try to get SPROM */
150+
err = bcma_sprom_get(bus);
151+
if (err) {
152+
pr_err("Failed to get SPROM: %d\n", err);
153+
return -ENOENT;
154+
}
155+
147156
/* Register found cores */
148157
bcma_register_cores(bus);
149158

drivers/bcma/sprom.c

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/*
2+
* Broadcom specific AMBA
3+
* SPROM reading
4+
*
5+
* Licensed under the GNU/GPL. See COPYING for details.
6+
*/
7+
8+
#include "bcma_private.h"
9+
10+
#include <linux/bcma/bcma.h>
11+
#include <linux/bcma/bcma_regs.h>
12+
#include <linux/pci.h>
13+
#include <linux/io.h>
14+
#include <linux/dma-mapping.h>
15+
#include <linux/slab.h>
16+
17+
#define SPOFF(offset) ((offset) / sizeof(u16))
18+
19+
/**************************************************
20+
* R/W ops.
21+
**************************************************/
22+
23+
static void bcma_sprom_read(struct bcma_bus *bus, u16 *sprom)
24+
{
25+
int i;
26+
for (i = 0; i < SSB_SPROMSIZE_WORDS_R4; i++)
27+
sprom[i] = bcma_read16(bus->drv_cc.core,
28+
BCMA_CC_SPROM + (i * 2));
29+
}
30+
31+
/**************************************************
32+
* Validation.
33+
**************************************************/
34+
35+
static inline u8 bcma_crc8(u8 crc, u8 data)
36+
{
37+
/* Polynomial: x^8 + x^7 + x^6 + x^4 + x^2 + 1 */
38+
static const u8 t[] = {
39+
0x00, 0xF7, 0xB9, 0x4E, 0x25, 0xD2, 0x9C, 0x6B,
40+
0x4A, 0xBD, 0xF3, 0x04, 0x6F, 0x98, 0xD6, 0x21,
41+
0x94, 0x63, 0x2D, 0xDA, 0xB1, 0x46, 0x08, 0xFF,
42+
0xDE, 0x29, 0x67, 0x90, 0xFB, 0x0C, 0x42, 0xB5,
43+
0x7F, 0x88, 0xC6, 0x31, 0x5A, 0xAD, 0xE3, 0x14,
44+
0x35, 0xC2, 0x8C, 0x7B, 0x10, 0xE7, 0xA9, 0x5E,
45+
0xEB, 0x1C, 0x52, 0xA5, 0xCE, 0x39, 0x77, 0x80,
46+
0xA1, 0x56, 0x18, 0xEF, 0x84, 0x73, 0x3D, 0xCA,
47+
0xFE, 0x09, 0x47, 0xB0, 0xDB, 0x2C, 0x62, 0x95,
48+
0xB4, 0x43, 0x0D, 0xFA, 0x91, 0x66, 0x28, 0xDF,
49+
0x6A, 0x9D, 0xD3, 0x24, 0x4F, 0xB8, 0xF6, 0x01,
50+
0x20, 0xD7, 0x99, 0x6E, 0x05, 0xF2, 0xBC, 0x4B,
51+
0x81, 0x76, 0x38, 0xCF, 0xA4, 0x53, 0x1D, 0xEA,
52+
0xCB, 0x3C, 0x72, 0x85, 0xEE, 0x19, 0x57, 0xA0,
53+
0x15, 0xE2, 0xAC, 0x5B, 0x30, 0xC7, 0x89, 0x7E,
54+
0x5F, 0xA8, 0xE6, 0x11, 0x7A, 0x8D, 0xC3, 0x34,
55+
0xAB, 0x5C, 0x12, 0xE5, 0x8E, 0x79, 0x37, 0xC0,
56+
0xE1, 0x16, 0x58, 0xAF, 0xC4, 0x33, 0x7D, 0x8A,
57+
0x3F, 0xC8, 0x86, 0x71, 0x1A, 0xED, 0xA3, 0x54,
58+
0x75, 0x82, 0xCC, 0x3B, 0x50, 0xA7, 0xE9, 0x1E,
59+
0xD4, 0x23, 0x6D, 0x9A, 0xF1, 0x06, 0x48, 0xBF,
60+
0x9E, 0x69, 0x27, 0xD0, 0xBB, 0x4C, 0x02, 0xF5,
61+
0x40, 0xB7, 0xF9, 0x0E, 0x65, 0x92, 0xDC, 0x2B,
62+
0x0A, 0xFD, 0xB3, 0x44, 0x2F, 0xD8, 0x96, 0x61,
63+
0x55, 0xA2, 0xEC, 0x1B, 0x70, 0x87, 0xC9, 0x3E,
64+
0x1F, 0xE8, 0xA6, 0x51, 0x3A, 0xCD, 0x83, 0x74,
65+
0xC1, 0x36, 0x78, 0x8F, 0xE4, 0x13, 0x5D, 0xAA,
66+
0x8B, 0x7C, 0x32, 0xC5, 0xAE, 0x59, 0x17, 0xE0,
67+
0x2A, 0xDD, 0x93, 0x64, 0x0F, 0xF8, 0xB6, 0x41,
68+
0x60, 0x97, 0xD9, 0x2E, 0x45, 0xB2, 0xFC, 0x0B,
69+
0xBE, 0x49, 0x07, 0xF0, 0x9B, 0x6C, 0x22, 0xD5,
70+
0xF4, 0x03, 0x4D, 0xBA, 0xD1, 0x26, 0x68, 0x9F,
71+
};
72+
return t[crc ^ data];
73+
}
74+
75+
static u8 bcma_sprom_crc(const u16 *sprom)
76+
{
77+
int word;
78+
u8 crc = 0xFF;
79+
80+
for (word = 0; word < SSB_SPROMSIZE_WORDS_R4 - 1; word++) {
81+
crc = bcma_crc8(crc, sprom[word] & 0x00FF);
82+
crc = bcma_crc8(crc, (sprom[word] & 0xFF00) >> 8);
83+
}
84+
crc = bcma_crc8(crc, sprom[SSB_SPROMSIZE_WORDS_R4 - 1] & 0x00FF);
85+
crc ^= 0xFF;
86+
87+
return crc;
88+
}
89+
90+
static int bcma_sprom_check_crc(const u16 *sprom)
91+
{
92+
u8 crc;
93+
u8 expected_crc;
94+
u16 tmp;
95+
96+
crc = bcma_sprom_crc(sprom);
97+
tmp = sprom[SSB_SPROMSIZE_WORDS_R4 - 1] & SSB_SPROM_REVISION_CRC;
98+
expected_crc = tmp >> SSB_SPROM_REVISION_CRC_SHIFT;
99+
if (crc != expected_crc)
100+
return -EPROTO;
101+
102+
return 0;
103+
}
104+
105+
static int bcma_sprom_valid(const u16 *sprom)
106+
{
107+
u16 revision;
108+
int err;
109+
110+
err = bcma_sprom_check_crc(sprom);
111+
if (err)
112+
return err;
113+
114+
revision = sprom[SSB_SPROMSIZE_WORDS_R4 - 1] & SSB_SPROM_REVISION_REV;
115+
if (revision != 8) {
116+
pr_err("Unsupported SPROM revision: %d\n", revision);
117+
return -ENOENT;
118+
}
119+
120+
return 0;
121+
}
122+
123+
/**************************************************
124+
* SPROM extraction.
125+
**************************************************/
126+
127+
static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
128+
{
129+
u16 v;
130+
int i;
131+
132+
for (i = 0; i < 3; i++) {
133+
v = sprom[SPOFF(SSB_SPROM8_IL0MAC) + i];
134+
*(((__be16 *)bus->sprom.il0mac) + i) = cpu_to_be16(v);
135+
}
136+
}
137+
138+
int bcma_sprom_get(struct bcma_bus *bus)
139+
{
140+
u16 *sprom;
141+
int err = 0;
142+
143+
if (!bus->drv_cc.core)
144+
return -EOPNOTSUPP;
145+
146+
sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),
147+
GFP_KERNEL);
148+
if (!sprom)
149+
return -ENOMEM;
150+
151+
bcma_sprom_read(bus, sprom);
152+
153+
err = bcma_sprom_valid(sprom);
154+
if (err)
155+
goto out;
156+
157+
bcma_sprom_extract_r8(bus, sprom);
158+
159+
out:
160+
kfree(sprom);
161+
return err;
162+
}

drivers/net/wireless/ath/ath.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ struct ath_common {
161161
const struct ath_bus_ops *bus_ops;
162162

163163
bool btcoex_enabled;
164+
bool disable_ani;
164165
};
165166

166167
struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,

drivers/net/wireless/ath/ath5k/base.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ static int modparam_all_channels;
7272
module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO);
7373
MODULE_PARM_DESC(all_channels, "Expose all channels the device can use.");
7474

75+
static int modparam_fastchanswitch;
76+
module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO);
77+
MODULE_PARM_DESC(fastchanswitch, "Enable fast channel switching for AR2413/AR5413 radios.");
78+
79+
7580
/* Module info */
7681
MODULE_AUTHOR("Jiri Slaby");
7782
MODULE_AUTHOR("Nick Kossifidis");
@@ -2686,6 +2691,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
26862691
struct ath5k_hw *ah = sc->ah;
26872692
struct ath_common *common = ath5k_hw_common(ah);
26882693
int ret, ani_mode;
2694+
bool fast;
26892695

26902696
ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "resetting\n");
26912697

@@ -2705,7 +2711,10 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
27052711
ath5k_drain_tx_buffs(sc);
27062712
if (chan)
27072713
sc->curchan = chan;
2708-
ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, chan != NULL,
2714+
2715+
fast = ((chan != NULL) && modparam_fastchanswitch) ? 1 : 0;
2716+
2717+
ret = ath5k_hw_reset(ah, sc->opmode, sc->curchan, fast,
27092718
skip_pcu);
27102719
if (ret) {
27112720
ATH5K_ERR(sc, "can't reset hardware (%d)\n", ret);

drivers/net/wireless/ath/ath5k/reset.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,11 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum nl80211_iftype op_mode,
11241124
/* Non fatal, can happen eg.
11251125
* on mode change */
11261126
ret = 0;
1127-
} else
1127+
} else {
1128+
ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_RESET,
1129+
"fast chan change successful\n");
11281130
return 0;
1131+
}
11291132
}
11301133

11311134
/*

drivers/net/wireless/ath/ath9k/ar9002_mac.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ static void ar9002_hw_set_desc_link(void *ds, u32 ds_link)
2828
((struct ath_desc*) ds)->ds_link = ds_link;
2929
}
3030

31-
static void ar9002_hw_get_desc_link(void *ds, u32 **ds_link)
32-
{
33-
*ds_link = &((struct ath_desc *)ds)->ds_link;
34-
}
35-
3631
static bool ar9002_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
3732
{
3833
u32 isr = 0;
@@ -437,7 +432,6 @@ void ar9002_hw_attach_mac_ops(struct ath_hw *ah)
437432

438433
ops->rx_enable = ar9002_hw_rx_enable;
439434
ops->set_desc_link = ar9002_hw_set_desc_link;
440-
ops->get_desc_link = ar9002_hw_get_desc_link;
441435
ops->get_isr = ar9002_hw_get_isr;
442436
ops->fill_txdesc = ar9002_hw_fill_txdesc;
443437
ops->proc_txdesc = ar9002_hw_proc_txdesc;

0 commit comments

Comments
 (0)