aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-07-02 00:09:51 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-07-02 13:44:37 -0400
commit54bd5006b03ee980f6067b4d61c3605b5a5e1d4a (patch)
tree9542e10c03a130c46a34173bebd2cd3e202034f9 /drivers/net/wireless/ath/ath9k/hw.h
parentath9k_hw: sanitize noise floor values properly on all chips (diff)
downloadlinux-dev-54bd5006b03ee980f6067b4d61c3605b5a5e1d4a.tar.xz
linux-dev-54bd5006b03ee980f6067b4d61c3605b5a5e1d4a.zip
ath9k_hw: clean up the noise floor calibration code to reduce code duplication
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to '')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 6a4b69257100..92e2502caafa 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -853,6 +853,12 @@ static inline struct ath_hw_ops *ath9k_hw_ops(struct ath_hw *ah)
return &ah->ops;
}
+static inline int sign_extend(int val, const int nbits)
+{
+ int order = BIT(nbits-1);
+ return (val ^ order) - order;
+}
+
/* Initialization, Detach, Reset */
const char *ath9k_hw_probe(u16 vendorid, u16 devid);
void ath9k_hw_deinit(struct ath_hw *ah);