Add support for AR9280 from FreeBSD HAL
[madwifi/.git] / ath_hal / ah_internal.h
index 17358afa62a9de528024c920babeb4c3279effe0..eb452fae9215c5bff0b62adbbe008c092645a90f 100644 (file)
@@ -319,8 +319,10 @@ struct ath_hal_private {
 #define        ath_hal_disablePCIE(_ah) \
        (_ah)->ah_disablePCIE(_ah)
 
-#define        ath_hal_eepromDetach(_ah) \
-       AH_PRIVATE(_ah)->ah_eepromDetach(_ah)
+#define        ath_hal_eepromDetach(_ah) do { \
+       if (AH_PRIVATE(_ah)->ah_eepromDetach) \
+               AH_PRIVATE(_ah)->ah_eepromDetach(_ah); \
+} while (0)
 #define        ath_hal_eepromGet(_ah, _param, _val) \
        AH_PRIVATE(_ah)->ah_eepromGet(_ah, _param, _val)
 #define        ath_hal_eepromSet(_ah, _param, _val) \
@@ -511,7 +513,7 @@ extern      u_int ath_hal_getctl(struct ath_hal *, HAL_CHANNEL *);
  * based on the current regulatory domain for the specified
  * channel.
  */
-extern u_int ath_hal_getnfcheckrequired(struct ath_hal *, HAL_CHANNEL *);
+extern HAL_BOOL ath_hal_getnfcheckrequired(struct ath_hal *, HAL_CHANNEL *);
 
 /*
  * Map a public channel definition to the corresponding
@@ -580,6 +582,17 @@ extern     void ath_hal_assert_failed(const char* filename,
 #define        HALASSERT(_x)
 #endif /* AH_ASSERT */
 
+/*
+ * Return the h/w frequency for a channel.  This may be
+ * different from ic_freq if this is a GSM device that
+ * takes 2.4GHz frequencies and down-converts them.
+ */
+static OS_INLINE uint16_t
+ath_hal_gethwchannel(struct ath_hal *ah, const HAL_CHANNEL *c)
+{
+       return ath_hal_checkchannel(ah, c)->channel;
+}
+
 /*
  * Convert between microseconds and core system clocks.
  */