1 //------------------------------------------------------------------------------
2 // Copyright (c) 2010 Atheros Corporation. All rights reserved.
5 // Permission to use, copy, modify, and/or distribute this software for any
6 // purpose with or without fee is hereby granted, provided that the above
7 // copyright notice and this permission notice appear in all copies.
9 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 //------------------------------------------------------------------------------
19 //==============================================================================
20 // Author(s): ="Atheros"
21 //==============================================================================
26 #include "htc_packet.h"
29 /* structure that is the state information for the default credit distribution callback
30 * drivers should instantiate (zero-init as well) this structure in their driver instance
31 * and pass it as a context to the HTC credit distribution functions */
32 struct common_credit_state_info
{
33 int TotalAvailableCredits
; /* total credits in the system at startup */
34 int CurrentFreeCredits
; /* credits available in the pool that have not been
35 given out to endpoints */
36 struct htc_endpoint_credit_dist
*pLowestPriEpDist
; /* pointer to the lowest priority endpoint dist struct */
39 struct hci_transport_callbacks
{
40 s32 (*setupTransport
)(void *ar
);
41 void (*cleanupTransport
)(void *ar
);
44 struct hci_transport_misc_handles
{
50 /* HTC TX packet tagging definitions */
51 #define AR6K_CONTROL_PKT_TAG HTC_TX_PACKET_TAG_USER_DEFINED
52 #define AR6K_DATA_PKT_TAG (AR6K_CONTROL_PKT_TAG + 1)
54 #define AR6002_VERSION_REV1 0x20000086
55 #define AR6002_VERSION_REV2 0x20000188
56 #define AR6003_VERSION_REV1 0x300002ba
57 #define AR6003_VERSION_REV2 0x30000384
59 #define AR6002_CUST_DATA_SIZE 112
60 #define AR6003_CUST_DATA_SIZE 16
66 /* OS-independent APIs */
67 int ar6000_setup_credit_dist(HTC_HANDLE HTCHandle
, struct common_credit_state_info
*pCredInfo
);
69 int ar6000_ReadRegDiag(struct hif_device
*hifDevice
, u32
*address
, u32
*data
);
71 int ar6000_WriteRegDiag(struct hif_device
*hifDevice
, u32
*address
, u32
*data
);
73 int ar6000_ReadDataDiag(struct hif_device
*hifDevice
, u32 address
, u8
*data
, u32 length
);
75 int ar6000_reset_device(struct hif_device
*hifDevice
, u32 TargetType
, bool waitForCompletion
, bool coldReset
);
77 void ar6000_dump_target_assert_info(struct hif_device
*hifDevice
, u32 TargetType
);
79 int ar6000_set_htc_params(struct hif_device
*hifDevice
,
81 u32 MboxIsrYieldValue
,
82 u8 HtcControlBuffers
);
84 int ar6000_prepare_target(struct hif_device
*hifDevice
,
88 int ar6000_set_hci_bridge_flags(struct hif_device
*hifDevice
,
92 void ar6000_copy_cust_data_from_target(struct hif_device
*hifDevice
, u32 TargetType
);
94 u8
*ar6000_get_cust_data_buffer(u32 TargetType
);
96 int ar6000_setBTState(void *context
, u8
*pInBuf
, u32 InBufSize
);
98 int ar6000_setDevicePowerState(void *context
, u8
*pInBuf
, u32 InBufSize
);
100 int ar6000_setWowMode(void *context
, u8
*pInBuf
, u32 InBufSize
);
102 int ar6000_setHostMode(void *context
, u8
*pInBuf
, u32 InBufSize
);
108 #endif /*COMMON_DRV_H_*/