[PATCH] libertas: first pass at fixing up endianness issues
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / net / wireless / libertas / 11d.h
blob73e42e7129110a3da2fefc377fbdd8a10676ef0a
1 /**
2 * This header file contains data structures and
3 * function declarations of 802.11d
4 */
5 #ifndef _WLAN_11D_
6 #define _WLAN_11D_
8 #include "types.h"
9 #include "defs.h"
11 #define UNIVERSAL_REGION_CODE 0xff
13 /** (Beaconsize(256)-5(IEId,len,contrystr(3))/3(FirstChan,NoOfChan,MaxPwr)
15 #define MRVDRV_MAX_SUBBAND_802_11D 83
17 #define COUNTRY_CODE_LEN 3
18 #define MAX_NO_OF_CHAN 40
20 struct cmd_ds_command;
22 /** Data structure for Country IE*/
23 struct ieeetypes_subbandset {
24 u8 firstchan;
25 u8 nrchan;
26 u8 maxtxpwr;
27 } __attribute__ ((packed));
29 struct ieeetypes_countryinfoset {
30 u8 element_id;
31 u8 len;
32 u8 countrycode[COUNTRY_CODE_LEN];
33 struct ieeetypes_subbandset subband[1];
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));
43 struct mrvlietypes_domainparamset {
44 struct mrvlietypesheader header;
45 u8 countrycode[COUNTRY_CODE_LEN];
46 struct ieeetypes_subbandset subband[1];
47 } __attribute__ ((packed));
49 struct cmd_ds_802_11d_domain_info {
50 __le16 action;
51 struct mrvlietypes_domainparamset domain;
52 } __attribute__ ((packed));
54 /** domain regulatory information */
55 struct wlan_802_11d_domain_reg {
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];
63 struct chan_power_11d {
64 u8 chan;
65 u8 pwr;
66 } __attribute__ ((packed));
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));
76 struct region_code_mapping {
77 u8 region[COUNTRY_CODE_LEN];
78 u8 code;
81 u8 libertas_get_scan_type_11d(u8 chan,
82 struct parsed_region_chan_11d *parsed_region_chan);
84 u32 libertas_chan_2_freq(u8 chan, u8 band);
86 enum state_11d libertas_get_state_11d(wlan_private * priv);
88 void libertas_init_11d(wlan_private * priv);
90 int libertas_set_universaltable(wlan_private * priv, u8 band);
92 int libertas_cmd_802_11d_domain_info(wlan_private * priv,
93 struct cmd_ds_command *cmd, u16 cmdno,
94 u16 cmdOption);
96 int libertas_cmd_enable_11d(wlan_private * priv, struct iwreq *wrq);
98 int libertas_ret_802_11d_domain_info(wlan_private * priv,
99 struct cmd_ds_command *resp);
101 struct bss_descriptor;
102 int libertas_parse_dnld_countryinfo_11d(wlan_private * priv,
103 struct bss_descriptor * bss);
105 int libertas_create_dnld_countryinfo_11d(wlan_private * priv);
107 #endif /* _WLAN_11D_ */