aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-02-08 15:32:25 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-08 15:32:25 -0500
commite0c42c8e3e94f6c478f8c96814d4a2d19d2204b2 (patch)
tree52478ce91a12eb79c3f0c3d4753d187d80886520
parent55b3280d1e471795c08dbbe17325720a843e104c (diff)
parent99ffd198f07f46f3a8e64399249a8333c09063df (diff)
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 <davem@davemloft.net>
-rw-r--r--drivers/net/wireless/ath/ath10k/core.c43
-rw-r--r--drivers/net/wireless/ath/ath10k/coredump.c3
-rw-r--r--drivers/net/wireless/ath/ath10k/debug.c12
-rw-r--r--drivers/net/wireless/ath/ath10k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/calib.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c1
-rw-r--r--drivers/net/wireless/mediatek/mt76/agg-rx.c40
-rw-r--r--drivers/net/wireless/mediatek/mt76/mac80211.c52
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76.h10
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2.h2
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2_init.c1
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2_mac.c2
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2_main.c28
-rw-r--r--drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c5
-rw-r--r--drivers/net/wireless/realtek/rtlwifi/wifi.h1
-rw-r--r--drivers/ssb/Kconfig2
-rw-r--r--include/linux/pci_ids.h2
18 files changed, 181 insertions, 32 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index b0fdc1023619..f3ec13b80b20 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -91,6 +91,35 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
91 .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, 91 .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL,
92 }, 92 },
93 { 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 },
122 {
94 .id = QCA9887_HW_1_0_VERSION, 123 .id = QCA9887_HW_1_0_VERSION,
95 .dev_id = QCA9887_1_0_DEVICE_ID, 124 .dev_id = QCA9887_1_0_DEVICE_ID,
96 .name = "qca9887 hw1.0", 125 .name = "qca9887 hw1.0",
@@ -1276,10 +1305,7 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
1276 len -= sizeof(*hdr); 1305 len -= sizeof(*hdr);
1277 data = hdr->data; 1306 data = hdr->data;
1278 1307
1279 /* jump over the padding */ 1308 if (len < ALIGN(ie_len, 4)) {
1280 ie_len = ALIGN(ie_len, 4);
1281
1282 if (len < ie_len) {
1283 ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n", 1309 ath10k_err(ar, "invalid length for board ie_id %d ie_len %zu len %zu\n",
1284 ie_id, ie_len, len); 1310 ie_id, ie_len, len);
1285 ret = -EINVAL; 1311 ret = -EINVAL;
@@ -1318,6 +1344,9 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar,
1318 goto out; 1344 goto out;
1319 } 1345 }
1320 1346
1347 /* jump over the padding */
1348 ie_len = ALIGN(ie_len, 4);
1349
1321 len -= ie_len; 1350 len -= ie_len;
1322 data += ie_len; 1351 data += ie_len;
1323 } 1352 }
@@ -1448,9 +1477,6 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
1448 len -= sizeof(*hdr); 1477 len -= sizeof(*hdr);
1449 data += sizeof(*hdr); 1478 data += sizeof(*hdr);
1450 1479
1451 /* jump over the padding */
1452 ie_len = ALIGN(ie_len, 4);
1453
1454 if (len < ie_len) { 1480 if (len < ie_len) {
1455 ath10k_err(ar, "invalid length for FW IE %d (%zu < %zu)\n", 1481 ath10k_err(ar, "invalid length for FW IE %d (%zu < %zu)\n",
1456 ie_id, len, ie_len); 1482 ie_id, len, ie_len);
@@ -1556,6 +1582,9 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
1556 break; 1582 break;
1557 } 1583 }
1558 1584
1585 /* jump over the padding */
1586 ie_len = ALIGN(ie_len, 4);
1587
1559 len -= ie_len; 1588 len -= ie_len;
1560 data += ie_len; 1589 data += ie_len;
1561 } 1590 }
diff --git a/drivers/net/wireless/ath/ath10k/coredump.c b/drivers/net/wireless/ath/ath10k/coredump.c
index 4dde126dab17..7173b3743b43 100644
--- a/drivers/net/wireless/ath/ath10k/coredump.c
+++ b/drivers/net/wireless/ath/ath10k/coredump.c
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. 2 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
3 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
3 * 4 *
4 * Permission to use, copy, modify, and/or distribute this software for any 5 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above 6 * 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[] = {
616 { 617 {
617 .type = ATH10K_MEM_REGION_TYPE_DRAM, 618 .type = ATH10K_MEM_REGION_TYPE_DRAM,
618 .start = 0x400000, 619 .start = 0x400000,
619 .len = 0x90000, 620 .len = 0xa8000,
620 .name = "DRAM", 621 .name = "DRAM",
621 .section_table = { 622 .section_table = {
622 .sections = NULL, 623 .sections = NULL,
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 6d836a26272f..554cd7856cb6 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc. 2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. 3 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
4 * 5 *
5 * Permission to use, copy, modify, and/or distribute this software for any 6 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above 7 * purpose with or without fee is hereby granted, provided that the above
@@ -81,6 +82,8 @@ void ath10k_debug_print_hwfw_info(struct ath10k *ar)
81void ath10k_debug_print_board_info(struct ath10k *ar) 82void ath10k_debug_print_board_info(struct ath10k *ar)
82{ 83{
83 char boardinfo[100]; 84 char boardinfo[100];
85 const struct firmware *board;
86 u32 crc;
84 87
85 if (ar->id.bmi_ids_valid) 88 if (ar->id.bmi_ids_valid)
86 scnprintf(boardinfo, sizeof(boardinfo), "%d:%d", 89 scnprintf(boardinfo, sizeof(boardinfo), "%d:%d",
@@ -88,11 +91,16 @@ void ath10k_debug_print_board_info(struct ath10k *ar)
88 else 91 else
89 scnprintf(boardinfo, sizeof(boardinfo), "N/A"); 92 scnprintf(boardinfo, sizeof(boardinfo), "N/A");
90 93
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
91 ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x", 100 ath10k_info(ar, "board_file api %d bmi_id %s crc32 %08x",
92 ar->bd_api, 101 ar->bd_api,
93 boardinfo, 102 boardinfo,
94 crc32_le(0, ar->normal_mode_fw.board->data, 103 crc);
95 ar->normal_mode_fw.board->size));
96} 104}
97 105
98void ath10k_debug_print_boot_info(struct ath10k *ar) 106void ath10k_debug_print_boot_info(struct ath10k *ar)
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 6203bc65799b..413b1b4321f7 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -22,6 +22,7 @@
22 22
23#define ATH10K_FW_DIR "ath10k" 23#define ATH10K_FW_DIR "ath10k"
24 24
25#define QCA988X_2_0_DEVICE_ID_UBNT (0x11ac)
25#define QCA988X_2_0_DEVICE_ID (0x003c) 26#define QCA988X_2_0_DEVICE_ID (0x003c)
26#define QCA6164_2_1_DEVICE_ID (0x0041) 27#define QCA6164_2_1_DEVICE_ID (0x0041)
27#define QCA6174_2_1_DEVICE_ID (0x003e) 28#define QCA6174_2_1_DEVICE_ID (0x003e)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 355db6a0fcf3..1b266cd0c2ec 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -58,6 +58,9 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only (default: 0)");
58#define ATH10K_DIAG_TRANSFER_LIMIT 0x5000 58#define ATH10K_DIAG_TRANSFER_LIMIT 0x5000
59 59
60static const struct pci_device_id ath10k_pci_id_table[] = { 60static 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
61 { PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */ 64 { PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */
62 { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */ 65 { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */
63 { PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */ 66 { 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[] = {
74 * hacks. ath10k doesn't have them and these devices crash horribly 77 * hacks. ath10k doesn't have them and these devices crash horribly
75 * because of that. 78 * because of that.
76 */ 79 */
80 { QCA988X_2_0_DEVICE_ID_UBNT, QCA988X_HW_2_0_CHIP_ID_REV },
77 { QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV }, 81 { QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV },
78 82
79 { QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV }, 83 { 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)
2193 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); 2197 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
2194 2198
2195 switch (ar_pci->pdev->device) { 2199 switch (ar_pci->pdev->device) {
2200 case QCA988X_2_0_DEVICE_ID_UBNT:
2196 case QCA988X_2_0_DEVICE_ID: 2201 case QCA988X_2_0_DEVICE_ID:
2197 case QCA99X0_2_0_DEVICE_ID: 2202 case QCA99X0_2_0_DEVICE_ID:
2198 case QCA9888_2_0_DEVICE_ID: 2203 case QCA9888_2_0_DEVICE_ID:
@@ -3424,6 +3429,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
3424 u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr); 3429 u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr);
3425 3430
3426 switch (pci_dev->device) { 3431 switch (pci_dev->device) {
3432 case QCA988X_2_0_DEVICE_ID_UBNT:
3427 case QCA988X_2_0_DEVICE_ID: 3433 case QCA988X_2_0_DEVICE_ID:
3428 hw_rev = ATH10K_HW_QCA988X; 3434 hw_rev = ATH10K_HW_QCA988X;
3429 pci_ps = false; 3435 pci_ps = false;
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index 3d9447e21025..695c779ae8cf 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -72,7 +72,7 @@ static s16 ath9k_hw_get_default_nf(struct ath_hw *ah,
72s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan, 72s16 ath9k_hw_getchan_noise(struct ath_hw *ah, struct ath9k_channel *chan,
73 s16 nf) 73 s16 nf)
74{ 74{
75 s8 noise = ath9k_hw_get_default_nf(ah, chan, 0); 75 s8 noise = ATH_DEFAULT_NOISE_FLOOR;
76 76
77 if (nf) { 77 if (nf) {
78 s8 delta = nf - ATH9K_NF_CAL_NOISE_THRESH - 78 s8 delta = nf - ATH9K_NF_CAL_NOISE_THRESH -
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 56676eaff24c..cb0eef13af1c 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -24,6 +24,7 @@ static const struct usb_device_id ath9k_hif_usb_ids[] = {
24 { USB_DEVICE(0x0cf3, 0x9271) }, /* Atheros */ 24 { USB_DEVICE(0x0cf3, 0x9271) }, /* Atheros */
25 { USB_DEVICE(0x0cf3, 0x1006) }, /* Atheros */ 25 { USB_DEVICE(0x0cf3, 0x1006) }, /* Atheros */
26 { USB_DEVICE(0x0846, 0x9030) }, /* Netgear N150 */ 26 { USB_DEVICE(0x0846, 0x9030) }, /* Netgear N150 */
27 { USB_DEVICE(0x07b8, 0x9271) }, /* Altai WA1011N-GU */
27 { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */ 28 { USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */
28 { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */ 29 { USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
29 { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */ 30 { USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */
diff --git a/drivers/net/wireless/mediatek/mt76/agg-rx.c b/drivers/net/wireless/mediatek/mt76/agg-rx.c
index 8027bb7c03c2..fcb208d1f276 100644
--- a/drivers/net/wireless/mediatek/mt76/agg-rx.c
+++ b/drivers/net/wireless/mediatek/mt76/agg-rx.c
@@ -98,6 +98,7 @@ mt76_rx_aggr_reorder_work(struct work_struct *work)
98 reorder_work.work); 98 reorder_work.work);
99 struct mt76_dev *dev = tid->dev; 99 struct mt76_dev *dev = tid->dev;
100 struct sk_buff_head frames; 100 struct sk_buff_head frames;
101 int nframes;
101 102
102 __skb_queue_head_init(&frames); 103 __skb_queue_head_init(&frames);
103 104
@@ -105,14 +106,44 @@ mt76_rx_aggr_reorder_work(struct work_struct *work)
105 106
106 spin_lock(&tid->lock); 107 spin_lock(&tid->lock);
107 mt76_rx_aggr_check_release(tid, &frames); 108 mt76_rx_aggr_check_release(tid, &frames);
109 nframes = tid->nframes;
108 spin_unlock(&tid->lock); 110 spin_unlock(&tid->lock);
109 111
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);
111 mt76_rx_complete(dev, &frames, -1); 115 mt76_rx_complete(dev, &frames, -1);
112 116
113 local_bh_enable(); 117 local_bh_enable();
114} 118}
115 119
120static void
121mt76_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
116void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames) 147void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames)
117{ 148{
118 struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb; 149 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)
126 __skb_queue_tail(frames, skb); 157 __skb_queue_tail(frames, skb);
127 158
128 sta = wcid_to_sta(wcid); 159 sta = wcid_to_sta(wcid);
129 if (!sta || !status->aggr) 160 if (!sta)
130 return; 161 return;
131 162
163 if (!status->aggr) {
164 mt76_rx_aggr_check_ctl(skb, frames);
165 return;
166 }
167
132 tid = rcu_dereference(wcid->aggr[status->tid]); 168 tid = rcu_dereference(wcid->aggr[status->tid]);
133 if (!tid) 169 if (!tid)
134 return; 170 return;
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 5fcb2deb89a2..85f8d324ebf8 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -276,6 +276,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
276 ieee80211_hw_set(hw, TX_AMSDU); 276 ieee80211_hw_set(hw, TX_AMSDU);
277 ieee80211_hw_set(hw, TX_FRAG_LIST); 277 ieee80211_hw_set(hw, TX_FRAG_LIST);
278 ieee80211_hw_set(hw, MFP_CAPABLE); 278 ieee80211_hw_set(hw, MFP_CAPABLE);
279 ieee80211_hw_set(hw, AP_LINK_PS);
279 280
280 wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 281 wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
281 282
@@ -470,6 +471,53 @@ mt76_check_ccmp_pn(struct sk_buff *skb)
470 return 0; 471 return 0;
471} 472}
472 473
474static void
475mt76_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
473void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, 521void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
474 int queue) 522 int queue)
475{ 523{
@@ -498,8 +546,10 @@ void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q)
498 546
499 __skb_queue_head_init(&frames); 547 __skb_queue_head_init(&frames);
500 548
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);
502 mt76_rx_aggr_reorder(skb, &frames); 551 mt76_rx_aggr_reorder(skb, &frames);
552 }
503 553
504 mt76_rx_complete(dev, &frames, q); 554 mt76_rx_complete(dev, &frames, q);
505} 555}
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 129015c9d116..d2ce15093edd 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -121,11 +121,18 @@ struct mt76_queue_ops {
121 void (*kick)(struct mt76_dev *dev, struct mt76_queue *q); 121 void (*kick)(struct mt76_dev *dev, struct mt76_queue *q);
122}; 122};
123 123
124enum mt76_wcid_flags {
125 MT_WCID_FLAG_CHECK_PS,
126 MT_WCID_FLAG_PS,
127};
128
124struct mt76_wcid { 129struct mt76_wcid {
125 struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS]; 130 struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS];
126 131
127 struct work_struct aggr_work; 132 struct work_struct aggr_work;
128 133
134 unsigned long flags;
135
129 u8 idx; 136 u8 idx;
130 u8 hw_key_idx; 137 u8 hw_key_idx;
131 138
@@ -206,6 +213,9 @@ struct mt76_driver_ops {
206 struct sk_buff *skb); 213 struct sk_buff *skb);
207 214
208 void (*rx_poll_complete)(struct mt76_dev *dev, enum mt76_rxq_id q); 215 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);
209}; 219};
210 220
211struct mt76_channel_state { 221struct mt76_channel_state {
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2.h b/drivers/net/wireless/mediatek/mt76/mt76x2.h
index 17df17afd9bf..e62131b88102 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2.h
@@ -218,6 +218,8 @@ void mt76x2_rx_poll_complete(struct mt76_dev *mdev, enum mt76_rxq_id q);
218void mt76x2_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, 218void mt76x2_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
219 struct sk_buff *skb); 219 struct sk_buff *skb);
220 220
221void mt76x2_sta_ps(struct mt76_dev *dev, struct ieee80211_sta *sta, bool ps);
222
221void mt76x2_update_channel(struct mt76_dev *mdev); 223void mt76x2_update_channel(struct mt76_dev *mdev);
222 224
223s8 mt76x2_tx_get_max_txpwr_adj(struct mt76x2_dev *dev, 225s8 mt76x2_tx_get_max_txpwr_adj(struct mt76x2_dev *dev,
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c
index 1b00ae4465a2..9dbf94947324 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_init.c
@@ -630,6 +630,7 @@ struct mt76x2_dev *mt76x2_alloc_device(struct device *pdev)
630 .tx_complete_skb = mt76x2_tx_complete_skb, 630 .tx_complete_skb = mt76x2_tx_complete_skb,
631 .rx_skb = mt76x2_queue_rx_skb, 631 .rx_skb = mt76x2_queue_rx_skb,
632 .rx_poll_complete = mt76x2_rx_poll_complete, 632 .rx_poll_complete = mt76x2_rx_poll_complete,
633 .sta_ps = mt76x2_sta_ps,
633 }; 634 };
634 struct ieee80211_hw *hw; 635 struct ieee80211_hw *hw;
635 struct mt76x2_dev *dev; 636 struct mt76x2_dev *dev;
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
index 6c30b5eaa9ca..7ea3d841918e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_mac.c
@@ -341,7 +341,7 @@ int mt76x2_mac_process_rx(struct mt76x2_dev *dev, struct sk_buff *skb,
341 341
342 mt76x2_remove_hdr_pad(skb, pad_len); 342 mt76x2_remove_hdr_pad(skb, pad_len);
343 343
344 if (rxinfo & MT_RXINFO_BA) 344 if ((rxinfo & MT_RXINFO_BA) && !(rxinfo & MT_RXINFO_NULL))
345 status->aggr = true; 345 status->aggr = true;
346 346
347 if (WARN_ON_ONCE(len > skb->len)) 347 if (WARN_ON_ONCE(len > skb->len))
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
index bf26284b9989..205043b470b2 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
@@ -282,6 +282,9 @@ mt76x2_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
282 for (i = 0; i < ARRAY_SIZE(sta->txq); i++) 282 for (i = 0; i < ARRAY_SIZE(sta->txq); i++)
283 mt76x2_txq_init(dev, sta->txq[i]); 283 mt76x2_txq_init(dev, sta->txq[i]);
284 284
285 if (vif->type == NL80211_IFTYPE_AP)
286 set_bit(MT_WCID_FLAG_CHECK_PS, &msta->wcid.flags);
287
285 rcu_assign_pointer(dev->wcid[idx], &msta->wcid); 288 rcu_assign_pointer(dev->wcid[idx], &msta->wcid);
286 289
287out: 290out:
@@ -311,23 +314,14 @@ mt76x2_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
311 return 0; 314 return 0;
312} 315}
313 316
314static void 317void
315mt76x2_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 318mt76x2_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps)
316 enum sta_notify_cmd cmd, struct ieee80211_sta *sta)
317{ 319{
318 struct mt76x2_sta *msta = (struct mt76x2_sta *) sta->drv_priv; 320 struct mt76x2_sta *msta = (struct mt76x2_sta *) sta->drv_priv;
319 struct mt76x2_dev *dev = hw->priv; 321 struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76);
320 int idx = msta->wcid.idx; 322 int idx = msta->wcid.idx;
321 323
322 switch (cmd) { 324 mt76x2_mac_wcid_set_drop(dev, idx, ps);
323 case STA_NOTIFY_SLEEP:
324 mt76x2_mac_wcid_set_drop(dev, idx, true);
325 mt76_stop_tx_queues(&dev->mt76, sta, true);
326 break;
327 case STA_NOTIFY_AWAKE:
328 mt76x2_mac_wcid_set_drop(dev, idx, false);
329 break;
330 }
331} 325}
332 326
333static int 327static int
@@ -549,6 +543,12 @@ static void mt76x2_set_coverage_class(struct ieee80211_hw *hw,
549 mutex_unlock(&dev->mutex); 543 mutex_unlock(&dev->mutex);
550} 544}
551 545
546static int
547mt76x2_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set)
548{
549 return 0;
550}
551
552const struct ieee80211_ops mt76x2_ops = { 552const struct ieee80211_ops mt76x2_ops = {
553 .tx = mt76x2_tx, 553 .tx = mt76x2_tx,
554 .start = mt76x2_start, 554 .start = mt76x2_start,
@@ -560,7 +560,6 @@ const struct ieee80211_ops mt76x2_ops = {
560 .bss_info_changed = mt76x2_bss_info_changed, 560 .bss_info_changed = mt76x2_bss_info_changed,
561 .sta_add = mt76x2_sta_add, 561 .sta_add = mt76x2_sta_add,
562 .sta_remove = mt76x2_sta_remove, 562 .sta_remove = mt76x2_sta_remove,
563 .sta_notify = mt76x2_sta_notify,
564 .set_key = mt76x2_set_key, 563 .set_key = mt76x2_set_key,
565 .conf_tx = mt76x2_conf_tx, 564 .conf_tx = mt76x2_conf_tx,
566 .sw_scan_start = mt76x2_sw_scan, 565 .sw_scan_start = mt76x2_sw_scan,
@@ -573,5 +572,6 @@ const struct ieee80211_ops mt76x2_ops = {
573 .release_buffered_frames = mt76_release_buffered_frames, 572 .release_buffered_frames = mt76_release_buffered_frames,
574 .set_coverage_class = mt76x2_set_coverage_class, 573 .set_coverage_class = mt76x2_set_coverage_class,
575 .get_survey = mt76_get_survey, 574 .get_survey = mt76_get_survey,
575 .set_tim = mt76x2_set_tim,
576}; 576};
577 577
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index f20e77b4bb65..317c1b3101da 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -1123,7 +1123,7 @@ static u8 _rtl8821ae_dbi_read(struct rtl_priv *rtlpriv, u16 addr)
1123 } 1123 }
1124 if (0 == tmp) { 1124 if (0 == tmp) {
1125 read_addr = REG_DBI_RDATA + addr % 4; 1125 read_addr = REG_DBI_RDATA + addr % 4;
1126 ret = rtl_read_word(rtlpriv, read_addr); 1126 ret = rtl_read_byte(rtlpriv, read_addr);
1127 } 1127 }
1128 return ret; 1128 return ret;
1129} 1129}
@@ -1165,7 +1165,8 @@ static void _rtl8821ae_enable_aspm_back_door(struct ieee80211_hw *hw)
1165 } 1165 }
1166 1166
1167 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x70f); 1167 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x70f);
1168 _rtl8821ae_dbi_write(rtlpriv, 0x70f, tmp | BIT(7)); 1168 _rtl8821ae_dbi_write(rtlpriv, 0x70f, tmp | BIT(7) |
1169 ASPM_L1_LATENCY << 3);
1169 1170
1170 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x719); 1171 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x719);
1171 _rtl8821ae_dbi_write(rtlpriv, 0x719, tmp | BIT(3) | BIT(4)); 1172 _rtl8821ae_dbi_write(rtlpriv, 0x719, tmp | BIT(3) | BIT(4));
diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
index a7aacbc3984e..46dcb7fef195 100644
--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
@@ -99,6 +99,7 @@
99#define RTL_USB_MAX_RX_COUNT 100 99#define RTL_USB_MAX_RX_COUNT 100
100#define QBSS_LOAD_SIZE 5 100#define QBSS_LOAD_SIZE 5
101#define MAX_WMMELE_LENGTH 64 101#define MAX_WMMELE_LENGTH 64
102#define ASPM_L1_LATENCY 7
102 103
103#define TOTAL_CAM_ENTRY 32 104#define TOTAL_CAM_ENTRY 32
104 105
diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index ee18428a051f..b3f5cae98ea6 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -31,7 +31,7 @@ config SSB_BLOCKIO
31 31
32config SSB_PCIHOST_POSSIBLE 32config SSB_PCIHOST_POSSIBLE
33 bool 33 bool
34 depends on SSB && (PCI = y || PCI = SSB) && PCI_DRIVERS_LEGACY 34 depends on SSB && (PCI = y || PCI = SSB) && (PCI_DRIVERS_LEGACY || !MIPS)
35 default y 35 default y
36 36
37config SSB_PCIHOST 37config SSB_PCIHOST
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index eb13e84e1fef..a6b30667a331 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -149,6 +149,8 @@
149#define PCI_VENDOR_ID_DYNALINK 0x0675 149#define PCI_VENDOR_ID_DYNALINK 0x0675
150#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702 150#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
151 151
152#define PCI_VENDOR_ID_UBIQUITI 0x0777
153
152#define PCI_VENDOR_ID_BERKOM 0x0871 154#define PCI_VENDOR_ID_BERKOM 0x0871
153#define PCI_DEVICE_ID_BERKOM_A1T 0xffa1 155#define PCI_DEVICE_ID_BERKOM_A1T 0xffa1
154#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xffa2 156#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xffa2