| 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*/ | 
|  | 23 | struct ieeetypes_subbandset { | 
|  | 24 | u8 firstchan; | 
|  | 25 | u8 nrchan; | 
|  | 26 | u8 maxtxpwr; | 
|  | 27 | } __attribute__ ((packed)); | 
|  | 28 |  | 
|  | 29 | struct ieeetypes_countryinfoset { | 
|  | 30 | u8 element_id; | 
|  | 31 | u8 len; | 
|  | 32 | u8 countrycode[COUNTRY_CODE_LEN]; | 
|  | 33 | struct ieeetypes_subbandset subband[1]; | 
|  | 34 | }; | 
|  | 35 |  | 
|  | 36 | struct ieeetypes_countryinfofullset { | 
|  | 37 | u8 element_id; | 
|  | 38 | u8 len; | 
|  | 39 | u8 countrycode[COUNTRY_CODE_LEN]; | 
|  | 40 | struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; | 
|  | 41 | } __attribute__ ((packed)); | 
|  | 42 |  | 
|  | 43 | struct mrvlietypes_domainparamset { | 
|  | 44 | struct mrvlietypesheader header; | 
|  | 45 | u8 countrycode[COUNTRY_CODE_LEN]; | 
|  | 46 | struct ieeetypes_subbandset subband[1]; | 
|  | 47 | } __attribute__ ((packed)); | 
|  | 48 |  | 
|  | 49 | struct cmd_ds_802_11d_domain_info { | 
| David Woodhouse | 981f187 | 2007-05-25 23:36:54 -0400 | [diff] [blame] | 50 | __le16 action; | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 51 | struct mrvlietypes_domainparamset domain; | 
|  | 52 | } __attribute__ ((packed)); | 
|  | 53 |  | 
|  | 54 | /** domain regulatory information */ | 
| Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 55 | struct lbs_802_11d_domain_reg { | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 56 | /** country Code*/ | 
|  | 57 | u8 countrycode[COUNTRY_CODE_LEN]; | 
|  | 58 | /** No. of subband*/ | 
|  | 59 | u8 nr_subband; | 
|  | 60 | struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D]; | 
|  | 61 | }; | 
|  | 62 |  | 
|  | 63 | struct chan_power_11d { | 
|  | 64 | u8 chan; | 
|  | 65 | u8 pwr; | 
|  | 66 | } __attribute__ ((packed)); | 
|  | 67 |  | 
|  | 68 | struct parsed_region_chan_11d { | 
|  | 69 | u8 band; | 
|  | 70 | u8 region; | 
|  | 71 | s8 countrycode[COUNTRY_CODE_LEN]; | 
|  | 72 | struct chan_power_11d chanpwr[MAX_NO_OF_CHAN]; | 
|  | 73 | u8 nr_chan; | 
|  | 74 | } __attribute__ ((packed)); | 
|  | 75 |  | 
|  | 76 | struct region_code_mapping { | 
|  | 77 | u8 region[COUNTRY_CODE_LEN]; | 
|  | 78 | u8 code; | 
|  | 79 | }; | 
|  | 80 |  | 
| Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 81 | struct lbs_private; | 
|  | 82 |  | 
| Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 83 | u8 lbs_get_scan_type_11d(u8 chan, | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 84 | struct parsed_region_chan_11d *parsed_region_chan); | 
|  | 85 |  | 
| Holger Schurig | 1007832 | 2007-11-15 18:05:47 -0500 | [diff] [blame] | 86 | u32 lbs_chan_2_freq(u8 chan, u8 band); | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 87 |  | 
| Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 88 | void lbs_init_11d(struct lbs_private *priv); | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 89 |  | 
| Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 90 | int lbs_set_universaltable(struct lbs_private *priv, u8 band); | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 91 |  | 
| Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 92 | int lbs_cmd_802_11d_domain_info(struct lbs_private *priv, | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 93 | struct cmd_ds_command *cmd, u16 cmdno, | 
|  | 94 | u16 cmdOption); | 
|  | 95 |  | 
| Holger Schurig | 69f9032 | 2007-11-23 15:43:44 +0100 | [diff] [blame] | 96 | int lbs_ret_802_11d_domain_info(struct lbs_private *priv, | 
| Marcelo Tosatti | 876c9d3 | 2007-02-10 12:25:27 -0200 | [diff] [blame] | 97 | struct cmd_ds_command *resp); | 
|  | 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 |