drv_types.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2010 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. * Modifications for inclusion into the Linux staging tree are
  19. * Copyright(c) 2010 Larry Finger. All rights reserved.
  20. *
  21. * Contact information:
  22. * WLAN FAE <wlanfae@realtek.com>
  23. * Larry Finger <Larry.Finger@lwfinger.net>
  24. *
  25. ******************************************************************************/
  26. /* ---------------------------------------------------------------------
  27. *
  28. * For type defines and data structure defines
  29. *
  30. * ---------------------------------------------------------------------
  31. */
  32. #ifndef __DRV_TYPES_H__
  33. #define __DRV_TYPES_H__
  34. struct _adapter;
  35. #include "osdep_service.h"
  36. #include "wlan_bssdef.h"
  37. #include "rtl8712_spec.h"
  38. #include "rtl8712_hal.h"
  39. #include <linux/mutex.h>
  40. #include <linux/completion.h>
  41. enum _NIC_VERSION {
  42. RTL8711_NIC,
  43. RTL8712_NIC,
  44. RTL8713_NIC,
  45. RTL8716_NIC
  46. };
  47. struct _adapter;
  48. struct qos_priv {
  49. /* bit mask option: u-apsd, s-apsd, ts, block ack... */
  50. unsigned int qos_option;
  51. };
  52. #include "rtl871x_ht.h"
  53. #include "rtl871x_cmd.h"
  54. #include "rtl871x_xmit.h"
  55. #include "rtl871x_recv.h"
  56. #include "rtl871x_security.h"
  57. #include "rtl871x_pwrctrl.h"
  58. #include "rtl871x_io.h"
  59. #include "rtl871x_eeprom.h"
  60. #include "sta_info.h"
  61. #include "rtl871x_mlme.h"
  62. #include "rtl871x_mp.h"
  63. #include "rtl871x_debug.h"
  64. #include "rtl871x_rf.h"
  65. #include "rtl871x_event.h"
  66. #include "rtl871x_led.h"
  67. #define SPEC_DEV_ID_DISABLE_HT BIT(1)
  68. struct specific_device_id {
  69. u32 flags;
  70. u16 idVendor;
  71. u16 idProduct;
  72. };
  73. struct registry_priv {
  74. u8 chip_version;
  75. u8 rfintfs;
  76. u8 lbkmode;
  77. u8 hci;
  78. u8 network_mode; /*infra, ad-hoc, auto*/
  79. struct ndis_802_11_ssid ssid;
  80. u8 channel;/* ad-hoc support requirement */
  81. u8 wireless_mode;/* A, B, G, auto */
  82. u8 vrtl_carrier_sense; /*Enable, Disable, Auto*/
  83. u8 vcs_type;/*RTS/CTS, CTS-to-self*/
  84. u16 rts_thresh;
  85. u16 frag_thresh;
  86. u8 preamble;/*long, short, auto*/
  87. u8 scan_mode;/*active, passive*/
  88. u8 adhoc_tx_pwr;
  89. u8 soft_ap;
  90. u8 smart_ps;
  91. u8 power_mgnt;
  92. u8 radio_enable;
  93. u8 long_retry_lmt;
  94. u8 short_retry_lmt;
  95. u16 busy_thresh;
  96. u8 ack_policy;
  97. u8 mp_mode;
  98. u8 software_encrypt;
  99. u8 software_decrypt;
  100. /* UAPSD */
  101. u8 wmm_enable;
  102. u8 uapsd_enable;
  103. u8 uapsd_max_sp;
  104. u8 uapsd_acbk_en;
  105. u8 uapsd_acbe_en;
  106. u8 uapsd_acvi_en;
  107. u8 uapsd_acvo_en;
  108. struct wlan_bssid_ex dev_network;
  109. u8 ht_enable;
  110. u8 cbw40_enable;
  111. u8 ampdu_enable;/*for tx*/
  112. u8 rf_config;
  113. u8 low_power;
  114. u8 wifi_test;
  115. };
  116. struct dvobj_priv {
  117. struct _adapter *padapter;
  118. u32 nr_endpoint;
  119. u8 ishighspeed;
  120. uint (*inirp_init)(struct _adapter *adapter);
  121. uint (*inirp_deinit)(struct _adapter *adapter);
  122. struct usb_device *pusbdev;
  123. };
  124. /**
  125. * struct _adapter - the main adapter structure for this device.
  126. *
  127. * bup: True indicates that the interface is up.
  128. */
  129. struct _adapter {
  130. struct dvobj_priv dvobjpriv;
  131. struct mlme_priv mlmepriv;
  132. struct cmd_priv cmdpriv;
  133. struct evt_priv evtpriv;
  134. struct io_queue *pio_queue;
  135. struct xmit_priv xmitpriv;
  136. struct recv_priv recvpriv;
  137. struct sta_priv stapriv;
  138. struct security_priv securitypriv;
  139. struct registry_priv registrypriv;
  140. struct wlan_acl_pool acl_list;
  141. struct pwrctrl_priv pwrctrlpriv;
  142. struct eeprom_priv eeprompriv;
  143. struct hal_priv halpriv;
  144. struct led_priv ledpriv;
  145. struct mp_priv mppriv;
  146. s32 bDriverStopped;
  147. s32 bSurpriseRemoved;
  148. u32 IsrContent;
  149. u32 ImrContent;
  150. u8 EepromAddressSize;
  151. u8 hw_init_completed;
  152. struct task_struct *cmdThread;
  153. pid_t evtThread;
  154. struct task_struct *xmitThread;
  155. pid_t recvThread;
  156. uint (*dvobj_init)(struct _adapter *adapter);
  157. void (*dvobj_deinit)(struct _adapter *adapter);
  158. struct net_device *pnetdev;
  159. int bup;
  160. struct net_device_stats stats;
  161. struct iw_statistics iwstats;
  162. int pid; /*process id from UI*/
  163. struct work_struct wkFilterRxFF0;
  164. u8 blnEnableRxFF0Filter;
  165. spinlock_t lockRxFF0Filter;
  166. const struct firmware *fw;
  167. struct usb_interface *pusb_intf;
  168. struct mutex mutex_start;
  169. struct completion rtl8712_fw_ready;
  170. };
  171. static inline u8 *myid(struct eeprom_priv *peepriv)
  172. {
  173. return peepriv->mac_addr;
  174. }
  175. u8 r8712_usb_hal_bus_init(struct _adapter *adapter);
  176. #endif /*__DRV_TYPES_H__*/