diff options
author | Michael Buesch <mbuesch@freenet.de> | 2006-03-13 13:27:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-03-27 11:19:37 -0500 |
commit | e9357c056c5e62516f0044e60591d41f00ca7cfa (patch) | |
tree | a5dc842a43db15403207f1d763df008fb43cb8e6 /drivers/net/wireless/bcm43xx/bcm43xx.h | |
parent | aae3778176ec7a57b1c4f539b7252acfd7d99a1b (diff) |
[PATCH] bcm43xx: reduce the size of bcm43xx_private by removing unneeded members.
Signed-off-by: Michael Buesch <mbuesch@freenet.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx.h')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx.h | 94 |
1 files changed, 58 insertions, 36 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index 29c95b07122a..a358646ad3eb 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -556,33 +556,37 @@ struct bcm43xx_pio { | |||
556 | 556 | ||
557 | #define BCM43xx_MAX_80211_CORES 2 | 557 | #define BCM43xx_MAX_80211_CORES 2 |
558 | 558 | ||
559 | #define BCM43xx_COREFLAG_AVAILABLE (1 << 0) | ||
560 | #define BCM43xx_COREFLAG_ENABLED (1 << 1) | ||
561 | #define BCM43xx_COREFLAG_INITIALIZED (1 << 2) | ||
562 | |||
563 | #ifdef CONFIG_BCM947XX | 559 | #ifdef CONFIG_BCM947XX |
564 | #define core_offset(bcm) (bcm)->current_core_offset | 560 | #define core_offset(bcm) (bcm)->current_core_offset |
565 | #else | 561 | #else |
566 | #define core_offset(bcm) 0 | 562 | #define core_offset(bcm) 0 |
567 | #endif | 563 | #endif |
568 | 564 | ||
565 | /* Generic information about a core. */ | ||
569 | struct bcm43xx_coreinfo { | 566 | struct bcm43xx_coreinfo { |
570 | /** Driver internal flags. See BCM43xx_COREFLAG_* */ | 567 | u8 available:1, |
571 | u32 flags; | 568 | enabled:1, |
569 | initialized:1; | ||
572 | /** core_id ID number */ | 570 | /** core_id ID number */ |
573 | u16 id; | 571 | u16 id; |
574 | /** core_rev revision number */ | 572 | /** core_rev revision number */ |
575 | u8 rev; | 573 | u8 rev; |
576 | /** Index number for _switch_core() */ | 574 | /** Index number for _switch_core() */ |
577 | u8 index; | 575 | u8 index; |
578 | /* Pointer to the PHYinfo, which belongs to this core (if 80211 core) */ | 576 | }; |
579 | struct bcm43xx_phyinfo *phy; | 577 | |
580 | /* Pointer to the RadioInfo, which belongs to this core (if 80211 core) */ | 578 | /* Additional information for each 80211 core. */ |
581 | struct bcm43xx_radioinfo *radio; | 579 | struct bcm43xx_coreinfo_80211 { |
582 | /* Pointer to the DMA rings, which belong to this core (if 80211 core) */ | 580 | /* PHY device. */ |
583 | struct bcm43xx_dma *dma; | 581 | struct bcm43xx_phyinfo phy; |
584 | /* Pointer to the PIO queues, which belong to this core (if 80211 core) */ | 582 | /* Radio device. */ |
585 | struct bcm43xx_pio *pio; | 583 | struct bcm43xx_radioinfo radio; |
584 | union { | ||
585 | /* DMA context. */ | ||
586 | struct bcm43xx_dma dma; | ||
587 | /* PIO context. */ | ||
588 | struct bcm43xx_pio pio; | ||
589 | }; | ||
586 | }; | 590 | }; |
587 | 591 | ||
588 | /* Context information for a noise calculation (Link Quality). */ | 592 | /* Context information for a noise calculation (Link Quality). */ |
@@ -652,7 +656,7 @@ struct bcm43xx_private { | |||
652 | #define BCM43xx_NR_LEDS 4 | 656 | #define BCM43xx_NR_LEDS 4 |
653 | struct bcm43xx_led leds[BCM43xx_NR_LEDS]; | 657 | struct bcm43xx_led leds[BCM43xx_NR_LEDS]; |
654 | 658 | ||
655 | /* The currently active core. NULL if not initialized, yet. */ | 659 | /* The currently active core. */ |
656 | struct bcm43xx_coreinfo *current_core; | 660 | struct bcm43xx_coreinfo *current_core; |
657 | #ifdef CONFIG_BCM947XX | 661 | #ifdef CONFIG_BCM947XX |
658 | /** current core memory offset */ | 662 | /** current core memory offset */ |
@@ -665,18 +669,15 @@ struct bcm43xx_private { | |||
665 | */ | 669 | */ |
666 | struct bcm43xx_coreinfo core_chipcommon; | 670 | struct bcm43xx_coreinfo core_chipcommon; |
667 | struct bcm43xx_coreinfo core_pci; | 671 | struct bcm43xx_coreinfo core_pci; |
668 | struct bcm43xx_coreinfo core_v90; | ||
669 | struct bcm43xx_coreinfo core_pcmcia; | ||
670 | struct bcm43xx_coreinfo core_ethernet; | ||
671 | struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ]; | 672 | struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ]; |
672 | /* Info about the PHY for each 80211 core. */ | 673 | /* Additional information, specific to the 80211 cores. */ |
673 | struct bcm43xx_phyinfo phy[ BCM43xx_MAX_80211_CORES ]; | 674 | struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ]; |
674 | /* Info about the Radio for each 80211 core. */ | 675 | /* Index of the current 80211 core. If current_core is not |
675 | struct bcm43xx_radioinfo radio[ BCM43xx_MAX_80211_CORES ]; | 676 | * an 80211 core, this is -1. |
676 | /* DMA */ | 677 | */ |
677 | struct bcm43xx_dma dma[ BCM43xx_MAX_80211_CORES ]; | 678 | int current_80211_core_idx; |
678 | /* PIO */ | 679 | /* Number of available 80211 cores. */ |
679 | struct bcm43xx_pio pio[ BCM43xx_MAX_80211_CORES ]; | 680 | int nr_80211_available; |
680 | 681 | ||
681 | u32 chipcommon_capabilities; | 682 | u32 chipcommon_capabilities; |
682 | 683 | ||
@@ -769,18 +770,39 @@ int bcm43xx_using_pio(struct bcm43xx_private *bcm) | |||
769 | # error "Using neither DMA nor PIO? Confused..." | 770 | # error "Using neither DMA nor PIO? Confused..." |
770 | #endif | 771 | #endif |
771 | 772 | ||
772 | 773 | /* Helper functions to access data structures private to the 80211 cores. | |
774 | * Note that we _must_ have an 80211 core mapped when calling | ||
775 | * any of these functions. | ||
776 | */ | ||
773 | static inline | 777 | static inline |
774 | int bcm43xx_num_80211_cores(struct bcm43xx_private *bcm) | 778 | struct bcm43xx_pio * bcm43xx_current_pio(struct bcm43xx_private *bcm) |
775 | { | 779 | { |
776 | int i, cnt = 0; | 780 | assert(bcm43xx_using_pio(bcm)); |
777 | 781 | assert(bcm->current_80211_core_idx >= 0); | |
778 | for (i = 0; i < BCM43xx_MAX_80211_CORES; i++) { | 782 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); |
779 | if (bcm->core_80211[i].flags & BCM43xx_COREFLAG_AVAILABLE) | 783 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].pio); |
780 | cnt++; | 784 | } |
781 | } | 785 | static inline |
782 | 786 | struct bcm43xx_dma * bcm43xx_current_dma(struct bcm43xx_private *bcm) | |
783 | return cnt; | 787 | { |
788 | assert(!bcm43xx_using_pio(bcm)); | ||
789 | assert(bcm->current_80211_core_idx >= 0); | ||
790 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); | ||
791 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].dma); | ||
792 | } | ||
793 | static inline | ||
794 | struct bcm43xx_phyinfo * bcm43xx_current_phy(struct bcm43xx_private *bcm) | ||
795 | { | ||
796 | assert(bcm->current_80211_core_idx >= 0); | ||
797 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); | ||
798 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].phy); | ||
799 | } | ||
800 | static inline | ||
801 | struct bcm43xx_radioinfo * bcm43xx_current_radio(struct bcm43xx_private *bcm) | ||
802 | { | ||
803 | assert(bcm->current_80211_core_idx >= 0); | ||
804 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); | ||
805 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].radio); | ||
784 | } | 806 | } |
785 | 807 | ||
786 | /* Are we running in init_board() context? */ | 808 | /* Are we running in init_board() context? */ |