aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c49
1 files changed, 30 insertions, 19 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 029be3c6c030..5ff72deea8d4 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -502,26 +502,14 @@ static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev,
502 struct rt2x00intf_conf *conf, 502 struct rt2x00intf_conf *conf,
503 const unsigned int flags) 503 const unsigned int flags)
504{ 504{
505 unsigned int beacon_base;
506 u32 reg; 505 u32 reg;
507 506
508 if (flags & CONFIG_UPDATE_TYPE) { 507 if (flags & CONFIG_UPDATE_TYPE) {
509 /* 508 /*
510 * Clear current synchronisation setup.
511 * For the Beacon base registers we only need to clear
512 * the first byte since that byte contains the VALID and OWNER
513 * bits which (when set to 0) will invalidate the entire beacon.
514 */
515 beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx);
516 rt2x00usb_register_write(rt2x00dev, beacon_base, 0);
517
518 /*
519 * Enable synchronisation. 509 * Enable synchronisation.
520 */ 510 */
521 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg); 511 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
522 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
523 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_SYNC, conf->sync); 512 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_SYNC, conf->sync);
524 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 1);
525 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); 513 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
526 } 514 }
527 515
@@ -1440,9 +1428,7 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev,
1440 rt73usb_disable_radio(rt2x00dev); 1428 rt73usb_disable_radio(rt2x00dev);
1441 break; 1429 break;
1442 case STATE_RADIO_IRQ_ON: 1430 case STATE_RADIO_IRQ_ON:
1443 case STATE_RADIO_IRQ_ON_ISR:
1444 case STATE_RADIO_IRQ_OFF: 1431 case STATE_RADIO_IRQ_OFF:
1445 case STATE_RADIO_IRQ_OFF_ISR:
1446 /* No support, but no error either */ 1432 /* No support, but no error either */
1447 break; 1433 break;
1448 case STATE_DEEP_SLEEP: 1434 case STATE_DEEP_SLEEP:
@@ -1590,8 +1576,6 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
1590 */ 1576 */
1591 rt2x00usb_register_write(rt2x00dev, TXRX_CSR10, 0x00001008); 1577 rt2x00usb_register_write(rt2x00dev, TXRX_CSR10, 0x00001008);
1592 1578
1593 rt2x00_set_field32(&reg, TXRX_CSR9_TSF_TICKING, 1);
1594 rt2x00_set_field32(&reg, TXRX_CSR9_TBTT_ENABLE, 1);
1595 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1); 1579 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1);
1596 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); 1580 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1597 1581
@@ -1602,6 +1586,33 @@ static void rt73usb_write_beacon(struct queue_entry *entry,
1602 entry->skb = NULL; 1586 entry->skb = NULL;
1603} 1587}
1604 1588
1589static void rt73usb_clear_beacon(struct queue_entry *entry)
1590{
1591 struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
1592 unsigned int beacon_base;
1593 u32 reg;
1594
1595 /*
1596 * Disable beaconing while we are reloading the beacon data,
1597 * otherwise we might be sending out invalid data.
1598 */
1599 rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, &reg);
1600 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 0);
1601 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1602
1603 /*
1604 * Clear beacon.
1605 */
1606 beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
1607 rt2x00usb_register_write(rt2x00dev, beacon_base, 0);
1608
1609 /*
1610 * Enable beaconing again.
1611 */
1612 rt2x00_set_field32(&reg, TXRX_CSR9_BEACON_GEN, 1);
1613 rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg);
1614}
1615
1605static int rt73usb_get_tx_data_len(struct queue_entry *entry) 1616static int rt73usb_get_tx_data_len(struct queue_entry *entry)
1606{ 1617{
1607 int length; 1618 int length;
@@ -1698,9 +1709,8 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
1698 rxdesc->flags |= RX_FLAG_IV_STRIPPED; 1709 rxdesc->flags |= RX_FLAG_IV_STRIPPED;
1699 1710
1700 /* 1711 /*
1701 * FIXME: Legacy driver indicates that the frame does 1712 * The hardware has already checked the Michael Mic and has
1702 * contain the Michael Mic. Unfortunately, in rt2x00 1713 * stripped it from the frame. Signal this to mac80211.
1703 * the MIC seems to be missing completely...
1704 */ 1714 */
1705 rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; 1715 rxdesc->flags |= RX_FLAG_MMIC_STRIPPED;
1706 1716
@@ -2313,6 +2323,7 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = {
2313 .flush_queue = rt2x00usb_flush_queue, 2323 .flush_queue = rt2x00usb_flush_queue,
2314 .write_tx_desc = rt73usb_write_tx_desc, 2324 .write_tx_desc = rt73usb_write_tx_desc,
2315 .write_beacon = rt73usb_write_beacon, 2325 .write_beacon = rt73usb_write_beacon,
2326 .clear_beacon = rt73usb_clear_beacon,
2316 .get_tx_data_len = rt73usb_get_tx_data_len, 2327 .get_tx_data_len = rt73usb_get_tx_data_len,
2317 .fill_rxdone = rt73usb_fill_rxdone, 2328 .fill_rxdone = rt73usb_fill_rxdone,
2318 .config_shared_key = rt73usb_config_shared_key, 2329 .config_shared_key = rt73usb_config_shared_key,