diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/core.h')
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 134 |
1 files changed, 61 insertions, 73 deletions
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 41a87b99deaa..e38f0331cfd5 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -61,7 +61,7 @@ struct ath_node; | |||
61 | #define TSF_TO_TU(_h,_l) \ | 61 | #define TSF_TO_TU(_h,_l) \ |
62 | ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) | 62 | ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) |
63 | 63 | ||
64 | #define ATH_TXQ_SETUP(sc, i) ((sc)->sc_txqsetup & (1<<i)) | 64 | #define ATH_TXQ_SETUP(sc, i) ((sc)->tx.txqsetup & (1<<i)) |
65 | 65 | ||
66 | static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; | 66 | static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; |
67 | 67 | ||
@@ -453,6 +453,28 @@ struct ath_node { | |||
453 | u8 mpdudensity; | 453 | u8 mpdudensity; |
454 | }; | 454 | }; |
455 | 455 | ||
456 | struct ath_tx { | ||
457 | u16 seq_no; | ||
458 | u32 txqsetup; | ||
459 | int hwq_map[ATH9K_WME_AC_VO+1]; | ||
460 | spinlock_t txbuflock; | ||
461 | struct list_head txbuf; | ||
462 | struct ath_txq txq[ATH9K_NUM_TX_QUEUES]; | ||
463 | struct ath_descdma txdma; | ||
464 | }; | ||
465 | |||
466 | struct ath_rx { | ||
467 | u8 defant; | ||
468 | u8 rxotherant; | ||
469 | u32 *rxlink; | ||
470 | int bufsize; | ||
471 | unsigned int rxfilter; | ||
472 | spinlock_t rxflushlock; | ||
473 | spinlock_t rxbuflock; | ||
474 | struct list_head rxbuf; | ||
475 | struct ath_descdma rxdma; | ||
476 | }; | ||
477 | |||
456 | int ath_startrecv(struct ath_softc *sc); | 478 | int ath_startrecv(struct ath_softc *sc); |
457 | bool ath_stoprecv(struct ath_softc *sc); | 479 | bool ath_stoprecv(struct ath_softc *sc); |
458 | void ath_flushrecv(struct ath_softc *sc); | 480 | void ath_flushrecv(struct ath_softc *sc); |
@@ -540,6 +562,26 @@ struct ath_beacon_config { | |||
540 | } u; /* last received beacon/probe response timestamp of this BSS. */ | 562 | } u; /* last received beacon/probe response timestamp of this BSS. */ |
541 | }; | 563 | }; |
542 | 564 | ||
565 | struct ath_beacon { | ||
566 | enum { | ||
567 | OK, /* no change needed */ | ||
568 | UPDATE, /* update pending */ | ||
569 | COMMIT /* beacon sent, commit change */ | ||
570 | } updateslot; /* slot time update fsm */ | ||
571 | |||
572 | u32 beaconq; | ||
573 | u32 bmisscnt; | ||
574 | u32 ast_be_xmit; | ||
575 | u64 bc_tstamp; | ||
576 | int bslot[ATH_BCBUF]; | ||
577 | int slottime; | ||
578 | int slotupdate; | ||
579 | struct ath9k_tx_queue_info beacon_qi; | ||
580 | struct ath_descdma bdma; | ||
581 | struct ath_txq *cabq; | ||
582 | struct list_head bbuf; | ||
583 | }; | ||
584 | |||
543 | void ath9k_beacon_tasklet(unsigned long data); | 585 | void ath9k_beacon_tasklet(unsigned long data); |
544 | void ath_beacon_config(struct ath_softc *sc, int if_id); | 586 | void ath_beacon_config(struct ath_softc *sc, int if_id); |
545 | int ath_beaconq_setup(struct ath_hal *ah); | 587 | int ath_beaconq_setup(struct ath_hal *ah); |
@@ -610,7 +652,7 @@ struct ath_rfkill { | |||
610 | #define DEFAULT_CACHELINE 32 | 652 | #define DEFAULT_CACHELINE 32 |
611 | #define ATH_DEFAULT_NOISE_FLOOR -95 | 653 | #define ATH_DEFAULT_NOISE_FLOOR -95 |
612 | #define ATH_REGCLASSIDS_MAX 10 | 654 | #define ATH_REGCLASSIDS_MAX 10 |
613 | #define ATH_CABQ_READY_TIME 80 /* % of beacon interval */ | 655 | #define ATH_CABQ_READY_TIME 80 /* % of beacon interval */ |
614 | #define ATH_MAX_SW_RETRIES 10 | 656 | #define ATH_MAX_SW_RETRIES 10 |
615 | #define ATH_CHAN_MAX 255 | 657 | #define ATH_CHAN_MAX 255 |
616 | #define IEEE80211_WEP_NKID 4 /* number of key ids */ | 658 | #define IEEE80211_WEP_NKID 4 /* number of key ids */ |
@@ -623,7 +665,7 @@ struct ath_rfkill { | |||
623 | * Different parts have different size key caches. We handle | 665 | * Different parts have different size key caches. We handle |
624 | * up to ATH_KEYMAX entries (could dynamically allocate state). | 666 | * up to ATH_KEYMAX entries (could dynamically allocate state). |
625 | */ | 667 | */ |
626 | #define ATH_KEYMAX 128 /* max key cache size we handle */ | 668 | #define ATH_KEYMAX 128 /* max key cache size we handle */ |
627 | 669 | ||
628 | #define ATH_IF_ID_ANY 0xff | 670 | #define ATH_IF_ID_ANY 0xff |
629 | #define ATH_TXPOWER_MAX 100 /* .5 dBm units */ | 671 | #define ATH_TXPOWER_MAX 100 /* .5 dBm units */ |
@@ -656,105 +698,51 @@ struct ath_softc { | |||
656 | struct pci_dev *pdev; | 698 | struct pci_dev *pdev; |
657 | struct tasklet_struct intr_tq; | 699 | struct tasklet_struct intr_tq; |
658 | struct tasklet_struct bcon_tasklet; | 700 | struct tasklet_struct bcon_tasklet; |
659 | struct ath_config sc_config; | ||
660 | struct ath_hal *sc_ah; | 701 | struct ath_hal *sc_ah; |
661 | void __iomem *mem; | 702 | void __iomem *mem; |
703 | spinlock_t sc_resetlock; | ||
662 | 704 | ||
663 | u8 sc_curbssid[ETH_ALEN]; | 705 | u8 sc_curbssid[ETH_ALEN]; |
664 | u8 sc_myaddr[ETH_ALEN]; | 706 | u8 sc_myaddr[ETH_ALEN]; |
665 | u8 sc_bssidmask[ETH_ALEN]; | 707 | u8 sc_bssidmask[ETH_ALEN]; |
666 | |||
667 | #ifdef CONFIG_ATH9K_DEBUG | ||
668 | struct ath9k_debug sc_debug; | ||
669 | #endif | ||
670 | u32 sc_intrstatus; | 708 | u32 sc_intrstatus; |
671 | u32 sc_flags; /* SC_OP_* */ | 709 | u32 sc_flags; /* SC_OP_* */ |
672 | unsigned int rx_filter; | ||
673 | u16 sc_curtxpow; | 710 | u16 sc_curtxpow; |
674 | u16 sc_curaid; | 711 | u16 sc_curaid; |
675 | u16 sc_cachelsz; | 712 | u16 sc_cachelsz; |
676 | int sc_slotupdate; /* slot to next advance fsm */ | 713 | u8 sc_nbcnvaps; |
677 | int sc_slottime; | 714 | u16 sc_nvaps; |
678 | int sc_bslot[ATH_BCBUF]; | ||
679 | u8 sc_tx_chainmask; | 715 | u8 sc_tx_chainmask; |
680 | u8 sc_rx_chainmask; | 716 | u8 sc_rx_chainmask; |
717 | u32 sc_keymax; | ||
718 | DECLARE_BITMAP(sc_keymap, ATH_KEYMAX); | ||
719 | u8 sc_splitmic; | ||
720 | u8 sc_protrix; | ||
681 | enum ath9k_int sc_imask; | 721 | enum ath9k_int sc_imask; |
682 | enum PROT_MODE sc_protmode; | 722 | enum PROT_MODE sc_protmode; |
683 | |||
684 | u8 sc_nbcnvaps; | ||
685 | u16 sc_nvaps; | ||
686 | struct ieee80211_vif *sc_vaps[ATH_BCBUF]; | ||
687 | |||
688 | u8 sc_mcastantenna; | ||
689 | u8 sc_defant; | ||
690 | u8 sc_rxotherant; | ||
691 | |||
692 | struct ath9k_node_stats sc_halstats; | ||
693 | enum ath9k_ht_extprotspacing sc_ht_extprotspacing; | 723 | enum ath9k_ht_extprotspacing sc_ht_extprotspacing; |
694 | enum ath9k_ht_macmode tx_chan_width; | 724 | enum ath9k_ht_macmode tx_chan_width; |
695 | 725 | ||
696 | enum { | 726 | struct ath_config sc_config; |
697 | OK, /* no change needed */ | 727 | struct ath_rx rx; |
698 | UPDATE, /* update pending */ | 728 | struct ath_tx tx; |
699 | COMMIT /* beacon sent, commit change */ | 729 | struct ath_beacon beacon; |
700 | } sc_updateslot; /* slot time update fsm */ | 730 | struct ieee80211_vif *sc_vaps[ATH_BCBUF]; |
701 | |||
702 | /* Crypto */ | ||
703 | u32 sc_keymax; | ||
704 | DECLARE_BITMAP(sc_keymap, ATH_KEYMAX); | ||
705 | u8 sc_splitmic; /* split TKIP MIC keys */ | ||
706 | |||
707 | /* RX */ | ||
708 | struct list_head sc_rxbuf; | ||
709 | struct ath_descdma sc_rxdma; | ||
710 | int sc_rxbufsize; | ||
711 | u32 *sc_rxlink; | ||
712 | |||
713 | /* TX */ | ||
714 | struct list_head sc_txbuf; | ||
715 | struct ath_txq sc_txq[ATH9K_NUM_TX_QUEUES]; | ||
716 | struct ath_descdma sc_txdma; | ||
717 | u32 sc_txqsetup; | ||
718 | int sc_haltype2q[ATH9K_WME_AC_VO+1]; | ||
719 | u16 seq_no; /* TX sequence number */ | ||
720 | |||
721 | /* Beacon */ | ||
722 | struct ath9k_tx_queue_info sc_beacon_qi; | ||
723 | struct ath_descdma sc_bdma; | ||
724 | struct ath_txq *sc_cabq; | ||
725 | struct list_head sc_bbuf; | ||
726 | u32 sc_bhalq; | ||
727 | u32 sc_bmisscount; | ||
728 | u32 ast_be_xmit; | ||
729 | u64 bc_tstamp; | ||
730 | |||
731 | /* Rate */ | ||
732 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX]; | 731 | struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX]; |
733 | struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX]; | 732 | struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX]; |
734 | struct ath_rate_table *cur_rate_table; | 733 | struct ath_rate_table *cur_rate_table; |
735 | u8 sc_protrix; | ||
736 | |||
737 | /* Channel, Band */ | ||
738 | struct ieee80211_channel channels[IEEE80211_NUM_BANDS][ATH_CHAN_MAX]; | 734 | struct ieee80211_channel channels[IEEE80211_NUM_BANDS][ATH_CHAN_MAX]; |
739 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; | 735 | struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS]; |
740 | |||
741 | /* Locks */ | ||
742 | spinlock_t sc_rxflushlock; | ||
743 | spinlock_t sc_rxbuflock; | ||
744 | spinlock_t sc_txbuflock; | ||
745 | spinlock_t sc_resetlock; | ||
746 | |||
747 | /* LEDs */ | ||
748 | struct ath_led radio_led; | 736 | struct ath_led radio_led; |
749 | struct ath_led assoc_led; | 737 | struct ath_led assoc_led; |
750 | struct ath_led tx_led; | 738 | struct ath_led tx_led; |
751 | struct ath_led rx_led; | 739 | struct ath_led rx_led; |
752 | |||
753 | /* Rfkill */ | ||
754 | struct ath_rfkill rf_kill; | 740 | struct ath_rfkill rf_kill; |
755 | |||
756 | /* ANI */ | ||
757 | struct ath_ani sc_ani; | 741 | struct ath_ani sc_ani; |
742 | struct ath9k_node_stats sc_halstats; | ||
743 | #ifdef CONFIG_ATH9K_DEBUG | ||
744 | struct ath9k_debug sc_debug; | ||
745 | #endif | ||
758 | }; | 746 | }; |
759 | 747 | ||
760 | int ath_reset(struct ath_softc *sc, bool retry_tx); | 748 | int ath_reset(struct ath_softc *sc, bool retry_tx); |