aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-23 04:46:38 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-08-27 12:13:00 -0400
commit8dfdb9d5757424f7018a643258065c4fc8e6a439 (patch)
treeba1c13360667aa6a813cdbc643d633dc96d7fc93 /drivers/net
parent8f2d3d2ae17855e396483724f152f223e6f01bfe (diff)
iwlwifi: move QoS into context
Since mac80211 doesn't currently enable/disable QoS per interface, we can't yet do it properly, but we can already prepare for it and move the QoS data and command ID into the context struct. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c43
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c1
5 files changed, 46 insertions, 28 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index d3714f076a0c..007dede73698 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -4203,6 +4203,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
4203 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON; 4203 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
4204 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING; 4204 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
4205 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; 4205 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
4206 priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM;
4206 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1); 4207 BUILD_BUG_ON(NUM_IWL_RXON_CTX != 1);
4207 4208
4208 SET_IEEE80211_DEV(hw, &pdev->dev); 4209 SET_IEEE80211_DEV(hw, &pdev->dev);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index a145d17cd943..d5499db34eb2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -191,27 +191,27 @@ EXPORT_SYMBOL(iwl_alloc_all);
191/* 191/*
192 * QoS support 192 * QoS support
193*/ 193*/
194static void iwl_update_qos(struct iwl_priv *priv) 194static void iwl_update_qos(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
195{ 195{
196 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 196 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
197 return; 197 return;
198 198
199 priv->qos_data.def_qos_parm.qos_flags = 0; 199 ctx->qos_data.def_qos_parm.qos_flags = 0;
200 200
201 if (priv->qos_data.qos_active) 201 if (ctx->qos_data.qos_active)
202 priv->qos_data.def_qos_parm.qos_flags |= 202 ctx->qos_data.def_qos_parm.qos_flags |=
203 QOS_PARAM_FLG_UPDATE_EDCA_MSK; 203 QOS_PARAM_FLG_UPDATE_EDCA_MSK;
204 204
205 if (priv->current_ht_config.is_ht) 205 if (priv->current_ht_config.is_ht)
206 priv->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK; 206 ctx->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK;
207 207
208 IWL_DEBUG_QOS(priv, "send QoS cmd with Qos active=%d FLAGS=0x%X\n", 208 IWL_DEBUG_QOS(priv, "send QoS cmd with Qos active=%d FLAGS=0x%X\n",
209 priv->qos_data.qos_active, 209 ctx->qos_data.qos_active,
210 priv->qos_data.def_qos_parm.qos_flags); 210 ctx->qos_data.def_qos_parm.qos_flags);
211 211
212 iwl_send_cmd_pdu_async(priv, REPLY_QOS_PARAM, 212 iwl_send_cmd_pdu_async(priv, ctx->qos_cmd,
213 sizeof(struct iwl_qosparam_cmd), 213 sizeof(struct iwl_qosparam_cmd),
214 &priv->qos_data.def_qos_parm, NULL); 214 &ctx->qos_data.def_qos_parm, NULL);
215} 215}
216 216
217#define MAX_BIT_RATE_40_MHZ 150 /* Mbps */ 217#define MAX_BIT_RATE_40_MHZ 150 /* Mbps */
@@ -1584,6 +1584,7 @@ int iwl_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
1584 const struct ieee80211_tx_queue_params *params) 1584 const struct ieee80211_tx_queue_params *params)
1585{ 1585{
1586 struct iwl_priv *priv = hw->priv; 1586 struct iwl_priv *priv = hw->priv;
1587 struct iwl_rxon_context *ctx;
1587 unsigned long flags; 1588 unsigned long flags;
1588 int q; 1589 int q;
1589 1590
@@ -1603,13 +1604,21 @@ int iwl_mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
1603 1604
1604 spin_lock_irqsave(&priv->lock, flags); 1605 spin_lock_irqsave(&priv->lock, flags);
1605 1606
1606 priv->qos_data.def_qos_parm.ac[q].cw_min = cpu_to_le16(params->cw_min); 1607 /*
1607 priv->qos_data.def_qos_parm.ac[q].cw_max = cpu_to_le16(params->cw_max); 1608 * MULTI-FIXME
1608 priv->qos_data.def_qos_parm.ac[q].aifsn = params->aifs; 1609 * This may need to be done per interface in nl80211/cfg80211/mac80211.
1609 priv->qos_data.def_qos_parm.ac[q].edca_txop = 1610 */
1610 cpu_to_le16((params->txop * 32)); 1611 for_each_context(priv, ctx) {
1612 ctx->qos_data.def_qos_parm.ac[q].cw_min =
1613 cpu_to_le16(params->cw_min);
1614 ctx->qos_data.def_qos_parm.ac[q].cw_max =
1615 cpu_to_le16(params->cw_max);
1616 ctx->qos_data.def_qos_parm.ac[q].aifsn = params->aifs;
1617 ctx->qos_data.def_qos_parm.ac[q].edca_txop =
1618 cpu_to_le16((params->txop * 32));
1611 1619
1612 priv->qos_data.def_qos_parm.ac[q].reserved1 = 0; 1620 ctx->qos_data.def_qos_parm.ac[q].reserved1 = 0;
1621 }
1613 1622
1614 spin_unlock_irqrestore(&priv->lock, flags); 1623 spin_unlock_irqrestore(&priv->lock, flags);
1615 1624
@@ -1751,8 +1760,8 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
1751 unsigned long flags; 1760 unsigned long flags;
1752 1761
1753 spin_lock_irqsave(&priv->lock, flags); 1762 spin_lock_irqsave(&priv->lock, flags);
1754 priv->qos_data.qos_active = bss_conf->qos; 1763 ctx->qos_data.qos_active = bss_conf->qos;
1755 iwl_update_qos(priv); 1764 iwl_update_qos(priv, ctx);
1756 spin_unlock_irqrestore(&priv->lock, flags); 1765 spin_unlock_irqrestore(&priv->lock, flags);
1757 } 1766 }
1758 1767
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index d36418c3a6b5..0ee8f516c4ab 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -643,19 +643,25 @@ static ssize_t iwl_dbgfs_qos_read(struct file *file, char __user *user_buf,
643 size_t count, loff_t *ppos) 643 size_t count, loff_t *ppos)
644{ 644{
645 struct iwl_priv *priv = file->private_data; 645 struct iwl_priv *priv = file->private_data;
646 struct iwl_rxon_context *ctx;
646 int pos = 0, i; 647 int pos = 0, i;
647 char buf[256]; 648 char buf[256 * NUM_IWL_RXON_CTX];
648 const size_t bufsz = sizeof(buf); 649 const size_t bufsz = sizeof(buf);
649 650
650 for (i = 0; i < AC_NUM; i++) { 651 for_each_context(priv, ctx) {
651 pos += scnprintf(buf + pos, bufsz - pos, 652 pos += scnprintf(buf + pos, bufsz - pos, "context %d:\n",
652 "\tcw_min\tcw_max\taifsn\ttxop\n"); 653 ctx->ctxid);
653 pos += scnprintf(buf + pos, bufsz - pos, 654 for (i = 0; i < AC_NUM; i++) {
655 pos += scnprintf(buf + pos, bufsz - pos,
656 "\tcw_min\tcw_max\taifsn\ttxop\n");
657 pos += scnprintf(buf + pos, bufsz - pos,
654 "AC[%d]\t%u\t%u\t%u\t%u\n", i, 658 "AC[%d]\t%u\t%u\t%u\t%u\n", i,
655 priv->qos_data.def_qos_parm.ac[i].cw_min, 659 ctx->qos_data.def_qos_parm.ac[i].cw_min,
656 priv->qos_data.def_qos_parm.ac[i].cw_max, 660 ctx->qos_data.def_qos_parm.ac[i].cw_max,
657 priv->qos_data.def_qos_parm.ac[i].aifsn, 661 ctx->qos_data.def_qos_parm.ac[i].aifsn,
658 priv->qos_data.def_qos_parm.ac[i].edca_txop); 662 ctx->qos_data.def_qos_parm.ac[i].edca_txop);
663 }
664 pos += scnprintf(buf + pos, bufsz - pos, "\n");
659 } 665 }
660 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 666 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
661} 667}
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 6a7e9ff4a88c..01a654e6db26 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1125,9 +1125,12 @@ struct iwl_rxon_context {
1125 1125
1126 struct iwl_rxon_time_cmd timing; 1126 struct iwl_rxon_time_cmd timing;
1127 1127
1128 struct iwl_qos_info qos_data;
1129
1128 u8 bcast_sta_id; 1130 u8 bcast_sta_id;
1129 1131
1130 u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd; 1132 u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
1133 u8 qos_cmd;
1131}; 1134};
1132 1135
1133struct iwl_priv { 1136struct iwl_priv {
@@ -1418,8 +1421,6 @@ struct iwl_priv {
1418 1421
1419 u32 inta_mask; 1422 u32 inta_mask;
1420 1423
1421 struct iwl_qos_info qos_data;
1422
1423 struct workqueue_struct *workqueue; 1424 struct workqueue_struct *workqueue;
1424 1425
1425 struct work_struct restart; 1426 struct work_struct restart;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4321d970d58d..09bca17255b4 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4016,6 +4016,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
4016 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON; 4016 priv->contexts[IWL_RXON_CTX_BSS].rxon_cmd = REPLY_RXON;
4017 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING; 4017 priv->contexts[IWL_RXON_CTX_BSS].rxon_timing_cmd = REPLY_RXON_TIMING;
4018 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC; 4018 priv->contexts[IWL_RXON_CTX_BSS].rxon_assoc_cmd = REPLY_RXON_ASSOC;
4019 priv->contexts[IWL_RXON_CTX_BSS].qos_cmd = REPLY_QOS_PARAM;
4019 4020
4020 /* 4021 /*
4021 * Disabling hardware scan means that mac80211 will perform scans 4022 * Disabling hardware scan means that mac80211 will perform scans