aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c1
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c69
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c69
5 files changed, 122 insertions, 24 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 64292c227c96..56829fad3471 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -666,10 +666,11 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
666 queue->cw_max = 10; /* cw_min: 2^10 = 1024. */ 666 queue->cw_max = 10; /* cw_min: 2^10 = 1024. */
667 667
668 queue->aifs = params->aifs; 668 queue->aifs = params->aifs;
669 queue->txop = params->txop;
669 670
670 INFO(rt2x00dev, 671 INFO(rt2x00dev,
671 "Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d.\n", 672 "Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d, TXop: %d.\n",
672 queue_idx, queue->cw_min, queue->cw_max, queue->aifs); 673 queue_idx, queue->cw_min, queue->cw_max, queue->aifs, queue->txop);
673 674
674 return 0; 675 return 0;
675} 676}
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 2822684c505e..a5e965068c83 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -736,6 +736,7 @@ static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
736 736
737 queue->rt2x00dev = rt2x00dev; 737 queue->rt2x00dev = rt2x00dev;
738 queue->qid = qid; 738 queue->qid = qid;
739 queue->txop = 0;
739 queue->aifs = 2; 740 queue->aifs = 2;
740 queue->cw_min = 5; 741 queue->cw_min = 5;
741 queue->cw_max = 10; 742 queue->cw_max = 10;
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 37f3f98d58a2..654fa0c624d3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -368,6 +368,7 @@ enum queue_index {
368 * @length: Number of frames in queue. 368 * @length: Number of frames in queue.
369 * @index: Index pointers to entry positions in the queue, 369 * @index: Index pointers to entry positions in the queue,
370 * use &enum queue_index to get a specific index field. 370 * use &enum queue_index to get a specific index field.
371 * @txop: maximum burst time.
371 * @aifs: The aifs value for outgoing frames (field ignored in RX queue). 372 * @aifs: The aifs value for outgoing frames (field ignored in RX queue).
372 * @cw_min: The cw min value for outgoing frames (field ignored in RX queue). 373 * @cw_min: The cw min value for outgoing frames (field ignored in RX queue).
373 * @cw_max: The cw max value for outgoing frames (field ignored in RX queue). 374 * @cw_max: The cw max value for outgoing frames (field ignored in RX queue).
@@ -387,6 +388,7 @@ struct data_queue {
387 unsigned short length; 388 unsigned short length;
388 unsigned short index[Q_INDEX_MAX]; 389 unsigned short index[Q_INDEX_MAX];
389 390
391 unsigned short txop;
390 unsigned short aifs; 392 unsigned short aifs;
391 unsigned short cw_min; 393 unsigned short cw_min;
392 unsigned short cw_max; 394 unsigned short cw_max;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 9d27ce0e54fe..52537101c908 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1478,16 +1478,6 @@ static int rt61pci_init_registers(struct rt2x00_dev *rt2x00dev)
1478 1478
1479 rt2x00pci_register_write(rt2x00dev, M2H_CMD_DONE_CSR, 0xffffffff); 1479 rt2x00pci_register_write(rt2x00dev, M2H_CMD_DONE_CSR, 0xffffffff);
1480 1480
1481 rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR0, &reg);
1482 rt2x00_set_field32(&reg, AC_TXOP_CSR0_AC0_TX_OP, 0);
1483 rt2x00_set_field32(&reg, AC_TXOP_CSR0_AC1_TX_OP, 0);
1484 rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR0, reg);
1485
1486 rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR1, &reg);
1487 rt2x00_set_field32(&reg, AC_TXOP_CSR1_AC2_TX_OP, 192);
1488 rt2x00_set_field32(&reg, AC_TXOP_CSR1_AC3_TX_OP, 48);
1489 rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR1, reg);
1490
1491 /* 1481 /*
1492 * Clear all beacons 1482 * Clear all beacons
1493 * For the Beacon base registers we only need to clear 1483 * For the Beacon base registers we only need to clear
@@ -2652,6 +2642,63 @@ static int rt61pci_set_retry_limit(struct ieee80211_hw *hw,
2652 return 0; 2642 return 0;
2653} 2643}
2654 2644
2645static int rt61pci_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
2646 const struct ieee80211_tx_queue_params *params)
2647{
2648 struct rt2x00_dev *rt2x00dev = hw->priv;
2649 struct data_queue *queue;
2650 struct rt2x00_field32 field;
2651 int retval;
2652 u32 reg;
2653
2654 /*
2655 * First pass the configuration through rt2x00lib, that will
2656 * update the queue settings and validate the input. After that
2657 * we are free to update the registers based on the value
2658 * in the queue parameter.
2659 */
2660 retval = rt2x00mac_conf_tx(hw, queue_idx, params);
2661 if (retval)
2662 return retval;
2663
2664 queue = rt2x00queue_get_queue(rt2x00dev, queue_idx);
2665
2666 /* Update WMM TXOP register */
2667 if (queue_idx < 2) {
2668 field.bit_offset = queue_idx * 16;
2669 field.bit_mask = 0xffff << field.bit_offset;
2670
2671 rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR0, &reg);
2672 rt2x00_set_field32(&reg, field, queue->txop);
2673 rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR0, reg);
2674 } else if (queue_idx < 4) {
2675 field.bit_offset = (queue_idx - 2) * 16;
2676 field.bit_mask = 0xffff << field.bit_offset;
2677
2678 rt2x00pci_register_read(rt2x00dev, AC_TXOP_CSR1, &reg);
2679 rt2x00_set_field32(&reg, field, queue->txop);
2680 rt2x00pci_register_write(rt2x00dev, AC_TXOP_CSR1, reg);
2681 }
2682
2683 /* Update WMM registers */
2684 field.bit_offset = queue_idx * 4;
2685 field.bit_mask = 0xf << field.bit_offset;
2686
2687 rt2x00pci_register_read(rt2x00dev, AIFSN_CSR, &reg);
2688 rt2x00_set_field32(&reg, field, queue->aifs);
2689 rt2x00pci_register_write(rt2x00dev, AIFSN_CSR, reg);
2690
2691 rt2x00pci_register_read(rt2x00dev, CWMIN_CSR, &reg);
2692 rt2x00_set_field32(&reg, field, queue->cw_min);
2693 rt2x00pci_register_write(rt2x00dev, CWMIN_CSR, reg);
2694
2695 rt2x00pci_register_read(rt2x00dev, CWMAX_CSR, &reg);
2696 rt2x00_set_field32(&reg, field, queue->cw_max);
2697 rt2x00pci_register_write(rt2x00dev, CWMAX_CSR, reg);
2698
2699 return 0;
2700}
2701
2655static u64 rt61pci_get_tsf(struct ieee80211_hw *hw) 2702static u64 rt61pci_get_tsf(struct ieee80211_hw *hw)
2656{ 2703{
2657 struct rt2x00_dev *rt2x00dev = hw->priv; 2704 struct rt2x00_dev *rt2x00dev = hw->priv;
@@ -2679,7 +2726,7 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = {
2679 .get_stats = rt2x00mac_get_stats, 2726 .get_stats = rt2x00mac_get_stats,
2680 .set_retry_limit = rt61pci_set_retry_limit, 2727 .set_retry_limit = rt61pci_set_retry_limit,
2681 .bss_info_changed = rt2x00mac_bss_info_changed, 2728 .bss_info_changed = rt2x00mac_bss_info_changed,
2682 .conf_tx = rt2x00mac_conf_tx, 2729 .conf_tx = rt61pci_conf_tx,
2683 .get_tx_stats = rt2x00mac_get_tx_stats, 2730 .get_tx_stats = rt2x00mac_get_tx_stats,
2684 .get_tsf = rt61pci_get_tsf, 2731 .get_tsf = rt61pci_get_tsf,
2685}; 2732};
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, &reg);
1281 rt2x00_set_field32(&reg, AC_TXOP_CSR0_AC0_TX_OP, 0);
1282 rt2x00_set_field32(&reg, 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, &reg);
1286 rt2x00_set_field32(&reg, AC_TXOP_CSR1_AC2_TX_OP, 192);
1287 rt2x00_set_field32(&reg, AC_TXOP_CSR1_AC3_TX_OP, 48);
1288 rt73usb_register_write(rt2x00dev, AC_TXOP_CSR1, reg);
1289
1290 rt73usb_register_read(rt2x00dev, MAC_CSR9, &reg); 1280 rt73usb_register_read(rt2x00dev, MAC_CSR9, &reg);
1291 rt2x00_set_field32(&reg, MAC_CSR9_CW_SELECT, 0); 1281 rt2x00_set_field32(&reg, 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
2239static 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, &reg);
2266 rt2x00_set_field32(&reg, 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, &reg);
2273 rt2x00_set_field32(&reg, 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, &reg);
2282 rt2x00_set_field32(&reg, field, queue->aifs);
2283 rt73usb_register_write(rt2x00dev, AIFSN_CSR, reg);
2284
2285 rt73usb_register_read(rt2x00dev, CWMIN_CSR, &reg);
2286 rt2x00_set_field32(&reg, field, queue->cw_min);
2287 rt73usb_register_write(rt2x00dev, CWMIN_CSR, reg);
2288
2289 rt73usb_register_read(rt2x00dev, CWMAX_CSR, &reg);
2290 rt2x00_set_field32(&reg, 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};