mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-19 14:54:24 +00:00
Add another HAL method - ah_isFastClockEnabled - which returns AH_TRUE
if 5ghz fast clock is enabled in the current operating mode. It's slightly dirty, but it's part of the reference HAL and used by the (currently closed-source) radar event code to map radar pulses back to microsecond durations. Obtained from: Atheros Approved by: re (kib, blanket)
This commit is contained in:
parent
6c8ea37c68
commit
60829c4817
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=224709
|
@ -958,6 +958,7 @@ struct ath_hal {
|
|||
HAL_BOOL __ahdecl(*ah_procRadarEvent)(struct ath_hal *ah,
|
||||
struct ath_rx_status *rxs, uint64_t fulltsf,
|
||||
const char *buf, HAL_DFS_EVENT *event);
|
||||
HAL_BOOL __ahdecl(*ah_isFastClockEnabled)(struct ath_hal *ah);
|
||||
|
||||
/* Key Cache Functions */
|
||||
uint32_t __ahdecl(*ah_getKeyCacheSize)(struct ath_hal*);
|
||||
|
|
|
@ -625,5 +625,6 @@ extern void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
|
|||
extern HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah,
|
||||
struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf,
|
||||
HAL_DFS_EVENT *event);
|
||||
extern HAL_BOOL ar5212IsFastClockEnabled(struct ath_hal *ah);
|
||||
|
||||
#endif /* _ATH_AR5212_H_ */
|
||||
|
|
|
@ -133,6 +133,7 @@ static const struct ath_hal_private ar5212hal = {{
|
|||
.ah_enableDfs = ar5212EnableDfs,
|
||||
.ah_getDfsThresh = ar5212GetDfsThresh,
|
||||
.ah_procRadarEvent = ar5212ProcessRadarEvent,
|
||||
.ah_isFastClockEnabled = ar5212IsFastClockEnabled,
|
||||
|
||||
/* Key Cache Functions */
|
||||
.ah_getKeyCacheSize = ar5212GetKeyCacheSize,
|
||||
|
|
|
@ -1222,3 +1222,13 @@ ar5212ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs,
|
|||
|
||||
return AH_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return whether 5GHz fast-clock (44MHz) is enabled.
|
||||
* It's always disabled for AR5212 series NICs.
|
||||
*/
|
||||
HAL_BOOL
|
||||
ar5212IsFastClockEnabled(struct ath_hal *ah)
|
||||
{
|
||||
return AH_FALSE;
|
||||
}
|
||||
|
|
|
@ -208,6 +208,7 @@ extern void ar5416GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe);
|
|||
extern HAL_BOOL ar5416ProcessRadarEvent(struct ath_hal *ah,
|
||||
struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf,
|
||||
HAL_DFS_EVENT *event);
|
||||
extern HAL_BOOL ar5416IsFastClockEnabled(struct ath_hal *ah);
|
||||
|
||||
extern HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode,
|
||||
int setChip);
|
||||
|
|
|
@ -150,6 +150,7 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc,
|
|||
ah->ah_enableDfs = ar5416EnableDfs;
|
||||
ah->ah_getDfsThresh = ar5416GetDfsThresh;
|
||||
ah->ah_procRadarEvent = ar5416ProcessRadarEvent;
|
||||
ah->ah_isFastClockEnabled = ar5416IsFastClockEnabled;
|
||||
|
||||
/* Power Management Functions */
|
||||
ah->ah_setPowerMode = ar5416SetPowerMode;
|
||||
|
|
|
@ -731,3 +731,15 @@ ar5416ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs,
|
|||
*/
|
||||
return AH_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return whether fast-clock is currently enabled for this
|
||||
* channel.
|
||||
*/
|
||||
HAL_BOOL
|
||||
ar5416IsFastClockEnabled(struct ath_hal *ah)
|
||||
{
|
||||
struct ath_hal_private *ahp = AH_PRIVATE(ah);
|
||||
|
||||
return IS_5GHZ_FAST_CLOCK_EN(ah, ahp->ah_curchan);
|
||||
}
|
||||
|
|
|
@ -712,6 +712,8 @@ void ath_intr(void *);
|
|||
((*(_ah)->ah_getDfsThresh)((_ah), (_param)))
|
||||
#define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \
|
||||
((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), (_buf), (_event)))
|
||||
#define ath_hal_isfastclockenabled(_ah) \
|
||||
((*(_ah)->ah_isFastClockEnabled((_ah))
|
||||
|
||||
#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \
|
||||
((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type)))
|
||||
|
|
Loading…
Reference in a new issue