Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 237003
b: refs/heads/master
c: c3e334d
h: refs/heads/master
i:
  237001: a6af749
  236999: 675a88b
v: v3
  • Loading branch information
David Gnedt authored and John W. Linville committed Feb 3, 2011
1 parent 5d82598 commit 259b44e
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb4793b3c6370a1fed86978c6590241d770cb43e
refs/heads/master: c3e334d29484423e78009790a3d3fa78da8b43a1
28 changes: 28 additions & 0 deletions trunk/drivers/net/wireless/wl1251/acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,34 @@ int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim)
return ret;
}

int wl1251_acx_bet_enable(struct wl1251 *wl, enum wl1251_acx_bet_mode mode,
u8 max_consecutive)
{
struct wl1251_acx_bet_enable *acx;
int ret;

wl1251_debug(DEBUG_ACX, "acx bet enable");

acx = kzalloc(sizeof(*acx), GFP_KERNEL);
if (!acx) {
ret = -ENOMEM;
goto out;
}

acx->enable = mode;
acx->max_consecutive = max_consecutive;

ret = wl1251_cmd_configure(wl, ACX_BET_ENABLE, acx, sizeof(*acx));
if (ret < 0) {
wl1251_warning("wl1251 acx bet enable failed: %d", ret);
goto out;
}

out:
kfree(acx);
return ret;
}

int wl1251_acx_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max,
u8 aifs, u16 txop)
{
Expand Down
27 changes: 27 additions & 0 deletions trunk/drivers/net/wireless/wl1251/acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,31 @@ struct wl1251_acx_wr_tbtt_and_dtim {
u8 padding;
} __packed;

enum wl1251_acx_bet_mode {
WL1251_ACX_BET_DISABLE = 0,
WL1251_ACX_BET_ENABLE = 1,
};

struct wl1251_acx_bet_enable {
struct acx_header header;

/*
* Specifies if beacon early termination procedure is enabled or
* disabled, see enum wl1251_acx_bet_mode.
*/
u8 enable;

/*
* Specifies the maximum number of consecutive beacons that may be
* early terminated. After this number is reached at least one full
* beacon must be correctly received in FW before beacon ET
* resumes. Range 0 - 255.
*/
u8 max_consecutive;

u8 padding[2];
} __packed;

struct wl1251_acx_ac_cfg {
struct acx_header header;

Expand Down Expand Up @@ -1401,6 +1426,8 @@ int wl1251_acx_tsf_info(struct wl1251 *wl, u64 *mactime);
int wl1251_acx_rate_policies(struct wl1251 *wl);
int wl1251_acx_mem_cfg(struct wl1251 *wl);
int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim);
int wl1251_acx_bet_enable(struct wl1251 *wl, enum wl1251_acx_bet_mode mode,
u8 max_consecutive);
int wl1251_acx_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max,
u8 aifs, u16 txop);
int wl1251_acx_tid_cfg(struct wl1251 *wl, u8 queue,
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/net/wireless/wl1251/ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode)
if (ret < 0)
return ret;

ret = wl1251_acx_bet_enable(wl, WL1251_ACX_BET_ENABLE,
WL1251_DEFAULT_BET_CONSECUTIVE);
if (ret < 0)
return ret;

ret = wl1251_cmd_ps_mode(wl, STATION_POWER_SAVE_MODE);
if (ret < 0)
return ret;
Expand All @@ -170,6 +175,12 @@ int wl1251_ps_set_mode(struct wl1251 *wl, enum wl1251_cmd_ps_mode mode)
if (ret < 0)
return ret;

/* disable BET */
ret = wl1251_acx_bet_enable(wl, WL1251_ACX_BET_DISABLE,
WL1251_DEFAULT_BET_CONSECUTIVE);
if (ret < 0)
return ret;

/* disable beacon filtering */
ret = wl1251_acx_beacon_filter_opt(wl, false);
if (ret < 0)
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/wl1251/wl1251.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ void wl1251_disable_interrupts(struct wl1251 *wl);

#define WL1251_DEFAULT_CHANNEL 0

#define WL1251_DEFAULT_BET_CONSECUTIVE 10

#define CHIP_ID_1251_PG10 (0x7010101)
#define CHIP_ID_1251_PG11 (0x7020101)
#define CHIP_ID_1251_PG12 (0x7030101)
Expand Down

0 comments on commit 259b44e

Please sign in to comment.