Skip to content

Commit

Permalink
Merge tag 'wireless-2023-05-17' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/wireless/wireless

Kalle Valo says:

====================
wireless fixes for v6.4

A lot of fixes this time, for both the stack and the drivers. The
brcmfmac resume fix has been reported by several people so I would say
it's the most important here. The iwlwifi RFI workaround is also
something which was reported as a regression recently.

* tag 'wireless-2023-05-17' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: (31 commits)
  wifi: b43: fix incorrect __packed annotation
  wifi: rtw88: sdio: Always use two consecutive bytes for word operations
  mac80211_hwsim: fix memory leak in hwsim_new_radio_nl
  wifi: iwlwifi: mvm: Add locking to the rate read flow
  wifi: iwlwifi: Don't use valid_links to iterate sta links
  wifi: iwlwifi: mvm: don't trust firmware n_channels
  wifi: iwlwifi: mvm: fix OEM's name in the tas approved list
  wifi: iwlwifi: fix OEM's name in the ppag approved list
  wifi: iwlwifi: mvm: fix initialization of a return value
  wifi: iwlwifi: mvm: fix access to fw_id_to_mac_id
  wifi: iwlwifi: fw: fix DBGI dump
  wifi: iwlwifi: mvm: fix number of concurrent link checks
  wifi: iwlwifi: mvm: fix cancel_delayed_work_sync() deadlock
  wifi: iwlwifi: mvm: don't double-init spinlock
  wifi: iwlwifi: mvm: always free dup_data
  wifi: mac80211: recalc chanctx mindef before assigning
  wifi: mac80211: consider reserved chanctx for mindef
  wifi: mac80211: simplify chanctx allocation
  wifi: mac80211: Abort running color change when stopping the AP
  wifi: mac80211: fix min center freq offset tracing
  ...
====================

Link: https://lore.kernel.org/r/20230517151914.B0AF6C433EF@smtp.kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed May 18, 2023
2 parents bfa00d8 + 212457c commit c259ad1
Show file tree
Hide file tree
Showing 41 changed files with 249 additions and 136 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/broadcom/b43/b43.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ struct b43_iv {
union {
__be16 d16;
__be32 d32;
} data __packed;
} __packed data;
} __packed;


Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/broadcom/b43legacy/b43legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ struct b43legacy_iv {
union {
__be16 d16;
__be32 d32;
} data __packed;
} __packed data;
} __packed;

#define B43legacy_PHYMODE(phytype) (1 << (phytype))
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,11 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
struct brcmf_sdio_dev *sdiodev;
struct brcmf_bus *bus_if;

if (!id) {
dev_err(&func->dev, "Error no sdio_device_id passed for %x:%x\n", func->vendor, func->device);
return -ENODEV;
}

brcmf_dbg(SDIO, "Enter\n");
brcmf_dbg(SDIO, "Class=%x\n", func->class);
brcmf_dbg(SDIO, "sdio vendor ID: 0x%04x\n", func->vendor);
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -2394,6 +2394,9 @@ static void brcmf_pcie_debugfs_create(struct device *dev)
}
#endif

/* Forward declaration for pci_match_id() call */
static const struct pci_device_id brcmf_pcie_devid_table[];

static int
brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
Expand All @@ -2404,6 +2407,14 @@ brcmf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
struct brcmf_core *core;
struct brcmf_bus *bus;

if (!id) {
id = pci_match_id(brcmf_pcie_devid_table, pdev);
if (!id) {
pci_err(pdev, "Error could not find pci_device_id for %x:%x\n", pdev->vendor, pdev->device);
return -ENODEV;
}
}

brcmf_dbg(PCIE, "Enter %x:%x\n", pdev->vendor, pdev->device);

ret = -ENOMEM;
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,9 @@ brcmf_usb_disconnect_cb(struct brcmf_usbdev_info *devinfo)
brcmf_usb_detach(devinfo);
}

/* Forward declaration for usb_match_id() call */
static const struct usb_device_id brcmf_usb_devid_table[];

static int
brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
Expand All @@ -1342,6 +1345,14 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
u32 num_of_eps;
u8 endpoint_num, ep;

if (!id) {
id = usb_match_id(intf, brcmf_usb_devid_table);
if (!id) {
dev_err(&intf->dev, "Error could not find matching usb_device_id\n");
return -ENODEV;
}
}

brcmf_dbg(USB, "Enter 0x%04x:0x%04x\n", id->idVendor, id->idProduct);

devinfo = kzalloc(sizeof(*devinfo), GFP_ATOMIC);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/intel/iwlwifi/fw/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static const struct dmi_system_id dmi_ppag_approved_list[] = {
},
{ .ident = "ASUS",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTek COMPUTER INC."),
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
},
},
{}
Expand Down
19 changes: 11 additions & 8 deletions drivers/net/wireless/intel/iwlwifi/fw/dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,14 +1664,10 @@ static __le32 iwl_get_mon_reg(struct iwl_fw_runtime *fwrt, u32 alloc_id,
}

static void *
iwl_dump_ini_mon_fill_header(struct iwl_fw_runtime *fwrt,
struct iwl_dump_ini_region_data *reg_data,
iwl_dump_ini_mon_fill_header(struct iwl_fw_runtime *fwrt, u32 alloc_id,
struct iwl_fw_ini_monitor_dump *data,
const struct iwl_fw_mon_regs *addrs)
{
struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data;
u32 alloc_id = le32_to_cpu(reg->dram_alloc_id);

if (!iwl_trans_grab_nic_access(fwrt->trans)) {
IWL_ERR(fwrt, "Failed to get monitor header\n");
return NULL;
Expand Down Expand Up @@ -1702,8 +1698,10 @@ iwl_dump_ini_mon_dram_fill_header(struct iwl_fw_runtime *fwrt,
void *data, u32 data_len)
{
struct iwl_fw_ini_monitor_dump *mon_dump = (void *)data;
struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data;
u32 alloc_id = le32_to_cpu(reg->dram_alloc_id);

return iwl_dump_ini_mon_fill_header(fwrt, reg_data, mon_dump,
return iwl_dump_ini_mon_fill_header(fwrt, alloc_id, mon_dump,
&fwrt->trans->cfg->mon_dram_regs);
}

Expand All @@ -1713,8 +1711,10 @@ iwl_dump_ini_mon_smem_fill_header(struct iwl_fw_runtime *fwrt,
void *data, u32 data_len)
{
struct iwl_fw_ini_monitor_dump *mon_dump = (void *)data;
struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data;
u32 alloc_id = le32_to_cpu(reg->internal_buffer.alloc_id);

return iwl_dump_ini_mon_fill_header(fwrt, reg_data, mon_dump,
return iwl_dump_ini_mon_fill_header(fwrt, alloc_id, mon_dump,
&fwrt->trans->cfg->mon_smem_regs);
}

Expand All @@ -1725,7 +1725,10 @@ iwl_dump_ini_mon_dbgi_fill_header(struct iwl_fw_runtime *fwrt,
{
struct iwl_fw_ini_monitor_dump *mon_dump = (void *)data;

return iwl_dump_ini_mon_fill_header(fwrt, reg_data, mon_dump,
return iwl_dump_ini_mon_fill_header(fwrt,
/* no offset calculation later */
IWL_FW_INI_ALLOCATION_ID_DBGC1,
mon_dump,
&fwrt->trans->cfg->mon_dbgi_regs);
}

Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,11 @@ iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
rcu_read_lock();

sta = rcu_dereference(mvm->fw_id_to_mac_id[mvmvif->deflink.ap_sta_id]);
if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta))) {
rcu_read_unlock();
return PTR_ERR_OR_ZERO(sta);
}

if (sta->mfp && (peer->ftm.trigger_based || peer->ftm.non_trigger_based))
FTM_PUT_FLAG(PMF);

Expand Down
5 changes: 2 additions & 3 deletions drivers/net/wireless/intel/iwlwifi/mvm/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ static const struct dmi_system_id dmi_tas_approved_list[] = {
},
{ .ident = "LENOVO",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Lenovo"),
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
},
},
{ .ident = "DELL",
Expand Down Expand Up @@ -1727,8 +1727,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
iwl_mvm_tas_init(mvm);
iwl_mvm_leds_sync(mvm);

if (fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_RFIM_SUPPORT)) {
if (iwl_rfi_supported(mvm)) {
if (iwl_mvm_eval_dsm_rfi(mvm) == DSM_VALUE_RFI_ENABLE)
iwl_rfi_send_config_cmd(mvm, NULL);
}
Expand Down
12 changes: 7 additions & 5 deletions drivers/net/wireless/intel/iwlwifi/mvm/link.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,13 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
if (mvmvif->link[i]->phy_ctxt)
count++;

/* FIXME: IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM should be
* defined per HW
*/
if (count >= IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM)
return -EINVAL;
if (vif->type == NL80211_IFTYPE_AP) {
if (count > mvm->fw->ucode_capa.num_beacons)
return -EOPNOTSUPP;
/* this should be per HW or such */
} else if (count >= IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM) {
return -EOPNOTSUPP;
}
}

/* Catch early if driver tries to activate or deactivate a link
Expand Down
55 changes: 25 additions & 30 deletions drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Copyright (C) 2012-2014, 2018-2022 Intel Corporation
* Copyright (C) 2012-2014, 2018-2023 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
Expand Down Expand Up @@ -3607,7 +3607,8 @@ static bool iwl_mvm_vif_conf_from_sta(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
unsigned int i;
struct ieee80211_link_sta *link_sta;
unsigned int link_id;

/* Beacon interval check - firmware will crash if the beacon
* interval is less than 16. We can't avoid connecting at all,
Expand All @@ -3616,14 +3617,11 @@ static bool iwl_mvm_vif_conf_from_sta(struct iwl_mvm *mvm,
* wpa_s will blocklist the AP...
*/

for_each_set_bit(i, (unsigned long *)&sta->valid_links,
IEEE80211_MLD_MAX_NUM_LINKS) {
struct ieee80211_link_sta *link_sta =
link_sta_dereference_protected(sta, i);
for_each_sta_active_link(vif, sta, link_sta, link_id) {
struct ieee80211_bss_conf *link_conf =
link_conf_dereference_protected(vif, i);
link_conf_dereference_protected(vif, link_id);

if (!link_conf || !link_sta)
if (!link_conf)
continue;

if (link_conf->beacon_int < IWL_MVM_MIN_BEACON_INTERVAL_TU) {
Expand All @@ -3645,24 +3643,23 @@ static void iwl_mvm_vif_set_he_support(struct ieee80211_hw *hw,
bool is_sta)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
unsigned int i;
struct ieee80211_link_sta *link_sta;
unsigned int link_id;

for_each_set_bit(i, (unsigned long *)&sta->valid_links,
IEEE80211_MLD_MAX_NUM_LINKS) {
struct ieee80211_link_sta *link_sta =
link_sta_dereference_protected(sta, i);
for_each_sta_active_link(vif, sta, link_sta, link_id) {
struct ieee80211_bss_conf *link_conf =
link_conf_dereference_protected(vif, i);
link_conf_dereference_protected(vif, link_id);

if (!link_conf || !link_sta || !mvmvif->link[i])
if (!link_conf || !mvmvif->link[link_id])
continue;

link_conf->he_support = link_sta->he_cap.has_he;

if (is_sta) {
mvmvif->link[i]->he_ru_2mhz_block = false;
mvmvif->link[link_id]->he_ru_2mhz_block = false;
if (link_sta->he_cap.has_he)
iwl_mvm_check_he_obss_narrow_bw_ru(hw, vif, i,
iwl_mvm_check_he_obss_narrow_bw_ru(hw, vif,
link_id,
link_conf);
}
}
Expand All @@ -3675,6 +3672,7 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,
struct iwl_mvm_sta_state_ops *callbacks)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct ieee80211_link_sta *link_sta;
unsigned int i;
int ret;

Expand All @@ -3699,15 +3697,9 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,
NL80211_TDLS_SETUP);
}

for (i = 0; i < ARRAY_SIZE(sta->link); i++) {
struct ieee80211_link_sta *link_sta;

link_sta = link_sta_dereference_protected(sta, i);
if (!link_sta)
continue;

for_each_sta_active_link(vif, sta, link_sta, i)
link_sta->agg.max_rc_amsdu_len = 1;
}

ieee80211_sta_recalc_aggregates(sta);

if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
Expand All @@ -3725,7 +3717,8 @@ iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw,
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
unsigned int i;
struct ieee80211_link_sta *link_sta;
unsigned int link_id;

lockdep_assert_held(&mvm->mutex);

Expand All @@ -3751,14 +3744,13 @@ iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw,
if (!mvm->mld_api_is_used)
goto out;

for_each_set_bit(i, (unsigned long *)&sta->valid_links,
IEEE80211_MLD_MAX_NUM_LINKS) {
for_each_sta_active_link(vif, sta, link_sta, link_id) {
struct ieee80211_bss_conf *link_conf =
link_conf_dereference_protected(vif, i);
link_conf_dereference_protected(vif, link_id);

if (WARN_ON(!link_conf))
return -EINVAL;
if (!mvmvif->link[i])
if (!mvmvif->link[link_id])
continue;

iwl_mvm_link_changed(mvm, vif, link_conf,
Expand Down Expand Up @@ -3889,6 +3881,9 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,
* from the AP now.
*/
iwl_mvm_reset_cca_40mhz_workaround(mvm, vif);

/* Also free dup data just in case any assertions below fail */
kfree(mvm_sta->dup_data);
}

mutex_lock(&mvm->mutex);
Expand Down
9 changes: 5 additions & 4 deletions drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,11 +906,12 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
n_active++;
}

if (vif->type == NL80211_IFTYPE_AP &&
n_active > mvm->fw->ucode_capa.num_beacons)
return -EOPNOTSUPP;
else if (n_active > 1)
if (vif->type == NL80211_IFTYPE_AP) {
if (n_active > mvm->fw->ucode_capa.num_beacons)
return -EOPNOTSUPP;
} else if (n_active > 1) {
return -EOPNOTSUPP;
}
}

for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
Expand Down
14 changes: 6 additions & 8 deletions drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,15 +667,15 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
ret = iwl_mvm_mld_alloc_sta_links(mvm, vif, sta);
if (ret)
return ret;
}

spin_lock_init(&mvm_sta->lock);
spin_lock_init(&mvm_sta->lock);

if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta);
else
ret = iwl_mvm_sta_init(mvm, vif, sta, IWL_MVM_INVALID_STA,
STATION_TYPE_PEER);
} else {
ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta);
}

if (ret)
goto err;

Expand Down Expand Up @@ -728,7 +728,7 @@ int iwl_mvm_mld_update_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
struct ieee80211_link_sta *link_sta;
unsigned int link_id;
int ret = 0;
int ret = -EINVAL;

lockdep_assert_held(&mvm->mutex);

Expand Down Expand Up @@ -791,8 +791,6 @@ int iwl_mvm_mld_rm_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,

lockdep_assert_held(&mvm->mutex);

kfree(mvm_sta->dup_data);

/* flush its queues here since we are freeing mvm_sta */
for_each_sta_active_link(vif, sta, link_sta, link_id) {
struct iwl_mvm_link_sta *mvm_link_sta =
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2347,6 +2347,7 @@ int iwl_mvm_mld_update_sta_keys(struct iwl_mvm *mvm,
u32 old_sta_mask,
u32 new_sta_mask);

bool iwl_rfi_supported(struct iwl_mvm *mvm);
int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm,
struct iwl_rfi_lut_entry *rfi_table);
struct iwl_rfi_freq_table_resp_cmd *iwl_rfi_get_freq_table(struct iwl_mvm *mvm);
Expand Down
Loading

0 comments on commit c259ad1

Please sign in to comment.