Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170964
b: refs/heads/master
c: 45b531a
h: refs/heads/master
v: v3
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Oct 27, 2009
1 parent 6e1c9ae commit b791100
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 71 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: 8793f9bb19c00b26532e37f1f516e1d9c7bc0476
refs/heads/master: 45b531a86f93c82d8e390e19a6258111b3627bb0
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/wl12xx/wl1271.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enum {
CFG_RX_CTL_EN | CFG_RX_BCN_EN | \
CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN)

#define WL1271_DEFAULT_BASIC_RATE_SET (ACX_RATE_MASK_ALL)
#define WL1271_DEFAULT_BASIC_RATE_SET (CONF_TX_RATE_MASK_ALL)

#define WL1271_FW_NAME "wl1271-fw.bin"
#define WL1271_NVS_NAME "wl1271-nvs.bin"
Expand Down
54 changes: 25 additions & 29 deletions trunk/drivers/net/wireless/wl12xx/wl1271_acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ int wl1271_acx_cca_threshold(struct wl1271 *wl)
}

detection->rx_cca_threshold = wl->conf.rx.rx_cca_threshold;
detection->tx_energy_detection = 0;
detection->tx_energy_detection = wl->conf.tx.tx_energy_detection;

ret = wl1271_cmd_configure(wl, ACX_CCA_THRESHOLD,
detection, sizeof(*detection));
Expand Down Expand Up @@ -729,6 +729,7 @@ int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats)
int wl1271_acx_rate_policies(struct wl1271 *wl, u32 enabled_rates)
{
struct acx_rate_policy *acx;
struct conf_tx_rate_class *c = &wl->conf.tx.rc_conf;
int ret = 0;

wl1271_debug(DEBUG_ACX, "acx rate policies");
Expand All @@ -743,9 +744,9 @@ int wl1271_acx_rate_policies(struct wl1271 *wl, u32 enabled_rates)
/* configure one default (one-size-fits-all) rate class */
acx->rate_class_cnt = 1;
acx->rate_class[0].enabled_rates = enabled_rates;
acx->rate_class[0].short_retry_limit = ACX_RATE_RETRY_LIMIT;
acx->rate_class[0].long_retry_limit = ACX_RATE_RETRY_LIMIT;
acx->rate_class[0].aflags = 0;
acx->rate_class[0].short_retry_limit = c->short_retry_limit;
acx->rate_class[0].long_retry_limit = c->long_retry_limit;
acx->rate_class[0].aflags = c->aflags;

ret = wl1271_cmd_configure(wl, ACX_RATE_POLICY, acx, sizeof(*acx));
if (ret < 0) {
Expand All @@ -772,22 +773,14 @@ int wl1271_acx_ac_cfg(struct wl1271 *wl)
goto out;
}

/*
* FIXME: Configure each AC with appropriate values (most suitable
* values will probably be different for each AC.
*/
for (i = 0; i < WL1271_ACX_AC_COUNT; i++) {
acx->ac = i;

/*
* FIXME: The following default values originate from
* the TI reference driver. What do they mean?
*/
acx->cw_min = 15;
acx->cw_max = 63;
acx->aifsn = 3;
for (i = 0; i < wl->conf.tx.ac_conf_count; i++) {
struct conf_tx_ac_category *c = &(wl->conf.tx.ac_conf[i]);
acx->ac = c->ac;
acx->cw_min = c->cw_min;
acx->cw_max = c->cw_max;
acx->aifsn = c->aifsn;
acx->reserved = 0;
acx->tx_op_limit = 0;
acx->tx_op_limit = c->tx_op_limit;

ret = wl1271_cmd_configure(wl, ACX_AC_CFG, acx, sizeof(*acx));
if (ret < 0) {
Expand Down Expand Up @@ -816,12 +809,15 @@ int wl1271_acx_tid_cfg(struct wl1271 *wl)
goto out;
}

/* FIXME: configure each TID with a different AC reference */
for (i = 0; i < WL1271_ACX_TID_COUNT; i++) {
acx->queue_id = i;
acx->tsid = WL1271_ACX_AC_BE;
acx->ps_scheme = WL1271_ACX_PS_SCHEME_LEGACY;
acx->ack_policy = WL1271_ACX_ACK_POLICY_LEGACY;
for (i = 0; i < wl->conf.tx.tid_conf_count; i++) {
struct conf_tx_tid *c = &(wl->conf.tx.tid_conf[i]);
acx->queue_id = c->queue_id;
acx->channel_type = c->channel_type;
acx->tsid = c->tsid;
acx->ps_scheme = c->ps_scheme;
acx->ack_policy = c->ack_policy;
acx->apsd_conf[0] = c->apsd_conf[0];
acx->apsd_conf[1] = c->apsd_conf[1];

ret = wl1271_cmd_configure(wl, ACX_TID_CFG, acx, sizeof(*acx));
if (ret < 0) {
Expand Down Expand Up @@ -849,7 +845,7 @@ int wl1271_acx_frag_threshold(struct wl1271 *wl)
goto out;
}

acx->frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
acx->frag_threshold = wl->conf.tx.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 All @@ -875,8 +871,8 @@ int wl1271_acx_tx_config_options(struct wl1271 *wl)
goto out;
}

acx->tx_compl_timeout = WL1271_ACX_TX_COMPL_TIMEOUT;
acx->tx_compl_threshold = WL1271_ACX_TX_COMPL_THRESHOLD;
acx->tx_compl_timeout = wl->conf.tx.tx_compl_timeout;
acx->tx_compl_threshold = wl->conf.tx.tx_compl_threshold;
ret = wl1271_cmd_configure(wl, ACX_TX_CONFIG_OPT, acx, sizeof(*acx));
if (ret < 0) {
wl1271_warning("Setting of tx options failed: %d", ret);
Expand Down Expand Up @@ -929,7 +925,7 @@ int wl1271_acx_init_mem_config(struct wl1271 *wl)
return ret;

wl->target_mem_map = kzalloc(sizeof(struct wl1271_acx_mem_map),
GFP_KERNEL);
GFP_KERNEL);
if (!wl->target_mem_map) {
wl1271_error("couldn't allocate target memory map");
return -ENOMEM;
Expand Down
37 changes: 1 addition & 36 deletions trunk/drivers/net/wireless/wl12xx/wl1271_acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,11 +850,6 @@ struct acx_statistics {
struct acx_rxpipe_statistics rxpipe;
} __attribute__ ((packed));

#define ACX_MAX_RATE_CLASSES 8
#define ACX_RATE_MASK_UNSPECIFIED 0
#define ACX_RATE_MASK_ALL 0x1eff
#define ACX_RATE_RETRY_LIMIT 10

struct acx_rate_class {
u32 enabled_rates;
u8 short_retry_limit;
Expand All @@ -867,11 +862,9 @@ struct acx_rate_policy {
struct acx_header header;

u32 rate_class_cnt;
struct acx_rate_class rate_class[ACX_MAX_RATE_CLASSES];
struct acx_rate_class rate_class[CONF_TX_MAX_RATE_CLASSES];
} __attribute__ ((packed));

#define WL1271_ACX_AC_COUNT 4

struct acx_ac_cfg {
struct acx_header header;
u8 ac;
Expand All @@ -882,31 +875,6 @@ struct acx_ac_cfg {
u16 tx_op_limit;
} __attribute__ ((packed));

enum wl1271_acx_ac {
WL1271_ACX_AC_BE = 0,
WL1271_ACX_AC_BK = 1,
WL1271_ACX_AC_VI = 2,
WL1271_ACX_AC_VO = 3,
WL1271_ACX_AC_CTS2SELF = 4,
WL1271_ACX_AC_ANY_TID = 0x1F,
WL1271_ACX_AC_INVALID = 0xFF,
};

enum wl1271_acx_ps_scheme {
WL1271_ACX_PS_SCHEME_LEGACY = 0,
WL1271_ACX_PS_SCHEME_UPSD_TRIGGER = 1,
WL1271_ACX_PS_SCHEME_LEGACY_PSPOLL = 2,
WL1271_ACX_PS_SCHEME_SAPSD = 3,
};

enum wl1271_acx_ack_policy {
WL1271_ACX_ACK_POLICY_LEGACY = 0,
WL1271_ACX_ACK_POLICY_NO_ACK = 1,
WL1271_ACX_ACK_POLICY_BLOCK = 2,
};

#define WL1271_ACX_TID_COUNT 7

struct acx_tid_config {
struct acx_header header;
u8 queue_id;
Expand All @@ -924,9 +892,6 @@ struct acx_frag_threshold {
u8 padding[2];
} __attribute__ ((packed));

#define WL1271_ACX_TX_COMPL_TIMEOUT 5
#define WL1271_ACX_TX_COMPL_THRESHOLD 5

struct acx_tx_config_options {
struct acx_header header;
u16 tx_compl_timeout; /* msec */
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/wl12xx/wl1271_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,9 @@ int wl1271_cmd_template_set(struct wl1271 *wl, u16 template_id,

cmd->len = cpu_to_le16(buf_len);
cmd->template_type = template_id;
cmd->enabled_rates = ACX_RATE_MASK_UNSPECIFIED;
cmd->short_retry_limit = ACX_RATE_RETRY_LIMIT;
cmd->long_retry_limit = ACX_RATE_RETRY_LIMIT;
cmd->enabled_rates = wl->conf.tx.rc_conf.enabled_rates;
cmd->short_retry_limit = wl->conf.tx.rc_conf.short_retry_limit;
cmd->long_retry_limit = wl->conf.tx.rc_conf.long_retry_limit;

if (buf)
memcpy(cmd->template_data, buf, buf_len);
Expand Down
Loading

0 comments on commit b791100

Please sign in to comment.