diff options
Diffstat (limited to 'drivers/net/wireless/b43/b43.h')
-rw-r--r-- | drivers/net/wireless/b43/b43.h | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index 25a78cfb7d15..1cb2ddee9dcf 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -5,12 +5,14 @@ | |||
5 | #include <linux/spinlock.h> | 5 | #include <linux/spinlock.h> |
6 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
7 | #include <linux/hw_random.h> | 7 | #include <linux/hw_random.h> |
8 | #include <linux/bcma/bcma.h> | ||
8 | #include <linux/ssb/ssb.h> | 9 | #include <linux/ssb/ssb.h> |
9 | #include <net/mac80211.h> | 10 | #include <net/mac80211.h> |
10 | 11 | ||
11 | #include "debugfs.h" | 12 | #include "debugfs.h" |
12 | #include "leds.h" | 13 | #include "leds.h" |
13 | #include "rfkill.h" | 14 | #include "rfkill.h" |
15 | #include "bus.h" | ||
14 | #include "lo.h" | 16 | #include "lo.h" |
15 | #include "phy_common.h" | 17 | #include "phy_common.h" |
16 | 18 | ||
@@ -414,6 +416,17 @@ enum { | |||
414 | #define B43_MACCMD_CCA 0x00000008 /* Clear channel assessment */ | 416 | #define B43_MACCMD_CCA 0x00000008 /* Clear channel assessment */ |
415 | #define B43_MACCMD_BGNOISE 0x00000010 /* Background noise */ | 417 | #define B43_MACCMD_BGNOISE 0x00000010 /* Background noise */ |
416 | 418 | ||
419 | /* BCMA 802.11 core specific IO Control (BCMA_IOCTL) flags */ | ||
420 | #define B43_BCMA_IOCTL_PHY_CLKEN 0x00000004 /* PHY Clock Enable */ | ||
421 | #define B43_BCMA_IOCTL_PHY_RESET 0x00000008 /* PHY Reset */ | ||
422 | #define B43_BCMA_IOCTL_MACPHYCLKEN 0x00000010 /* MAC PHY Clock Control Enable */ | ||
423 | #define B43_BCMA_IOCTL_PLLREFSEL 0x00000020 /* PLL Frequency Reference Select */ | ||
424 | #define B43_BCMA_IOCTL_PHY_BW 0x000000C0 /* PHY band width and clock speed mask (N-PHY+ only?) */ | ||
425 | #define B43_BCMA_IOCTL_PHY_BW_10MHZ 0x00000000 /* 10 MHz bandwidth, 40 MHz PHY */ | ||
426 | #define B43_BCMA_IOCTL_PHY_BW_20MHZ 0x00000040 /* 20 MHz bandwidth, 80 MHz PHY */ | ||
427 | #define B43_BCMA_IOCTL_PHY_BW_40MHZ 0x00000080 /* 40 MHz bandwidth, 160 MHz PHY */ | ||
428 | #define B43_BCMA_IOCTL_GMODE 0x00002000 /* G Mode Enable */ | ||
429 | |||
417 | /* 802.11 core specific TM State Low (SSB_TMSLOW) flags */ | 430 | /* 802.11 core specific TM State Low (SSB_TMSLOW) flags */ |
418 | #define B43_TMSLOW_GMODE 0x20000000 /* G Mode Enable */ | 431 | #define B43_TMSLOW_GMODE 0x20000000 /* G Mode Enable */ |
419 | #define B43_TMSLOW_PHY_BANDWIDTH 0x00C00000 /* PHY band width and clock speed mask (N-PHY only) */ | 432 | #define B43_TMSLOW_PHY_BANDWIDTH 0x00C00000 /* PHY band width and clock speed mask (N-PHY only) */ |
@@ -707,7 +720,8 @@ enum { | |||
707 | 720 | ||
708 | /* Data structure for one wireless device (802.11 core) */ | 721 | /* Data structure for one wireless device (802.11 core) */ |
709 | struct b43_wldev { | 722 | struct b43_wldev { |
710 | struct ssb_device *sdev; | 723 | struct ssb_device *sdev; /* TODO: remove when b43_bus_dev is ready */ |
724 | struct b43_bus_dev *dev; | ||
711 | struct b43_wl *wl; | 725 | struct b43_wl *wl; |
712 | 726 | ||
713 | /* The device initialization status. | 727 | /* The device initialization status. |
@@ -879,36 +893,59 @@ static inline enum ieee80211_band b43_current_band(struct b43_wl *wl) | |||
879 | return wl->hw->conf.channel->band; | 893 | return wl->hw->conf.channel->band; |
880 | } | 894 | } |
881 | 895 | ||
896 | static inline int b43_bus_may_powerdown(struct b43_wldev *wldev) | ||
897 | { | ||
898 | return wldev->dev->bus_may_powerdown(wldev->dev); | ||
899 | } | ||
900 | static inline int b43_bus_powerup(struct b43_wldev *wldev, bool dynamic_pctl) | ||
901 | { | ||
902 | return wldev->dev->bus_powerup(wldev->dev, dynamic_pctl); | ||
903 | } | ||
904 | static inline int b43_device_is_enabled(struct b43_wldev *wldev) | ||
905 | { | ||
906 | return wldev->dev->device_is_enabled(wldev->dev); | ||
907 | } | ||
908 | static inline void b43_device_enable(struct b43_wldev *wldev, | ||
909 | u32 core_specific_flags) | ||
910 | { | ||
911 | wldev->dev->device_enable(wldev->dev, core_specific_flags); | ||
912 | } | ||
913 | static inline void b43_device_disable(struct b43_wldev *wldev, | ||
914 | u32 core_specific_flags) | ||
915 | { | ||
916 | wldev->dev->device_disable(wldev->dev, core_specific_flags); | ||
917 | } | ||
918 | |||
882 | static inline u16 b43_read16(struct b43_wldev *dev, u16 offset) | 919 | static inline u16 b43_read16(struct b43_wldev *dev, u16 offset) |
883 | { | 920 | { |
884 | return ssb_read16(dev->sdev, offset); | 921 | return dev->dev->read16(dev->dev, offset); |
885 | } | 922 | } |
886 | 923 | ||
887 | static inline void b43_write16(struct b43_wldev *dev, u16 offset, u16 value) | 924 | static inline void b43_write16(struct b43_wldev *dev, u16 offset, u16 value) |
888 | { | 925 | { |
889 | ssb_write16(dev->sdev, offset, value); | 926 | dev->dev->write16(dev->dev, offset, value); |
890 | } | 927 | } |
891 | 928 | ||
892 | static inline u32 b43_read32(struct b43_wldev *dev, u16 offset) | 929 | static inline u32 b43_read32(struct b43_wldev *dev, u16 offset) |
893 | { | 930 | { |
894 | return ssb_read32(dev->sdev, offset); | 931 | return dev->dev->read32(dev->dev, offset); |
895 | } | 932 | } |
896 | 933 | ||
897 | static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value) | 934 | static inline void b43_write32(struct b43_wldev *dev, u16 offset, u32 value) |
898 | { | 935 | { |
899 | ssb_write32(dev->sdev, offset, value); | 936 | dev->dev->write32(dev->dev, offset, value); |
900 | } | 937 | } |
901 | 938 | ||
902 | static inline void b43_block_read(struct b43_wldev *dev, void *buffer, | 939 | static inline void b43_block_read(struct b43_wldev *dev, void *buffer, |
903 | size_t count, u16 offset, u8 reg_width) | 940 | size_t count, u16 offset, u8 reg_width) |
904 | { | 941 | { |
905 | ssb_block_read(dev->sdev, buffer, count, offset, reg_width); | 942 | dev->dev->block_read(dev->dev, buffer, count, offset, reg_width); |
906 | } | 943 | } |
907 | 944 | ||
908 | static inline void b43_block_write(struct b43_wldev *dev, const void *buffer, | 945 | static inline void b43_block_write(struct b43_wldev *dev, const void *buffer, |
909 | size_t count, u16 offset, u8 reg_width) | 946 | size_t count, u16 offset, u8 reg_width) |
910 | { | 947 | { |
911 | ssb_block_write(dev->sdev, buffer, count, offset, reg_width); | 948 | dev->dev->block_write(dev->dev, buffer, count, offset, reg_width); |
912 | } | 949 | } |
913 | 950 | ||
914 | static inline bool b43_using_pio_transfers(struct b43_wldev *dev) | 951 | static inline bool b43_using_pio_transfers(struct b43_wldev *dev) |