aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/11d.h
blob: 982d7929eed7cd1ec129044b09d5503e4aae6026 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/**
  * This header file contains data structures and
  * function declarations of 802.11d
  */
#ifndef _WLAN_11D_
#define _WLAN_11D_

#include "types.h"
#include "defs.h"

#define UNIVERSAL_REGION_CODE			0xff

/** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr)
 */
#define MRVDRV_MAX_SUBBAND_802_11D		83

#define COUNTRY_CODE_LEN			3
#define MAX_NO_OF_CHAN 				40

struct cmd_ds_command;

/** Data structure for Country IE*/
struct ieeetypes_subbandset {
	u8 firstchan;
	u8 nrchan;
	u8 maxtxpwr;
} __attribute__ ((packed));

struct ieeetypes_countryinfoset {
	u8 element_id;
	u8 len;
	u8 countrycode[COUNTRY_CODE_LEN];
	struct ieeetypes_subbandset subband[1];
};

struct ieeetypes_countryinfofullset {
	u8 element_id;
	u8 len;
	u8 countrycode[COUNTRY_CODE_LEN];
	struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
} __attribute__ ((packed));

struct mrvlietypes_domainparamset {
	struct mrvlietypesheader header;
	u8 countrycode[COUNTRY_CODE_LEN];
	struct ieeetypes_subbandset subband[1];
} __attribute__ ((packed));

struct cmd_ds_802_11d_domain_info {
	u16 action;
	struct mrvlietypes_domainparamset domain;
} __attribute__ ((packed));

/** domain regulatory information */
struct wlan_802_11d_domain_reg {
	/** country Code*/
	u8 countrycode[COUNTRY_CODE_LEN];
	/** No. of subband*/
	u8 nr_subband;
	struct ieeetypes_subbandset subband[MRVDRV_MAX_SUBBAND_802_11D];
};

struct chan_power_11d {
	u8 chan;
	u8 pwr;
} __attribute__ ((packed));

struct parsed_region_chan_11d {
	u8 band;
	u8 region;
	s8 countrycode[COUNTRY_CODE_LEN];
	struct chan_power_11d chanpwr[MAX_NO_OF_CHAN];
	u8 nr_chan;
} __attribute__ ((packed));

struct region_code_mapping {
	u8 region[COUNTRY_CODE_LEN];
	u8 code;
};

u8 libertas_get_scan_type_11d(u8 chan,
			  struct parsed_region_chan_11d *parsed_region_chan);

u32 libertas_chan_2_freq(u8 chan, u8 band);

enum state_11d libertas_get_state_11d(wlan_private * priv);

void libertas_init_11d(wlan_private * priv);

int libertas_set_universaltable(wlan_private * priv, u8 band);

int libertas_cmd_802_11d_domain_info(wlan_private * priv,
				 struct cmd_ds_command *cmd, u16 cmdno,
				 u16 cmdOption);

int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq);

int libertas_ret_802_11d_domain_info(wlan_private * priv,
				 struct cmd_ds_command *resp);

struct bss_descriptor;
int libertas_parse_dnld_countryinfo_11d(wlan_private * priv,
                                        struct bss_descriptor * bss);

int libertas_create_dnld_countryinfo_11d(wlan_private * priv);

#endif				/* _WLAN_11D_ */