1/*--------------------------------------------------------------------- 2 3 For type defines and data structure defines 4 5-----------------------------------------------------------------------*/ 6#ifndef __DRV_TYPES_H__ 7#define __DRV_TYPES_H__ 8 9struct _adapter; 10 11#include "osdep_service.h" 12#include "wlan_bssdef.h" 13#include "rtl8712_spec.h" 14#include "rtl8712_hal.h" 15 16enum _NIC_VERSION { 17 RTL8711_NIC, 18 RTL8712_NIC, 19 RTL8713_NIC, 20 RTL8716_NIC 21}; 22 23struct _adapter; 24 25struct qos_priv { 26 /* bit mask option: u-apsd, s-apsd, ts, block ack... */ 27 unsigned int qos_option; 28}; 29 30#include "rtl871x_ht.h" 31#include "rtl871x_cmd.h" 32#include "wlan_bssdef.h" 33#include "rtl871x_xmit.h" 34#include "rtl871x_recv.h" 35#include "rtl871x_security.h" 36#include "rtl871x_pwrctrl.h" 37#include "rtl871x_io.h" 38#include "rtl871x_eeprom.h" 39#include "sta_info.h" 40#include "rtl871x_mlme.h" 41#include "rtl871x_mp.h" 42#include "rtl871x_debug.h" 43#include "rtl871x_rf.h" 44#include "rtl871x_event.h" 45#include "rtl871x_led.h" 46 47#define SPEC_DEV_ID_NONE BIT(0) 48#define SPEC_DEV_ID_DISABLE_HT BIT(1) 49#define SPEC_DEV_ID_ENABLE_PS BIT(2) 50 51struct specific_device_id { 52 u32 flags; 53 u16 idVendor; 54 u16 idProduct; 55 56}; 57 58struct registry_priv { 59 u8 chip_version; 60 u8 rfintfs; 61 u8 lbkmode; 62 u8 hci; 63 u8 network_mode; /*infra, ad-hoc, auto*/ 64 struct ndis_802_11_ssid ssid; 65 u8 channel;/* ad-hoc support requirement */ 66 u8 wireless_mode;/* A, B, G, auto */ 67 u8 vrtl_carrier_sense; /*Enable, Disable, Auto*/ 68 u8 vcs_type;/*RTS/CTS, CTS-to-self*/ 69 u16 rts_thresh; 70 u16 frag_thresh; 71 u8 preamble;/*long, short, auto*/ 72 u8 scan_mode;/*active, passive*/ 73 u8 adhoc_tx_pwr; 74 u8 soft_ap; 75 u8 smart_ps; 76 u8 power_mgnt; 77 u8 radio_enable; 78 u8 long_retry_lmt; 79 u8 short_retry_lmt; 80 u16 busy_thresh; 81 u8 ack_policy; 82 u8 mp_mode; 83 u8 software_encrypt; 84 u8 software_decrypt; 85 /* UAPSD */ 86 u8 wmm_enable; 87 u8 uapsd_enable; 88 u8 uapsd_max_sp; 89 u8 uapsd_acbk_en; 90 u8 uapsd_acbe_en; 91 u8 uapsd_acvi_en; 92 u8 uapsd_acvo_en; 93 94 struct wlan_bssid_ex dev_network; 95 96 u8 ht_enable; 97 u8 cbw40_enable; 98 u8 ampdu_enable;/*for tx*/ 99 u8 rf_config; 100 u8 low_power; 101 u8 wifi_test; 102}; 103 104/* For registry parameters */ 105#define RGTRY_OFT(field) ((addr_t)FIELD_OFFSET(struct registry_priv, field)) 106#define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field) 107#define BSSID_OFT(field) ((addr_t)FIELD_OFFSET(struct ndis_wlan_bssid_ex, \ 108 field)) 109#define BSSID_SZ(field) sizeof(((struct ndis_wlan_bssid_ex *)0)->field) 110 111struct dvobj_priv { 112 struct _adapter *padapter; 113 u32 nr_endpoint; 114 u8 ishighspeed; 115 uint(*inirp_init)(struct _adapter *adapter); 116 uint(*inirp_deinit)(struct _adapter *adapter); 117 struct semaphore usb_suspend_sema; 118 struct usb_device *pusbdev; 119}; 120 121struct _adapter { 122 struct dvobj_priv dvobjpriv; 123 struct mlme_priv mlmepriv; 124 struct cmd_priv cmdpriv; 125 struct evt_priv evtpriv; 126 struct io_queue *pio_queue; 127 struct xmit_priv xmitpriv; 128 struct recv_priv recvpriv; 129 struct sta_priv stapriv; 130 struct security_priv securitypriv; 131 struct registry_priv registrypriv; 132 struct wlan_acl_pool acl_list; 133 struct pwrctrl_priv pwrctrlpriv; 134 struct eeprom_priv eeprompriv; 135 struct hal_priv halpriv; 136 struct led_priv ledpriv; 137 struct mp_priv mppriv; 138 s32 bDriverStopped; 139 s32 bSurpriseRemoved; 140 u32 IsrContent; 141 u32 ImrContent; 142 u8 EepromAddressSize; 143 u8 hw_init_completed; 144 struct task_struct *cmdThread; 145 pid_t evtThread; 146 struct task_struct *xmitThread; 147 pid_t recvThread; 148 uint(*dvobj_init)(struct _adapter *adapter); 149 void (*dvobj_deinit)(struct _adapter *adapter); 150 struct net_device *pnetdev; 151 int bup; 152 struct net_device_stats stats; 153 struct iw_statistics iwstats; 154 int pid; /*process id from UI*/ 155}; 156 157static inline u8 *myid(struct eeprom_priv *peepriv) 158{ 159 return peepriv->mac_addr; 160} 161 162u8 r8712_usb_hal_bus_init(struct _adapter *adapter); 163 164#endif /*__DRV_TYPES_H__*/ 165 166