1b7d5e03cSMatthew Dillon /*
2b7d5e03cSMatthew Dillon * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting
3b7d5e03cSMatthew Dillon * Copyright (c) 2002-2008 Atheros Communications, Inc.
4b7d5e03cSMatthew Dillon *
5b7d5e03cSMatthew Dillon * Permission to use, copy, modify, and/or distribute this software for any
6b7d5e03cSMatthew Dillon * purpose with or without fee is hereby granted, provided that the above
7b7d5e03cSMatthew Dillon * copyright notice and this permission notice appear in all copies.
8b7d5e03cSMatthew Dillon *
9b7d5e03cSMatthew Dillon * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10b7d5e03cSMatthew Dillon * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11b7d5e03cSMatthew Dillon * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12b7d5e03cSMatthew Dillon * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13b7d5e03cSMatthew Dillon * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14b7d5e03cSMatthew Dillon * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15b7d5e03cSMatthew Dillon * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16b7d5e03cSMatthew Dillon *
17b7d5e03cSMatthew Dillon * $FreeBSD: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c 235972 2012-05-25 05:01:27Z adrian $
18b7d5e03cSMatthew Dillon */
19b7d5e03cSMatthew Dillon #include "opt_ah.h"
20b7d5e03cSMatthew Dillon
21b7d5e03cSMatthew Dillon #include "ah.h"
22b7d5e03cSMatthew Dillon #include "ah_internal.h"
23b7d5e03cSMatthew Dillon #include "ah_devid.h"
24b7d5e03cSMatthew Dillon
25b7d5e03cSMatthew Dillon #include "ar9300/ar9300.h"
26b7d5e03cSMatthew Dillon #include "ar9300/ar9300reg.h"
27b7d5e03cSMatthew Dillon #include "ar9300/ar9300phy.h"
28b7d5e03cSMatthew Dillon
29b7d5e03cSMatthew Dillon #include "ar9300/ar9300_stub.h"
30b7d5e03cSMatthew Dillon #include "ar9300/ar9300_stub_funcs.h"
31b7d5e03cSMatthew Dillon
32b7d5e03cSMatthew Dillon void
ar9300_set_stub_functions(struct ath_hal * ah)33b7d5e03cSMatthew Dillon ar9300_set_stub_functions(struct ath_hal *ah)
34b7d5e03cSMatthew Dillon {
35b7d5e03cSMatthew Dillon
36*848b370cSMatthew Dillon // ath_hal_printf(ah, "%s: setting stub functions\n", __func__);
37b7d5e03cSMatthew Dillon
38b7d5e03cSMatthew Dillon ah->ah_getRateTable = ar9300_Stub_GetRateTable;
39b7d5e03cSMatthew Dillon // ah->ah_detach = ar9300_Stub_detach;
40b7d5e03cSMatthew Dillon
41b7d5e03cSMatthew Dillon /* Reset Functions */
42b7d5e03cSMatthew Dillon ah->ah_reset = ar9300_Stub_Reset;
43b7d5e03cSMatthew Dillon ah->ah_phyDisable = ar9300_Stub_PhyDisable;
44b7d5e03cSMatthew Dillon ah->ah_disable = ar9300_Stub_Disable;
45b7d5e03cSMatthew Dillon ah->ah_configPCIE = ar9300_Stub_ConfigPCIE;
46b7d5e03cSMatthew Dillon ah->ah_disablePCIE = ar9300_Stub_DisablePCIE;
47b7d5e03cSMatthew Dillon ah->ah_setPCUConfig = ar9300_Stub_SetPCUConfig;
48b7d5e03cSMatthew Dillon ah->ah_perCalibration = ar9300_Stub_PerCalibration;
49b7d5e03cSMatthew Dillon ah->ah_perCalibrationN = ar9300_Stub_PerCalibrationN;
50b7d5e03cSMatthew Dillon ah->ah_resetCalValid = ar9300_Stub_ResetCalValid;
51b7d5e03cSMatthew Dillon ah->ah_setTxPowerLimit = ar9300_Stub_SetTxPowerLimit;
52b7d5e03cSMatthew Dillon ah->ah_getChanNoise = ath_hal_getChanNoise;
53b7d5e03cSMatthew Dillon
54b7d5e03cSMatthew Dillon /* Transmit functions */
55b7d5e03cSMatthew Dillon ah->ah_updateTxTrigLevel = ar9300_Stub_UpdateTxTrigLevel;
56b7d5e03cSMatthew Dillon ah->ah_setupTxQueue = ar9300_Stub_SetupTxQueue;
57b7d5e03cSMatthew Dillon ah->ah_setTxQueueProps = ar9300_Stub_SetTxQueueProps;
58b7d5e03cSMatthew Dillon ah->ah_getTxQueueProps = ar9300_Stub_GetTxQueueProps;
59b7d5e03cSMatthew Dillon ah->ah_releaseTxQueue = ar9300_Stub_ReleaseTxQueue;
60b7d5e03cSMatthew Dillon ah->ah_resetTxQueue = ar9300_Stub_ResetTxQueue;
61b7d5e03cSMatthew Dillon ah->ah_getTxDP = ar9300_Stub_GetTxDP;
62b7d5e03cSMatthew Dillon ah->ah_setTxDP = ar9300_Stub_SetTxDP;
63b7d5e03cSMatthew Dillon ah->ah_numTxPending = ar9300_Stub_NumTxPending;
64b7d5e03cSMatthew Dillon ah->ah_startTxDma = ar9300_Stub_StartTxDma;
65b7d5e03cSMatthew Dillon ah->ah_stopTxDma = ar9300_Stub_StopTxDma;
66b7d5e03cSMatthew Dillon ah->ah_setupTxDesc = ar9300_Stub_SetupTxDesc;
67b7d5e03cSMatthew Dillon ah->ah_setupXTxDesc = ar9300_Stub_SetupXTxDesc;
68b7d5e03cSMatthew Dillon ah->ah_fillTxDesc = ar9300_Stub_FillTxDesc;
69b7d5e03cSMatthew Dillon ah->ah_procTxDesc = ar9300_Stub_ProcTxDesc;
70b7d5e03cSMatthew Dillon ah->ah_getTxIntrQueue = ar9300_Stub_GetTxIntrQueue;
71b7d5e03cSMatthew Dillon ah->ah_reqTxIntrDesc = ar9300_Stub_IntrReqTxDesc;
72b7d5e03cSMatthew Dillon ah->ah_getTxCompletionRates = ar9300_Stub_GetTxCompletionRates;
73b7d5e03cSMatthew Dillon
74b7d5e03cSMatthew Dillon /* RX Functions */
75b7d5e03cSMatthew Dillon ah->ah_getRxDP = ar9300_Stub_GetRxDP;
76b7d5e03cSMatthew Dillon ah->ah_setRxDP = ar9300_Stub_SetRxDP;
77b7d5e03cSMatthew Dillon ah->ah_enableReceive = ar9300_Stub_EnableReceive;
78b7d5e03cSMatthew Dillon ah->ah_stopDmaReceive = ar9300_Stub_StopDmaReceive;
79b7d5e03cSMatthew Dillon ah->ah_startPcuReceive = ar9300_Stub_StartPcuReceive;
80b7d5e03cSMatthew Dillon ah->ah_stopPcuReceive = ar9300_Stub_StopPcuReceive;
81b7d5e03cSMatthew Dillon ah->ah_setMulticastFilter = ar9300_Stub_SetMulticastFilter;
82b7d5e03cSMatthew Dillon ah->ah_setMulticastFilterIndex = ar9300_Stub_SetMulticastFilterIndex;
83b7d5e03cSMatthew Dillon ah->ah_clrMulticastFilterIndex = ar9300_Stub_ClrMulticastFilterIndex;
84b7d5e03cSMatthew Dillon ah->ah_getRxFilter = ar9300_Stub_GetRxFilter;
85b7d5e03cSMatthew Dillon ah->ah_setRxFilter = ar9300_Stub_SetRxFilter;
86b7d5e03cSMatthew Dillon ah->ah_setupRxDesc = ar9300_Stub_SetupRxDesc;
87b7d5e03cSMatthew Dillon ah->ah_procRxDesc = ar9300_Stub_ProcRxDesc;
88b7d5e03cSMatthew Dillon ah->ah_rxMonitor = ar9300_Stub_RxMonitor;
89b7d5e03cSMatthew Dillon ah->ah_aniPoll = ar9300_Stub_AniPoll;
90b7d5e03cSMatthew Dillon ah->ah_procMibEvent = ar9300_Stub_ProcessMibIntr;
91b7d5e03cSMatthew Dillon
92b7d5e03cSMatthew Dillon /* Misc Functions */
93b7d5e03cSMatthew Dillon ah->ah_getCapability = ar9300_Stub_GetCapability;
94b7d5e03cSMatthew Dillon ah->ah_setCapability = ar9300_Stub_SetCapability;
95b7d5e03cSMatthew Dillon ah->ah_getDiagState = ar9300_Stub_GetDiagState;
96b7d5e03cSMatthew Dillon ah->ah_getMacAddress = ar9300_Stub_GetMacAddress;
97b7d5e03cSMatthew Dillon ah->ah_setMacAddress = ar9300_Stub_SetMacAddress;
98b7d5e03cSMatthew Dillon ah->ah_getBssIdMask = ar9300_Stub_GetBssIdMask;
99b7d5e03cSMatthew Dillon ah->ah_setBssIdMask = ar9300_Stub_SetBssIdMask;
100b7d5e03cSMatthew Dillon ah->ah_setRegulatoryDomain = ar9300_Stub_SetRegulatoryDomain;
101b7d5e03cSMatthew Dillon ah->ah_setLedState = ar9300_Stub_SetLedState;
102b7d5e03cSMatthew Dillon ah->ah_writeAssocid = ar9300_Stub_WriteAssocid;
103b7d5e03cSMatthew Dillon ah->ah_gpioCfgInput = ar9300_Stub_GpioCfgInput;
104b7d5e03cSMatthew Dillon ah->ah_gpioCfgOutput = ar9300_Stub_GpioCfgOutput;
105b7d5e03cSMatthew Dillon ah->ah_gpioGet = ar9300_Stub_GpioGet;
106b7d5e03cSMatthew Dillon ah->ah_gpioSet = ar9300_Stub_GpioSet;
107b7d5e03cSMatthew Dillon ah->ah_gpioSetIntr = ar9300_Stub_GpioSetIntr;
108b7d5e03cSMatthew Dillon ah->ah_getTsf32 = ar9300_Stub_GetTsf32;
109b7d5e03cSMatthew Dillon ah->ah_getTsf64 = ar9300_Stub_GetTsf64;
110b7d5e03cSMatthew Dillon ah->ah_resetTsf = ar9300_Stub_ResetTsf;
111b7d5e03cSMatthew Dillon ah->ah_detectCardPresent = ar9300_Stub_DetectCardPresent;
112b7d5e03cSMatthew Dillon ah->ah_updateMibCounters = ar9300_Stub_UpdateMibCounters;
113b7d5e03cSMatthew Dillon ah->ah_getRfGain = ar9300_Stub_GetRfgain;
114b7d5e03cSMatthew Dillon ah->ah_getDefAntenna = ar9300_Stub_GetDefAntenna;
115b7d5e03cSMatthew Dillon ah->ah_setDefAntenna = ar9300_Stub_SetDefAntenna;
116b7d5e03cSMatthew Dillon ah->ah_getAntennaSwitch = ar9300_Stub_GetAntennaSwitch;
117b7d5e03cSMatthew Dillon ah->ah_setAntennaSwitch = ar9300_Stub_SetAntennaSwitch;
118b7d5e03cSMatthew Dillon ah->ah_setSifsTime = ar9300_Stub_SetSifsTime;
119b7d5e03cSMatthew Dillon ah->ah_getSifsTime = ar9300_Stub_GetSifsTime;
120b7d5e03cSMatthew Dillon ah->ah_setSlotTime = ar9300_Stub_SetSlotTime;
121b7d5e03cSMatthew Dillon ah->ah_getSlotTime = ar9300_Stub_GetSlotTime;
122b7d5e03cSMatthew Dillon ah->ah_setAckTimeout = ar9300_Stub_SetAckTimeout;
123b7d5e03cSMatthew Dillon ah->ah_getAckTimeout = ar9300_Stub_GetAckTimeout;
124b7d5e03cSMatthew Dillon ah->ah_setAckCTSRate = ar9300_Stub_SetAckCTSRate;
125b7d5e03cSMatthew Dillon ah->ah_getAckCTSRate = ar9300_Stub_GetAckCTSRate;
126b7d5e03cSMatthew Dillon ah->ah_setCTSTimeout = ar9300_Stub_SetCTSTimeout;
127b7d5e03cSMatthew Dillon ah->ah_getCTSTimeout = ar9300_Stub_GetCTSTimeout;
128b7d5e03cSMatthew Dillon ah->ah_setDecompMask = ar9300_Stub_SetDecompMask;
129b7d5e03cSMatthew Dillon ah->ah_setCoverageClass = ar9300_Stub_SetCoverageClass;
130b7d5e03cSMatthew Dillon ah->ah_setQuiet = ar9300_Stub_SetQuiet;
131b7d5e03cSMatthew Dillon ah->ah_getMibCycleCounts = ar9300_Stub_GetMibCycleCounts;
132b7d5e03cSMatthew Dillon
133b7d5e03cSMatthew Dillon /* DFS Functions */
134b7d5e03cSMatthew Dillon ah->ah_enableDfs = ar9300_Stub_EnableDfs;
135b7d5e03cSMatthew Dillon ah->ah_getDfsThresh = ar9300_Stub_GetDfsThresh;
136b7d5e03cSMatthew Dillon ah->ah_procRadarEvent = ar9300_Stub_ProcessRadarEvent;
137b7d5e03cSMatthew Dillon ah->ah_isFastClockEnabled = ar9300_Stub_IsFastClockEnabled;
138b7d5e03cSMatthew Dillon ah->ah_get11nExtBusy = ar9300_Stub_Get11nExtBusy;
139b7d5e03cSMatthew Dillon
140b7d5e03cSMatthew Dillon /* Key Cache Functions */
141b7d5e03cSMatthew Dillon ah->ah_getKeyCacheSize = ar9300_Stub_GetKeyCacheSize;
142b7d5e03cSMatthew Dillon ah->ah_resetKeyCacheEntry = ar9300_Stub_ResetKeyCacheEntry;
143b7d5e03cSMatthew Dillon ah->ah_isKeyCacheEntryValid = ar9300_Stub_IsKeyCacheEntryValid;
144b7d5e03cSMatthew Dillon ah->ah_setKeyCacheEntry = ar9300_Stub_SetKeyCacheEntry;
145b7d5e03cSMatthew Dillon ah->ah_setKeyCacheEntryMac = ar9300_Stub_SetKeyCacheEntryMac;
146b7d5e03cSMatthew Dillon
147b7d5e03cSMatthew Dillon /* Power Management Functions */
148b7d5e03cSMatthew Dillon ah->ah_setPowerMode = ar9300_Stub_SetPowerMode;
149b7d5e03cSMatthew Dillon ah->ah_getPowerMode = ar9300_Stub_GetPowerMode;
150b7d5e03cSMatthew Dillon
151b7d5e03cSMatthew Dillon /* Beacon Functions */
152b7d5e03cSMatthew Dillon ah->ah_setBeaconTimers = ar9300_Stub_SetBeaconTimers;
153b7d5e03cSMatthew Dillon ah->ah_beaconInit = ar9300_Stub_BeaconInit;
154b7d5e03cSMatthew Dillon ah->ah_setStationBeaconTimers = ar9300_Stub_SetStaBeaconTimers;
155b7d5e03cSMatthew Dillon ah->ah_resetStationBeaconTimers = ar9300_Stub_ResetStaBeaconTimers;
156b7d5e03cSMatthew Dillon ah->ah_getNextTBTT = ar9300_Stub_GetNextTBTT;
157b7d5e03cSMatthew Dillon
158b7d5e03cSMatthew Dillon /* Interrupt Functions */
159b7d5e03cSMatthew Dillon ah->ah_isInterruptPending = ar9300_Stub_IsInterruptPending;
160b7d5e03cSMatthew Dillon ah->ah_getPendingInterrupts = ar9300_Stub_GetPendingInterrupts;
161b7d5e03cSMatthew Dillon ah->ah_getInterrupts = ar9300_Stub_GetInterrupts;
162b7d5e03cSMatthew Dillon ah->ah_setInterrupts = ar9300_Stub_SetInterrupts;
163b7d5e03cSMatthew Dillon
164b7d5e03cSMatthew Dillon AH_PRIVATE(ah)->ah_getChannelEdges = ar9300_Stub_GetChannelEdges;
165b7d5e03cSMatthew Dillon AH_PRIVATE(ah)->ah_getWirelessModes = ar9300_Stub_GetWirelessModes;
166b7d5e03cSMatthew Dillon AH_PRIVATE(ah)->ah_eepromRead = ar9300_Stub_EepromRead;
167b7d5e03cSMatthew Dillon #ifdef AH_SUPPORT_WRITE_EEPROM
168b7d5e03cSMatthew Dillon AH_PRIVATE(ah)->ah_eepromWrite = ar9300_Stub_EepromWrite;
169b7d5e03cSMatthew Dillon #endif
170b7d5e03cSMatthew Dillon AH_PRIVATE(ah)->ah_getChipPowerLimits = ar9300_Stub_GetChipPowerLimits;
171b7d5e03cSMatthew Dillon }
172