aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c55
1 files changed, 22 insertions, 33 deletions
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,