• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * hdf_wl_interface.h
3  *
4  * hdf driver
5  *
6  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21  */
22 
23 #ifndef HDF_WL_INTERFACE_H
24 #define HDF_WL_INTERFACE_H
25 #include <net/cfg80211.h>
26 #include <linux/netdevice.h>
27 #include "net_device.h"
28 
29 enum hdf_inf_type {
30     HDF_INF_WLAN0 = 0,
31     HDF_INF_P2P0,
32     HDF_INF_P2P1,
33     HDF_INF_AP0,
34     HDF_INF_MAX
35 };
36 
37 struct hdf_eapol_event_s {
38     struct work_struct eapol_report;
39     NetBufQueue eapolQueue;
40     int32_t idx;
41 };
42 
43 struct hdf_inf_map {
44     struct NetDevice  *hnetdev;
45     struct net_device *netdev;
46     struct wireless_dev *wdev;
47     u8 macaddr[ETH_ALEN];
48     struct hdf_eapol_event_s eapolEvent;
49 };
50 
51 struct InnerConnetResult {
52     uint8_t   *bssid;  /**< MAC address of the AP associated with the station */
53     uint16_t  statusCode;           /**< 16-bit status code defined in the IEEE protocol */
54     uint8_t  *rspIe;                /**< Association response IE */
55     uint8_t  *reqIe;                /**< Association request IE */
56     uint32_t  reqIeLen;             /**< Length of the association request IE */
57     uint32_t  rspIeLen;             /**< Length of the association response IE */
58     uint16_t  connectStatus;        /**< Connection status */
59     uint16_t  freq;                 /**< Frequency of the AP */
60 };
61 
62 struct InnerBssInfo {
63     struct ieee80211_channel *channel;
64     int32_t signal;
65     int16_t freq;
66     struct ieee80211_mgmt *mgmt;
67     uint32_t mgmtLen;
68 };
69 
bdh6_hdf_vxx_lock(struct wireless_dev * vxx,int pad)70 static inline int bdh6_hdf_vxx_lock(struct wireless_dev *vxx, int pad)
71     __acquires(vxx)
72 {
73     pad = 0;
74     mutex_lock(&vxx->mtx);
75     __acquire(vxx->mtx);
76     return pad;
77 }
78 
bdh6_hdf_vxx_unlock(struct wireless_dev * vxx,int pad)79 static inline int bdh6_hdf_vxx_unlock(struct wireless_dev *vxx, int pad)
80     __releases(vxx)
81 {
82     pad = 1;
83     __release(vxx->mtx);
84     mutex_unlock(&vxx->mtx);
85     return pad;
86 }
87 
88 void eapol_report_handler(struct work_struct *work_data);
89 #endif
90