1 /*
2 *
3 * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd.
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 */
15 #include <net/netlink.h>
16 #include <net/cfg80211.h>
17 #include <securec.h>
18 #include <linux/kernel.h>
19 #include <linux/skbuff.h>
20 #include <linux/slab.h>
21 #include <linux/printk.h>
22 #include <linux/in6.h>
23 #include <linux/wireless.h>
24
25 #include "osal_mem.h"
26 #include "net_device.h"
27 #include "net_device_impl.h"
28 #include "net_device_adapter.h"
29 #include "wifi_mac80211_ops.h"
30 #include "hdf_wifi_cmd.h"
31 #include "hdf_wifi_event.h"
32 #include "hdf_wl_interface.h"
33 #include "hdf_public_ap6256.h"
34 #include "hdf_mac80211_sta_event.h"
35
36 #define HDF_LOG_TAG BDH6Driver
37 #define WIFI_SCAN_EXTRA_IE_LEN_MAX (512)
38
HdfScanEventCallback(struct net_device * ndev,HdfWifiScanStatus _status)39 int32_t HdfScanEventCallback(struct net_device *ndev, HdfWifiScanStatus _status)
40 {
41 int32_t ret = 0;
42
43 NetDevice *netDev = GetHdfNetDeviceByLinuxInf(ndev);
44 WifiScanStatus status = _status;
45 netDev = get_hdf_netdev(g_scan_event_ifidx);
46 HDF_LOGE("%s: %d, scandone!", __func__, _status);
47 ret = HdfWifiEventScanDone(netDev, status);
48
49 return ret;
50 }
51
HdfDisconnectedEventCallback(struct net_device * ndev,uint16_t reason,uint8_t * ie,uint32_t len)52 int32_t HdfDisconnectedEventCallback(struct net_device *ndev, uint16_t reason, uint8_t *ie, uint32_t len)
53 {
54 int32_t ret = 0;
55
56 NetDevice *netDev = GetHdfNetDeviceByLinuxInf(ndev);
57 netDev = get_hdf_netdev(g_conn_event_ifidx);
58 HDF_LOGE("%s: leave", __func__);
59
60 ret = HdfWifiEventDisconnected(netDev, reason, ie, len);
61 return ret;
62 }
63