Advertisement
Guest User

patch2.20230830104840964.zip.sha256.0345dd97b8197f9adfd5e4c3e6f6127b0735ab1d8be384c1275e46c2d1ac52c8

a guest
Jan 27th, 2024
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 14.31 KB | None | 0 0
  1. diff --unified --recursive --no-dereference rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/core/rtw_br_ext.c rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/core/rtw_br_ext.c
  2. --- rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/core/rtw_br_ext.c    2022-04-18 10:20:02.000000000 +0800
  3. +++ rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/core/rtw_br_ext.c    2024-01-18 23:39:48.640286386 +0800
  4. @@ -17,7 +17,10 @@
  5.  #ifdef __KERNEL__
  6.     #include <linux/if_arp.h>
  7.     #include <net/ip.h>
  8. +   #include <linux/version.h>
  9. +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
  10.     #include <net/ipx.h>
  11. +#endif
  12.     #include <linux/atalk.h>
  13.     #include <linux/udp.h>
  14.     #include <linux/if_pppox.h>
  15. @@ -169,6 +172,7 @@
  16.  }
  17.  
  18.  
  19. +#ifdef _NET_INET_IPX_H_
  20.  static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
  21.         unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
  22.  {
  23. @@ -200,7 +204,7 @@
  24.     memcpy(networkAddr + 1, (unsigned char *)network, 2);
  25.     networkAddr[3] = *node;
  26.  }
  27. -
  28. +#endif
  29.  
  30.  static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
  31.         unsigned char *ac_mac, unsigned short *sid)
  32. @@ -330,6 +334,7 @@
  33.         x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
  34.  
  35.         return x & (NAT25_HASH_SIZE - 1);
  36. +#ifdef _NET_INET_IPX_H_
  37.     } else if (networkAddr[0] == NAT25_IPX) {
  38.         unsigned long x;
  39.  
  40. @@ -343,6 +348,7 @@
  41.         x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3];
  42.  
  43.         return x & (NAT25_HASH_SIZE - 1);
  44. +#endif
  45.     } else if (networkAddr[0] == NAT25_PPPOE) {
  46.         unsigned long x;
  47.  
  48. @@ -889,6 +895,7 @@
  49.         }
  50.     }
  51.  
  52. +#ifdef _NET_INET_IPX_H_
  53.     /*---------------------------------------------------*/
  54.     /*         Handle IPX and Apple Talk frame          */
  55.     /*---------------------------------------------------*/
  56. @@ -1109,6 +1116,7 @@
  57.  
  58.         return -1;
  59.     }
  60. +#endif
  61.  
  62.     /*---------------------------------------------------*/
  63.     /*                Handle PPPoE frame                */
  64. diff --unified --recursive --no-dereference rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/ioctl_cfg80211.c rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/ioctl_cfg80211.c
  65. --- rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/ioctl_cfg80211.c    2022-04-18 10:20:02.000000000 +0800
  66. +++ rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/ioctl_cfg80211.c    2024-01-18 20:02:39.718126034 +0800
  67. @@ -491,7 +491,10 @@
  68.  
  69.  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
  70.     if (started) {
  71. -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0))
  72. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  73. +       /* new argument link_id for MLO, 802.11be, must be 0 for non-MLO */
  74. +       cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
  75. +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0))
  76.  
  77.         /* --- cfg80211_ch_switch_started_notfiy() ---
  78.          *  A new parameter, bool quiet, is added from Linux kernel v5.11,
  79. @@ -512,7 +515,10 @@
  80.     if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
  81.         goto exit;
  82.  
  83. -   cfg80211_ch_switch_notify(adapter->pnetdev, &chdef);
  84. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  85. +   /* new argument link_id for MLO, 802.11be, must be 0 for non-MLO */
  86. +   cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
  87. +#endif
  88.  
  89.  #else
  90.     int freq = rtw_ch2freq(ch);
  91. @@ -1179,7 +1185,11 @@
  92.         #endif
  93.  
  94.         #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
  95. +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
  96.         roam_info.bssid = cur_network->network.MacAddress;
  97. +#else
  98. +       roam_info.links[0].bssid = cur_network->network.MacAddress;
  99. +#endif
  100.         roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
  101.         roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
  102.         roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
  103. @@ -1943,6 +1953,9 @@
  104.  }
  105.  
  106.  static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
  107. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  108. +   , int link_id
  109. +#endif
  110.     , u8 key_index
  111.  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
  112.     , bool pairwise
  113. @@ -2105,6 +2118,9 @@
  114.  }
  115.  
  116.  static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
  117. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  118. +   , int link_id
  119. +#endif
  120.     , u8 keyid
  121.  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
  122.     , bool pairwise
  123. @@ -2293,7 +2309,9 @@
  124.  }
  125.  
  126.  static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
  127. -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
  128. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  129. +               int link_id, u8 key_index, bool pairwise, const u8 *mac_addr)
  130. +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
  131.                 u8 key_index, bool pairwise, const u8 *mac_addr)
  132.  #else  /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */
  133.                 u8 key_index, const u8 *mac_addr)
  134. @@ -2313,7 +2331,11 @@
  135.  }
  136.  
  137.  static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
  138. -   struct net_device *ndev, u8 key_index
  139. +   struct net_device *ndev
  140. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  141. +   , int link_id
  142. +#endif
  143. +   , u8 key_index
  144.     #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)) || defined(COMPAT_KERNEL_RELEASE)
  145.     , bool unicast, bool multicast
  146.     #endif
  147. @@ -2361,7 +2383,11 @@
  148.  
  149.  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30))
  150.  int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy,
  151. -   struct net_device *ndev, u8 key_index)
  152. +   struct net_device *ndev
  153. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  154. +   , int link_id
  155. +#endif
  156. +   , u8 key_index)
  157.  {
  158.  #define SET_DEF_KEY_PARAM_FMT " key_index=%d"
  159.  #define SET_DEF_KEY_PARAM_ARG , key_index
  160. @@ -5626,7 +5652,11 @@
  161.     return ret;
  162.  }
  163.  
  164. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
  165. +static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id)
  166. +#else
  167.  static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
  168. +#endif
  169.  {
  170.     _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
  171.  
  172. @@ -7004,6 +7034,9 @@
  173.  #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
  174.  static int cfg80211_rtw_get_channel(struct wiphy *wiphy,
  175.     struct wireless_dev *wdev,
  176. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
  177. +    unsigned int link_id,
  178. +#endif
  179.     struct cfg80211_chan_def *chandef)
  180.  {
  181.     _adapter *padapter = wiphy_to_adapter(wiphy);
  182. @@ -11110,7 +11143,11 @@
  183.     rtw_cfg80211_indicate_scan_done(adapter, _TRUE);
  184.  
  185.     #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
  186. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
  187. +   if (wdev->links[0].client.current_bss) {
  188. +#else
  189.     if (wdev->current_bss) {
  190. +#endif
  191.         RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
  192.         rtw_cfg80211_indicate_disconnect(adapter, 0, 1);
  193.     }
  194. diff --unified --recursive --no-dereference rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/os_intfs.c rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/os_intfs.c
  195. --- rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/os_intfs.c  2022-04-18 10:20:02.000000000 +0800
  196. +++ rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/os_intfs.c  2024-01-18 19:01:54.643852516 +0800
  197. @@ -2198,7 +2198,11 @@
  198.     u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj);
  199.  
  200.  #ifdef CONFIG_RTW_NAPI
  201. -   netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
  202. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  203. +        netif_napi_add_weight(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
  204. +#else
  205. +        netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT);
  206. +#endif
  207.  #endif /* CONFIG_RTW_NAPI */
  208.  
  209.  #if defined(CONFIG_IOCTL_CFG80211)
  210. diff --unified --recursive --no-dereference rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/rtw_proc.c rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/rtw_proc.c
  211. --- rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/rtw_proc.c  2022-04-18 10:20:02.000000000 +0800
  212. +++ rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/rtw_proc.c  2024-01-18 20:15:56.908709696 +0800
  213. @@ -304,7 +304,11 @@
  214.  static int rtw_drv_proc_open(struct inode *inode, struct file *file)
  215.  {
  216.     /* struct net_device *dev = proc_get_parent_data(inode); */
  217. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  218. +   ssize_t index = (ssize_t)pde_data(inode);
  219. +#else
  220.     ssize_t index = (ssize_t)PDE_DATA(inode);
  221. +#endif
  222.     const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
  223.     void *private = NULL;
  224.  
  225. @@ -330,7 +334,11 @@
  226.  
  227.  static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
  228.  {
  229. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  230. +   ssize_t index = (ssize_t)pde_data(file_inode(file));
  231. +#else
  232.     ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
  233. +#endif
  234.     const struct rtw_proc_hdl *hdl = drv_proc_hdls + index;
  235.     ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
  236.  
  237. @@ -5853,7 +5861,11 @@
  238.  
  239.  static int rtw_adapter_proc_open(struct inode *inode, struct file *file)
  240.  {
  241. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  242. +   ssize_t index = (ssize_t)pde_data(inode);
  243. +#else
  244.     ssize_t index = (ssize_t)PDE_DATA(inode);
  245. +#endif
  246.     const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
  247.     void *private = proc_get_parent_data(inode);
  248.  
  249. @@ -5879,7 +5891,11 @@
  250.  
  251.  static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
  252.  {
  253. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  254. +   ssize_t index = (ssize_t)pde_data(file_inode(file));
  255. +#else
  256.     ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
  257. +#endif
  258.     const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index;
  259.     ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
  260.  
  261. @@ -6042,7 +6058,11 @@
  262.  
  263.  static int rtw_odm_proc_open(struct inode *inode, struct file *file)
  264.  {
  265. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  266. +   ssize_t index = (ssize_t)pde_data(inode);
  267. +#else
  268.     ssize_t index = (ssize_t)PDE_DATA(inode);
  269. +#endif
  270.     const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
  271.     void *private = proc_get_parent_data(inode);
  272.  
  273. @@ -6068,7 +6088,11 @@
  274.  
  275.  static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
  276.  {
  277. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  278. +   ssize_t index = (ssize_t)pde_data(file_inode(file));
  279. +#else
  280.     ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
  281. +#endif
  282.     const struct rtw_proc_hdl *hdl = odm_proc_hdls + index;
  283.     ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
  284.  
  285. @@ -6207,7 +6231,11 @@
  286.  
  287.  static int rtw_mcc_proc_open(struct inode *inode, struct file *file)
  288.  {
  289. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  290. +   ssize_t index = (ssize_t)pde_data(inode);
  291. +#else
  292.     ssize_t index = (ssize_t)PDE_DATA(inode);
  293. +#endif
  294.     const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index;
  295.     void *private = proc_get_parent_data(inode);
  296.  
  297. @@ -6233,7 +6261,11 @@
  298.  
  299.  static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos)
  300.  {
  301. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  302. +   ssize_t index = (ssize_t)pde_data(file_inode(file));
  303. +#else
  304.     ssize_t index = (ssize_t)PDE_DATA(file_inode(file));
  305. +#endif
  306.     const struct rtw_proc_hdl *hdl = mcc_proc_hdls + index;
  307.     ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write;
  308.  
  309. diff --unified --recursive --no-dereference rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/wifi_regd.c rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/wifi_regd.c
  310. --- rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/linux/wifi_regd.c 2022-04-18 10:20:02.000000000 +0800
  311. +++ rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/linux/wifi_regd.c 2024-01-27 21:23:39.479192231 +0800
  312. @@ -694,7 +694,12 @@
  313.     wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
  314.  #endif
  315.  
  316. -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
  317. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) \
  318. +       && ((LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 39)) \
  319. +   || (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0))) \
  320. +       && ((LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 13)) \
  321. +   || (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0))) \
  322. +       && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 4))
  323.     wiphy->regulatory_flags |= REGULATORY_IGNORE_STALE_KICKOFF;
  324.  #endif
  325.  
  326. diff --unified --recursive --no-dereference rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/osdep_service.c rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/osdep_service.c
  327. --- rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/os_dep/osdep_service.c   2022-04-18 10:20:02.000000000 +0800
  328. +++ rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727.patched/os_dep/osdep_service.c   2024-01-18 19:56:46.367617065 +0800
  329. @@ -1505,7 +1505,11 @@
  330.  inline void thread_exit(_completion *comp)
  331.  {
  332.  #ifdef PLATFORM_LINUX
  333. -   complete_and_exit(comp, 0);
  334. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
  335. +    kthread_complete_and_exit(comp, 0);
  336. +#else
  337. +    complete_and_exit(comp, 0);
  338. +#endif
  339.  #endif
  340.  
  341.  #ifdef PLATFORM_FREEBSD
  342. @@ -3186,7 +3190,9 @@
  343.  inline u32 rtw_random32(void)
  344.  {
  345.  #ifdef PLATFORM_LINUX
  346. -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
  347. +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
  348. +    return get_random_u32();
  349. +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
  350.     return prandom_u32();
  351.  #elif (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18))
  352.     u32 random_int;
  353.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement