Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef HOSTAP_80211_H
0003 #define HOSTAP_80211_H
0004 
0005 #include <linux/types.h>
0006 #include <linux/skbuff.h>
0007 #include <linux/netdevice.h>
0008 
0009 struct hostap_ieee80211_mgmt {
0010     __le16 frame_control;
0011     __le16 duration;
0012     u8 da[6];
0013     u8 sa[6];
0014     u8 bssid[6];
0015     __le16 seq_ctrl;
0016     union {
0017         struct {
0018             __le16 auth_alg;
0019             __le16 auth_transaction;
0020             __le16 status_code;
0021             /* possibly followed by Challenge text */
0022             u8 variable[0];
0023         } __packed auth;
0024         struct {
0025             __le16 reason_code;
0026         } __packed deauth;
0027         struct {
0028             __le16 capab_info;
0029             __le16 listen_interval;
0030             /* followed by SSID and Supported rates */
0031             u8 variable[0];
0032         } __packed assoc_req;
0033         struct {
0034             __le16 capab_info;
0035             __le16 status_code;
0036             __le16 aid;
0037             /* followed by Supported rates */
0038             u8 variable[0];
0039         } __packed assoc_resp, reassoc_resp;
0040         struct {
0041             __le16 capab_info;
0042             __le16 listen_interval;
0043             u8 current_ap[6];
0044             /* followed by SSID and Supported rates */
0045             u8 variable[0];
0046         } __packed reassoc_req;
0047         struct {
0048             __le16 reason_code;
0049         } __packed disassoc;
0050         struct {
0051         } __packed probe_req;
0052         struct {
0053             u8 timestamp[8];
0054             __le16 beacon_int;
0055             __le16 capab_info;
0056             /* followed by some of SSID, Supported rates,
0057              * FH Params, DS Params, CF Params, IBSS Params, TIM */
0058             u8 variable[0];
0059         } __packed beacon, probe_resp;
0060     } u;
0061 } __packed;
0062 
0063 
0064 #define IEEE80211_MGMT_HDR_LEN 24
0065 #define IEEE80211_DATA_HDR3_LEN 24
0066 #define IEEE80211_DATA_HDR4_LEN 30
0067 
0068 
0069 struct hostap_80211_rx_status {
0070     u32 mac_time;
0071     u8 signal;
0072     u8 noise;
0073     u16 rate; /* in 100 kbps */
0074 };
0075 
0076 /* prism2_rx_80211 'type' argument */
0077 enum {
0078     PRISM2_RX_MONITOR, PRISM2_RX_MGMT, PRISM2_RX_NON_ASSOC,
0079     PRISM2_RX_NULLFUNC_ACK
0080 };
0081 
0082 int prism2_rx_80211(struct net_device *dev, struct sk_buff *skb,
0083             struct hostap_80211_rx_status *rx_stats, int type);
0084 void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
0085              struct hostap_80211_rx_status *rx_stats);
0086 void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
0087               struct hostap_80211_rx_status *rx_stats);
0088 
0089 void hostap_dump_tx_80211(const char *name, struct sk_buff *skb);
0090 netdev_tx_t hostap_data_start_xmit(struct sk_buff *skb,
0091                    struct net_device *dev);
0092 netdev_tx_t hostap_mgmt_start_xmit(struct sk_buff *skb,
0093                    struct net_device *dev);
0094 netdev_tx_t hostap_master_start_xmit(struct sk_buff *skb,
0095                      struct net_device *dev);
0096 
0097 #endif /* HOSTAP_80211_H */