zd1201.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * Copyright (c) 2004, 2005 Jeroen Vreeken (pe1rxq@amsat.org)
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * version 2 as published by the Free Software Foundation.
  7. *
  8. * Parts of this driver have been derived from a wlan-ng version
  9. * modified by ZyDAS.
  10. * Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
  11. */
  12. #ifndef _INCLUDE_ZD1201_H_
  13. #define _INCLUDE_ZD1201_H_
  14. #define ZD1201_NUMKEYS 4
  15. #define ZD1201_MAXKEYLEN 13
  16. #define ZD1201_MAXMULTI 16
  17. #define ZD1201_FRAGMAX 2500
  18. #define ZD1201_FRAGMIN 256
  19. #define ZD1201_RTSMAX 2500
  20. #define ZD1201_RXSIZE 3000
  21. struct zd1201 {
  22. struct usb_device *usb;
  23. int removed;
  24. struct net_device *dev;
  25. struct iw_statistics iwstats;
  26. int endp_in;
  27. int endp_out;
  28. int endp_out2;
  29. struct urb *rx_urb;
  30. struct urb *tx_urb;
  31. unsigned char rxdata[ZD1201_RXSIZE];
  32. int rxlen;
  33. wait_queue_head_t rxdataq;
  34. int rxdatas;
  35. struct hlist_head fraglist;
  36. unsigned char txdata[ZD1201_RXSIZE];
  37. int ap;
  38. char essid[IW_ESSID_MAX_SIZE+1];
  39. int essidlen;
  40. int mac_enabled;
  41. int was_enabled;
  42. int monitor;
  43. int encode_enabled;
  44. int encode_restricted;
  45. unsigned char encode_keys[ZD1201_NUMKEYS][ZD1201_MAXKEYLEN];
  46. int encode_keylen[ZD1201_NUMKEYS];
  47. };
  48. struct zd1201_frag {
  49. struct hlist_node fnode;
  50. int seq;
  51. struct sk_buff *skb;
  52. };
  53. #define ZD1201SIWHOSTAUTH SIOCIWFIRSTPRIV
  54. #define ZD1201GIWHOSTAUTH ZD1201SIWHOSTAUTH+1
  55. #define ZD1201SIWAUTHSTA SIOCIWFIRSTPRIV+2
  56. #define ZD1201SIWMAXASSOC SIOCIWFIRSTPRIV+4
  57. #define ZD1201GIWMAXASSOC ZD1201SIWMAXASSOC+1
  58. #define ZD1201_FW_TIMEOUT (1000)
  59. #define ZD1201_TX_TIMEOUT (2000)
  60. #define ZD1201_USB_CMDREQ 0
  61. #define ZD1201_USB_RESREQ 1
  62. #define ZD1201_CMDCODE_INIT 0x00
  63. #define ZD1201_CMDCODE_ENABLE 0x01
  64. #define ZD1201_CMDCODE_DISABLE 0x02
  65. #define ZD1201_CMDCODE_ALLOC 0x0a
  66. #define ZD1201_CMDCODE_INQUIRE 0x11
  67. #define ZD1201_CMDCODE_SETRXRID 0x17
  68. #define ZD1201_CMDCODE_ACCESS 0x21
  69. #define ZD1201_PACKET_EVENTSTAT 0x0
  70. #define ZD1201_PACKET_RXDATA 0x1
  71. #define ZD1201_PACKET_INQUIRE 0x2
  72. #define ZD1201_PACKET_RESOURCE 0x3
  73. #define ZD1201_ACCESSBIT 0x0100
  74. #define ZD1201_RID_CNFPORTTYPE 0xfc00
  75. #define ZD1201_RID_CNFOWNMACADDR 0xfc01
  76. #define ZD1201_RID_CNFDESIREDSSID 0xfc02
  77. #define ZD1201_RID_CNFOWNCHANNEL 0xfc03
  78. #define ZD1201_RID_CNFOWNSSID 0xfc04
  79. #define ZD1201_RID_CNFMAXDATALEN 0xfc07
  80. #define ZD1201_RID_CNFPMENABLED 0xfc09
  81. #define ZD1201_RID_CNFPMEPS 0xfc0a
  82. #define ZD1201_RID_CNFMAXSLEEPDURATION 0xfc0c
  83. #define ZD1201_RID_CNFDEFAULTKEYID 0xfc23
  84. #define ZD1201_RID_CNFDEFAULTKEY0 0xfc24
  85. #define ZD1201_RID_CNFDEFAULTKEY1 0xfc25
  86. #define ZD1201_RID_CNFDEFAULTKEY2 0xfc26
  87. #define ZD1201_RID_CNFDEFAULTKEY3 0xfc27
  88. #define ZD1201_RID_CNFWEBFLAGS 0xfc28
  89. #define ZD1201_RID_CNFAUTHENTICATION 0xfc2a
  90. #define ZD1201_RID_CNFMAXASSOCSTATIONS 0xfc2b
  91. #define ZD1201_RID_CNFHOSTAUTH 0xfc2e
  92. #define ZD1201_RID_CNFGROUPADDRESS 0xfc80
  93. #define ZD1201_RID_CNFFRAGTHRESHOLD 0xfc82
  94. #define ZD1201_RID_CNFRTSTHRESHOLD 0xfc83
  95. #define ZD1201_RID_TXRATECNTL 0xfc84
  96. #define ZD1201_RID_PROMISCUOUSMODE 0xfc85
  97. #define ZD1201_RID_CNFBASICRATES 0xfcb3
  98. #define ZD1201_RID_AUTHENTICATESTA 0xfce3
  99. #define ZD1201_RID_CURRENTBSSID 0xfd42
  100. #define ZD1201_RID_COMMSQUALITY 0xfd43
  101. #define ZD1201_RID_CURRENTTXRATE 0xfd44
  102. #define ZD1201_RID_CNFMAXTXBUFFERNUMBER 0xfda0
  103. #define ZD1201_RID_CURRENTCHANNEL 0xfdc1
  104. #define ZD1201_INQ_SCANRESULTS 0xf101
  105. #define ZD1201_INF_LINKSTATUS 0xf200
  106. #define ZD1201_INF_ASSOCSTATUS 0xf201
  107. #define ZD1201_INF_AUTHREQ 0xf202
  108. #define ZD1201_ASSOCSTATUS_STAASSOC 0x1
  109. #define ZD1201_ASSOCSTATUS_REASSOC 0x2
  110. #define ZD1201_ASSOCSTATUS_DISASSOC 0x3
  111. #define ZD1201_ASSOCSTATUS_ASSOCFAIL 0x4
  112. #define ZD1201_ASSOCSTATUS_AUTHFAIL 0x5
  113. #define ZD1201_PORTTYPE_IBSS 0
  114. #define ZD1201_PORTTYPE_BSS 1
  115. #define ZD1201_PORTTYPE_WDS 2
  116. #define ZD1201_PORTTYPE_PSEUDOIBSS 3
  117. #define ZD1201_PORTTYPE_AP 6
  118. #define ZD1201_RATEB1 1
  119. #define ZD1201_RATEB2 2
  120. #define ZD1201_RATEB5 4 /* 5.5 really, but 5 is shorter :) */
  121. #define ZD1201_RATEB11 8
  122. #define ZD1201_CNFAUTHENTICATION_OPENSYSTEM 0x0001
  123. #define ZD1201_CNFAUTHENTICATION_SHAREDKEY 0x0002
  124. #endif /* _INCLUDE_ZD1201_H_ */