diff options
author | Michael Buesch <mb@bu3sch.de> | 2006-07-08 16:02:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-07-27 18:19:18 -0400 |
commit | 58e5528ee464d38040b9489e10033c9387a10d56 (patch) | |
tree | 58023ac8bf79757e37a4d05ce7fa63fb3f2388b9 /drivers/net/wireless/bcm43xx/bcm43xx.h | |
parent | 3234faa8abe0c3d6da12cc4a38ce790134c92564 (diff) |
[PATCH] bcm43xx: init routine rewrite
Rewrite of the bcm43xx initialization routines.
This fixes several issues:
* up-down-up-down-up... stale data issue
(May fix some DHCP issues)
* Fix the init vs IRQ handler race (and remove the workaround)
* Fix init for cards with multiple cores (APHY)
As softmac has no internal PHY handling (unlike dscape),
this adds the file "phymode" to sysfs.
The active PHY can be selected by writing either a, b or g
to this file. Current PHY can be determined by reading from it.
* Fix the controller restart code.
Controller restart can now also be triggered through
echo 1 > /debug/bcm43xx/ethX/restart
Signed-off-by: Michael Buesch <mb@bu3sch.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 | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index bee84b58060c..c6ee1e974c84 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -504,6 +504,12 @@ struct bcm43xx_phyinfo { | |||
504 | * This lock is only used by bcm43xx_phy_{un}lock() | 504 | * This lock is only used by bcm43xx_phy_{un}lock() |
505 | */ | 505 | */ |
506 | spinlock_t lock; | 506 | spinlock_t lock; |
507 | |||
508 | /* Firmware. */ | ||
509 | const struct firmware *ucode; | ||
510 | const struct firmware *pcm; | ||
511 | const struct firmware *initvals0; | ||
512 | const struct firmware *initvals1; | ||
507 | }; | 513 | }; |
508 | 514 | ||
509 | 515 | ||
@@ -593,12 +599,14 @@ struct bcm43xx_coreinfo { | |||
593 | u8 available:1, | 599 | u8 available:1, |
594 | enabled:1, | 600 | enabled:1, |
595 | initialized:1; | 601 | initialized:1; |
596 | /** core_id ID number */ | ||
597 | u16 id; | ||
598 | /** core_rev revision number */ | 602 | /** core_rev revision number */ |
599 | u8 rev; | 603 | u8 rev; |
600 | /** Index number for _switch_core() */ | 604 | /** Index number for _switch_core() */ |
601 | u8 index; | 605 | u8 index; |
606 | /** core_id ID number */ | ||
607 | u16 id; | ||
608 | /** Core-specific data. */ | ||
609 | void *priv; | ||
602 | }; | 610 | }; |
603 | 611 | ||
604 | /* Additional information for each 80211 core. */ | 612 | /* Additional information for each 80211 core. */ |
@@ -647,7 +655,10 @@ enum { | |||
647 | BCM43xx_STAT_RESTARTING, /* controller_restart() called. */ | 655 | BCM43xx_STAT_RESTARTING, /* controller_restart() called. */ |
648 | }; | 656 | }; |
649 | #define bcm43xx_status(bcm) atomic_read(&(bcm)->init_status) | 657 | #define bcm43xx_status(bcm) atomic_read(&(bcm)->init_status) |
650 | #define bcm43xx_set_status(bcm, stat) atomic_set(&(bcm)->init_status, (stat)) | 658 | #define bcm43xx_set_status(bcm, stat) do { \ |
659 | atomic_set(&(bcm)->init_status, (stat)); \ | ||
660 | smp_wmb(); \ | ||
661 | } while (0) | ||
651 | 662 | ||
652 | /* *** THEORY OF LOCKING *** | 663 | /* *** THEORY OF LOCKING *** |
653 | * | 664 | * |
@@ -721,10 +732,6 @@ struct bcm43xx_private { | |||
721 | struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ]; | 732 | struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ]; |
722 | /* Additional information, specific to the 80211 cores. */ | 733 | /* Additional information, specific to the 80211 cores. */ |
723 | struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ]; | 734 | struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ]; |
724 | /* Index of the current 80211 core. If current_core is not | ||
725 | * an 80211 core, this is -1. | ||
726 | */ | ||
727 | int current_80211_core_idx; | ||
728 | /* Number of available 80211 cores. */ | 735 | /* Number of available 80211 cores. */ |
729 | int nr_80211_available; | 736 | int nr_80211_available; |
730 | 737 | ||
@@ -761,12 +768,6 @@ struct bcm43xx_private { | |||
761 | struct bcm43xx_key key[54]; | 768 | struct bcm43xx_key key[54]; |
762 | u8 default_key_idx; | 769 | u8 default_key_idx; |
763 | 770 | ||
764 | /* Firmware. */ | ||
765 | const struct firmware *ucode; | ||
766 | const struct firmware *pcm; | ||
767 | const struct firmware *initvals0; | ||
768 | const struct firmware *initvals1; | ||
769 | |||
770 | /* Random Number Generator. */ | 771 | /* Random Number Generator. */ |
771 | struct hwrng rng; | 772 | struct hwrng rng; |
772 | char rng_name[20 + 1]; | 773 | char rng_name[20 + 1]; |
@@ -829,34 +830,33 @@ int bcm43xx_using_pio(struct bcm43xx_private *bcm) | |||
829 | * any of these functions. | 830 | * any of these functions. |
830 | */ | 831 | */ |
831 | static inline | 832 | static inline |
833 | struct bcm43xx_coreinfo_80211 * | ||
834 | bcm43xx_current_80211_priv(struct bcm43xx_private *bcm) | ||
835 | { | ||
836 | assert(bcm->current_core->id == BCM43xx_COREID_80211); | ||
837 | return bcm->current_core->priv; | ||
838 | } | ||
839 | static inline | ||
832 | struct bcm43xx_pio * bcm43xx_current_pio(struct bcm43xx_private *bcm) | 840 | struct bcm43xx_pio * bcm43xx_current_pio(struct bcm43xx_private *bcm) |
833 | { | 841 | { |
834 | assert(bcm43xx_using_pio(bcm)); | 842 | assert(bcm43xx_using_pio(bcm)); |
835 | assert(bcm->current_80211_core_idx >= 0); | 843 | return &(bcm43xx_current_80211_priv(bcm)->pio); |
836 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); | ||
837 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].pio); | ||
838 | } | 844 | } |
839 | static inline | 845 | static inline |
840 | struct bcm43xx_dma * bcm43xx_current_dma(struct bcm43xx_private *bcm) | 846 | struct bcm43xx_dma * bcm43xx_current_dma(struct bcm43xx_private *bcm) |
841 | { | 847 | { |
842 | assert(!bcm43xx_using_pio(bcm)); | 848 | assert(!bcm43xx_using_pio(bcm)); |
843 | assert(bcm->current_80211_core_idx >= 0); | 849 | return &(bcm43xx_current_80211_priv(bcm)->dma); |
844 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); | ||
845 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].dma); | ||
846 | } | 850 | } |
847 | static inline | 851 | static inline |
848 | struct bcm43xx_phyinfo * bcm43xx_current_phy(struct bcm43xx_private *bcm) | 852 | struct bcm43xx_phyinfo * bcm43xx_current_phy(struct bcm43xx_private *bcm) |
849 | { | 853 | { |
850 | assert(bcm->current_80211_core_idx >= 0); | 854 | return &(bcm43xx_current_80211_priv(bcm)->phy); |
851 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); | ||
852 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].phy); | ||
853 | } | 855 | } |
854 | static inline | 856 | static inline |
855 | struct bcm43xx_radioinfo * bcm43xx_current_radio(struct bcm43xx_private *bcm) | 857 | struct bcm43xx_radioinfo * bcm43xx_current_radio(struct bcm43xx_private *bcm) |
856 | { | 858 | { |
857 | assert(bcm->current_80211_core_idx >= 0); | 859 | return &(bcm43xx_current_80211_priv(bcm)->radio); |
858 | assert(bcm->current_80211_core_idx < BCM43xx_MAX_80211_CORES); | ||
859 | return &(bcm->core_80211_ext[bcm->current_80211_core_idx].radio); | ||
860 | } | 860 | } |
861 | 861 | ||
862 | 862 | ||