Commit cbeb1c1b authored by Jakub Kicinski's avatar Jakub Kicinski

Merge tag 'wireless-2023-04-05' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless

Kalle Valo says:

====================
wireless fixes for v6.3

mt76 has a fix for leaking cleartext frames on a certain scenario and
two firmware file handling related fixes. For brcmfmac we have a fix
for an older SDIO suspend regression and for ath11k avoiding a kernel
crash during hibernation with SUSE kernels.

* tag 'wireless-2023-04-05' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless:
  wifi: mt76: ignore key disable commands
  wifi: ath11k: reduce the MHI timeout to 20s
  wifi: mt76: mt7921: fix fw used for offload check for mt7922
  wifi: mt76: mt7921: Fix use-after-free in fw features query.
  wifi: brcmfmac: Fix SDIO suspend/resume regression
====================

Link: https://lore.kernel.org/r/20230405105536.4E946C433D2@smtp.kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents b97ee72a e6db67fa
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "pci.h" #include "pci.h"
#include "pcic.h" #include "pcic.h"
#define MHI_TIMEOUT_DEFAULT_MS 90000 #define MHI_TIMEOUT_DEFAULT_MS 20000
#define RDDM_DUMP_SIZE 0x420000 #define RDDM_DUMP_SIZE 0x420000
static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = { static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = {
......
...@@ -994,15 +994,34 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = { ...@@ -994,15 +994,34 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
static void brcmf_sdiod_acpi_set_power_manageable(struct device *dev, static void brcmf_sdiod_acpi_save_power_manageable(struct brcmf_sdio_dev *sdiodev)
int val)
{ {
#if IS_ENABLED(CONFIG_ACPI) #if IS_ENABLED(CONFIG_ACPI)
struct acpi_device *adev; struct acpi_device *adev;
adev = ACPI_COMPANION(dev); adev = ACPI_COMPANION(&sdiodev->func1->dev);
if (adev) if (adev)
adev->flags.power_manageable = 0; sdiodev->func1_power_manageable = adev->flags.power_manageable;
adev = ACPI_COMPANION(&sdiodev->func2->dev);
if (adev)
sdiodev->func2_power_manageable = adev->flags.power_manageable;
#endif
}
static void brcmf_sdiod_acpi_set_power_manageable(struct brcmf_sdio_dev *sdiodev,
int enable)
{
#if IS_ENABLED(CONFIG_ACPI)
struct acpi_device *adev;
adev = ACPI_COMPANION(&sdiodev->func1->dev);
if (adev)
adev->flags.power_manageable = enable ? sdiodev->func1_power_manageable : 0;
adev = ACPI_COMPANION(&sdiodev->func2->dev);
if (adev)
adev->flags.power_manageable = enable ? sdiodev->func2_power_manageable : 0;
#endif #endif
} }
...@@ -1012,7 +1031,6 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, ...@@ -1012,7 +1031,6 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
int err; int err;
struct brcmf_sdio_dev *sdiodev; struct brcmf_sdio_dev *sdiodev;
struct brcmf_bus *bus_if; struct brcmf_bus *bus_if;
struct device *dev;
brcmf_dbg(SDIO, "Enter\n"); brcmf_dbg(SDIO, "Enter\n");
brcmf_dbg(SDIO, "Class=%x\n", func->class); brcmf_dbg(SDIO, "Class=%x\n", func->class);
...@@ -1020,14 +1038,9 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, ...@@ -1020,14 +1038,9 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device); brcmf_dbg(SDIO, "sdio device ID: 0x%04x\n", func->device);
brcmf_dbg(SDIO, "Function#: %d\n", func->num); brcmf_dbg(SDIO, "Function#: %d\n", func->num);
dev = &func->dev;
/* Set MMC_QUIRK_LENIENT_FN0 for this card */ /* Set MMC_QUIRK_LENIENT_FN0 for this card */
func->card->quirks |= MMC_QUIRK_LENIENT_FN0; func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
/* prohibit ACPI power management for this device */
brcmf_sdiod_acpi_set_power_manageable(dev, 0);
/* Consume func num 1 but dont do anything with it. */ /* Consume func num 1 but dont do anything with it. */
if (func->num == 1) if (func->num == 1)
return 0; return 0;
...@@ -1059,6 +1072,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, ...@@ -1059,6 +1072,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
dev_set_drvdata(&sdiodev->func1->dev, bus_if); dev_set_drvdata(&sdiodev->func1->dev, bus_if);
sdiodev->dev = &sdiodev->func1->dev; sdiodev->dev = &sdiodev->func1->dev;
brcmf_sdiod_acpi_save_power_manageable(sdiodev);
brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN); brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN);
brcmf_dbg(SDIO, "F2 found, calling brcmf_sdiod_probe...\n"); brcmf_dbg(SDIO, "F2 found, calling brcmf_sdiod_probe...\n");
...@@ -1124,6 +1138,8 @@ void brcmf_sdio_wowl_config(struct device *dev, bool enabled) ...@@ -1124,6 +1138,8 @@ void brcmf_sdio_wowl_config(struct device *dev, bool enabled)
if (sdiodev->settings->bus.sdio.oob_irq_supported || if (sdiodev->settings->bus.sdio.oob_irq_supported ||
pm_caps & MMC_PM_WAKE_SDIO_IRQ) { pm_caps & MMC_PM_WAKE_SDIO_IRQ) {
/* Stop ACPI from turning off the device when wowl is enabled */
brcmf_sdiod_acpi_set_power_manageable(sdiodev, !enabled);
sdiodev->wowl_enabled = enabled; sdiodev->wowl_enabled = enabled;
brcmf_dbg(SDIO, "Configuring WOWL, enabled=%d\n", enabled); brcmf_dbg(SDIO, "Configuring WOWL, enabled=%d\n", enabled);
return; return;
......
...@@ -188,6 +188,8 @@ struct brcmf_sdio_dev { ...@@ -188,6 +188,8 @@ struct brcmf_sdio_dev {
char nvram_name[BRCMF_FW_NAME_LEN]; char nvram_name[BRCMF_FW_NAME_LEN];
char clm_name[BRCMF_FW_NAME_LEN]; char clm_name[BRCMF_FW_NAME_LEN];
bool wowl_enabled; bool wowl_enabled;
bool func1_power_manageable;
bool func2_power_manageable;
enum brcmf_sdiod_state state; enum brcmf_sdiod_state state;
struct brcmf_sdiod_freezer *freezer; struct brcmf_sdiod_freezer *freezer;
const struct firmware *clm_fw; const struct firmware *clm_fw;
......
...@@ -512,15 +512,15 @@ mt7603_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -512,15 +512,15 @@ mt7603_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (cmd == SET_KEY) { if (cmd != SET_KEY) {
key->hw_key_idx = wcid->idx;
wcid->hw_key_idx = idx;
} else {
if (idx == wcid->hw_key_idx) if (idx == wcid->hw_key_idx)
wcid->hw_key_idx = -1; wcid->hw_key_idx = -1;
key = NULL; return 0;
} }
key->hw_key_idx = wcid->idx;
wcid->hw_key_idx = idx;
mt76_wcid_key_setup(&dev->mt76, wcid, key); mt76_wcid_key_setup(&dev->mt76, wcid, key);
return mt7603_wtbl_set_key(dev, wcid->idx, key); return mt7603_wtbl_set_key(dev, wcid->idx, key);
......
...@@ -1193,8 +1193,7 @@ EXPORT_SYMBOL_GPL(mt7615_mac_enable_rtscts); ...@@ -1193,8 +1193,7 @@ EXPORT_SYMBOL_GPL(mt7615_mac_enable_rtscts);
static int static int
mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key,
enum mt76_cipher_type cipher, u16 cipher_mask, enum mt76_cipher_type cipher, u16 cipher_mask)
enum set_key_cmd cmd)
{ {
u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx) + 30 * 4; u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx) + 30 * 4;
u8 data[32] = {}; u8 data[32] = {};
...@@ -1203,27 +1202,18 @@ mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, ...@@ -1203,27 +1202,18 @@ mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid,
return -EINVAL; return -EINVAL;
mt76_rr_copy(dev, addr, data, sizeof(data)); mt76_rr_copy(dev, addr, data, sizeof(data));
if (cmd == SET_KEY) { if (cipher == MT_CIPHER_TKIP) {
if (cipher == MT_CIPHER_TKIP) { /* Rx/Tx MIC keys are swapped */
/* Rx/Tx MIC keys are swapped */ memcpy(data, key->key, 16);
memcpy(data, key->key, 16); memcpy(data + 16, key->key + 24, 8);
memcpy(data + 16, key->key + 24, 8); memcpy(data + 24, key->key + 16, 8);
memcpy(data + 24, key->key + 16, 8);
} else {
if (cipher_mask == BIT(cipher))
memcpy(data, key->key, key->keylen);
else if (cipher != MT_CIPHER_BIP_CMAC_128)
memcpy(data, key->key, 16);
if (cipher == MT_CIPHER_BIP_CMAC_128)
memcpy(data + 16, key->key, 16);
}
} else { } else {
if (cipher_mask == BIT(cipher))
memcpy(data, key->key, key->keylen);
else if (cipher != MT_CIPHER_BIP_CMAC_128)
memcpy(data, key->key, 16);
if (cipher == MT_CIPHER_BIP_CMAC_128) if (cipher == MT_CIPHER_BIP_CMAC_128)
memset(data + 16, 0, 16); memcpy(data + 16, key->key, 16);
else if (cipher_mask)
memset(data, 0, 16);
if (!cipher_mask)
memset(data, 0, sizeof(data));
} }
mt76_wr_copy(dev, addr, data, sizeof(data)); mt76_wr_copy(dev, addr, data, sizeof(data));
...@@ -1234,7 +1224,7 @@ mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, ...@@ -1234,7 +1224,7 @@ mt7615_mac_wtbl_update_key(struct mt7615_dev *dev, struct mt76_wcid *wcid,
static int static int
mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid, mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid,
enum mt76_cipher_type cipher, u16 cipher_mask, enum mt76_cipher_type cipher, u16 cipher_mask,
int keyidx, enum set_key_cmd cmd) int keyidx)
{ {
u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx), w0, w1; u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx), w0, w1;
...@@ -1253,9 +1243,7 @@ mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid, ...@@ -1253,9 +1243,7 @@ mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid,
else else
w0 &= ~MT_WTBL_W0_RX_IK_VALID; w0 &= ~MT_WTBL_W0_RX_IK_VALID;
if (cmd == SET_KEY && if (cipher != MT_CIPHER_BIP_CMAC_128 || cipher_mask == BIT(cipher)) {
(cipher != MT_CIPHER_BIP_CMAC_128 ||
cipher_mask == BIT(cipher))) {
w0 &= ~MT_WTBL_W0_KEY_IDX; w0 &= ~MT_WTBL_W0_KEY_IDX;
w0 |= FIELD_PREP(MT_WTBL_W0_KEY_IDX, keyidx); w0 |= FIELD_PREP(MT_WTBL_W0_KEY_IDX, keyidx);
} }
...@@ -1272,19 +1260,10 @@ mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid, ...@@ -1272,19 +1260,10 @@ mt7615_mac_wtbl_update_pk(struct mt7615_dev *dev, struct mt76_wcid *wcid,
static void static void
mt7615_mac_wtbl_update_cipher(struct mt7615_dev *dev, struct mt76_wcid *wcid, mt7615_mac_wtbl_update_cipher(struct mt7615_dev *dev, struct mt76_wcid *wcid,
enum mt76_cipher_type cipher, u16 cipher_mask, enum mt76_cipher_type cipher, u16 cipher_mask)
enum set_key_cmd cmd)
{ {
u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx); u32 addr = mt7615_mac_wtbl_addr(dev, wcid->idx);
if (!cipher_mask) {
mt76_clear(dev, addr + 2 * 4, MT_WTBL_W2_KEY_TYPE);
return;
}
if (cmd != SET_KEY)
return;
if (cipher == MT_CIPHER_BIP_CMAC_128 && if (cipher == MT_CIPHER_BIP_CMAC_128 &&
cipher_mask & ~BIT(MT_CIPHER_BIP_CMAC_128)) cipher_mask & ~BIT(MT_CIPHER_BIP_CMAC_128))
return; return;
...@@ -1295,8 +1274,7 @@ mt7615_mac_wtbl_update_cipher(struct mt7615_dev *dev, struct mt76_wcid *wcid, ...@@ -1295,8 +1274,7 @@ mt7615_mac_wtbl_update_cipher(struct mt7615_dev *dev, struct mt76_wcid *wcid,
int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev,
struct mt76_wcid *wcid, struct mt76_wcid *wcid,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key)
enum set_key_cmd cmd)
{ {
enum mt76_cipher_type cipher; enum mt76_cipher_type cipher;
u16 cipher_mask = wcid->cipher; u16 cipher_mask = wcid->cipher;
...@@ -1306,19 +1284,14 @@ int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, ...@@ -1306,19 +1284,14 @@ int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev,
if (cipher == MT_CIPHER_NONE) if (cipher == MT_CIPHER_NONE)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (cmd == SET_KEY) cipher_mask |= BIT(cipher);
cipher_mask |= BIT(cipher); mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask);
else err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask);
cipher_mask &= ~BIT(cipher);
mt7615_mac_wtbl_update_cipher(dev, wcid, cipher, cipher_mask, cmd);
err = mt7615_mac_wtbl_update_key(dev, wcid, key, cipher, cipher_mask,
cmd);
if (err < 0) if (err < 0)
return err; return err;
err = mt7615_mac_wtbl_update_pk(dev, wcid, cipher, cipher_mask, err = mt7615_mac_wtbl_update_pk(dev, wcid, cipher, cipher_mask,
key->keyidx, cmd); key->keyidx);
if (err < 0) if (err < 0)
return err; return err;
...@@ -1329,13 +1302,12 @@ int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, ...@@ -1329,13 +1302,12 @@ int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev,
int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev,
struct mt76_wcid *wcid, struct mt76_wcid *wcid,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key)
enum set_key_cmd cmd)
{ {
int err; int err;
spin_lock_bh(&dev->mt76.lock); spin_lock_bh(&dev->mt76.lock);
err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); err = __mt7615_mac_wtbl_set_key(dev, wcid, key);
spin_unlock_bh(&dev->mt76.lock); spin_unlock_bh(&dev->mt76.lock);
return err; return err;
......
...@@ -391,18 +391,17 @@ static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -391,18 +391,17 @@ static int mt7615_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
if (cmd == SET_KEY) if (cmd == SET_KEY)
*wcid_keyidx = idx; *wcid_keyidx = idx;
else if (idx == *wcid_keyidx) else {
*wcid_keyidx = -1; if (idx == *wcid_keyidx)
else *wcid_keyidx = -1;
goto out; goto out;
}
mt76_wcid_key_setup(&dev->mt76, wcid, mt76_wcid_key_setup(&dev->mt76, wcid, key);
cmd == SET_KEY ? key : NULL);
if (mt76_is_mmio(&dev->mt76)) if (mt76_is_mmio(&dev->mt76))
err = mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); err = mt7615_mac_wtbl_set_key(dev, wcid, key);
else else
err = __mt7615_mac_wtbl_set_key(dev, wcid, key, cmd); err = __mt7615_mac_wtbl_set_key(dev, wcid, key);
out: out:
mt7615_mutex_release(dev); mt7615_mutex_release(dev);
......
...@@ -490,11 +490,9 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, ...@@ -490,11 +490,9 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
void mt7615_mac_set_timing(struct mt7615_phy *phy); void mt7615_mac_set_timing(struct mt7615_phy *phy);
int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev,
struct mt76_wcid *wcid, struct mt76_wcid *wcid,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key);
enum set_key_cmd cmd);
int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid,
struct ieee80211_key_conf *key, struct ieee80211_key_conf *key);
enum set_key_cmd cmd);
void mt7615_mac_reset_work(struct work_struct *work); void mt7615_mac_reset_work(struct work_struct *work);
u32 mt7615_mac_get_sta_tid_sn(struct mt7615_dev *dev, int wcid, u8 tid); u32 mt7615_mac_get_sta_tid_sn(struct mt7615_dev *dev, int wcid, u8 tid);
......
...@@ -454,20 +454,20 @@ int mt76x02_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -454,20 +454,20 @@ int mt76x02_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
msta = sta ? (struct mt76x02_sta *)sta->drv_priv : NULL; msta = sta ? (struct mt76x02_sta *)sta->drv_priv : NULL;
wcid = msta ? &msta->wcid : &mvif->group_wcid; wcid = msta ? &msta->wcid : &mvif->group_wcid;
if (cmd == SET_KEY) { if (cmd != SET_KEY) {
key->hw_key_idx = wcid->idx;
wcid->hw_key_idx = idx;
if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) {
key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
wcid->sw_iv = true;
}
} else {
if (idx == wcid->hw_key_idx) { if (idx == wcid->hw_key_idx) {
wcid->hw_key_idx = -1; wcid->hw_key_idx = -1;
wcid->sw_iv = false; wcid->sw_iv = false;
} }
key = NULL; return 0;
}
key->hw_key_idx = wcid->idx;
wcid->hw_key_idx = idx;
if (key->flags & IEEE80211_KEY_FLAG_RX_MGMT) {
key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
wcid->sw_iv = true;
} }
mt76_wcid_key_setup(&dev->mt76, wcid, key); mt76_wcid_key_setup(&dev->mt76, wcid, key);
......
...@@ -410,16 +410,15 @@ static int mt7915_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -410,16 +410,15 @@ static int mt7915_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
mt7915_mcu_add_bss_info(phy, vif, true); mt7915_mcu_add_bss_info(phy, vif, true);
} }
if (cmd == SET_KEY) if (cmd == SET_KEY) {
*wcid_keyidx = idx; *wcid_keyidx = idx;
else if (idx == *wcid_keyidx) } else {
*wcid_keyidx = -1; if (idx == *wcid_keyidx)
else *wcid_keyidx = -1;
goto out; goto out;
}
mt76_wcid_key_setup(&dev->mt76, wcid, mt76_wcid_key_setup(&dev->mt76, wcid, key);
cmd == SET_KEY ? key : NULL);
err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip,
key, MCU_EXT_CMD(STA_REC_UPDATE), key, MCU_EXT_CMD(STA_REC_UPDATE),
&msta->wcid, cmd); &msta->wcid, cmd);
......
...@@ -171,12 +171,12 @@ mt7921_mac_init_band(struct mt7921_dev *dev, u8 band) ...@@ -171,12 +171,12 @@ mt7921_mac_init_band(struct mt7921_dev *dev, u8 band)
u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm) u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
{ {
struct mt7921_fw_features *features = NULL;
const struct mt76_connac2_fw_trailer *hdr; const struct mt76_connac2_fw_trailer *hdr;
struct mt7921_realease_info *rel_info; struct mt7921_realease_info *rel_info;
const struct firmware *fw; const struct firmware *fw;
int ret, i, offset = 0; int ret, i, offset = 0;
const u8 *data, *end; const u8 *data, *end;
u8 offload_caps = 0;
ret = request_firmware(&fw, fw_wm, dev); ret = request_firmware(&fw, fw_wm, dev);
if (ret) if (ret)
...@@ -208,7 +208,10 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm) ...@@ -208,7 +208,10 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
data += sizeof(*rel_info); data += sizeof(*rel_info);
if (rel_info->tag == MT7921_FW_TAG_FEATURE) { if (rel_info->tag == MT7921_FW_TAG_FEATURE) {
struct mt7921_fw_features *features;
features = (struct mt7921_fw_features *)data; features = (struct mt7921_fw_features *)data;
offload_caps = features->data;
break; break;
} }
...@@ -218,7 +221,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm) ...@@ -218,7 +221,7 @@ u8 mt7921_check_offload_capability(struct device *dev, const char *fw_wm)
out: out:
release_firmware(fw); release_firmware(fw);
return features ? features->data : 0; return offload_caps;
} }
EXPORT_SYMBOL_GPL(mt7921_check_offload_capability); EXPORT_SYMBOL_GPL(mt7921_check_offload_capability);
......
...@@ -569,16 +569,15 @@ static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -569,16 +569,15 @@ static int mt7921_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
mt7921_mutex_acquire(dev); mt7921_mutex_acquire(dev);
if (cmd == SET_KEY) if (cmd == SET_KEY) {
*wcid_keyidx = idx; *wcid_keyidx = idx;
else if (idx == *wcid_keyidx) } else {
*wcid_keyidx = -1; if (idx == *wcid_keyidx)
else *wcid_keyidx = -1;
goto out; goto out;
}
mt76_wcid_key_setup(&dev->mt76, wcid, mt76_wcid_key_setup(&dev->mt76, wcid, key);
cmd == SET_KEY ? key : NULL);
err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip,
key, MCU_UNI_CMD(STA_REC_UPDATE), key, MCU_UNI_CMD(STA_REC_UPDATE),
&msta->wcid, cmd); &msta->wcid, cmd);
......
...@@ -20,7 +20,7 @@ static const struct pci_device_id mt7921_pci_device_table[] = { ...@@ -20,7 +20,7 @@ static const struct pci_device_id mt7921_pci_device_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0608), { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0608),
.driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM }, .driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM },
{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0616), { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0616),
.driver_data = (kernel_ulong_t)MT7921_FIRMWARE_WM }, .driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM },
{ }, { },
}; };
......
...@@ -351,16 +351,15 @@ static int mt7996_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -351,16 +351,15 @@ static int mt7996_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
mt7996_mcu_add_bss_info(phy, vif, true); mt7996_mcu_add_bss_info(phy, vif, true);
} }
if (cmd == SET_KEY) if (cmd == SET_KEY) {
*wcid_keyidx = idx; *wcid_keyidx = idx;
else if (idx == *wcid_keyidx) } else {
*wcid_keyidx = -1; if (idx == *wcid_keyidx)
else *wcid_keyidx = -1;
goto out; goto out;
}
mt76_wcid_key_setup(&dev->mt76, wcid, mt76_wcid_key_setup(&dev->mt76, wcid, key);
cmd == SET_KEY ? key : NULL);
err = mt7996_mcu_add_key(&dev->mt76, vif, &msta->bip, err = mt7996_mcu_add_key(&dev->mt76, vif, &msta->bip,
key, MCU_WMWA_UNI_CMD(STA_REC_UPDATE), key, MCU_WMWA_UNI_CMD(STA_REC_UPDATE),
&msta->wcid, cmd); &msta->wcid, cmd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment