Home | History | Annotate | Line # | Download | only in ar5312
ar5312.h revision 1.2.10.2
      1  1.2.10.2  snj /*
      2  1.2.10.2  snj  * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
      3  1.2.10.2  snj  * Copyright (c) 2002-2008 Atheros Communications, Inc.
      4  1.2.10.2  snj  *
      5  1.2.10.2  snj  * Permission to use, copy, modify, and/or distribute this software for any
      6  1.2.10.2  snj  * purpose with or without fee is hereby granted, provided that the above
      7  1.2.10.2  snj  * copyright notice and this permission notice appear in all copies.
      8  1.2.10.2  snj  *
      9  1.2.10.2  snj  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     10  1.2.10.2  snj  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     11  1.2.10.2  snj  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     12  1.2.10.2  snj  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     13  1.2.10.2  snj  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     14  1.2.10.2  snj  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     15  1.2.10.2  snj  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     16  1.2.10.2  snj  *
     17  1.2.10.2  snj  * $Id: ar5312.h,v 1.2.10.2 2009/08/07 06:43:44 snj Exp $
     18  1.2.10.2  snj  */
     19  1.2.10.2  snj #ifndef _ATH_AR5312_H_
     20  1.2.10.2  snj #define _ATH_AR5312_H_
     21  1.2.10.2  snj 
     22  1.2.10.2  snj #include "ah_soc.h"
     23  1.2.10.2  snj #include "ar5212/ar5212.h"
     24  1.2.10.2  snj 
     25  1.2.10.2  snj #define AR5312_UNIT(_ah) \
     26  1.2.10.2  snj 	(((const struct ar531x_config *)((_ah)->ah_st))->unit)
     27  1.2.10.2  snj #define AR5312_BOARDCONFIG(_ah) \
     28  1.2.10.2  snj 	(((const struct ar531x_config *)((_ah)->ah_st))->board)
     29  1.2.10.2  snj #define AR5312_RADIOCONFIG(_ah) \
     30  1.2.10.2  snj 	(((const struct ar531x_config *)((_ah)->ah_st))->radio)
     31  1.2.10.2  snj 
     32  1.2.10.2  snj #define	IS_5312_2_X(ah) \
     33  1.2.10.2  snj 	(AH_PRIVATE(ah)->ah_macVersion == AR_SREV_VERSION_VENICE && \
     34  1.2.10.2  snj 	 (AH_PRIVATE(ah)->ah_macRev == 2 || AH_PRIVATE(ah)->ah_macRev == 7))
     35  1.2.10.2  snj #define IS_5315(ah) \
     36  1.2.10.2  snj 	(AH_PRIVATE(ah)->ah_devid == AR5212_AR2315_REV6 || \
     37  1.2.10.2  snj 	 AH_PRIVATE(ah)->ah_devid == AR5212_AR2315_REV7 || \
     38  1.2.10.2  snj 	 AH_PRIVATE(ah)->ah_devid == AR5212_AR2317_REV1 || \
     39  1.2.10.2  snj 	 AH_PRIVATE(ah)->ah_devid == AR5212_AR2317_REV2)
     40  1.2.10.2  snj 
     41  1.2.10.2  snj extern  HAL_BOOL ar5312IsInterruptPending(struct ath_hal *ah);
     42  1.2.10.2  snj 
     43  1.2.10.2  snj /* AR5312 */
     44  1.2.10.2  snj extern	HAL_BOOL ar5312GpioCfgOutput(struct ath_hal *, uint32_t gpio);
     45  1.2.10.2  snj extern	HAL_BOOL ar5312GpioCfgInput(struct ath_hal *, uint32_t gpio);
     46  1.2.10.2  snj extern	HAL_BOOL ar5312GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val);
     47  1.2.10.2  snj extern	uint32_t ar5312GpioGet(struct ath_hal *ah, uint32_t gpio);
     48  1.2.10.2  snj extern	void ar5312GpioSetIntr(struct ath_hal *ah, u_int, uint32_t ilevel);
     49  1.2.10.2  snj 
     50  1.2.10.2  snj /* AR2315+ */
     51  1.2.10.2  snj extern	HAL_BOOL ar5315GpioCfgOutput(struct ath_hal *, uint32_t gpio);
     52  1.2.10.2  snj extern	HAL_BOOL ar5315GpioCfgInput(struct ath_hal *, uint32_t gpio);
     53  1.2.10.2  snj extern	HAL_BOOL ar5315GpioSet(struct ath_hal *, uint32_t gpio, uint32_t val);
     54  1.2.10.2  snj extern	uint32_t ar5315GpioGet(struct ath_hal *ah, uint32_t gpio);
     55  1.2.10.2  snj extern	void ar5315GpioSetIntr(struct ath_hal *ah, u_int, uint32_t ilevel);
     56  1.2.10.2  snj 
     57  1.2.10.2  snj extern  void ar5312SetLedState(struct ath_hal *ah, HAL_LED_STATE state);
     58  1.2.10.2  snj extern  HAL_BOOL ar5312DetectCardPresent(struct ath_hal *ah);
     59  1.2.10.2  snj extern  void ar5312SetupClock(struct ath_hal *ah, HAL_OPMODE opmode);
     60  1.2.10.2  snj extern  void ar5312RestoreClock(struct ath_hal *ah, HAL_OPMODE opmode);
     61  1.2.10.2  snj extern  void ar5312DumpState(struct ath_hal *ah);
     62  1.2.10.2  snj extern  HAL_BOOL ar5312Reset(struct ath_hal *ah, HAL_OPMODE opmode,
     63  1.2.10.2  snj               HAL_CHANNEL *chan, HAL_BOOL bChannelChange, HAL_STATUS *status);
     64  1.2.10.2  snj extern  HAL_BOOL ar5312ChipReset(struct ath_hal *ah, HAL_CHANNEL *chan);
     65  1.2.10.2  snj extern  HAL_BOOL ar5312SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode,
     66  1.2.10.2  snj                                     int setChip);
     67  1.2.10.2  snj extern  HAL_BOOL ar5312PhyDisable(struct ath_hal *ah);
     68  1.2.10.2  snj extern  HAL_BOOL ar5312Disable(struct ath_hal *ah);
     69  1.2.10.2  snj extern  HAL_BOOL ar5312MacReset(struct ath_hal *ah, unsigned int RCMask);
     70  1.2.10.2  snj extern  uint32_t ar5312GetPowerMode(struct ath_hal *ah);
     71  1.2.10.2  snj extern  HAL_BOOL ar5312GetPowerStatus(struct ath_hal *ah);
     72  1.2.10.2  snj 
     73  1.2.10.2  snj /* BSP functions */
     74  1.2.10.2  snj extern	HAL_BOOL ar5312EepromRead(struct ath_hal *, u_int off, uint16_t *data);
     75  1.2.10.2  snj extern	HAL_BOOL ar5312EepromWrite(struct ath_hal *, u_int off, uint16_t data);
     76  1.2.10.2  snj 
     77  1.2.10.2  snj #endif	/* _ATH_AR3212_H_ */
     78