Skip to content

Commit e0c42c8

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2018-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== wireless-drivers-next patches for 4.16 The most important here is the ssb fix, it has been reported by the users frequently and the fix just missed the final v4.15. Also numerous other fixes, mt76 had multiple problems with aggregation and a long standing unaligned access bug in rtlwifi is finally fixed. Major changes: ath10k * correct firmware RAM dump length for QCA6174/QCA9377 * add new QCA988X device id * fix a kernel panic during pci probe * revert a recent commit which broke ath10k firmware metadata parsing ath9k * fix a noise floor regression introduced during the merge window * add new device id rtlwifi * fix unaligned access seen on ARM architecture mt76 * various aggregation fixes which fix connection stalls ssb * fix b43 and b44 on non-MIPS which broke in v4.15-rc9 ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 55b3280 + 99ffd19 commit e0c42c8

File tree

18 files changed

+181
-32
lines changed

18 files changed

+181
-32
lines changed

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,35 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
9090
.target_64bit = false,
9191
.rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL,
9292
},
93+
{
94+
.id = QCA988X_HW_2_0_VERSION,
95+
.dev_id = QCA988X_2_0_DEVICE_ID_UBNT,
96+
.name = "qca988x hw2.0 ubiquiti",
97+
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
98+
.uart_pin = 7,
99+
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
100+
.otp_exe_param = 0,
101+
.channel_counters_freq_hz = 88000,
102+
.max_probe_resp_desc_thres = 0,
103+
.cal_data_len = 2116,
104+
.fw = {
105+
.dir = QCA988X_HW_2_0_FW_DIR,
106+
.board = QCA988X_HW_2_0_BOARD_DATA_FILE,
107+
.board_size = QCA988X_BOARD_DATA_SZ,
108+
.board_ext_size = QCA988X_BOARD_EXT_DATA_SZ,
109+
},
110+
.hw_ops = &qca988x_ops,
111+
.decap_align_bytes = 4,
112+
.spectral_bin_discard = 0,
113+
.vht160_mcs_rx_highest = 0,
114+
.vht160_mcs_tx_highest = 0,
115+
.n_cipher_suites = 8,
116+
.num_peers = TARGET_TLV_NUM_PEERS,
117+
.ast_skid_limit = 0x10,
118+
.num_wds_entries = 0x20,
119+
.target_64bit = false,
120+
.rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL,
121+
},
93122
{
94123
.id = QCA9887_HW_1_0_VERSION,
95124
.dev_id = QCA9887_1_0_DEVICE_ID,
@@ -1276,10 +1305,7 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
12761305
len -= sizeof(*hdr);
12771306
data = hdr->data;
12781307

1279-
/* jump over the padding */
1280-
ie_len = ALIGN(ie_len, 4);
1281-
1282-
if (len < ie_len) {
1308+
if (len < ALIGN(ie_len, 4)) {
12831309
ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
12841310
ie_id, ie_len, len);
12851311
ret = -EINVAL;
@@ -1318,6 +1344,9 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
13181344
goto out;
13191345
}
13201346

1347+
/* jump over the padding */
1348+
ie_len = ALIGN(ie_len, 4);
1349+
13211350
len -= ie_len;
13221351
data += ie_len;
13231352
}
@@ -1448,9 +1477,6 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
14481477
len -= sizeof(*hdr);
14491478
data += sizeof(*hdr);
14501479

1451-
/* jump over the padding */
1452-
ie_len = ALIGN(ie_len, 4);
1453-
14541480
if (len < ie_len) {
14551481
ath10k_err(ar, "invalid length for FW IE %d (%zu < %zu)\n",
14561482
ie_id, len, ie_len);
@@ -1556,6 +1582,9 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
15561582
break;
15571583
}
15581584

1585+
/* jump over the padding */
1586+
ie_len = ALIGN(ie_len, 4);
1587+
15591588
len -= ie_len;
15601589
data += ie_len;
15611590
}

drivers/net/wireless/ath/ath10k/coredump.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
3+
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
34
*
45
* Permission to use, copy, modify, and/or distribute this software for any
56
* purpose with or without fee is hereby granted, provided that the above
@@ -616,7 +617,7 @@ static const struct ath10k_mem_region qca6174_hw30_mem_regions[] = {
616617
{
617618
.type = ATH10K_MEM_REGION_TYPE_DRAM,
618619
.start = 0x400000,
619-
.len = 0x90000,
620+
.len = 0xa8000,
620621
.name = "DRAM",
621622
.section_table = {
622623
.sections = NULL,

drivers/net/wireless/ath/ath10k/debug.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2005-2011 Atheros Communications Inc.
33
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4+
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
45
*
56
* Permission to use, copy, modify, and/or distribute this software for any
67
* purpose with or without fee is hereby granted, provided that the above
@@ -81,18 +82,25 @@ void ath10k_debug_print_hwfw_info(struct ath10k *ar)
8182
void ath10k_debug_print_board_info(struct ath10k *ar)
8283
{
8384
char boardinfo[100];
85+
const struct firmware *board;
86+
u32 crc;
8487

8588
if (ar->id.bmi_ids_valid)
8689
scnprintf(boardinfo, sizeof(boardinfo), "%d:%d",
8790
ar->id.bmi_chip_id, ar->id.bmi_board_id);
8891
else
8992
scnprintf(boardinfo, sizeof(boardinfo), "N/A");
9093

94+
board = ar->normal_mode_fw.board;
95+
if (!IS_ERR_OR_NULL(board))
96+
crc = crc32_le(0, board->data, board->size);
97+
else
98+
crc = 0;
99+
91100
ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x",
92101
ar->bd_api,
93102
boardinfo,
94-
crc32_le(0, ar->normal_mode_fw.board->data,
95-
ar->normal_mode_fw.board->size));
103+
crc);
96104
}
97105

98106
void ath10k_debug_print_boot_info(struct ath10k *ar)

drivers/net/wireless/ath/ath10k/hw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#define ATH10K_FW_DIR "ath10k"
2424

25+
#define QCA988X_2_0_DEVICE_ID_UBNT (0x11ac)
2526
#define QCA988X_2_0_DEVICE_ID (0x003c)
2627
#define QCA6164_2_1_DEVICE_ID (0x0041)
2728
#define QCA6174_2_1_DEVICE_ID (0x003e)

drivers/net/wireless/ath/ath10k/pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only (default: 0)");
5858
#define ATH10K_DIAG_TRANSFER_LIMIT 0x5000
5959

6060
static const struct pci_device_id ath10k_pci_id_table[] = {
61+
/* PCI-E QCA988X V2 (Ubiquiti branded) */
62+
{ PCI_VDEVICE(UBIQUITI, QCA988X_2_0_DEVICE_ID_UBNT) },
63+
6164
{ PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */
6265
{ PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */
6366
{ PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */
@@ -74,6 +77,7 @@ static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = {
7477
* hacks. ath10k doesn't have them and these devices crash horribly
7578
* because of that.
7679
*/
80+
{ QCA988X_2_0_DEVICE_ID_UBNT, QCA988X_HW_2_0_CHIP_ID_REV },
7781
{ QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV },
7882

7983
{ QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV },
@@ -2193,6 +2197,7 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar)
21932197
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
21942198

21952199
switch (ar_pci->pdev->device) {
2200+
case QCA988X_2_0_DEVICE_ID_UBNT:
21962201
case QCA988X_2_0_DEVICE_ID:
21972202
case QCA99X0_2_0_DEVICE_ID:
21982203
case QCA9888_2_0_DEVICE_ID:
@@ -3424,6 +3429,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
34243429
u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr);
34253430

34263431
switch (pci_dev->device) {
3432+
case QCA988X_2_0_DEVICE_ID_UBNT:
34273433
case QCA988X_2_0_DEVICE_ID:
34283434
hw_rev = ATH10K_HW_QCA988X;
34293435
pci_ps = false;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static s16 ath9k_hw_get_default_nf(struct ath_hw *ah,
7272
s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan,
7373
s16 nf)
7474
{
75-
s8 noise = ath9k_hw_get_default_nf(ah, chan, 0);
75+
s8 noise = ATH_DEFAULT_NOISE_FLOOR;
7676

7777
if (nf) {
7878
s8 delta = nf - ATH9K_NF_CAL_NOISE_THRESH -

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ static const struct usb_device_id ath9k_hif_usb_ids[] = {
2424
{ USB_DEVICE(0x0cf3, 0x9271) }, /* Atheros */
2525
{ USB_DEVICE(0x0cf3, 0x1006) }, /* Atheros */
2626
{ USB_DEVICE(0x0846, 0x9030) }, /* Netgear N150 */
27+
{ USB_DEVICE(0x07b8, 0x9271) }, /* Altai WA1011N-GU */
2728
{ USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */
2829
{ USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
2930
{ USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */

drivers/net/wireless/mediatek/mt76/agg-rx.c

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,52 @@ mt76_rx_aggr_reorder_work(struct work_struct *work)
9898
reorder_work.work);
9999
struct mt76_dev *dev = tid->dev;
100100
struct sk_buff_head frames;
101+
int nframes;
101102

102103
__skb_queue_head_init(&frames);
103104

104105
local_bh_disable();
105106

106107
spin_lock(&tid->lock);
107108
mt76_rx_aggr_check_release(tid, &frames);
109+
nframes = tid->nframes;
108110
spin_unlock(&tid->lock);
109111

110-
ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work, REORDER_TIMEOUT);
112+
if (nframes)
113+
ieee80211_queue_delayed_work(tid->dev->hw, &tid->reorder_work,
114+
REORDER_TIMEOUT);
111115
mt76_rx_complete(dev, &frames, -1);
112116

113117
local_bh_enable();
114118
}
115119

120+
static void
121+
mt76_rx_aggr_check_ctl(struct sk_buff *skb, struct sk_buff_head *frames)
122+
{
123+
struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb;
124+
struct ieee80211_bar *bar = (struct ieee80211_bar *) skb->data;
125+
struct mt76_wcid *wcid = status->wcid;
126+
struct mt76_rx_tid *tid;
127+
u16 seqno;
128+
129+
if (!ieee80211_is_ctl(bar->frame_control))
130+
return;
131+
132+
if (!ieee80211_is_back_req(bar->frame_control))
133+
return;
134+
135+
status->tid = le16_to_cpu(bar->control) >> 12;
136+
seqno = le16_to_cpu(bar->start_seq_num) >> 4;
137+
tid = rcu_dereference(wcid->aggr[status->tid]);
138+
if (!tid)
139+
return;
140+
141+
spin_lock_bh(&tid->lock);
142+
mt76_rx_aggr_release_frames(tid, frames, seqno);
143+
mt76_rx_aggr_release_head(tid, frames);
144+
spin_unlock_bh(&tid->lock);
145+
}
146+
116147
void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames)
117148
{
118149
struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb;
@@ -126,9 +157,14 @@ void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames)
126157
__skb_queue_tail(frames, skb);
127158

128159
sta = wcid_to_sta(wcid);
129-
if (!sta || !status->aggr)
160+
if (!sta)
130161
return;
131162

163+
if (!status->aggr) {
164+
mt76_rx_aggr_check_ctl(skb, frames);
165+
return;
166+
}
167+
132168
tid = rcu_dereference(wcid->aggr[status->tid]);
133169
if (!tid)
134170
return;

drivers/net/wireless/mediatek/mt76/mac80211.c

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
276276
ieee80211_hw_set(hw, TX_AMSDU);
277277
ieee80211_hw_set(hw, TX_FRAG_LIST);
278278
ieee80211_hw_set(hw, MFP_CAPABLE);
279+
ieee80211_hw_set(hw, AP_LINK_PS);
279280

280281
wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
281282

@@ -470,6 +471,53 @@ mt76_check_ccmp_pn(struct sk_buff *skb)
470471
return 0;
471472
}
472473

474+
static void
475+
mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb)
476+
{
477+
struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb;
478+
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
479+
struct ieee80211_sta *sta;
480+
struct mt76_wcid *wcid = status->wcid;
481+
bool ps;
482+
483+
if (!wcid || !wcid->sta)
484+
return;
485+
486+
sta = container_of((void *) wcid, struct ieee80211_sta, drv_priv);
487+
488+
if (!test_bit(MT_WCID_FLAG_CHECK_PS, &wcid->flags))
489+
return;
490+
491+
if (ieee80211_is_pspoll(hdr->frame_control)) {
492+
ieee80211_sta_pspoll(sta);
493+
return;
494+
}
495+
496+
if (ieee80211_has_morefrags(hdr->frame_control) ||
497+
!(ieee80211_is_mgmt(hdr->frame_control) ||
498+
ieee80211_is_data(hdr->frame_control)))
499+
return;
500+
501+
ps = ieee80211_has_pm(hdr->frame_control);
502+
503+
if (ps && (ieee80211_is_data_qos(hdr->frame_control) ||
504+
ieee80211_is_qos_nullfunc(hdr->frame_control)))
505+
ieee80211_sta_uapsd_trigger(sta, status->tid);
506+
507+
if (!!test_bit(MT_WCID_FLAG_PS, &wcid->flags) == ps)
508+
return;
509+
510+
if (ps) {
511+
set_bit(MT_WCID_FLAG_PS, &wcid->flags);
512+
mt76_stop_tx_queues(dev, sta, true);
513+
} else {
514+
clear_bit(MT_WCID_FLAG_PS, &wcid->flags);
515+
}
516+
517+
ieee80211_sta_ps_transition(sta, ps);
518+
dev->drv->sta_ps(dev, sta, ps);
519+
}
520+
473521
void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
474522
int queue)
475523
{
@@ -498,8 +546,10 @@ void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q)
498546

499547
__skb_queue_head_init(&frames);
500548

501-
while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL)
549+
while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) {
550+
mt76_check_ps(dev, skb);
502551
mt76_rx_aggr_reorder(skb, &frames);
552+
}
503553

504554
mt76_rx_complete(dev, &frames, q);
505555
}

drivers/net/wireless/mediatek/mt76/mt76.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,18 @@ struct mt76_queue_ops {
121121
void (*kick)(struct mt76_dev *dev, struct mt76_queue *q);
122122
};
123123

124+
enum mt76_wcid_flags {
125+
MT_WCID_FLAG_CHECK_PS,
126+
MT_WCID_FLAG_PS,
127+
};
128+
124129
struct mt76_wcid {
125130
struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS];
126131

127132
struct work_struct aggr_work;
128133

134+
unsigned long flags;
135+
129136
u8 idx;
130137
u8 hw_key_idx;
131138

@@ -206,6 +213,9 @@ struct mt76_driver_ops {
206213
struct sk_buff *skb);
207214

208215
void (*rx_poll_complete)(struct mt76_dev *dev, enum mt76_rxq_id q);
216+
217+
void (*sta_ps)(struct mt76_dev *dev, struct ieee80211_sta *sta,
218+
bool ps);
209219
};
210220

211221
struct mt76_channel_state {

drivers/net/wireless/mediatek/mt76/mt76x2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ void mt76x2_rx_poll_complete(struct mt76_dev *mdev, enum mt76_rxq_id q);
218218
void mt76x2_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
219219
struct sk_buff *skb);
220220

221+
void mt76x2_sta_ps(struct mt76_dev *dev, struct ieee80211_sta *sta, bool ps);
222+
221223
void mt76x2_update_channel(struct mt76_dev *mdev);
222224

223225
s8 mt76x2_tx_get_max_txpwr_adj(struct mt76x2_dev *dev,

drivers/net/wireless/mediatek/mt76/mt76x2_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ struct mt76x2_dev *mt76x2_alloc_device(struct device *pdev)
630630
.tx_complete_skb = mt76x2_tx_complete_skb,
631631
.rx_skb = mt76x2_queue_rx_skb,
632632
.rx_poll_complete = mt76x2_rx_poll_complete,
633+
.sta_ps = mt76x2_sta_ps,
633634
};
634635
struct ieee80211_hw *hw;
635636
struct mt76x2_dev *dev;

drivers/net/wireless/mediatek/mt76/mt76x2_mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb,
341341

342342
mt76x2_remove_hdr_pad(skb, pad_len);
343343

344-
if (rxinfo & MT_RXINFO_BA)
344+
if ((rxinfo & MT_RXINFO_BA) && !(rxinfo & MT_RXINFO_NULL))
345345
status->aggr = true;
346346

347347
if (WARN_ON_ONCE(len > skb->len))

0 commit comments

Comments
 (0)