Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170910
b: refs/heads/master
c: d94cd29
h: refs/heads/master
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Oct 27, 2009
1 parent a6eb95b commit f87d257
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 23 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: 8a5a37a6c492f7c9602aa72ef19f69c926cdca15
refs/heads/master: d94cd297e58b55bb272fdfd51ff0de7acbc1941b
12 changes: 12 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1271.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ enum {
CFG_RX_CTL_EN | CFG_RX_BCN_EN | \
CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN)

#define WL1271_DEFAULT_BASIC_RATE_SET (ACX_RATE_MASK_ALL)

#define WL1271_FW_NAME "wl1271-fw.bin"
#define WL1271_NVS_NAME "wl1271-nvs.bin"

Expand All @@ -118,6 +120,9 @@ enum {
#define WL1271_ELP_HW_STATE_ASLEEP 0
#define WL1271_ELP_HW_STATE_IRQ 1

#define WL1271_DEFAULT_BEACON_INT 100
#define WL1271_DEFAULT_DTIM_PERIOD 1

enum wl1271_state {
WL1271_STATE_OFF,
WL1271_STATE_ON,
Expand Down Expand Up @@ -369,6 +374,13 @@ struct wl1271 {
/* Our association ID */
u16 aid;

/* Beacon parameters */
u16 beacon_int;
u8 dtim_period;

/* currently configured rate set */
u32 basic_rate_set;

/* The current band */
enum ieee80211_band band;

Expand Down
15 changes: 5 additions & 10 deletions trunk/drivers/net/wireless/wl12xx/wl1271_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,9 @@ int wl1271_cmd_cal(struct wl1271 *wl)
return ret;
}

int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
u16 beacon_interval, u8 wait)
int wl1271_cmd_join(struct wl1271 *wl)
{
static bool do_cal = true;
unsigned long timeout;
struct wl1271_cmd_join *join;
int ret, i;
u8 *bssid;
Expand Down Expand Up @@ -213,9 +211,9 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
join->basic_rate_set = RATE_MASK_1MBPS | RATE_MASK_2MBPS |
RATE_MASK_5_5MBPS | RATE_MASK_11MBPS;

join->beacon_interval = beacon_interval;
join->dtim_interval = dtim_interval;
join->bss_type = bss_type;
join->beacon_interval = wl->beacon_int;
join->dtim_interval = wl->dtim_period;
join->bss_type = wl->bss_type;
join->channel = wl->channel;
join->ssid_len = wl->ssid_len;
memcpy(join->ssid, wl->ssid, wl->ssid_len);
Expand All @@ -239,14 +237,11 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
goto out_free;
}

timeout = msecs_to_jiffies(JOIN_TIMEOUT);

/*
* ugly hack: we should wait for JOIN_EVENT_COMPLETE_ID but to
* simplify locking we just sleep instead, for now
*/
if (wait)
msleep(10);
msleep(10);

out_free:
kfree(join);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/wl12xx/wl1271_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
struct acx_header;

int wl1271_cmd_send(struct wl1271 *wl, u16 type, void *buf, size_t buf_len);
int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type, u8 dtim_interval,
u16 beacon_interval, u8 wait);
int wl1271_cmd_join(struct wl1271 *wl);
int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
Expand Down
42 changes: 32 additions & 10 deletions trunk/drivers/net/wireless/wl12xx/wl1271_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,7 @@ static void wl1271_filter_work(struct work_struct *work)
if (ret < 0)
goto out;

/* FIXME: replace the magic numbers with proper definitions */
ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);
ret = wl1271_cmd_join(wl);
if (ret < 0)
goto out_sleep;

Expand Down Expand Up @@ -672,8 +671,7 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw,
memcpy(wl->ssid, conf->ssid, wl->ssid_len);

if (wl->bss_type != BSS_TYPE_IBSS) {
/* FIXME: replace the magic numbers with proper definitions */
ret = wl1271_cmd_join(wl, wl->bss_type, 5, 100, 1);
ret = wl1271_cmd_join(wl);
if (ret < 0)
goto out_sleep;
}
Expand All @@ -696,8 +694,7 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw,
if (ret < 0)
goto out_sleep;

/* FIXME: replace the magic numbers with proper definitions */
ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);
ret = wl1271_cmd_join(wl);

if (ret < 0)
goto out_sleep;
Expand Down Expand Up @@ -738,8 +735,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
u8 old_channel = wl->channel;
wl->channel = channel;

/* FIXME: use beacon interval provided by mac80211 */
ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);
ret = wl1271_cmd_join(wl);
if (ret < 0) {
wl->channel = old_channel;
goto out_sleep;
Expand Down Expand Up @@ -1016,8 +1012,17 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,

if (changed & BSS_CHANGED_ASSOC) {
if (bss_conf->assoc) {
wl->beacon_int = bss_conf->beacon_int;
wl->dtim_period = bss_conf->dtim_period;
wl->aid = bss_conf->aid;

ret = wl1271_cmd_join(wl);
if (ret < 0) {
wl1271_warning("Association configuration "
"failed %d", ret);
goto out_sleep;
}

ret = wl1271_cmd_build_ps_poll(wl, wl->aid);
if (ret < 0)
goto out_sleep;
Expand All @@ -1033,7 +1038,14 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
if (ret < 0)
goto out_sleep;
}
} else {
/* use defaults when not associated */
wl->beacon_int = WL1271_DEFAULT_BEACON_INT;
wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD;
wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET;
wl->aid = 0;
}

}

if (changed & BSS_CHANGED_ERP_SLOT) {
Expand Down Expand Up @@ -1066,13 +1078,20 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
}

if (changed & BSS_CHANGED_BASIC_RATES) {
u32 enabled_rates = wl1271_enabled_rates_get(
wl->basic_rate_set = wl1271_enabled_rates_get(
wl, bss_conf->basic_rates);
ret = wl1271_acx_rate_policies(wl, enabled_rates);
ret = wl1271_acx_rate_policies(wl, wl->basic_rate_set);

if (ret < 0) {
wl1271_warning("Set rate policies failed %d", ret);
goto out_sleep;
}
ret = wl1271_cmd_join(wl);
if (ret < 0) {
wl1271_warning("Join with new basic rate "
"set failed %d", ret);
goto out_sleep;
}
}

out_sleep:
Expand Down Expand Up @@ -1269,6 +1288,9 @@ static int __devinit wl1271_probe(struct spi_device *spi)
wl->psm_requested = false;
wl->tx_queue_stopped = false;
wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
wl->beacon_int = WL1271_DEFAULT_BEACON_INT;
wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD;
wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET;
wl->band = IEEE80211_BAND_2GHZ;

/* We use the default power on sleep time until we know which chip
Expand Down

0 comments on commit f87d257

Please sign in to comment.