* [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP
@ 2011-02-17 22:45 Thomas Pedersen
2011-02-17 22:45 ` [PATCH V2 2/3] mwl8k: Tell mac80211 we have rate adaptation in FW Thomas Pedersen
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thomas Pedersen @ 2011-02-17 22:45 UTC (permalink / raw)
To: linux-wireless; +Cc: buytenh
From: Nishant Sarmukadam <nishants@marvell.com>
When configuring rx antennas using CMD_RF_ANTENNA, the argument input is
the number of antennas to be enabled. For AP, we support 3 rx antennas
and hence set the field to 3. For tx antennas, value is a bitmap, so 0x7
enables all three.
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
drivers/net/wireless/mwl8k.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index af4f2c6..f79da1b 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -3945,9 +3945,13 @@ static int mwl8k_config(struct ieee80211_hw *hw, u32 changed)
if (rc)
goto out;
- rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_RX, 0x7);
- if (!rc)
- rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_TX, 0x7);
+ rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_RX, 0x3);
+ if (rc)
+ wiphy_warn(hw->wiphy, "failed to set # of RX antennas");
+ rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_TX, 0x7);
+ if (rc)
+ wiphy_warn(hw->wiphy, "failed to set # of TX antennas");
+
} else {
rc = mwl8k_cmd_rf_tx_power(hw, conf->power_level);
if (rc)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH V2 2/3] mwl8k: Tell mac80211 we have rate adaptation in FW
2011-02-17 22:45 [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP Thomas Pedersen
@ 2011-02-17 22:45 ` Thomas Pedersen
2011-02-17 22:45 ` [PATCH V2 3/3] mwl8k: Invert tx queues for set_hw_spec and set_edca_params Thomas Pedersen
2011-02-22 19:49 ` [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP John W. Linville
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Pedersen @ 2011-02-17 22:45 UTC (permalink / raw)
To: linux-wireless; +Cc: buytenh
From: Nishant Sarmukadam <nishants@marvell.com>
All mwl8k parts perform rate control in firmware. Make this known to
mac80211 so that it does not launch minstrel. Also, because actual tx
rate information is not available from the firmware, invalidate the
rate status before returning the skb to mac80211.
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
drivers/net/wireless/mwl8k.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index f79da1b..44355f7 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1535,6 +1535,13 @@ mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
info = IEEE80211_SKB_CB(skb);
ieee80211_tx_info_clear_status(info);
+
+ /* Rate control is happening in the firmware.
+ * Ensure no tx rate is being reported.
+ */
+ info->status.rates[0].idx = -1;
+ info->status.rates[0].count = 1;
+
if (MWL8K_TXD_SUCCESS(status))
info->flags |= IEEE80211_TX_STAT_ACK;
@@ -4764,7 +4771,7 @@ static int mwl8k_firmware_load_success(struct mwl8k_priv *priv)
hw->queues = MWL8K_TX_QUEUES;
/* Set rssi values to dBm */
- hw->flags |= IEEE80211_HW_SIGNAL_DBM;
+ hw->flags |= IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_HAS_RATE_CONTROL;
hw->vif_data_size = sizeof(struct mwl8k_vif);
hw->sta_data_size = sizeof(struct mwl8k_sta);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH V2 3/3] mwl8k: Invert tx queues for set_hw_spec and set_edca_params
2011-02-17 22:45 [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP Thomas Pedersen
2011-02-17 22:45 ` [PATCH V2 2/3] mwl8k: Tell mac80211 we have rate adaptation in FW Thomas Pedersen
@ 2011-02-17 22:45 ` Thomas Pedersen
2011-02-22 19:49 ` [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP John W. Linville
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Pedersen @ 2011-02-17 22:45 UTC (permalink / raw)
To: linux-wireless; +Cc: buytenh
From: Nishant Sarmukadam <nishants@marvell.com>
mac80211 and mwl8k FW tx queue priorities map inversely to each other.
Fix this.
Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Tested-by: Pradeep Nemavat <pnemavat@marvell.com>
---
drivers/net/wireless/mwl8k.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 44355f7..03f2584 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2128,8 +2128,18 @@ static int mwl8k_cmd_set_hw_spec(struct ieee80211_hw *hw)
cmd->ps_cookie = cpu_to_le32(priv->cookie_dma);
cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rxd_dma);
cmd->num_tx_queues = cpu_to_le32(MWL8K_TX_QUEUES);
- for (i = 0; i < MWL8K_TX_QUEUES; i++)
- cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].txd_dma);
+
+ /*
+ * Mac80211 stack has Q0 as highest priority and Q3 as lowest in
+ * that order. Firmware has Q3 as highest priority and Q0 as lowest
+ * in that order. Map Q3 of mac80211 to Q0 of firmware so that the
+ * priority is interpreted the right way in firmware.
+ */
+ for (i = 0; i < MWL8K_TX_QUEUES; i++) {
+ int j = MWL8K_TX_QUEUES - 1 - i;
+ cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[j].txd_dma);
+ }
+
cmd->flags = cpu_to_le32(MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT |
MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP |
MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON);
@@ -4331,12 +4341,14 @@ static int mwl8k_conf_tx(struct ieee80211_hw *hw, u16 queue,
if (!priv->wmm_enabled)
rc = mwl8k_cmd_set_wmm_mode(hw, 1);
- if (!rc)
- rc = mwl8k_cmd_set_edca_params(hw, queue,
+ if (!rc) {
+ int q = MWL8K_TX_QUEUES - 1 - queue;
+ rc = mwl8k_cmd_set_edca_params(hw, q,
params->cw_min,
params->cw_max,
params->aifs,
params->txop);
+ }
mwl8k_fw_unlock(hw);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP
2011-02-17 22:45 [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP Thomas Pedersen
2011-02-17 22:45 ` [PATCH V2 2/3] mwl8k: Tell mac80211 we have rate adaptation in FW Thomas Pedersen
2011-02-17 22:45 ` [PATCH V2 3/3] mwl8k: Invert tx queues for set_hw_spec and set_edca_params Thomas Pedersen
@ 2011-02-22 19:49 ` John W. Linville
2 siblings, 0 replies; 4+ messages in thread
From: John W. Linville @ 2011-02-22 19:49 UTC (permalink / raw)
To: Thomas Pedersen; +Cc: linux-wireless, buytenh
On Thu, Feb 17, 2011 at 02:45:16PM -0800, Thomas Pedersen wrote:
> From: Nishant Sarmukadam <nishants@marvell.com>
>
> When configuring rx antennas using CMD_RF_ANTENNA, the argument input is
> the number of antennas to be enabled. For AP, we support 3 rx antennas
> and hence set the field to 3. For tx antennas, value is a bitmap, so 0x7
> enables all three.
>
> Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
> Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
I hope you registered your displeasure with the firmware writers over
this API detail...
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-02-22 20:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 22:45 [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP Thomas Pedersen
2011-02-17 22:45 ` [PATCH V2 2/3] mwl8k: Tell mac80211 we have rate adaptation in FW Thomas Pedersen
2011-02-17 22:45 ` [PATCH V2 3/3] mwl8k: Invert tx queues for set_hw_spec and set_edca_params Thomas Pedersen
2011-02-22 19:49 ` [PATCH V2 1/3] mwl8k: fix rf_antenna rx argument for AP John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).