diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 69 |
1 files changed, 58 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index f58fd059c9a0..636b4e0d0ef5 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1277,16 +1277,6 @@ static int rt73usb_init_registers(struct rt2x00_dev *rt2x00dev) | |||
1277 | rt73usb_register_write(rt2x00dev, PHY_CSR6, 0x00080606); | 1277 | rt73usb_register_write(rt2x00dev, PHY_CSR6, 0x00080606); |
1278 | rt73usb_register_write(rt2x00dev, PHY_CSR7, 0x00000408); | 1278 | rt73usb_register_write(rt2x00dev, PHY_CSR7, 0x00000408); |
1279 | 1279 | ||
1280 | rt73usb_register_read(rt2x00dev, AC_TXOP_CSR0, ®); | ||
1281 | rt2x00_set_field32(®, AC_TXOP_CSR0_AC0_TX_OP, 0); | ||
1282 | rt2x00_set_field32(®, AC_TXOP_CSR0_AC1_TX_OP, 0); | ||
1283 | rt73usb_register_write(rt2x00dev, AC_TXOP_CSR0, reg); | ||
1284 | |||
1285 | rt73usb_register_read(rt2x00dev, AC_TXOP_CSR1, ®); | ||
1286 | rt2x00_set_field32(®, AC_TXOP_CSR1_AC2_TX_OP, 192); | ||
1287 | rt2x00_set_field32(®, AC_TXOP_CSR1_AC3_TX_OP, 48); | ||
1288 | rt73usb_register_write(rt2x00dev, AC_TXOP_CSR1, reg); | ||
1289 | |||
1290 | rt73usb_register_read(rt2x00dev, MAC_CSR9, ®); | 1280 | rt73usb_register_read(rt2x00dev, MAC_CSR9, ®); |
1291 | rt2x00_set_field32(®, MAC_CSR9_CW_SELECT, 0); | 1281 | rt2x00_set_field32(®, MAC_CSR9_CW_SELECT, 0); |
1292 | rt73usb_register_write(rt2x00dev, MAC_CSR9, reg); | 1282 | rt73usb_register_write(rt2x00dev, MAC_CSR9, reg); |
@@ -2246,6 +2236,63 @@ static int rt73usb_set_retry_limit(struct ieee80211_hw *hw, | |||
2246 | return 0; | 2236 | return 0; |
2247 | } | 2237 | } |
2248 | 2238 | ||
2239 | static int rt73usb_conf_tx(struct ieee80211_hw *hw, u16 queue_idx, | ||
2240 | const struct ieee80211_tx_queue_params *params) | ||
2241 | { | ||
2242 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
2243 | struct data_queue *queue; | ||
2244 | struct rt2x00_field32 field; | ||
2245 | int retval; | ||
2246 | u32 reg; | ||
2247 | |||
2248 | /* | ||
2249 | * First pass the configuration through rt2x00lib, that will | ||
2250 | * update the queue settings and validate the input. After that | ||
2251 | * we are free to update the registers based on the value | ||
2252 | * in the queue parameter. | ||
2253 | */ | ||
2254 | retval = rt2x00mac_conf_tx(hw, queue_idx, params); | ||
2255 | if (retval) | ||
2256 | return retval; | ||
2257 | |||
2258 | queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); | ||
2259 | |||
2260 | /* Update WMM TXOP register */ | ||
2261 | if (queue_idx < 2) { | ||
2262 | field.bit_offset = queue_idx * 16; | ||
2263 | field.bit_mask = 0xffff << field.bit_offset; | ||
2264 | |||
2265 | rt73usb_register_read(rt2x00dev, AC_TXOP_CSR0, ®); | ||
2266 | rt2x00_set_field32(®, field, queue->txop); | ||
2267 | rt73usb_register_write(rt2x00dev, AC_TXOP_CSR0, reg); | ||
2268 | } else if (queue_idx < 4) { | ||
2269 | field.bit_offset = (queue_idx - 2) * 16; | ||
2270 | field.bit_mask = 0xffff << field.bit_offset; | ||
2271 | |||
2272 | rt73usb_register_read(rt2x00dev, AC_TXOP_CSR1, ®); | ||
2273 | rt2x00_set_field32(®, field, queue->txop); | ||
2274 | rt73usb_register_write(rt2x00dev, AC_TXOP_CSR1, reg); | ||
2275 | } | ||
2276 | |||
2277 | /* Update WMM registers */ | ||
2278 | field.bit_offset = queue_idx * 4; | ||
2279 | field.bit_mask = 0xf << field.bit_offset; | ||
2280 | |||
2281 | rt73usb_register_read(rt2x00dev, AIFSN_CSR, ®); | ||
2282 | rt2x00_set_field32(®, field, queue->aifs); | ||
2283 | rt73usb_register_write(rt2x00dev, AIFSN_CSR, reg); | ||
2284 | |||
2285 | rt73usb_register_read(rt2x00dev, CWMIN_CSR, ®); | ||
2286 | rt2x00_set_field32(®, field, queue->cw_min); | ||
2287 | rt73usb_register_write(rt2x00dev, CWMIN_CSR, reg); | ||
2288 | |||
2289 | rt73usb_register_read(rt2x00dev, CWMAX_CSR, ®); | ||
2290 | rt2x00_set_field32(®, field, queue->cw_max); | ||
2291 | rt73usb_register_write(rt2x00dev, CWMAX_CSR, reg); | ||
2292 | |||
2293 | return 0; | ||
2294 | } | ||
2295 | |||
2249 | #if 0 | 2296 | #if 0 |
2250 | /* | 2297 | /* |
2251 | * Mac80211 demands get_tsf must be atomic. | 2298 | * Mac80211 demands get_tsf must be atomic. |
@@ -2283,7 +2330,7 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = { | |||
2283 | .get_stats = rt2x00mac_get_stats, | 2330 | .get_stats = rt2x00mac_get_stats, |
2284 | .set_retry_limit = rt73usb_set_retry_limit, | 2331 | .set_retry_limit = rt73usb_set_retry_limit, |
2285 | .bss_info_changed = rt2x00mac_bss_info_changed, | 2332 | .bss_info_changed = rt2x00mac_bss_info_changed, |
2286 | .conf_tx = rt2x00mac_conf_tx, | 2333 | .conf_tx = rt73usb_conf_tx, |
2287 | .get_tx_stats = rt2x00mac_get_tx_stats, | 2334 | .get_tx_stats = rt2x00mac_get_tx_stats, |
2288 | .get_tsf = rt73usb_get_tsf, | 2335 | .get_tsf = rt73usb_get_tsf, |
2289 | }; | 2336 | }; |