drv_types.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  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. };
  257. //For registry parameters
  258. #define RGTRY_OFT(field) ((ULONG)FIELD_OFFSET(struct registry_priv,field))
  259. #define RGTRY_SZ(field) sizeof(((struct registry_priv*) 0)->field)
  260. #define BSSID_OFT(field) ((ULONG)FIELD_OFFSET(WLAN_BSSID_EX,field))
  261. #define BSSID_SZ(field) sizeof(((PWLAN_BSSID_EX) 0)->field)
  262. #define MAX_CONTINUAL_URB_ERR 4
  263. #ifdef CONFIG_SDIO_HCI
  264. #include <drv_types_sdio.h>
  265. #define INTF_DATA SDIO_DATA
  266. #elif defined(CONFIG_GSPI_HCI)
  267. #include <drv_types_gspi.h>
  268. #define INTF_DATA GSPI_DATA
  269. #elif defined(CONFIG_PCI_HCI)
  270. #include <drv_types_pci.h>
  271. #endif
  272. #define GET_PRIMARY_ADAPTER(padapter) (((_adapter *)padapter)->dvobj->if1)
  273. #define GET_IFACE_NUMS(padapter) (((_adapter *)padapter)->dvobj->iface_nums)
  274. #define GET_ADAPTER(padapter, iface_id) (((_adapter *)padapter)->dvobj->padapters[iface_id])
  275. enum _IFACE_ID {
  276. IFACE_ID0, //maping to PRIMARY_ADAPTER
  277. IFACE_ID1, //maping to SECONDARY_ADAPTER
  278. IFACE_ID2,
  279. IFACE_ID3,
  280. IFACE_ID_MAX,
  281. };
  282. struct dvobj_priv
  283. {
  284. _adapter *if1; //PRIMARY_ADAPTER
  285. _adapter *if2; //SECONDARY_ADAPTER
  286. //for local/global synchronization
  287. //
  288. _lock lock;
  289. int macid[NUM_STA];
  290. _mutex hw_init_mutex;
  291. _mutex h2c_fwcmd_mutex;
  292. _mutex setch_mutex;
  293. _mutex setbw_mutex;
  294. unsigned char oper_channel; //saved channel info when call set_channel_bw
  295. unsigned char oper_bwmode;
  296. unsigned char oper_ch_offset;//PRIME_CHNL_OFFSET
  297. //extend to support mulitu interface
  298. //padapters[IFACE_ID0] == if1
  299. //padapters[IFACE_ID1] == if2
  300. _adapter *padapters[IFACE_ID_MAX];
  301. u8 iface_nums; // total number of ifaces used runtime
  302. //For 92D, DMDP have 2 interface.
  303. u8 InterfaceNumber;
  304. u8 NumInterfaces;
  305. //In /Out Pipe information
  306. int RtInPipe[2];
  307. int RtOutPipe[3];
  308. u8 Queue2Pipe[HW_QUEUE_ENTRY];//for out pipe mapping
  309. u8 irq_alloc;
  310. /*-------- below is for SDIO INTERFACE --------*/
  311. #ifdef INTF_DATA
  312. INTF_DATA intf_data;
  313. #endif
  314. /*-------- below is for USB INTERFACE --------*/
  315. #ifdef CONFIG_USB_HCI
  316. u8 usb_speed; // 1.1, 2.0 or 3.0
  317. u8 nr_endpoint;
  318. u8 RtNumInPipes;
  319. u8 RtNumOutPipes;
  320. int ep_num[6]; //endpoint number
  321. int RegUsbSS;
  322. _sema usb_suspend_sema;
  323. #ifdef CONFIG_USB_VENDOR_REQ_MUTEX
  324. _mutex usb_vendor_req_mutex;
  325. #endif
  326. #ifdef CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
  327. u8 * usb_alloc_vendor_req_buf;
  328. u8 * usb_vendor_req_buf;
  329. #endif
  330. #ifdef PLATFORM_WINDOWS
  331. //related device objects
  332. PDEVICE_OBJECT pphysdevobj;//pPhysDevObj;
  333. PDEVICE_OBJECT pfuncdevobj;//pFuncDevObj;
  334. PDEVICE_OBJECT pnextdevobj;//pNextDevObj;
  335. u8 nextdevstacksz;//unsigned char NextDeviceStackSize; //= (CHAR)CEdevice->pUsbDevObj->StackSize + 1;
  336. //urb for control diescriptor request
  337. #ifdef PLATFORM_OS_XP
  338. struct _URB_CONTROL_DESCRIPTOR_REQUEST descriptor_urb;
  339. PUSB_CONFIGURATION_DESCRIPTOR pconfig_descriptor;//UsbConfigurationDescriptor;
  340. #endif
  341. #ifdef PLATFORM_OS_CE
  342. WCHAR active_path[MAX_ACTIVE_REG_PATH]; // adapter regpath
  343. USB_EXTENSION usb_extension;
  344. _nic_hdl pipehdls_r8192c[0x10];
  345. #endif
  346. u32 config_descriptor_len;//ULONG UsbConfigurationDescriptorLength;
  347. #endif//PLATFORM_WINDOWS
  348. #ifdef PLATFORM_LINUX
  349. struct usb_interface *pusbintf;
  350. struct usb_device *pusbdev;
  351. #endif//PLATFORM_LINUX
  352. #ifdef PLATFORM_FREEBSD
  353. struct usb_interface *pusbintf;
  354. struct usb_device *pusbdev;
  355. #endif//PLATFORM_FREEBSD
  356. ATOMIC_T continual_urb_error;
  357. #endif//CONFIG_USB_HCI
  358. /*-------- below is for PCIE INTERFACE --------*/
  359. #ifdef CONFIG_PCI_HCI
  360. #ifdef PLATFORM_LINUX
  361. struct pci_dev *ppcidev;
  362. //PCI MEM map
  363. unsigned long pci_mem_end; /* shared mem end */
  364. unsigned long pci_mem_start; /* shared mem start */
  365. //PCI IO map
  366. unsigned long pci_base_addr; /* device I/O address */
  367. //PciBridge
  368. struct pci_priv pcipriv;
  369. u16 irqline;
  370. u8 irq_enabled;
  371. RT_ISR_CONTENT isr_content;
  372. _lock irq_th_lock;
  373. //ASPM
  374. u8 const_pci_aspm;
  375. u8 const_amdpci_aspm;
  376. u8 const_hwsw_rfoff_d3;
  377. u8 const_support_pciaspm;
  378. // pci-e bridge */
  379. u8 const_hostpci_aspm_setting;
  380. // pci-e device */
  381. u8 const_devicepci_aspm_setting;
  382. u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00.
  383. u8 b_support_backdoor;
  384. u8 bdma64;
  385. #endif//PLATFORM_LINUX
  386. #endif//CONFIG_PCI_HCI
  387. };
  388. #ifdef PLATFORM_LINUX
  389. static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
  390. {
  391. /* todo: get interface type from dvobj and the return the dev accordingly */
  392. #ifdef RTW_DVOBJ_CHIP_HW_TYPE
  393. #endif
  394. #ifdef CONFIG_USB_HCI
  395. return &dvobj->pusbintf->dev;
  396. #endif
  397. #ifdef CONFIG_SDIO_HCI
  398. return &dvobj->intf_data.func->dev;
  399. #endif
  400. #ifdef CONFIG_GSPI_HCI
  401. return &dvobj->intf_data.func->dev;
  402. #endif
  403. #ifdef CONFIG_PCI_HCI
  404. return &dvobj->ppcidev->dev;
  405. #endif
  406. }
  407. #endif
  408. enum _IFACE_TYPE {
  409. IFACE_PORT0, //mapping to port0 for C/D series chips
  410. IFACE_PORT1, //mapping to port1 for C/D series chip
  411. MAX_IFACE_PORT,
  412. };
  413. enum _ADAPTER_TYPE {
  414. PRIMARY_ADAPTER,
  415. SECONDARY_ADAPTER,
  416. MAX_ADAPTER = 0xFF,
  417. };
  418. typedef enum _DRIVER_STATE{
  419. DRIVER_NORMAL = 0,
  420. DRIVER_DISAPPEAR = 1,
  421. DRIVER_REPLACE_DONGLE = 2,
  422. }DRIVER_STATE;
  423. #ifdef CONFIG_INTEL_PROXIM
  424. struct proxim {
  425. bool proxim_support;
  426. bool proxim_on;
  427. void *proximity_priv;
  428. int (*proxim_rx)(_adapter *padapter,
  429. union recv_frame *precv_frame);
  430. u8 (*proxim_get_var)(_adapter* padapter, u8 type);
  431. };
  432. #endif //CONFIG_INTEL_PROXIM
  433. #ifdef CONFIG_MAC_LOOPBACK_DRIVER
  434. typedef struct loopbackdata
  435. {
  436. _sema sema;
  437. _thread_hdl_ lbkthread;
  438. u8 bstop;
  439. u32 cnt;
  440. u16 size;
  441. u16 txsize;
  442. u8 txbuf[0x8000];
  443. u16 rxsize;
  444. u8 rxbuf[0x8000];
  445. u8 msg[100];
  446. }LOOPBACKDATA, *PLOOPBACKDATA;
  447. #endif
  448. struct _ADAPTER{
  449. int DriverState;// for disable driver using module, use dongle to replace module.
  450. int pid[3];//process id from UI, 0:wps, 1:hostapd, 2:dhcpcd
  451. int bDongle;//build-in module or external dongle
  452. u16 chip_type;
  453. u16 HardwareType;
  454. u16 interface_type;//USB,SDIO,SPI,PCI
  455. struct dvobj_priv *dvobj;
  456. struct mlme_priv mlmepriv;
  457. struct mlme_ext_priv mlmeextpriv;
  458. struct cmd_priv cmdpriv;
  459. struct evt_priv evtpriv;
  460. //struct io_queue *pio_queue;
  461. struct io_priv iopriv;
  462. struct xmit_priv xmitpriv;
  463. struct recv_priv recvpriv;
  464. struct sta_priv stapriv;
  465. struct security_priv securitypriv;
  466. struct registry_priv registrypriv;
  467. struct pwrctrl_priv pwrctrlpriv;
  468. struct eeprom_priv eeprompriv;
  469. struct led_priv ledpriv;
  470. #ifdef CONFIG_MP_INCLUDED
  471. struct mp_priv mppriv;
  472. #endif
  473. #ifdef CONFIG_DRVEXT_MODULE
  474. struct drvext_priv drvextpriv;
  475. #endif
  476. #ifdef CONFIG_AP_MODE
  477. struct hostapd_priv *phostapdpriv;
  478. #endif
  479. #ifdef CONFIG_IOCTL_CFG80211
  480. #ifdef CONFIG_P2P
  481. struct cfg80211_wifidirect_info cfg80211_wdinfo;
  482. #endif //CONFIG_P2P
  483. #endif //CONFIG_IOCTL_CFG80211
  484. u32 setband;
  485. #ifdef CONFIG_P2P
  486. struct wifidirect_info wdinfo;
  487. #endif //CONFIG_P2P
  488. #ifdef CONFIG_TDLS
  489. struct tdls_info tdlsinfo;
  490. #endif //CONFIG_TDLS
  491. #ifdef CONFIG_WAPI_SUPPORT
  492. u8 WapiSupport;
  493. RT_WAPI_T wapiInfo;
  494. #endif
  495. #ifdef CONFIG_WFD
  496. struct wifi_display_info wfd_info;
  497. #endif //CONFIG_WFD
  498. PVOID HalData;
  499. u32 hal_data_sz;
  500. struct hal_ops HalFunc;
  501. s32 bDriverStopped;
  502. s32 bSurpriseRemoved;
  503. s32 bCardDisableWOHSM;
  504. u32 IsrContent;
  505. u32 ImrContent;
  506. u8 EepromAddressSize;
  507. u8 hw_init_completed;
  508. u8 bDriverIsGoingToUnload;
  509. u8 init_adpt_in_progress;
  510. u8 bHaltInProgress;
  511. _thread_hdl_ cmdThread;
  512. _thread_hdl_ evtThread;
  513. _thread_hdl_ xmitThread;
  514. _thread_hdl_ recvThread;
  515. #ifndef PLATFORM_LINUX
  516. NDIS_STATUS (*dvobj_init)(struct dvobj_priv *dvobj);
  517. void (*dvobj_deinit)(struct dvobj_priv *dvobj);
  518. #endif
  519. void (*intf_start)(_adapter * adapter);
  520. void (*intf_stop)(_adapter * adapter);
  521. #ifdef PLATFORM_WINDOWS
  522. _nic_hdl hndis_adapter;//hNdisAdapter(NDISMiniportAdapterHandle);
  523. _nic_hdl hndis_config;//hNdisConfiguration;
  524. NDIS_STRING fw_img;
  525. u32 NdisPacketFilter;
  526. u8 MCList[MAX_MCAST_LIST_NUM][6];
  527. u32 MCAddrCount;
  528. #endif //end of PLATFORM_WINDOWS
  529. #ifdef PLATFORM_LINUX
  530. _nic_hdl pnetdev;
  531. // used by rtw_rereg_nd_name related function
  532. struct rereg_nd_name_data {
  533. _nic_hdl old_pnetdev;
  534. char old_ifname[IFNAMSIZ];
  535. u8 old_ips_mode;
  536. u8 old_bRegUseLed;
  537. } rereg_nd_name_priv;
  538. int bup;
  539. struct net_device_stats stats;
  540. struct iw_statistics iwstats;
  541. struct proc_dir_entry *dir_dev;// for proc directory
  542. #ifdef CONFIG_IOCTL_CFG80211
  543. struct wireless_dev *rtw_wdev;
  544. #endif //CONFIG_IOCTL_CFG80211
  545. #endif //end of PLATFORM_LINUX
  546. #ifdef PLATFORM_FREEBSD
  547. _nic_hdl pifp;
  548. int bup;
  549. _lock glock;
  550. #endif //PLATFORM_FREEBSD
  551. int net_closed;
  552. u8 bFWReady;
  553. u8 bBTFWReady;
  554. u8 bReadPortCancel;
  555. u8 bWritePortCancel;
  556. u8 bLinkInfoDump;
  557. // Added by Albert 2012/10/26
  558. // The driver will show up the desired channel number when this flag is 1.
  559. u8 bNotifyChannelChange;
  560. #ifdef CONFIG_P2P
  561. // Added by Albert 2012/12/06
  562. // The driver will show the current P2P status when the upper application reads it.
  563. u8 bShowGetP2PState;
  564. #endif
  565. #ifdef CONFIG_AUTOSUSPEND
  566. u8 bDisableAutosuspend;
  567. #endif
  568. //pbuddy_adapter is used only in two inteface case, (iface_nums=2 in struct dvobj_priv)
  569. //PRIMARY_ADAPTER's buddy is SECONDARY_ADAPTER
  570. //SECONDARY_ADAPTER's buddy is PRIMARY_ADAPTER
  571. //for iface_id > SECONDARY_ADAPTER(IFACE_ID1), refer to padapters[iface_id] in struct dvobj_priv
  572. //and their pbuddy_adapter is PRIMARY_ADAPTER.
  573. //for PRIMARY_ADAPTER(IFACE_ID0) can directly refer to if1 in struct dvobj_priv
  574. _adapter *pbuddy_adapter;
  575. #if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
  576. u8 isprimary; //is primary adapter or not
  577. //notes:
  578. // if isprimary is true, the adapter_type value is 0, iface_id is IFACE_ID0 for PRIMARY_ADAPTER
  579. // if isprimary is false, the adapter_type value is 1, iface_id is IFACE_ID1 for SECONDARY_ADAPTER
  580. // refer to iface_id if iface_nums>2 and isprimary is false and the adapter_type value is 0xff.
  581. u8 adapter_type;//used only in two inteface case(PRIMARY_ADAPTER and SECONDARY_ADAPTER) .
  582. u8 iface_type; //interface port type, it depends on HW port
  583. #endif //CONFIG_CONCURRENT_MODE || CONFIG_DUALMAC_CONCURRENT
  584. //extend to support multi interface
  585. //IFACE_ID0 is equals to PRIMARY_ADAPTER
  586. //IFACE_ID1 is equals to SECONDARY_ADAPTER
  587. u8 iface_id;
  588. #ifdef CONFIG_DUALMAC_CONCURRENT
  589. u8 DualMacConcurrent; // 1: DMSP 0:DMDP
  590. #endif
  591. #ifdef CONFIG_BR_EXT
  592. _lock br_ext_lock;
  593. //unsigned int macclone_completed;
  594. struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE];
  595. int pppoe_connection_in_progress;
  596. unsigned char pppoe_addr[MACADDRLEN];
  597. unsigned char scdb_mac[MACADDRLEN];
  598. unsigned char scdb_ip[4];
  599. struct nat25_network_db_entry *scdb_entry;
  600. unsigned char br_mac[MACADDRLEN];
  601. unsigned char br_ip[4];
  602. struct br_ext_info ethBrExtInfo;
  603. #endif // CONFIG_BR_EXT
  604. #ifdef CONFIG_INTEL_PROXIM
  605. /* intel Proximity, should be alloc mem
  606. * in intel Proximity module and can only
  607. * be used in intel Proximity mode */
  608. struct proxim proximity;
  609. #endif //CONFIG_INTEL_PROXIM
  610. #ifdef CONFIG_MAC_LOOPBACK_DRIVER
  611. PLOOPBACKDATA ploopback;
  612. #endif
  613. u8 fix_rate;
  614. unsigned char in_cta_test;
  615. };
  616. #define adapter_to_dvobj(adapter) (adapter->dvobj)
  617. int rtw_handle_dualmac(_adapter *adapter, bool init);
  618. __inline static u8 *myid(struct eeprom_priv *peepriv)
  619. {
  620. return (peepriv->mac_addr);
  621. }
  622. // HCI Related header file
  623. #ifdef CONFIG_USB_HCI
  624. #include <usb_osintf.h>
  625. #include <usb_ops.h>
  626. #include <usb_hal.h>
  627. #endif
  628. #ifdef CONFIG_SDIO_HCI
  629. #include <sdio_osintf.h>
  630. #include <sdio_ops.h>
  631. #include <sdio_hal.h>
  632. #endif
  633. #ifdef CONFIG_GSPI_HCI
  634. #include <gspi_osintf.h>
  635. #include <gspi_ops.h>
  636. #include <gspi_hal.h>
  637. #endif
  638. #ifdef CONFIG_PCI_HCI
  639. #include <pci_osintf.h>
  640. #include <pci_ops.h>
  641. #include <pci_hal.h>
  642. #endif
  643. #endif //__DRV_TYPES_H__