aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271.h
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-02-18 06:25:42 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-19 15:52:43 -0500
commit152ee6e09e2ce54d7d1cc9d338b82c0bf3cbbc95 (patch)
treed6f9ffed8d59cc257f2dfd884337f946a212ea3b /drivers/net/wireless/wl12xx/wl1271.h
parentc6999d831ab9ae5e368b20f3bc11b0ca9c17a7ec (diff)
wl1271: Use NVS INI file configuration
Replace the hardcoded general and radio parameter configuration in the driver with configuration taken from the NVS file directly. Also remove the driver dependency to the structures with the parameter data. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271.h')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index d0938db043b..b3a3402593d 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -109,7 +109,33 @@ enum {
109 109
110#define WL1271_FW_NAME "wl1271-fw.bin" 110#define WL1271_FW_NAME "wl1271-fw.bin"
111#define WL1271_NVS_NAME "wl1271-nvs.bin" 111#define WL1271_NVS_NAME "wl1271-nvs.bin"
112#define WL1271_NVS_LEN 468 112
113/* NVS data structure */
114#define WL1271_NVS_SECTION_SIZE 468
115
116#define WL1271_NVS_GENERAL_PARAMS_SIZE 57
117#define WL1271_NVS_GENERAL_PARAMS_SIZE_PADDED \
118 (WL1271_NVS_GENERAL_PARAMS_SIZE + 1)
119#define WL1271_NVS_STAT_RADIO_PARAMS_SIZE 17
120#define WL1271_NVS_STAT_RADIO_PARAMS_SIZE_PADDED \
121 (WL1271_NVS_STAT_RADIO_PARAMS_SIZE + 1)
122#define WL1271_NVS_DYN_RADIO_PARAMS_SIZE 65
123#define WL1271_NVS_DYN_RADIO_PARAMS_SIZE_PADDED \
124 (WL1271_NVS_DYN_RADIO_PARAMS_SIZE + 1)
125#define WL1271_NVS_FEM_COUNT 2
126#define WL1271_NVS_INI_SPARE_SIZE 124
127
128struct wl1271_nvs_file {
129 /* NVS section */
130 u8 nvs[WL1271_NVS_SECTION_SIZE];
131
132 /* INI section */
133 u8 general_params[WL1271_NVS_GENERAL_PARAMS_SIZE_PADDED];
134 u8 stat_radio_params[WL1271_NVS_STAT_RADIO_PARAMS_SIZE_PADDED];
135 u8 dyn_radio_params[WL1271_NVS_FEM_COUNT]
136 [WL1271_NVS_DYN_RADIO_PARAMS_SIZE_PADDED];
137 u8 ini_spare[WL1271_NVS_INI_SPARE_SIZE];
138} __attribute__ ((packed));
113 139
114/* 140/*
115 * Enable/disable 802.11a support for WL1273 141 * Enable/disable 802.11a support for WL1273
@@ -342,8 +368,7 @@ struct wl1271 {
342 368
343 u8 *fw; 369 u8 *fw;
344 size_t fw_len; 370 size_t fw_len;
345 u8 *nvs; 371 struct wl1271_nvs_file *nvs;
346 size_t nvs_len;
347 372
348 u8 bssid[ETH_ALEN]; 373 u8 bssid[ETH_ALEN];
349 u8 mac_addr[ETH_ALEN]; 374 u8 mac_addr[ETH_ALEN];
@@ -461,6 +486,7 @@ int wl1271_plt_stop(struct wl1271 *wl);
461 486
462static inline bool wl1271_11a_enabled(void) 487static inline bool wl1271_11a_enabled(void)
463{ 488{
489 /* FIXME: this could be determined based on the NVS-INI file */
464#ifdef WL1271_80211A_ENABLED 490#ifdef WL1271_80211A_ENABLED
465 return true; 491 return true;
466#else 492#else