From d88bd98445fe4c07832d97dd684d194cb06e5bac Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Mon, 26 Sep 2022 12:03:35 +0800 Subject: [PATCH] mxm_wifiex: fix the build errors with the API changes on next-20220912 kernel tag Kernel cfg80211 add link_id parameter to various key operations for MLO, for more details, please check the following link: https://lore.kernel.org/all/20220730052643.1959111-4-quic_vjakkam@quicinc.com/ As these API changes on next-20220912 kernel tag, corresponding functions also need to be changed to avoid build break. Signed-off-by: Sherry Sun --- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c | 18 +++++++++++++++++- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h | 15 +++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index a09dc09..a6a3b79 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -1371,6 +1371,9 @@ fail: */ #endif int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index, #if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE bool pairwise, @@ -1427,6 +1430,9 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev, */ #endif int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index, #if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE bool pairwise, @@ -1482,7 +1488,11 @@ int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev, */ #endif int woal_cfg80211_set_default_key(struct wiphy *wiphy, - struct net_device *netdev, t_u8 key_index + struct net_device *netdev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif + t_u8 key_index #if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE , bool ucast, bool mcast @@ -1514,6 +1524,9 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index) { PRINTM(MINFO, "set default mgmt key, key index=%d\n", key_index); @@ -1525,6 +1538,9 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, struct net_device *netdev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index) { PRINTM(MINFO, "set default beacon key, key index=%d\n", key_index); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h index 3c4d14e..103209e 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.h @@ -128,6 +128,9 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy, int woal_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed); int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index, #if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE bool pairwise, @@ -135,6 +138,9 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev, const t_u8 *mac_addr, struct key_params *params); int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index, #if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE bool pairwise, @@ -207,6 +213,9 @@ int woal_cfg80211_set_channel(struct wiphy *wiphy, #if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index, bool ucast, bool mcast); #else int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, @@ -216,12 +225,18 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev, #if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy, struct net_device *netdev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index); #endif #if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy, struct net_device *netdev, +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) + int link_id, +#endif t_u8 key_index); #endif