Merge pull request #138 from MastaG/fix-linux-7.4-cfg80211-key-type-legacy

fix(legacy-mcu1): support Linux 7.4 cfg80211 key type
This commit is contained in:
MinQ authored and GitHub committed 2026-11-09 13:37:47 +08:00
commit f68181eac3
1 file changed
+19
+19
View File
@@ -2955,7 +2955,12 @@ static int rwnx_cfg80211_add_key(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= HIGH_KERNEL_VERSION2)
int link_id,
#endif
#if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 4, 0)
u8 key_index, enum nl80211_key_type key_type,
const u8 *mac_addr,
#else
u8 key_index, bool pairwise, const u8 *mac_addr,
#endif
struct key_params *params)
{
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
@@ -2969,6 +2974,10 @@ static int rwnx_cfg80211_add_key(struct wiphy *wiphy,
u8_l cipher = 0;
struct rwnx_sta *sta = NULL;
struct rwnx_key *rwnx_key;
#if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 4, 0)
/* Linux 7.4 passes the key type instead of a pairwise flag */
bool pairwise = key_type == NL80211_KEYTYPE_PAIRWISE;
#endif
RWNX_DBG(RWNX_FN_ENTRY_STR);
@@ -3080,7 +3089,12 @@ static int rwnx_cfg80211_get_key(struct wiphy *wiphy,
int link_id,
#endif
#if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 4, 0)
u8 key_index, enum nl80211_key_type key_type,
const u8 *mac_addr,
#else
u8 key_index, bool pairwise, const u8 *mac_addr,
#endif
void *cookie,
void (*callback)(void *cookie, struct key_params*))
{
@@ -3104,7 +3118,12 @@ static int rwnx_cfg80211_del_key(struct wiphy *wiphy,
int link_id,
#endif
#if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 4, 0)
u8 key_index, enum nl80211_key_type key_type,
const u8 *mac_addr)
#else
u8 key_index, bool pairwise, const u8 *mac_addr)
#endif
{
struct rwnx_hw *rwnx_hw = wiphy_priv(wiphy);
#if AICWF_CFG80211_VERSION_CODE >= KERNEL_VERSION(7, 1, 0)