Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215044
b: refs/heads/master
c: 02fabb0
h: refs/heads/master
v: v3
  • Loading branch information
Juuso Oikarinen authored and Luciano Coelho committed Sep 28, 2010
1 parent bb9e041 commit 3442603
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18c311b71899803de91f1ed41b9d87eb81017a91
refs/heads/master: 02fabb0eafde901ae51532ad15fdd4737b7d71e3
18 changes: 3 additions & 15 deletions trunk/drivers/net/wireless/wl12xx/wl1271.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ enum {
#define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
#define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))

/*
* Enable/disable 802.11a support for WL1273
*/
#undef WL1271_80211A_ENABLED

#define WL1271_BUSY_WORD_CNT 1
#define WL1271_BUSY_WORD_LEN (WL1271_BUSY_WORD_CNT * sizeof(u32))

Expand Down Expand Up @@ -363,6 +358,7 @@ struct wl1271 {
u8 *fw;
size_t fw_len;
struct wl1271_nvs_file *nvs;
size_t nvs_len;

s8 hw_pg_ver;

Expand Down Expand Up @@ -476,6 +472,8 @@ struct wl1271 {

bool sg_enabled;

bool enable_11a;

struct list_head list;

/* Most recently reported noise in dBm */
Expand All @@ -499,14 +497,4 @@ int wl1271_plt_stop(struct wl1271 *wl);
#define WL1271_PRE_POWER_ON_SLEEP 20 /* in miliseconds */
#define WL1271_POWER_ON_SLEEP 200 /* in miliseconds */

static inline bool wl1271_11a_enabled(void)
{
/* FIXME: this could be determined based on the NVS-INI file */
#ifdef WL1271_80211A_ENABLED
return true;
#else
return false;
#endif
}

#endif
22 changes: 22 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1271_boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,28 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
if (wl->nvs == NULL)
return -ENODEV;

/*
* FIXME: the LEGACY NVS image support (NVS's missing the 5GHz band
* configurations) can be removed when those NVS files stop floating
* around.
*/
if (wl->nvs_len == sizeof(struct wl1271_nvs_file) ||
wl->nvs_len == WL1271_INI_LEGACY_NVS_FILE_SIZE) {
if (wl->nvs->general_params.dual_mode_select)
wl->enable_11a = true;
}

if (wl->nvs_len != sizeof(struct wl1271_nvs_file) &&
(wl->nvs_len != WL1271_INI_LEGACY_NVS_FILE_SIZE ||
wl->enable_11a)) {
wl1271_error("nvs size is not as expected: %zu != %zu",
wl->nvs_len, sizeof(struct wl1271_nvs_file));
kfree(wl->nvs);
wl->nvs = NULL;
wl->nvs_len = 0;
return -EILSEQ;
}

/* only the first part of the NVS needs to be uploaded */
nvs_len = sizeof(wl->nvs->nvs);
nvs_ptr = (u8 *)wl->nvs->nvs;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/wl12xx/wl1271_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int wl1271_init_templates_config(struct wl1271 *wl)
if (ret < 0)
return ret;

if (wl1271_11a_enabled()) {
if (wl->enable_11a) {
size_t size = sizeof(struct wl12xx_probe_req_template);
ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
NULL, size, 0,
Expand Down
18 changes: 3 additions & 15 deletions trunk/drivers/net/wireless/wl12xx/wl1271_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,20 +622,6 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
return ret;
}

/*
* FIXME: the LEGACY NVS image support (NVS's missing the 5GHz band
* configurations) can be removed when those NVS files stop floating
* around.
*/
if (fw->size != sizeof(struct wl1271_nvs_file) &&
(fw->size != WL1271_INI_LEGACY_NVS_FILE_SIZE ||
wl1271_11a_enabled())) {
wl1271_error("nvs size is not as expected: %zu != %zu",
fw->size, sizeof(struct wl1271_nvs_file));
ret = -EILSEQ;
goto out;
}

wl->nvs = kmemdup(fw->data, sizeof(struct wl1271_nvs_file), GFP_KERNEL);

if (!wl->nvs) {
Expand All @@ -644,6 +630,8 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
goto out;
}

wl->nvs_len = fw->size;

out:
release_firmware(fw);

Expand Down Expand Up @@ -2414,7 +2402,7 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
wl->hw->wiphy->max_scan_ssids = 1;
wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &wl1271_band_2ghz;

if (wl1271_11a_enabled())
if (wl->enable_11a)
wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz;

wl->hw->queues = 4;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/wl12xx/wl1271_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void wl1271_scan_stm(struct wl1271 *wl)
ret = wl1271_scan_send(wl, IEEE80211_BAND_2GHZ, true,
wl->conf.tx.basic_rate);
if (ret == WL1271_NOTHING_TO_SCAN) {
if (wl1271_11a_enabled())
if (wl->enable_11a)
wl->scan.state = WL1271_SCAN_STATE_5GHZ_ACTIVE;
else
wl->scan.state = WL1271_SCAN_STATE_DONE;
Expand Down
14 changes: 1 addition & 13 deletions trunk/drivers/net/wireless/wl12xx/wl1271_testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,6 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
buf = nla_data(tb[WL1271_TM_ATTR_DATA]);
len = nla_len(tb[WL1271_TM_ATTR_DATA]);

/*
* FIXME: the LEGACY NVS image support (NVS's missing the 5GHz band
* configurations) can be removed when those NVS files stop floating
* around.
*/
if (len != sizeof(struct wl1271_nvs_file) &&
(len != WL1271_INI_LEGACY_NVS_FILE_SIZE ||
wl1271_11a_enabled())) {
wl1271_error("nvs size is not as expected: %zu != %zu",
len, sizeof(struct wl1271_nvs_file));
return -EMSGSIZE;
}

mutex_lock(&wl->mutex);

kfree(wl->nvs);
Expand All @@ -224,6 +211,7 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
}

memcpy(wl->nvs, buf, len);
wl->nvs_len = len;

wl1271_debug(DEBUG_TESTMODE, "testmode pushed nvs");

Expand Down

0 comments on commit 3442603

Please sign in to comment.