1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 ******************************************************************************/
15 #ifndef __IOCTL_CFG80211_H__
16 #define __IOCTL_CFG80211_H__
18 #include <linux/version.h>
20 struct rtw_wdev_invit_info {
21 u8 state; /* 0: req, 1:rep */
22 u8 peer_mac[ETH_ALEN];
31 #define rtw_wdev_invit_info_init(invit_info) \
33 (invit_info)->state = 0xff; \
34 memset((invit_info)->peer_mac, 0, ETH_ALEN); \
35 (invit_info)->active = 0xff; \
36 (invit_info)->token = 0; \
37 (invit_info)->flags = 0x00; \
38 (invit_info)->status = 0xff; \
39 (invit_info)->req_op_ch = 0; \
40 (invit_info)->rsp_op_ch = 0; \
43 struct rtw_wdev_nego_info {
44 u8 state; /* 0: req, 1:rep, 2:conf */
45 u8 peer_mac[ETH_ALEN];
57 #define rtw_wdev_nego_info_init(nego_info) \
59 (nego_info)->state = 0xff; \
60 memset((nego_info)->peer_mac, 0, ETH_ALEN); \
61 (nego_info)->active = 0xff; \
62 (nego_info)->token = 0; \
63 (nego_info)->status = 0xff; \
64 (nego_info)->req_intent = 0xff; \
65 (nego_info)->req_op_ch = 0; \
66 (nego_info)->req_listen_ch = 0; \
67 (nego_info)->rsp_intent = 0xff; \
68 (nego_info)->rsp_op_ch = 0; \
69 (nego_info)->conf_op_ch = 0; \
74 struct wireless_dev *rtw_wdev;
76 struct adapter *padapter;
78 struct cfg80211_scan_request *scan_request;
81 struct net_device *pmon_ndev;/* for monitor interface */
82 char ifname_mon[IFNAMSIZ + 1]; /* interface name for monitor interface */
86 u8 provdisc_req_issued;
88 struct rtw_wdev_invit_info invit_info;
89 struct rtw_wdev_nego_info nego_info;
96 #define wiphy_to_adapter(x) (*((struct adapter **)wiphy_priv(x)))
98 #define wdev_to_ndev(w) ((w)->netdev)
100 int rtw_wdev_alloc(struct adapter *padapter, struct device *dev);
101 void rtw_wdev_free(struct wireless_dev *wdev);
102 void rtw_wdev_unregister(struct wireless_dev *wdev);
104 void rtw_cfg80211_init_wiphy(struct adapter *padapter);
106 void rtw_cfg80211_unlink_bss(struct adapter *padapter, struct wlan_network *pnetwork);
107 void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter);
108 struct cfg80211_bss *rtw_cfg80211_inform_bss(struct adapter *padapter, struct wlan_network *pnetwork);
109 int rtw_cfg80211_check_bss(struct adapter *padapter);
110 void rtw_cfg80211_ibss_indicate_connect(struct adapter *padapter);
111 void rtw_cfg80211_indicate_connect(struct adapter *padapter);
112 void rtw_cfg80211_indicate_disconnect(struct adapter *padapter);
113 void rtw_cfg80211_indicate_scan_done(struct adapter *adapter, bool aborted);
115 void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
116 void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, unsigned char *da, unsigned short reason);
118 void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, uint frame_len, const char*msg);
120 bool rtw_cfg80211_pwr_mgmt(struct adapter *adapter);
122 #define rtw_cfg80211_rx_mgmt(adapter, freq, sig_dbm, buf, len, gfp) cfg80211_rx_mgmt((adapter)->rtw_wdev, freq, sig_dbm, buf, len, 0)
123 #define rtw_cfg80211_send_rx_assoc(adapter, bss, buf, len) cfg80211_send_rx_assoc((adapter)->pnetdev, bss, buf, len)
124 #define rtw_cfg80211_mgmt_tx_status(adapter, cookie, buf, len, ack, gfp) cfg80211_mgmt_tx_status((adapter)->rtw_wdev, cookie, buf, len, ack, gfp)
125 #define rtw_cfg80211_ready_on_channel(adapter, cookie, chan, channel_type, duration, gfp) cfg80211_ready_on_channel((adapter)->rtw_wdev, cookie, chan, duration, gfp)
126 #define rtw_cfg80211_remain_on_channel_expired(adapter, cookie, chan, chan_type, gfp) cfg80211_remain_on_channel_expired((adapter)->rtw_wdev, cookie, chan, gfp)
128 #endif /* __IOCTL_CFG80211_H__ */