net: wireless: rtl8723ds: Adapt driver to API changes in kernel 6.6 12/319612/1
authorMichal Wilczynski <m.wilczynski@samsung.com>
Mon, 28 Oct 2024 17:25:35 +0000 (18:25 +0100)
committerMichal Wilczynski <m.wilczynski@samsung.com>
Mon, 28 Oct 2024 17:38:38 +0000 (18:38 +0100)
Driver copied from the kernel 5.10 doesn't compile on the kernel 6.6.
Adapt it by changing function calls that changed across the kernel
versions.

Change-Id: I0ecd55a7c7bd5b869d51bbaf0fef9b3e93d4055e
Signed-off-by: Michal Wilczynski <m.wilczynski@samsung.com>
drivers/net/wireless/rtl8723ds/os_dep/linux/ioctl_cfg80211.c
drivers/net/wireless/rtl8723ds/os_dep/linux/os_intfs.c
drivers/net/wireless/rtl8723ds/os_dep/linux/recv_linux.c
drivers/net/wireless/rtl8723ds/os_dep/linux/wifi_regd.c
drivers/net/wireless/rtl8723ds/os_dep/osdep_service.c

index f97606d8c0e7a3b34b716ae00a6625570b5816ca..c9227a72ff69ed41b596ebb97e94e66acc138526 100644 (file)
@@ -464,7 +464,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,
                 *  called by others with block-tx.
                 */
 
-               cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false);
+               cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 1, false, 0);
 #else
                cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0);
 #endif
@@ -475,7 +475,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,
        if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
                goto exit;
 
-       cfg80211_ch_switch_notify(adapter->pnetdev, &chdef);
+       cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
 
 #else
        int freq = rtw_ch2freq(ch);
@@ -1139,7 +1139,7 @@ check_bss:
                #endif
 
                #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-               roam_info.bssid = cur_network->network.MacAddress;
+               roam_info.links[0].bssid = cur_network->network.MacAddress;
                roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
                roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
                roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
@@ -1899,10 +1899,9 @@ exit:
 }
 
 static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
-       , u8 key_index
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
+       ,int link_id
+       ,u8 key_index
        , bool pairwise
-#endif
        , const u8 *mac_addr, struct key_params *params)
 {
        char *alg_name;
@@ -2061,6 +2060,7 @@ addkey_end:
 }
 
 static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
+       ,int link_id
        , u8 keyid
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
        , bool pairwise
@@ -2250,7 +2250,7 @@ exit:
 
 static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
-                               u8 key_index, bool pairwise, const u8 *mac_addr)
+                               int link_id, u8 key_index, bool pairwise, const u8 *mac_addr)
 #else  /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */
                                u8 key_index, const u8 *mac_addr)
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */
@@ -2269,7 +2269,7 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
 }
 
 static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
-       struct net_device *ndev, u8 key_index
+       struct net_device *ndev,int link_id, u8 key_index
        #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)) || defined(COMPAT_KERNEL_RELEASE)
        , bool unicast, bool multicast
        #endif
@@ -2317,7 +2317,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30))
 int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy,
-       struct net_device *ndev, u8 key_index)
+       struct net_device *ndev, int link_id, u8 key_index)
 {
 #define SET_DEF_KEY_PARAM_FMT " key_index=%d"
 #define SET_DEF_KEY_PARAM_ARG , key_index
@@ -5377,7 +5377,8 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
        return ret;
 }
 
-static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
+static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev,
+                               unsigned int link_id)
 {
        _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
 
@@ -6753,7 +6754,7 @@ exit:
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
 static int cfg80211_rtw_get_channel(struct wiphy *wiphy,
-       struct wireless_dev *wdev,
+       struct wireless_dev *wdev, unsigned int link_id,
        struct cfg80211_chan_def *chandef)
 {
        _adapter *padapter = wiphy_to_adapter(wiphy);
@@ -10691,13 +10692,6 @@ void rtw_wdev_unregister(struct wireless_dev *wdev)
 
        rtw_cfg80211_indicate_scan_done(adapter, _TRUE);
 
-       #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
-       if (wdev->current_bss) {
-               RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
-               rtw_cfg80211_indicate_disconnect(adapter, 0, 1);
-       }
-       #endif
-
        if (pwdev_priv->pmon_ndev) {
                RTW_INFO("%s, unregister monitor interface\n", __func__);
                unregister_netdev(pwdev_priv->pmon_ndev);
index 958e6a455a49bd1e7ec9541c75185a91015cf7c3..ce8e18b9ea07f0700498494ce8ced6495a27a2e5 100644 (file)
@@ -2147,7 +2147,7 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
        u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj);
 
 #ifdef CONFIG_RTW_NAPI
-       netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
+       netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll);
 #endif /* CONFIG_RTW_NAPI */
 
 #if defined(CONFIG_IOCTL_CFG80211)
index 13cd7660ac7ed0dd2a8fe4e856d3a5939ec42482..d1a908a07437b8b312738d3815a058d06523a024 100644 (file)
@@ -405,8 +405,8 @@ static int napi_recv(_adapter *padapter, int budget)
                        So, we should prevent cloned SKB go into napi_gro_receive.
                */
                if (pregistrypriv->en_gro && !skb_cloned(pskb)) {
-                       if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP)
-                               rx_ok = _TRUE;
+                       rtw_napi_gro_receive(&padapter->napi, pskb);
+                       rx_ok = _TRUE;
                        goto next;
                }
 #endif /* CONFIG_RTW_GRO */
index 81e1dc75e5fbec01fbaacf5ba1c5dff5a845c070..dd1cbc7aa65cc712ad8cbeaed3033cd114c22b5c 100644 (file)
@@ -406,7 +406,7 @@ int rtw_regd_init(struct wiphy *wiphy)
 #endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
-       wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
+       wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
 #endif
 
        return 0;
index 160a152c4348e203f2635335f4cc896ce32a5524..1be5f5ee10bbdbe279353fd659c2ff8cf23028c9 100644 (file)
@@ -1309,7 +1309,7 @@ u32 _rtw_down_sema(_sema *sema)
 inline void thread_exit(_completion *comp)
 {
 #ifdef PLATFORM_LINUX
-       complete_and_exit(comp, 0);
+       kthread_complete_and_exit(comp, 0);
 #endif
 
 #ifdef PLATFORM_FREEBSD
@@ -2911,7 +2911,7 @@ inline u32 rtw_random32(void)
 {
 #ifdef PLATFORM_LINUX
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
-       return prandom_u32();
+       return get_random_u32();
 #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18))
        u32 random_int;
        get_random_bytes(&random_int , 4);