aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-04-20 05:03:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-25 14:50:14 -0400
commit3a0593efd191c7eb13c79179c4c5ddbc519b2510 (patch)
tree9b1d5e7bb44c7a467bbc2f96c8848b4c1286a149 /drivers/net/wireless/ath
parent0ff2b5c05d4dd84222a8e163335c5b550e2ca195 (diff)
ath9k_htc: Fix AMPDU subframe handling
* Register the driver's maximum ampdu subframe limit to mac80211. * Cleanup the target capabilities structure and fix an endian issue. * Fix BTCOEX by sending a command to the target when the BT priority changes. * Bump the required firmware version to 1.1 Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.h3
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h14
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_gpio.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c15
5 files changed, 35 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h
index f59df48a86e2..9a52ccc94d12 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.h
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.h
@@ -17,6 +17,9 @@
17#ifndef HTC_USB_H 17#ifndef HTC_USB_H
18#define HTC_USB_H 18#define HTC_USB_H
19 19
20#define MAJOR_VERSION_REQ 1
21#define MINOR_VERSION_REQ 1
22
20#define IS_AR7010_DEVICE(_v) (((_v) == AR9280_USB) || ((_v) == AR9287_USB)) 23#define IS_AR7010_DEVICE(_v) (((_v) == AR9280_USB) || ((_v) == AR9287_USB))
21 24
22#define AR9271_FIRMWARE 0x501000 25#define AR9271_FIRMWARE 0x501000
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 48a885575085..af9082970845 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -106,15 +106,14 @@ struct tx_beacon_header {
106 u16 rev; 106 u16 rev;
107} __packed; 107} __packed;
108 108
109#define MAX_TX_AMPDU_SUBFRAMES_9271 17
110#define MAX_TX_AMPDU_SUBFRAMES_7010 22
111
109struct ath9k_htc_cap_target { 112struct ath9k_htc_cap_target {
110 u32 flags; 113 __be32 ampdu_limit;
111 u32 flags_ext;
112 u32 ampdu_limit;
113 u8 ampdu_subframes; 114 u8 ampdu_subframes;
115 u8 enable_coex;
114 u8 tx_chainmask; 116 u8 tx_chainmask;
115 u8 tx_chainmask_legacy;
116 u8 rtscts_ratecode;
117 u8 protmode;
118 u8 pad; 117 u8 pad;
119} __packed; 118} __packed;
120 119
@@ -551,7 +550,8 @@ void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id,
551void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, 550void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
552 enum htc_endpoint_id ep_id, bool txok); 551 enum htc_endpoint_id ep_id, bool txok);
553 552
554int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv); 553int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
554 u8 enable_coex);
555void ath9k_htc_station_work(struct work_struct *work); 555void ath9k_htc_station_work(struct work_struct *work);
556void ath9k_htc_aggr_work(struct work_struct *work); 556void ath9k_htc_aggr_work(struct work_struct *work);
557void ath9k_htc_ani_work(struct work_struct *work); 557void ath9k_htc_ani_work(struct work_struct *work);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
index 138f8e1350d4..d051a4263e0c 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
@@ -65,15 +65,13 @@ static void ath_btcoex_period_work(struct work_struct *work)
65 u32 timer_period; 65 u32 timer_period;
66 bool is_btscan; 66 bool is_btscan;
67 int ret; 67 int ret;
68 u8 cmd_rsp, aggr;
69 68
70 ath_detect_bt_priority(priv); 69 ath_detect_bt_priority(priv);
71 70
72 is_btscan = !!(priv->op_flags & OP_BT_SCAN); 71 is_btscan = !!(priv->op_flags & OP_BT_SCAN);
73 72
74 aggr = priv->op_flags & OP_BT_PRIORITY_DETECTED; 73 ret = ath9k_htc_update_cap_target(priv,
75 74 !!(priv->op_flags & OP_BT_PRIORITY_DETECTED));
76 WMI_CMD_BUF(WMI_AGGR_LIMIT_CMD, &aggr);
77 if (ret) { 75 if (ret) {
78 ath_err(common, "Unable to set BTCOEX parameters\n"); 76 ath_err(common, "Unable to set BTCOEX parameters\n");
79 return; 77 return;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 06e043bffaf4..dbf5f959cf9b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -753,6 +753,12 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,
753 hw->queues = 4; 753 hw->queues = 4;
754 hw->channel_change_time = 5000; 754 hw->channel_change_time = 5000;
755 hw->max_listen_interval = 10; 755 hw->max_listen_interval = 10;
756
757 if (AR_SREV_9271(priv->ah))
758 hw->max_tx_aggregation_subframes = MAX_TX_AMPDU_SUBFRAMES_9271;
759 else
760 hw->max_tx_aggregation_subframes = MAX_TX_AMPDU_SUBFRAMES_7010;
761
756 hw->vif_data_size = sizeof(struct ath9k_htc_vif); 762 hw->vif_data_size = sizeof(struct ath9k_htc_vif);
757 hw->sta_data_size = sizeof(struct ath9k_htc_sta); 763 hw->sta_data_size = sizeof(struct ath9k_htc_sta);
758 764
@@ -802,6 +808,17 @@ static int ath9k_init_firmware_version(struct ath9k_htc_priv *priv)
802 priv->fw_version_major, 808 priv->fw_version_major,
803 priv->fw_version_minor); 809 priv->fw_version_minor);
804 810
811 /*
812 * Check if the available FW matches the driver's
813 * required version.
814 */
815 if (priv->fw_version_major != MAJOR_VERSION_REQ ||
816 priv->fw_version_minor != MINOR_VERSION_REQ) {
817 dev_err(priv->dev, "ath9k_htc: Please upgrade to FW version %d.%d\n",
818 MAJOR_VERSION_REQ, MINOR_VERSION_REQ);
819 return -EINVAL;
820 }
821
805 return 0; 822 return 0;
806} 823}
807 824
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 7cff5547b8c0..a6402681d58d 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -563,7 +563,8 @@ static int ath9k_htc_remove_station(struct ath9k_htc_priv *priv,
563 return 0; 563 return 0;
564} 564}
565 565
566int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv) 566int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
567 u8 enable_coex)
567{ 568{
568 struct ath9k_htc_cap_target tcap; 569 struct ath9k_htc_cap_target tcap;
569 int ret; 570 int ret;
@@ -571,13 +572,9 @@ int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv)
571 572
572 memset(&tcap, 0, sizeof(struct ath9k_htc_cap_target)); 573 memset(&tcap, 0, sizeof(struct ath9k_htc_cap_target));
573 574
574 /* FIXME: Values are hardcoded */ 575 tcap.ampdu_limit = cpu_to_be32(0xffff);
575 tcap.flags = 0x240c40; 576 tcap.ampdu_subframes = priv->hw->max_tx_aggregation_subframes;
576 tcap.flags_ext = 0x80601000; 577 tcap.enable_coex = enable_coex;
577 tcap.ampdu_limit = 0xffff0000;
578 tcap.ampdu_subframes = 20;
579 tcap.tx_chainmask_legacy = priv->ah->caps.tx_chainmask;
580 tcap.protmode = 1;
581 tcap.tx_chainmask = priv->ah->caps.tx_chainmask; 578 tcap.tx_chainmask = priv->ah->caps.tx_chainmask;
582 579
583 WMI_CMD_BUF(WMI_TARGET_IC_UPDATE_CMDID, &tcap); 580 WMI_CMD_BUF(WMI_TARGET_IC_UPDATE_CMDID, &tcap);
@@ -936,7 +933,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
936 933
937 ath9k_host_rx_init(priv); 934 ath9k_host_rx_init(priv);
938 935
939 ret = ath9k_htc_update_cap_target(priv); 936 ret = ath9k_htc_update_cap_target(priv, 0);
940 if (ret) 937 if (ret)
941 ath_dbg(common, ATH_DBG_CONFIG, 938 ath_dbg(common, ATH_DBG_CONFIG,
942 "Failed to update capability in target\n"); 939 "Failed to update capability in target\n");