11d.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 ieeetypes_subbandset {
  18. u8 firstchan;
  19. u8 nrchan;
  20. u8 maxtxpwr;
  21. } __attribute__ ((packed));
  22. struct ieeetypes_countryinfoset {
  23. u8 element_id;
  24. u8 len;
  25. u8 countrycode[COUNTRY_CODE_LEN];
  26. struct ieeetypes_subbandset subband[1];
  27. };
  28. struct ieeetypes_countryinfofullset {
  29. u8 element_id;
  30. u8 len;
  31. u8 countrycode[COUNTRY_CODE_LEN];
  32. struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
  33. } __attribute__ ((packed));
  34. struct mrvlietypes_domainparamset {
  35. struct mrvlietypesheader header;
  36. u8 countrycode[COUNTRY_CODE_LEN];
  37. struct ieeetypes_subbandset subband[1];
  38. } __attribute__ ((packed));
  39. struct cmd_ds_802_11d_domain_info {
  40. __le16 action;
  41. struct mrvlietypes_domainparamset domain;
  42. } __attribute__ ((packed));
  43. /** domain regulatory information */
  44. struct lbs_802_11d_domain_reg {
  45. /** country Code*/
  46. u8 countrycode[COUNTRY_CODE_LEN];
  47. /** No. of subband*/
  48. u8 nr_subband;
  49. struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
  50. };
  51. struct chan_power_11d {
  52. u8 chan;
  53. u8 pwr;
  54. } __attribute__ ((packed));
  55. struct parsed_region_chan_11d {
  56. u8 band;
  57. u8 region;
  58. s8 countrycode[COUNTRY_CODE_LEN];
  59. struct chan_power_11d chanpwr[MAX_NO_OF_CHAN];
  60. u8 nr_chan;
  61. } __attribute__ ((packed));
  62. struct region_code_mapping {
  63. u8 region[COUNTRY_CODE_LEN];
  64. u8 code;
  65. };
  66. struct lbs_private;
  67. u8 lbs_get_scan_type_11d(u8 chan,
  68. struct parsed_region_chan_11d *parsed_region_chan);
  69. u32 lbs_chan_2_freq(u8 chan);
  70. void lbs_init_11d(struct lbs_private *priv);
  71. int lbs_set_universaltable(struct lbs_private *priv, u8 band);
  72. int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
  73. struct cmd_ds_command *cmd, u16 cmdno,
  74. u16 cmdOption);
  75. int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);
  76. struct bss_descriptor;
  77. int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
  78. struct bss_descriptor * bss);
  79. int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv);
  80. #endif