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