aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGertjan van Wingerde <gwingerde@gmail.com>2010-05-08 17:40:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-10 14:56:48 -0400
commitd61cb26696e19494c049297def6c8f37d9e2f534 (patch)
tree29d4f3fa8a6cb3ad61112c0791a8cbe659a53602
parent2de64dd22d0390688b853788dcadee3c0ad9e518 (diff)
rt2x00: Clean up all driver's kick_tx_queue callback functions.
All of the driver's kick_tx_queue callback functions treat the TX queue for beacons in a special manner. Clean this up by integrating the kicking of the beacon queue into the write_beacon callback function, and let the generic code no longer call the kick_tx_queue callback function when updating the beacon. Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c19
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c19
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c55
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c20
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c29
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c30
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c40
8 files changed, 83 insertions, 134 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 6f898913492a..9c13a4e0e731 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1089,6 +1089,14 @@ static void rt2400pci_write_beacon(struct queue_entry *entry)
1089 rt2x00_desc_read(entry_priv->desc, 1, &word); 1089 rt2x00_desc_read(entry_priv->desc, 1, &word);
1090 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); 1090 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
1091 rt2x00_desc_write(entry_priv->desc, 1, word); 1091 rt2x00_desc_write(entry_priv->desc, 1, word);
1092
1093 /*
1094 * Enable beaconing again.
1095 */
1096 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
1097 rt2x00_set_field32(&reg, CSR14_TBCN, 1);
1098 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1);
1099 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1092} 1100}
1093 1101
1094static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, 1102static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
@@ -1096,17 +1104,6 @@ static void rt2400pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1096{ 1104{
1097 u32 reg; 1105 u32 reg;
1098 1106
1099 if (queue == QID_BEACON) {
1100 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1101 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
1102 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
1103 rt2x00_set_field32(&reg, CSR14_TBCN, 1);
1104 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1);
1105 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1106 }
1107 return;
1108 }
1109
1110 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); 1107 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
1111 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE)); 1108 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE));
1112 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK)); 1109 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK));
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index d9b630455e7d..84ab56ec5872 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1246,6 +1246,14 @@ static void rt2500pci_write_beacon(struct queue_entry *entry)
1246 rt2x00_desc_read(entry_priv->desc, 1, &word); 1246 rt2x00_desc_read(entry_priv->desc, 1, &word);
1247 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma); 1247 rt2x00_set_field32(&word, TXD_W1_BUFFER_ADDRESS, skbdesc->skb_dma);
1248 rt2x00_desc_write(entry_priv->desc, 1, word); 1248 rt2x00_desc_write(entry_priv->desc, 1, word);
1249
1250 /*
1251 * Enable beaconing again.
1252 */
1253 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
1254 rt2x00_set_field32(&reg, CSR14_TBCN, 1);
1255 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1);
1256 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1249} 1257}
1250 1258
1251static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, 1259static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
@@ -1253,17 +1261,6 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1253{ 1261{
1254 u32 reg; 1262 u32 reg;
1255 1263
1256 if (queue == QID_BEACON) {
1257 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1258 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
1259 rt2x00_set_field32(&reg, CSR14_TSF_COUNT, 1);
1260 rt2x00_set_field32(&reg, CSR14_TBCN, 1);
1261 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1);
1262 rt2x00pci_register_write(rt2x00dev, CSR14, reg);
1263 }
1264 return;
1265 }
1266
1267 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg); 1264 rt2x00pci_register_read(rt2x00dev, TXCSR0, &reg);
1268 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE)); 1265 rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, (queue == QID_AC_BE));
1269 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK)); 1266 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, (queue == QID_AC_BK));
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index f90b308899aa..5ee9b9fd77b3 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1090,7 +1090,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry)
1090 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); 1090 struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
1091 int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint); 1091 int pipe = usb_sndbulkpipe(usb_dev, entry->queue->usb_endpoint);
1092 int length; 1092 int length;
1093 u16 reg; 1093 u16 reg, reg0;
1094 1094
1095 /* 1095 /*
1096 * Add the descriptor in front of the skb. 1096 * Add the descriptor in front of the skb.
@@ -1132,6 +1132,26 @@ static void rt2500usb_write_beacon(struct queue_entry *entry)
1132 * Send out the guardian byte. 1132 * Send out the guardian byte.
1133 */ 1133 */
1134 usb_submit_urb(bcn_priv->guardian_urb, GFP_ATOMIC); 1134 usb_submit_urb(bcn_priv->guardian_urb, GFP_ATOMIC);
1135
1136 /*
1137 * Enable beaconing again.
1138 */
1139 rt2x00_set_field16(&reg, TXRX_CSR19_TSF_COUNT, 1);
1140 rt2x00_set_field16(&reg, TXRX_CSR19_TBCN, 1);
1141 reg0 = reg;
1142 rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 1);
1143 /*
1144 * Beacon generation will fail initially.
1145 * To prevent this we need to change the TXRX_CSR19
1146 * register several times (reg0 is the same as reg
1147 * except for TXRX_CSR19_BEACON_GEN, which is 0 in reg0
1148 * and 1 in reg).
1149 */
1150 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1151 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg0);
1152 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1153 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg0);
1154 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1135} 1155}
1136 1156
1137static int rt2500usb_get_tx_data_len(struct queue_entry *entry) 1157static int rt2500usb_get_tx_data_len(struct queue_entry *entry)
@@ -1148,37 +1168,6 @@ static int rt2500usb_get_tx_data_len(struct queue_entry *entry)
1148 return length; 1168 return length;
1149} 1169}
1150 1170
1151static void rt2500usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1152 const enum data_queue_qid queue)
1153{
1154 u16 reg, reg0;
1155
1156 if (queue != QID_BEACON) {
1157 rt2x00usb_kick_tx_queue(rt2x00dev, queue);
1158 return;
1159 }
1160
1161 rt2500usb_register_read(rt2x00dev, TXRX_CSR19, &reg);
1162 if (!rt2x00_get_field16(reg, TXRX_CSR19_BEACON_GEN)) {
1163 rt2x00_set_field16(&reg, TXRX_CSR19_TSF_COUNT, 1);
1164 rt2x00_set_field16(&reg, TXRX_CSR19_TBCN, 1);
1165 reg0 = reg;
1166 rt2x00_set_field16(&reg, TXRX_CSR19_BEACON_GEN, 1);
1167 /*
1168 * Beacon generation will fail initially.
1169 * To prevent this we need to change the TXRX_CSR19
1170 * register several times (reg0 is the same as reg
1171 * except for TXRX_CSR19_BEACON_GEN, which is 0 in reg0
1172 * and 1 in reg).
1173 */
1174 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1175 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg0);
1176 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1177 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg0);
1178 rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg);
1179 }
1180}
1181
1182/* 1171/*
1183 * RX control handlers 1172 * RX control handlers
1184 */ 1173 */
@@ -1777,7 +1766,7 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
1777 .write_tx_data = rt2x00usb_write_tx_data, 1766 .write_tx_data = rt2x00usb_write_tx_data,
1778 .write_beacon = rt2500usb_write_beacon, 1767 .write_beacon = rt2500usb_write_beacon,
1779 .get_tx_data_len = rt2500usb_get_tx_data_len, 1768 .get_tx_data_len = rt2500usb_get_tx_data_len,
1780 .kick_tx_queue = rt2500usb_kick_tx_queue, 1769 .kick_tx_queue = rt2x00usb_kick_tx_queue,
1781 .kill_tx_queue = rt2x00usb_kill_tx_queue, 1770 .kill_tx_queue = rt2x00usb_kill_tx_queue,
1782 .fill_rxdone = rt2500usb_fill_rxdone, 1771 .fill_rxdone = rt2500usb_fill_rxdone,
1783 .config_shared_key = rt2500usb_config_key, 1772 .config_shared_key = rt2500usb_config_key,
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 308842a2e8ba..6d564607bbbd 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -705,6 +705,14 @@ static void rt2800pci_write_beacon(struct queue_entry *entry)
705 entry->skb->data, entry->skb->len); 705 entry->skb->data, entry->skb->len);
706 706
707 /* 707 /*
708 * Enable beaconing again.
709 */
710 rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
711 rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
712 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 1);
713 rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
714
715 /*
708 * Clean up beacon skb. 716 * Clean up beacon skb.
709 */ 717 */
710 dev_kfree_skb_any(entry->skb); 718 dev_kfree_skb_any(entry->skb);
@@ -716,18 +724,6 @@ static void rt2800pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
716{ 724{
717 struct data_queue *queue; 725 struct data_queue *queue;
718 unsigned int idx, qidx = 0; 726 unsigned int idx, qidx = 0;
719 u32 reg;
720
721 if (queue_idx == QID_BEACON) {
722 rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
723 if (!rt2x00_get_field32(reg, BCN_TIME_CFG_BEACON_GEN)) {
724 rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
725 rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
726 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 1);
727 rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
728 }
729 return;
730 }
731 727
732 if (queue_idx > QID_HCCA && queue_idx != QID_MGMT) 728 if (queue_idx > QID_HCCA && queue_idx != QID_MGMT)
733 return; 729 return;
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index db371193b507..dbec71852f00 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -459,6 +459,14 @@ static void rt2800usb_write_beacon(struct queue_entry *entry)
459 REGISTER_TIMEOUT32(entry->skb->len)); 459 REGISTER_TIMEOUT32(entry->skb->len));
460 460
461 /* 461 /*
462 * Enable beaconing again.
463 */
464 rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
465 rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
466 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 1);
467 rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
468
469 /*
462 * Clean up the beacon skb. 470 * Clean up the beacon skb.
463 */ 471 */
464 dev_kfree_skb(entry->skb); 472 dev_kfree_skb(entry->skb);
@@ -480,25 +488,6 @@ static int rt2800usb_get_tx_data_len(struct queue_entry *entry)
480 return length; 488 return length;
481} 489}
482 490
483static void rt2800usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
484 const enum data_queue_qid queue)
485{
486 u32 reg;
487
488 if (queue != QID_BEACON) {
489 rt2x00usb_kick_tx_queue(rt2x00dev, queue);
490 return;
491 }
492
493 rt2800_register_read(rt2x00dev, BCN_TIME_CFG, &reg);
494 if (!rt2x00_get_field32(reg, BCN_TIME_CFG_BEACON_GEN)) {
495 rt2x00_set_field32(&reg, BCN_TIME_CFG_TSF_TICKING, 1);
496 rt2x00_set_field32(&reg, BCN_TIME_CFG_TBTT_ENABLE, 1);
497 rt2x00_set_field32(&reg, BCN_TIME_CFG_BEACON_GEN, 1);
498 rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
499 }
500}
501
502/* 491/*
503 * RX control handlers 492 * RX control handlers
504 */ 493 */
@@ -667,7 +656,7 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = {
667 .write_tx_data = rt2x00usb_write_tx_data, 656 .write_tx_data = rt2x00usb_write_tx_data,
668 .write_beacon = rt2800usb_write_beacon, 657 .write_beacon = rt2800usb_write_beacon,
669 .get_tx_data_len = rt2800usb_get_tx_data_len, 658 .get_tx_data_len = rt2800usb_get_tx_data_len,
670 .kick_tx_queue = rt2800usb_kick_tx_queue, 659 .kick_tx_queue = rt2x00usb_kick_tx_queue,
671 .kill_tx_queue = rt2x00usb_kill_tx_queue, 660 .kill_tx_queue = rt2x00usb_kill_tx_queue,
672 .fill_rxdone = rt2800usb_fill_rxdone, 661 .fill_rxdone = rt2800usb_fill_rxdone,
673 .config_shared_key = rt2800_config_shared_key, 662 .config_shared_key = rt2800_config_shared_key,
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 59d9459acfaf..949aaad0cbd2 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -602,12 +602,9 @@ int rt2x00queue_update_beacon(struct rt2x00_dev *rt2x00dev,
602 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc); 602 rt2x00queue_write_tx_descriptor(intf->beacon, &txdesc);
603 603
604 /* 604 /*
605 * Send beacon to hardware. 605 * Send beacon to hardware and enable beacon genaration..
606 * Also enable beacon generation, which might have been disabled
607 * by the driver during the config_beacon() callback function.
608 */ 606 */
609 rt2x00dev->ops->lib->write_beacon(intf->beacon); 607 rt2x00dev->ops->lib->write_beacon(intf->beacon);
610 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, QID_BEACON);
611 608
612 mutex_unlock(&intf->beacon_skb_mutex); 609 mutex_unlock(&intf->beacon_skb_mutex);
613 610
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 1b0c70d65699..9e3a1ee426e2 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1869,6 +1869,19 @@ static void rt61pci_write_beacon(struct queue_entry *entry)
1869 entry->skb->data, entry->skb->len); 1869 entry->skb->data, entry->skb->len);
1870 1870
1871 /* 1871 /*
1872 * Enable beaconing again.
1873 *
1874 * For Wi-Fi faily generated beacons between participating
1875 * stations. Set TBTT phase adaptive adjustment step to 8us.
1876 */
1877 rt2x00pci_register_write(rt2x00dev, TXRX_CSR10, 0x00001008);
1878
1879 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
1880 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 1);
1881 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1);
1882 rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg);
1883
1884 /*
1872 * Clean up beacon skb. 1885 * Clean up beacon skb.
1873 */ 1886 */
1874 dev_kfree_skb_any(entry->skb); 1887 dev_kfree_skb_any(entry->skb);
@@ -1880,23 +1893,6 @@ static void rt61pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1880{ 1893{
1881 u32 reg; 1894 u32 reg;
1882 1895
1883 if (queue == QID_BEACON) {
1884 /*
1885 * For Wi-Fi faily generated beacons between participating
1886 * stations. Set TBTT phase adaptive adjustment step to 8us.
1887 */
1888 rt2x00pci_register_write(rt2x00dev, TXRX_CSR10, 0x00001008);
1889
1890 rt2x00pci_register_read(rt2x00dev, TXRX_CSR9, &reg);
1891 if (!rt2x00_get_field32(reg, TXRX_CSR9_BEACON_GEN)) {
1892 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
1893 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 1);
1894 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1);
1895 rt2x00pci_register_write(rt2x00dev, TXRX_CSR9, reg);
1896 }
1897 return;
1898 }
1899
1900 rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, &reg); 1896 rt2x00pci_register_read(rt2x00dev, TX_CNTL_CSR, &reg);
1901 rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC0, (queue == QID_AC_BE)); 1897 rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC0, (queue == QID_AC_BE));
1902 rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC1, (queue == QID_AC_BK)); 1898 rt2x00_set_field32(&reg, TX_CNTL_CSR_KICK_TX_AC1, (queue == QID_AC_BK));
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 6acba620971f..ca3707af4b4c 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1536,6 +1536,19 @@ static void rt73usb_write_beacon(struct queue_entry *entry)
1536 REGISTER_TIMEOUT32(entry->skb->len)); 1536 REGISTER_TIMEOUT32(entry->skb->len));
1537 1537
1538 /* 1538 /*
1539 * Enable beaconing again.
1540 *
1541 * For Wi-Fi faily generated beacons between participating stations.
1542 * Set TBTT phase adaptive adjustment step to 8us (default 16us)
1543 */
1544 rt2x00usb_register_write(rt2x00dev, TXRX_CSR10, 0x00001008);
1545
1546 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
1547 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 1);
1548 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1);
1549 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1550
1551 /*
1539 * Clean up the beacon skb. 1552 * Clean up the beacon skb.
1540 */ 1553 */
1541 dev_kfree_skb(entry->skb); 1554 dev_kfree_skb(entry->skb);
@@ -1556,31 +1569,6 @@ static int rt73usb_get_tx_data_len(struct queue_entry *entry)
1556 return length; 1569 return length;
1557} 1570}
1558 1571
1559static void rt73usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1560 const enum data_queue_qid queue)
1561{
1562 u32 reg;
1563
1564 if (queue != QID_BEACON) {
1565 rt2x00usb_kick_tx_queue(rt2x00dev, queue);
1566 return;
1567 }
1568
1569 /*
1570 * For Wi-Fi faily generated beacons between participating stations.
1571 * Set TBTT phase adaptive adjustment step to 8us (default 16us)
1572 */
1573 rt2x00usb_register_write(rt2x00dev, TXRX_CSR10, 0x00001008);
1574
1575 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
1576 if (!rt2x00_get_field32(reg, TXRX_CSR9_BEACON_GEN)) {
1577 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
1578 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 1);
1579 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1);
1580 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1581 }
1582}
1583
1584/* 1572/*
1585 * RX control handlers 1573 * RX control handlers
1586 */ 1574 */
@@ -2261,7 +2249,7 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {
2261 .write_tx_data = rt2x00usb_write_tx_data, 2249 .write_tx_data = rt2x00usb_write_tx_data,
2262 .write_beacon = rt73usb_write_beacon, 2250 .write_beacon = rt73usb_write_beacon,
2263 .get_tx_data_len = rt73usb_get_tx_data_len, 2251 .get_tx_data_len = rt73usb_get_tx_data_len,
2264 .kick_tx_queue = rt73usb_kick_tx_queue, 2252 .kick_tx_queue = rt2x00usb_kick_tx_queue,
2265 .kill_tx_queue = rt2x00usb_kill_tx_queue, 2253 .kill_tx_queue = rt2x00usb_kill_tx_queue,
2266 .fill_rxdone = rt73usb_fill_rxdone, 2254 .fill_rxdone = rt73usb_fill_rxdone,
2267 .config_shared_key = rt73usb_config_shared_key, 2255 .config_shared_key = rt73usb_config_shared_key,