diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2010-06-03 04:51:53 -0400 |
---|---|---|
committer | Ivo van Doorn <IvDoorn@gmail.com> | 2010-06-03 04:51:53 -0400 |
commit | f0194b2d5d01b99555fd8a6e42281809086f1ab1 (patch) | |
tree | 74eb78ca8c5b66c55e0bf4bfb6270e8c7e08384a /drivers/net/wireless/rt2x00/rt2800usb.c | |
parent | 96b61bafe22b2f2abcc833d651739edb977f1b1e (diff) |
rt2x00: Centralize rt2800 beacon writing.
The beacon writing functions of rt2800pci and rt2800usb are now identical.
Move them to rt2800lib to only have one central function.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 63 |
1 files changed, 1 insertions, 62 deletions
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, |