aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-02-10 10:49:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-29 15:37:07 -0500
commit3330d7be7008fa8e213648750fc13613eecc54bb (patch)
tree89f8ce89b984819144d6643e7c4a5e7e2d67e7cc /drivers/net/wireless
parentbb1eeff12d4cd6c706ef9fae340a9c93bb41ad05 (diff)
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: Johannes Berg <johannes@sipsolutions.net> Acked-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c2
-rw-r--r--drivers/net/wireless/p54common.c21
3 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4ad26f7613c5..bb3a5f633227 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -7442,7 +7442,7 @@ static int iwl3945_mac_conf_tx(struct ieee80211_hw *hw, int queue,
7442 priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max); 7442 priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max);
7443 priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs; 7443 priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
7444 priv->qos_data.def_qos_parm.ac[q].edca_txop = 7444 priv->qos_data.def_qos_parm.ac[q].edca_txop =
7445 cpu_to_le16((params->burst_time * 100)); 7445 cpu_to_le16((params->txop * 32));
7446 7446
7447 priv->qos_data.def_qos_parm.ac[q].reserved1 = 0; 7447 priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
7448 priv->qos_data.qos_active = 1; 7448 priv->qos_data.qos_active = 1;
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index f8931993ab70..fb4c84e31932 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -7916,7 +7916,7 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, int queue,
7916 priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max); 7916 priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max);
7917 priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs; 7917 priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
7918 priv->qos_data.def_qos_parm.ac[q].edca_txop = 7918 priv->qos_data.def_qos_parm.ac[q].edca_txop =
7919 cpu_to_le16((params->burst_time * 100)); 7919 cpu_to_le16((params->txop * 32));
7920 7920
7921 priv->qos_data.def_qos_parm.ac[q].reserved1 = 0; 7921 priv->qos_data.def_qos_parm.ac[q].reserved1 = 0;
7922 priv->qos_data.qos_active = 1; 7922 priv->qos_data.qos_active = 1;
diff --git a/drivers/net/wireless/p54common.c b/drivers/net/wireless/p54common.c
index 218ff7770ef6..0e9f887178ce 100644
--- a/drivers/net/wireless/p54common.c
+++ b/drivers/net/wireless/p54common.c
@@ -759,13 +759,12 @@ static int p54_set_leds(struct ieee80211_hw *dev, int mode, int link, int act)
759 return 0; 759 return 0;
760} 760}
761 761
762#define P54_SET_QUEUE(queue, ai_fs, cw_min, cw_max, burst) \ 762#define P54_SET_QUEUE(queue, ai_fs, cw_min, cw_max, _txop) \
763do { \ 763do { \
764 queue.aifs = cpu_to_le16(ai_fs); \ 764 queue.aifs = cpu_to_le16(ai_fs); \
765 queue.cwmin = cpu_to_le16(cw_min); \ 765 queue.cwmin = cpu_to_le16(cw_min); \
766 queue.cwmax = cpu_to_le16(cw_max); \ 766 queue.cwmax = cpu_to_le16(cw_max); \
767 queue.txop = (burst == 0) ? \ 767 queue.txop = cpu_to_le16(_txop); \
768 0 : cpu_to_le16((burst * 100) / 32 + 1); \
769} while(0) 768} while(0)
770 769
771static void p54_init_vdcf(struct ieee80211_hw *dev) 770static void p54_init_vdcf(struct ieee80211_hw *dev)
@@ -783,10 +782,16 @@ static void p54_init_vdcf(struct ieee80211_hw *dev)
783 782
784 vdcf = (struct p54_tx_control_vdcf *) hdr->data; 783 vdcf = (struct p54_tx_control_vdcf *) hdr->data;
785 784
786 P54_SET_QUEUE(vdcf->queue[0], 0x0002, 0x0003, 0x0007, 0x000f); 785 /*
787 P54_SET_QUEUE(vdcf->queue[1], 0x0002, 0x0007, 0x000f, 0x001e); 786 * FIXME: The default values in the spec (IEEE 802.11
788 P54_SET_QUEUE(vdcf->queue[2], 0x0002, 0x000f, 0x03ff, 0x0014); 787 * 7.3.2.19 Table 37) are 47, 94, 0, 0, why use
789 P54_SET_QUEUE(vdcf->queue[3], 0x0007, 0x000f, 0x03ff, 0x0000); 788 * 47, 94, 63, 0 here? Also, the default AIFS
789 * values (second parameter) are 2, 2, 3, 7...
790 */
791 P54_SET_QUEUE(vdcf->queue[0], 0x0002, 0x0003, 0x0007, 47);
792 P54_SET_QUEUE(vdcf->queue[1], 0x0002, 0x0007, 0x000f, 94);
793 P54_SET_QUEUE(vdcf->queue[2], 0x0002, 0x000f, 0x03ff, 63);
794 P54_SET_QUEUE(vdcf->queue[3], 0x0007, 0x000f, 0x03ff, 0);
790} 795}
791 796
792static void p54_set_vdcf(struct ieee80211_hw *dev) 797static void p54_set_vdcf(struct ieee80211_hw *dev)
@@ -939,7 +944,7 @@ static int p54_conf_tx(struct ieee80211_hw *dev, int queue,
939 944
940 if ((params) && !((queue < 0) || (queue > 4))) { 945 if ((params) && !((queue < 0) || (queue > 4))) {
941 P54_SET_QUEUE(vdcf->queue[queue], params->aifs, 946 P54_SET_QUEUE(vdcf->queue[queue], params->aifs,
942 params->cw_min, params->cw_max, params->burst_time); 947 params->cw_min, params->cw_max, params->txop);
943 } else 948 } else
944 return -EINVAL; 949 return -EINVAL;
945 950