Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183263
b: refs/heads/master
c: 86dff7a
h: refs/heads/master
i:
  183261: 7369bce
  183259: 48af4f0
  183255: a2c912e
  183247: 4be5f7a
  183231: b4508de
v: v3
  • Loading branch information
Kalle Valo authored and John W. Linville committed Dec 21, 2009
1 parent 39cd1c6 commit d3a0551
Show file tree
Hide file tree
Showing 7 changed files with 165 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: cdd1e9a91ea55594cbcc9847dbb9392e341cbefd
refs/heads/master: 86dff7a7955f1e14c1f2c142312462fae70ea7e4
33 changes: 33 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,3 +976,36 @@ int wl1251_acx_wr_tbtt_and_dtim(struct wl1251 *wl, u16 tbtt, u8 dtim)
kfree(acx);
return ret;
}

int wl1251_acx_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max,
u8 aifs, u16 txop)
{
struct wl1251_acx_ac_cfg *acx;
int ret = 0;

wl1251_debug(DEBUG_ACX, "acx ac cfg %d cw_ming %d cw_max %d "
"aifs %d txop %d", ac, cw_min, cw_max, aifs, txop);

acx = kzalloc(sizeof(*acx), GFP_KERNEL);

if (!acx) {
ret = -ENOMEM;
goto out;
}

acx->ac = ac;
acx->cw_min = cw_min;
acx->cw_max = cw_max;
acx->aifsn = aifs;
acx->txop_limit = txop;

ret = wl1251_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx));
if (ret < 0) {
wl1251_warning("acx ac cfg failed: %d", ret);
goto out;
}

out:
kfree(acx);
return ret;
}
32 changes: 32 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,36 @@ struct wl1251_acx_wr_tbtt_and_dtim {
u8 padding;
} __attribute__ ((packed));

struct wl1251_acx_ac_cfg {
struct acx_header header;

/*
* Access Category - The TX queue's access category
* (refer to AccessCategory_enum)
*/
u8 ac;

/*
* The contention window minimum size (in slots) for
* the access class.
*/
u8 cw_min;

/*
* The contention window maximum size (in slots) for
* the access class.
*/
u16 cw_max;

/* The AIF value (in slots) for the access class. */
u8 aifsn;

u8 reserved;

/* The TX Op Limit (in microseconds) for the access class. */
u16 txop_limit;
} __attribute__ ((packed));

/*************************************************************************
Host Interrupt Register (WiLink -> Host)
Expand Down Expand Up @@ -1322,5 +1352,7 @@ 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_ac_cfg(struct wl1251 *wl, u8 ac, u8 cw_min, u16 cw_max,
u8 aifs, u16 txop);

#endif /* __WL1251_ACX_H__ */
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@ static int wl1251_hw_init_tx_queue_config(struct wl1251 *wl)
goto out;
}

wl1251_acx_ac_cfg(wl, AC_BE, CWMIN_BE, CWMAX_BE, AIFS_DIFS, TXOP_BE);
wl1251_acx_ac_cfg(wl, AC_BK, CWMIN_BK, CWMAX_BK, AIFS_DIFS, TXOP_BK);
wl1251_acx_ac_cfg(wl, AC_VI, CWMIN_VI, CWMAX_VI, AIFS_DIFS, TXOP_VI);
wl1251_acx_ac_cfg(wl, AC_VO, CWMIN_VO, CWMAX_VO, AIFS_DIFS, TXOP_VO);

out:
kfree(config);
return ret;
Expand Down
47 changes: 47 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,53 @@

#include "wl1251.h"

enum {
/* best effort/legacy */
AC_BE = 0,

/* background */
AC_BK = 1,

/* video */
AC_VI = 2,

/* voice */
AC_VO = 3,

/* broadcast dummy access category */
AC_BCAST = 4,

NUM_ACCESS_CATEGORIES = 4
};

/* following are defult values for the IE fields*/
#define CWMIN_BK 15
#define CWMIN_BE 15
#define CWMIN_VI 7
#define CWMIN_VO 3
#define CWMAX_BK 1023
#define CWMAX_BE 63
#define CWMAX_VI 15
#define CWMAX_VO 7

/* slot number setting to start transmission at PIFS interval */
#define AIFS_PIFS 1

/*
* slot number setting to start transmission at DIFS interval - normal DCF
* access
*/
#define AIFS_DIFS 2

#define AIFSN_BK 7
#define AIFSN_BE 3
#define AIFSN_VI AIFS_PIFS
#define AIFSN_VO AIFS_PIFS
#define TXOP_BK 0
#define TXOP_BE 0
#define TXOP_VI 3008
#define TXOP_VO 1504

int wl1251_hw_init_hwenc_config(struct wl1251 *wl);
int wl1251_hw_init_templates_config(struct wl1251 *wl);
int wl1251_hw_init_rx_config(struct wl1251 *wl, u32 config, u32 filter);
Expand Down
27 changes: 27 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,32 @@ static struct ieee80211_channel wl1251_channels[] = {
{ .hw_value = 13, .center_freq = 2472},
};

static int wl1251_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
struct wl1251 *wl = hw->priv;
int ret;

mutex_lock(&wl->mutex);

wl1251_debug(DEBUG_MAC80211, "mac80211 conf tx %d", queue);

ret = wl1251_ps_elp_wakeup(wl);
if (ret < 0)
goto out;

ret = wl1251_acx_ac_cfg(wl, wl1251_tx_get_queue(queue),
params->cw_min, params->cw_max,
params->aifs, params->txop);

wl1251_ps_elp_sleep(wl);

out:
mutex_unlock(&wl->mutex);

return ret;
}

/* can't be const, mac80211 writes to this */
static struct ieee80211_supported_band wl1251_band_2ghz = {
.channels = wl1251_channels,
Expand All @@ -1305,6 +1331,7 @@ static const struct ieee80211_ops wl1251_ops = {
.hw_scan = wl1251_op_hw_scan,
.bss_info_changed = wl1251_op_bss_info_changed,
.set_rts_threshold = wl1251_op_set_rts_threshold,
.conf_tx = wl1251_op_conf_tx,
};

static int wl1251_register_hw(struct wl1251 *wl)
Expand Down
20 changes: 20 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define __WL1251_TX_H__

#include <linux/bitops.h>
#include "wl1251_acx.h"

/*
*
Expand Down Expand Up @@ -209,6 +210,25 @@ struct tx_result {
u8 done_2;
} __attribute__ ((packed));

static inline int wl1251_tx_get_queue(int queue)
{
/* FIXME: use best effort until WMM is enabled */
return QOS_AC_BE;

switch (queue) {
case 0:
return QOS_AC_VO;
case 1:
return QOS_AC_VI;
case 2:
return QOS_AC_BE;
case 3:
return QOS_AC_BK;
default:
return QOS_AC_BE;
}
}

void wl1251_tx_work(struct work_struct *work);
void wl1251_tx_complete(struct wl1251 *wl);
void wl1251_tx_flush(struct wl1251 *wl);
Expand Down

0 comments on commit d3a0551

Please sign in to comment.