wiphy_unlock(vif->ar->wiphy);
}
-static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
+static int ath6kl_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr,
struct key_params *params)
{
- struct ath6kl *ar = ath6kl_priv(ndev);
- struct ath6kl_vif *vif = netdev_priv(ndev);
+ struct ath6kl *ar = ath6kl_priv(wdev->netdev);
+ struct ath6kl_vif *vif = netdev_priv(wdev->netdev);
struct ath6kl_key *key = NULL;
int seq_len;
u8 key_usage;
(u8 *) mac_addr, SYNC_BOTH_WMIFLAG);
}
-static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
+static int ath6kl_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr)
{
- struct ath6kl *ar = ath6kl_priv(ndev);
- struct ath6kl_vif *vif = netdev_priv(ndev);
+ struct ath6kl *ar = ath6kl_priv(wdev->netdev);
+ struct ath6kl_vif *vif = netdev_priv(wdev->netdev);
ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: index %d\n", __func__, key_index);
return ath6kl_wmi_deletekey_cmd(ar->wmi, vif->fw_vif_idx, key_index);
}
-static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
+static int ath6kl_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr, void *cookie,
void (*callback) (void *cookie,
struct key_params *))
{
- struct ath6kl_vif *vif = netdev_priv(ndev);
+ struct ath6kl_vif *vif = netdev_priv(wdev->netdev);
struct ath6kl_key *key = NULL;
struct key_params params;
}
static int wil_cfg80211_add_key(struct wiphy *wiphy,
- struct net_device *ndev, int link_id,
+ struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise,
const u8 *mac_addr,
struct key_params *params)
{
int rc;
- struct wil6210_vif *vif = ndev_to_vif(ndev);
struct wil6210_priv *wil = wiphy_to_wil(wiphy);
- struct wireless_dev *wdev = vif_to_wdev(vif);
+ struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
enum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise);
struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid,
key_usage,
}
static int wil_cfg80211_del_key(struct wiphy *wiphy,
- struct net_device *ndev, int link_id,
+ struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise,
const u8 *mac_addr)
{
- struct wil6210_vif *vif = ndev_to_vif(ndev);
struct wil6210_priv *wil = wiphy_to_wil(wiphy);
- struct wireless_dev *wdev = vif_to_wdev(vif);
+ struct wil6210_vif *vif = wdev_to_vif(wil, wdev);
enum wmi_key_usage key_usage = wil_detect_key_usage(wdev, pairwise);
struct wil_sta_info *cs = wil_find_sta_by_key_usage(wil, vif->mid,
key_usage,
key_params.key = vif->gtk;
key_params.key_len = vif->gtk_len;
key_params.seq_len = IEEE80211_GCMP_PN_LEN;
- rc = wil_cfg80211_add_key(wiphy, ndev, -1, vif->gtk_index,
+ rc = wil_cfg80211_add_key(wiphy, vif_to_wdev(vif), -1,
+ vif->gtk_index,
false, NULL, &key_params);
if (rc)
wil_err(wil, "vif %d recovery add key failed (%d)\n",
}
static s32
-brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
+brcmf_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_idx, bool pairwise,
const u8 *mac_addr)
{
- struct brcmf_if *ifp = netdev_priv(ndev);
+ struct brcmf_if *ifp = netdev_priv(wdev->netdev);
struct brcmf_wsec_key *key;
s32 err;
}
static s32
-brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
+brcmf_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_idx, bool pairwise,
const u8 *mac_addr, struct key_params *params)
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
- struct brcmf_if *ifp = netdev_priv(ndev);
+ struct brcmf_if *ifp = netdev_priv(wdev->netdev);
struct brcmf_pub *drvr = cfg->pub;
struct brcmf_wsec_key *key;
s32 val;
}
if (params->key_len == 0)
- return brcmf_cfg80211_del_key(wiphy, ndev, -1, key_idx,
+ return brcmf_cfg80211_del_key(wiphy, wdev, -1, key_idx,
pairwise, mac_addr);
if (params->key_len > sizeof(key->data)) {
}
static s32
-brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
+brcmf_cfg80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_idx, bool pairwise,
const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie,
{
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
struct key_params params;
- struct brcmf_if *ifp = netdev_priv(ndev);
+ struct brcmf_if *ifp = netdev_priv(wdev->netdev);
struct brcmf_cfg80211_profile *profile = &ifp->vif->profile;
struct brcmf_pub *drvr = cfg->pub;
struct brcmf_cfg80211_security *sec;
static s32
brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
- struct net_device *ndev, int link_id,
+ struct wireless_dev *wdev, int link_id,
u8 key_idx)
{
- struct brcmf_if *ifp = netdev_priv(ndev);
+ struct brcmf_if *ifp = netdev_priv(wdev->netdev);
brcmf_dbg(TRACE, "Enter key_idx %d\n", key_idx);
}
-static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
+static int lbs_cfg_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 idx, bool pairwise,
const u8 *mac_addr, struct key_params *params)
{
u16 key_type;
int ret = 0;
- if (netdev == priv->mesh_dev)
+ if (wdev->netdev == priv->mesh_dev)
return -EOPNOTSUPP;
lbs_deb_assoc("add_key: cipher 0x%x, mac_addr %pM\n",
}
-static int lbs_cfg_del_key(struct wiphy *wiphy, struct net_device *netdev,
+static int lbs_cfg_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr)
{
* CFG802.11 operation handler to delete a network key.
*/
static int
-mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
+mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr)
{
- struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
+ struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const u8 *peer_mac = pairwise ? mac_addr : bc_mac;
* CFG802.11 operation handler to add a network key.
*/
static int
-mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
+mwifiex_cfg80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr, struct key_params *params)
{
- struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
+ struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
struct mwifiex_wep_key *wep_key;
static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const u8 *peer_mac = pairwise ? mac_addr : bc_mac;
*/
static int
mwifiex_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
- struct net_device *netdev,
+ struct wireless_dev *wdev,
int link_id,
u8 key_index)
{
- struct mwifiex_private *priv = mwifiex_netdev_get_priv(netdev);
+ struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
struct mwifiex_ds_encrypt_key encrypt_key;
wiphy_dbg(wiphy, "set default mgmt key, key index=%d\n", key_index);
return 0;
}
-static int add_key(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+static int add_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr,
struct key_params *params)
const u8 *tx_mic = NULL;
u8 mode = WILC_FW_SEC_NO;
u8 op_mode;
- struct wilc_vif *vif = netdev_priv(netdev);
+ struct wilc_vif *vif = netdev_priv(wdev->netdev);
struct wilc_priv *priv = &vif->priv;
struct wilc_wfi_key *key;
break;
default:
- netdev_err(netdev, "%s: Unsupported cipher\n", __func__);
+ netdev_err(wdev->netdev, "%s: Unsupported cipher\n", __func__);
ret = -ENOTSUPP;
}
return ret;
}
-static int del_key(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+static int del_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index,
bool pairwise,
const u8 *mac_addr)
{
- struct wilc_vif *vif = netdev_priv(netdev);
+ struct wilc_vif *vif = netdev_priv(wdev->netdev);
struct wilc_priv *priv = &vif->priv;
if (!pairwise && (key_index == 4 || key_index == 5)) {
return 0;
}
-static int get_key(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+static int get_key(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr,
void *cookie,
void (*callback)(void *cookie, struct key_params *))
{
- struct wilc_vif *vif = netdev_priv(netdev);
+ struct wilc_vif *vif = netdev_priv(wdev->netdev);
struct wilc_priv *priv = &vif->priv;
struct key_params key_params;
return 0;
}
-static int set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev,
+static int set_default_mgmt_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index)
{
- struct wilc_vif *vif = netdev_priv(netdev);
+ struct wilc_vif *vif = netdev_priv(wdev->netdev);
return wilc_set_default_mgmt_key_index(vif, key_index);
}
return ret;
}
-static int qtnf_add_key(struct wiphy *wiphy, struct net_device *dev,
+static int qtnf_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr, struct key_params *params)
{
- struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
+ struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev);
int ret;
ret = qtnf_cmd_send_add_key(vif, key_index, pairwise, mac_addr, params);
return ret;
}
-static int qtnf_del_key(struct wiphy *wiphy, struct net_device *dev,
+static int qtnf_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr)
{
- struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
+ struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev);
int ret;
ret = qtnf_cmd_send_del_key(vif, key_index, pairwise, mac_addr);
}
static int
-qtnf_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *dev,
+qtnf_set_default_mgmt_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index)
{
- struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
+ struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev);
int ret;
ret = qtnf_cmd_send_set_default_mgmt_key(vif, key_index);
return ret;
}
-static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
+static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr, struct key_params *params)
{
u32 param_len;
struct ieee_param *param = NULL;
int ret = 0;
+ struct net_device *ndev = wdev->netdev;
struct adapter *padapter = rtw_netdev_priv(ndev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
return ret;
}
-static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
+static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie,
return 0;
}
-static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
+static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr)
{
- struct adapter *padapter = rtw_netdev_priv(ndev);
+ struct adapter *padapter = rtw_netdev_priv(wdev->netdev);
struct security_priv *psecuritypriv = &padapter->securitypriv;
if (key_index == psecuritypriv->dot11PrivacyKeyIndex) {
struct wireless_dev *wdev,
unsigned int link_id);
- int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
+ int (*add_key)(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr, struct key_params *params);
- int (*get_key)(struct wiphy *wiphy, struct net_device *netdev,
+ int (*get_key)(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie, struct key_params*));
- int (*del_key)(struct wiphy *wiphy, struct net_device *netdev,
+ int (*del_key)(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr);
int (*set_default_key)(struct wiphy *wiphy,
struct net_device *netdev, int link_id,
u8 key_index, bool unicast, bool multicast);
int (*set_default_mgmt_key)(struct wiphy *wiphy,
- struct net_device *netdev, int link_id,
+ struct wireless_dev *wdev, int link_id,
u8 key_index);
int (*set_default_beacon_key)(struct wiphy *wiphy,
- struct net_device *netdev,
+ struct wireless_dev *wdev,
int link_id,
u8 key_index);
return ret;
}
-static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+static int ieee80211_add_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_idx, bool pairwise,
const u8 *mac_addr, struct key_params *params)
{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct ieee80211_link_data *link =
ieee80211_link_or_deflink(sdata, link_id, false);
struct ieee80211_local *local = sdata->local;
return NULL;
}
-static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+static int ieee80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_idx, bool pairwise,
const u8 *mac_addr)
{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct ieee80211_local *local = sdata->local;
struct ieee80211_key *key;
return 0;
}
-static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+static int ieee80211_get_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_idx, bool pairwise,
const u8 *mac_addr, void *cookie,
void (*callback)(void *cookie,
int err = -ENOENT;
struct ieee80211_key_seq kseq = {};
- sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
rcu_read_lock();
}
static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy,
- struct net_device *dev,
+ struct wireless_dev *wdev,
int link_id, u8 key_idx)
{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct ieee80211_link_data *link =
ieee80211_link_or_deflink(sdata, link_id, true);
}
static int ieee80211_config_default_beacon_key(struct wiphy *wiphy,
- struct net_device *dev,
+ struct wireless_dev *wdev,
int link_id, u8 key_idx)
{
- struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
struct ieee80211_link_data *link =
ieee80211_link_or_deflink(sdata, link_id, true);
* Some IBSS support code for cfg80211.
*
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
- * Copyright (C) 2020-2024 Intel Corporation
+ * Copyright (C) 2020-2026 Intel Corporation
*/
#include <linux/etherdevice.h>
*/
if (rdev->ops->del_key)
for (i = 0; i < 6; i++)
- rdev_del_key(rdev, dev, -1, i, false, NULL);
+ rdev_del_key(rdev, wdev, -1, i, false, NULL);
if (wdev->u.ibss.current_bss) {
cfg80211_unhold_bss(wdev->u.ibss.current_bss);
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
int err;
- struct net_device *dev = info->user_ptr[1];
+ struct wireless_dev *wdev = info->user_ptr[1];
u8 key_idx = 0;
const u8 *mac_addr = NULL;
bool pairwise;
struct sk_buff *msg;
bool bigtk_support = false;
int link_id = nl80211_link_id_or_invalid(info->attrs);
- struct wireless_dev *wdev = dev->ieee80211_ptr;
if (wiphy_ext_feature_isset(&rdev->wiphy,
NL80211_EXT_FEATURE_BEACON_PROTECTION))
cookie.msg = msg;
cookie.idx = key_idx;
- if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) ||
+ if ((wdev->netdev &&
+ nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex)) ||
+ nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev),
+ NL80211_ATTR_PAD) ||
nla_put_u8(msg, NL80211_ATTR_KEY_IDX, key_idx))
goto nla_put_failure;
if (mac_addr &&
if (err)
goto free_msg;
- err = rdev_get_key(rdev, dev, link_id, key_idx, pairwise, mac_addr,
+ err = rdev_get_key(rdev, wdev, link_id, key_idx, pairwise, mac_addr,
&cookie, get_key_callback);
if (err)
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct key_parse key;
int err;
- struct net_device *dev = info->user_ptr[1];
+ struct wireless_dev *wdev = info->user_ptr[1];
int link_id = nl80211_link_id_or_invalid(info->attrs);
- struct wireless_dev *wdev = dev->ieee80211_ptr;
err = nl80211_parse_key(info, &key);
if (err)
if (!rdev->ops->set_default_key)
return -EOPNOTSUPP;
+ if (!wdev->netdev)
+ return -EINVAL;
+
err = nl80211_key_allowed(wdev);
if (err)
return err;
if (err)
return err;
- err = rdev_set_default_key(rdev, dev, link_id, key.idx,
+ err = rdev_set_default_key(rdev, wdev->netdev, link_id, key.idx,
key.def_uni, key.def_multi);
if (err)
if (err)
return err;
- err = rdev_set_default_mgmt_key(rdev, dev, link_id, key.idx);
+ err = rdev_set_default_mgmt_key(rdev, wdev, link_id, key.idx);
if (err)
return err;
if (err)
return err;
- return rdev_set_default_beacon_key(rdev, dev, link_id, key.idx);
+ return rdev_set_default_beacon_key(rdev, wdev, link_id,
+ key.idx);
} else if (key.p.mode == NL80211_KEY_SET_TX &&
wiphy_ext_feature_isset(&rdev->wiphy,
NL80211_EXT_FEATURE_EXT_KEY_ID)) {
if (err)
return err;
- return rdev_add_key(rdev, dev, link_id, key.idx,
+ return rdev_add_key(rdev, wdev, link_id, key.idx,
NL80211_KEYTYPE_PAIRWISE,
mac_addr, &key.p);
}
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
int err;
- struct net_device *dev = info->user_ptr[1];
+ struct wireless_dev *wdev = info->user_ptr[1];
struct key_parse key;
const u8 *mac_addr = NULL;
int link_id = nl80211_link_id_or_invalid(info->attrs);
- struct wireless_dev *wdev = dev->ieee80211_ptr;
err = nl80211_parse_key(info, &key);
if (err)
key.type == NL80211_KEYTYPE_PAIRWISE);
if (!err) {
- err = rdev_add_key(rdev, dev, link_id, key.idx,
+ err = rdev_add_key(rdev, wdev, link_id, key.idx,
key.type == NL80211_KEYTYPE_PAIRWISE,
mac_addr, &key.p);
if (err)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
int err;
- struct net_device *dev = info->user_ptr[1];
+ struct wireless_dev *wdev = info->user_ptr[1];
u8 *mac_addr = NULL;
struct key_parse key;
int link_id = nl80211_link_id_or_invalid(info->attrs);
- struct wireless_dev *wdev = dev->ieee80211_ptr;
err = nl80211_parse_key(info, &key);
if (err)
key.type == NL80211_KEYTYPE_PAIRWISE);
if (!err)
- err = rdev_del_key(rdev, dev, link_id, key.idx,
+ err = rdev_del_key(rdev, wdev, link_id, key.idx,
key.type == NL80211_KEYTYPE_PAIRWISE,
mac_addr);
NL80211_FLAG_CLEAR_SKB) \
SELECTOR(__sel, WDEV_UP, \
NL80211_FLAG_NEED_WDEV_UP) \
+ SELECTOR(__sel, WDEV_UP_CLEAR, \
+ NL80211_FLAG_NEED_WDEV_UP | \
+ NL80211_FLAG_CLEAR_SKB) \
SELECTOR(__sel, WDEV_UP_LINK, \
NL80211_FLAG_NEED_WDEV_UP | \
NL80211_FLAG_MLO_VALID_LINK_ID) \
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = nl80211_get_key,
.flags = GENL_UNS_ADMIN_PERM,
- .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP),
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),
},
{
.cmd = NL80211_CMD_SET_KEY,
.doit = nl80211_set_key,
.flags = GENL_UNS_ADMIN_PERM,
/* cannot use NL80211_FLAG_MLO_VALID_LINK_ID, depends on key */
- .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP |
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP |
NL80211_FLAG_CLEAR_SKB),
},
{
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = nl80211_new_key,
.flags = GENL_UNS_ADMIN_PERM,
- .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP |
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP |
NL80211_FLAG_CLEAR_SKB),
},
{
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
.doit = nl80211_del_key,
.flags = GENL_UNS_ADMIN_PERM,
- .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP),
+ .internal_flags = IFLAGS(NL80211_FLAG_NEED_WDEV_UP),
},
{
.cmd = NL80211_CMD_SET_BEACON,
/*
* Portions of this file
* Copyright(c) 2016-2017 Intel Deutschland GmbH
- * Copyright (C) 2018, 2021-2025 Intel Corporation
+ * Copyright (C) 2018, 2021-2026 Intel Corporation
*/
#ifndef __CFG80211_RDEV_OPS
#define __CFG80211_RDEV_OPS
}
static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, int link_id,
+ struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
int ret;
- trace_rdev_add_key(&rdev->wiphy, netdev, link_id, key_index, pairwise,
+ trace_rdev_add_key(&rdev->wiphy, wdev, link_id, key_index, pairwise,
mac_addr, params->mode);
- ret = rdev->ops->add_key(&rdev->wiphy, netdev, link_id, key_index,
+ ret = rdev->ops->add_key(&rdev->wiphy, wdev, link_id, key_index,
pairwise, mac_addr, params);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
static inline int
-rdev_get_key(struct cfg80211_registered_device *rdev, struct net_device *netdev,
+rdev_get_key(struct cfg80211_registered_device *rdev, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
void *cookie,
void (*callback)(void *cookie, struct key_params*))
{
int ret;
- trace_rdev_get_key(&rdev->wiphy, netdev, link_id, key_index, pairwise,
+ trace_rdev_get_key(&rdev->wiphy, wdev, link_id, key_index, pairwise,
mac_addr);
- ret = rdev->ops->get_key(&rdev->wiphy, netdev, link_id, key_index,
+ ret = rdev->ops->get_key(&rdev->wiphy, wdev, link_id, key_index,
pairwise, mac_addr, cookie, callback);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, int link_id,
+ struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr)
{
int ret;
- trace_rdev_del_key(&rdev->wiphy, netdev, link_id, key_index, pairwise,
+ trace_rdev_del_key(&rdev->wiphy, wdev, link_id, key_index, pairwise,
mac_addr);
- ret = rdev->ops->del_key(&rdev->wiphy, netdev, link_id, key_index,
+ ret = rdev->ops->del_key(&rdev->wiphy, wdev, link_id, key_index,
pairwise, mac_addr);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
static inline int
rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, int link_id, u8 key_index)
+ struct wireless_dev *wdev, int link_id, u8 key_index)
{
int ret;
- trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, link_id,
+ trace_rdev_set_default_mgmt_key(&rdev->wiphy, wdev, link_id,
key_index);
- ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev, link_id,
+ ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, wdev, link_id,
key_index);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
static inline int
rdev_set_default_beacon_key(struct cfg80211_registered_device *rdev,
- struct net_device *netdev, int link_id,
+ struct wireless_dev *wdev, int link_id,
u8 key_index)
{
int ret;
- trace_rdev_set_default_beacon_key(&rdev->wiphy, netdev, link_id,
+ trace_rdev_set_default_beacon_key(&rdev->wiphy, wdev, link_id,
key_index);
- ret = rdev->ops->set_default_beacon_key(&rdev->wiphy, netdev, link_id,
+ ret = rdev->ops->set_default_beacon_key(&rdev->wiphy, wdev, link_id,
key_index);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
* (for nl80211's connect() and wext)
*
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
- * Copyright (C) 2009, 2020, 2022-2025 Intel Corporation. All rights reserved.
+ * Copyright (C) 2009, 2020, 2022-2026 Intel Corporation. All rights reserved.
* Copyright 2017 Intel Deutschland GmbH
*/
NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT))
max_key_idx = 7;
for (i = 0; i <= max_key_idx; i++)
- rdev_del_key(rdev, dev, -1, i, false, NULL);
+ rdev_del_key(rdev, wdev, -1, i, false, NULL);
}
rdev_set_qos_map(rdev, dev, NULL);
/*
* Portions of this file
* Copyright(c) 2016-2017 Intel Deutschland GmbH
- * Copyright (C) 2018, 2020-2025 Intel Corporation
+ * Copyright (C) 2018, 2020-2026 Intel Corporation
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM cfg80211
);
DECLARE_EVENT_CLASS(key_handle,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr),
- TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr),
+ TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr),
TP_STRUCT__entry(
WIPHY_ENTRY
- NETDEV_ENTRY
+ WDEV_ENTRY
MAC_ENTRY(mac_addr)
__field(int, link_id)
__field(u8, key_index)
),
TP_fast_assign(
WIPHY_ASSIGN;
- NETDEV_ASSIGN;
+ WDEV_ASSIGN;
MAC_ASSIGN(mac_addr, mac_addr);
__entry->link_id = link_id;
__entry->key_index = key_index;
__entry->pairwise = pairwise;
),
- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, "
"key_index: %u, pairwise: %s, mac addr: %pM",
- WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id,
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id,
__entry->key_index, BOOL_TO_STR(__entry->pairwise),
__entry->mac_addr)
);
DEFINE_EVENT(key_handle, rdev_get_key,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr),
- TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr)
+ TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr)
);
DEFINE_EVENT(key_handle, rdev_del_key,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr),
- TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr)
+ TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr)
);
TRACE_EVENT(rdev_add_key,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr, u8 mode),
- TP_ARGS(wiphy, netdev, link_id, key_index, pairwise, mac_addr, mode),
+ TP_ARGS(wiphy, wdev, link_id, key_index, pairwise, mac_addr, mode),
TP_STRUCT__entry(
WIPHY_ENTRY
- NETDEV_ENTRY
+ WDEV_ENTRY
MAC_ENTRY(mac_addr)
__field(int, link_id)
__field(u8, key_index)
),
TP_fast_assign(
WIPHY_ASSIGN;
- NETDEV_ASSIGN;
+ WDEV_ASSIGN;
MAC_ASSIGN(mac_addr, mac_addr);
__entry->link_id = link_id;
__entry->key_index = key_index;
__entry->pairwise = pairwise;
__entry->mode = mode;
),
- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, "
"key_index: %u, mode: %u, pairwise: %s, "
"mac addr: %pM",
- WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id,
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id,
__entry->key_index, __entry->mode,
BOOL_TO_STR(__entry->pairwise), __entry->mac_addr)
);
);
TRACE_EVENT(rdev_set_default_mgmt_key,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index),
- TP_ARGS(wiphy, netdev, link_id, key_index),
+ TP_ARGS(wiphy, wdev, link_id, key_index),
TP_STRUCT__entry(
WIPHY_ENTRY
- NETDEV_ENTRY
+ WDEV_ENTRY
__field(int, link_id)
__field(u8, key_index)
),
TP_fast_assign(
WIPHY_ASSIGN;
- NETDEV_ASSIGN;
+ WDEV_ASSIGN;
__entry->link_id = link_id;
__entry->key_index = key_index;
),
- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
- "key index: %u", WIPHY_PR_ARG, NETDEV_PR_ARG,
- __entry->link_id, __entry->key_index)
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, key index: %u",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id,
+ __entry->key_index)
);
TRACE_EVENT(rdev_set_default_beacon_key,
- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, int link_id,
+ TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int link_id,
u8 key_index),
- TP_ARGS(wiphy, netdev, link_id, key_index),
+ TP_ARGS(wiphy, wdev, link_id, key_index),
TP_STRUCT__entry(
WIPHY_ENTRY
- NETDEV_ENTRY
+ WDEV_ENTRY
__field(int, link_id)
__field(u8, key_index)
),
TP_fast_assign(
WIPHY_ASSIGN;
- NETDEV_ASSIGN;
+ WDEV_ASSIGN;
__entry->link_id = link_id;
__entry->key_index = key_index;
),
- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d, "
- "key index: %u", WIPHY_PR_ARG, NETDEV_PR_ARG,
- __entry->link_id, __entry->key_index)
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", link_id: %d, key index: %u",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __entry->link_id,
+ __entry->key_index)
);
TRACE_EVENT(rdev_start_ap,
for (i = 0; i < 4; i++) {
if (!wdev->connect_keys->params[i].cipher)
continue;
- if (rdev_add_key(rdev, dev, -1, i, false, NULL,
+ if (rdev_add_key(rdev, wdev, -1, i, false, NULL,
&wdev->connect_keys->params[i])) {
netdev_err(dev, "failed to set key %d\n", i);
continue;
!(rdev->wiphy.flags & WIPHY_FLAG_IBSS_RSN))
err = -ENOENT;
else
- err = rdev_del_key(rdev, dev, -1, idx, pairwise,
+ err = rdev_del_key(rdev, wdev, -1, idx, pairwise,
addr);
}
wdev->wext.connect.privacy = false;
if (wdev->connected ||
(wdev->iftype == NL80211_IFTYPE_ADHOC &&
wdev->u.ibss.current_bss))
- err = rdev_add_key(rdev, dev, -1, idx, pairwise, addr, params);
+ err = rdev_add_key(rdev, wdev, -1, idx, pairwise, addr, params);
else if (params->cipher != WLAN_CIPHER_SUITE_WEP40 &&
params->cipher != WLAN_CIPHER_SUITE_WEP104)
return -EINVAL;
if (wdev->connected ||
(wdev->iftype == NL80211_IFTYPE_ADHOC &&
wdev->u.ibss.current_bss))
- err = rdev_set_default_mgmt_key(rdev, dev, -1, idx);
+ err = rdev_set_default_mgmt_key(rdev, wdev, -1, idx);
if (!err)
wdev->wext.default_mgmt_key = idx;
return err;