Skip to content

Commit afc050d

Browse files
committed
Merge tag 'wireless-drivers-for-davem-2015-10-17' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
Kalle Valo says: ==================== iwlwifi: * mvm: flush fw_dump_wk when mvm fails to start * mvm: init card correctly on ctkill exit check * pci: add a few more PCI subvendor IDs for the 7265 series * fix firmware filename for 3160 * mvm: clear csa countdown when AP is stopped * mvm: fix D3 firmware PN programming * dvm: fix D3 firmware PN programming * mvm: fix D3 CCMP TX PN assignment rtlwifi: * rtl8821ae: Fix system lockups on boot ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents e277de5 + de28a05 commit afc050d

File tree

12 files changed

+54
-20
lines changed

12 files changed

+54
-20
lines changed

drivers/net/wireless/iwlwifi/dvm/lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,
10201020
u8 *pn = seq.ccmp.pn;
10211021

10221022
ieee80211_get_key_rx_seq(key, i, &seq);
1023-
aes_sc->pn = cpu_to_le64(
1023+
aes_sc[i].pn = cpu_to_le64(
10241024
(u64)pn[5] |
10251025
((u64)pn[4] << 8) |
10261026
((u64)pn[3] << 16) |

drivers/net/wireless/iwlwifi/iwl-7000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,6 @@ const struct iwl_cfg iwl7265d_n_cfg = {
348348
};
349349

350350
MODULE_FIRMWARE(IWL7260_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
351-
MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL3160_UCODE_API_OK));
351+
MODULE_FIRMWARE(IWL3160_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
352352
MODULE_FIRMWARE(IWL7265_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));
353353
MODULE_FIRMWARE(IWL7265D_MODULE_FIRMWARE(IWL7260_UCODE_API_OK));

drivers/net/wireless/iwlwifi/mvm/d3.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,13 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
274274
break;
275275
case WLAN_CIPHER_SUITE_CCMP:
276276
if (sta) {
277-
u8 *pn = seq.ccmp.pn;
277+
u64 pn64;
278278

279279
aes_sc = data->rsc_tsc->all_tsc_rsc.aes.unicast_rsc;
280280
aes_tx_sc = &data->rsc_tsc->all_tsc_rsc.aes.tsc;
281281

282-
ieee80211_get_key_tx_seq(key, &seq);
283-
aes_tx_sc->pn = cpu_to_le64((u64)pn[5] |
284-
((u64)pn[4] << 8) |
285-
((u64)pn[3] << 16) |
286-
((u64)pn[2] << 24) |
287-
((u64)pn[1] << 32) |
288-
((u64)pn[0] << 40));
282+
pn64 = atomic64_read(&key->tx_pn);
283+
aes_tx_sc->pn = cpu_to_le64(pn64);
289284
} else {
290285
aes_sc = data->rsc_tsc->all_tsc_rsc.aes.multicast_rsc;
291286
}
@@ -298,12 +293,12 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
298293
u8 *pn = seq.ccmp.pn;
299294

300295
ieee80211_get_key_rx_seq(key, i, &seq);
301-
aes_sc->pn = cpu_to_le64((u64)pn[5] |
302-
((u64)pn[4] << 8) |
303-
((u64)pn[3] << 16) |
304-
((u64)pn[2] << 24) |
305-
((u64)pn[1] << 32) |
306-
((u64)pn[0] << 40));
296+
aes_sc[i].pn = cpu_to_le64((u64)pn[5] |
297+
((u64)pn[4] << 8) |
298+
((u64)pn[3] << 16) |
299+
((u64)pn[2] << 24) |
300+
((u64)pn[1] << 32) |
301+
((u64)pn[0] << 40));
307302
}
308303
data->use_rsc_tsc = true;
309304
break;
@@ -1453,15 +1448,15 @@ static void iwl_mvm_d3_update_gtks(struct ieee80211_hw *hw,
14531448

14541449
switch (key->cipher) {
14551450
case WLAN_CIPHER_SUITE_CCMP:
1456-
iwl_mvm_aes_sc_to_seq(&sc->aes.tsc, &seq);
14571451
iwl_mvm_set_aes_rx_seq(sc->aes.unicast_rsc, key);
1452+
atomic64_set(&key->tx_pn, le64_to_cpu(sc->aes.tsc.pn));
14581453
break;
14591454
case WLAN_CIPHER_SUITE_TKIP:
14601455
iwl_mvm_tkip_sc_to_seq(&sc->tkip.tsc, &seq);
14611456
iwl_mvm_set_tkip_rx_seq(sc->tkip.unicast_rsc, key);
1457+
ieee80211_set_key_tx_seq(key, &seq);
14621458
break;
14631459
}
1464-
ieee80211_set_key_tx_seq(key, &seq);
14651460

14661461
/* that's it for this key */
14671462
return;

drivers/net/wireless/iwlwifi/mvm/fw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
703703
* abort after reading the nvm in case RF Kill is on, we will complete
704704
* the init seq later when RF kill will switch to off
705705
*/
706-
if (iwl_mvm_is_radio_killed(mvm)) {
706+
if (iwl_mvm_is_radio_hw_killed(mvm)) {
707707
IWL_DEBUG_RF_KILL(mvm,
708708
"jump over all phy activities due to RF kill\n");
709709
iwl_remove_notification(&mvm->notif_wait, &calib_wait);
@@ -736,7 +736,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
736736
ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait,
737737
MVM_UCODE_CALIB_TIMEOUT);
738738

739-
if (ret && iwl_mvm_is_radio_killed(mvm)) {
739+
if (ret && iwl_mvm_is_radio_hw_killed(mvm)) {
740740
IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n");
741741
ret = 1;
742742
}

drivers/net/wireless/iwlwifi/mvm/mac80211.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,6 +2388,7 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
23882388
iwl_mvm_remove_time_event(mvm, mvmvif,
23892389
&mvmvif->time_event_data);
23902390
RCU_INIT_POINTER(mvm->csa_vif, NULL);
2391+
mvmvif->csa_countdown = false;
23912392
}
23922393

23932394
if (rcu_access_pointer(mvm->csa_tx_blocked_vif) == vif) {

drivers/net/wireless/iwlwifi/mvm/mvm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,11 @@ static inline bool iwl_mvm_is_radio_killed(struct iwl_mvm *mvm)
860860
test_bit(IWL_MVM_STATUS_HW_CTKILL, &mvm->status);
861861
}
862862

863+
static inline bool iwl_mvm_is_radio_hw_killed(struct iwl_mvm *mvm)
864+
{
865+
return test_bit(IWL_MVM_STATUS_HW_RFKILL, &mvm->status);
866+
}
867+
863868
/* Must be called with rcu_read_lock() held and it can only be
864869
* released when mvmsta is not needed anymore.
865870
*/

drivers/net/wireless/iwlwifi/mvm/ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
590590
ieee80211_unregister_hw(mvm->hw);
591591
iwl_mvm_leds_exit(mvm);
592592
out_free:
593+
flush_delayed_work(&mvm->fw_dump_wk);
593594
iwl_phy_db_free(mvm->phy_db);
594595
kfree(mvm->scan_cmd);
595596
if (!cfg->no_power_up_nic_in_init || !mvm->nvm_file_name)

drivers/net/wireless/iwlwifi/pcie/drv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
414414
{IWL_PCI_DEVICE(0x095A, 0x5590, iwl7265_2ac_cfg)},
415415
{IWL_PCI_DEVICE(0x095B, 0x5290, iwl7265_2ac_cfg)},
416416
{IWL_PCI_DEVICE(0x095A, 0x5490, iwl7265_2ac_cfg)},
417+
{IWL_PCI_DEVICE(0x095A, 0x5F10, iwl7265_2ac_cfg)},
418+
{IWL_PCI_DEVICE(0x095B, 0x5212, iwl7265_2ac_cfg)},
419+
{IWL_PCI_DEVICE(0x095B, 0x520A, iwl7265_2ac_cfg)},
420+
{IWL_PCI_DEVICE(0x095A, 0x9000, iwl7265_2ac_cfg)},
421+
{IWL_PCI_DEVICE(0x095A, 0x9400, iwl7265_2ac_cfg)},
417422

418423
/* 8000 Series */
419424
{IWL_PCI_DEVICE(0x24F3, 0x0010, iwl8260_2ac_cfg)},

drivers/net/wireless/rtlwifi/pci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ struct rtl_pci {
247247
/* MSI support */
248248
bool msi_support;
249249
bool using_msi;
250+
/* interrupt clear before set */
251+
bool int_clear;
250252
};
251253

252254
struct mp_adapter {

drivers/net/wireless/rtlwifi/rtl8821ae/hw.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2253,11 +2253,28 @@ void rtl8821ae_set_qos(struct ieee80211_hw *hw, int aci)
22532253
}
22542254
}
22552255

2256+
static void rtl8821ae_clear_interrupt(struct ieee80211_hw *hw)
2257+
{
2258+
struct rtl_priv *rtlpriv = rtl_priv(hw);
2259+
u32 tmp = rtl_read_dword(rtlpriv, REG_HISR);
2260+
2261+
rtl_write_dword(rtlpriv, REG_HISR, tmp);
2262+
2263+
tmp = rtl_read_dword(rtlpriv, REG_HISRE);
2264+
rtl_write_dword(rtlpriv, REG_HISRE, tmp);
2265+
2266+
tmp = rtl_read_dword(rtlpriv, REG_HSISR);
2267+
rtl_write_dword(rtlpriv, REG_HSISR, tmp);
2268+
}
2269+
22562270
void rtl8821ae_enable_interrupt(struct ieee80211_hw *hw)
22572271
{
22582272
struct rtl_priv *rtlpriv = rtl_priv(hw);
22592273
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
22602274

2275+
if (!rtlpci->int_clear)
2276+
rtl8821ae_clear_interrupt(hw);/*clear it here first*/
2277+
22612278
rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF);
22622279
rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF);
22632280
rtlpci->irq_enabled = true;

drivers/net/wireless/rtlwifi/rtl8821ae/sw.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
9696

9797
rtl8821ae_bt_reg_init(hw);
9898
rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
99+
rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear;
99100
rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();
100101

101102
rtlpriv->dm.dm_initialgain_enable = 1;
@@ -167,6 +168,7 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
167168
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
168169
rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
169170
rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
171+
rtlpci->msi_support = rtlpriv->cfg->mod_params->int_clear;
170172
if (rtlpriv->cfg->mod_params->disable_watchdog)
171173
pr_info("watchdog disabled\n");
172174
rtlpriv->psc.reg_fwctrl_lps = 3;
@@ -308,6 +310,7 @@ static struct rtl_mod_params rtl8821ae_mod_params = {
308310
.swctrl_lps = false,
309311
.fwctrl_lps = true,
310312
.msi_support = true,
313+
.int_clear = true,
311314
.debug = DBG_EMERG,
312315
.disable_watchdog = 0,
313316
};
@@ -437,13 +440,15 @@ module_param_named(fwlps, rtl8821ae_mod_params.fwctrl_lps, bool, 0444);
437440
module_param_named(msi, rtl8821ae_mod_params.msi_support, bool, 0444);
438441
module_param_named(disable_watchdog, rtl8821ae_mod_params.disable_watchdog,
439442
bool, 0444);
443+
module_param_named(int_clear, rtl8821ae_mod_params.int_clear, bool, 0444);
440444
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
441445
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
442446
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
443447
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
444448
MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");
445449
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
446450
MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
451+
MODULE_PARM_DESC(int_clear, "Set to 1 to disable interrupt clear before set (default 0)\n");
447452

448453
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
449454

drivers/net/wireless/rtlwifi/wifi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,6 +2249,9 @@ struct rtl_mod_params {
22492249

22502250
/* default 0: 1 means disable */
22512251
bool disable_watchdog;
2252+
2253+
/* default 0: 1 means do not disable interrupts */
2254+
bool int_clear;
22522255
};
22532256

22542257
struct rtl_hal_usbint_cfg {

0 commit comments

Comments
 (0)