Commit 3330d7be authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: give burst time in txop rather than 0.1msec units

This changes mac80211 to pass the burst time to conf_tx in txop
units rather than 0.1msec units. 0.1msec units are only required
by atheros hardware (according to current driver support), all
other drivers do other calculations or require the txop value.
Therefore, it results in fewer calculations and more precision
if we just pass the txop value through to the driver.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Acked-by: default avatarMichael Buesch <mb@bu3sch.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bb1eeff1
...@@ -7442,7 +7442,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, int queue, ...@@ -7442,7 +7442,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, int queue,
priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max); priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max);
priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs; priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
priv->qos_data.def_qos_parm.ac[q].edca_txop = priv->qos_data.def_qos_parm.ac[q].edca_txop =
cpu_to_le16((params->burst_time * 100)); cpu_to_le16((params->txop * 32));
priv->qos_data.def_qos_parm.ac[q].reserved1 = 0; priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
priv->qos_data.qos_active = 1; priv->qos_data.qos_active = 1;
......
...@@ -7916,7 +7916,7 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, int queue, ...@@ -7916,7 +7916,7 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, int queue,
priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max); priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max);
priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs; priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
priv->qos_data.def_qos_parm.ac[q].edca_txop = priv->qos_data.def_qos_parm.ac[q].edca_txop =
cpu_to_le16((params->burst_time * 100)); cpu_to_le16((params->txop * 32));
priv->qos_data.def_qos_parm.ac[q].reserved1 = 0; priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
priv->qos_data.qos_active = 1; priv->qos_data.qos_active = 1;
......
...@@ -759,13 +759,12 @@ static int p54_set_leds(struct ieee80211_hw *dev, int mode, int link, int act) ...@@ -759,13 +759,12 @@ static int p54_set_leds(struct ieee80211_hw *dev, int mode, int link, int act)
return 0; return 0;
} }
#define P54_SET_QUEUE(queue, ai_fs, cw_min, cw_max, burst) \ #define P54_SET_QUEUE(queue, ai_fs, cw_min, cw_max, _txop) \
do { \ do { \
queue.aifs = cpu_to_le16(ai_fs); \ queue.aifs = cpu_to_le16(ai_fs); \
queue.cwmin = cpu_to_le16(cw_min); \ queue.cwmin = cpu_to_le16(cw_min); \
queue.cwmax = cpu_to_le16(cw_max); \ queue.cwmax = cpu_to_le16(cw_max); \
queue.txop = (burst == 0) ? \ queue.txop = cpu_to_le16(_txop); \
0 : cpu_to_le16((burst * 100) / 32 + 1); \
} while(0) } while(0)
static void p54_init_vdcf(struct ieee80211_hw *dev) static void p54_init_vdcf(struct ieee80211_hw *dev)
...@@ -783,10 +782,16 @@ static void p54_init_vdcf(struct ieee80211_hw *dev) ...@@ -783,10 +782,16 @@ static void p54_init_vdcf(struct ieee80211_hw *dev)
vdcf = (struct p54_tx_control_vdcf *) hdr->data; vdcf = (struct p54_tx_control_vdcf *) hdr->data;
P54_SET_QUEUE(vdcf->queue[0], 0x0002, 0x0003, 0x0007, 0x000f); /*
P54_SET_QUEUE(vdcf->queue[1], 0x0002, 0x0007, 0x000f, 0x001e); * FIXME: The default values in the spec (IEEE 802.11
P54_SET_QUEUE(vdcf->queue[2], 0x0002, 0x000f, 0x03ff, 0x0014); * 7.3.2.19 Table 37) are 47, 94, 0, 0, why use
P54_SET_QUEUE(vdcf->queue[3], 0x0007, 0x000f, 0x03ff, 0x0000); * 47, 94, 63, 0 here? Also, the default AIFS
* values (second parameter) are 2, 2, 3, 7...
*/
P54_SET_QUEUE(vdcf->queue[0], 0x0002, 0x0003, 0x0007, 47);
P54_SET_QUEUE(vdcf->queue[1], 0x0002, 0x0007, 0x000f, 94);
P54_SET_QUEUE(vdcf->queue[2], 0x0002, 0x000f, 0x03ff, 63);
P54_SET_QUEUE(vdcf->queue[3], 0x0007, 0x000f, 0x03ff, 0);
} }
static void p54_set_vdcf(struct ieee80211_hw *dev) static void p54_set_vdcf(struct ieee80211_hw *dev)
...@@ -939,7 +944,7 @@ static int p54_conf_tx(struct ieee80211_hw *dev, int queue, ...@@ -939,7 +944,7 @@ static int p54_conf_tx(struct ieee80211_hw *dev, int queue,
if ((params) && !((queue < 0) || (queue > 4))) { if ((params) && !((queue < 0) || (queue > 4))) {
P54_SET_QUEUE(vdcf->queue[queue], params->aifs, P54_SET_QUEUE(vdcf->queue[queue], params->aifs,
params->cw_min, params->cw_max, params->burst_time); params->cw_min, params->cw_max, params->txop);
} else } else
return -EINVAL; return -EINVAL;
......
...@@ -89,19 +89,19 @@ struct ieee80211_ht_bss_info { ...@@ -89,19 +89,19 @@ struct ieee80211_ht_bss_info {
* struct ieee80211_tx_queue_params - transmit queue configuration * struct ieee80211_tx_queue_params - transmit queue configuration
* *
* The information provided in this structure is required for QoS * The information provided in this structure is required for QoS
* transmit queue configuration. * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
* *
* @aifs: arbitration interface space [0..255, -1: use default] * @aifs: arbitration interface space [0..255, -1: use default]
* @cw_min: minimum contention window [will be a value of the form * @cw_min: minimum contention window [will be a value of the form
* 2^n-1 in the range 1..1023; 0: use default] * 2^n-1 in the range 1..1023; 0: use default]
* @cw_max: maximum contention window [like @cw_min] * @cw_max: maximum contention window [like @cw_min]
* @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled
*/ */
struct ieee80211_tx_queue_params { struct ieee80211_tx_queue_params {
int aifs; s16 aifs;
int cw_min; u16 cw_min;
int cw_max; u16 cw_max;
int burst_time; u16 txop;
}; };
/** /**
......
...@@ -297,12 +297,13 @@ static void ieee80211_sta_wmm_params(struct net_device *dev, ...@@ -297,12 +297,13 @@ static void ieee80211_sta_wmm_params(struct net_device *dev,
params.aifs = pos[0] & 0x0f; params.aifs = pos[0] & 0x0f;
params.cw_max = ecw2cw((pos[1] & 0xf0) >> 4); params.cw_max = ecw2cw((pos[1] & 0xf0) >> 4);
params.cw_min = ecw2cw(pos[1] & 0x0f); params.cw_min = ecw2cw(pos[1] & 0x0f);
/* TXOP is in units of 32 usec; burst_time in 0.1 ms */ params.txop = pos[2] | (pos[3] << 8);
params.burst_time = (pos[2] | (pos[3] << 8)) * 32 / 100; #ifdef CONFIG_MAC80211_DEBUG
printk(KERN_DEBUG "%s: WMM queue=%d aci=%d acm=%d aifs=%d " printk(KERN_DEBUG "%s: WMM queue=%d aci=%d acm=%d aifs=%d "
"cWmin=%d cWmax=%d burst=%d\n", "cWmin=%d cWmax=%d txop=%d\n",
dev->name, queue, aci, acm, params.aifs, params.cw_min, dev->name, queue, aci, acm, params.aifs, params.cw_min,
params.cw_max, params.burst_time); params.cw_max, params.txop);
#endif
/* TODO: handle ACM (block TX, fallback to next lowest allowed /* TODO: handle ACM (block TX, fallback to next lowest allowed
* AC for now) */ * AC for now) */
if (local->ops->conf_tx(local_to_hw(local), queue, &params)) { if (local->ops->conf_tx(local_to_hw(local), queue, &params)) {
...@@ -3230,7 +3231,7 @@ int ieee80211_sta_set_ssid(struct net_device *dev, char *ssid, size_t len) ...@@ -3230,7 +3231,7 @@ int ieee80211_sta_set_ssid(struct net_device *dev, char *ssid, size_t len)
qparam.cw_min = 15; qparam.cw_min = 15;
qparam.cw_max = 1023; qparam.cw_max = 1023;
qparam.burst_time = 0; qparam.txop = 0;
for (i = IEEE80211_TX_QUEUE_DATA0; i < NUM_TX_DATA_QUEUES; i++) for (i = IEEE80211_TX_QUEUE_DATA0; i < NUM_TX_DATA_QUEUES; i++)
local->ops->conf_tx(local_to_hw(local), local->ops->conf_tx(local_to_hw(local),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment