wifi: mac80211: add cigtk parameter to ieee80211_gtk_rekey_add

The CIGTK keys use a key index of 0 or 1, which is not unique. As such,
a new parameter is needed to differentiate the key type. Add the
parameter to prepare for handling the CIGTK in the future.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20260921144048.8bfea7df6b06.I3d046fbe7dfb3883471773f84e7a791b5b97000e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Benjamin Berg 2026-09-21 14:40:53 +02:00 committed by Johannes Berg
parent 3191dfbf07
commit 89665aeecd
5 changed files with 15 additions and 8 deletions

View File

@ -1138,7 +1138,8 @@ iwl_mld_add_mcast_rekey(struct ieee80211_vif *vif,
return;
key_config = ieee80211_gtk_rekey_add(vif, key_data->id, key_data->key,
sizeof(key_data->key), link_id);
sizeof(key_data->key), link_id,
false);
if (IS_ERR(key_config))
return;
@ -1220,7 +1221,8 @@ static void iwl_mld_mlo_rekey(struct iwl_mld *mld,
mlo_key->idx, link_id);
key = ieee80211_gtk_rekey_add(vif, mlo_key->idx, mlo_key->key,
sizeof(mlo_key->key), link_id);
sizeof(mlo_key->key), link_id,
false);
if (IS_ERR(key))
continue;

View File

@ -1887,7 +1887,8 @@ static bool iwl_mvm_gtk_rekey(struct iwl_wowlan_status_data *status,
key = ieee80211_gtk_rekey_add(vif, status->gtk[i].id,
status->gtk[i].key,
sizeof(status->gtk[i].key), -1);
sizeof(status->gtk[i].key), -1,
false);
if (IS_ERR(key)) {
/* FW may send also the old keys */
if (PTR_ERR(key) == -EALREADY)
@ -1922,7 +1923,8 @@ iwl_mvm_d3_igtk_bigtk_rekey_add(struct iwl_wowlan_status_data *status,
return true;
key_config = ieee80211_gtk_rekey_add(vif, keyidx, key_data->key,
sizeof(key_data->key), -1);
sizeof(key_data->key), -1,
false);
if (IS_ERR(key_config)) {
/* FW may send also the old keys */
return PTR_ERR(key_config) == -EALREADY;

View File

@ -669,10 +669,12 @@ static struct ieee80211_key_conf *rtw89_wow_gtk_rekey(struct rtw89_dev *rtwdev,
if (ieee80211_vif_is_mld(wow_vif))
key = ieee80211_gtk_rekey_add(wow_vif, keyidx, gtk,
cipher_info->len,
rtwvif_link->link_id);
rtwvif_link->link_id,
false);
else
key = ieee80211_gtk_rekey_add(wow_vif, keyidx, gtk,
cipher_info->len, -1);
cipher_info->len, -1,
false);
kfree(rekey_conf);
if (IS_ERR(key)) {

View File

@ -6278,6 +6278,7 @@ void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
* @key_len: the key data. Might be bigger than the actual key length,
* but not smaller (for the driver convinence)
* @link_id: the link id of the key or -1 for non-MLO
* @cigtk: whether this is a CIGTK
*
* When GTK rekeying was done while the system was suspended, (a) new
* key(s) will be available. These will be needed by mac80211 for proper
@ -6304,7 +6305,7 @@ void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
struct ieee80211_key_conf *
ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
u8 idx, u8 *key_data, u8 key_len,
int link_id);
int link_id, bool cigtk);
/**
* ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying

View File

@ -1366,7 +1366,7 @@ EXPORT_SYMBOL_GPL(ieee80211_set_key_rx_seq);
struct ieee80211_key_conf *
ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
u8 idx, u8 *key_data, u8 key_len,
int link_id)
int link_id, bool cigtk)
{
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
struct ieee80211_local *local = sdata->local;