From 7c0e3b529afd31f99baf78be10b5d71d9086789a Mon Sep 17 00:00:00 2001
From: Paolo Sabatino <paolo.sabatino@gmail.com>
Date: Sun, 29 Jan 2023 15:53:20 +0000
Subject: [PATCH] port uwe5622 driver to kernel 6.1

---
 drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c b/drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c
index 294f19e1f6c..9dcdee02cb9 100755
--- a/drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c
+++ b/drivers/net/wireless/uwe5622/unisocwifi/cfg80211.c
@@ -703,7 +703,7 @@ static int sprdwl_add_cipher_key(struct sprdwl_vif *vif, bool pairwise,
 }
 
 static int sprdwl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
-				   u8 key_index, bool pairwise,
+				   int link_id, u8 key_index, bool pairwise,
 				   const u8 *mac_addr,
 				   struct key_params *params)
 {
@@ -725,7 +725,7 @@ static int sprdwl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
 }
 
 static int sprdwl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
-				   u8 key_index, bool pairwise,
+				   int link_id, u8 key_index, bool pairwise,
 				   const u8 *mac_addr)
 {
 	struct sprdwl_vif *vif = netdev_priv(ndev);
@@ -755,7 +755,7 @@ static int sprdwl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev,
 
 static int sprdwl_cfg80211_set_default_key(struct wiphy *wiphy,
 					   struct net_device *ndev,
-					   u8 key_index, bool unicast,
+					   int link_id, u8 key_index, bool unicast,
 					   bool multicast)
 {
 	struct sprdwl_vif *vif = netdev_priv(ndev);
@@ -2383,7 +2383,7 @@ void sprdwl_report_connection(struct sprdwl_vif *vif,
 		 conn_info->status == SPRDWL_ROAM_SUCCESS){
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
 		struct cfg80211_roam_info roam_info = {
-			.bss = bss,
+			.links[0].bss = bss,
 			.req_ie = conn_info->req_ie,
 			.req_ie_len = conn_info->req_ie_len,
 			.resp_ie = conn_info->resp_ie,
-- 
2.34.1

diff --git a/drivers/net/wireless/uwe5622/unisocwcn/platform/wcn_parn_parser.c b/drivers/net/wireless/uwe5622/unisocwcn/platform/wcn_parn_parser.c
index 0aa765ad839..20aea5e7366 100644
--- a/drivers/net/wireless/uwe5622/unisocwcn/platform/wcn_parn_parser.c
+++ b/drivers/net/wireless/uwe5622/unisocwcn/platform/wcn_parn_parser.c
@@ -143,7 +143,7 @@ static int prefixcmp(const char *str, const char *prefix)
 }
 
 #if KERNEL_VERSION(3, 19, 0) <= LINUX_VERSION_CODE
-static int find_callback(struct dir_context *ctx, const char *name, int namlen,
+static bool find_callback(struct dir_context *ctx, const char *name, int namlen,
 		     loff_t offset, u64 ino, unsigned int d_type)
 #else
 static int find_callback(void *ctx, const char *name, int namlen,
