Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170965
b: refs/heads/master
c: 51f2be2
h: refs/heads/master
i:
  170963: 6e1c9ae
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Oct 27, 2009
1 parent b791100 commit ba02e68
Show file tree
Hide file tree
Showing 7 changed files with 349 additions and 45 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: 45b531a86f93c82d8e390e19a6258111b3627bb0
refs/heads/master: 51f2be24328957f9e2acf116b1b1d2dfd10bf41f
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/wl12xx/wl1271.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ struct wl1271 {
u8 bss_type;
u8 ssid[IW_ESSID_MAX_SIZE + 1];
u8 ssid_len;
u8 listen_int;
int channel;

struct wl1271_acx_mem_map *target_mem_map;
Expand Down
63 changes: 47 additions & 16 deletions trunk/drivers/net/wireless/wl12xx/wl1271_acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
#include "wl1271_spi.h"
#include "wl1271_ps.h"

int wl1271_acx_wake_up_conditions(struct wl1271 *wl, u8 wake_up_event,
u8 listen_interval)
int wl1271_acx_wake_up_conditions(struct wl1271 *wl)
{
struct acx_wake_up_condition *wake_up;
int ret;
Expand All @@ -48,8 +47,8 @@ int wl1271_acx_wake_up_conditions(struct wl1271 *wl, u8 wake_up_event,
goto out;
}

wake_up->wake_up_event = wake_up_event;
wake_up->listen_interval = listen_interval;
wake_up->wake_up_event = wl->conf.conn.wake_up_event;
wake_up->listen_interval = wl->conf.conn.listen_interval;

ret = wl1271_cmd_configure(wl, ACX_WAKE_UP_CONDITIONS,
wake_up, sizeof(*wake_up));
Expand Down Expand Up @@ -393,18 +392,27 @@ int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold)

int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
{
struct acx_beacon_filter_option *beacon_filter;
int ret;
struct acx_beacon_filter_option *beacon_filter = NULL;
int ret = 0;

wl1271_debug(DEBUG_ACX, "acx beacon filter opt");

if (enable_filter &&
wl->conf.conn.bcn_filt_mode == CONF_BCN_FILT_MODE_DISABLED)
goto out;

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

beacon_filter->enable = enable_filter;

/*
* When set to zero, and the filter is enabled, beacons
* without the unicast TIM bit set are dropped.
*/
beacon_filter->max_num_beacons = 0;

ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_OPT,
Expand All @@ -422,8 +430,9 @@ int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
{
struct acx_beacon_filter_ie_table *ie_table;
int idx = 0;
int i, idx = 0;
int ret;
bool vendor_spec = false;

wl1271_debug(DEBUG_ACX, "acx beacon filter table");

Expand All @@ -434,9 +443,31 @@ int wl1271_acx_beacon_filter_table(struct wl1271 *wl)
}

/* configure default beacon pass-through rules */
ie_table->num_ie = 1;
ie_table->table[idx++] = BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN;
ie_table->table[idx++] = BEACON_RULE_PASS_ON_APPEARANCE;
ie_table->num_ie = 0;
for (i = 0; i < wl->conf.conn.bcn_filt_ie_count; i++) {
struct conf_bcn_filt_rule *r = &(wl->conf.conn.bcn_filt_ie[i]);
ie_table->table[idx++] = r->ie;
ie_table->table[idx++] = r->rule;

if (r->ie == WLAN_EID_VENDOR_SPECIFIC) {
/* only one vendor specific ie allowed */
if (vendor_spec)
continue;

/* for vendor specific rules configure the
additional fields */
memcpy(&(ie_table->table[idx]), r->oui,
CONF_BCN_IE_OUI_LEN);
idx += CONF_BCN_IE_OUI_LEN;
ie_table->table[idx++] = r->type;
memcpy(&(ie_table->table[idx]), r->version,
CONF_BCN_IE_VER_LEN);
idx += CONF_BCN_IE_VER_LEN;
vendor_spec = true;
}

ie_table->num_ie++;
}

ret = wl1271_cmd_configure(wl, ACX_BEACON_FILTER_TABLE,
ie_table, sizeof(*ie_table));
Expand All @@ -463,8 +494,8 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl)
goto out;
}

acx->synch_fail_thold = SYNCH_FAIL_DEFAULT_THRESHOLD;
acx->bss_lose_timeout = NO_BEACON_DEFAULT_TIMEOUT;
acx->synch_fail_thold = wl->conf.conn.synch_fail_thold;
acx->bss_lose_timeout = wl->conf.conn.bss_lose_timeout;

ret = wl1271_cmd_configure(wl, ACX_CONN_MONIT_PARAMS,
acx, sizeof(*acx));
Expand Down Expand Up @@ -585,10 +616,10 @@ int wl1271_acx_bcn_dtim_options(struct wl1271 *wl)
goto out;
}

bb->beacon_rx_timeout = BCN_RX_TIMEOUT_DEF_VALUE;
bb->broadcast_timeout = BROADCAST_RX_TIMEOUT_DEF_VALUE;
bb->rx_broadcast_in_ps = RX_BROADCAST_IN_PS_DEF_VALUE;
bb->ps_poll_threshold = CONSECUTIVE_PS_POLL_FAILURE_DEF;
bb->beacon_rx_timeout = wl->conf.conn.beacon_rx_timeout;
bb->broadcast_timeout = wl->conf.conn.broadcast_timeout;
bb->rx_broadcast_in_ps = wl->conf.conn.rx_broadcast_in_ps;
bb->ps_poll_threshold = wl->conf.conn.ps_poll_threshold;

ret = wl1271_cmd_configure(wl, ACX_BCN_DTIM_OPTIONS, bb, sizeof(*bb));
if (ret < 0) {
Expand Down
24 changes: 1 addition & 23 deletions trunk/drivers/net/wireless/wl12xx/wl1271_acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,6 @@ struct acx_beacon_filter_option {
(BEACON_FILTER_TABLE_MAX_VENDOR_SPECIFIC_IE_NUM * \
BEACON_FILTER_TABLE_EXTRA_VENDOR_SPECIFIC_IE_SIZE))

#define BEACON_RULE_PASS_ON_CHANGE BIT(0)
#define BEACON_RULE_PASS_ON_APPEARANCE BIT(1)

#define BEACON_FILTER_IE_ID_CHANNEL_SWITCH_ANN (37)

struct acx_beacon_filter_ie_table {
struct acx_header header;

Expand All @@ -390,9 +385,6 @@ struct acx_beacon_filter_ie_table {
u8 pad[3];
} __attribute__ ((packed));

#define SYNCH_FAIL_DEFAULT_THRESHOLD 5 /* number of beacons */
#define NO_BEACON_DEFAULT_TIMEOUT (100) /* TU */

struct acx_conn_monit_params {
struct acx_header header;

Expand Down Expand Up @@ -497,11 +489,6 @@ struct acx_energy_detection {
u8 pad;
} __attribute__ ((packed));

#define BCN_RX_TIMEOUT_DEF_VALUE 10000
#define BROADCAST_RX_TIMEOUT_DEF_VALUE 20000
#define RX_BROADCAST_IN_PS_DEF_VALUE 1
#define CONSECUTIVE_PS_POLL_FAILURE_DEF 4

struct acx_beacon_broadcast {
struct acx_header header;

Expand Down Expand Up @@ -575,14 +562,6 @@ struct acx_current_tx_power {
u8 padding[3];
} __attribute__ ((packed));

enum acx_wake_up_event {
WAKE_UP_EVENT_BEACON_BITMAP = 0x01, /* Wake on every Beacon*/
WAKE_UP_EVENT_DTIM_BITMAP = 0x02, /* Wake on every DTIM*/
WAKE_UP_EVENT_N_DTIM_BITMAP = 0x04, /* Wake on every Nth DTIM */
WAKE_UP_EVENT_N_BEACONS_BITMAP = 0x08, /* Wake on every Nth Beacon */
WAKE_UP_EVENT_BITS_MASK = 0x0F
};

struct acx_wake_up_condition {
struct acx_header header;

Expand Down Expand Up @@ -1038,8 +1017,7 @@ enum {
};


int wl1271_acx_wake_up_conditions(struct wl1271 *wl, u8 wake_up_event,
u8 listen_interval);
int wl1271_acx_wake_up_conditions(struct wl1271 *wl);
int wl1271_acx_sleep_auth(struct wl1271 *wl, u8 sleep_auth);
int wl1271_acx_fw_version(struct wl1271 *wl, char *buf, size_t len);
int wl1271_acx_tx_power(struct wl1271 *wl, int power);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/wireless/wl12xx/wl1271_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,7 @@ int wl1271_cmd_ps_mode(struct wl1271 *wl, u8 ps_mode)
int ret = 0;

/* FIXME: this should be in ps.c */
ret = wl1271_acx_wake_up_conditions(wl, WAKE_UP_EVENT_DTIM_BITMAP,
wl->listen_int);
ret = wl1271_acx_wake_up_conditions(wl);
if (ret < 0) {
wl1271_error("couldn't set wake up conditions");
goto out;
Expand Down
Loading

0 comments on commit ba02e68

Please sign in to comment.