📄 hostap_wlan.h
字号:
HOSTAP_QUEUE set_tim_queue; struct list_head set_tim_list; spinlock_t set_tim_lock; int wds_max_connections; int wds_connections;#define HOSTAP_WDS_BROADCAST_RA BIT(0)#define HOSTAP_WDS_AP_CLIENT BIT(1)#define HOSTAP_WDS_STANDARD_FRAME BIT(2) u32 wds_type; u16 tx_control; /* flags to be used in TX description */ int manual_retry_count; /* -1 = use f/w default; otherwise retry count * to be used with all frames */ struct iw_statistics wstats; unsigned long scan_timestamp; /* Time started to scan */ enum { PRISM2_MONITOR_80211 = 0, PRISM2_MONITOR_PRISM = 1, PRISM2_MONITOR_CAPHDR = 2 } monitor_type; int (*saved_eth_header_parse)(struct sk_buff *skb, unsigned char *haddr); int monitor_allow_fcserr; int hostapd; /* whether user space daemon, hostapd, is used for AP * management */ int hostapd_sta; /* whether hostapd is used with an extra STA interface */ struct net_device *apdev; struct net_device_stats apdevstats; char assoc_ap_addr[ETH_ALEN]; struct net_device *stadev; struct net_device_stats stadevstats;#define WEP_KEYS 4#define WEP_KEY_LEN 13 struct prism2_crypt_data *crypt[WEP_KEYS]; int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ struct timer_list crypt_deinit_timer; struct list_head crypt_deinit_list; int open_wep; /* allow unencrypted frames */ int host_encrypt; int host_decrypt; int privacy_invoked; /* force privacy invoked flag even if no keys are * configured */ int fw_encrypt_ok; /* whether firmware-based WEP encrypt is working * in Host AP mode (STA f/w 1.4.9 or newer) */ int bcrx_sta_key; /* use individual keys to override default keys even * with RX of broad/multicast frames */ struct prism2_frag_entry frag_cache[PRISM2_FRAG_CACHE_LEN]; unsigned int frag_next_idx; int ieee_802_1x; /* is IEEE 802.1X used */ int antsel_tx, antsel_rx; int rts_threshold; /* dot11RTSThreshold */ int fragm_threshold; /* dot11FragmentationThreshold */ int auth_algs; /* PRISM2_AUTH_ flags */ int enh_sec; /* cnfEnhSecurity options (broadcast SSID hide/ignore) */ int tallies32; /* 32-bit tallies in use */ struct prism2_helper_functions *func; int bus_master_threshold_tx; int bus_master_threshold_rx; u8 *bus_m1_buf; u8 *pda; int fw_ap;#define PRISM2_FW_VER(major, minor, variant) \(((major) << 16) | ((minor) << 8) | variant) u32 sta_fw_ver; /* Tasklets for handling hardware IRQ related operations outside hw IRQ * handler */ HOSTAP_TASKLET bap_tasklet; HOSTAP_TASKLET info_tasklet; struct sk_buff_head info_list; /* info frames as skb's for * info_tasklet */ struct hostap_tx_callback_info *tx_callback; /* registered TX callbacks */ HOSTAP_TASKLET rx_tasklet; struct sk_buff_head rx_list; HOSTAP_TASKLET sta_tx_exc_tasklet; struct sk_buff_head sta_tx_exc_list; int host_roaming; unsigned long last_join_time; /* time of last JoinRequest */ struct hfa384x_hostscan_result *last_scan_results; int last_scan_results_count; enum { PRISM2_SCAN, PRISM2_HOSTSCAN } last_scan_type; HOSTAP_QUEUE info_queue; long pending_info; /* bit field of pending info_queue items */#define PRISM2_INFO_PENDING_LINKSTATUS 0#define PRISM2_INFO_PENDING_SCANRESULTS 1 int prev_link_status; /* previous received LinkStatus info */ int prev_linkstatus_connected; u8 preferred_ap[6]; /* use this AP if possible */#ifdef PRISM2_CALLBACK void *callback_data; /* Can be used in callbacks; e.g., allocate * on enable event and free on disable event. * Host AP driver code does not touch this. */#endif /* PRISM2_CALLBACK */ wait_queue_head_t hostscan_wq; /* Passive scan in Host AP mode */ struct timer_list passive_scan_timer; int passive_scan_interval; /* in seconds, 0 = disabled */ int passive_scan_channel; enum { PASSIVE_SCAN_WAIT, PASSIVE_SCAN_LISTEN } passive_scan_state; struct timer_list tick_timer; unsigned long last_tick_timer; unsigned int sw_tick_stuck; /* commsQuality / dBmCommsQuality data from periodic polling; only * valid for Managed and Ad-hoc modes */ unsigned long last_comms_qual_update; int comms_qual; /* in some odd unit.. */ int avg_signal; /* in dB (note: negative) */ int avg_noise; /* in dB (note: negative) */ HOSTAP_QUEUE comms_qual_update; /* RSSI to dBm adjustment (for RX descriptor fields) */ int rssi_to_dBm; /* substract from RSSI to get approximate dBm value */ /* BSS list / protected by local->lock */ struct list_head bss_list; int num_bss_info; int wpa; /* WPA support enabled */ int tkip_countermeasures; int drop_unencrypted; /* Generic IEEE 802.11 info element to be added to * ProbeResp/Beacon/(Re)AssocReq */ u8 *generic_elem; size_t generic_elem_len;#ifdef PRISM2_DOWNLOAD_SUPPORT /* Persistent volatile download data */ struct prism2_download_data *dl_pri; struct prism2_download_data *dl_sec;#endif /* PRISM2_DOWNLOAD_SUPPORT */#ifdef PRISM2_IO_DEBUG#define PRISM2_IO_DEBUG_SIZE 10000 u32 io_debug[PRISM2_IO_DEBUG_SIZE]; int io_debug_head; int io_debug_enabled;#endif /* PRISM2_IO_DEBUG */ /* struct local_info is used also in hostap.o that does not define * any PRISM2_{PCCARD,PLX,PCI}. Make sure that the hardware version * specific fields are in the end of the struct (these could also be * moved to void *priv or something like that). */#ifdef PRISM2_PCCARD dev_node_t node; dev_link_t *link; int sandisk_connectplus;#endif /* PRISM2_PCCARD */#ifdef PRISM2_PLX void *attr_mem; unsigned int cor_offset;#endif /* PRISM2_PLX */#ifdef PRISM2_PCI#ifdef PRISM2_BUS_MASTER /* bus master for BAP0 (TX) */ int bus_m0_tx_idx; u8 *bus_m0_buf; /* bus master for BAP1 (RX) */ struct sk_buff *rx_skb;#endif /* PRISM2_BUS_MASTER */#ifdef CONFIG_PM#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) u32 pci_save_state[16];#endif#endif /* CONFIG_PM */#endif /* PRISM2_PCI */ /* NOTE! Do not add common entries here after hardware version * specific blocks. */};/* Per interface private Host AP data * Allocated for each net device that Host AP uses (wlan#, wlan#ap, wlan#sta, * WDS) and dev->priv points to this structure. */struct hostap_interface { struct list_head list; /* list entry in Host AP interface list */ struct net_device *dev; /* pointer to this device */ struct local_info *local; /* pointer to shared private data */ struct net_device_stats stats;#if WIRELESS_EXT > 15 /* Note: this data area must be at a fixed offset from dev->priv. * Unfortunately, this model does not fit the current Host AP netdev * data structure because this should really be in local_into_t that is * shared by all virtual interfaces. Currently, only the main data * device (wlan#) is used for iwspy entries. */ struct iw_spy_data spy_data; /* iwspy support */#if WIRELESS_EXT > 16 /* This is the fix for the problem described above. Jean II */ struct iw_public_data wireless_data;#endif /* WIRELESS_EXT > 16 */#endif /* WIRELESS_EXT > 15 */ enum { HOSTAP_INTERFACE_MASTER, HOSTAP_INTERFACE_MAIN, HOSTAP_INTERFACE_AP, HOSTAP_INTERFACE_STA, HOSTAP_INTERFACE_WDS, } type; union { struct hostap_interface_wds { u8 remote_addr[ETH_ALEN]; } wds; } u;};#define HOSTAP_SKB_TX_DATA_MAGIC 0xf08a36a2/* * TX meta data - stored in skb->cb buffer, so this must not be increased over * the 40-byte limit */struct hostap_skb_tx_data { u32 magic; /* HOSTAP_SKB_TX_DATA_MAGIC */ u8 rate; /* transmit rate */#define HOSTAP_TX_FLAGS_WDS BIT(0)#define HOSTAP_TX_FLAGS_BUFFERED_FRAME BIT(1)#define HOSTAP_TX_FLAGS_ADD_MOREDATA BIT(2) u8 flags; /* HOSTAP_TX_FLAGS_* */ u16 tx_cb_idx; struct hostap_interface *iface; unsigned long jiffies; /* queueing timestamp */ unsigned short ethertype;};#ifndef PRISM2_NO_DEBUG#define DEBUG_FID BIT(0)#define DEBUG_PS BIT(1)#define DEBUG_FLOW BIT(2)#define DEBUG_AP BIT(3)#define DEBUG_HW BIT(4)#define DEBUG_EXTRA BIT(5)#define DEBUG_EXTRA2 BIT(6)#define DEBUG_PS2 BIT(7)#define DEBUG_MASK (DEBUG_PS | DEBUG_AP | DEBUG_HW | DEBUG_EXTRA)#define PDEBUG(n, args...) \do { if ((n) & DEBUG_MASK) printk(KERN_DEBUG args); } while (0)#define PDEBUG2(n, args...) \do { if ((n) & DEBUG_MASK) printk(args); } while (0)#else /* PRISM2_NO_DEBUG */#define PDEBUG(n, args...)#define PDEBUG2(n, args...)#endif /* PRISM2_NO_DEBUG */enum { BAP0 = 0, BAP1 = 1 };#define PRISM2_IO_DEBUG_CMD_INB 0#define PRISM2_IO_DEBUG_CMD_INW 1#define PRISM2_IO_DEBUG_CMD_INSW 2#define PRISM2_IO_DEBUG_CMD_OUTB 3#define PRISM2_IO_DEBUG_CMD_OUTW 4#define PRISM2_IO_DEBUG_CMD_OUTSW 5#define PRISM2_IO_DEBUG_CMD_ERROR 6#define PRISM2_IO_DEBUG_CMD_INTERRUPT 7#ifdef PRISM2_IO_DEBUG#define PRISM2_IO_DEBUG_ENTRY(cmd, reg, value) \(((cmd) << 24) | ((reg) << 16) | value)static inline void prism2_io_debug_add(struct net_device *dev, int cmd, int reg, int value){ struct hostap_interface *iface = dev->priv; local_info_t *local = iface->local; if (!local->io_debug_enabled) return; local->io_debug[local->io_debug_head] = jiffies & 0xffffffff; if (++local->io_debug_head >= PRISM2_IO_DEBUG_SIZE) local->io_debug_head = 0; local->io_debug[local->io_debug_head] = PRISM2_IO_DEBUG_ENTRY(cmd, reg, value); if (++local->io_debug_head >= PRISM2_IO_DEBUG_SIZE) local->io_debug_head = 0;}static inline void prism2_io_debug_error(struct net_device *dev, int err){ struct hostap_interface *iface = dev->priv; local_info_t *local = iface->local; unsigned long flags; if (!local->io_debug_enabled) return; spin_lock_irqsave(&local->lock, flags); prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_ERROR, 0, err); if (local->io_debug_enabled == 1) { local->io_debug_enabled = 0; printk(KERN_DEBUG "%s: I/O debug stopped\n", dev->name); } spin_unlock_irqrestore(&local->lock, flags);}#else /* PRISM2_IO_DEBUG */static inline void prism2_io_debug_add(struct net_device *dev, int cmd, int reg, int value){}static inline void prism2_io_debug_error(struct net_device *dev, int err){}#endif /* PRISM2_IO_DEBUG */#ifdef PRISM2_CALLBACKenum { /* Called when card is enabled */ PRISM2_CALLBACK_ENABLE, /* Called when card is disabled */ PRISM2_CALLBACK_DISABLE, /* Called when RX/TX starts/ends */ PRISM2_CALLBACK_RX_START, PRISM2_CALLBACK_RX_END, PRISM2_CALLBACK_TX_START, PRISM2_CALLBACK_TX_END};void prism2_callback(local_info_t *local, int event);#else /* PRISM2_CALLBACK */#define prism2_callback(d, e) do { } while (0)#endif /* PRISM2_CALLBACK */#endif /* __KERNEL__ */#endif /* HOSTAP_WLAN_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -