Skip to content

Commit d8ec5a5

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
2 parents 6115c11 + 8e3ffa4 commit d8ec5a5

File tree

31 files changed

+284
-163
lines changed

31 files changed

+284
-163
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,17 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
187187
INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
188188
ar9485_1_1_baseband_core_txfir_coeff_japan_2484);
189189

190-
/* Load PCIE SERDES settings from INI */
191-
192-
/* Awake Setting */
193-
194-
INIT_INI_ARRAY(&ah->iniPcieSerdes,
195-
ar9485_1_1_pcie_phy_clkreq_disable_L1);
196-
197-
/* Sleep Setting */
198-
199-
INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
200-
ar9485_1_1_pcie_phy_clkreq_disable_L1);
190+
if (ah->config.no_pll_pwrsave) {
191+
INIT_INI_ARRAY(&ah->iniPcieSerdes,
192+
ar9485_1_1_pcie_phy_clkreq_disable_L1);
193+
INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
194+
ar9485_1_1_pcie_phy_clkreq_disable_L1);
195+
} else {
196+
INIT_INI_ARRAY(&ah->iniPcieSerdes,
197+
ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
198+
INIT_INI_ARRAY(&ah->iniPcieSerdesLowPower,
199+
ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1);
200+
}
201201
} else if (AR_SREV_9462_21(ah)) {
202202
INIT_INI_ARRAY(&ah->iniMac[ATH_INI_CORE],
203203
ar9462_2p1_mac_core);

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

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ static const u32 ar9485_1_1_mac_postamble[][5] = {
3232
{0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440},
3333
};
3434

35-
static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_disable_L1[][2] = {
36-
/* Addr allmodes */
37-
{0x00018c00, 0x18012e5e},
38-
{0x00018c04, 0x000801d8},
39-
{0x00018c08, 0x0000080c},
40-
};
41-
4235
static const u32 ar9485Common_wo_xlna_rx_gain_1_1[][2] = {
4336
/* Addr allmodes */
4437
{0x00009e00, 0x037216a0},
@@ -1101,20 +1094,6 @@ static const u32 ar9485_common_rx_gain_1_1[][2] = {
11011094
{0x0000a1fc, 0x00000296},
11021095
};
11031096

1104-
static const u32 ar9485_1_1_pcie_phy_pll_on_clkreq_enable_L1[][2] = {
1105-
/* Addr allmodes */
1106-
{0x00018c00, 0x18052e5e},
1107-
{0x00018c04, 0x000801d8},
1108-
{0x00018c08, 0x0000080c},
1109-
};
1110-
1111-
static const u32 ar9485_1_1_pcie_phy_clkreq_enable_L1[][2] = {
1112-
/* Addr allmodes */
1113-
{0x00018c00, 0x18053e5e},
1114-
{0x00018c04, 0x000801d8},
1115-
{0x00018c08, 0x0000080c},
1116-
};
1117-
11181097
static const u32 ar9485_1_1_soc_preamble[][2] = {
11191098
/* Addr allmodes */
11201099
{0x00004014, 0xba280400},
@@ -1173,13 +1152,6 @@ static const u32 ar9485_1_1_baseband_postamble[][5] = {
11731152
{0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
11741153
};
11751154

1176-
static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
1177-
/* Addr allmodes */
1178-
{0x00018c00, 0x18013e5e},
1179-
{0x00018c04, 0x000801d8},
1180-
{0x00018c08, 0x0000080c},
1181-
};
1182-
11831155
static const u32 ar9485_1_1_radio_postamble[][2] = {
11841156
/* Addr allmodes */
11851157
{0x0001609c, 0x0b283f31},
@@ -1358,4 +1330,18 @@ static const u32 ar9485_1_1_baseband_core_txfir_coeff_japan_2484[][2] = {
13581330
{0x0000a3a0, 0xca9228ee},
13591331
};
13601332

1333+
static const u32 ar9485_1_1_pcie_phy_clkreq_disable_L1[][2] = {
1334+
/* Addr allmodes */
1335+
{0x00018c00, 0x18013e5e},
1336+
{0x00018c04, 0x000801d8},
1337+
{0x00018c08, 0x0000080c},
1338+
};
1339+
1340+
static const u32 ar9485_1_1_pll_on_cdr_on_clkreq_disable_L1[][2] = {
1341+
/* Addr allmodes */
1342+
{0x00018c00, 0x1801265e},
1343+
{0x00018c04, 0x000801d8},
1344+
{0x00018c08, 0x0000080c},
1345+
};
1346+
13611347
#endif /* INITVALS_9485_H */

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,16 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs);
632632
/* Main driver core */
633633
/********************/
634634

635-
#define ATH9K_PCI_CUS198 0x0001
636-
#define ATH9K_PCI_CUS230 0x0002
637-
#define ATH9K_PCI_CUS217 0x0004
638-
#define ATH9K_PCI_CUS252 0x0008
639-
#define ATH9K_PCI_WOW 0x0010
640-
#define ATH9K_PCI_BT_ANT_DIV 0x0020
641-
#define ATH9K_PCI_D3_L1_WAR 0x0040
642-
#define ATH9K_PCI_AR9565_1ANT 0x0080
643-
#define ATH9K_PCI_AR9565_2ANT 0x0100
635+
#define ATH9K_PCI_CUS198 0x0001
636+
#define ATH9K_PCI_CUS230 0x0002
637+
#define ATH9K_PCI_CUS217 0x0004
638+
#define ATH9K_PCI_CUS252 0x0008
639+
#define ATH9K_PCI_WOW 0x0010
640+
#define ATH9K_PCI_BT_ANT_DIV 0x0020
641+
#define ATH9K_PCI_D3_L1_WAR 0x0040
642+
#define ATH9K_PCI_AR9565_1ANT 0x0080
643+
#define ATH9K_PCI_AR9565_2ANT 0x0100
644+
#define ATH9K_PCI_NO_PLL_PWRSAVE 0x0200
644645

645646
/*
646647
* Default cache line size, in bytes.

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,20 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
4444
if (buf == NULL)
4545
return -ENOMEM;
4646

47-
if (sc->dfs_detector)
48-
dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
49-
5047
len += scnprintf(buf + len, size - len, "DFS support for "
5148
"macVersion = 0x%x, macRev = 0x%x: %s\n",
5249
hw_ver->macVersion, hw_ver->macRev,
5350
(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ?
5451
"enabled" : "disabled");
52+
53+
if (!sc->dfs_detector) {
54+
len += scnprintf(buf + len, size - len,
55+
"DFS detector not enabled\n");
56+
goto exit;
57+
}
58+
59+
dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
60+
5561
len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
5662
ATH9K_DFS_STAT("pulse events reported ", pulses_total);
5763
ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs);
@@ -76,6 +82,7 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
7682
ATH9K_DFS_POOL_STAT("Seqs. alloc error ", pseq_alloc_error);
7783
ATH9K_DFS_POOL_STAT("Seqs. in use ", pseq_used);
7884

85+
exit:
7986
if (len > size)
8087
len = size;
8188

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ struct ath9k_ops_config {
316316
u32 ant_ctrl_comm2g_switch_enable;
317317
bool xatten_margin_cfg;
318318
bool alt_mingainidx;
319+
bool no_pll_pwrsave;
319320
};
320321

321322
enum ath9k_int {

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,11 @@ static void ath9k_init_platform(struct ath_softc *sc)
609609
ah->config.pcie_waen = 0x0040473b;
610610
ath_info(common, "Enable WAR for ASPM D3/L1\n");
611611
}
612+
613+
if (sc->driver_data & ATH9K_PCI_NO_PLL_PWRSAVE) {
614+
ah->config.no_pll_pwrsave = true;
615+
ath_info(common, "Disable PLL PowerSave\n");
616+
}
612617
}
613618

614619
static void ath9k_eeprom_request_cb(const struct firmware *eeprom_blob,
@@ -863,8 +868,8 @@ static const struct ieee80211_iface_combination if_comb[] = {
863868
.max_interfaces = 1,
864869
.num_different_channels = 1,
865870
.beacon_int_infra_match = true,
866-
.radar_detect_widths = BIT(NL80211_CHAN_NO_HT) |
867-
BIT(NL80211_CHAN_HT20),
871+
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
872+
BIT(NL80211_CHAN_WIDTH_20),
868873
}
869874
};
870875

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

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,93 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
195195
0x3219),
196196
.driver_data = ATH9K_PCI_BT_ANT_DIV },
197197

198+
/* AR9485 cards with PLL power-save disabled by default. */
199+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
200+
0x0032,
201+
PCI_VENDOR_ID_AZWAVE,
202+
0x2C97),
203+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
204+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
205+
0x0032,
206+
PCI_VENDOR_ID_AZWAVE,
207+
0x2100),
208+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
209+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
210+
0x0032,
211+
0x1C56, /* ASKEY */
212+
0x4001),
213+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
214+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
215+
0x0032,
216+
0x11AD, /* LITEON */
217+
0x6627),
218+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
219+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
220+
0x0032,
221+
0x11AD, /* LITEON */
222+
0x6628),
223+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
224+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
225+
0x0032,
226+
PCI_VENDOR_ID_FOXCONN,
227+
0xE04E),
228+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
229+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
230+
0x0032,
231+
PCI_VENDOR_ID_FOXCONN,
232+
0xE04F),
233+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
234+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
235+
0x0032,
236+
0x144F, /* ASKEY */
237+
0x7197),
238+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
239+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
240+
0x0032,
241+
0x1B9A, /* XAVI */
242+
0x2000),
243+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
244+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
245+
0x0032,
246+
0x1B9A, /* XAVI */
247+
0x2001),
248+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
249+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
250+
0x0032,
251+
PCI_VENDOR_ID_AZWAVE,
252+
0x1186),
253+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
254+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
255+
0x0032,
256+
PCI_VENDOR_ID_AZWAVE,
257+
0x1F86),
258+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
259+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
260+
0x0032,
261+
PCI_VENDOR_ID_AZWAVE,
262+
0x1195),
263+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
264+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
265+
0x0032,
266+
PCI_VENDOR_ID_AZWAVE,
267+
0x1F95),
268+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
269+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
270+
0x0032,
271+
0x1B9A, /* XAVI */
272+
0x1C00),
273+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
274+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
275+
0x0032,
276+
0x1B9A, /* XAVI */
277+
0x1C01),
278+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
279+
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS,
280+
0x0032,
281+
PCI_VENDOR_ID_ASUSTEK,
282+
0x850D),
283+
.driver_data = ATH9K_PCI_NO_PLL_PWRSAVE },
284+
198285
{ PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
199286
{ PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
200287

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static ssize_t write_file_dump(struct file *file,
126126
if (begin == NULL)
127127
break;
128128

129-
if (kstrtoul(begin, 0, (unsigned long *)(arg + i)) != 0)
129+
if (kstrtou32(begin, 0, &arg[i]) != 0)
130130
break;
131131
}
132132

drivers/net/wireless/ath/wcn36xx/smd.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,8 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
12861286
} else {
12871287
wcn36xx_err("Beacon is to big: beacon size=%d\n",
12881288
msg_body.beacon_length);
1289-
return -ENOMEM;
1289+
ret = -ENOMEM;
1290+
goto out;
12901291
}
12911292
memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
12921293

@@ -1327,7 +1328,8 @@ int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
13271328
if (skb->len > BEACON_TEMPLATE_SIZE) {
13281329
wcn36xx_warn("probe response template is too big: %d\n",
13291330
skb->len);
1330-
return -E2BIG;
1331+
ret = -E2BIG;
1332+
goto out;
13311333
}
13321334

13331335
msg.probe_resp_template_len = skb->len;
@@ -1606,7 +1608,8 @@ int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn,
16061608
/* TODO: it also support ARP response type */
16071609
} else {
16081610
wcn36xx_warn("unknow keep alive packet type %d\n", packet_type);
1609-
return -EINVAL;
1611+
ret = -EINVAL;
1612+
goto out;
16101613
}
16111614

16121615
PREPARE_HAL_BUF(wcn->hal_buf, msg_body);

drivers/net/wireless/libertas/debugfs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,10 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
913913
char *p2;
914914
struct debug_data *d = f->private_data;
915915

916-
pdata = kmalloc(cnt, GFP_KERNEL);
916+
if (cnt == 0)
917+
return 0;
918+
919+
pdata = kmalloc(cnt + 1, GFP_KERNEL);
917920
if (pdata == NULL)
918921
return 0;
919922

@@ -922,6 +925,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
922925
kfree(pdata);
923926
return 0;
924927
}
928+
pdata[cnt] = '\0';
925929

926930
p0 = pdata;
927931
for (i = 0; i < num_of_items; i++) {

0 commit comments

Comments
 (0)