diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 61 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 63 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 63 |
4 files changed, 65 insertions, 124 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 3258301aa29c..1556e324cecc 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -379,6 +379,67 @@ void rt2800_process_rxwi(struct sk_buff *skb, struct rxdone_entry_desc *rxdesc) | |||
379 | } | 379 | } |
380 | EXPORT_SYMBOL_GPL(rt2800_process_rxwi); | 380 | EXPORT_SYMBOL_GPL(rt2800_process_rxwi); |
381 | 381 | ||
382 | void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc) | ||
383 | { | ||
384 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | ||
385 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
386 | unsigned int beacon_base; | ||
387 | u32 reg; | ||
388 | |||
389 | /* | ||
390 | * Disable beaconing while we are reloading the beacon data, | ||
391 | * otherwise we might be sending out invalid data. | ||
392 | */ | ||
393 | rt2800_register_read(rt2x00dev, BCN_TIME_CFG, ®); | ||
394 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 0); | ||
395 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
396 | |||
397 | /* | ||
398 | * Add space for the TXWI in front of the skb. | ||
399 | */ | ||
400 | skb_push(entry->skb, TXWI_DESC_SIZE); | ||
401 | memset(entry->skb, 0, TXWI_DESC_SIZE); | ||
402 | |||
403 | /* | ||
404 | * Register descriptor details in skb frame descriptor. | ||
405 | */ | ||
406 | skbdesc->flags |= SKBDESC_DESC_IN_SKB; | ||
407 | skbdesc->desc = entry->skb->data; | ||
408 | skbdesc->desc_len = TXWI_DESC_SIZE; | ||
409 | |||
410 | /* | ||
411 | * Add the TXWI for the beacon to the skb. | ||
412 | */ | ||
413 | rt2800_write_txwi((__le32 *)entry->skb->data, txdesc); | ||
414 | |||
415 | /* | ||
416 | * Dump beacon to userspace through debugfs. | ||
417 | */ | ||
418 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb); | ||
419 | |||
420 | /* | ||
421 | * Write entire beacon with TXWI to register. | ||
422 | */ | ||
423 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | ||
424 | rt2800_register_multiwrite(rt2x00dev, beacon_base, | ||
425 | entry->skb->data, entry->skb->len); | ||
426 | |||
427 | /* | ||
428 | * Enable beaconing again. | ||
429 | */ | ||
430 | rt2x00_set_field32(®, BCN_TIME_CFG_TSF_TICKING, 1); | ||
431 | rt2x00_set_field32(®, BCN_TIME_CFG_TBTT_ENABLE, 1); | ||
432 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 1); | ||
433 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
434 | |||
435 | /* | ||
436 | * Clean up beacon skb. | ||
437 | */ | ||
438 | dev_kfree_skb_any(entry->skb); | ||
439 | entry->skb = NULL; | ||
440 | } | ||
441 | EXPORT_SYMBOL(rt2800_write_beacon); | ||
442 | |||
382 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS | 443 | #ifdef CONFIG_RT2X00_LIB_DEBUGFS |
383 | const struct rt2x00debug rt2800_rt2x00debug = { | 444 | const struct rt2x00debug rt2800_rt2x00debug = { |
384 | .owner = THIS_MODULE, | 445 | .owner = THIS_MODULE, |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.h b/drivers/net/wireless/rt2x00/rt2800lib.h index 0f0a13c61e68..b16fd6d2d22c 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.h +++ b/drivers/net/wireless/rt2x00/rt2800lib.h | |||
@@ -114,6 +114,8 @@ void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev, | |||
114 | void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc); | 114 | void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc); |
115 | void rt2800_process_rxwi(struct sk_buff *skb, struct rxdone_entry_desc *txdesc); | 115 | void rt2800_process_rxwi(struct sk_buff *skb, struct rxdone_entry_desc *txdesc); |
116 | 116 | ||
117 | void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc); | ||
118 | |||
117 | extern const struct rt2x00debug rt2800_rt2x00debug; | 119 | extern const struct rt2x00debug rt2800_rt2x00debug; |
118 | 120 | ||
119 | int rt2800_rfkill_poll(struct rt2x00_dev *rt2x00dev); | 121 | int rt2800_rfkill_poll(struct rt2x00_dev *rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index db61a78e32b0..f2718367d1a0 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -676,67 +676,6 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
676 | /* | 676 | /* |
677 | * TX data initialization | 677 | * TX data initialization |
678 | */ | 678 | */ |
679 | static void rt2800pci_write_beacon(struct queue_entry *entry, | ||
680 | struct txentry_desc *txdesc) | ||
681 | { | ||
682 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | ||
683 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
684 | unsigned int beacon_base; | ||
685 | u32 reg; | ||
686 | |||
687 | /* | ||
688 | * Disable beaconing while we are reloading the beacon data, | ||
689 | * otherwise we might be sending out invalid data. | ||
690 | */ | ||
691 | rt2800_register_read(rt2x00dev, BCN_TIME_CFG, ®); | ||
692 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 0); | ||
693 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
694 | |||
695 | /* | ||
696 | * Add space for the TXWI in front of the skb. | ||
697 | */ | ||
698 | skb_push(entry->skb, TXWI_DESC_SIZE); | ||
699 | memset(entry->skb, 0, TXWI_DESC_SIZE); | ||
700 | |||
701 | /* | ||
702 | * Register descriptor details in skb frame descriptor. | ||
703 | */ | ||
704 | skbdesc->flags |= SKBDESC_DESC_IN_SKB; | ||
705 | skbdesc->desc = entry->skb->data; | ||
706 | skbdesc->desc_len = TXWI_DESC_SIZE; | ||
707 | |||
708 | /* | ||
709 | * Add the TXWI for the beacon to the skb. | ||
710 | */ | ||
711 | rt2800_write_txwi((__le32 *)entry->skb->data, txdesc); | ||
712 | |||
713 | /* | ||
714 | * Dump beacon to userspace through debugfs. | ||
715 | */ | ||
716 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb); | ||
717 | |||
718 | /* | ||
719 | * Write entire beacon with TXWI to register. | ||
720 | */ | ||
721 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | ||
722 | rt2800_register_multiwrite(rt2x00dev, beacon_base, | ||
723 | entry->skb->data, entry->skb->len); | ||
724 | |||
725 | /* | ||
726 | * Enable beaconing again. | ||
727 | */ | ||
728 | rt2x00_set_field32(®, BCN_TIME_CFG_TSF_TICKING, 1); | ||
729 | rt2x00_set_field32(®, BCN_TIME_CFG_TBTT_ENABLE, 1); | ||
730 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 1); | ||
731 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
732 | |||
733 | /* | ||
734 | * Clean up beacon skb. | ||
735 | */ | ||
736 | dev_kfree_skb_any(entry->skb); | ||
737 | entry->skb = NULL; | ||
738 | } | ||
739 | |||
740 | static void rt2800pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, | 679 | static void rt2800pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, |
741 | const enum data_queue_qid queue_idx) | 680 | const enum data_queue_qid queue_idx) |
742 | { | 681 | { |
@@ -1074,7 +1013,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { | |||
1074 | .write_tx_desc = rt2800pci_write_tx_desc, | 1013 | .write_tx_desc = rt2800pci_write_tx_desc, |
1075 | .write_tx_data = rt2x00pci_write_tx_data, | 1014 | .write_tx_data = rt2x00pci_write_tx_data, |
1076 | .write_tx_datadesc = rt2800pci_write_tx_datadesc, | 1015 | .write_tx_datadesc = rt2800pci_write_tx_datadesc, |
1077 | .write_beacon = rt2800pci_write_beacon, | 1016 | .write_beacon = rt2800_write_beacon, |
1078 | .kick_tx_queue = rt2800pci_kick_tx_queue, | 1017 | .kick_tx_queue = rt2800pci_kick_tx_queue, |
1079 | .kill_tx_queue = rt2800pci_kill_tx_queue, | 1018 | .kill_tx_queue = rt2800pci_kill_tx_queue, |
1080 | .fill_rxdone = rt2800pci_fill_rxdone, | 1019 | .fill_rxdone = rt2800pci_fill_rxdone, |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index c69628d943de..2e584b5c8d36 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -432,67 +432,6 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
432 | /* | 432 | /* |
433 | * TX data initialization | 433 | * TX data initialization |
434 | */ | 434 | */ |
435 | static void rt2800usb_write_beacon(struct queue_entry *entry, | ||
436 | struct txentry_desc *txdesc) | ||
437 | { | ||
438 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | ||
439 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); | ||
440 | unsigned int beacon_base; | ||
441 | u32 reg; | ||
442 | |||
443 | /* | ||
444 | * Disable beaconing while we are reloading the beacon data, | ||
445 | * otherwise we might be sending out invalid data. | ||
446 | */ | ||
447 | rt2800_register_read(rt2x00dev, BCN_TIME_CFG, ®); | ||
448 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 0); | ||
449 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
450 | |||
451 | /* | ||
452 | * Add space for the TXWI in front of the skb. | ||
453 | */ | ||
454 | skb_push(entry->skb, TXWI_DESC_SIZE); | ||
455 | memset(entry->skb, 0, TXWI_DESC_SIZE); | ||
456 | |||
457 | /* | ||
458 | * Register descriptor details in skb frame descriptor. | ||
459 | */ | ||
460 | skbdesc->flags |= SKBDESC_DESC_IN_SKB; | ||
461 | skbdesc->desc = entry->skb->data; | ||
462 | skbdesc->desc_len = TXWI_DESC_SIZE; | ||
463 | |||
464 | /* | ||
465 | * Add the TXWI for the beacon to the skb. | ||
466 | */ | ||
467 | rt2800_write_txwi((__le32 *) entry->skb->data, txdesc); | ||
468 | |||
469 | /* | ||
470 | * Dump beacon to userspace through debugfs. | ||
471 | */ | ||
472 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb); | ||
473 | |||
474 | /* | ||
475 | * Write entire beacon with descriptor to register. | ||
476 | */ | ||
477 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | ||
478 | rt2800_register_multiwrite(rt2x00dev, beacon_base, | ||
479 | entry->skb->data, entry->skb->len); | ||
480 | |||
481 | /* | ||
482 | * Enable beaconing again. | ||
483 | */ | ||
484 | rt2x00_set_field32(®, BCN_TIME_CFG_TSF_TICKING, 1); | ||
485 | rt2x00_set_field32(®, BCN_TIME_CFG_TBTT_ENABLE, 1); | ||
486 | rt2x00_set_field32(®, BCN_TIME_CFG_BEACON_GEN, 1); | ||
487 | rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg); | ||
488 | |||
489 | /* | ||
490 | * Clean up the beacon skb. | ||
491 | */ | ||
492 | dev_kfree_skb(entry->skb); | ||
493 | entry->skb = NULL; | ||
494 | } | ||
495 | |||
496 | static int rt2800usb_get_tx_data_len(struct queue_entry *entry) | 435 | static int rt2800usb_get_tx_data_len(struct queue_entry *entry) |
497 | { | 436 | { |
498 | int length; | 437 | int length; |
@@ -674,7 +613,7 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { | |||
674 | .link_tuner = rt2800_link_tuner, | 613 | .link_tuner = rt2800_link_tuner, |
675 | .write_tx_desc = rt2800usb_write_tx_desc, | 614 | .write_tx_desc = rt2800usb_write_tx_desc, |
676 | .write_tx_data = rt2x00usb_write_tx_data, | 615 | .write_tx_data = rt2x00usb_write_tx_data, |
677 | .write_beacon = rt2800usb_write_beacon, | 616 | .write_beacon = rt2800_write_beacon, |
678 | .get_tx_data_len = rt2800usb_get_tx_data_len, | 617 | .get_tx_data_len = rt2800usb_get_tx_data_len, |
679 | .kick_tx_queue = rt2x00usb_kick_tx_queue, | 618 | .kick_tx_queue = rt2x00usb_kick_tx_queue, |
680 | .kill_tx_queue = rt2x00usb_kill_tx_queue, | 619 | .kill_tx_queue = rt2x00usb_kill_tx_queue, |