Skip to content

Commit fb68e2f

Browse files
committed
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville says: ==================== Please pull this batch of fixes intended for the 3.10 stream... Regarding the NFC bits, Samuel says: "This is the first batch of NFC fixes for 3.10, and it contains: - 3 fixes for the NFC MEI support: * We now depend on the correct Kconfig symbol. * We register an MEI event callback whenever we enable an NFC device, otherwise we fail to read anything after an enable/disable cycle. * We only disable an MEI device from its disable mey_phy_ops, preventing useless consecutive disable calls. - An NFC Makefile cleanup, as I forgot to remove a commented out line when moving the LLCP code to the NFC top level directory." As for the mac80211 bits, Johannes says: "This time I have a fix from Stanislaw for a stupid mistake I made in the auth/assoc timeout changes, a fix from Felix for 64-bit traffic counters and one from Helmut for address mask handling in mac80211. I also have a few fixes myself for four different crashes reported by a few people." And Johannes says this about the iwlwifi bit: "This fixes a brown paper-bag bug that we really should've caught in review. More details in the changelog for the fix." On top of that... Arend van Spriel and Hante Meuleman cooperate to send a series of AP and P2P mode fixes for brcmfmac. Gabor Juhos corrects a register offset for AR9550, avoiding a bus error. Dan Carpenter provides a fixup to some dmesg output in the atmel driver. And, finally... Felix Fietkau not only gives us a trio of small AR934x fixes, but also refactors the ath9k aggregation session start/stop handling (using the generic mac80211 support) in order to avoid a deadlock. Please let me know if there are problems! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 01e5b2c + 50cc1ca commit fb68e2f

File tree

27 files changed

+301
-235
lines changed

27 files changed

+301
-235
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,16 @@
6868
#define AR9300_BASE_ADDR 0x3ff
6969
#define AR9300_BASE_ADDR_512 0x1ff
7070

71-
#define AR9300_OTP_BASE(AR_SREV_9340(ah) ? 0x30000 : 0x14000)
72-
#define AR9300_OTP_STATUS(AR_SREV_9340(ah) ? 0x30018 : 0x15f18)
71+
#define AR9300_OTP_BASE \
72+
((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000)
73+
#define AR9300_OTP_STATUS \
74+
((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18)
7375
#define AR9300_OTP_STATUS_TYPE0x7
7476
#define AR9300_OTP_STATUS_VALID0x4
7577
#define AR9300_OTP_STATUS_ACCESS_BUSY0x2
7678
#define AR9300_OTP_STATUS_SM_BUSY0x1
77-
#define AR9300_OTP_READ_DATA(AR_SREV_9340(ah) ? 0x3001c : 0x15f1c)
79+
#define AR9300_OTP_READ_DATA \
80+
((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c)
7881

7982
enum targetPowerHTRates {
8083
HT_TARGET_RATE_0_8_16,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ static void ar9003_hw_spur_ofdm(struct ath_hw *ah,
334334
REG_RMW_FIELD(ah, AR_PHY_SPUR_REG,
335335
AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI, 1);
336336

337-
if (REG_READ_FIELD(ah, AR_PHY_MODE,
337+
if (!AR_SREV_9340(ah) &&
338+
REG_READ_FIELD(ah, AR_PHY_MODE,
338339
AR_PHY_MODE_DYNAMIC) == 0x1)
339340
REG_RMW_FIELD(ah, AR_PHY_SPUR_REG,
340341
AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT, 1);

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,9 @@ struct ath_atx_tid {
251251
int tidno;
252252
int baw_head; /* first un-acked tx buffer */
253253
int baw_tail; /* next unused tx buffer slot */
254-
int sched;
255-
int paused;
256-
u8 state;
257-
bool stop_cb;
254+
bool sched;
255+
bool paused;
256+
bool active;
258257
};
259258

260259
struct ath_node {
@@ -275,10 +274,6 @@ struct ath_node {
275274
#endif
276275
};
277276

278-
#define AGGR_CLEANUP BIT(1)
279-
#define AGGR_ADDBA_COMPLETE BIT(2)
280-
#define AGGR_ADDBA_PROGRESS BIT(3)
281-
282277
struct ath_tx_control {
283278
struct ath_txq *txq;
284279
struct ath_node *an;
@@ -352,8 +347,7 @@ void ath_tx_tasklet(struct ath_softc *sc);
352347
void ath_tx_edma_tasklet(struct ath_softc *sc);
353348
int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
354349
u16 tid, u16 *ssn);
355-
bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid,
356-
bool flush);
350+
void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
357351
void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
358352

359353
void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an);

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan)
11721172
static inline void ath9k_hw_set_dma(struct ath_hw *ah)
11731173
{
11741174
struct ath_common *common = ath9k_hw_common(ah);
1175+
int txbuf_size;
11751176

11761177
ENABLE_REGWRITE_BUFFER(ah);
11771178

@@ -1225,13 +1226,17 @@ static inline void ath9k_hw_set_dma(struct ath_hw *ah)
12251226
* So set the usable tx buf size also to half to
12261227
* avoid data/delimiter underruns
12271228
*/
1228-
REG_WRITE(ah, AR_PCU_TXBUF_CTRL,
1229-
AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE);
1230-
} else if (!AR_SREV_9271(ah)) {
1231-
REG_WRITE(ah, AR_PCU_TXBUF_CTRL,
1232-
AR_PCU_TXBUF_CTRL_USABLE_SIZE);
1229+
txbuf_size = AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE;
1230+
} else if (AR_SREV_9340_13_OR_LATER(ah)) {
1231+
/* Uses fewer entries for AR934x v1.3+ to prevent rx overruns */
1232+
txbuf_size = AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE;
1233+
} else {
1234+
txbuf_size = AR_PCU_TXBUF_CTRL_USABLE_SIZE;
12331235
}
12341236

1237+
if (!AR_SREV_9271(ah))
1238+
REG_WRITE(ah, AR_PCU_TXBUF_CTRL, txbuf_size);
1239+
12351240
REGWRITE_BUFFER_FLUSH(ah);
12361241

12371242
if (AR_SREV_9300_20_OR_LATER(ah))
@@ -1306,9 +1311,13 @@ static bool ath9k_hw_set_reset(struct ath_hw *ah, int type)
13061311
AR_RTC_RC_COLD_RESET | AR_RTC_RC_WARM_RESET;
13071312
} else {
13081313
tmpReg = REG_READ(ah, AR_INTR_SYNC_CAUSE);
1309-
if (tmpReg &
1310-
(AR_INTR_SYNC_LOCAL_TIMEOUT |
1311-
AR_INTR_SYNC_RADM_CPL_TIMEOUT)) {
1314+
if (AR_SREV_9340(ah))
1315+
tmpReg &= AR9340_INTR_SYNC_LOCAL_TIMEOUT;
1316+
else
1317+
tmpReg &= AR_INTR_SYNC_LOCAL_TIMEOUT |
1318+
AR_INTR_SYNC_RADM_CPL_TIMEOUT;
1319+
1320+
if (tmpReg) {
13121321
u32 val;
13131322
REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0);
13141323

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
410410

411411
REG_WRITE(ah, AR_QMISC(q), AR_Q_MISC_DCU_EARLY_TERM_REQ);
412412

413-
if (AR_SREV_9340(ah))
413+
if (AR_SREV_9340(ah) && !AR_SREV_9340_13_OR_LATER(ah))
414414
REG_WRITE(ah, AR_DMISC(q),
415415
AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x1);
416416
else

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1709,7 +1709,8 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
17091709
flush = true;
17101710
case IEEE80211_AMPDU_TX_STOP_CONT:
17111711
ath9k_ps_wakeup(sc);
1712-
if (ath_tx_aggr_stop(sc, sta, tid, flush))
1712+
ath_tx_aggr_stop(sc, sta, tid);
1713+
if (!flush)
17131714
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
17141715
ath9k_ps_restore(sc);
17151716
break;

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,10 +1227,7 @@ static bool ath_tx_aggr_check(struct ath_softc *sc, struct ieee80211_sta *sta,
12271227
return false;
12281228

12291229
txtid = ATH_AN_2_TID(an, tidno);
1230-
1231-
if (!(txtid->state & (AGGR_ADDBA_COMPLETE | AGGR_ADDBA_PROGRESS)))
1232-
return true;
1233-
return false;
1230+
return !txtid->active;
12341231
}
12351232

12361233

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,10 @@
798798
#define AR_SREV_REVISION_9485_100
799799
#define AR_SREV_REVISION_9485_11 1
800800
#define AR_SREV_VERSION_93400x300
801+
#define AR_SREV_REVISION_9340_100
802+
#define AR_SREV_REVISION_9340_111
803+
#define AR_SREV_REVISION_9340_122
804+
#define AR_SREV_REVISION_9340_133
801805
#define AR_SREV_VERSION_95800x1C0
802806
#define AR_SREV_REVISION_9580_104 /* AR9580 1.0 */
803807
#define AR_SREV_VERSION_94620x280
@@ -897,6 +901,10 @@
897901
#define AR_SREV_9340(_ah) \
898902
(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340))
899903

904+
#define AR_SREV_9340_13_OR_LATER(_ah) \
905+
(AR_SREV_9340((_ah)) && \
906+
((_ah)->hw_version.macRev >= AR_SREV_REVISION_9340_13))
907+
900908
#define AR_SREV_9285E_20(_ah) \
901909
(AR_SREV_9285_12_OR_LATER(_ah) && \
902910
((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1))
@@ -1007,6 +1015,8 @@ enum {
10071015
AR_INTR_SYNC_LOCAL_TIMEOUT |
10081016
AR_INTR_SYNC_MAC_SLEEP_ACCESS),
10091017

1018+
AR9340_INTR_SYNC_LOCAL_TIMEOUT = 0x00000010,
1019+
10101020
AR_INTR_SYNC_SPURIOUS = 0xFFFFFFFF,
10111021

10121022
};
@@ -1881,6 +1891,7 @@ enum {
18811891
#define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF
18821892
#define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700
18831893
#define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380
1894+
#define AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE 0x500
18841895

18851896
#define AR_PCU_MISC_MODE2 0x8344
18861897
#define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002

0 commit comments

Comments
 (0)