aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-12-12 04:32:37 -0500
committerLuciano Coelho <coelho@ti.com>2012-04-12 01:44:00 -0400
commit53d67a50cd17aca120dff20eb2a93e1665361688 (patch)
treead5945465cac43a5c39775fd758719385e4e925f
parent4158149c24e6f933809bc6fe03dbc3fb218b935b (diff)
wlcore/wl12xx: split Tx completion to immediate/delayed
One chip family employs immediate Tx completion, where knowledge of completed packets is given as part of the FW status. Another is only notified of Tx completion via the FW status, and has to read the completion status of the packets from a different location. Implement the wl12xx tx completion as a delayed Tx completion. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c10
-rw-r--r--drivers/net/wireless/ti/wlcore/hw_ops.h12
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c8
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.c1
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h2
5 files changed, 30 insertions, 3 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 5f81aaf19d9..6b187d066c5 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -789,6 +789,14 @@ static u32 wl12xx_get_rx_packet_len(struct wl1271 *wl, void *rx_data,
789 return data_len - sizeof(*desc) - desc->pad_len; 789 return data_len - sizeof(*desc) - desc->pad_len;
790} 790}
791 791
792static void wl12xx_tx_delayed_compl(struct wl1271 *wl)
793{
794 if (wl->fw_status->tx_results_counter == (wl->tx_results_count & 0xff))
795 return;
796
797 wl1271_tx_complete(wl);
798}
799
792static bool wl12xx_mac_in_fuse(struct wl1271 *wl) 800static bool wl12xx_mac_in_fuse(struct wl1271 *wl)
793{ 801{
794 bool supported = false; 802 bool supported = false;
@@ -862,6 +870,8 @@ static struct wlcore_ops wl12xx_ops = {
862 .set_tx_desc_data_len = wl12xx_set_tx_desc_data_len, 870 .set_tx_desc_data_len = wl12xx_set_tx_desc_data_len,
863 .get_rx_buf_align = wl12xx_get_rx_buf_align, 871 .get_rx_buf_align = wl12xx_get_rx_buf_align,
864 .get_rx_packet_len = wl12xx_get_rx_packet_len, 872 .get_rx_packet_len = wl12xx_get_rx_packet_len,
873 .tx_immediate_compl = NULL,
874 .tx_delayed_compl = wl12xx_tx_delayed_compl,
865 .get_pg_ver = wl12xx_get_pg_ver, 875 .get_pg_ver = wl12xx_get_pg_ver,
866 .get_mac = wl12xx_get_mac, 876 .get_mac = wl12xx_get_mac,
867}; 877};
diff --git a/drivers/net/wireless/ti/wlcore/hw_ops.h b/drivers/net/wireless/ti/wlcore/hw_ops.h
index 22615a8f1a4..9fc64295293 100644
--- a/drivers/net/wireless/ti/wlcore/hw_ops.h
+++ b/drivers/net/wireless/ti/wlcore/hw_ops.h
@@ -81,4 +81,16 @@ wlcore_hw_get_rx_packet_len(struct wl1271 *wl, void *rx_data, u32 data_len)
81 return wl->ops->get_rx_packet_len(wl, rx_data, data_len); 81 return wl->ops->get_rx_packet_len(wl, rx_data, data_len);
82} 82}
83 83
84static inline void wlcore_hw_tx_delayed_compl(struct wl1271 *wl)
85{
86 if (wl->ops->tx_delayed_compl)
87 wl->ops->tx_delayed_compl(wl);
88}
89
90static inline void wlcore_hw_tx_immediate_compl(struct wl1271 *wl)
91{
92 if (wl->ops->tx_immediate_compl)
93 wl->ops->tx_immediate_compl(wl);
94}
95
84#endif 96#endif
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 3f558d5a43e..0392166c430 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -49,6 +49,7 @@
49#include "boot.h" 49#include "boot.h"
50#include "testmode.h" 50#include "testmode.h"
51#include "scan.h" 51#include "scan.h"
52#include "hw_ops.h"
52 53
53#define WL1271_BOOT_RETRIES 3 54#define WL1271_BOOT_RETRIES 3
54 55
@@ -933,6 +934,9 @@ static irqreturn_t wl1271_irq(int irq, void *cookie)
933 smp_mb__after_clear_bit(); 934 smp_mb__after_clear_bit();
934 935
935 wl12xx_fw_status(wl, wl->fw_status); 936 wl12xx_fw_status(wl, wl->fw_status);
937
938 wlcore_hw_tx_immediate_compl(wl);
939
936 intr = le32_to_cpu(wl->fw_status->intr); 940 intr = le32_to_cpu(wl->fw_status->intr);
937 intr &= WL1271_INTR_MASK; 941 intr &= WL1271_INTR_MASK;
938 if (!intr) { 942 if (!intr) {
@@ -969,9 +973,7 @@ static irqreturn_t wl1271_irq(int irq, void *cookie)
969 } 973 }
970 974
971 /* check for tx results */ 975 /* check for tx results */
972 if (wl->fw_status->tx_results_counter != 976 wlcore_hw_tx_delayed_compl(wl);
973 (wl->tx_results_count & 0xff))
974 wl1271_tx_complete(wl);
975 977
976 /* Make sure the deferred queues don't get too long */ 978 /* Make sure the deferred queues don't get too long */
977 defer_count = skb_queue_len(&wl->deferred_tx_queue) + 979 defer_count = skb_queue_len(&wl->deferred_tx_queue) +
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index 1fabc482ca2..d1811b8b514 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -905,6 +905,7 @@ void wl1271_tx_complete(struct wl1271 *wl)
905 wl->tx_results_count++; 905 wl->tx_results_count++;
906 } 906 }
907} 907}
908EXPORT_SYMBOL(wl1271_tx_complete);
908 909
909void wl1271_tx_reset_link_queues(struct wl1271 *wl, u8 hlid) 910void wl1271_tx_reset_link_queues(struct wl1271 *wl, u8 hlid)
910{ 911{
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 664df3216bb..29b39f9b746 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -51,6 +51,8 @@ struct wlcore_ops {
51 void (*prepare_read)(struct wl1271 *wl, u32 rx_desc, u32 len); 51 void (*prepare_read)(struct wl1271 *wl, u32 rx_desc, u32 len);
52 u32 (*get_rx_packet_len)(struct wl1271 *wl, void *rx_data, 52 u32 (*get_rx_packet_len)(struct wl1271 *wl, void *rx_data,
53 u32 data_len); 53 u32 data_len);
54 void (*tx_delayed_compl)(struct wl1271 *wl);
55 void (*tx_immediate_compl)(struct wl1271 *wl);
54 s8 (*get_pg_ver)(struct wl1271 *wl); 56 s8 (*get_pg_ver)(struct wl1271 *wl);
55 void (*get_mac)(struct wl1271 *wl); 57 void (*get_mac)(struct wl1271 *wl);
56}; 58};