Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224628
b: refs/heads/master
c: 68d069c
h: refs/heads/master
v: v3
  • Loading branch information
Arik Nemtsov authored and Luciano Coelho committed Nov 22, 2010
1 parent 571ef00 commit a9157ba
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 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: fa97f46b30357a50f3ee193e6f82864f95bc55ec
refs/heads/master: 68d069c45f73e8aeda0249891daec1f7e2f0e067
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/wl12xx/acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
return ret;
}

int wl1271_acx_frag_threshold(struct wl1271 *wl)
int wl1271_acx_frag_threshold(struct wl1271 *wl, u16 frag_threshold)
{
struct acx_frag_threshold *acx;
int ret = 0;
Expand All @@ -876,7 +876,7 @@ int wl1271_acx_frag_threshold(struct wl1271 *wl)
goto out;
}

acx->frag_threshold = cpu_to_le16(wl->conf.tx.frag_threshold);
acx->frag_threshold = cpu_to_le16(frag_threshold);
ret = wl1271_cmd_configure(wl, ACX_FRAG_CFG, acx, sizeof(*acx));
if (ret < 0) {
wl1271_warning("Setting of frag threshold failed: %d", ret);
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 @@ -1161,7 +1161,7 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
int wl1271_acx_tid_cfg(struct wl1271 *wl, u8 queue_id, u8 channel_type,
u8 tsid, u8 ps_scheme, u8 ack_policy,
u32 apsd_conf0, u32 apsd_conf1);
int wl1271_acx_frag_threshold(struct wl1271 *wl);
int wl1271_acx_frag_threshold(struct wl1271 *wl, u16 frag_threshold);
int wl1271_acx_tx_config_options(struct wl1271 *wl);
int wl1271_acx_mem_cfg(struct wl1271 *wl);
int wl1271_acx_init_mem_config(struct wl1271 *wl);
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 @@ -290,7 +290,7 @@ int wl1271_hw_init(struct wl1271 *wl)
goto out_free_memmap;

/* Default fragmentation threshold */
ret = wl1271_acx_frag_threshold(wl);
ret = wl1271_acx_frag_threshold(wl, wl->conf.tx.frag_threshold);
if (ret < 0)
goto out_free_memmap;

Expand Down
31 changes: 30 additions & 1 deletion trunk/drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ static int wl1271_plt_init(struct wl1271 *wl)
goto out_free_memmap;

/* Default fragmentation threshold */
ret = wl1271_acx_frag_threshold(wl);
ret = wl1271_acx_frag_threshold(wl, wl->conf.tx.frag_threshold);
if (ret < 0)
goto out_free_memmap;

Expand Down Expand Up @@ -1745,6 +1745,34 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
return ret;
}

static int wl1271_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value)
{
struct wl1271 *wl = hw->priv;
int ret = 0;

mutex_lock(&wl->mutex);

if (unlikely(wl->state == WL1271_STATE_OFF)) {
ret = -EAGAIN;
goto out;
}

ret = wl1271_ps_elp_wakeup(wl, false);
if (ret < 0)
goto out;

ret = wl1271_acx_frag_threshold(wl, (u16)value);
if (ret < 0)
wl1271_warning("wl1271_op_set_frag_threshold failed: %d", ret);

wl1271_ps_elp_sleep(wl);

out:
mutex_unlock(&wl->mutex);

return ret;
}

static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
{
struct wl1271 *wl = hw->priv;
Expand Down Expand Up @@ -2421,6 +2449,7 @@ static const struct ieee80211_ops wl1271_ops = {
.set_key = wl1271_op_set_key,
.hw_scan = wl1271_op_hw_scan,
.bss_info_changed = wl1271_op_bss_info_changed,
.set_frag_threshold = wl1271_op_set_frag_threshold,
.set_rts_threshold = wl1271_op_set_rts_threshold,
.conf_tx = wl1271_op_conf_tx,
.get_tsf = wl1271_op_get_tsf,
Expand Down

0 comments on commit a9157ba

Please sign in to comment.