Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 1 | /** |
| 2 | * This header file contains data structures and |
| 3 | * function declarations of 802.11d |
| 4 | */ |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 5 | #ifndef _LBS_11D_ |
| 6 | #define _LBS_11D_ |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 7 | |
| 8 | #include "types.h" |
| 9 | #include "defs.h" |
| 10 | |
| 11 | #define UNIVERSAL_REGION_CODE 0xff |
| 12 | |
| 13 | /** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr) |
| 14 | */ |
| 15 | #define MRVDRV_MAX_SUBBAND_802_11D 83 |
| 16 | |
| 17 | #define COUNTRY_CODE_LEN 3 |
| 18 | #define MAX_NO_OF_CHAN 40 |
| 19 | |
| 20 | struct cmd_ds_command; |
| 21 | |
| 22 | /** Data structure for Country IE*/ |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 23 | struct ieee_subbandset { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 24 | u8 firstchan; |
| 25 | u8 nrchan; |
| 26 | u8 maxtxpwr; |
| 27 | } __attribute__ ((packed)); |
| 28 | |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 29 | struct ieee_ie_country_info_set { |
| 30 | struct ieee_ie_header header; |
| 31 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 32 | u8 countrycode[COUNTRY_CODE_LEN]; |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 33 | struct ieee_subbandset subband[1]; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 34 | }; |
| 35 | |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 36 | struct ieee_ie_country_info_full_set { |
| 37 | struct ieee_ie_header header; |
| 38 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 39 | u8 countrycode[COUNTRY_CODE_LEN]; |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 40 | struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 41 | } __attribute__ ((packed)); |
| 42 | |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 43 | struct mrvl_ie_domain_param_set { |
| 44 | struct mrvl_ie_header header; |
| 45 | |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 46 | u8 countrycode[COUNTRY_CODE_LEN]; |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 47 | struct ieee_subbandset subband[1]; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 48 | } __attribute__ ((packed)); |
| 49 | |
| 50 | struct cmd_ds_802_11d_domain_info { |
David Woodhouse | 981f187 | 2007-05-25 23:36:54 -0400 | [diff] [blame] | 51 | __le16 action; |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 52 | struct mrvl_ie_domain_param_set domain; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 53 | } __attribute__ ((packed)); |
| 54 | |
| 55 | /** domain regulatory information */ |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 56 | struct lbs_802_11d_domain_reg { |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 57 | /** country Code*/ |
| 58 | u8 countrycode[COUNTRY_CODE_LEN]; |
| 59 | /** No. of subband*/ |
| 60 | u8 nr_subband; |
Dan Williams | 75b6a61 | 2009-05-22 20:03:09 -0400 | [diff] [blame] | 61 | struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 62 | }; |
| 63 | |
| 64 | struct chan_power_11d { |
| 65 | u8 chan; |
| 66 | u8 pwr; |
| 67 | } __attribute__ ((packed)); |
| 68 | |
| 69 | struct parsed_region_chan_11d { |
| 70 | u8 band; |
| 71 | u8 region; |
| 72 | s8 countrycode[COUNTRY_CODE_LEN]; |
| 73 | struct chan_power_11d chanpwr[MAX_NO_OF_CHAN]; |
| 74 | u8 nr_chan; |
| 75 | } __attribute__ ((packed)); |
| 76 | |
| 77 | struct region_code_mapping { |
| 78 | u8 region[COUNTRY_CODE_LEN]; |
| 79 | u8 code; |
| 80 | }; |
| 81 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 82 | struct lbs_private; |
| 83 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 84 | u8 lbs_get_scan_type_11d(u8 chan, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 85 | struct parsed_region_chan_11d *parsed_region_chan); |
| 86 | |
Holger Schurig | e98a88d | 2008-03-19 14:25:58 +0100 | [diff] [blame] | 87 | u32 lbs_chan_2_freq(u8 chan); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 88 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 89 | void lbs_init_11d(struct lbs_private *priv); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 90 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 91 | int lbs_set_universaltable(struct lbs_private *priv, u8 band); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 92 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 93 | int lbs_cmd_802_11d_domain_info(struct lbs_private *priv, |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 94 | struct cmd_ds_command *cmd, u16 cmdno, |
| 95 | u16 cmdOption); |
| 96 | |
Holger Schurig | e98a88d | 2008-03-19 14:25:58 +0100 | [diff] [blame] | 97 | int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 98 | |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 99 | struct bss_descriptor; |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 100 | int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv, |
Dan Williams | e76850d | 2007-05-25 17:09:41 -0400 | [diff] [blame] | 101 | struct bss_descriptor * bss); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 102 | |
Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 103 | int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv); |
Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 104 | |
Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 105 | #endif |