0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef B43_MAIN_H_
0019 #define B43_MAIN_H_
0020
0021 #include "b43.h"
0022
0023 #define P4D_BYT3S(magic, nr_bytes) u8 __p4dding##magic[nr_bytes]
0024 #define P4D_BYTES(line, nr_bytes) P4D_BYT3S(line, nr_bytes)
0025
0026 #define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes))
0027
0028
0029 extern int b43_modparam_verbose;
0030
0031
0032
0033 enum b43_verbosity {
0034 B43_VERBOSITY_ERROR,
0035 B43_VERBOSITY_WARN,
0036 B43_VERBOSITY_INFO,
0037 B43_VERBOSITY_DEBUG,
0038 __B43_VERBOSITY_AFTERLAST,
0039
0040 B43_VERBOSITY_MAX = __B43_VERBOSITY_AFTERLAST - 1,
0041 #if B43_DEBUG
0042 B43_VERBOSITY_DEFAULT = B43_VERBOSITY_DEBUG,
0043 #else
0044 B43_VERBOSITY_DEFAULT = B43_VERBOSITY_INFO,
0045 #endif
0046 };
0047
0048 static inline int b43_is_cck_rate(int rate)
0049 {
0050 return (rate == B43_CCK_RATE_1MB ||
0051 rate == B43_CCK_RATE_2MB ||
0052 rate == B43_CCK_RATE_5MB || rate == B43_CCK_RATE_11MB);
0053 }
0054
0055 static inline int b43_is_ofdm_rate(int rate)
0056 {
0057 return !b43_is_cck_rate(rate);
0058 }
0059
0060 u8 b43_ieee80211_antenna_sanitize(struct b43_wldev *dev,
0061 u8 antenna_nr);
0062
0063 void b43_tsf_read(struct b43_wldev *dev, u64 * tsf);
0064 void b43_tsf_write(struct b43_wldev *dev, u64 tsf);
0065
0066 u32 b43_shm_read32(struct b43_wldev *dev, u16 routing, u16 offset);
0067 u16 b43_shm_read16(struct b43_wldev *dev, u16 routing, u16 offset);
0068 void b43_shm_write32(struct b43_wldev *dev, u16 routing, u16 offset, u32 value);
0069 void b43_shm_write16(struct b43_wldev *dev, u16 routing, u16 offset, u16 value);
0070
0071 u64 b43_hf_read(struct b43_wldev *dev);
0072 void b43_hf_write(struct b43_wldev *dev, u64 value);
0073
0074 void b43_dummy_transmission(struct b43_wldev *dev, bool ofdm, bool pa_on);
0075
0076 void b43_wireless_core_reset(struct b43_wldev *dev, bool gmode);
0077
0078 void b43_controller_restart(struct b43_wldev *dev, const char *reason);
0079
0080 #define B43_PS_ENABLED (1 << 0)
0081 #define B43_PS_DISABLED (1 << 1)
0082 #define B43_PS_AWAKE (1 << 2)
0083 #define B43_PS_ASLEEP (1 << 3)
0084 void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags);
0085
0086 void b43_wireless_core_phy_pll_reset(struct b43_wldev *dev);
0087
0088 void b43_mac_suspend(struct b43_wldev *dev);
0089 void b43_mac_enable(struct b43_wldev *dev);
0090 void b43_mac_phy_clock_set(struct b43_wldev *dev, bool on);
0091 void b43_mac_switch_freq(struct b43_wldev *dev, u8 spurmode);
0092
0093
0094 struct b43_request_fw_context;
0095 int b43_do_request_fw(struct b43_request_fw_context *ctx, const char *name,
0096 struct b43_firmware_file *fw, bool async);
0097 void b43_do_release_fw(struct b43_firmware_file *fw);
0098
0099 #endif