Commit 62e1de1d authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge tag 'wireless-2025-09-11' of...

Merge tag 'wireless-2025-09-11' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless

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: default avatarPaolo Abeni <pabeni@redhat.com>
parents 9b1fbd35 c3f8d133
Loading
Loading
Loading
Loading
+67 −55
Original line number Diff line number Diff line
@@ -4078,12 +4078,68 @@ static int ath12k_mac_fils_discovery(struct ath12k_link_vif *arvif,
	return ret;
}

static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif)
{
	struct ath12k *ar = arvif->ar;
	struct ieee80211_vif *vif = arvif->ahvif->vif;
	struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf;
	enum wmi_sta_powersave_param param;
	struct ieee80211_bss_conf *info;
	enum wmi_sta_ps_mode psmode;
	int ret;
	int timeout;
	bool enable_ps;

	lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);

	if (vif->type != NL80211_IFTYPE_STATION)
		return;

	enable_ps = arvif->ahvif->ps;
	if (enable_ps) {
		psmode = WMI_STA_PS_MODE_ENABLED;
		param = WMI_STA_PS_PARAM_INACTIVITY_TIME;

		timeout = conf->dynamic_ps_timeout;
		if (timeout == 0) {
			info = ath12k_mac_get_link_bss_conf(arvif);
			if (!info) {
				ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n",
					    vif->addr, arvif->link_id);
				return;
			}

			/* firmware doesn't like 0 */
			timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000;
		}

		ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
						  timeout);
		if (ret) {
			ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n",
				    arvif->vdev_id, ret);
			return;
		}
	} else {
		psmode = WMI_STA_PS_MODE_DISABLED;
	}

	ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n",
		   arvif->vdev_id, psmode ? "enable" : "disable");

	ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode);
	if (ret)
		ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n",
			    psmode, arvif->vdev_id, ret);
}

static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,
					  struct ieee80211_vif *vif,
					  u64 changed)
{
	struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
	unsigned long links = ahvif->links_map;
	struct ieee80211_vif_cfg *vif_cfg;
	struct ieee80211_bss_conf *info;
	struct ath12k_link_vif *arvif;
	struct ieee80211_sta *sta;
@@ -4147,61 +4203,24 @@ static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,
			}
		}
	}
}

static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif)
{
	struct ath12k *ar = arvif->ar;
	struct ieee80211_vif *vif = arvif->ahvif->vif;
	struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf;
	enum wmi_sta_powersave_param param;
	struct ieee80211_bss_conf *info;
	enum wmi_sta_ps_mode psmode;
	int ret;
	int timeout;
	bool enable_ps;

	lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);

	if (vif->type != NL80211_IFTYPE_STATION)
		return;
	if (changed & BSS_CHANGED_PS) {
		links = ahvif->links_map;
		vif_cfg = &vif->cfg;

	enable_ps = arvif->ahvif->ps;
	if (enable_ps) {
		psmode = WMI_STA_PS_MODE_ENABLED;
		param = WMI_STA_PS_PARAM_INACTIVITY_TIME;
		for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
			arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]);
			if (!arvif || !arvif->ar)
				continue;

		timeout = conf->dynamic_ps_timeout;
		if (timeout == 0) {
			info = ath12k_mac_get_link_bss_conf(arvif);
			if (!info) {
				ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n",
					    vif->addr, arvif->link_id);
				return;
			}
			ar = arvif->ar;

			/* firmware doesn't like 0 */
			timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000;
			if (ar->ab->hw_params->supports_sta_ps) {
				ahvif->ps = vif_cfg->ps;
				ath12k_mac_vif_setup_ps(arvif);
			}

		ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
						  timeout);
		if (ret) {
			ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n",
				    arvif->vdev_id, ret);
			return;
		}
	} else {
		psmode = WMI_STA_PS_MODE_DISABLED;
	}

	ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n",
		   arvif->vdev_id, psmode ? "enable" : "disable");

	ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode);
	if (ret)
		ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n",
			    psmode, arvif->vdev_id, ret);
}

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,
{
	struct ath12k_vif *ahvif = arvif->ahvif;
	struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif);
	struct ieee80211_vif_cfg *vif_cfg = &vif->cfg;
	struct cfg80211_chan_def def;
	u32 param_id, param_value;
	enum nl80211_band band;
@@ -4510,12 +4528,6 @@ static void ath12k_mac_bss_info_changed(struct ath12k *ar,
	}

	ath12k_mac_fils_discovery(arvif, info);

	if (changed & BSS_CHANGED_PS &&
	    ar->ab->hw_params->supports_sta_ps) {
		ahvif->ps = vif_cfg->ps;
		ath12k_mac_vif_setup_ps(arvif);
	}
}

static struct ath12k_vif_cache *ath12k_ahvif_get_link_cache(struct ath12k_vif *ahvif,
+1 −1
Original line number Diff line number Diff line
@@ -843,7 +843,7 @@ int ath12k_wmi_mgmt_send(struct ath12k_link_vif *arvif, u32 buf_id,
	cmd->tx_params_valid = 0;

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

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

+13 −13
Original line number Diff line number Diff line
@@ -124,13 +124,13 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct pci_device_id iwl_hw_card_ids[] = {
	{IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_mac_cfg)},/* low 5GHz active */
	{IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_mac_cfg)},/* high 5GHz active */

/* 6x30 Series */
	{IWL_PCI_DEVICE(0x008A, 0x5305, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x008A, 0x5307, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x008A, 0x5325, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x008A, 0x5327, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x008B, 0x5315, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x008B, 0x5317, iwl1000_mac_cfg)},
/* 1030/6x30 Series */
	{IWL_PCI_DEVICE(0x008A, 0x5305, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x008A, 0x5307, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x008A, 0x5325, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x008A, 0x5327, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x008B, 0x5315, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x008B, 0x5317, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x0090, 0x5211, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x0090, 0x5215, iwl6030_mac_cfg)},
	{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[] = {
	{IWL_PCI_DEVICE(0x08AE, 0x1027, iwl1000_mac_cfg)},

/* 130 Series WiFi */
	{IWL_PCI_DEVICE(0x0896, 0x5005, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x0896, 0x5007, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x0897, 0x5015, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x0897, 0x5017, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x0896, 0x5025, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x0896, 0x5027, iwl1000_mac_cfg)},
	{IWL_PCI_DEVICE(0x0896, 0x5005, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x0896, 0x5007, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x0897, 0x5015, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x0897, 0x5017, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x0896, 0x5025, iwl6030_mac_cfg)},
	{IWL_PCI_DEVICE(0x0896, 0x5027, iwl6030_mac_cfg)},

/* 2x00 Series */
	{IWL_PCI_DEVICE(0x0890, 0x4022, iwl2000_mac_cfg)},
+3 −1
Original line number Diff line number Diff line
@@ -277,7 +277,9 @@ static void virt_wifi_connect_complete(struct work_struct *work)
		priv->is_connected = true;

	/* Schedules an event that acquires the rtnl lock. */
	cfg80211_connect_result(priv->upperdev, requested_bss, NULL, 0, NULL, 0,
	cfg80211_connect_result(priv->upperdev,
				priv->is_connected ? fake_router_bssid : NULL,
				NULL, 0, NULL, 0,
				status, GFP_KERNEL);
	netif_carrier_on(priv->upperdev);
}
+7 −6
Original line number Diff line number Diff line
@@ -7062,7 +7062,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
				u32 seq, int flags,
				struct cfg80211_registered_device *rdev,
				struct net_device *dev,
				const u8 *mac_addr, struct station_info *sinfo)
				const u8 *mac_addr, struct station_info *sinfo,
				bool link_stats)
{
	void *hdr;
	struct nlattr *sinfoattr, *bss_param;
@@ -7283,7 +7284,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
			goto nla_put_failure;
	}
	if (sinfo->valid_links) {
	if (link_stats && sinfo->valid_links) {
		links = nla_nest_start(msg, NL80211_ATTR_MLO_LINKS);
		if (!links)
			goto nla_put_failure;
@@ -7574,7 +7575,7 @@ static int nl80211_dump_station(struct sk_buff *skb,
				NETLINK_CB(cb->skb).portid,
				cb->nlh->nlmsg_seq, NLM_F_MULTI,
				rdev, wdev->netdev, mac_addr,
				&sinfo) < 0)
				&sinfo, false) < 0)
			goto out;
		sta_idx++;
@@ -7635,7 +7636,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
	if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION,
				 info->snd_portid, info->snd_seq, 0,
				 rdev, dev, mac_addr, &sinfo) < 0) {
				 rdev, dev, mac_addr, &sinfo, false) < 0) {
		nlmsg_free(msg);
		return -ENOBUFS;
	}
@@ -19680,7 +19681,7 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
		return;
	if (nl80211_send_station(msg, NL80211_CMD_NEW_STATION, 0, 0, 0,
				 rdev, dev, mac_addr, sinfo) < 0) {
				 rdev, dev, mac_addr, sinfo, false) < 0) {
		nlmsg_free(msg);
		return;
	}
@@ -19710,7 +19711,7 @@ void cfg80211_del_sta_sinfo(struct net_device *dev, const u8 *mac_addr,
	}
	if (nl80211_send_station(msg, NL80211_CMD_DEL_STATION, 0, 0, 0,
				 rdev, dev, mac_addr, sinfo) < 0) {
				 rdev, dev, mac_addr, sinfo, false) < 0) {
		nlmsg_free(msg);
		return;
	}