r8192U.h 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
  1. /*
  2. * This is part of rtl8187 OpenSource driver.
  3. * Copyright (C) Andrea Merello 2004-2005 <andrea.merello@gmail.com>
  4. * Released under the terms of GPL (General Public Licence)
  5. *
  6. * Parts of this driver are based on the GPL part of the
  7. * official realtek driver
  8. *
  9. * Parts of this driver are based on the rtl8192 driver skeleton
  10. * from Patric Schenke & Andres Salomon
  11. *
  12. * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver
  13. *
  14. * We want to thank the Authors of those projects and the Ndiswrapper
  15. * project Authors.
  16. */
  17. #ifndef R8192U_H
  18. #define R8192U_H
  19. #include <linux/compiler.h>
  20. #include <linux/module.h>
  21. #include <linux/kernel.h>
  22. #include <linux/ioport.h>
  23. #include <linux/sched.h>
  24. #include <linux/types.h>
  25. #include <linux/slab.h>
  26. #include <linux/netdevice.h>
  27. #include <linux/usb.h>
  28. #include <linux/etherdevice.h>
  29. #include <linux/delay.h>
  30. #include <linux/rtnetlink.h>
  31. #include <linux/wireless.h>
  32. #include <linux/timer.h>
  33. #include <linux/proc_fs.h>
  34. #include <linux/if_arp.h>
  35. #include <linux/random.h>
  36. #include <linux/io.h>
  37. #include "ieee80211/ieee80211.h"
  38. #define RTL8192U
  39. #define RTL819xU_MODULE_NAME "rtl819xU"
  40. /* HW security */
  41. #define MAX_KEY_LEN 61
  42. #define KEY_BUF_SIZE 5
  43. #define Rx_Smooth_Factor 20
  44. #define DMESG(x, a...)
  45. #define DMESGW(x, a...)
  46. #define DMESGE(x, a...)
  47. extern u32 rt_global_debug_component;
  48. #define RT_TRACE(component, x, args...) \
  49. do { \
  50. if (rt_global_debug_component & component) \
  51. pr_debug("RTL8192U: " x "\n", ##args); \
  52. } while (0)
  53. #define COMP_TRACE BIT(0) /* Function call tracing. */
  54. #define COMP_DBG BIT(1)
  55. #define COMP_INIT BIT(2) /* Driver initialization/halt/reset. */
  56. #define COMP_RECV BIT(3) /* Receive data path. */
  57. #define COMP_SEND BIT(4) /* Send data path. */
  58. #define COMP_IO BIT(5)
  59. /* 802.11 Power Save mode or System/Device Power state. */
  60. #define COMP_POWER BIT(6)
  61. /* 802.11 link related: join/start BSS, leave BSS. */
  62. #define COMP_EPROM BIT(7)
  63. #define COMP_SWBW BIT(8) /* Bandwidth switch. */
  64. #define COMP_POWER_TRACKING BIT(9) /* 8190 TX Power Tracking */
  65. #define COMP_TURBO BIT(10) /* Turbo Mode */
  66. #define COMP_QOS BIT(11)
  67. #define COMP_RATE BIT(12) /* Rate Adaptive mechanism */
  68. #define COMP_RM BIT(13) /* Radio Measurement */
  69. #define COMP_DIG BIT(14)
  70. #define COMP_PHY BIT(15)
  71. #define COMP_CH BIT(16) /* Channel setting debug */
  72. #define COMP_TXAGC BIT(17) /* Tx power */
  73. #define COMP_HIPWR BIT(18) /* High Power Mechanism */
  74. #define COMP_HALDM BIT(19) /* HW Dynamic Mechanism */
  75. #define COMP_SEC BIT(20) /* Event handling */
  76. #define COMP_LED BIT(21)
  77. #define COMP_RF BIT(22)
  78. #define COMP_RXDESC BIT(23) /* Rx desc information for SD3 debug */
  79. /* 11n or 8190 specific code */
  80. #define COMP_FIRMWARE BIT(24) /* Firmware downloading */
  81. #define COMP_HT BIT(25) /* 802.11n HT related information */
  82. #define COMP_AMSDU BIT(26) /* A-MSDU Debugging */
  83. #define COMP_SCAN BIT(27)
  84. #define COMP_DOWN BIT(29) /* rm driver module */
  85. #define COMP_RESET BIT(30) /* Silent reset */
  86. #define COMP_ERR BIT(31) /* Error out, always on */
  87. #define RTL819x_DEBUG
  88. #ifdef RTL819x_DEBUG
  89. #define RTL8192U_ASSERT(expr) \
  90. do { \
  91. if (!(expr)) { \
  92. pr_debug("Assertion failed! %s, %s, %s, line = %d\n", \
  93. #expr, __FILE__, __func__, __LINE__); \
  94. } \
  95. } while (0)
  96. /*
  97. * Debug out data buf.
  98. * If you want to print DATA buffer related BA,
  99. * please set ieee80211_debug_level to DATA|BA
  100. */
  101. #define RT_DEBUG_DATA(level, data, datalen) \
  102. do { \
  103. if ((rt_global_debug_component & (level)) == (level)) { \
  104. int i; \
  105. u8 *pdata = (u8 *) data; \
  106. pr_debug("RTL8192U: %s()\n", __func__); \
  107. for (i = 0; i < (int)(datalen); i++) { \
  108. printk("%2x ", pdata[i]); \
  109. if ((i+1)%16 == 0) \
  110. printk("\n"); \
  111. } \
  112. printk("\n"); \
  113. } \
  114. } while (0)
  115. #else
  116. #define RTL8192U_ASSERT(expr) do {} while (0)
  117. #define RT_DEBUG_DATA(level, data, datalen) do {} while (0)
  118. #endif /* RTL8169_DEBUG */
  119. /* Queue Select Value in TxDesc */
  120. #define QSLT_BK 0x1
  121. #define QSLT_BE 0x0
  122. #define QSLT_VI 0x4
  123. #define QSLT_VO 0x6
  124. #define QSLT_BEACON 0x10
  125. #define QSLT_HIGH 0x11
  126. #define QSLT_MGNT 0x12
  127. #define QSLT_CMD 0x13
  128. #define DESC90_RATE1M 0x00
  129. #define DESC90_RATE2M 0x01
  130. #define DESC90_RATE5_5M 0x02
  131. #define DESC90_RATE11M 0x03
  132. #define DESC90_RATE6M 0x04
  133. #define DESC90_RATE9M 0x05
  134. #define DESC90_RATE12M 0x06
  135. #define DESC90_RATE18M 0x07
  136. #define DESC90_RATE24M 0x08
  137. #define DESC90_RATE36M 0x09
  138. #define DESC90_RATE48M 0x0a
  139. #define DESC90_RATE54M 0x0b
  140. #define DESC90_RATEMCS0 0x00
  141. #define DESC90_RATEMCS1 0x01
  142. #define DESC90_RATEMCS2 0x02
  143. #define DESC90_RATEMCS3 0x03
  144. #define DESC90_RATEMCS4 0x04
  145. #define DESC90_RATEMCS5 0x05
  146. #define DESC90_RATEMCS6 0x06
  147. #define DESC90_RATEMCS7 0x07
  148. #define DESC90_RATEMCS8 0x08
  149. #define DESC90_RATEMCS9 0x09
  150. #define DESC90_RATEMCS10 0x0a
  151. #define DESC90_RATEMCS11 0x0b
  152. #define DESC90_RATEMCS12 0x0c
  153. #define DESC90_RATEMCS13 0x0d
  154. #define DESC90_RATEMCS14 0x0e
  155. #define DESC90_RATEMCS15 0x0f
  156. #define DESC90_RATEMCS32 0x20
  157. #define RTL819X_DEFAULT_RF_TYPE RF_1T2R
  158. #define IEEE80211_WATCH_DOG_TIME 2000
  159. #define PHY_Beacon_RSSI_SLID_WIN_MAX 10
  160. /* For Tx Power Tracking */
  161. #define OFDM_Table_Length 19
  162. #define CCK_Table_length 12
  163. /* For rtl819x */
  164. struct tx_desc_819x_usb {
  165. /* DWORD 0 */
  166. u16 PktSize;
  167. u8 Offset;
  168. u8 Reserved0:3;
  169. u8 CmdInit:1;
  170. u8 LastSeg:1;
  171. u8 FirstSeg:1;
  172. u8 LINIP:1;
  173. u8 OWN:1;
  174. /* DWORD 1 */
  175. u8 TxFWInfoSize;
  176. u8 RATid:3;
  177. u8 DISFB:1;
  178. u8 USERATE:1;
  179. u8 MOREFRAG:1;
  180. u8 NoEnc:1;
  181. u8 PIFS:1;
  182. u8 QueueSelect:5;
  183. u8 NoACM:1;
  184. u8 Reserved1:2;
  185. u8 SecCAMID:5;
  186. u8 SecDescAssign:1;
  187. u8 SecType:2;
  188. /* DWORD 2 */
  189. u16 TxBufferSize;
  190. u8 ResvForPaddingLen:7;
  191. u8 Reserved3:1;
  192. u8 Reserved4;
  193. /* DWORD 3, 4, 5 */
  194. u32 Reserved5;
  195. u32 Reserved6;
  196. u32 Reserved7;
  197. };
  198. struct tx_desc_cmd_819x_usb {
  199. /* DWORD 0 */
  200. u16 Reserved0;
  201. u8 Reserved1;
  202. u8 Reserved2:3;
  203. u8 CmdInit:1;
  204. u8 LastSeg:1;
  205. u8 FirstSeg:1;
  206. u8 LINIP:1;
  207. u8 OWN:1;
  208. /* DOWRD 1 */
  209. u8 TxFWInfoSize;
  210. u8 Reserved3;
  211. u8 QueueSelect;
  212. u8 Reserved4;
  213. /* DOWRD 2 */
  214. u16 TxBufferSize;
  215. u16 Reserved5;
  216. /* DWORD 3, 4, 5 */
  217. u32 Reserved6;
  218. u32 Reserved7;
  219. u32 Reserved8;
  220. };
  221. struct tx_fwinfo_819x_usb {
  222. /* DOWRD 0 */
  223. u8 TxRate:7;
  224. u8 CtsEnable:1;
  225. u8 RtsRate:7;
  226. u8 RtsEnable:1;
  227. u8 TxHT:1;
  228. u8 Short:1; /* Error out, always on */
  229. u8 TxBandwidth:1; /* Used for HT MCS rate only */
  230. u8 TxSubCarrier:2; /* Used for legacy OFDM rate only */
  231. u8 STBC:2;
  232. u8 AllowAggregation:1;
  233. /* Interpret RtsRate field as high throughput data rate */
  234. u8 RtsHT:1;
  235. u8 RtsShort:1; /* Short PLCP for CCK or short GI for 11n MCS */
  236. u8 RtsBandwidth:1; /* Used for HT MCS rate only */
  237. u8 RtsSubcarrier:2;/* Used for legacy OFDM rate only */
  238. u8 RtsSTBC:2;
  239. /* Enable firmware to recalculate and assign packet duration */
  240. u8 EnableCPUDur:1;
  241. /* DWORD 1 */
  242. u32 RxMF:2;
  243. u32 RxAMD:3;
  244. /* 1 indicate Tx info gathered by firmware and returned by Rx Cmd */
  245. u32 TxPerPktInfoFeedback:1;
  246. u32 Reserved1:2;
  247. u32 TxAGCOffSet:4;
  248. u32 TxAGCSign:1;
  249. u32 Tx_INFO_RSVD:6;
  250. u32 PacketID:13;
  251. };
  252. struct rtl8192_rx_info {
  253. struct urb *urb;
  254. struct net_device *dev;
  255. u8 out_pipe;
  256. };
  257. struct rx_desc_819x_usb {
  258. /* DOWRD 0 */
  259. u16 Length:14;
  260. u16 CRC32:1;
  261. u16 ICV:1;
  262. u8 RxDrvInfoSize;
  263. u8 Shift:2;
  264. u8 PHYStatus:1;
  265. u8 SWDec:1;
  266. u8 Reserved1:4;
  267. /* DWORD 1 */
  268. u32 Reserved2;
  269. };
  270. struct rx_drvinfo_819x_usb {
  271. /* DWORD 0 */
  272. u16 Reserved1:12;
  273. u16 PartAggr:1;
  274. u16 FirstAGGR:1;
  275. u16 Reserved2:2;
  276. u8 RxRate:7;
  277. u8 RxHT:1;
  278. u8 BW:1;
  279. u8 SPLCP:1;
  280. u8 Reserved3:2;
  281. u8 PAM:1;
  282. u8 Mcast:1;
  283. u8 Bcast:1;
  284. u8 Reserved4:1;
  285. /* DWORD 1 */
  286. u32 TSFL;
  287. };
  288. /* Support till 64 bit bus width OS */
  289. #define MAX_DEV_ADDR_SIZE 8
  290. /* For RTL8190 */
  291. #define MAX_FIRMWARE_INFORMATION_SIZE 32
  292. #define MAX_802_11_HEADER_LENGTH (40 + MAX_FIRMWARE_INFORMATION_SIZE)
  293. #define ENCRYPTION_MAX_OVERHEAD 128
  294. #define USB_HWDESC_HEADER_LEN sizeof(struct tx_desc_819x_usb)
  295. #define TX_PACKET_SHIFT_BYTES (USB_HWDESC_HEADER_LEN + sizeof(struct tx_fwinfo_819x_usb))
  296. #define MAX_FRAGMENT_COUNT 8
  297. #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
  298. #define MAX_TRANSMIT_BUFFER_SIZE 32000
  299. #else
  300. #define MAX_TRANSMIT_BUFFER_SIZE 8000
  301. #endif
  302. /* Octets for crc32 (FCS, ICV) */
  303. #define scrclng 4
  304. enum rf_op_type {
  305. RF_OP_By_SW_3wire = 0,
  306. RF_OP_By_FW,
  307. RF_OP_MAX
  308. };
  309. /* 8190 Loopback Mode definition */
  310. typedef enum _rtl819xUsb_loopback {
  311. RTL819xU_NO_LOOPBACK = 0,
  312. RTL819xU_MAC_LOOPBACK = 1,
  313. RTL819xU_DMA_LOOPBACK = 2,
  314. RTL819xU_CCK_LOOPBACK = 3,
  315. } rtl819xUsb_loopback_e;
  316. /* due to rtl8192 firmware */
  317. typedef enum _desc_packet_type_e {
  318. DESC_PACKET_TYPE_INIT = 0,
  319. DESC_PACKET_TYPE_NORMAL = 1,
  320. } desc_packet_type_e;
  321. typedef enum _firmware_status {
  322. FW_STATUS_0_INIT = 0,
  323. FW_STATUS_1_MOVE_BOOT_CODE = 1,
  324. FW_STATUS_2_MOVE_MAIN_CODE = 2,
  325. FW_STATUS_3_TURNON_CPU = 3,
  326. FW_STATUS_4_MOVE_DATA_CODE = 4,
  327. FW_STATUS_5_READY = 5,
  328. } firmware_status_e;
  329. typedef struct _rt_firmare_seg_container {
  330. u16 seg_size;
  331. u8 *seg_ptr;
  332. } fw_seg_container, *pfw_seg_container;
  333. typedef struct _rt_firmware {
  334. firmware_status_e firmware_status;
  335. u16 cmdpacket_frag_thresold;
  336. #define RTL8190_MAX_FIRMWARE_CODE_SIZE 64000
  337. u8 firmware_buf[RTL8190_MAX_FIRMWARE_CODE_SIZE];
  338. u16 firmware_buf_size;
  339. } rt_firmware, *prt_firmware;
  340. /* Add this to 9100 bytes to receive A-MSDU from RT-AP */
  341. #define MAX_RECEIVE_BUFFER_SIZE 9100
  342. typedef struct _rt_firmware_info_819xUsb {
  343. u8 sz_info[16];
  344. } rt_firmware_info_819xUsb, *prt_firmware_info_819xUsb;
  345. /* Firmware Queue Layout */
  346. #define NUM_OF_FIRMWARE_QUEUE 10
  347. #define NUM_OF_PAGES_IN_FW 0x100
  348. #ifdef USE_ONE_PIPE
  349. #define NUM_OF_PAGE_IN_FW_QUEUE_BE 0x000
  350. #define NUM_OF_PAGE_IN_FW_QUEUE_BK 0x000
  351. #define NUM_OF_PAGE_IN_FW_QUEUE_VI 0x0ff
  352. #define NUM_OF_PAGE_IN_FW_QUEUE_VO 0x000
  353. #define NUM_OF_PAGE_IN_FW_QUEUE_HCCA 0
  354. #define NUM_OF_PAGE_IN_FW_QUEUE_CMD 0x0
  355. #define NUM_OF_PAGE_IN_FW_QUEUE_MGNT 0x00
  356. #define NUM_OF_PAGE_IN_FW_QUEUE_HIGH 0
  357. #define NUM_OF_PAGE_IN_FW_QUEUE_BCN 0x0
  358. #define NUM_OF_PAGE_IN_FW_QUEUE_PUB 0x00
  359. #else
  360. #define NUM_OF_PAGE_IN_FW_QUEUE_BE 0x020
  361. #define NUM_OF_PAGE_IN_FW_QUEUE_BK 0x020
  362. #define NUM_OF_PAGE_IN_FW_QUEUE_VI 0x040
  363. #define NUM_OF_PAGE_IN_FW_QUEUE_VO 0x040
  364. #define NUM_OF_PAGE_IN_FW_QUEUE_HCCA 0
  365. #define NUM_OF_PAGE_IN_FW_QUEUE_CMD 0x4
  366. #define NUM_OF_PAGE_IN_FW_QUEUE_MGNT 0x20
  367. #define NUM_OF_PAGE_IN_FW_QUEUE_HIGH 0
  368. #define NUM_OF_PAGE_IN_FW_QUEUE_BCN 0x4
  369. #define NUM_OF_PAGE_IN_FW_QUEUE_PUB 0x18
  370. #endif
  371. #define APPLIED_RESERVED_QUEUE_IN_FW 0x80000000
  372. #define RSVD_FW_QUEUE_PAGE_BK_SHIFT 0x00
  373. #define RSVD_FW_QUEUE_PAGE_BE_SHIFT 0x08
  374. #define RSVD_FW_QUEUE_PAGE_VI_SHIFT 0x10
  375. #define RSVD_FW_QUEUE_PAGE_VO_SHIFT 0x18
  376. #define RSVD_FW_QUEUE_PAGE_MGNT_SHIFT 0x10
  377. #define RSVD_FW_QUEUE_PAGE_CMD_SHIFT 0x08
  378. #define RSVD_FW_QUEUE_PAGE_BCN_SHIFT 0x00
  379. #define RSVD_FW_QUEUE_PAGE_PUB_SHIFT 0x08
  380. /*
  381. * =================================================================
  382. * =================================================================
  383. */
  384. #define EPROM_93c46 0
  385. #define EPROM_93c56 1
  386. #define DEFAULT_FRAG_THRESHOLD 2342U
  387. #define MIN_FRAG_THRESHOLD 256U
  388. #define DEFAULT_BEACONINTERVAL 0x64U
  389. #define DEFAULT_BEACON_ESSID "Rtl819xU"
  390. #define DEFAULT_SSID ""
  391. #define DEFAULT_RETRY_RTS 7
  392. #define DEFAULT_RETRY_DATA 7
  393. #define PRISM_HDR_SIZE 64
  394. #define PHY_RSSI_SLID_WIN_MAX 100
  395. typedef enum _WIRELESS_MODE {
  396. WIRELESS_MODE_UNKNOWN = 0x00,
  397. WIRELESS_MODE_A = 0x01,
  398. WIRELESS_MODE_B = 0x02,
  399. WIRELESS_MODE_G = 0x04,
  400. WIRELESS_MODE_AUTO = 0x08,
  401. WIRELESS_MODE_N_24G = 0x10,
  402. WIRELESS_MODE_N_5G = 0x20
  403. } WIRELESS_MODE;
  404. #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30)
  405. typedef struct buffer {
  406. struct buffer *next;
  407. u32 *buf;
  408. } buffer;
  409. typedef struct rtl_reg_debug {
  410. unsigned int cmd;
  411. struct {
  412. unsigned char type;
  413. unsigned char addr;
  414. unsigned char page;
  415. unsigned char length;
  416. } head;
  417. unsigned char buf[0xff];
  418. } rtl_reg_debug;
  419. typedef struct _rt_9x_tx_rate_history {
  420. u32 cck[4];
  421. u32 ofdm[8];
  422. u32 ht_mcs[4][16];
  423. } rt_tx_rahis_t, *prt_tx_rahis_t;
  424. typedef struct _RT_SMOOTH_DATA_4RF {
  425. s8 elements[4][100]; /* array to store values */
  426. u32 index; /* index to current array to store */
  427. u32 TotalNum; /* num of valid elements */
  428. u32 TotalVal[4]; /* sum of valid elements */
  429. } RT_SMOOTH_DATA_4RF, *PRT_SMOOTH_DATA_4RF;
  430. /* This maybe changed for D-cut larger aggregation size */
  431. #define MAX_8192U_RX_SIZE 8192
  432. /* Stats seems messed up, clean it ASAP */
  433. typedef struct Stats {
  434. unsigned long txrdu;
  435. unsigned long rxok;
  436. unsigned long rxframgment;
  437. unsigned long rxurberr;
  438. unsigned long rxstaterr;
  439. /* 0: Total, 1: OK, 2: CRC, 3: ICV */
  440. unsigned long received_rate_histogram[4][32];
  441. /* 0: Long preamble/GI, 1: Short preamble/GI */
  442. unsigned long received_preamble_GI[2][32];
  443. /* level: (<4K), (4K~8K), (8K~16K), (16K~32K), (32K~64K) */
  444. unsigned long rx_AMPDUsize_histogram[5];
  445. /* level: (<5), (5~10), (10~20), (20~40), (>40) */
  446. unsigned long rx_AMPDUnum_histogram[5];
  447. unsigned long numpacket_matchbssid;
  448. unsigned long numpacket_toself;
  449. unsigned long num_process_phyinfo;
  450. unsigned long numqry_phystatus;
  451. unsigned long numqry_phystatusCCK;
  452. unsigned long numqry_phystatusHT;
  453. /* 0: 20M, 1: funn40M, 2: upper20M, 3: lower20M, 4: duplicate */
  454. unsigned long received_bwtype[5];
  455. unsigned long txnperr;
  456. unsigned long txnpdrop;
  457. unsigned long txresumed;
  458. unsigned long txnpokint;
  459. unsigned long txoverflow;
  460. unsigned long txlpokint;
  461. unsigned long txlpdrop;
  462. unsigned long txlperr;
  463. unsigned long txbeokint;
  464. unsigned long txbedrop;
  465. unsigned long txbeerr;
  466. unsigned long txbkokint;
  467. unsigned long txbkdrop;
  468. unsigned long txbkerr;
  469. unsigned long txviokint;
  470. unsigned long txvidrop;
  471. unsigned long txvierr;
  472. unsigned long txvookint;
  473. unsigned long txvodrop;
  474. unsigned long txvoerr;
  475. unsigned long txbeaconokint;
  476. unsigned long txbeacondrop;
  477. unsigned long txbeaconerr;
  478. unsigned long txmanageokint;
  479. unsigned long txmanagedrop;
  480. unsigned long txmanageerr;
  481. unsigned long txdatapkt;
  482. unsigned long txfeedback;
  483. unsigned long txfeedbackok;
  484. unsigned long txoktotal;
  485. unsigned long txokbytestotal;
  486. unsigned long txokinperiod;
  487. unsigned long txmulticast;
  488. unsigned long txbytesmulticast;
  489. unsigned long txbroadcast;
  490. unsigned long txbytesbroadcast;
  491. unsigned long txunicast;
  492. unsigned long txbytesunicast;
  493. unsigned long rxoktotal;
  494. unsigned long rxbytesunicast;
  495. unsigned long txfeedbackfail;
  496. unsigned long txerrtotal;
  497. unsigned long txerrbytestotal;
  498. unsigned long txerrmulticast;
  499. unsigned long txerrbroadcast;
  500. unsigned long txerrunicast;
  501. unsigned long txretrycount;
  502. unsigned long txfeedbackretry;
  503. u8 last_packet_rate;
  504. unsigned long slide_signal_strength[100];
  505. unsigned long slide_evm[100];
  506. /* For recording sliding window's RSSI value */
  507. unsigned long slide_rssi_total;
  508. /* For recording sliding window's EVM value */
  509. unsigned long slide_evm_total;
  510. /* Transformed in dbm. Beautified signal strength for UI, not correct */
  511. long signal_strength;
  512. long signal_quality;
  513. long last_signal_strength_inpercent;
  514. /* Correct smoothed ss in dbm, only used in driver
  515. * to report real power now
  516. */
  517. long recv_signal_power;
  518. u8 rx_rssi_percentage[4];
  519. u8 rx_evm_percentage[2];
  520. long rxSNRdB[4];
  521. rt_tx_rahis_t txrate;
  522. /* For beacon RSSI */
  523. u32 Slide_Beacon_pwdb[100];
  524. u32 Slide_Beacon_Total;
  525. RT_SMOOTH_DATA_4RF cck_adc_pwdb;
  526. u32 CurrentShowTxate;
  527. } Stats;
  528. /* Bandwidth Offset */
  529. #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
  530. #define HAL_PRIME_CHNL_OFFSET_LOWER 1
  531. #define HAL_PRIME_CHNL_OFFSET_UPPER 2
  532. typedef struct ChnlAccessSetting {
  533. u16 SIFS_Timer;
  534. u16 DIFS_Timer;
  535. u16 SlotTimeTimer;
  536. u16 EIFS_Timer;
  537. u16 CWminIndex;
  538. u16 CWmaxIndex;
  539. } *PCHANNEL_ACCESS_SETTING, CHANNEL_ACCESS_SETTING;
  540. typedef struct _BB_REGISTER_DEFINITION {
  541. /* set software control: 0x870~0x877 [8 bytes] */
  542. u32 rfintfs;
  543. /* readback data: 0x8e0~0x8e7 [8 bytes] */
  544. u32 rfintfi;
  545. /* output data: 0x860~0x86f [16 bytes] */
  546. u32 rfintfo;
  547. /* output enable: 0x860~0x86f [16 bytes] */
  548. u32 rfintfe;
  549. /* LSSI data: 0x840~0x84f [16 bytes] */
  550. u32 rf3wireOffset;
  551. /* BB Band Select: 0x878~0x87f [8 bytes] */
  552. u32 rfLSSI_Select;
  553. /* Tx gain stage: 0x80c~0x80f [4 bytes] */
  554. u32 rfTxGainStage;
  555. /* wire parameter control1: 0x820~0x823, 0x828~0x82b,
  556. * 0x830~0x833, 0x838~0x83b [16 bytes]
  557. */
  558. u32 rfHSSIPara1;
  559. /* wire parameter control2: 0x824~0x827, 0x82c~0x82f,
  560. * 0x834~0x837, 0x83c~0x83f [16 bytes]
  561. */
  562. u32 rfHSSIPara2;
  563. /* Tx Rx antenna control: 0x858~0x85f [16 bytes] */
  564. u32 rfSwitchControl;
  565. /* AGC parameter control1: 0xc50~0xc53, 0xc58~0xc5b,
  566. * 0xc60~0xc63, 0xc68~0xc6b [16 bytes]
  567. */
  568. u32 rfAGCControl1;
  569. /* AGC parameter control2: 0xc54~0xc57, 0xc5c~0xc5f,
  570. * 0xc64~0xc67, 0xc6c~0xc6f [16 bytes]
  571. */
  572. u32 rfAGCControl2;
  573. /* OFDM Rx IQ imbalance matrix: 0xc14~0xc17, 0xc1c~0xc1f,
  574. * 0xc24~0xc27, 0xc2c~0xc2f [16 bytes]
  575. */
  576. u32 rfRxIQImbalance;
  577. /* Rx IQ DC offset and Rx digital filter, Rx DC notch filter:
  578. * 0xc10~0xc13, 0xc18~0xc1b,
  579. * 0xc20~0xc23, 0xc28~0xc2b [16 bytes]
  580. */
  581. u32 rfRxAFE;
  582. /* OFDM Tx IQ imbalance matrix: 0xc80~0xc83, 0xc88~0xc8b,
  583. * 0xc90~0xc93, 0xc98~0xc9b [16 bytes]
  584. */
  585. u32 rfTxIQImbalance;
  586. /* Tx IQ DC Offset and Tx DFIR type:
  587. * 0xc84~0xc87, 0xc8c~0xc8f,
  588. * 0xc94~0xc97, 0xc9c~0xc9f [16 bytes]
  589. */
  590. u32 rfTxAFE;
  591. /* LSSI RF readback data: 0x8a0~0x8af [16 bytes] */
  592. u32 rfLSSIReadBack;
  593. } BB_REGISTER_DEFINITION_T, *PBB_REGISTER_DEFINITION_T;
  594. typedef enum _RT_RF_TYPE_819xU {
  595. RF_TYPE_MIN = 0,
  596. RF_8225,
  597. RF_8256,
  598. RF_8258,
  599. RF_PSEUDO_11N = 4,
  600. } RT_RF_TYPE_819xU, *PRT_RF_TYPE_819xU;
  601. /* 2007/10/08 MH Define RATR state. */
  602. enum dynamic_ratr_state {
  603. DM_RATR_STA_HIGH = 0,
  604. DM_RATR_STA_MIDDLE = 1,
  605. DM_RATR_STA_LOW = 2,
  606. DM_RATR_STA_MAX
  607. };
  608. typedef struct _rate_adaptive {
  609. u8 rate_adaptive_disabled;
  610. enum dynamic_ratr_state ratr_state;
  611. u16 reserve;
  612. u32 high_rssi_thresh_for_ra;
  613. u32 high2low_rssi_thresh_for_ra;
  614. u8 low2high_rssi_thresh_for_ra40M;
  615. u32 low_rssi_thresh_for_ra40M;
  616. u8 low2high_rssi_thresh_for_ra20M;
  617. u32 low_rssi_thresh_for_ra20M;
  618. u32 upper_rssi_threshold_ratr;
  619. u32 middle_rssi_threshold_ratr;
  620. u32 low_rssi_threshold_ratr;
  621. u32 low_rssi_threshold_ratr_40M;
  622. u32 low_rssi_threshold_ratr_20M;
  623. u8 ping_rssi_enable;
  624. u32 ping_rssi_ratr;
  625. u32 ping_rssi_thresh_for_ra;
  626. u32 last_ratr;
  627. } rate_adaptive, *prate_adaptive;
  628. #define TxBBGainTableLength 37
  629. #define CCKTxBBGainTableLength 23
  630. typedef struct _txbbgain_struct {
  631. long txbb_iq_amplifygain;
  632. u32 txbbgain_value;
  633. } txbbgain_struct, *ptxbbgain_struct;
  634. typedef struct _ccktxbbgain_struct {
  635. /* The value is from a22 to a29, one byte one time is much safer */
  636. u8 ccktxbb_valuearray[8];
  637. } ccktxbbgain_struct, *pccktxbbgain_struct;
  638. typedef struct _init_gain {
  639. u8 xaagccore1;
  640. u8 xbagccore1;
  641. u8 xcagccore1;
  642. u8 xdagccore1;
  643. u8 cca;
  644. } init_gain, *pinit_gain;
  645. typedef struct _phy_ofdm_rx_status_report_819xusb {
  646. u8 trsw_gain_X[4];
  647. u8 pwdb_all;
  648. u8 cfosho_X[4];
  649. u8 cfotail_X[4];
  650. u8 rxevm_X[2];
  651. u8 rxsnr_X[4];
  652. u8 pdsnr_X[2];
  653. u8 csi_current_X[2];
  654. u8 csi_target_X[2];
  655. u8 sigevm;
  656. u8 max_ex_pwr;
  657. u8 sgi_en;
  658. u8 rxsc_sgien_exflg;
  659. } phy_sts_ofdm_819xusb_t;
  660. typedef struct _phy_cck_rx_status_report_819xusb {
  661. /* For CCK rate descriptor. This is an unsigned 8:1 variable.
  662. * LSB bit presend 0.5. And MSB 7 bts presend a signed value.
  663. * Range from -64~+63.5.
  664. */
  665. u8 adc_pwdb_X[4];
  666. u8 sq_rpt;
  667. u8 cck_agc_rpt;
  668. } phy_sts_cck_819xusb_t;
  669. struct phy_ofdm_rx_status_rxsc_sgien_exintfflag {
  670. u8 reserved:4;
  671. u8 rxsc:2;
  672. u8 sgi_en:1;
  673. u8 ex_intf_flag:1;
  674. };
  675. typedef enum _RT_CUSTOMER_ID {
  676. RT_CID_DEFAULT = 0,
  677. RT_CID_8187_ALPHA0 = 1,
  678. RT_CID_8187_SERCOMM_PS = 2,
  679. RT_CID_8187_HW_LED = 3,
  680. RT_CID_8187_NETGEAR = 4,
  681. RT_CID_WHQL = 5,
  682. RT_CID_819x_CAMEO = 6,
  683. RT_CID_819x_RUNTOP = 7,
  684. RT_CID_819x_Senao = 8,
  685. RT_CID_TOSHIBA = 9,
  686. RT_CID_819x_Netcore = 10,
  687. RT_CID_Nettronix = 11,
  688. RT_CID_DLINK = 12,
  689. RT_CID_PRONET = 13,
  690. } RT_CUSTOMER_ID, *PRT_CUSTOMER_ID;
  691. /*
  692. * ==========================================================================
  693. * LED customization.
  694. * ==========================================================================
  695. */
  696. typedef enum _LED_STRATEGY_8190 {
  697. SW_LED_MODE0, /* SW control 1 LED via GPIO0. It is default option. */
  698. SW_LED_MODE1, /* SW control for PCI Express */
  699. SW_LED_MODE2, /* SW control for Cameo. */
  700. SW_LED_MODE3, /* SW control for RunTop. */
  701. SW_LED_MODE4, /* SW control for Netcore. */
  702. /* HW control 2 LEDs, LED0 and LED1 (4 different control modes) */
  703. HW_LED,
  704. } LED_STRATEGY_8190, *PLED_STRATEGY_8190;
  705. typedef enum _RESET_TYPE {
  706. RESET_TYPE_NORESET = 0x00,
  707. RESET_TYPE_NORMAL = 0x01,
  708. RESET_TYPE_SILENT = 0x02
  709. } RESET_TYPE;
  710. /* The simple tx command OP code. */
  711. typedef enum _tag_TxCmd_Config_Index {
  712. TXCMD_TXRA_HISTORY_CTRL = 0xFF900000,
  713. TXCMD_RESET_TX_PKT_BUFF = 0xFF900001,
  714. TXCMD_RESET_RX_PKT_BUFF = 0xFF900002,
  715. TXCMD_SET_TX_DURATION = 0xFF900003,
  716. TXCMD_SET_RX_RSSI = 0xFF900004,
  717. TXCMD_SET_TX_PWR_TRACKING = 0xFF900005,
  718. TXCMD_XXXX_CTRL,
  719. } DCMD_TXCMD_OP;
  720. typedef struct r8192_priv {
  721. struct usb_device *udev;
  722. /* For maintain info from eeprom */
  723. short epromtype;
  724. u16 eeprom_vid;
  725. u16 eeprom_pid;
  726. u8 eeprom_CustomerID;
  727. u8 eeprom_ChannelPlan;
  728. RT_CUSTOMER_ID CustomerID;
  729. LED_STRATEGY_8190 LedStrategy;
  730. u8 txqueue_to_outpipemap[9];
  731. int irq;
  732. struct ieee80211_device *ieee80211;
  733. /* O: rtl8192, 1: rtl8185 V B/C, 2: rtl8185 V D */
  734. short card_8192;
  735. /* If TCR reports card V B/C, this discriminates */
  736. u8 card_8192_version;
  737. short enable_gpio0;
  738. enum card_type {
  739. PCI, MINIPCI, CARDBUS, USB
  740. } card_type;
  741. short hw_plcp_len;
  742. short plcp_preamble_mode;
  743. spinlock_t irq_lock;
  744. spinlock_t tx_lock;
  745. struct mutex mutex;
  746. u16 irq_mask;
  747. short chan;
  748. short sens;
  749. short max_sens;
  750. short up;
  751. /* If 1, allow bad crc frame, reception in monitor mode */
  752. short crcmon;
  753. struct mutex wx_mutex;
  754. u8 rf_type; /* 0: 1T2R, 1: 2T4R */
  755. RT_RF_TYPE_819xU rf_chip;
  756. short (*rf_set_sens)(struct net_device *dev, short sens);
  757. u8 (*rf_set_chan)(struct net_device *dev, u8 ch);
  758. void (*rf_close)(struct net_device *dev);
  759. void (*rf_init)(struct net_device *dev);
  760. short promisc;
  761. /* Stats */
  762. struct Stats stats;
  763. struct iw_statistics wstats;
  764. /* RX stuff */
  765. struct urb **rx_urb;
  766. struct urb **rx_cmd_urb;
  767. #ifdef THOMAS_BEACON
  768. u32 *oldaddr;
  769. #endif
  770. #ifdef THOMAS_TASKLET
  771. atomic_t irt_counter; /* count for irq_rx_tasklet */
  772. #endif
  773. #ifdef JACKSON_NEW_RX
  774. struct sk_buff **pp_rxskb;
  775. int rx_inx;
  776. #endif
  777. struct sk_buff_head rx_queue;
  778. struct sk_buff_head skb_queue;
  779. struct work_struct qos_activate;
  780. short tx_urb_index;
  781. atomic_t tx_pending[0x10]; /* UART_PRIORITY + 1 */
  782. struct tasklet_struct irq_rx_tasklet;
  783. struct urb *rxurb_task;
  784. /* Tx Related variables */
  785. u16 ShortRetryLimit;
  786. u16 LongRetryLimit;
  787. u32 TransmitConfig;
  788. u8 RegCWinMin; /* For turbo mode CW adaptive */
  789. u32 LastRxDescTSFHigh;
  790. u32 LastRxDescTSFLow;
  791. /* Rx Related variables */
  792. u16 EarlyRxThreshold;
  793. u32 ReceiveConfig;
  794. u8 AcmControl;
  795. u8 RFProgType;
  796. u8 retry_data;
  797. u8 retry_rts;
  798. u16 rts;
  799. struct ChnlAccessSetting ChannelAccessSetting;
  800. struct work_struct reset_wq;
  801. /**********************************************************/
  802. /* For rtl819xUsb */
  803. u16 basic_rate;
  804. u8 short_preamble;
  805. u8 slot_time;
  806. bool bDcut;
  807. bool bCurrentRxAggrEnable;
  808. enum rf_op_type Rf_Mode; /* For Firmware RF -R/W switch */
  809. prt_firmware pFirmware;
  810. rtl819xUsb_loopback_e LoopbackMode;
  811. u16 EEPROMTxPowerDiff;
  812. u8 EEPROMThermalMeter;
  813. u8 EEPROMPwDiff;
  814. u8 EEPROMCrystalCap;
  815. u8 EEPROM_Def_Ver;
  816. u8 EEPROMTxPowerLevelCCK; /* CCK channel 1~14 */
  817. u8 EEPROMTxPowerLevelCCK_V1[3];
  818. u8 EEPROMTxPowerLevelOFDM24G[3]; /* OFDM 2.4G channel 1~14 */
  819. u8 EEPROMTxPowerLevelOFDM5G[24]; /* OFDM 5G */
  820. /* PHY related */
  821. BB_REGISTER_DEFINITION_T PHYRegDef[4]; /* Radio A/B/C/D */
  822. /* Read/write are allow for following hardware information variables */
  823. u32 MCSTxPowerLevelOriginalOffset[6];
  824. u32 CCKTxPowerLevelOriginalOffset;
  825. u8 TxPowerLevelCCK[14]; /* CCK channel 1~14 */
  826. u8 TxPowerLevelOFDM24G[14]; /* OFDM 2.4G channel 1~14 */
  827. u8 TxPowerLevelOFDM5G[14]; /* OFDM 5G */
  828. u32 Pwr_Track;
  829. u8 TxPowerDiff;
  830. u8 AntennaTxPwDiff[2]; /* Antenna gain offset, 0: B, 1: C, 2: D */
  831. u8 CrystalCap;
  832. u8 ThermalMeter[2]; /* index 0: RFIC0, index 1: RFIC1 */
  833. u8 CckPwEnl;
  834. /* Use to calculate PWBD */
  835. u8 bCckHighPower;
  836. long undecorated_smoothed_pwdb;
  837. /* For set channel */
  838. u8 SwChnlInProgress;
  839. u8 SwChnlStage;
  840. u8 SwChnlStep;
  841. u8 SetBWModeInProgress;
  842. enum ht_channel_width CurrentChannelBW;
  843. u8 ChannelPlan;
  844. /* 8190 40MHz mode */
  845. /* Control channel sub-carrier */
  846. u8 nCur40MhzPrimeSC;
  847. /* Test for shorten RF configuration time.
  848. * We save RF reg0 in this variable to reduce RF reading.
  849. */
  850. u32 RfReg0Value[4];
  851. u8 NumTotalRFPath;
  852. bool brfpath_rxenable[4];
  853. /* RF set related */
  854. bool SetRFPowerStateInProgress;
  855. struct timer_list watch_dog_timer;
  856. /* For dynamic mechanism */
  857. /* Tx Power Control for Near/Far Range */
  858. bool bdynamic_txpower;
  859. bool bDynamicTxHighPower;
  860. bool bDynamicTxLowPower;
  861. bool bLastDTPFlag_High;
  862. bool bLastDTPFlag_Low;
  863. bool bstore_last_dtpflag;
  864. /* Define to discriminate on High power State or
  865. * on sitesurvey to change Tx gain index
  866. */
  867. bool bstart_txctrl_bydtp;
  868. rate_adaptive rate_adaptive;
  869. /* TX power tracking
  870. * OPEN/CLOSE TX POWER TRACKING
  871. */
  872. txbbgain_struct txbbgain_table[TxBBGainTableLength];
  873. u8 txpower_count; /* For 6 sec do tracking again */
  874. bool btxpower_trackingInit;
  875. u8 OFDM_index;
  876. u8 CCK_index;
  877. /* CCK TX Power Tracking */
  878. ccktxbbgain_struct cck_txbbgain_table[CCKTxBBGainTableLength];
  879. ccktxbbgain_struct cck_txbbgain_ch14_table[CCKTxBBGainTableLength];
  880. u8 rfa_txpowertrackingindex;
  881. u8 rfa_txpowertrackingindex_real;
  882. u8 rfa_txpowertracking_default;
  883. u8 rfc_txpowertrackingindex;
  884. u8 rfc_txpowertrackingindex_real;
  885. s8 cck_present_attenuation;
  886. u8 cck_present_attenuation_20Mdefault;
  887. u8 cck_present_attenuation_40Mdefault;
  888. s8 cck_present_attenuation_difference;
  889. bool btxpower_tracking;
  890. bool bcck_in_ch14;
  891. bool btxpowerdata_readfromEEPORM;
  892. u16 TSSI_13dBm;
  893. init_gain initgain_backup;
  894. u8 DefaultInitialGain[4];
  895. /* For EDCA Turbo mode */
  896. bool bis_any_nonbepkts;
  897. bool bcurrent_turbo_EDCA;
  898. bool bis_cur_rdlstate;
  899. struct timer_list fsync_timer;
  900. bool bfsync_processing; /* 500ms Fsync timer is active or not */
  901. u32 rate_record;
  902. u32 rateCountDiffRecord;
  903. u32 ContinueDiffCount;
  904. bool bswitch_fsync;
  905. u8 framesync;
  906. u32 framesyncC34;
  907. u8 framesyncMonitor;
  908. u16 nrxAMPDU_size;
  909. u8 nrxAMPDU_aggr_num;
  910. /* For gpio */
  911. bool bHwRadioOff;
  912. u32 reset_count;
  913. bool bpbc_pressed;
  914. u32 txpower_checkcnt;
  915. u32 txpower_tracking_callback_cnt;
  916. u8 thermal_read_val[40];
  917. u8 thermal_readback_index;
  918. u32 ccktxpower_adjustcnt_not_ch14;
  919. u32 ccktxpower_adjustcnt_ch14;
  920. u8 tx_fwinfo_force_subcarriermode;
  921. u8 tx_fwinfo_force_subcarrierval;
  922. /* For silent reset */
  923. RESET_TYPE ResetProgress;
  924. bool bForcedSilentReset;
  925. bool bDisableNormalResetCheck;
  926. u16 TxCounter;
  927. u16 RxCounter;
  928. int IrpPendingCount;
  929. bool bResetInProgress;
  930. bool force_reset;
  931. u8 InitialGainOperateType;
  932. u16 SifsTime;
  933. /* Define work item */
  934. struct delayed_work update_beacon_wq;
  935. struct delayed_work watch_dog_wq;
  936. struct delayed_work txpower_tracking_wq;
  937. struct delayed_work rfpath_check_wq;
  938. struct delayed_work gpio_change_rf_wq;
  939. struct delayed_work initialgain_operate_wq;
  940. struct workqueue_struct *priv_wq;
  941. } r8192_priv;
  942. /* For rtl8187B */
  943. typedef enum{
  944. BULK_PRIORITY = 0x01,
  945. LOW_PRIORITY,
  946. NORM_PRIORITY,
  947. VO_PRIORITY,
  948. VI_PRIORITY,
  949. BE_PRIORITY,
  950. BK_PRIORITY,
  951. RSVD2,
  952. RSVD3,
  953. BEACON_PRIORITY,
  954. HIGH_PRIORITY,
  955. MANAGE_PRIORITY,
  956. RSVD4,
  957. RSVD5,
  958. UART_PRIORITY
  959. } priority_t;
  960. typedef enum {
  961. NIC_8192U = 1,
  962. NIC_8190P = 2,
  963. NIC_8192E = 3,
  964. } nic_t;
  965. bool init_firmware(struct net_device *dev);
  966. short rtl819xU_tx_cmd(struct net_device *dev, struct sk_buff *skb);
  967. short rtl8192_tx(struct net_device *dev, struct sk_buff *skb);
  968. u32 read_cam(struct net_device *dev, u8 addr);
  969. void write_cam(struct net_device *dev, u8 addr, u32 data);
  970. int read_nic_byte(struct net_device *dev, int x, u8 *data);
  971. int read_nic_byte_E(struct net_device *dev, int x, u8 *data);
  972. int read_nic_dword(struct net_device *dev, int x, u32 *data);
  973. int read_nic_word(struct net_device *dev, int x, u16 *data);
  974. int write_nic_byte(struct net_device *dev, int x, u8 y);
  975. int write_nic_byte_E(struct net_device *dev, int x, u8 y);
  976. int write_nic_word(struct net_device *dev, int x, u16 y);
  977. int write_nic_dword(struct net_device *dev, int x, u32 y);
  978. void force_pci_posting(struct net_device *dev);
  979. void rtl8192_rtx_disable(struct net_device *dev);
  980. void rtl8192_rx_enable(struct net_device *dev);
  981. void rtl8192_tx_enable(struct net_device *dev);
  982. void rtl8192_disassociate(struct net_device *dev);
  983. void rtl8185_set_rf_pins_enable(struct net_device *dev, u32 a);
  984. void rtl8192_set_anaparam(struct net_device *dev, u32 a);
  985. void rtl8185_set_anaparam2(struct net_device *dev, u32 a);
  986. void rtl8192_update_msr(struct net_device *dev);
  987. int rtl8192_down(struct net_device *dev);
  988. int rtl8192_up(struct net_device *dev);
  989. void rtl8192_commit(struct net_device *dev);
  990. void rtl8192_set_chan(struct net_device *dev, short ch);
  991. void write_phy(struct net_device *dev, u8 adr, u8 data);
  992. void write_phy_cck(struct net_device *dev, u8 adr, u32 data);
  993. void write_phy_ofdm(struct net_device *dev, u8 adr, u32 data);
  994. void rtl8185_tx_antenna(struct net_device *dev, u8 ant);
  995. void rtl8192_set_rxconf(struct net_device *dev);
  996. void rtl819xusb_beacon_tx(struct net_device *dev, u16 tx_rate);
  997. void EnableHWSecurityConfig8192(struct net_device *dev);
  998. void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, u8 *MacAddr, u8 DefaultKey, u32 *KeyContent);
  999. #endif