broadcom.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*
  2. * Custom OID/ioctl definitions for
  3. * Broadcom 802.11abg Networking Device Driver
  4. *
  5. * Definitions subject to change without notice.
  6. *
  7. * Copyright 2006, Broadcom Corporation
  8. * All Rights Reserved.
  9. *
  10. * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
  11. * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
  12. * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
  13. * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
  14. *
  15. */
  16. #ifndef _BROADCOM_H
  17. #define _BROADCOM_H
  18. #define WL_MCSSET_LEN 16
  19. #define WL_MAX_STA_COUNT 32
  20. #define WL_BSS_RSSI_OFFSET 82
  21. #define WL_BSS_NOISE_OFFSET 84
  22. #define WLC_IOCTL_MAGIC 0x14e46c77
  23. #define WLC_IOCTL_MAXLEN 8192
  24. #define WLC_CNTRY_BUF_SZ 4
  25. #define WLC_GET_MAGIC 0
  26. #define WLC_GET_RATE 12
  27. #define WLC_GET_INFRA 19
  28. #define WLC_GET_AUTH 21
  29. #define WLC_GET_BSSID 23
  30. #define WLC_GET_SSID 25
  31. #define WLC_GET_CHANNEL 29
  32. #define WLC_GET_PHYTYPE 39
  33. #define WLC_GET_PASSIVE 48
  34. #define WLC_GET_COUNTRY 83
  35. #define WLC_GET_REVINFO 98
  36. #define WLC_GET_AP 117
  37. #define WLC_GET_RSSI 127
  38. #define WLC_GET_WSEC 133
  39. #define WLC_GET_PHY_NOISE 135
  40. #define WLC_GET_BSS_INFO 136
  41. #define WLC_GET_BANDLIST 140
  42. #define WLC_GET_ASSOCLIST 159
  43. #define WLC_GET_WPA_AUTH 164
  44. #define WLC_GET_COUNTRY_LIST 261
  45. #define WLC_GET_VAR 262
  46. #define WLC_PHY_TYPE_A 0
  47. #define WLC_PHY_TYPE_B 1
  48. #define WLC_PHY_TYPE_G 2
  49. #define WLC_PHY_TYPE_N 4
  50. #define WLC_PHY_TYPE_LP 5
  51. #define WLC_BAND_5G 1
  52. #define WLC_BAND_2G 2
  53. #define WLC_BAND_ALL 3
  54. struct wl_ether_addr {
  55. uint8_t octet[6];
  56. };
  57. struct wl_maclist {
  58. uint count;
  59. struct wl_ether_addr ea[1];
  60. };
  61. typedef struct wl_sta_rssi {
  62. int rssi;
  63. char mac[6];
  64. uint16_t foo;
  65. } wl_sta_rssi_t;
  66. #define WL_NUMRATES 255 /* max # of rates in a rateset */
  67. typedef struct wl_rateset {
  68. uint32_t count; /* # rates in this set */
  69. uint8_t rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
  70. } wl_rateset_t;
  71. typedef struct wl_sta_info {
  72. uint16_t ver; /* version of this struct */
  73. uint16_t len; /* length in bytes of this structure */
  74. uint16_t cap; /* sta's advertised capabilities */
  75. uint32_t flags; /* flags defined below */
  76. uint32_t idle; /* time since data pkt rx'd from sta */
  77. unsigned char ea[6]; /* Station address */
  78. wl_rateset_t rateset; /* rateset in use */
  79. uint32_t in; /* seconds elapsed since associated */
  80. uint32_t listen_interval_inms; /* Min Listen interval in ms for this STA */
  81. uint32_t tx_pkts; /* # of packets transmitted */
  82. uint32_t tx_failures; /* # of packets failed */
  83. uint32_t rx_ucast_pkts; /* # of unicast packets received */
  84. uint32_t rx_mcast_pkts; /* # of multicast packets received */
  85. uint32_t tx_rate; /* Rate of last successful tx frame */
  86. uint32_t rx_rate; /* Rate of last successful rx frame */
  87. } wl_sta_info_t;
  88. typedef struct wlc_ssid {
  89. uint32_t ssid_len;
  90. unsigned char ssid[32];
  91. } wlc_ssid_t;
  92. /* Linux network driver ioctl encoding */
  93. typedef struct wl_ioctl {
  94. uint32_t cmd; /* common ioctl definition */
  95. void *buf; /* pointer to user buffer */
  96. uint32_t len; /* length of user buffer */
  97. uint8_t set; /* get or set request (optional) */
  98. uint32_t used; /* bytes read or written (optional) */
  99. uint32_t needed; /* bytes needed (optional) */
  100. } wl_ioctl_t;
  101. /* Revision info */
  102. typedef struct wlc_rev_info {
  103. uint vendorid; /* PCI vendor id */
  104. uint deviceid; /* device id of chip */
  105. uint radiorev; /* radio revision */
  106. uint chiprev; /* chip revision */
  107. uint corerev; /* core revision */
  108. uint boardid; /* board identifier (usu. PCI sub-device id) */
  109. uint boardvendor; /* board vendor (usu. PCI sub-vendor id) */
  110. uint boardrev; /* board revision */
  111. uint driverrev; /* driver version */
  112. uint ucoderev; /* microcode version */
  113. uint bus; /* bus type */
  114. uint chipnum; /* chip number */
  115. uint phytype; /* phy type */
  116. uint phyrev; /* phy revision */
  117. uint anarev; /* anacore rev */
  118. } wlc_rev_info_t;
  119. typedef struct wl_country_list {
  120. uint32_t buflen;
  121. uint32_t band_set;
  122. uint32_t band;
  123. uint32_t count;
  124. char country_abbrev[1];
  125. } wl_country_list_t;
  126. #endif