diff --git a/linux-5.10/rk3568_patch/kernel.patch b/linux-5.10/rk3568_patch/kernel.patch old mode 100755 new mode 100644 index d531e30b9754244f1459d11695949a361fcd0df7..add09c6067afa8f03f506fbe58399bf97ab55b48 --- a/linux-5.10/rk3568_patch/kernel.patch +++ b/linux-5.10/rk3568_patch/kernel.patch @@ -911769,7 +911769,7 @@ new file mode 100755 index 000000000..bc27ba560 --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/bcmstdlib_s.c -@@ -0,0 +1,307 @@ +@@ -0,0 +1,314 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Broadcom Secure Standard Library. @@ -911839,6 +911839,8 @@ index 000000000..bc27ba560 + * Also on error, if dest is not a null pointer and destsz not greater + * than RSIZE_MAX, writes destsz zero bytes into the dest object. + */ ++#ifndef CONFIG_AP6XXX_WIFI6_HDF ++ +static int +memmove_s(void *dest, size_t destsz, const void *src, size_t n) +{ @@ -911881,6 +911883,7 @@ index 000000000..bc27ba560 + * Also on error, if dest is not a null pointer and destsz not greater + * than RSIZE_MAX, writes destsz zero bytes into the dest object. + */ ++ +static int +memcpy_s(void *dest, size_t destsz, const void *src, size_t n) +{ @@ -911922,6 +911925,7 @@ index 000000000..bc27ba560 + return err; +} + ++ +/* + * memset_s - secure memset + * dest : pointer to the object to be set @@ -911956,8 +911960,11 @@ index 000000000..bc27ba560 +exit: + return err; +} ++#endif ++ +#endif /* !__STDC_WANT_SECURE_LIB__ && !(__STDC_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__) */ + ++ +#if 0 +/** + * strlcpy - Copy a %NUL terminated string into a sized buffer @@ -933086,7 +933093,7 @@ new file mode 100755 index 000000000..cc35d0860 --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/dhd_cfg80211.c -@@ -0,0 +1,305 @@ +@@ -0,0 +1,335 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Linux cfg80211 driver - Dongle Host Driver (DHD) related @@ -933145,6 +933152,12 @@ index 000000000..cc35d0860 +#include +#include + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++#include "net_device.h" ++struct NetDevice * GetHdfNetDeviceByLinuxInf(struct net_device *dev); ++ ++#endif ++ +static s32 wl_dongle_up(struct net_device *ndev); +static s32 wl_dongle_down(struct net_device *ndev); + @@ -933240,6 +933253,7 @@ index 000000000..cc35d0860 +int wl_cfg80211_remove_if(struct bcm_cfg80211 *cfg, + int ifidx, struct net_device* ndev, bool rtnl_lock_reqd) +{ ++ WL_ERR(("lijg123: call wl_cfg80211_remove_if ifidx=%d rtnl_lock_reqd=%d\n", ifidx, rtnl_lock_reqd)); + return dhd_remove_if(cfg->pub, ifidx, rtnl_lock_reqd); +} + @@ -933253,6 +933267,9 @@ index 000000000..cc35d0860 +struct net_device * dhd_cfg80211_netdev_free(struct net_device *ndev) +{ + struct bcm_cfg80211 *cfg; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ struct NetDevice *hnetdev = NULL; ++#endif + + if (ndev) { + cfg = wl_get_cfg(ndev); @@ -933260,7 +933277,24 @@ index 000000000..cc35d0860 + MFREE(cfg->osh, ndev->ieee80211_ptr, sizeof(struct wireless_dev)); + ndev->ieee80211_ptr = NULL; + } ++ ++ WL_ERR(("call dhd_cfg80211_netdev_free %s\n", ndev->name)); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ hnetdev = GetHdfNetDeviceByLinuxInf(ndev); ++ if (hnetdev == NULL) { ++ WL_ERR(("get NetDevice %s failed\n", ndev->name)); ++ return NULL; ++ } ++ ++ // clear private obj ++ kfree(hnetdev->mlPriv); ++ hnetdev->mlPriv = NULL; ++ ++ // clear NetDevice object ++ NetDeviceDeInit(hnetdev); ++#else + free_netdev(ndev); ++#endif + return NULL; + } + @@ -933270,10 +933304,13 @@ index 000000000..cc35d0860 +void dhd_netdev_free(struct net_device *ndev) +{ +#ifdef WL_CFG80211 ++ WL_ERR(("lijg123 call dhd_netdev_free 01 run this %s\n", ndev->name)); + ndev = dhd_cfg80211_netdev_free(ndev); +#endif // endif -+ if (ndev) ++ if (ndev) { ++ WL_ERR(("lijg123 call dhd_netdev_free 02 %s\n", ndev->name)); + free_netdev(ndev); ++ } +} + +static s32 @@ -955731,7 +955768,7 @@ new file mode 100755 index 000000000..37a12817a --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/dhd_linux.c -@@ -0,0 +1,22324 @@ +@@ -0,0 +1,22693 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Broadcom Dongle Host Driver (DHD), Linux-specific network interface @@ -956669,11 +956706,46 @@ index 000000000..37a12817a +} dhd_dev_priv_t; + +#define DHD_DEV_PRIV_SIZE (sizeof(dhd_dev_priv_t)) ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++#include "net_device.h" ++ ++extern int g_hdf_ifidx; ++//struct NetDevice * get_hdf_netdev(int ifidx); ++struct NetDevice * GetHdfNetDeviceByLinuxInf(struct net_device *dev); ++ ++static inline dhd_dev_priv_t * DHD_DEV_PRIV(struct net_device *dev) ++{ ++ dhd_dev_priv_t *__tmp_dhd_netpriv = NULL; ++ struct NetDevice * hnetdev = GetHdfNetDeviceByLinuxInf(dev); ++ if ( hnetdev != NULL) { ++ __tmp_dhd_netpriv = ((dhd_dev_priv_t *)hnetdev->mlPriv); ++ } else { ++ __tmp_dhd_netpriv = NULL; ++ DHD_ERROR(("HDF net_device %s is invalid\n", dev->name)); ++ } ++ ++ return (__tmp_dhd_netpriv); ++} ++ ++void * VOID_DEV_PRIV(struct net_device *dev) ++{ ++ return (void *)DHD_DEV_PRIV(dev); ++} ++ ++#define DHD_DEV_INFO(dev) (DHD_DEV_PRIV(dev)->dhd) ++#define DHD_DEV_IFP(dev) (DHD_DEV_PRIV(dev)->ifp) ++#define DHD_DEV_IFIDX(dev) (DHD_DEV_PRIV(dev)->ifidx) ++#define DHD_DEV_LKUP(dev) (DHD_DEV_PRIV(dev)->lkup) ++ ++ ++#else +#define DHD_DEV_PRIV(dev) ((dhd_dev_priv_t *)DEV_PRIV(dev)) +#define DHD_DEV_INFO(dev) (((dhd_dev_priv_t *)DEV_PRIV(dev))->dhd) +#define DHD_DEV_IFP(dev) (((dhd_dev_priv_t *)DEV_PRIV(dev))->ifp) +#define DHD_DEV_IFIDX(dev) (((dhd_dev_priv_t *)DEV_PRIV(dev))->ifidx) +#define DHD_DEV_LKUP(dev) (((dhd_dev_priv_t *)DEV_PRIV(dev))->lkup) ++#endif + +/** Clear the dhd net_device's private structure. */ +static inline void @@ -960152,6 +960224,11 @@ index 000000000..37a12817a + wake_counts_t *wcp = NULL; +#endif /* DHD_WAKE_STATUS */ + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ struct NetDevice *netDevice = NULL; ++ struct sk_buff *eap_skb = NULL; ++ int ret = 0; ++#endif + DHD_TRACE(("%s: Enter\n", __FUNCTION__)); + BCM_REFERENCE(dump_data); + @@ -960442,6 +960519,19 @@ index 000000000..37a12817a + skb->data = eth; + skb->len = len; + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ // send EAPOL pkt to HDF WIFI ++ if (protocol == ETHER_TYPE_802_1X) { ++ netDevice = GetHdfNetDeviceByLinuxInf(skb->dev); ++ if (netDevice && netDevice->netDeviceIf != NULL && netDevice->netDeviceIf->specialEtherTypeProcess != NULL) { ++ eap_skb = skb_copy(skb, GFP_ATOMIC); ++ skb_linearize(eap_skb); ++ ret = netDevice->netDeviceIf->specialEtherTypeProcess(netDevice, eap_skb); ++ DHD_ERROR(("%s: send EAPOL pkt ret=%d, from %s\n", __FUNCTION__, ret, netDevice->name)); ++ print_hex_dump(KERN_INFO, "recv EAPOL: ", DUMP_PREFIX_NONE, 16, 1, eap_skb->data, eap_skb->len, true); ++ } ++ } ++#endif + DHD_DBG_PKT_MON_RX(dhdp, skb); + /* Strip header, count, deliver upward */ + skb_pull(skb, ETH_HLEN); @@ -963555,6 +963645,18 @@ index 000000000..37a12817a +} +#endif /* WL_STATIC_IF */ + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++struct net_device * get_krn_netdev(int ifidx); ++ ++int get_dhd_priv_data_size(void) ++{ ++ return DHD_DEV_PRIV_SIZE; ++} ++ ++const static struct net_device_ops *hdf_netdev_ops = NULL; ++ ++#endif ++ +/* unregister and free the existing net_device interface (if any) in iflist and + * allocate a new one. the slot is reused. this function does NOT register the + * new interface to linux kernel. dhd_register_if does the job @@ -963566,13 +963668,19 @@ index 000000000..37a12817a + dhd_info_t *dhdinfo = (dhd_info_t *)dhdpub->info; + dhd_if_t *ifp; + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ DHD_ERROR(("%s: bdh6: create netdevice %s hdfidx=%d, ifidx=%d, bssidx=%u\n", __FUNCTION__, name, g_hdf_ifidx, ifidx, bssidx)); ++#else ++ DHD_ERROR(("%s: bdh6: create netdevice %s ifidx=%d, bssidx=%u\n", __FUNCTION__, name, ifidx, bssidx)); ++#endif ++ + ASSERT(dhdinfo && (ifidx < (DHD_MAX_IFS + DHD_MAX_STATIC_IFS))); + + ifp = dhdinfo->iflist[ifidx]; + + if (ifp != NULL) { + if (ifp->net != NULL) { -+ DHD_ERROR(("%s: free existing IF %s ifidx:%d \n", ++ DHD_ERROR(("%s: bdh6 free existing IF %s ifidx:%d \n", + __FUNCTION__, ifp->net->name, ifidx)); + + if (ifidx == 0) { @@ -963622,7 +963730,14 @@ index 000000000..37a12817a + memcpy(&ifp->mac_addr, mac, ETHER_ADDR_LEN); + + /* Allocate etherdev, including space for private structure */ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ ifp->net = get_krn_netdev(g_hdf_ifidx); ++ if (0 == g_hdf_ifidx) { ++ hdf_netdev_ops = ifp->net->netdev_ops; ++ } ++#else + ifp->net = alloc_etherdev(DHD_DEV_PRIV_SIZE); ++#endif + if (ifp->net == NULL) { + DHD_ERROR(("%s: OOM - alloc_etherdev(%zu)\n", __FUNCTION__, sizeof(dhdinfo))); + goto fail; @@ -963774,7 +963889,6 @@ index 000000000..37a12817a + dhd_if_t *ifp; + unsigned long flags; + long timeout; -+ + ifp = dhdinfo->iflist[ifidx]; + + if (ifp != NULL) { @@ -963860,7 +963974,10 @@ index 000000000..37a12817a + return BCME_OK; +} + -+static struct net_device_ops dhd_ops_pri = { ++#ifndef CONFIG_AP6XXX_WIFI6_HDF ++static ++#endif ++struct net_device_ops dhd_ops_pri = { + .ndo_open = dhd_pri_open, + .ndo_stop = dhd_pri_stop, + .ndo_get_stats = dhd_get_stats, @@ -964399,7 +964516,10 @@ index 000000000..37a12817a + /* initialize the l2_filter_cnt */ + dhd->pub.l2_filter_cnt = 0; +#endif // endif ++ ++#ifndef CONFIG_AP6XXX_WIFI6_HDF + net->netdev_ops = NULL; ++#endif + + mutex_init(&dhd->dhd_iovar_mutex); + sema_init(&dhd->proto_sem, 1); @@ -967346,6 +967466,18 @@ index 000000000..37a12817a + return 0; +} + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++int dhd_netdev_changemtu_wrapper(struct net_device *netdev, int mtu) ++{ ++ int bcmerror = BCME_OK; ++ dhd_info_t *dhd = DHD_DEV_INFO(netdev); ++ mtu &= 0xffff; ++ bcmerror = dhd_change_mtu(&dhd->pub, mtu, 0); ++ return bcmerror; ++} ++#endif ++ ++ +#ifdef ARP_OFFLOAD_SUPPORT +/* add or remove AOE host ip(s) (up to 8 IPs on the interface) */ +void @@ -967420,7 +967552,11 @@ index 000000000..37a12817a + + /* Filter notifications meant for non Broadcom devices */ + if ((ifa->ifa_dev->dev->netdev_ops != &dhd_ops_pri) && -+ (ifa->ifa_dev->dev->netdev_ops != &dhd_ops_virt)) { ++ (ifa->ifa_dev->dev->netdev_ops != &dhd_ops_virt) ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ && (ifa->ifa_dev->dev->netdev_ops != hdf_netdev_ops) ++#endif ++ ) { +#if defined(WL_ENABLE_P2P_IF) + if (!wl_cfgp2p_is_ifops(ifa->ifa_dev->dev->netdev_ops)) +#endif /* WL_ENABLE_P2P_IF */ @@ -967617,7 +967753,11 @@ index 000000000..37a12817a + int idx; + + /* Filter notifications meant for non Broadcom devices */ -+ if (inet6_ifa->idev->dev->netdev_ops != &dhd_ops_pri) { ++ if (inet6_ifa->idev->dev->netdev_ops != &dhd_ops_pri ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ && inet6_ifa->idev->dev->netdev_ops != hdf_netdev_ops ++#endif ++ ) { + return NOTIFY_DONE; + } + @@ -967705,6 +967845,9 @@ index 000000000..37a12817a + struct net_device *net = NULL; + int err = 0; + uint8 temp_addr[ETHER_ADDR_LEN] = { 0x00, 0x90, 0x4c, 0x11, 0x22, 0x33 }; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ struct NetDevice *hnetdev = NULL; ++#endif + + DHD_TRACE(("%s: ifidx %d\n", __FUNCTION__, ifidx)); + @@ -967719,14 +967862,25 @@ index 000000000..37a12817a + ASSERT(net && (ifp->idx == ifidx)); + + ASSERT(!net->netdev_ops); ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ DHD_ERROR(("%s: bdh6 register netdev=%s hdfidx=%d, ifidx=%d, %p, %p\n", __FUNCTION__, net->name, g_hdf_ifidx, ++ ifidx, net->netdev_ops, &dhd_ops_virt)); ++#else + net->netdev_ops = &dhd_ops_virt; ++ DHD_ERROR(("%s: bdh6 register netdev=%s ifidx=%d\n", __FUNCTION__, net->name, ifidx)); ++#endif + + /* Ok, link into the network layer... */ + if (ifidx == 0) { + /* + * device functions for the primary interface only + */ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ DHD_ERROR(("%s: for primary inf don't set ops %d\n", __FUNCTION__, g_hdf_ifidx)); ++#else + net->netdev_ops = &dhd_ops_pri; ++#endif + if (!ETHER_ISNULLADDR(dhd->pub.mac.octet)) + memcpy(temp_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN); + } else { @@ -967784,10 +967938,23 @@ index 000000000..37a12817a + } + } + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ //if (0 == g_hdf_ifidx) { ++ DHD_ERROR(("%s: for hdf inf %d don't register netdev\n", __FUNCTION__, g_hdf_ifidx)); ++ ++ // update mac address ++ hnetdev = GetHdfNetDeviceByLinuxInf(net); ++ memcpy(hnetdev->macAddr, net->dev_addr, ETHER_ADDR_LEN); ++ // Call linux register_netdev() ++ err = NetDeviceAdd(hnetdev); ++ DHD_ERROR(("%s:NetDeviceAdd %s ret=%d\n", __FUNCTION__, net->name, err)); ++ //} ++#else + if (need_rtnl_lock) + err = register_netdev(net); + else + err = register_netdevice(net); ++#endif + + if (err != 0) { + DHD_ERROR(("couldn't register the net device [%s], err %d\n", net->name, err)); @@ -967853,7 +968020,9 @@ index 000000000..37a12817a + return 0; + +fail: ++#ifndef CONFIG_AP6XXX_WIFI6_HDF + net->netdev_ops = NULL; ++#endif + return err; +} + @@ -968054,6 +968223,7 @@ index 000000000..37a12817a + * (which is set to free_netdev) + */ + if (ifp->net->reg_state == NETREG_UNINITIALIZED) { ++ DHD_ERROR(("lijg123: free netdev 01 %s\n", ifp->net->name)); + free_netdev(ifp->net); + } else { +#if defined(ARGOS_NOTIFY_CB) @@ -968450,8 +968620,11 @@ index 000000000..37a12817a + unregister_reboot_notifier(&dhd_reboot_notifier); + dhd_destroy_to_notifier_skt(); +} -+ -+static int __init ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++int ++#else ++static int __init ++#endif +dhd_module_init(void) +{ + int err; @@ -968512,6 +968685,7 @@ index 000000000..37a12817a + return NOTIFY_DONE; +} + ++#ifndef CONFIG_AP6XXX_WIFI6_HDF +#if defined(CONFIG_DEFERRED_INITCALLS) && !defined(EXYNOS_PCIE_MODULE_PATCH) +#if defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_SOC_EXYNOS8890) || \ + defined(CONFIG_ARCH_MSM8996) || defined(CONFIG_ARCH_MSM8998) || \ @@ -968533,6 +968707,7 @@ index 000000000..37a12817a +#endif /* USE_LATE_INITCALL_SYNC */ + +module_exit(dhd_module_exit); ++#endif + +/* + * OS specific functions required to implement DHD driver in OS independent way @@ -969557,7 +969732,11 @@ index 000000000..37a12817a +int +dhd_dev_get_feature_set(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *ptr = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *ptr = *(dhd_info_t **)netdev_priv(dev); ++#endif + dhd_pub_t *dhd = (&ptr->pub); + int feature_set = 0; + @@ -969700,7 +969879,11 @@ index 000000000..37a12817a +int +dhd_dev_ndo_cfg(struct net_device *dev, u8 enable) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + int ret = 0; + @@ -970001,8 +970184,11 @@ index 000000000..37a12817a +bool +dhd_dev_is_legacy_pno_enabled(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_is_legacy_pno_enabled(&dhd->pub)); +} + @@ -970030,8 +970216,11 @@ index 000000000..37a12817a +dhd_dev_pno_set_cfg_gscan(struct net_device *dev, dhd_pno_gscan_cmd_cfg_t type, + void *buf, bool flush) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_pno_set_cfg_gscan(&dhd->pub, type, buf, flush)); +} + @@ -970039,8 +970228,11 @@ index 000000000..37a12817a +int +dhd_dev_wait_batch_results_complete(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_wait_batch_results_complete(&dhd->pub)); +} + @@ -970048,16 +970240,22 @@ index 000000000..37a12817a +int +dhd_dev_pno_lock_access_batch_results(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_pno_lock_batch_results(&dhd->pub)); +} +/* Linux wrapper to call common dhd_pno_unlock_batch_results */ +void +dhd_dev_pno_unlock_access_batch_results(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_pno_unlock_batch_results(&dhd->pub)); +} + @@ -970065,8 +970263,11 @@ index 000000000..37a12817a +int +dhd_dev_pno_run_gscan(struct net_device *dev, bool run, bool flush) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_pno_initiate_gscan_request(&dhd->pub, run, flush)); +} + @@ -970074,8 +970275,11 @@ index 000000000..37a12817a +int +dhd_dev_pno_enable_full_scan_result(struct net_device *dev, bool real_time_flag) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_pno_enable_full_scan_result(&dhd->pub, real_time_flag)); +} + @@ -970084,8 +970288,11 @@ index 000000000..37a12817a +dhd_dev_hotlist_scan_event(struct net_device *dev, + const void *data, int *send_evt_bytes, hotlist_type_t type, u32 *buf_len) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_handle_hotlist_scan_evt(&dhd->pub, data, send_evt_bytes, type, buf_len)); +} + @@ -970094,16 +970301,22 @@ index 000000000..37a12817a +dhd_dev_process_full_gscan_result(struct net_device *dev, +const void *data, uint32 len, int *send_evt_bytes) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_process_full_gscan_result(&dhd->pub, data, len, send_evt_bytes)); +} + +void +dhd_dev_gscan_hotlist_cache_cleanup(struct net_device *dev, hotlist_type_t type) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + dhd_gscan_hotlist_cache_cleanup(&dhd->pub, type); + + return; @@ -970112,8 +970325,11 @@ index 000000000..37a12817a +int +dhd_dev_gscan_batch_cache_cleanup(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_gscan_batch_cache_cleanup(&dhd->pub)); +} + @@ -970121,8 +970337,11 @@ index 000000000..37a12817a +int +dhd_dev_retrieve_batch_scan(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_retreive_batch_scan_results(&dhd->pub)); +} + @@ -970130,8 +970349,11 @@ index 000000000..37a12817a +void * dhd_dev_process_epno_result(struct net_device *dev, + const void *data, uint32 event, int *send_evt_bytes) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_pno_process_epno_result(&dhd->pub, data, event, send_evt_bytes)); +} + @@ -970139,7 +970361,11 @@ index 000000000..37a12817a +dhd_dev_set_lazy_roam_cfg(struct net_device *dev, + wlc_roam_exp_params_t *roam_param) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + wl_roam_exp_cfg_t roam_exp_cfg; + int err; + @@ -970174,7 +970400,11 @@ index 000000000..37a12817a +dhd_dev_lazy_roam_enable(struct net_device *dev, uint32 enable) +{ + int err; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + wl_roam_exp_cfg_t roam_exp_cfg; + + memset(&roam_exp_cfg, 0, sizeof(roam_exp_cfg)); @@ -970200,7 +970430,11 @@ index 000000000..37a12817a +{ + int err; + uint len; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + + bssid_pref->version = BSSID_PREF_LIST_VERSION; + /* By default programming bssid pref flushes out old values */ @@ -970224,7 +970458,11 @@ index 000000000..37a12817a + uint32 len, uint32 flush) +{ + int err; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + int macmode; + + if (blacklist) { @@ -970250,7 +970488,11 @@ index 000000000..37a12817a + uint32 len, uint32 flush) +{ + int err; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + wl_ssid_whitelist_t whitelist_ssid_flush; + + if (!ssid_whitelist) { @@ -970279,8 +970521,11 @@ index 000000000..37a12817a +dhd_dev_pno_get_gscan(struct net_device *dev, dhd_pno_gscan_cmd_cfg_t type, + void *info, uint32 *len) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_pno_get_gscan(&dhd->pub, type, info, len)); +} +#endif /* GSCAN_SUPPORT || DHD_GET_VALID_CHANNELS */ @@ -970293,8 +970538,11 @@ index 000000000..37a12817a +{ + int err; + wl_rssi_monitor_cfg_t rssi_monitor; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + rssi_monitor.version = RSSI_MONITOR_VERSION; + rssi_monitor.max_rssi = max_rssi; + rssi_monitor.min_rssi = min_rssi; @@ -970313,8 +970561,11 @@ index 000000000..37a12817a +dhd_dev_set_tcpack_sup_mode_cfg(struct net_device *dev, uint8 enable) +{ + int err; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + err = dhd_tcpack_suppress_set(&dhd->pub, enable); + if (err != BCME_OK) { + DHD_ERROR(("%s : Failed to set tcpack_suppress mode: %d\n", __FUNCTION__, err)); @@ -970326,7 +970577,11 @@ index 000000000..37a12817a +int +dhd_dev_cfg_rand_mac_oui(struct net_device *dev, uint8 *oui) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + + if (!dhdp || !oui) { @@ -970377,60 +970632,87 @@ index 000000000..37a12817a +int +dhd_dev_rtt_set_cfg(struct net_device *dev, void *buf) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_rtt_set_cfg(&dhd->pub, buf)); +} + +int +dhd_dev_rtt_cancel_cfg(struct net_device *dev, struct ether_addr *mac_list, int mac_cnt) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_rtt_stop(&dhd->pub, mac_list, mac_cnt)); +} + +int +dhd_dev_rtt_register_noti_callback(struct net_device *dev, void *ctx, dhd_rtt_compl_noti_fn noti_fn) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_rtt_register_noti_callback(&dhd->pub, ctx, noti_fn)); +} + +int +dhd_dev_rtt_unregister_noti_callback(struct net_device *dev, dhd_rtt_compl_noti_fn noti_fn) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_rtt_unregister_noti_callback(&dhd->pub, noti_fn)); +} + +int +dhd_dev_rtt_capability(struct net_device *dev, rtt_capabilities_t *capa) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); -+ ++#endif + return (dhd_rtt_capability(&dhd->pub, capa)); +} + +int +dhd_dev_rtt_avail_channel(struct net_device *dev, wifi_channel_info *channel_info) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + return (dhd_rtt_avail_channel(&dhd->pub, channel_info)); +} + +int +dhd_dev_rtt_enable_responder(struct net_device *dev, wifi_channel_info *channel_info) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + return (dhd_rtt_enable_responder(&dhd->pub, channel_info)); +} + +int dhd_dev_rtt_cancel_responder(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + return (dhd_rtt_cancel_responder(&dhd->pub)); +} + @@ -970793,7 +971075,11 @@ index 000000000..37a12817a +static int +__dhd_apf_delete_filter(struct net_device *ndev, uint32 filter_id) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(ndev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + int ifidx, ret; + @@ -970862,7 +971148,11 @@ index 000000000..37a12817a +int +dhd_dev_apf_get_max_len(struct net_device *ndev, uint32 *max_len) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(ndev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + int ifidx, ret; + @@ -971589,7 +971879,11 @@ index 000000000..37a12817a +dhd_get_memdump_filename(struct net_device *ndev, char *memdump_path, int len, char *fname) +{ + char memdump_type[32]; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(ndev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + + /* Init file name */ @@ -973075,7 +973369,11 @@ index 000000000..37a12817a +int +dhd_sssr_dump_dig_buf_before(void *dev, const void *user_buf, uint32 len) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info_t *dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhd_pub_t *dhdp = &dhd_info->pub; + int pos = 0, ret = BCME_ERROR; + uint dig_buf_size = 0; @@ -973097,7 +973395,11 @@ index 000000000..37a12817a +int +dhd_sssr_dump_dig_buf_after(void *dev, const void *user_buf, uint32 len) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info_t *dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhd_pub_t *dhdp = &dhd_info->pub; + int pos = 0, ret = BCME_ERROR; + uint dig_buf_size = 0; @@ -973119,7 +973421,11 @@ index 000000000..37a12817a +int +dhd_sssr_dump_d11_buf_before(void *dev, const void *user_buf, uint32 len, int core) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info_t *dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhd_pub_t *dhdp = &dhd_info->pub; + int pos = 0, ret = BCME_ERROR; + @@ -973135,7 +973441,11 @@ index 000000000..37a12817a +int +dhd_sssr_dump_d11_buf_after(void *dev, const void *user_buf, uint32 len, int core) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info_t *dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhd_pub_t *dhdp = &dhd_info->pub; + int pos = 0, ret = BCME_ERROR; + @@ -973509,7 +973819,11 @@ index 000000000..37a12817a +void +dhd_nla_put_sssr_dump_len(void *ndev, uint32 *arr_len) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info_t *dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhd_pub_t *dhdp = &dhd_info->pub; + + if (dhdp->sssr_dump_collected) { @@ -973538,7 +973852,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973562,7 +973880,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973586,7 +973908,11 @@ index 000000000..37a12817a + uint32 remain_len = 0; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973613,7 +973939,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973638,7 +973968,11 @@ index 000000000..37a12817a + uint32 remain_len = 0; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973685,7 +974019,11 @@ index 000000000..37a12817a + dhd_dbg_ring_t *ring; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973710,7 +974048,11 @@ index 000000000..37a12817a + dhd_dbg_ring_t *ring; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973737,7 +974079,11 @@ index 000000000..37a12817a + dld_buf = &g_dld_buf[type]; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } else if (!dhdp) { + return BCME_ERROR; @@ -973837,7 +974183,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973937,7 +974287,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -973982,7 +974336,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974028,7 +974386,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974069,7 +974431,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974093,7 +974459,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974143,7 +974513,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974173,7 +974547,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974199,7 +974577,11 @@ index 000000000..37a12817a + dhd_info_t *dhd_info; + + if (dev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)dev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)dev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974217,7 +974599,11 @@ index 000000000..37a12817a + uint32 length = 0; + + if (ndev) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info = *(dhd_info_t **)DHD_DEV_PRIV((struct net_device *)ndev); ++#else + dhd_info = *(dhd_info_t **)netdev_priv((struct net_device *)ndev); ++#endif + dhdp = &dhd_info->pub; + } + @@ -974544,7 +974930,11 @@ index 000000000..37a12817a +dhd_os_socram_dump(struct net_device *dev, uint32 *dump_size) +{ + int ret = BCME_OK; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + + if (dhdp->busstate == DHD_BUS_DOWN) { @@ -974572,7 +974962,11 @@ index 000000000..37a12817a +{ + int ret = BCME_OK; + int orig_len = 0; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + if (buf == NULL) + return BCME_ERROR; @@ -974620,7 +975014,11 @@ index 000000000..37a12817a +dhd_os_get_axi_error_dump(void *dev, const void *user_buf, uint32 len) +{ + int ret = BCME_OK; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhd = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); ++#endif + dhd_pub_t *dhdp = &dhd->pub; + loff_t pos = 0; + if (user_buf == NULL) { @@ -977959,7 +978357,11 @@ index 000000000..37a12817a + +void *dhd_get_pub(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhdinfo = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhdinfo = *(dhd_info_t **)netdev_priv(dev); ++#endif + if (dhdinfo) + return (void *)&dhdinfo->pub; + else { @@ -977970,7 +978372,11 @@ index 000000000..37a12817a + +void *dhd_get_conf(struct net_device *dev) +{ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ dhd_info_t *dhdinfo = *(dhd_info_t **)DHD_DEV_PRIV(dev); ++#else + dhd_info_t *dhdinfo = *(dhd_info_t **)netdev_priv(dev); ++#endif + if (dhdinfo) + return (void *)dhdinfo->pub.conf; + else { @@ -1062362,7 +1062768,7 @@ new file mode 100755 index 000000000..6c79800c8 --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/include/bcmstdlib_s.h -@@ -0,0 +1,46 @@ +@@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Broadcom Secure Standard Library. @@ -1062399,9 +1062805,15 @@ index 000000000..6c79800c8 +#ifndef BWL_NO_INTERNAL_STDLIB_SUPPORT +#if !defined(__STDC_WANT_SECURE_LIB__) && !(defined(__STDC_LIB_EXT1__) && \ + defined(__STDC_WANT_LIB_EXT1__)) ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++int memmove_s(void *dest, size_t destsz, const void *src, size_t n); ++int memcpy_s(void *dest, size_t destsz, const void *src, size_t n); ++int memset_s(void *dest, size_t destsz, int c, size_t n); ++#else +static int memmove_s(void *dest, size_t destsz, const void *src, size_t n); +static int memcpy_s(void *dest, size_t destsz, const void *src, size_t n); +static int memset_s(void *dest, size_t destsz, int c, size_t n); ++#endif +#endif /* !__STDC_WANT_SECURE_LIB__ && !(__STDC_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__) */ +#if !defined(FREEBSD) && !defined(BCM_USE_PLATFORM_STRLCPY) +extern size_t strlcpy(char *dest, const char *src, size_t size); @@ -1121518,7 +1121930,7 @@ new file mode 100755 index 000000000..a8e96385b --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_android.c -@@ -0,0 +1,6630 @@ +@@ -0,0 +1,6644 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Linux cfg80211 driver - Android related functions @@ -1121605,6 +1122017,14 @@ index 000000000..a8e96385b +#define WL_BSSIDX_MAX 16 +#endif /* WL_STATIC_IF */ + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++#include "net_device.h" ++ ++extern int g_event_ifidx; ++struct NetDevice * get_hdf_netdev(int ifidx); ++#endif ++ ++ +uint android_msg_level = ANDROID_ERROR_LEVEL | ANDROID_MSG_LEVEL; + +#define ANDROID_ERROR_MSG(x, args...) \ @@ -1125713,6 +1126133,12 @@ index 000000000..a8e96385b + &cfg->remain_on_chan, + cfg->remain_on_chan_type, GFP_KERNEL); +#endif /* WL_CFG80211_P2P_DEV_IF */ ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ int32 ret = 0; ++ ret = HdfWifiEventCancelRemainOnChannel(get_hdf_netdev(g_event_ifidx), cfg->remain_on_chan.center_freq); ++ WL_ERR(("HdfWifiEventCancelRemainOnChannel ret=%d\n", ret)); ++#endif + } + wl_cfg80211_p2plo_deinit(cfg); + } @@ -1127399,7 +1127825,7 @@ index 000000000..a8e96385b + } + else if (strnicmp(command, CMD_INTERFACE_CREATE, strlen(CMD_INTERFACE_CREATE)) == 0) { + char *name = (command + strlen(CMD_INTERFACE_CREATE) +1); -+ ANDROID_INFO(("Creating %s interface\n", name)); ++ printk(KERN_INFO"Creating %s interface for wl_handle_private_cmd\n", name); + if (wl_cfg80211_add_if(wl_get_cfg(net), net, WL_IF_TYPE_STA, + name, NULL) == NULL) { + bytes_written = -ENODEV; @@ -1136557,7 +1136983,7 @@ new file mode 100755 index 000000000..7680903aa --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_cfg80211.c -@@ -0,0 +1,24840 @@ +@@ -0,0 +1,25007 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Linux cfg80211 driver @@ -1136591,7 +1137017,9 @@ index 000000000..7680903aa +#include +#include +#include -+ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++#include "hdf_mac80211_sta_event.h" ++#endif +#include +#include +#include @@ -1136717,7 +1137145,8 @@ index 000000000..7680903aa + +static struct device *cfg80211_parent_dev = NULL; +static struct bcm_cfg80211 *g_bcmcfg = NULL; -+u32 wl_dbg_level = WL_DBG_ERR; // | WL_DBG_P2P_ACTION | WL_DBG_INFO; ++u32 wl_dbg_level = 0xff; ++//u32 wl_dbg_level = WL_DBG_ERR; // | WL_DBG_P2P_ACTION | WL_DBG_INFO; + +#define MAX_VIF_OFFSET 15 +#define MAX_WAIT_TIME 1500 @@ -1136757,6 +1137186,27 @@ index 000000000..7680903aa +}; +#endif /* WL_RELMCAST */ + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++#include "hdf_wl_interface.h" ++#include "net_device.h" ++int32_t HdfWifiEventMgmtTxStatus(const struct NetDevice *netDev, const uint8_t *buf, size_t len, uint8_t ack); ++int32_t HdfWifiEventRxMgmt(const struct NetDevice *netDev, int32_t freq, int32_t sigMbm, const uint8_t *buf, size_t len); ++int32_t HdfWifiEventCsaChannelSwitch(const struct NetDevice *netDev, int32_t freq); ++int32_t HdfWifiEventRemainOnChannel(const struct NetDevice *netDev, uint32_t freq, uint32_t duration); ++ ++struct NetDevice * GetHdfNetDeviceByLinuxInf(struct net_device *dev); ++ ++int ChangNewSta(struct net_device *dev, const uint8_t *macAddr, uint8_t addrLen, ++ const struct station_info *info); ++int ChangDelSta(struct net_device *dev,const uint8_t *macAddr, uint8_t addrLen); ++ ++extern int g_event_ifidx; ++extern struct hdf_inf_map g_hdf_infmap[HDF_INF_MAX]; ++struct NetDevice * get_hdf_netdev(int ifidx); ++extern int g_mgmt_tx_event_ifidx; ++ ++#endif ++ +/* This is to override regulatory domains defined in cfg80211 module (reg.c) + * By default world regulatory domain defined in reg.c puts the flags NL80211_RRF_PASSIVE_SCAN + * and NL80211_RRF_NO_IBSS for 5GHz channels (for 36..48 and 149..165). @@ -1136787,6 +1137237,14 @@ index 000000000..7680903aa + /* IEEE 802.11a, channel 100..165 */ + REG_RULE(5470-10, 5850+10, 40, 6, 20, 0), } +}; ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++const struct ieee80211_regdomain * bdh6_get_regdomain(void) ++{ ++ return &brcm_regdom; ++} ++#endif ++ +#if defined(STRICT_GCC_WARNINGS) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == \ + 4 && __GNUC_MINOR__ >= 6)) +_Pragma("GCC diagnostic pop") @@ -1137043,13 +1137501,19 @@ index 000000000..7680903aa +static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, + struct net_device *dev, bool enabled, + s32 timeout); -+static int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, ++#ifndef CONFIG_AP6XXX_WIFI6_HDF ++static ++#endif ++int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_connect_params *sme); +#if defined(WL_FILS) +static int wl_cfg80211_update_connect_params(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_connect_params *sme, u32 changed); +#endif /* WL_FILS */ -+static s32 wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, ++#ifndef CONFIG_AP6XXX_WIFI6_HDF ++static ++#endif ++s32 wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, + u16 reason_code); +#if defined(WL_CFG80211_P2P_DEV_IF) +static s32 @@ -1138384,9 +1138848,15 @@ index 000000000..7680903aa + return NULL; + } + ++ printk(KERN_INFO"wl_cfg80211_p2p_if_add type=%d, name=%s\n", wl_iftype, name); ++ +#if defined(WL_CFG80211_P2P_DEV_IF) + if (wl_iftype == WL_IF_TYPE_P2P_DISC) { + /* Handle Dedicated P2P discovery Interface */ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ // cache @mac_addr ... ++ memcpy(g_hdf_infmap[HDF_INF_P2P0].macaddr, mac_addr, ETH_ALEN); ++#endif + return wl_cfgp2p_add_p2p_disc_if(cfg); + } +#endif /* WL_CFG80211_P2P_DEV_IF */ @@ -1139470,8 +1139940,8 @@ index 000000000..7680903aa + dhd_pub_t *dhd; + wl_iftype_t macaddr_iftype = wl_iftype; + -+ WL_INFORM_MEM(("if name: %s, wl_iftype:%d \n", -+ name ? name : "NULL", wl_iftype)); ++ printk(KERN_INFO"%s if name: %s, wl_iftype:%d \n", __func__, ++ name ? name : "NULL", wl_iftype); + if (!cfg || !primary_ndev || !name) { + WL_ERR(("cfg/ndev/name ptr null\n")); + return NULL; @@ -1139660,6 +1140130,7 @@ index 000000000..7680903aa + return ERR_PTR(-EINVAL); + } + ++ printk(KERN_INFO"wl_cfg80211_add_if %s new ifname=%s, type=%u,mode=%u\n", primary_ndev->name, name, wl_iftype, wl_mode); + wdev = wl_cfg80211_add_if(cfg, primary_ndev, wl_iftype, name, NULL); + if (unlikely(!wdev)) { + return ERR_PTR(-ENODEV); @@ -1139985,8 +1140456,8 @@ index 000000000..7680903aa + if (!dhd) + return -EINVAL; + -+ WL_INFORM_MEM(("[%s] Enter. current cfg_iftype:%d new cfg_iftype:%d \n", -+ ndev->name, ndev->ieee80211_ptr->iftype, type)); ++ printk(KERN_INFO"[%s] Enter. current cfg_iftype:%d new cfg_iftype:%d \n", ++ ndev->name, ndev->ieee80211_ptr->iftype, type); + primary_ndev = bcmcfg_to_prmry_ndev(cfg); + + if (cfg80211_to_wl_iftype(type, &wl_iftype, &wl_mode) < 0) { @@ -1142800,7 +1143271,10 @@ index 000000000..7680903aa +#define MAX_SCAN_ABORT_WAIT_CNT 20 +#define WAIT_SCAN_ABORT_OSL_SLEEP_TIME 10 + -+static s32 ++#ifndef CONFIG_AP6XXX_WIFI6_HDF ++static ++#endif ++s32 +wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, + struct cfg80211_connect_params *sme) +{ @@ -1142830,7 +1143304,7 @@ index 000000000..7680903aa + int wait_cnt; + char sec[32]; + -+ WL_DBG(("In\n")); ++ WL_DBG(("In %s\n", dev->name)); + if (!dev) { + WL_ERR(("dev is null\n")); + return -EINVAL; @@ -1143368,7 +1143842,10 @@ index 000000000..7680903aa + return; +} + -+static s32 ++#ifndef CONFIG_AP6XXX_WIFI6_HDF ++static ++#endif ++s32 +wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, + u16 reason_code) +{ @@ -1144626,7 +1145103,7 @@ index 000000000..7680903aa + dhd_pub_t *dhd = cfg->pub; + RETURN_EIO_IF_NOT_UP(cfg); + -+ WL_DBG(("Enter\n")); ++ WL_DBG(("Enter %s enable=%d, timeout=%u\n", dev->name, enabled, timeout)); + mode = wl_get_mode_by_netdev(cfg, dev); + if (cfg->p2p_net == dev || _net_info == NULL || + !wl_get_drv_status(cfg, CONNECTED, dev) || @@ -1145191,6 +1145668,10 @@ index 000000000..7680903aa + s32 err = BCME_OK; + struct ether_addr primary_mac; + struct net_device *ndev = NULL; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ NetDevice *netdev = NULL; ++ int ret = 0; ++#endif + struct bcm_cfg80211 *cfg = wiphy_priv(wiphy); + + RETURN_EIO_IF_NOT_UP(cfg); @@ -1145324,8 +1145805,14 @@ index 000000000..7680903aa + if (err == BCME_OK) { + WL_DBG(("Success\n")); +#if defined(WL_CFG80211_P2P_DEV_IF) ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ netdev = get_hdf_netdev(HDF_INF_P2P0); ++ ret = HdfWifiEventRemainOnChannel(netdev, channel->center_freq, duration); ++ printk(KERN_INFO"call HdfWifiEventRemainOnChannel cookie=%llu, ret=%d\n", *cookie, ret); ++#else + cfg80211_ready_on_channel(cfgdev, *cookie, channel, + duration, GFP_KERNEL); ++#endif +#else + cfg80211_ready_on_channel(cfgdev, *cookie, channel, + channel_type, duration, GFP_KERNEL); @@ -1145374,7 +1145861,7 @@ index 000000000..7680903aa + + if (cfg->last_roc_id == cookie) { + wl_cfgp2p_set_p2p_mode(cfg, WL_P2P_DISC_ST_SCAN, 0, 0, -+ wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE)); ++ wl_to_p2p_bss_bssidx(cfg, P2PAPI_BSSCFG_DEVICE)); + } else { + WL_ERR(("wl_cfg80211_cancel_remain_on_channel: ignore, request cookie(%llu)" + " is not matched. (cur : %llu)\n", @@ -1146108,7 +1146595,7 @@ index 000000000..7680903aa + } + } + -+ WL_DBG(("TX target bssidx=%d\n", bssidx)); ++ WL_DBG(("TX target bssidx=%d, wdev iftype=%d, center_freq=%u\n", bssidx, cfgdev->iftype, params->chan->center_freq)); + + if (p2p_is_on(cfg)) { + /* Suspend P2P discovery search-listen to prevent it from changing the @@ -1146135,6 +1146622,9 @@ index 000000000..7680903aa + wl_cfg80211_set_mgmt_vndr_ies(cfg, ndev_to_cfgdev(dev), bssidx, + VNDR_IE_PRBRSP_FLAG, (const u8 *)(buf + ie_offset), ie_len); + cfg80211_mgmt_tx_status(cfgdev, *cookie, buf, len, true, GFP_KERNEL); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventMgmtTxStatus(get_hdf_netdev(g_mgmt_tx_event_ifidx), buf, len, true); ++#endif +#if defined(P2P_IE_MISSING_FIX) + if (!cfg->p2p_prb_noti) { + cfg->p2p_prb_noti = true; @@ -1146173,6 +1146663,9 @@ index 000000000..7680903aa + wl_delay(400); + + cfg80211_mgmt_tx_status(cfgdev, *cookie, buf, len, true, GFP_KERNEL); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventMgmtTxStatus(get_hdf_netdev(g_mgmt_tx_event_ifidx), buf, len, true); ++#endif + goto exit; + + } else if (ieee80211_is_action(mgmt->frame_control)) { @@ -1146220,6 +1146713,9 @@ index 000000000..7680903aa + } + MFREE(cfg->osh, ambuf, param_len); + cfg80211_mgmt_tx_status(cfgdev, *cookie, buf, len, ack, GFP_KERNEL); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventMgmtTxStatus(get_hdf_netdev(g_mgmt_tx_event_ifidx), buf, len, ack); ++#endif + goto exit; + } +#endif /* WL_CLIENT_SAE */ @@ -1146267,6 +1146763,9 @@ index 000000000..7680903aa + ack = wl_cfg80211_send_action_frame(wiphy, dev, cfgdev, af_params, + action_frame, action_frame->len, bssidx); + cfg80211_mgmt_tx_status(cfgdev, *cookie, buf, len, ack, GFP_KERNEL); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventMgmtTxStatus(get_hdf_netdev(g_mgmt_tx_event_ifidx), buf, len, ack); ++#endif + + MFREE(cfg->osh, af_params, WL_WIFI_AF_PARAMS_SIZE); +exit: @@ -1149229,7 +1149728,10 @@ index 000000000..7680903aa +} +#endif /* WL_SUPPORT_ACS */ + -+static struct cfg80211_ops wl_cfg80211_ops = { ++#ifndef CONFIG_AP6XXX_WIFI6_HDF ++static ++#endif ++struct cfg80211_ops wl_cfg80211_ops = { + .add_virtual_intf = wl_cfg80211_add_virtual_iface, + .del_virtual_intf = wl_cfg80211_del_virtual_iface, + .change_virtual_intf = wl_cfg80211_change_virtual_iface, @@ -1149879,7 +1150381,9 @@ index 000000000..7680903aa + gfp_t aflags; + u8 tmp_buf[IEEE80211_MAX_SSID_LEN + 1]; + chanspec_t chanspec; -+ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg); ++#endif + if (unlikely(dtoh32(bi->length) > WL_BSS_INFO_MAX)) { + WL_DBG(("Beacon is larger than buffer. Discarding\n")); + return err; @@ -1149958,7 +1150462,7 @@ index 000000000..7680903aa + channel = ieee80211_get_channel(wiphy, freq); + memcpy(tmp_buf, bi->SSID, bi->SSID_len); + tmp_buf[bi->SSID_len] = '\0'; -+ WL_SCAN(("BSSID %pM, channel %3d(%3d %3sMHz), rssi %3d, capa 0x%-4x, mgmt_type %d, " ++ WL_ERR(("BSSID %pM, channel %3d(%3d %3sMHz), rssi %3d, capa 0x%-4x, mgmt_type %d, " + "frame_len %3d, SSID \"%s\"\n", + &bi->BSSID, notif_bss_info->channel, CHSPEC_CHANNEL(chanspec), + CHSPEC_IS20(chanspec)?"20": @@ -1150000,7 +1150504,10 @@ index 000000000..7680903aa + } + + CFG80211_PUT_BSS(wiphy, cbss); -+ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ //WL_ERR(("bdh6 frame_len %u == %u, netdev=%s\n", le16_to_cpu(notif_bss_info->frame_len), notif_bss_info->frame_len, ndev->name)); ++ HdfInformBssFrameEventCallback(ndev, channel, signal, freq, mgmt, notif_bss_info->frame_len); ++#endif + if (DBG_RING_ACTIVE(dhdp, DHD_EVENT_RING_ID) && + (cfg->sched_scan_req && !cfg->scan_request)) { + alloc_len = sizeof(log_conn_event_t) + IEEE80211_MAX_SSID_LEN + sizeof(uint16) + @@ -1150334,6 +1150841,9 @@ index 000000000..7680903aa + if (!err) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, 0, mgmt_frame, len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) @@ -1150514,6 +1151024,9 @@ index 000000000..7680903aa + ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH))) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, 0, mgmt_frame, len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \ @@ -1150553,6 +1151066,9 @@ index 000000000..7680903aa + wl_ext_in4way_sync(ndev, AP_WAIT_STA_RECONNECT, + WL_EXT_STATUS_STA_CONNECTED, (void *)&e->addr); + cfg80211_new_sta(ndev, e->addr.octet, &sinfo, GFP_ATOMIC); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ ChangNewSta(ndev,e->addr.octet,6,&sinfo); ++#endif +#ifdef WL_WPS_SYNC + wl_wps_session_update(ndev, WPS_STATE_LINKUP, e->addr.octet); +#endif /* WL_WPS_SYNC */ @@ -1150564,6 +1151080,9 @@ index 000000000..7680903aa + wl_ext_in4way_sync(ndev, AP_WAIT_STA_RECONNECT, + WL_EXT_STATUS_STA_DISCONNECTED, (void *)&e->addr); + cfg80211_del_sta(ndev, e->addr.octet, GFP_ATOMIC); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ ChangDelSta(ndev,e->addr.octet,6); ++#endif +#ifdef WL_WPS_SYNC + wl_wps_session_update(ndev, WPS_STATE_LINKDOWN, e->addr.octet); +#endif /* WL_WPS_SYNC */ @@ -1150758,6 +1151277,9 @@ index 000000000..7680903aa + if (event == WLC_E_ASSOC_IND && reason == DOT11_SC_SUCCESS) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(cfgdev, freq, rssi, mgmt_frame, len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, rssi, mgmt_frame, len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) @@ -1150768,6 +1151290,9 @@ index 000000000..7680903aa + } else if (event == WLC_E_DISASSOC_IND) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(cfgdev, freq, rssi, mgmt_frame, len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, rssi, mgmt_frame, len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) @@ -1150778,6 +1151303,9 @@ index 000000000..7680903aa + } else if ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH)) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(cfgdev, freq, rssi, mgmt_frame, len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, rssi, mgmt_frame, len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) @@ -1150788,6 +1151316,9 @@ index 000000000..7680903aa + } else if (event == WLC_E_AUTH) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(cfgdev, freq, rssi, mgmt_frame, len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, rssi, mgmt_frame, len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) @@ -1151151,6 +1151682,9 @@ index 000000000..7680903aa + ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH))) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, 0, mgmt_frame, len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \ @@ -1151200,6 +1151734,36 @@ index 000000000..7680903aa +} +#endif /* WLMESH_CFG80211 */ + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++static s32 wl_notify_connect_sta_status(struct bcm_cfg80211 *cfg, struct net_device *ndev, ++ const wl_event_msg_t *e, void *data, bool completed, struct cfg80211_bss *bss) ++{ ++ uint8_t *curbssid = NULL; ++ uint16_t connectStatus = 0; ++ uint16_t freq = 0; ++ struct wl_connect_info *conn_info = NULL; ++ conn_info = wl_to_conn(cfg); ++ curbssid = (uint8_t *)wl_read_prof(cfg, ndev, WL_PROF_BSSID); ++ ++ if(completed) { ++ connectStatus = 0; ++ } else { ++ connectStatus = 1; ++ } ++ ++ if(bss != NULL) { ++ if(bss->channel != NULL) { ++ freq = bss->channel->center_freq; ++ } ++ } ++ ++ HdfConnectResultEventCallback(ndev, curbssid, conn_info->req_ie, conn_info->resp_ie, \ ++ conn_info->req_ie_len, conn_info->resp_ie_len, connectStatus, freq); ++ ++ return 0; ++} ++#endif ++ +static s32 +wl_notify_connect_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, + const wl_event_msg_t *e, void *data) @@ -1151593,6 +1152157,9 @@ index 000000000..7680903aa +#endif /* WL_ANALYTICS */ + } + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfDisconnectedEventCallback(ndev, reason, ie_ptr, ie_len); ++#endif + CFG80211_DISCONNECTED(ndev, reason, ie_ptr, ie_len, + loc_gen, GFP_KERNEL); + WL_INFORM_MEM(("[%s] Disconnect event sent to upper layer" @@ -1152781,6 +1153348,10 @@ index 000000000..7680903aa + sec->auth_assoc_res_status : + WLAN_STATUS_UNSPECIFIED_FAILURE, + GFP_KERNEL); ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ wl_notify_connect_sta_status(cfg, ndev, e, data, completed, bss); ++#endif + } + } else { + WL_INFORM_MEM(("[%s] Ignore event:%d. drv status" @@ -1153025,6 +1153596,9 @@ index 000000000..7680903aa +{ + struct ieee80211_supported_band *band; + struct wiphy *wiphy = bcmcfg_to_wiphy(cfg); ++//#ifdef CONFIG_AP6XXX_WIFI6_HDF ++// struct net_device *netdev = bcmcfg_to_prmry_ndev(cfg); ++//#endif + struct ether_addr da; + struct ether_addr bssid; + bool isfree = false; @@ -1153327,6 +1153901,9 @@ index 000000000..7680903aa + WL_DBG(("Rx Managment frame For Iface (%s) \n", ndev->name)); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), freq, 0, mgmt_frame, mgmt_frame_len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(cfgdev, freq, 0, mgmt_frame, mgmt_frame_len, 0, GFP_ATOMIC); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \ @@ -1153889,9 +1154466,11 @@ index 000000000..7680903aa + break; + } + case NETDEV_UNREGISTER: ++ WL_DBG(("lijg123: unregister notify begin %s\n", dev->name)); + wl_cfg80211_clear_per_bss_ies(cfg, wdev); + /* after calling list_del_rcu(&wdev->list) */ + wl_dealloc_netinfo_by_wdev(cfg, wdev); ++ WL_DBG(("lijg123: unregister notify end %s\n", dev->name)); + break; + case NETDEV_GOING_DOWN: + /* @@ -1154400,6 +1154979,10 @@ index 000000000..7680903aa + return BCME_OK; +} + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++void set_krn_wiphy(void *pwiphy); ++#endif ++ +s32 wl_cfg80211_attach(struct net_device *ndev, void *context) +{ + struct wireless_dev *wdev; @@ -1154442,6 +1155025,9 @@ index 000000000..7680903aa + spin_lock_init(&cfg->vndr_oui_sync); + spin_lock_init(&cfg->net_list_sync); + ndev->ieee80211_ptr = wdev; ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ set_krn_wiphy(wdev->wiphy); ++#endif + SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy)); + wdev->netdev = ndev; + cfg->state_notifier = wl_notifier_change_state; @@ -1156311,6 +1156897,10 @@ index 000000000..7680903aa +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)) + cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0, + cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len, 0); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventRxMgmt(get_hdf_netdev(g_event_ifidx), cfg->tdls_mgmt_freq, 0, ++ cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)) + cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0, + cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len, 0, @@ -1158195,6 +1158785,9 @@ index 000000000..7680903aa +#if (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 8, 0)) + freq = chandef.chan ? chandef.chan->center_freq : chandef.center_freq1; + cfg80211_ch_switch_notify(dev, &chandef); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfWifiEventCsaChannelSwitch(get_hdf_netdev(HDF_INF_P2P0), freq); ++#endif +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION (3, 5, 0) && (LINUX_VERSION_CODE <= (3, 7, 0))) + freq = chan_info.freq; + cfg80211_ch_switch_notify(dev, freq, chan_info.chan_type); @@ -1173528,7 +1174121,7 @@ new file mode 100755 index 000000000..2452ffa3b --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_cfgp2p.c -@@ -0,0 +1,2741 @@ +@@ -0,0 +1,2782 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Linux cfgp2p driver @@ -1173614,6 +1174207,14 @@ index 000000000..2452ffa3b +}; +#endif /* WL_ENABLE_P2P_IF */ + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++#include "net_device.h" ++ ++extern int g_event_ifidx; ++struct NetDevice * get_hdf_netdev(int ifidx); ++int32_t HdfWifiEventCancelRemainOnChannel(const struct NetDevice *netDev, uint32_t freq); ++#endif ++ +bool wl_cfgp2p_is_pub_action(void *frame, u32 frame_len) +{ + wifi_p2p_pub_act_frame_t *pact_frm; @@ -1174951,6 +1175552,11 @@ index 000000000..2452ffa3b + cfg80211_remain_on_channel_expired(cfgdev, cfg->last_roc_id, + &cfg->remain_on_chan, cfg->remain_on_chan_type, GFP_KERNEL); +#endif /* WL_CFG80211_P2P_DEV_IF */ ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ ret = HdfWifiEventCancelRemainOnChannel(get_hdf_netdev(g_event_ifidx), cfg->remain_on_chan.center_freq); ++ WL_ERR(("HdfWifiEventCancelRemainOnChannel ret=%d\n", ret)); ++#endif + } + } +#endif /* P2P_LISTEN_OFFLOADING */ @@ -1175001,6 +1175607,10 @@ index 000000000..2452ffa3b + */ + cfg80211_remain_on_channel_expired(bcmcfg_to_p2p_wdev(cfg), + cfg->last_roc_id, &cfg->remain_on_chan, GFP_KERNEL); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ ret = HdfWifiEventCancelRemainOnChannel(get_hdf_netdev(g_event_ifidx), cfg->remain_on_chan.center_freq); ++ WL_ERR(("HdfWifiEventCancelRemainOnChannel ret=%d\n", ret)); ++#endif + } else + CFGP2P_ERR(("Invalid cfgdev. Dropping the" + "remain_on_channel_expired event.\n")); @@ -1175009,6 +1175619,11 @@ index 000000000..2452ffa3b + cfg80211_remain_on_channel_expired(cfgdev, + cfg->last_roc_id, &cfg->remain_on_chan, + cfg->remain_on_chan_type, GFP_KERNEL); ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ ret = HdfWifiEventCancelRemainOnChannel(get_hdf_netdev(g_event_ifidx), cfg->remain_on_chan.center_freq); ++ WL_ERR(("HdfWifiEventCancelRemainOnChannel ret=%d\n", ret)); ++#endif +#endif /* WL_CFG80211_P2P_DEV_IF */ + } + } @@ -1175082,6 +1175697,12 @@ index 000000000..2452ffa3b + cfg80211_remain_on_channel_expired(ndev, cfg->last_roc_id, + &cfg->remain_on_chan, cfg->remain_on_chan_type, GFP_KERNEL); +#endif /* WL_CFG80211_P2P_DEV_IF */ ++ ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ int ret =0; ++ ret = HdfWifiEventCancelRemainOnChannel(get_hdf_netdev(g_event_ifidx), cfg->remain_on_chan.center_freq); ++ WL_ERR(("HdfWifiEventCancelRemainOnChannel ret=%d\n", ret)); ++#endif + } + } + return 0; @@ -1175859,6 +1176480,16 @@ index 000000000..2452ffa3b +}; +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) */ + ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++int hdf_cfgp2p_register_ndev(struct net_device *p2p_netdev, struct net_device *primary_netdev, struct wiphy *wiphy) ++{ ++ ++ //SET_NETDEV_DEV(p2p_netdev, wiphy); ++ WL_MSG(p2p_netdev->name, "P2P Interface Registered\n"); ++ return 0; ++} ++#endif ++ +#if defined(WL_ENABLE_P2P_IF) +s32 +wl_cfgp2p_register_ndev(struct bcm_cfg80211 *cfg) @@ -1176047,7 +1176678,7 @@ index 000000000..2452ffa3b + if (!cfg || !cfg->p2p_supported) + return ERR_PTR(-EINVAL); + -+ WL_TRACE(("Enter\n")); ++ printk(KERN_INFO"Enter wl_cfgp2p_add_p2p_disc_if, p2p_wdev=%p\n", cfg->p2p_wdev); + + if (cfg->p2p_wdev) { +#ifndef EXPLICIT_DISCIF_CLEANUP @@ -1176108,7 +1176739,8 @@ index 000000000..2452ffa3b + /* store p2p wdev ptr for further reference. */ + cfg->p2p_wdev = wdev; + -+ printf("P2P interface registered\n"); ++ printf("P2P interface registered, wdev mac = %02x:%02x:%02x:%02x:%02x:%02x\n", wdev->address[0], wdev->address[1], ++ wdev->address[2], wdev->address[3], wdev->address[4], wdev->address[5]); + printf("%s: wdev: %p, wdev->net: %p\n", __FUNCTION__, wdev, wdev->netdev); + return wdev; +} @@ -1176204,7 +1176836,7 @@ index 000000000..2452ffa3b + return -EINVAL; + } + -+ WL_INFORM(("Enter\n")); ++ printk(KERN_INFO"Enter wl_cfgp2p_del_p2p_disc_if wdev->netdev=%p %d\n", wdev->netdev, wdev->iftype); + + if (!cfg->p2p_wdev) { + WL_ERR(("Already deleted p2p_wdev\n")); @@ -1176216,7 +1176848,9 @@ index 000000000..2452ffa3b + rollback_lock = true; + } + ++#ifndef CONFIG_AP6XXX_WIFI6_HDF + cfg80211_unregister_wdev(wdev); ++#endif + + if (rollback_lock) + rtnl_unlock(); @@ -1176739,7 +1177373,7 @@ new file mode 100755 index 000000000..8b9382deb --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_cfgscan.c -@@ -0,0 +1,3298 @@ +@@ -0,0 +1,3340 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Linux cfg80211 driver scan related code @@ -1176824,6 +1177458,9 @@ index 000000000..8b9382deb +#include "dhd_rtt.h" +#endif /* RTT_SUPPORT */ +#include ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++#include "hdf_mac80211_sta_event.h" ++#endif + +#define ACTIVE_SCAN 1 +#define PASSIVE_SCAN 0 @@ -1177426,11 +1178063,19 @@ index 000000000..8b9382deb + } + wl_inform_bss(cfg); + wl_notify_escan_complete(cfg, ndev, false, false); ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ printk("scan done success!\n"); ++ HdfScanEventCallback(ndev, HDF_WIFI_SCAN_SUCCESS); ++#endif + } + wl_escan_increment_sync_id(cfg, SCAN_BUF_NEXT); + } else if ((status == WLC_E_STATUS_ABORT) || (status == WLC_E_STATUS_NEWSCAN) || + (status == WLC_E_STATUS_11HQUIET) || (status == WLC_E_STATUS_CS_ABORT) || + (status == WLC_E_STATUS_NEWASSOC)) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ printk("scan abort status=%d\n", status); ++ //HdfScanEventCallback(ndev, HDF_WIFI_SCAN_FAILED); ++#endif + /* Dump FW preserve buffer content */ + if (status == WLC_E_STATUS_ABORT) { + wl_flush_fw_log_buffer(ndev, FW_LOGSET_MASK_ALL); @@ -1177490,12 +1178135,19 @@ index 000000000..8b9382deb + } + wl_escan_increment_sync_id(cfg, SCAN_BUF_CNT); + } else if (status == WLC_E_STATUS_TIMEOUT) { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ HdfScanEventCallback(ndev, HDF_WIFI_SCAN_TIMEOUT); ++#endif + WL_ERR(("WLC_E_STATUS_TIMEOUT : scan_request[%p]\n", cfg->scan_request)); + WL_ERR(("reason[0x%x]\n", e->reason)); + if (e->reason == 0xFFFFFFFF) { + wl_notify_escan_complete(cfg, cfg->escan_info.ndev, true, true); + } + } else { ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++ printk("scan failed 3\n"); ++ HdfScanEventCallback(ndev, HDF_WIFI_SCAN_FAILED); ++#endif + WL_ERR(("unexpected Escan Event %d : abort\n", status)); + cfg->escan_info.escan_state = WL_ESCAN_STATE_IDLE; + wl_escan_print_sync_id(status, escan_result->sync_id, @@ -1178616,7 +1179268,7 @@ index 000000000..8b9382deb + struct net_device *ndev = wdev_to_wlc_ndev(request->wdev, cfg); +#endif /* WL_CFG80211_P2P_DEV_IF */ + -+ WL_DBG(("Enter\n")); ++ WL_DBG(("Enter request wdev netdev=%s, wdev iftype=%d\n", ndev->name, request->wdev->iftype)); + RETURN_EIO_IF_NOT_UP(cfg); + +#ifdef DHD_IFDEBUG @@ -1178879,6 +1179531,20 @@ index 000000000..8b9382deb + WL_DBG(("wl_cfg80211_abort_scan: Scan abort issued to FW\n")); + } +} ++#else ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++void ++wl_cfg80211_abort_scan(struct wiphy *wiphy, struct wireless_dev *wdev) ++{ ++ struct bcm_cfg80211 *cfg; ++ ++ WL_DBG(("Enter wl_cfg80211_abort_scan\n")); ++ cfg = wiphy_priv(wdev->wiphy); ++ ++ /* cancel scan and notify scan status */ ++ wl_cfg80211_cancel_scan(cfg); ++} ++#endif +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) */ + +int wl_cfg80211_scan_stop(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev) @@ -1178915,9 +1179581,14 @@ index 000000000..8b9382deb +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)) + memset_s(&info, sizeof(struct cfg80211_scan_info), 0, sizeof(struct cfg80211_scan_info)); + info.aborted = aborted; ++ ++#ifndef CONFIG_AP6XXX_WIFI6_HDF + cfg80211_scan_done(cfg->scan_request, &info); ++#endif +#else ++#ifndef CONFIG_AP6XXX_WIFI6_HDF + cfg80211_scan_done(cfg->scan_request, aborted); ++#endif +#endif // endif + cfg->scan_request = NULL; +} @@ -1179170,9 +1179841,14 @@ index 000000000..8b9382deb + + bzero(&info, sizeof(struct cfg80211_scan_info)); + info.aborted = aborted; ++ ++#ifndef CONFIG_AP6XXX_WIFI6_HDF + cfg80211_scan_done(cfg->scan_request, &info); ++#endif +#else ++#ifndef CONFIG_AP6XXX_WIFI6_HDF + cfg80211_scan_done(cfg->scan_request, aborted); ++#endif +#endif // endif +} + @@ -1180043,7 +1180719,7 @@ new file mode 100755 index 000000000..236d3ed29 --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_cfgscan.h -@@ -0,0 +1,96 @@ +@@ -0,0 +1,101 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Header for Linux cfg80211 scan @@ -1180113,6 +1180789,11 @@ index 000000000..236d3ed29 +#endif /* WL_CFG80211_P2P_DEV_IF */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) +extern void wl_cfg80211_abort_scan(struct wiphy *wiphy, struct wireless_dev *wdev); ++#else ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++void ++wl_cfg80211_abort_scan(struct wiphy *wiphy, struct wireless_dev *wdev); ++#endif +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) */ +extern void wl_cfg80211_scan_abort(struct bcm_cfg80211 *cfg); +extern s32 wl_init_scan(struct bcm_cfg80211 *cfg); @@ -1192886,7 +1193567,7 @@ new file mode 100755 index 000000000..9281cdbe4 --- /dev/null +++ b/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd_wifi6/wl_iw.c -@@ -0,0 +1,4335 @@ +@@ -0,0 +1,4340 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Linux Wireless Extensions support @@ -1193131,8 +1193812,13 @@ index 000000000..9281cdbe4 +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) +#define WL_DEV_LINK(dev) (priv_link_t*)(dev->priv) +#else ++#ifdef CONFIG_AP6XXX_WIFI6_HDF ++void * VOID_DEV_PRIV(struct net_device *dev); ++#define WL_DEV_LINK(dev) (priv_link_t*)VOID_DEV_PRIV(dev) ++#else +#define WL_DEV_LINK(dev) (priv_link_t*)netdev_priv(dev) +#endif ++#endif + +/* dev to wl_iw_t */ +#define IW_DEV_IF(dev) ((wl_iw_t*)(WL_DEV_LINK(dev))->wliw)