aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2009-01-17 14:42:58 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:00:46 -0500
commit5e790023620ee02486fd64c7e5a6115ce004495d (patch)
treeb2cf06ad1b846c191fd2cf240c7f35cd4cb5ad55 /drivers/net/wireless/rt2x00/rt73usb.c
parent4e54c711b42c3cc8da8a3fdcde3407b86d67ebcc (diff)
rt2x00: conf_tx() only need register access for WMM queues
conf_tx() in rt61pci and rt73usb only have to check once if the queue_idx indicates a non-WMM queue and break of the function immediately if that is the case. Only the WMM queues need to have the TX configuration written to the registers. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 961f9f9352d8..60c43c11bc17 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2180,6 +2180,7 @@ static int rt73usb_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
2180 struct rt2x00_field32 field; 2180 struct rt2x00_field32 field;
2181 int retval; 2181 int retval;
2182 u32 reg; 2182 u32 reg;
2183 u32 offset;
2183 2184
2184 /* 2185 /*
2185 * First pass the configuration through rt2x00lib, that will 2186 * First pass the configuration through rt2x00lib, that will
@@ -2191,24 +2192,23 @@ static int rt73usb_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
2191 if (retval) 2192 if (retval)
2192 return retval; 2193 return retval;
2193 2194
2195 /*
2196 * We only need to perform additional register initialization
2197 * for WMM queues/
2198 */
2199 if (queue_idx >= 4)
2200 return 0;
2201
2194 queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); 2202 queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
2195 2203
2196 /* Update WMM TXOP register */ 2204 /* Update WMM TXOP register */
2197 if (queue_idx < 2) { 2205 offset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx & 2)));
2198 field.bit_offset = queue_idx * 16; 2206 field.bit_offset = (queue_idx & 1) * 16;
2199 field.bit_mask = 0xffff << field.bit_offset; 2207 field.bit_mask = 0xffff << field.bit_offset;
2200 2208
2201 rt2x00usb_register_read(rt2x00dev, AC_TXOP_CSR0, &reg); 2209 rt2x00usb_register_read(rt2x00dev, offset, &reg);
2202 rt2x00_set_field32(&reg, field, queue->txop); 2210 rt2x00_set_field32(&reg, field, queue->txop);
2203 rt2x00usb_register_write(rt2x00dev, AC_TXOP_CSR0, reg); 2211 rt2x00usb_register_write(rt2x00dev, offset, reg);
2204 } else if (queue_idx < 4) {
2205 field.bit_offset = (queue_idx - 2) * 16;
2206 field.bit_mask = 0xffff << field.bit_offset;
2207
2208 rt2x00usb_register_read(rt2x00dev, AC_TXOP_CSR1, &reg);
2209 rt2x00_set_field32(&reg, field, queue->txop);
2210 rt2x00usb_register_write(rt2x00dev, AC_TXOP_CSR1, reg);
2211 }
2212 2212
2213 /* Update WMM registers */ 2213 /* Update WMM registers */
2214 field.bit_offset = queue_idx * 4; 2214 field.bit_offset = queue_idx * 4;