diff options
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 30 |
2 files changed, 30 insertions, 30 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 8a8753e2930..3a7eccac885 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2657,6 +2657,7 @@ static int rt61pci_conf_tx(struct ieee80211_hw *hw, u16 queue_idx, | |||
2657 | struct rt2x00_field32 field; | 2657 | struct rt2x00_field32 field; |
2658 | int retval; | 2658 | int retval; |
2659 | u32 reg; | 2659 | u32 reg; |
2660 | u32 offset; | ||
2660 | 2661 | ||
2661 | /* | 2662 | /* |
2662 | * First pass the configuration through rt2x00lib, that will | 2663 | * First pass the configuration through rt2x00lib, that will |
@@ -2668,24 +2669,23 @@ static int rt61pci_conf_tx(struct ieee80211_hw *hw, u16 queue_idx, | |||
2668 | if (retval) | 2669 | if (retval) |
2669 | return retval; | 2670 | return retval; |
2670 | 2671 | ||
2672 | /* | ||
2673 | * We only need to perform additional register initialization | ||
2674 | * for WMM queues/ | ||
2675 | */ | ||
2676 | if (queue_idx >= 4) | ||
2677 | return 0; | ||
2678 | |||
2671 | queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); | 2679 | queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); |
2672 | 2680 | ||
2673 | /* Update WMM TXOP register */ | 2681 | /* Update WMM TXOP register */ |
2674 | if (queue_idx < 2) { | 2682 | offset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx & 2))); |
2675 | field.bit_offset = queue_idx * 16; | 2683 | field.bit_offset = (queue_idx & 1) * 16; |
2676 | field.bit_mask = 0xffff << field.bit_offset; | 2684 | field.bit_mask = 0xffff << field.bit_offset; |
2677 | 2685 | ||
2678 | rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR0, ®); | 2686 | rt2x00pci_register_read(rt2x00dev, offset, ®); |
2679 | rt2x00_set_field32(®, field, queue->txop); | 2687 | rt2x00_set_field32(®, field, queue->txop); |
2680 | rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR0, reg); | 2688 | rt2x00pci_register_write(rt2x00dev, offset, reg); |
2681 | } else if (queue_idx < 4) { | ||
2682 | field.bit_offset = (queue_idx - 2) * 16; | ||
2683 | field.bit_mask = 0xffff << field.bit_offset; | ||
2684 | |||
2685 | rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR1, ®); | ||
2686 | rt2x00_set_field32(®, field, queue->txop); | ||
2687 | rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR1, reg); | ||
2688 | } | ||
2689 | 2689 | ||
2690 | /* Update WMM registers */ | 2690 | /* Update WMM registers */ |
2691 | field.bit_offset = queue_idx * 4; | 2691 | field.bit_offset = queue_idx * 4; |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 961f9f9352d..60c43c11bc1 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, ®); | 2209 | rt2x00usb_register_read(rt2x00dev, offset, ®); |
2202 | rt2x00_set_field32(®, field, queue->txop); | 2210 | rt2x00_set_field32(®, 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, ®); | ||
2209 | rt2x00_set_field32(®, 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; |