Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278640
b: refs/heads/master
c: d2d66c5
h: refs/heads/master
v: v3
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Oct 7, 2011
1 parent 39692b4 commit 0152a20
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 53 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: 30d0c8fd5b87d1c5486705d6420545a21533e115
refs/heads/master: d2d66c56cf6c8727662aa321991f791604c22094
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/wl12xx/acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,11 @@ int wl1271_acx_sta_rate_policies(struct wl1271 *wl, struct wl12xx_vif *wlvif)
}

wl1271_debug(DEBUG_ACX, "basic_rate: 0x%x, full_rate: 0x%x",
wl->basic_rate, wlvif->rate_set);
wlvif->basic_rate, wlvif->rate_set);

/* configure one basic rate class */
acx->rate_policy_idx = cpu_to_le32(ACX_TX_BASIC_RATE);
acx->rate_policy.enabled_rates = cpu_to_le32(wl->basic_rate);
acx->rate_policy.enabled_rates = cpu_to_le32(wlvif->basic_rate);
acx->rate_policy.short_retry_limit = c->short_retry_limit;
acx->rate_policy.long_retry_limit = c->long_retry_limit;
acx->rate_policy.aflags = c->aflags;
Expand Down Expand Up @@ -1567,7 +1567,7 @@ int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl)
return ret;
}

int wl1271_acx_config_ps(struct wl1271 *wl)
int wl12xx_acx_config_ps(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{
struct wl1271_acx_config_ps *config_ps;
int ret;
Expand All @@ -1582,7 +1582,7 @@ int wl1271_acx_config_ps(struct wl1271 *wl)

config_ps->exit_retries = wl->conf.conn.psm_exit_retries;
config_ps->enter_retries = wl->conf.conn.psm_entry_retries;
config_ps->null_data_rate = cpu_to_le32(wl->basic_rate);
config_ps->null_data_rate = cpu_to_le32(wlvif->basic_rate);

ret = wl1271_cmd_configure(wl, ACX_CONFIG_PS, config_ps,
sizeof(*config_ps));
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/wl12xx/acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index,
int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime);
int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, bool enable);
int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl);
int wl1271_acx_config_ps(struct wl1271 *wl);
int wl12xx_acx_config_ps(struct wl1271 *wl, struct wl12xx_vif *wlvif);
int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, u8 *addr);
int wl1271_acx_fm_coex(struct wl1271 *wl);
int wl12xx_acx_set_rate_mgmt_params(struct wl1271 *wl);
Expand Down
23 changes: 14 additions & 9 deletions trunk/drivers/net/wireless/wl12xx/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
return ret;
}

int wl1271_cmd_build_null_data(struct wl1271 *wl)
int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{
struct sk_buff *skb = NULL;
int size;
Expand All @@ -1043,15 +1043,16 @@ int wl1271_cmd_build_null_data(struct wl1271 *wl)
size = sizeof(struct wl12xx_null_data_template);
ptr = NULL;
} else {
skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
skb = ieee80211_nullfunc_get(wl->hw,
wl12xx_wlvif_to_vif(wlvif));
if (!skb)
goto out;
size = skb->len;
ptr = skb->data;
}

ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, ptr, size, 0,
wl->basic_rate);
wlvif->basic_rate);

out:
dev_kfree_skb(skb);
Expand All @@ -1062,19 +1063,21 @@ int wl1271_cmd_build_null_data(struct wl1271 *wl)

}

int wl1271_cmd_build_klv_null_data(struct wl1271 *wl)
int wl12xx_cmd_build_klv_null_data(struct wl1271 *wl,
struct wl12xx_vif *wlvif)
{
struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
struct sk_buff *skb = NULL;
int ret = -ENOMEM;

skb = ieee80211_nullfunc_get(wl->hw, wl->vif);
skb = ieee80211_nullfunc_get(wl->hw, vif);
if (!skb)
goto out;

ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV,
skb->data, skb->len,
CMD_TEMPL_KLV_IDX_NULL_DATA,
wl->basic_rate);
wlvif->basic_rate);

out:
dev_kfree_skb(skb);
Expand Down Expand Up @@ -1161,7 +1164,8 @@ struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
return skb;
}

int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr)
int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif,
__be32 ip_addr)
{
int ret;
struct wl12xx_arp_rsp_template tmpl;
Expand Down Expand Up @@ -1197,13 +1201,14 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr)

ret = wl1271_cmd_template_set(wl, CMD_TEMPL_ARP_RSP,
&tmpl, sizeof(tmpl), 0,
wl->basic_rate);
wlvif->basic_rate);

return ret;
}

int wl1271_build_qos_null_data(struct wl1271 *wl, struct ieee80211_vif *vif)
{
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
struct ieee80211_qos_hdr template;

memset(&template, 0, sizeof(template));
Expand All @@ -1221,7 +1226,7 @@ int wl1271_build_qos_null_data(struct wl1271 *wl, struct ieee80211_vif *vif)

return wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, &template,
sizeof(template), 0,
wl->basic_rate);
wlvif->basic_rate);
}

int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid)
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/net/wireless/wl12xx/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,19 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
size_t len);
int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,
void *buf, size_t buf_len, int index, u32 rates);
int wl1271_cmd_build_null_data(struct wl1271 *wl);
int wl12xx_cmd_build_null_data(struct wl1271 *wl, struct wl12xx_vif *wlvif);
int wl1271_cmd_build_ps_poll(struct wl1271 *wl, struct wl12xx_vif *wlvif,
u16 aid);
int wl1271_cmd_build_probe_req(struct wl1271 *wl,
const u8 *ssid, size_t ssid_len,
const u8 *ie, size_t ie_len, u8 band);
struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
struct sk_buff *skb);
int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr);
int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, struct wl12xx_vif *wlvif,
__be32 ip_addr);
int wl1271_build_qos_null_data(struct wl1271 *wl, struct ieee80211_vif *vif);
int wl1271_cmd_build_klv_null_data(struct wl1271 *wl);
int wl12xx_cmd_build_klv_null_data(struct wl1271 *wl,
struct wl12xx_vif *wlvif);
int wl12xx_cmd_set_default_wep_key(struct wl1271 *wl, u8 id, u8 hlid);
int wl1271_cmd_set_sta_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
u8 key_size, const u8 *key, const u8 *addr,
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/wl12xx/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
DRIVER_STATE_PRINT_INT(state);
DRIVER_STATE_PRINT_INT(bss_type);
DRIVER_STATE_PRINT_INT(channel);
DRIVER_STATE_PRINT_HEX(basic_rate);
DRIVER_STATE_PRINT_INT(band);
DRIVER_STATE_PRINT_INT(beacon_int);
DRIVER_STATE_PRINT_INT(psm_entry_retry);
Expand Down
21 changes: 15 additions & 6 deletions trunk/drivers/net/wireless/wl12xx/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@

void wl1271_pspoll_work(struct work_struct *work)
{
struct ieee80211_vif *vif;
struct wl12xx_vif *wlvif;
struct delayed_work *dwork;
struct wl1271 *wl;
int ret;

dwork = container_of(work, struct delayed_work, work);
wl = container_of(dwork, struct wl1271, pspoll_work);
vif = wl->vif; /* TODO: move work into vif struct */
wlvif = wl12xx_vif_to_data(vif);

wl1271_debug(DEBUG_EVENT, "pspoll work");

Expand All @@ -60,14 +64,16 @@ void wl1271_pspoll_work(struct work_struct *work)
if (ret < 0)
goto out;

wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, wl->basic_rate, true);
wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE, wlvif->basic_rate,
true);

wl1271_ps_elp_sleep(wl);
out:
mutex_unlock(&wl->mutex);
};

static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl)
static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl,
struct wl12xx_vif *wlvif)
{
int delay = wl->conf.conn.ps_poll_recovery_period;
int ret;
Expand All @@ -80,7 +86,7 @@ static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl)
/* force active mode receive data from the AP */
if (test_bit(WL1271_FLAG_PSM, &wl->flags)) {
ret = wl1271_ps_set_mode(wl, STATION_ACTIVE_MODE,
wl->basic_rate, true);
wlvif->basic_rate, true);
if (ret < 0)
return;
set_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags);
Expand All @@ -97,6 +103,7 @@ static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl)
}

static int wl1271_event_ps_report(struct wl1271 *wl,
struct wl12xx_vif *wlvif,
struct event_mailbox *mbox,
bool *beacon_loss)
{
Expand All @@ -118,7 +125,7 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
if (wl->psm_entry_retry < total_retries) {
wl->psm_entry_retry++;
ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
wl->basic_rate, true);
wlvif->basic_rate, true);
} else {
wl1271_info("No ack to nullfunc from AP.");
wl->psm_entry_retry = 0;
Expand Down Expand Up @@ -217,6 +224,8 @@ static void wl1271_event_mbox_dump(struct event_mailbox *mbox)

static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
{
struct ieee80211_vif *vif = wl->vif; /* TODO: get as param */
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
int ret;
u32 vector;
bool beacon_loss = false;
Expand Down Expand Up @@ -276,13 +285,13 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)

if ((vector & PS_REPORT_EVENT_ID) && !is_ap) {
wl1271_debug(DEBUG_EVENT, "PS_REPORT_EVENT");
ret = wl1271_event_ps_report(wl, mbox, &beacon_loss);
ret = wl1271_event_ps_report(wl, wlvif, mbox, &beacon_loss);
if (ret < 0)
return ret;
}

if ((vector & PSPOLL_DELIVERY_FAILURE_EVENT_ID) && !is_ap)
wl1271_event_pspoll_delivery_fail(wl);
wl1271_event_pspoll_delivery_fail(wl, wlvif);

if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) {
wl1271_debug(DEBUG_EVENT, "RSSI_SNR_TRIGGER_0_EVENT");
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/wl12xx/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static int wl1271_sta_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
}

/* PS config */
ret = wl1271_acx_config_ps(wl);
ret = wl12xx_acx_config_ps(wl, wlvif);
if (ret < 0)
return ret;

Expand Down
Loading

0 comments on commit 0152a20

Please sign in to comment.