Skip to content

Commit e4d680c

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2 parents a248afd + 5160b46 commit e4d680c

Some content is hidden

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

67 files changed

+3271
-1375
lines changed

drivers/bcma/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void bcma_core_set_clockmode(struct bcma_device *core,
6565
switch (clkmode) {
6666
case BCMA_CLKMODE_FAST:
6767
bcma_set32(core, BCMA_CLKCTLST, BCMA_CLKCTLST_FORCEHT);
68-
udelay(64);
68+
usleep_range(64, 300);
6969
for (i = 0; i < 1500; i++) {
7070
if (bcma_read32(core, BCMA_CLKCTLST) &
7171
BCMA_CLKCTLST_HAVEHT) {

drivers/bcma/driver_chipcommon_pmu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
7676
if (max_msk)
7777
bcma_cc_write32(cc, BCMA_CC_PMU_MAXRES_MSK, max_msk);
7878

79-
/* Add some delay; allow resources to come up and settle. */
79+
/*
80+
* Add some delay; allow resources to come up and settle.
81+
* Delay is required for SoC (early init).
82+
*/
8083
mdelay(2);
8184
}
8285

drivers/bcma/driver_pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static void bcma_pcie_mdio_set_phy(struct bcma_drv_pci *pc, u8 phy)
5151
v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL);
5252
if (v & BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE)
5353
break;
54-
msleep(1);
54+
usleep_range(1000, 2000);
5555
}
5656
}
5757

@@ -92,7 +92,7 @@ static u16 bcma_pcie_mdio_read(struct bcma_drv_pci *pc, u8 device, u8 address)
9292
ret = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_DATA);
9393
break;
9494
}
95-
msleep(1);
95+
usleep_range(1000, 2000);
9696
}
9797
pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0);
9898
return ret;
@@ -132,7 +132,7 @@ static void bcma_pcie_mdio_write(struct bcma_drv_pci *pc, u8 device,
132132
v = pcicore_read32(pc, BCMA_CORE_PCI_MDIO_CONTROL);
133133
if (v & BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE)
134134
break;
135-
msleep(1);
135+
usleep_range(1000, 2000);
136136
}
137137
pcicore_write32(pc, BCMA_CORE_PCI_MDIO_CONTROL, 0);
138138
}

drivers/bcma/driver_pci_host.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,9 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
425425
pc_host->io_resource.flags = IORESOURCE_IO | IORESOURCE_PCI_FIXED;
426426

427427
/* Reset RC */
428-
udelay(3000);
428+
usleep_range(3000, 5000);
429429
pcicore_write32(pc, BCMA_CORE_PCI_CTL, BCMA_CORE_PCI_CTL_RST_OE);
430-
udelay(1000);
430+
usleep_range(1000, 2000);
431431
pcicore_write32(pc, BCMA_CORE_PCI_CTL, BCMA_CORE_PCI_CTL_RST |
432432
BCMA_CORE_PCI_CTL_RST_OE);
433433

@@ -481,7 +481,7 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
481481
* before issuing configuration requests to PCI Express
482482
* devices.
483483
*/
484-
udelay(100000);
484+
msleep(100);
485485

486486
bcma_core_pci_enable_crs(pc);
487487

@@ -501,7 +501,7 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc)
501501
set_io_port_base(pc_host->pci_controller.io_map_base);
502502
/* Give some time to the PCI controller to configure itself with the new
503503
* values. Not waiting at this point causes crashes of the machine. */
504-
mdelay(10);
504+
usleep_range(10000, 15000);
505505
register_pci_controller(&pc_host->pci_controller);
506506
return;
507507
}

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
182182
struct ath9k_hw_capabilities *pCap = &ah->caps;
183183
struct ath_common *common = ath9k_hw_common(ah);
184184
u32 sync_cause = 0, async_cause, async_mask = AR_INTR_MAC_IRQ;
185+
bool fatal_int;
185186

186187
if (ath9k_hw_mci_is_enabled(ah))
187188
async_mask |= AR_INTR_ASYNC_MASK_MCI;
@@ -310,6 +311,22 @@ static bool ar9003_hw_get_isr(struct ath_hw *ah, enum ath9k_int *masked)
310311

311312
if (sync_cause) {
312313
ath9k_debug_sync_cause(common, sync_cause);
314+
fatal_int =
315+
(sync_cause &
316+
(AR_INTR_SYNC_HOST1_FATAL | AR_INTR_SYNC_HOST1_PERR))
317+
? true : false;
318+
319+
if (fatal_int) {
320+
if (sync_cause & AR_INTR_SYNC_HOST1_FATAL) {
321+
ath_dbg(common, ANY,
322+
"received PCI FATAL interrupt\n");
323+
}
324+
if (sync_cause & AR_INTR_SYNC_HOST1_PERR) {
325+
ath_dbg(common, ANY,
326+
"received PCI PERR interrupt\n");
327+
}
328+
*masked |= ATH9K_INT_FATAL;
329+
}
313330

314331
if (sync_cause & AR_INTR_SYNC_RADM_CPL_TIMEOUT) {
315332
REG_WRITE(ah, AR_RC, AR_RC_HOSTIF);

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,8 @@ static void ar9003_mci_osla_setup(struct ath_hw *ah, bool enable)
813813
AR_BTCOEX_CTRL_ONE_STEP_LOOK_AHEAD_EN, 1);
814814
}
815815

816-
void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
817-
bool is_full_sleep)
816+
int ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
817+
bool is_full_sleep)
818818
{
819819
struct ath_common *common = ath9k_hw_common(ah);
820820
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
@@ -824,14 +824,13 @@ void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
824824
is_full_sleep, is_2g);
825825

826826
if (!mci->gpm_addr && !mci->sched_addr) {
827-
ath_dbg(common, MCI,
828-
"MCI GPM and schedule buffers are not allocated\n");
829-
return;
827+
ath_err(common, "MCI GPM and schedule buffers are not allocated\n");
828+
return -ENOMEM;
830829
}
831830

832831
if (REG_READ(ah, AR_BTCOEX_CTRL) == 0xdeadbeef) {
833-
ath_dbg(common, MCI, "BTCOEX control register is dead\n");
834-
return;
832+
ath_err(common, "BTCOEX control register is dead\n");
833+
return -EINVAL;
835834
}
836835

837836
/* Program MCI DMA related registers */
@@ -913,6 +912,8 @@ void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
913912

914913
if (en_int)
915914
ar9003_mci_enable_interrupt(ah);
915+
916+
return 0;
916917
}
917918

918919
void ar9003_mci_stop_bt(struct ath_hw *ah, bool save_fullsleep)
@@ -1144,8 +1145,8 @@ void ar9003_mci_init_cal_done(struct ath_hw *ah)
11441145
ar9003_mci_send_message(ah, MCI_GPM, 0, pld, 16, true, false);
11451146
}
11461147

1147-
void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
1148-
u16 len, u32 sched_addr)
1148+
int ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
1149+
u16 len, u32 sched_addr)
11491150
{
11501151
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
11511152

@@ -1154,7 +1155,7 @@ void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
11541155
mci->gpm_len = len;
11551156
mci->sched_addr = sched_addr;
11561157

1157-
ar9003_mci_reset(ah, true, true, true);
1158+
return ar9003_mci_reset(ah, true, true, true);
11581159
}
11591160
EXPORT_SYMBOL(ar9003_mci_setup);
11601161

drivers/net/wireless/ath/ath9k/ar9003_mci.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ bool ar9003_mci_send_message(struct ath_hw *ah, u8 header, u32 flag,
249249
u32 *payload, u8 len, bool wait_done,
250250
bool check_bt);
251251
u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type);
252-
void ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
253-
u16 len, u32 sched_addr);
252+
int ar9003_mci_setup(struct ath_hw *ah, u32 gpm_addr, void *gpm_buf,
253+
u16 len, u32 sched_addr);
254254
void ar9003_mci_cleanup(struct ath_hw *ah);
255255
void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr,
256256
u32 *rx_msg_intr);
@@ -272,8 +272,8 @@ void ar9003_mci_check_bt(struct ath_hw *ah);
272272
bool ar9003_mci_start_reset(struct ath_hw *ah, struct ath9k_channel *chan);
273273
int ar9003_mci_end_reset(struct ath_hw *ah, struct ath9k_channel *chan,
274274
struct ath9k_hw_cal_data *caldata);
275-
void ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
276-
bool is_full_sleep);
275+
int ar9003_mci_reset(struct ath_hw *ah, bool en_int, bool is_2g,
276+
bool is_full_sleep);
277277
void ar9003_mci_get_isr(struct ath_hw *ah, enum ath9k_int *masked);
278278
void ar9003_mci_bt_gain_ctrl(struct ath_hw *ah);
279279
void ar9003_mci_set_power_awake(struct ath_hw *ah);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ static void ar9003_hw_antctrl_shared_chain_lnadiv(struct ath_hw *ah,
13601360
if (enable) {
13611361
REG_SET_BIT(ah, AR_PHY_MC_GAIN_CTRL,
13621362
(1 << AR_PHY_ANT_SW_RX_PROT_S));
1363-
if (IS_CHAN_2GHZ(ah->curchan))
1363+
if (ah->curchan && IS_CHAN_2GHZ(ah->curchan))
13641364
REG_SET_BIT(ah, AR_PHY_RESTART,
13651365
AR_PHY_RESTART_ENABLE_DIV_M2FLAG);
13661366
REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV,

drivers/net/wireless/ath/ath9k/ath9k.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd,
173173

174174
#define ATH_AN_2_TID(_an, _tidno) (&(_an)->tid[(_tidno)])
175175

176+
#define IS_CCK_RATE(rate) ((rate >= 0x18) && (rate <= 0x1e))
177+
176178
#define ATH_TX_COMPLETE_POLL_INT 1000
177179

178180
enum ATH_AGGR_STATUS {

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

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ static const u32 ar9003_wlan_weights[ATH_BTCOEX_STOMP_MAX]
4343
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, /* STOMP_NONE */
4444
};
4545

46-
static const u32 ar9462_wlan_weights[ATH_BTCOEX_STOMP_MAX]
47-
[AR9300_NUM_WLAN_WEIGHTS] = {
46+
static const u32 mci_wlan_weights[ATH_BTCOEX_STOMP_MAX]
47+
[AR9300_NUM_WLAN_WEIGHTS] = {
4848
{ 0x01017d01, 0x41414101, 0x41414101, 0x41414141 }, /* STOMP_ALL */
4949
{ 0x01017d01, 0x3b3b3b01, 0x3b3b3b01, 0x3b3b3b3b }, /* STOMP_LOW */
5050
{ 0x01017d01, 0x01010101, 0x01010101, 0x01010101 }, /* STOMP_NONE */
@@ -208,14 +208,37 @@ static void ath9k_hw_btcoex_enable_2wire(struct ath_hw *ah)
208208
AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
209209
}
210210

211+
/*
212+
* For AR9002, bt_weight/wlan_weight are used.
213+
* For AR9003 and above, stomp_type is used.
214+
*/
211215
void ath9k_hw_btcoex_set_weight(struct ath_hw *ah,
212216
u32 bt_weight,
213-
u32 wlan_weight)
217+
u32 wlan_weight,
218+
enum ath_stomp_type stomp_type)
214219
{
215220
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
216221

217-
btcoex_hw->bt_coex_weights = SM(bt_weight, AR_BTCOEX_BT_WGHT) |
218-
SM(wlan_weight, AR_BTCOEX_WL_WGHT);
222+
if (AR_SREV_9300_20_OR_LATER(ah)) {
223+
const u32 *weight = ar9003_wlan_weights[stomp_type];
224+
int i;
225+
226+
if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
227+
if ((stomp_type == ATH_BTCOEX_STOMP_LOW) &&
228+
btcoex_hw->mci.stomp_ftp)
229+
stomp_type = ATH_BTCOEX_STOMP_LOW_FTP;
230+
weight = mci_wlan_weights[stomp_type];
231+
}
232+
233+
for (i = 0; i < AR9300_NUM_WLAN_WEIGHTS; i++) {
234+
btcoex_hw->bt_weight[i] = AR9300_BT_WGHT;
235+
btcoex_hw->wlan_weight[i] = weight[i];
236+
}
237+
} else {
238+
btcoex_hw->bt_coex_weights =
239+
SM(bt_weight, AR_BTCOEX_BT_WGHT) |
240+
SM(wlan_weight, AR_BTCOEX_WL_WGHT);
241+
}
219242
}
220243
EXPORT_SYMBOL(ath9k_hw_btcoex_set_weight);
221244

@@ -282,7 +305,7 @@ void ath9k_hw_btcoex_enable(struct ath_hw *ah)
282305
ath9k_hw_btcoex_enable_2wire(ah);
283306
break;
284307
case ATH_BTCOEX_CFG_3WIRE:
285-
if (AR_SREV_9462(ah)) {
308+
if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
286309
ath9k_hw_btcoex_enable_mci(ah);
287310
return;
288311
}
@@ -304,7 +327,7 @@ void ath9k_hw_btcoex_disable(struct ath_hw *ah)
304327
int i;
305328

306329
btcoex_hw->enabled = false;
307-
if (AR_SREV_9462(ah)) {
330+
if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
308331
ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE);
309332
for (i = 0; i < AR9300_NUM_BT_WEIGHTS; i++)
310333
REG_WRITE(ah, AR_MCI_COEX_WL_WEIGHTS(i),
@@ -332,49 +355,29 @@ void ath9k_hw_btcoex_disable(struct ath_hw *ah)
332355
}
333356
EXPORT_SYMBOL(ath9k_hw_btcoex_disable);
334357

335-
static void ar9003_btcoex_bt_stomp(struct ath_hw *ah,
336-
enum ath_stomp_type stomp_type)
337-
{
338-
struct ath_btcoex_hw *btcoex = &ah->btcoex_hw;
339-
const u32 *weight = ar9003_wlan_weights[stomp_type];
340-
int i;
341-
342-
if (AR_SREV_9462(ah)) {
343-
if ((stomp_type == ATH_BTCOEX_STOMP_LOW) &&
344-
btcoex->mci.stomp_ftp)
345-
stomp_type = ATH_BTCOEX_STOMP_LOW_FTP;
346-
weight = ar9462_wlan_weights[stomp_type];
347-
}
348-
349-
for (i = 0; i < AR9300_NUM_WLAN_WEIGHTS; i++) {
350-
btcoex->bt_weight[i] = AR9300_BT_WGHT;
351-
btcoex->wlan_weight[i] = weight[i];
352-
}
353-
}
354-
355358
/*
356359
* Configures appropriate weight based on stomp type.
357360
*/
358361
void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah,
359362
enum ath_stomp_type stomp_type)
360363
{
361364
if (AR_SREV_9300_20_OR_LATER(ah)) {
362-
ar9003_btcoex_bt_stomp(ah, stomp_type);
365+
ath9k_hw_btcoex_set_weight(ah, 0, 0, stomp_type);
363366
return;
364367
}
365368

366369
switch (stomp_type) {
367370
case ATH_BTCOEX_STOMP_ALL:
368371
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
369-
AR_STOMP_ALL_WLAN_WGHT);
372+
AR_STOMP_ALL_WLAN_WGHT, 0);
370373
break;
371374
case ATH_BTCOEX_STOMP_LOW:
372375
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
373-
AR_STOMP_LOW_WLAN_WGHT);
376+
AR_STOMP_LOW_WLAN_WGHT, 0);
374377
break;
375378
case ATH_BTCOEX_STOMP_NONE:
376379
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
377-
AR_STOMP_NONE_WLAN_WGHT);
380+
AR_STOMP_NONE_WLAN_WGHT, 0);
378381
break;
379382
default:
380383
ath_dbg(ath9k_hw_common(ah), BTCOEX, "Invalid Stomptype\n");

drivers/net/wireless/ath/ath9k/btcoex.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ void ath9k_hw_btcoex_init_mci(struct ath_hw *ah);
107107
void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum);
108108
void ath9k_hw_btcoex_set_weight(struct ath_hw *ah,
109109
u32 bt_weight,
110-
u32 wlan_weight);
110+
u32 wlan_weight,
111+
enum ath_stomp_type stomp_type);
111112
void ath9k_hw_btcoex_disable(struct ath_hw *ah);
112113
void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah,
113114
enum ath_stomp_type stomp_type);

0 commit comments

Comments
 (0)