drv_types.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
  4. *
  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.
  8. *
  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
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. /*-------------------------------------------------------------------------------
  21. For type defines and data structure defines
  22. --------------------------------------------------------------------------------*/
  23. #ifndef __DRV_TYPES_H__
  24. #define __DRV_TYPES_H__
  25. #include <drv_conf.h>
  26. #include <basic_types.h>
  27. #include <osdep_service.h>
  28. #include <rtw_byteorder.h>
  29. #include <wlan_bssdef.h>
  30. #include <wifi.h>
  31. #include <ieee80211.h>
  32. #ifdef PLATFORM_OS_XP
  33. #include <drv_types_xp.h>
  34. #endif
  35. #ifdef PLATFORM_OS_CE
  36. #include <drv_types_ce.h>
  37. #endif
  38. #ifdef PLATFORM_LINUX
  39. #include <drv_types_linux.h>
  40. #endif
  41. enum _NIC_VERSION {
  42. RTL8711_NIC,
  43. RTL8712_NIC,
  44. RTL8713_NIC,
  45. RTL8716_NIC
  46. };
  47. typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER;
  48. #include <rtw_debug.h>
  49. #ifdef CONFIG_80211N_HT
  50. #include <rtw_ht.h>
  51. #endif
  52. #ifdef CONFIG_80211AC_VHT
  53. #include <rtw_vht.h>
  54. #endif
  55. #ifdef CONFIG_INTEL_WIDI
  56. #include <rtw_intel_widi.h>
  57. #endif
  58. #include <rtw_rf.h>
  59. #include <rtw_cmd.h>
  60. #include <cmd_osdep.h>
  61. #include <rtw_security.h>
  62. #include <rtw_xmit.h>
  63. #include <xmit_osdep.h>
  64. #include <rtw_recv.h>
  65. #include <recv_osdep.h>
  66. #include <rtw_efuse.h>
  67. #include <rtw_sreset.h>
  68. #include <hal_intf.h>
  69. #include <hal_com.h>
  70. #include <hal_com_led.h>
  71. #include <rtw_qos.h>
  72. #include <rtw_pwrctrl.h>
  73. #include <rtw_mlme.h>
  74. #include <mlme_osdep.h>
  75. #include <rtw_io.h>
  76. #include <rtw_ioctl.h>
  77. #include <rtw_ioctl_set.h>
  78. #include <rtw_ioctl_query.h>
  79. #include <rtw_ioctl_rtl.h>
  80. #include <osdep_intf.h>
  81. #include <rtw_eeprom.h>
  82. #include <sta_info.h>
  83. #include <rtw_event.h>
  84. #include <rtw_mlme_ext.h>
  85. #include <rtw_ap.h>
  86. #include <rtw_efuse.h>
  87. #include <rtw_version.h>
  88. #ifdef CONFIG_P2P
  89. #include <rtw_p2p.h>
  90. #endif // CONFIG_P2P
  91. #ifdef CONFIG_TDLS
  92. #include <rtw_tdls.h>
  93. #endif // CONFIG_TDLS
  94. #ifdef CONFIG_WAPI_SUPPORT
  95. #include <rtw_wapi.h>
  96. #endif // CONFIG_WAPI_SUPPORT
  97. #ifdef CONFIG_DRVEXT_MODULE
  98. #include <drvext_api.h>
  99. #endif // CONFIG_DRVEXT_MODULE
  100. #ifdef CONFIG_MP_INCLUDED
  101. #include <rtw_mp.h>
  102. #endif // CONFIG_MP_INCLUDED
  103. #ifdef CONFIG_BR_EXT
  104. #include <rtw_br_ext.h>
  105. #endif // CONFIG_BR_EXT
  106. #ifdef CONFIG_IOL
  107. #include <rtw_iol.h>
  108. #endif // CONFIG_IOL
  109. #ifdef CONFIG_BT_COEXIST
  110. #include <rtl8723a_hal.h>
  111. #endif // CONFIG_BT_COEXIST
  112. #ifdef CONFIG_IOCTL_CFG80211
  113. #include "ioctl_cfg80211.h"
  114. #endif //CONFIG_IOCTL_CFG80211
  115. #include <ip.h>
  116. #include <if_ether.h>
  117. #include <ethernet.h>
  118. #include <circ_buf.h>
  119. #include <rtw_android.h>
  120. #define SPEC_DEV_ID_NONE BIT(0)
  121. #define SPEC_DEV_ID_DISABLE_HT BIT(1)
  122. #define SPEC_DEV_ID_ENABLE_PS BIT(2)
  123. #define SPEC_DEV_ID_RF_CONFIG_1T1R BIT(3)
  124. #define SPEC_DEV_ID_RF_CONFIG_2T2R BIT(4)
  125. #define SPEC_DEV_ID_ASSIGN_IFNAME BIT(5)
  126. struct specific_device_id{
  127. u32 flags;
  128. u16 idVendor;
  129. u16 idProduct;
  130. };
  131. struct registry_priv
  132. {
  133. u8 chip_version;
  134. u8 rfintfs;
  135. u8 lbkmode;
  136. u8 hci;
  137. NDIS_802_11_SSID ssid;
  138. u8 network_mode; //infra, ad-hoc, auto
  139. u8 channel;//ad-hoc support requirement
  140. u8 wireless_mode;//A, B, G, auto
  141. u8 scan_mode;//active, passive
  142. u8 radio_enable;
  143. u8 preamble;//long, short, auto
  144. u8 vrtl_carrier_sense;//Enable, Disable, Auto
  145. u8 vcs_type;//RTS/CTS, CTS-to-self
  146. u16 rts_thresh;
  147. u16 frag_thresh;
  148. u8 adhoc_tx_pwr;
  149. u8 soft_ap;
  150. u8 power_mgnt;
  151. u8 ips_mode;
  152. u8 smart_ps;
  153. u8 long_retry_lmt;
  154. u8 short_retry_lmt;
  155. u16 busy_thresh;
  156. u8 ack_policy;
  157. u8 mp_mode;
  158. u8 software_encrypt;
  159. u8 software_decrypt;
  160. #ifdef CONFIG_TX_EARLY_MODE
  161. u8 early_mode;
  162. #endif
  163. u8 acm_method;
  164. //UAPSD
  165. u8 wmm_enable;
  166. u8 uapsd_enable;
  167. u8 uapsd_max_sp;
  168. u8 uapsd_acbk_en;
  169. u8 uapsd_acbe_en;
  170. u8 uapsd_acvi_en;
  171. u8 uapsd_acvo_en;
  172. WLAN_BSSID_EX dev_network;
  173. #ifdef CONFIG_80211N_HT
  174. u8 ht_enable;
  175. // 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160MHz
  176. // 2.4G use bit 0 ~ 3, 5G use bit 4 ~ 7
  177. // 0x21 means enable 2.4G 40MHz & 5G 80MHz
  178. u8 bw_mode;
  179. u8 ampdu_enable;//for tx
  180. u8 rx_stbc;
  181. u8 ampdu_amsdu;//A-MPDU Supports A-MSDU is permitted
  182. // Short GI support Bit Map
  183. // BIT0 - 20MHz, 1: support, 0: non-support
  184. // BIT1 - 40MHz, 1: support, 0: non-support
  185. // BIT2 - 80MHz, 1: support, 0: non-support
  186. // BIT3 - 160MHz, 1: support, 0: non-support
  187. u8 short_gi;
  188. #endif //CONFIG_80211N_HT
  189. #ifdef CONFIG_80211AC_VHT
  190. u8 vht_enable;
  191. u8 ampdu_factor;
  192. u8 vht_rate_sel;
  193. // BIT0: Enable VHT LDPC Rx, BIT1: Enable VHT LDPC Tx, BIT4: Enable HT LDPC Rx, BIT5: Enable HT LDPC Tx
  194. u8 ldpc_cap;
  195. // BIT0: Enable VHT STBC Rx, BIT1: Enable VHT STBC Tx, BIT4: Enable HT STBC Rx, BIT5: Enable HT STBC Tx
  196. u8 stbc_cap;
  197. // BIT0: Enable VHT Beamformer, BIT1: Enable VHT Beamformee, BIT4: Enable HT Beamformer, BIT5: Enable HT Beamformee
  198. u8 beamform_cap;
  199. #endif //CONFIG_80211AC_VHT
  200. u8 lowrate_two_xmit;
  201. u8 rf_config ;
  202. u8 low_power ;
  203. u8 wifi_spec;// !turbo_mode
  204. u8 channel_plan;
  205. #ifdef CONFIG_BT_COEXIST
  206. u8 btcoex;
  207. u8 bt_iso;
  208. u8 bt_sco;
  209. u8 bt_ampdu;
  210. #endif
  211. BOOLEAN bAcceptAddbaReq;
  212. u8 antdiv_cfg;
  213. u8 antdiv_type;
  214. u8 usbss_enable;//0:disable,1:enable
  215. u8 hwpdn_mode;//0:disable,1:enable,2:decide by EFUSE config
  216. u8 hwpwrp_detect;//0:disable,1:enable
  217. u8 hw_wps_pbc;//0:disable,1:enable
  218. #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
  219. char adaptor_info_caching_file_path[PATH_LENGTH_MAX];
  220. #endif
  221. #ifdef CONFIG_LAYER2_ROAMING
  222. u8 max_roaming_times; // the max number driver will try to roaming
  223. #endif
  224. #ifdef CONFIG_IOL
  225. u8 fw_iol; //enable iol without other concern
  226. #endif
  227. #ifdef CONFIG_DUALMAC_CONCURRENT
  228. u8 dmsp;//0:disable,1:enable
  229. #endif
  230. #ifdef CONFIG_80211D
  231. u8 enable80211d;
  232. #endif
  233. u8 ifname[16];
  234. u8 if2name[16];
  235. u8 notch_filter;
  236. #ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
  237. u8 force_ant;//0 normal,1 main,2 aux
  238. u8 force_igi;//0 normal
  239. #endif
  240. u8 regulatory_tid;
  241. //define for tx power adjust
  242. u32 RegTxPwrLimit;
  243. u8 RegEnableTxPowerLimit;
  244. u8 RegPowerBase;
  245. u8 RegPwrTblSel;
  246. u8 RegPwrByRate;
  247. s8 TxBBSwing_2G;
  248. s8 TxBBSwing_5G;
  249. u8 AmplifierType_2G;
  250. u8 AmplifierType_5G;
  251. u8 bEn_RFE;
  252. u8 RFE_Type;
  253. #ifdef CONFIG_MULTI_VIR_IFACES
  254. u8 ext_iface_num;//primary/secondary iface is excluded
  255. #endif
  256. #ifdef CONFIG_SW_LED
  257. u8 led_enable;
  258. #endif
  259. };
  260. //For registry parameters
  261. #define RGTRY_OFT(field) ((ULONG)FIELD_OFFSET(struct registry_priv,field))
  262. #define RGTRY_SZ(field) sizeof(((struct registry_priv*) 0)->field)
  263. #define BSSID_OFT(field) ((ULONG)FIELD_OFFSET(WLAN_BSSID_EX,field))
  264. #define BSSID_SZ(field) sizeof(((PWLAN_BSSID_EX) 0)->field)
  265. #define MAX_CONTINUAL_URB_ERR 4
  266. #ifdef CONFIG_SDIO_HCI
  267. #include <drv_types_sdio.h>
  268. #define INTF_DATA SDIO_DATA
  269. #elif defined(CONFIG_GSPI_HCI)
  270. #include <drv_types_gspi.h>
  271. #define INTF_DATA GSPI_DATA
  272. #elif defined(CONFIG_PCI_HCI)
  273. #include <drv_types_pci.h>
  274. #endif
  275. #define GET_PRIMARY_ADAPTER(padapter) (((_adapter *)padapter)->dvobj->if1)
  276. #define GET_IFACE_NUMS(padapter) (((_adapter *)padapter)->dvobj->iface_nums)
  277. #define GET_ADAPTER(padapter, iface_id) (((_adapter *)padapter)->dvobj->padapters[iface_id])
  278. enum _IFACE_ID {
  279. IFACE_ID0, //maping to PRIMARY_ADAPTER
  280. IFACE_ID1, //maping to SECONDARY_ADAPTER
  281. IFACE_ID2,
  282. IFACE_ID3,
  283. IFACE_ID_MAX,
  284. };
  285. struct dvobj_priv
  286. {
  287. _adapter *if1; //PRIMARY_ADAPTER
  288. _adapter *if2; //SECONDARY_ADAPTER
  289. //for local/global synchronization
  290. //
  291. _lock lock;
  292. int macid[NUM_STA];
  293. _mutex hw_init_mutex;
  294. _mutex h2c_fwcmd_mutex;
  295. _mutex setch_mutex;
  296. _mutex setbw_mutex;
  297. unsigned char oper_channel; //saved channel info when call set_channel_bw
  298. unsigned char oper_bwmode;
  299. unsigned char oper_ch_offset;//PRIME_CHNL_OFFSET
  300. //extend to support mulitu interface
  301. //padapters[IFACE_ID0] == if1
  302. //padapters[IFACE_ID1] == if2
  303. _adapter *padapters[IFACE_ID_MAX];
  304. u8 iface_nums; // total number of ifaces used runtime
  305. //For 92D, DMDP have 2 interface.
  306. u8 InterfaceNumber;
  307. u8 NumInterfaces;
  308. //In /Out Pipe information
  309. int RtInPipe[2];
  310. int RtOutPipe[3];
  311. u8 Queue2Pipe[HW_QUEUE_ENTRY];//for out pipe mapping
  312. u8 irq_alloc;
  313. /*-------- below is for SDIO INTERFACE --------*/
  314. #ifdef INTF_DATA
  315. INTF_DATA intf_data;
  316. #endif
  317. /*-------- below is for USB INTERFACE --------*/
  318. #ifdef CONFIG_USB_HCI
  319. u8 usb_speed; // 1.1, 2.0 or 3.0
  320. u8 nr_endpoint;
  321. u8 RtNumInPipes;
  322. u8 RtNumOutPipes;
  323. int ep_num[6]; //endpoint number
  324. int RegUsbSS;
  325. _sema usb_suspend_sema;
  326. #ifdef CONFIG_USB_VENDOR_REQ_MUTEX
  327. _mutex usb_vendor_req_mutex;
  328. #endif
  329. #ifdef CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
  330. u8 * usb_alloc_vendor_req_buf;
  331. u8 * usb_vendor_req_buf;
  332. #endif
  333. #ifdef PLATFORM_WINDOWS
  334. //related device objects
  335. PDEVICE_OBJECT pphysdevobj;//pPhysDevObj;
  336. PDEVICE_OBJECT pfuncdevobj;//pFuncDevObj;
  337. PDEVICE_OBJECT pnextdevobj;//pNextDevObj;
  338. u8 nextdevstacksz;//unsigned char NextDeviceStackSize; //= (CHAR)CEdevice->pUsbDevObj->StackSize + 1;
  339. //urb for control diescriptor request
  340. #ifdef PLATFORM_OS_XP
  341. struct _URB_CONTROL_DESCRIPTOR_REQUEST descriptor_urb;
  342. PUSB_CONFIGURATION_DESCRIPTOR pconfig_descriptor;//UsbConfigurationDescriptor;
  343. #endif
  344. #ifdef PLATFORM_OS_CE
  345. WCHAR active_path[MAX_ACTIVE_REG_PATH]; // adapter regpath
  346. USB_EXTENSION usb_extension;
  347. _nic_hdl pipehdls_r8192c[0x10];
  348. #endif
  349. u32 config_descriptor_len;//ULONG UsbConfigurationDescriptorLength;
  350. #endif//PLATFORM_WINDOWS
  351. #ifdef PLATFORM_LINUX
  352. struct usb_interface *pusbintf;
  353. struct usb_device *pusbdev;
  354. #endif//PLATFORM_LINUX
  355. #ifdef PLATFORM_FREEBSD
  356. struct usb_interface *pusbintf;
  357. struct usb_device *pusbdev;
  358. #endif//PLATFORM_FREEBSD
  359. ATOMIC_T continual_urb_error;
  360. #endif//CONFIG_USB_HCI
  361. /*-------- below is for PCIE INTERFACE --------*/
  362. #ifdef CONFIG_PCI_HCI
  363. #ifdef PLATFORM_LINUX
  364. struct pci_dev *ppcidev;
  365. //PCI MEM map
  366. unsigned long pci_mem_end; /* shared mem end */
  367. unsigned long pci_mem_start; /* shared mem start */
  368. //PCI IO map
  369. unsigned long pci_base_addr; /* device I/O address */
  370. //PciBridge
  371. struct pci_priv pcipriv;
  372. u16 irqline;
  373. u8 irq_enabled;
  374. RT_ISR_CONTENT isr_content;
  375. _lock irq_th_lock;
  376. //ASPM
  377. u8 const_pci_aspm;
  378. u8 const_amdpci_aspm;
  379. u8 const_hwsw_rfoff_d3;
  380. u8 const_support_pciaspm;
  381. // pci-e bridge */
  382. u8 const_hostpci_aspm_setting;
  383. // pci-e device */
  384. u8 const_devicepci_aspm_setting;
  385. u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00.
  386. u8 b_support_backdoor;
  387. u8 bdma64;
  388. #endif//PLATFORM_LINUX
  389. #endif//CONFIG_PCI_HCI
  390. };
  391. #ifdef PLATFORM_LINUX
  392. static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
  393. {
  394. /* todo: get interface type from dvobj and the return the dev accordingly */
  395. #ifdef RTW_DVOBJ_CHIP_HW_TYPE
  396. #endif
  397. #ifdef CONFIG_USB_HCI
  398. return &dvobj->pusbintf->dev;
  399. #endif
  400. #ifdef CONFIG_SDIO_HCI
  401. return &dvobj->intf_data.func->dev;
  402. #endif
  403. #ifdef CONFIG_GSPI_HCI
  404. return &dvobj->intf_data.func->dev;
  405. #endif
  406. #ifdef CONFIG_PCI_HCI
  407. return &dvobj->ppcidev->dev;
  408. #endif
  409. }
  410. #endif
  411. enum _IFACE_TYPE {
  412. IFACE_PORT0, //mapping to port0 for C/D series chips
  413. IFACE_PORT1, //mapping to port1 for C/D series chip
  414. MAX_IFACE_PORT,
  415. };
  416. enum _ADAPTER_TYPE {
  417. PRIMARY_ADAPTER,
  418. SECONDARY_ADAPTER,
  419. MAX_ADAPTER = 0xFF,
  420. };
  421. typedef enum _DRIVER_STATE{
  422. DRIVER_NORMAL = 0,
  423. DRIVER_DISAPPEAR = 1,
  424. DRIVER_REPLACE_DONGLE = 2,
  425. }DRIVER_STATE;
  426. #ifdef CONFIG_INTEL_PROXIM
  427. struct proxim {
  428. bool proxim_support;
  429. bool proxim_on;
  430. void *proximity_priv;
  431. int (*proxim_rx)(_adapter *padapter,
  432. union recv_frame *precv_frame);
  433. u8 (*proxim_get_var)(_adapter* padapter, u8 type);
  434. };
  435. #endif //CONFIG_INTEL_PROXIM
  436. #ifdef CONFIG_MAC_LOOPBACK_DRIVER
  437. typedef struct loopbackdata
  438. {
  439. _sema sema;
  440. _thread_hdl_ lbkthread;
  441. u8 bstop;
  442. u32 cnt;
  443. u16 size;
  444. u16 txsize;
  445. u8 txbuf[0x8000];
  446. u16 rxsize;
  447. u8 rxbuf[0x8000];
  448. u8 msg[100];
  449. }LOOPBACKDATA, *PLOOPBACKDATA;
  450. #endif
  451. struct _ADAPTER{
  452. int DriverState;// for disable driver using module, use dongle to replace module.
  453. int pid[3];//process id from UI, 0:wps, 1:hostapd, 2:dhcpcd
  454. int bDongle;//build-in module or external dongle
  455. u16 chip_type;
  456. u16 HardwareType;
  457. u16 interface_type;//USB,SDIO,SPI,PCI
  458. struct dvobj_priv *dvobj;
  459. struct mlme_priv mlmepriv;
  460. struct mlme_ext_priv mlmeextpriv;
  461. struct cmd_priv cmdpriv;
  462. struct evt_priv evtpriv;
  463. //struct io_queue *pio_queue;
  464. struct io_priv iopriv;
  465. struct xmit_priv xmitpriv;
  466. struct recv_priv recvpriv;
  467. struct sta_priv stapriv;
  468. struct security_priv securitypriv;
  469. struct registry_priv registrypriv;
  470. struct pwrctrl_priv pwrctrlpriv;
  471. struct eeprom_priv eeprompriv;
  472. struct led_priv ledpriv;
  473. #ifdef CONFIG_MP_INCLUDED
  474. struct mp_priv mppriv;
  475. #endif
  476. #ifdef CONFIG_DRVEXT_MODULE
  477. struct drvext_priv drvextpriv;
  478. #endif
  479. #ifdef CONFIG_AP_MODE
  480. struct hostapd_priv *phostapdpriv;
  481. #endif
  482. #ifdef CONFIG_IOCTL_CFG80211
  483. #ifdef CONFIG_P2P
  484. struct cfg80211_wifidirect_info cfg80211_wdinfo;
  485. #endif //CONFIG_P2P
  486. #endif //CONFIG_IOCTL_CFG80211
  487. u32 setband;
  488. #ifdef CONFIG_P2P
  489. struct wifidirect_info wdinfo;
  490. #endif //CONFIG_P2P
  491. #ifdef CONFIG_TDLS
  492. struct tdls_info tdlsinfo;
  493. #endif //CONFIG_TDLS
  494. #ifdef CONFIG_WAPI_SUPPORT
  495. u8 WapiSupport;
  496. RT_WAPI_T wapiInfo;
  497. #endif
  498. #ifdef CONFIG_WFD
  499. struct wifi_display_info wfd_info;
  500. #endif //CONFIG_WFD
  501. PVOID HalData;
  502. u32 hal_data_sz;
  503. struct hal_ops HalFunc;
  504. s32 bDriverStopped;
  505. s32 bSurpriseRemoved;
  506. s32 bCardDisableWOHSM;
  507. u32 IsrContent;
  508. u32 ImrContent;
  509. u8 EepromAddressSize;
  510. u8 hw_init_completed;
  511. u8 bDriverIsGoingToUnload;
  512. u8 init_adpt_in_progress;
  513. u8 bHaltInProgress;
  514. _thread_hdl_ cmdThread;
  515. _thread_hdl_ evtThread;
  516. _thread_hdl_ xmitThread;
  517. _thread_hdl_ recvThread;
  518. #ifndef PLATFORM_LINUX
  519. NDIS_STATUS (*dvobj_init)(struct dvobj_priv *dvobj);
  520. void (*dvobj_deinit)(struct dvobj_priv *dvobj);
  521. #endif
  522. void (*intf_start)(_adapter * adapter);
  523. void (*intf_stop)(_adapter * adapter);
  524. #ifdef PLATFORM_WINDOWS
  525. _nic_hdl hndis_adapter;//hNdisAdapter(NDISMiniportAdapterHandle);
  526. _nic_hdl hndis_config;//hNdisConfiguration;
  527. NDIS_STRING fw_img;
  528. u32 NdisPacketFilter;
  529. u8 MCList[MAX_MCAST_LIST_NUM][6];
  530. u32 MCAddrCount;
  531. #endif //end of PLATFORM_WINDOWS
  532. #ifdef PLATFORM_LINUX
  533. _nic_hdl pnetdev;
  534. // used by rtw_rereg_nd_name related function
  535. struct rereg_nd_name_data {
  536. _nic_hdl old_pnetdev;
  537. char old_ifname[IFNAMSIZ];
  538. u8 old_ips_mode;
  539. u8 old_bRegUseLed;
  540. } rereg_nd_name_priv;
  541. int bup;
  542. struct net_device_stats stats;
  543. struct iw_statistics iwstats;
  544. struct proc_dir_entry *dir_dev;// for proc directory
  545. #ifdef CONFIG_IOCTL_CFG80211
  546. struct wireless_dev *rtw_wdev;
  547. #endif //CONFIG_IOCTL_CFG80211
  548. #endif //end of PLATFORM_LINUX
  549. #ifdef PLATFORM_FREEBSD
  550. _nic_hdl pifp;
  551. int bup;
  552. _lock glock;
  553. #endif //PLATFORM_FREEBSD
  554. int net_closed;
  555. u8 bFWReady;
  556. u8 bBTFWReady;
  557. u8 bReadPortCancel;
  558. u8 bWritePortCancel;
  559. u8 bLinkInfoDump;
  560. // Added by Albert 2012/10/26
  561. // The driver will show up the desired channel number when this flag is 1.
  562. u8 bNotifyChannelChange;
  563. #ifdef CONFIG_P2P
  564. // Added by Albert 2012/12/06
  565. // The driver will show the current P2P status when the upper application reads it.
  566. u8 bShowGetP2PState;
  567. #endif
  568. #ifdef CONFIG_AUTOSUSPEND
  569. u8 bDisableAutosuspend;
  570. #endif
  571. //pbuddy_adapter is used only in two inteface case, (iface_nums=2 in struct dvobj_priv)
  572. //PRIMARY_ADAPTER's buddy is SECONDARY_ADAPTER
  573. //SECONDARY_ADAPTER's buddy is PRIMARY_ADAPTER
  574. //for iface_id > SECONDARY_ADAPTER(IFACE_ID1), refer to padapters[iface_id] in struct dvobj_priv
  575. //and their pbuddy_adapter is PRIMARY_ADAPTER.
  576. //for PRIMARY_ADAPTER(IFACE_ID0) can directly refer to if1 in struct dvobj_priv
  577. _adapter *pbuddy_adapter;
  578. #if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
  579. u8 isprimary; //is primary adapter or not
  580. //notes:
  581. // if isprimary is true, the adapter_type value is 0, iface_id is IFACE_ID0 for PRIMARY_ADAPTER
  582. // if isprimary is false, the adapter_type value is 1, iface_id is IFACE_ID1 for SECONDARY_ADAPTER
  583. // refer to iface_id if iface_nums>2 and isprimary is false and the adapter_type value is 0xff.
  584. u8 adapter_type;//used only in two inteface case(PRIMARY_ADAPTER and SECONDARY_ADAPTER) .
  585. u8 iface_type; //interface port type, it depends on HW port
  586. #endif //CONFIG_CONCURRENT_MODE || CONFIG_DUALMAC_CONCURRENT
  587. //extend to support multi interface
  588. //IFACE_ID0 is equals to PRIMARY_ADAPTER
  589. //IFACE_ID1 is equals to SECONDARY_ADAPTER
  590. u8 iface_id;
  591. #ifdef CONFIG_DUALMAC_CONCURRENT
  592. u8 DualMacConcurrent; // 1: DMSP 0:DMDP
  593. #endif
  594. #ifdef CONFIG_BR_EXT
  595. _lock br_ext_lock;
  596. //unsigned int macclone_completed;
  597. struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE];
  598. int pppoe_connection_in_progress;
  599. unsigned char pppoe_addr[MACADDRLEN];
  600. unsigned char scdb_mac[MACADDRLEN];
  601. unsigned char scdb_ip[4];
  602. struct nat25_network_db_entry *scdb_entry;
  603. unsigned char br_mac[MACADDRLEN];
  604. unsigned char br_ip[4];
  605. struct br_ext_info ethBrExtInfo;
  606. #endif // CONFIG_BR_EXT
  607. #ifdef CONFIG_INTEL_PROXIM
  608. /* intel Proximity, should be alloc mem
  609. * in intel Proximity module and can only
  610. * be used in intel Proximity mode */
  611. struct proxim proximity;
  612. #endif //CONFIG_INTEL_PROXIM
  613. #ifdef CONFIG_MAC_LOOPBACK_DRIVER
  614. PLOOPBACKDATA ploopback;
  615. #endif
  616. u8 fix_rate;
  617. unsigned char in_cta_test;
  618. };
  619. #define adapter_to_dvobj(adapter) (adapter->dvobj)
  620. int rtw_handle_dualmac(_adapter *adapter, bool init);
  621. __inline static u8 *myid(struct eeprom_priv *peepriv)
  622. {
  623. return (peepriv->mac_addr);
  624. }
  625. // HCI Related header file
  626. #ifdef CONFIG_USB_HCI
  627. #include <usb_osintf.h>
  628. #include <usb_ops.h>
  629. #include <usb_hal.h>
  630. #endif
  631. #ifdef CONFIG_SDIO_HCI
  632. #include <sdio_osintf.h>
  633. #include <sdio_ops.h>
  634. #include <sdio_hal.h>
  635. #endif
  636. #ifdef CONFIG_GSPI_HCI
  637. #include <gspi_osintf.h>
  638. #include <gspi_ops.h>
  639. #include <gspi_hal.h>
  640. #endif
  641. #ifdef CONFIG_PCI_HCI
  642. #include <pci_osintf.h>
  643. #include <pci_ops.h>
  644. #include <pci_hal.h>
  645. #endif
  646. #endif //__DRV_TYPES_H__