Skip to content

Commit 62e1de1

Browse files
author
Paolo Abeni
committed
Johannes Berg says: ==================== Some more fixes: - iwlwifi: fix 130/1030 devices - ath12k: fix alignment, power save - virt_wifi: fix crash - cfg80211: disable per-link stats due to buffer size issues * tag 'wireless-2025-09-11' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: nl80211: completely disable per-link stats for now wifi: virt_wifi: Fix page fault on connect wifi: cfg80211: Fix "no buffer space available" error in nl80211_get_station() for MLO wifi: iwlwifi: fix 130/1030 configs wifi: ath12k: fix WMI TLV header misalignment wifi: ath12k: Fix missing station power save configuration ==================== Link: https://patch.msgid.link/20250911100345.20025-3-johannes@sipsolutions.net Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents 9b1fbd3 + c3f8d13 commit 62e1de1

File tree

5 files changed

+91
-76
lines changed

5 files changed

+91
-76
lines changed

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 67 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4078,12 +4078,68 @@ static int ath12k_mac_fils_discovery(struct ath12k_link_vif *arvif,
40784078
return ret;
40794079
}
40804080

4081+
static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif)
4082+
{
4083+
struct ath12k *ar = arvif->ar;
4084+
struct ieee80211_vif *vif = arvif->ahvif->vif;
4085+
struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf;
4086+
enum wmi_sta_powersave_param param;
4087+
struct ieee80211_bss_conf *info;
4088+
enum wmi_sta_ps_mode psmode;
4089+
int ret;
4090+
int timeout;
4091+
bool enable_ps;
4092+
4093+
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
4094+
4095+
if (vif->type != NL80211_IFTYPE_STATION)
4096+
return;
4097+
4098+
enable_ps = arvif->ahvif->ps;
4099+
if (enable_ps) {
4100+
psmode = WMI_STA_PS_MODE_ENABLED;
4101+
param = WMI_STA_PS_PARAM_INACTIVITY_TIME;
4102+
4103+
timeout = conf->dynamic_ps_timeout;
4104+
if (timeout == 0) {
4105+
info = ath12k_mac_get_link_bss_conf(arvif);
4106+
if (!info) {
4107+
ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n",
4108+
vif->addr, arvif->link_id);
4109+
return;
4110+
}
4111+
4112+
/* firmware doesn't like 0 */
4113+
timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000;
4114+
}
4115+
4116+
ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
4117+
timeout);
4118+
if (ret) {
4119+
ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n",
4120+
arvif->vdev_id, ret);
4121+
return;
4122+
}
4123+
} else {
4124+
psmode = WMI_STA_PS_MODE_DISABLED;
4125+
}
4126+
4127+
ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n",
4128+
arvif->vdev_id, psmode ? "enable" : "disable");
4129+
4130+
ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode);
4131+
if (ret)
4132+
ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n",
4133+
psmode, arvif->vdev_id, ret);
4134+
}
4135+
40814136
static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,
40824137
struct ieee80211_vif *vif,
40834138
u64 changed)
40844139
{
40854140
struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
40864141
unsigned long links = ahvif->links_map;
4142+
struct ieee80211_vif_cfg *vif_cfg;
40874143
struct ieee80211_bss_conf *info;
40884144
struct ath12k_link_vif *arvif;
40894145
struct ieee80211_sta *sta;
@@ -4147,61 +4203,24 @@ static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,
41474203
}
41484204
}
41494205
}
4150-
}
4151-
4152-
static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif)
4153-
{
4154-
struct ath12k *ar = arvif->ar;
4155-
struct ieee80211_vif *vif = arvif->ahvif->vif;
4156-
struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf;
4157-
enum wmi_sta_powersave_param param;
4158-
struct ieee80211_bss_conf *info;
4159-
enum wmi_sta_ps_mode psmode;
4160-
int ret;
4161-
int timeout;
4162-
bool enable_ps;
41634206

4164-
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
4207+
if (changed & BSS_CHANGED_PS) {
4208+
links = ahvif->links_map;
4209+
vif_cfg = &vif->cfg;
41654210

4166-
if (vif->type != NL80211_IFTYPE_STATION)
4167-
return;
4211+
for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
4212+
arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]);
4213+
if (!arvif || !arvif->ar)
4214+
continue;
41684215

4169-
enable_ps = arvif->ahvif->ps;
4170-
if (enable_ps) {
4171-
psmode = WMI_STA_PS_MODE_ENABLED;
4172-
param = WMI_STA_PS_PARAM_INACTIVITY_TIME;
4216+
ar = arvif->ar;
41734217

4174-
timeout = conf->dynamic_ps_timeout;
4175-
if (timeout == 0) {
4176-
info = ath12k_mac_get_link_bss_conf(arvif);
4177-
if (!info) {
4178-
ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n",
4179-
vif->addr, arvif->link_id);
4180-
return;
4218+
if (ar->ab->hw_params->supports_sta_ps) {
4219+
ahvif->ps = vif_cfg->ps;
4220+
ath12k_mac_vif_setup_ps(arvif);
41814221
}
4182-
4183-
/* firmware doesn't like 0 */
4184-
timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000;
41854222
}
4186-
4187-
ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
4188-
timeout);
4189-
if (ret) {
4190-
ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n",
4191-
arvif->vdev_id, ret);
4192-
return;
4193-
}
4194-
} else {
4195-
psmode = WMI_STA_PS_MODE_DISABLED;
41964223
}
4197-
4198-
ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n",
4199-
arvif->vdev_id, psmode ? "enable" : "disable");
4200-
4201-
ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode);
4202-
if (ret)
4203-
ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n",
4204-
psmode, arvif->vdev_id, ret);
42054224
}
42064225

42074226
static bool ath12k_mac_supports_tpc(struct ath12k *ar, struct ath12k_vif *ahvif,
@@ -4223,7 +4242,6 @@ static void ath12k_mac_bss_info_changed(struct ath12k *ar,
42234242
{
42244243
struct ath12k_vif *ahvif = arvif->ahvif;
42254244
struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif);
4226-
struct ieee80211_vif_cfg *vif_cfg = &vif->cfg;
42274245
struct cfg80211_chan_def def;
42284246
u32 param_id, param_value;
42294247
enum nl80211_band band;
@@ -4510,12 +4528,6 @@ static void ath12k_mac_bss_info_changed(struct ath12k *ar,
45104528
}
45114529

45124530
ath12k_mac_fils_discovery(arvif, info);
4513-
4514-
if (changed & BSS_CHANGED_PS &&
4515-
ar->ab->hw_params->supports_sta_ps) {
4516-
ahvif->ps = vif_cfg->ps;
4517-
ath12k_mac_vif_setup_ps(arvif);
4518-
}
45194531
}
45204532

45214533
static struct ath12k_vif_cache *ath12k_ahvif_get_link_cache(struct ath12k_vif *ahvif,

drivers/net/wireless/ath/ath12k/wmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ int ath12k_wmi_mgmt_send(struct ath12k_link_vif *arvif, u32 buf_id,
843843
cmd->tx_params_valid = 0;
844844

845845
frame_tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd));
846-
frame_tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, buf_len);
846+
frame_tlv->header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, buf_len_aligned);
847847

848848
memcpy(frame_tlv->value, frame->data, buf_len);
849849

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct pci_device_id iwl_hw_card_ids[] = {
124124
{IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_mac_cfg)},/* low 5GHz active */
125125
{IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_mac_cfg)},/* high 5GHz active */
126126

127-
/* 6x30 Series */
128-
{IWL_PCI_DEVICE(0x008A, 0x5305, iwl1000_mac_cfg)},
129-
{IWL_PCI_DEVICE(0x008A, 0x5307, iwl1000_mac_cfg)},
130-
{IWL_PCI_DEVICE(0x008A, 0x5325, iwl1000_mac_cfg)},
131-
{IWL_PCI_DEVICE(0x008A, 0x5327, iwl1000_mac_cfg)},
132-
{IWL_PCI_DEVICE(0x008B, 0x5315, iwl1000_mac_cfg)},
133-
{IWL_PCI_DEVICE(0x008B, 0x5317, iwl1000_mac_cfg)},
127+
/* 1030/6x30 Series */
128+
{IWL_PCI_DEVICE(0x008A, 0x5305, iwl6030_mac_cfg)},
129+
{IWL_PCI_DEVICE(0x008A, 0x5307, iwl6030_mac_cfg)},
130+
{IWL_PCI_DEVICE(0x008A, 0x5325, iwl6030_mac_cfg)},
131+
{IWL_PCI_DEVICE(0x008A, 0x5327, iwl6030_mac_cfg)},
132+
{IWL_PCI_DEVICE(0x008B, 0x5315, iwl6030_mac_cfg)},
133+
{IWL_PCI_DEVICE(0x008B, 0x5317, iwl6030_mac_cfg)},
134134
{IWL_PCI_DEVICE(0x0090, 0x5211, iwl6030_mac_cfg)},
135135
{IWL_PCI_DEVICE(0x0090, 0x5215, iwl6030_mac_cfg)},
136136
{IWL_PCI_DEVICE(0x0090, 0x5216, iwl6030_mac_cfg)},
@@ -181,12 +181,12 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct pci_device_id iwl_hw_card_ids[] = {
181181
{IWL_PCI_DEVICE(0x08AE, 0x1027, iwl1000_mac_cfg)},
182182

183183
/* 130 Series WiFi */
184-
{IWL_PCI_DEVICE(0x0896, 0x5005, iwl1000_mac_cfg)},
185-
{IWL_PCI_DEVICE(0x0896, 0x5007, iwl1000_mac_cfg)},
186-
{IWL_PCI_DEVICE(0x0897, 0x5015, iwl1000_mac_cfg)},
187-
{IWL_PCI_DEVICE(0x0897, 0x5017, iwl1000_mac_cfg)},
188-
{IWL_PCI_DEVICE(0x0896, 0x5025, iwl1000_mac_cfg)},
189-
{IWL_PCI_DEVICE(0x0896, 0x5027, iwl1000_mac_cfg)},
184+
{IWL_PCI_DEVICE(0x0896, 0x5005, iwl6030_mac_cfg)},
185+
{IWL_PCI_DEVICE(0x0896, 0x5007, iwl6030_mac_cfg)},
186+
{IWL_PCI_DEVICE(0x0897, 0x5015, iwl6030_mac_cfg)},
187+
{IWL_PCI_DEVICE(0x0897, 0x5017, iwl6030_mac_cfg)},
188+
{IWL_PCI_DEVICE(0x0896, 0x5025, iwl6030_mac_cfg)},
189+
{IWL_PCI_DEVICE(0x0896, 0x5027, iwl6030_mac_cfg)},
190190

191191
/* 2x00 Series */
192192
{IWL_PCI_DEVICE(0x0890, 0x4022, iwl2000_mac_cfg)},

drivers/net/wireless/virtual/virt_wifi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ static void virt_wifi_connect_complete(struct work_struct *work)
277277
priv->is_connected = true;
278278

279279
/* Schedules an event that acquires the rtnl lock. */
280-
cfg80211_connect_result(priv->upperdev, requested_bss, NULL, 0, NULL, 0,
280+
cfg80211_connect_result(priv->upperdev,
281+
priv->is_connected ? fake_router_bssid : NULL,
282+
NULL, 0, NULL, 0,
281283
status, GFP_KERNEL);
282284
netif_carrier_on(priv->upperdev);
283285
}

net/wireless/nl80211.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7062,7 +7062,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
70627062
u32 seq, int flags,
70637063
struct cfg80211_registered_device *rdev,
70647064
struct net_device *dev,
7065-
const u8 *mac_addr, struct station_info *sinfo)
7065+
const u8 *mac_addr, struct station_info *sinfo,
7066+
bool link_stats)
70667067
{
70677068
void *hdr;
70687069
struct nlattr *sinfoattr, *bss_param;
@@ -7283,7 +7284,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
72837284
goto nla_put_failure;
72847285
}
72857286

7286-
if (sinfo->valid_links) {
7287+
if (link_stats && sinfo->valid_links) {
72877288
links = nla_nest_start(msg, NL80211_ATTR_MLO_LINKS);
72887289
if (!links)
72897290
goto nla_put_failure;
@@ -7574,7 +7575,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
75747575
NETLINK_CB(cb->skb).portid,
75757576
cb->nlh->nlmsg_seq, NLM_F_MULTI,
75767577
rdev, wdev->netdev, mac_addr,
7577-
&sinfo) < 0)
7578+
&sinfo, false) < 0)
75787579
goto out;
75797580

75807581
sta_idx++;
@@ -7635,7 +7636,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
76357636

76367637
if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION,
76377638
info->snd_portid, info->snd_seq, 0,
7638-
rdev, dev, mac_addr, &sinfo) < 0) {
7639+
rdev, dev, mac_addr, &sinfo, false) < 0) {
76397640
nlmsg_free(msg);
76407641
return -ENOBUFS;
76417642
}
@@ -19680,7 +19681,7 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
1968019681
return;
1968119682

1968219683
if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, 0, 0, 0,
19683-
rdev, dev, mac_addr, sinfo) < 0) {
19684+
rdev, dev, mac_addr, sinfo, false) < 0) {
1968419685
nlmsg_free(msg);
1968519686
return;
1968619687
}
@@ -19710,7 +19711,7 @@ void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr,
1971019711
}
1971119712

1971219713
if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0,
19713-
rdev, dev, mac_addr, sinfo) < 0) {
19714+
rdev, dev, mac_addr, sinfo, false) < 0) {
1971419715
nlmsg_free(msg);
1971519716
return;
1971619717
}

0 commit comments

Comments
 (0)