blob: fb75d3e321a05a64fcd5c7e0736a562f47c83fd1 [file] [log] [blame]
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02001/**
2 * This header file contains data structures and
3 * function declarations of 802.11d
4 */
Holger Schurig10078322007-11-15 18:05:47 -05005#ifndef _LBS_11D_
6#define _LBS_11D_
Marcelo Tosatti876c9d32007-02-10 12:25:27 -02007
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
20struct cmd_ds_command;
21
22/** Data structure for Country IE*/
Dan Williams75b6a612009-05-22 20:03:09 -040023struct ieee_subbandset {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020024 u8 firstchan;
25 u8 nrchan;
26 u8 maxtxpwr;
27} __attribute__ ((packed));
28
Dan Williams75b6a612009-05-22 20:03:09 -040029struct ieee_ie_country_info_set {
30 struct ieee_ie_header header;
31
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020032 u8 countrycode[COUNTRY_CODE_LEN];
Dan Williams75b6a612009-05-22 20:03:09 -040033 struct ieee_subbandset subband[1];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020034};
35
Dan Williams75b6a612009-05-22 20:03:09 -040036struct ieee_ie_country_info_full_set {
37 struct ieee_ie_header header;
38
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020039 u8 countrycode[COUNTRY_CODE_LEN];
Dan Williams75b6a612009-05-22 20:03:09 -040040 struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020041} __attribute__ ((packed));
42
Dan Williams75b6a612009-05-22 20:03:09 -040043struct mrvl_ie_domain_param_set {
44 struct mrvl_ie_header header;
45
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020046 u8 countrycode[COUNTRY_CODE_LEN];
Dan Williams75b6a612009-05-22 20:03:09 -040047 struct ieee_subbandset subband[1];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020048} __attribute__ ((packed));
49
50struct cmd_ds_802_11d_domain_info {
David Woodhouse981f1872007-05-25 23:36:54 -040051 __le16 action;
Dan Williams75b6a612009-05-22 20:03:09 -040052 struct mrvl_ie_domain_param_set domain;
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020053} __attribute__ ((packed));
54
55/** domain regulatory information */
Holger Schurig10078322007-11-15 18:05:47 -050056struct lbs_802_11d_domain_reg {
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020057 /** country Code*/
58 u8 countrycode[COUNTRY_CODE_LEN];
59 /** No. of subband*/
60 u8 nr_subband;
Dan Williams75b6a612009-05-22 20:03:09 -040061 struct ieee_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020062};
63
64struct chan_power_11d {
65 u8 chan;
66 u8 pwr;
67} __attribute__ ((packed));
68
69struct 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
77struct region_code_mapping {
78 u8 region[COUNTRY_CODE_LEN];
79 u8 code;
80};
81
Holger Schurig69f90322007-11-23 15:43:44 +010082struct lbs_private;
83
Holger Schurig10078322007-11-15 18:05:47 -050084u8 lbs_get_scan_type_11d(u8 chan,
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020085 struct parsed_region_chan_11d *parsed_region_chan);
86
Holger Schurige98a88d2008-03-19 14:25:58 +010087u32 lbs_chan_2_freq(u8 chan);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020088
Holger Schurig69f90322007-11-23 15:43:44 +010089void lbs_init_11d(struct lbs_private *priv);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020090
Holger Schurig69f90322007-11-23 15:43:44 +010091int lbs_set_universaltable(struct lbs_private *priv, u8 band);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020092
Holger Schurig69f90322007-11-23 15:43:44 +010093int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020094 struct cmd_ds_command *cmd, u16 cmdno,
95 u16 cmdOption);
96
Holger Schurige98a88d2008-03-19 14:25:58 +010097int lbs_ret_802_11d_domain_info(struct cmd_ds_command *resp);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -020098
Dan Williamse76850d2007-05-25 17:09:41 -040099struct bss_descriptor;
Holger Schurig69f90322007-11-23 15:43:44 +0100100int lbs_parse_dnld_countryinfo_11d(struct lbs_private *priv,
Dan Williamse76850d2007-05-25 17:09:41 -0400101 struct bss_descriptor * bss);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200102
Holger Schurig69f90322007-11-23 15:43:44 +0100103int lbs_create_dnld_countryinfo_11d(struct lbs_private *priv);
Marcelo Tosatti876c9d32007-02-10 12:25:27 -0200104
Holger Schurig10078322007-11-15 18:05:47 -0500105#endif