11d.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /**
  2. * This header file contains data structures and
  3. * function declarations of 802.11d
  4. */
  5. #ifndef _LBS_11D_
  6. #define _LBS_11D_
  7. #include "types.h"
  8. #include "defs.h"
  9. #define UNIVERSAL_REGION_CODE 0xff
  10. /** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr)
  11. */
  12. #define MRVDRV_MAX_SUBBAND_802_11D 83
  13. #define COUNTRY_CODE_LEN 3
  14. #define MAX_NO_OF_CHAN 40
  15. struct cmd_ds_command;
  16. /** Data structure for Country IE*/
  17. struct ieee_subbandset {
  18. u8 firstchan;
  19. u8 nrchan;
  20. u8 maxtxpwr;
  21. } __attribute__ ((packed));
  22. struct ieee_ie_country_info_set {
  23. struct ieee_ie_header header;
  24. u8 countrycode[COUNTRY_CODE_LEN];
  25. struct ieee_subbandset subband[1];
  26. };
  27. struct ieee_ie_country_info_full_set {
  28. struct ieee_ie_header header;
  29. u8 countrycode[COUNTRY_CODE_LEN];
  30. struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
  31. } __attribute__ ((packed));
  32. struct mrvl_ie_domain_param_set {
  33. struct mrvl_ie_header header;
  34. u8 countrycode[COUNTRY_CODE_LEN];
  35. struct ieee_subbandset subband[1];
  36. } __attribute__ ((packed));
  37. struct cmd_ds_802_11d_domain_info {
  38. __le16 action;
  39. struct mrvl_ie_domain_param_set domain;
  40. } __attribute__ ((packed));
  41. /** domain regulatory information */
  42. struct lbs_802_11d_domain_reg {
  43. /** country Code*/
  44. u8 countrycode[COUNTRY_CODE_LEN];
  45. /** No. of subband*/
  46. u8 nr_subband;
  47. struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
  48. };
  49. struct chan_power_11d {
  50. u8 chan;
  51. u8 pwr;
  52. } __attribute__ ((packed));
  53. struct parsed_region_chan_11d {
  54. u8 band;
  55. u8 region;
  56. s8 countrycode[COUNTRY_CODE_LEN];
  57. struct chan_power_11d chanpwr[MAX_NO_OF_CHAN];
  58. u8 nr_chan;
  59. } __attribute__ ((packed));
  60. struct region_code_mapping {
  61. u8 region[COUNTRY_CODE_LEN];
  62. u8 code;
  63. };
  64. struct lbs_private;
  65. u8 lbs_get_scan_type_11d(u8 chan,
  66. struct parsed_region_chan_11d *parsed_region_chan);
  67. u32 lbs_chan_2_freq(u8 chan);
  68. void lbs_init_11d(struct lbs_private *priv);
  69. int lbs_set_universaltable(struct lbs_private *priv, u8 band);
  70. int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
  71. struct cmd_ds_command *cmd, u16 cmdno,
  72. u16 cmdOption);
  73. int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);
  74. struct bss_descriptor;
  75. int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
  76. struct bss_descriptor * bss);
  77. int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv);
  78. #endif