static bool bmiDone;
int
-bmiBufferSend(HIF_DEVICE *device,
+bmiBufferSend(struct hif_device *device,
u8 *buffer,
u32 length);
int
-bmiBufferReceive(HIF_DEVICE *device,
+bmiBufferReceive(struct hif_device *device,
u8 *buffer,
u32 length,
bool want_timeout);
}
int
-BMIDone(HIF_DEVICE *device)
+BMIDone(struct hif_device *device)
{
int status;
u32 cid;
}
int
-BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
+BMIGetTargetInfo(struct hif_device *device, struct bmi_target_info *targ_info)
{
int status;
u32 cid;
}
int
-BMIReadMemory(HIF_DEVICE *device,
+BMIReadMemory(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length)
}
int
-BMIWriteMemory(HIF_DEVICE *device,
+BMIWriteMemory(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length)
}
int
-BMIExecute(HIF_DEVICE *device,
+BMIExecute(struct hif_device *device,
u32 address,
u32 *param)
{
}
int
-BMISetAppStart(HIF_DEVICE *device,
+BMISetAppStart(struct hif_device *device,
u32 address)
{
u32 cid;
}
int
-BMIReadSOCRegister(HIF_DEVICE *device,
+BMIReadSOCRegister(struct hif_device *device,
u32 address,
u32 *param)
{
}
int
-BMIWriteSOCRegister(HIF_DEVICE *device,
+BMIWriteSOCRegister(struct hif_device *device,
u32 address,
u32 param)
{
}
int
-BMIrompatchInstall(HIF_DEVICE *device,
+BMIrompatchInstall(struct hif_device *device,
u32 ROM_addr,
u32 RAM_addr,
u32 nbytes,
}
int
-BMIrompatchUninstall(HIF_DEVICE *device,
+BMIrompatchUninstall(struct hif_device *device,
u32 rompatch_id)
{
u32 cid;
}
static int
-_BMIrompatchChangeActivation(HIF_DEVICE *device,
+_BMIrompatchChangeActivation(struct hif_device *device,
u32 rompatch_count,
u32 *rompatch_list,
u32 do_activate)
}
int
-BMIrompatchActivate(HIF_DEVICE *device,
+BMIrompatchActivate(struct hif_device *device,
u32 rompatch_count,
u32 *rompatch_list)
{
}
int
-BMIrompatchDeactivate(HIF_DEVICE *device,
+BMIrompatchDeactivate(struct hif_device *device,
u32 rompatch_count,
u32 *rompatch_list)
{
}
int
-BMILZData(HIF_DEVICE *device,
+BMILZData(struct hif_device *device,
u8 *buffer,
u32 length)
{
}
int
-BMILZStreamStart(HIF_DEVICE *device,
+BMILZStreamStart(struct hif_device *device,
u32 address)
{
u32 cid;
/* BMI Access routines */
int
-bmiBufferSend(HIF_DEVICE *device,
+bmiBufferSend(struct hif_device *device,
u8 *buffer,
u32 length)
{
}
int
-bmiBufferReceive(HIF_DEVICE *device,
+bmiBufferReceive(struct hif_device *device,
u8 *buffer,
u32 length,
bool want_timeout)
}
int
-BMIFastDownload(HIF_DEVICE *device, u32 address, u8 *buffer, u32 length)
+BMIFastDownload(struct hif_device *device, u32 address, u8 *buffer, u32 length)
{
int status = A_ERROR;
u32 lastWord = 0;
}
int
-BMIRawWrite(HIF_DEVICE *device, u8 *buffer, u32 length)
+BMIRawWrite(struct hif_device *device, u8 *buffer, u32 length)
{
return bmiBufferSend(device, buffer, length);
}
int
-BMIRawRead(HIF_DEVICE *device, u8 *buffer, u32 length, bool want_timeout)
+BMIRawRead(struct hif_device *device, u8 *buffer, u32 length, bool want_timeout)
{
return bmiBufferReceive(device, buffer, length, want_timeout);
}
#define CMD53_FIXED_ADDRESS 1
#define CMD53_INCR_ADDRESS 2
-BUS_REQUEST *hifAllocateBusRequest(HIF_DEVICE *device);
-void hifFreeBusRequest(HIF_DEVICE *device, BUS_REQUEST *busrequest);
-void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest);
+BUS_REQUEST *hifAllocateBusRequest(struct hif_device *device);
+void hifFreeBusRequest(struct hif_device *device, BUS_REQUEST *busrequest);
+void AddToAsyncList(struct hif_device *device, BUS_REQUEST *busrequest);
#ifdef HIF_LINUX_MMC_SCATTER_SUPPORT
struct hif_scatter_req_priv {
struct hif_scatter_req *pHifScatterReq; /* HIF scatter request with allocated entries */
- HIF_DEVICE *device; /* this device */
+ struct hif_device *device; /* this device */
BUS_REQUEST *busrequest; /* request associated with request */
/* scatter list for linux */
struct scatterlist sgentries[MAX_SCATTER_ENTRIES_PER_REQ];
#define ATH_DEBUG_SCATTER ATH_DEBUG_MAKE_MODULE_MASK(0)
-int SetupHIFScatterSupport(HIF_DEVICE *device, struct hif_device_scatter_support_info *pInfo);
-void CleanupHIFScatterResources(HIF_DEVICE *device);
-int DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest);
+int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_support_info *pInfo);
+void CleanupHIFScatterResources(struct hif_device *device);
+int DoHifReadWriteScatter(struct hif_device *device, BUS_REQUEST *busrequest);
#else // HIF_LINUX_MMC_SCATTER_SUPPORT
-static inline int SetupHIFScatterSupport(HIF_DEVICE *device, struct hif_device_scatter_support_info *pInfo)
+static inline int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_support_info *pInfo)
{
return A_ENOTSUP;
}
-static inline int DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest)
+static inline int DoHifReadWriteScatter(struct hif_device *device, BUS_REQUEST *busrequest)
{
return A_ENOTSUP;
}
#endif /* CONFIG_PM */
static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id);
static void hifDeviceRemoved(struct sdio_func *func);
-static HIF_DEVICE *addHifDevice(struct sdio_func *func);
-static HIF_DEVICE *getHifDevice(struct sdio_func *func);
-static void delHifDevice(HIF_DEVICE * device);
+static struct hif_device *addHifDevice(struct sdio_func *func);
+static struct hif_device *getHifDevice(struct sdio_func *func);
+static void delHifDevice(struct hif_device * device);
static int Func0_CMD52WriteByte(struct mmc_card *card, unsigned int address, unsigned char byte);
static int Func0_CMD52ReadByte(struct mmc_card *card, unsigned int address, unsigned char *byte);
extern u32 debughif;
static void ResetAllCards(void);
-static int hifDisableFunc(HIF_DEVICE *device, struct sdio_func *func);
-static int hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func);
+static int hifDisableFunc(struct hif_device *device, struct sdio_func *func);
+static int hifEnableFunc(struct hif_device *device, struct sdio_func *func);
#ifdef DEBUG
}
static int
-__HIFReadWrite(HIF_DEVICE *device,
+__HIFReadWrite(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length,
return status;
}
-void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest)
+void AddToAsyncList(struct hif_device *device, BUS_REQUEST *busrequest)
{
unsigned long flags;
BUS_REQUEST *async;
/* queue a read/write request */
int
-HIFReadWrite(HIF_DEVICE *device,
+HIFReadWrite(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length,
/* thread to serialize all requests, both sync and async */
static int async_task(void *param)
{
- HIF_DEVICE *device;
+ struct hif_device *device;
BUS_REQUEST *request;
int status;
unsigned long flags;
- device = (HIF_DEVICE *)param;
+ device = (struct hif_device *)param;
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: async task\n"));
set_current_state(TASK_INTERRUPTIBLE);
while(!device->async_shutdown) {
return 0;
}
-static s32 IssueSDCommand(HIF_DEVICE *device, u32 opcode, u32 arg, u32 flags, u32 *resp)
+static s32 IssueSDCommand(struct hif_device *device, u32 opcode, u32 arg, u32 flags, u32 *resp)
{
struct mmc_command cmd;
s32 err;
return err;
}
-int ReinitSDIO(HIF_DEVICE *device)
+int ReinitSDIO(struct hif_device *device)
{
s32 err;
struct mmc_host *host;
}
int
-PowerStateChangeNotify(HIF_DEVICE *device, HIF_DEVICE_POWER_CHANGE_TYPE config)
+PowerStateChangeNotify(struct hif_device *device, HIF_DEVICE_POWER_CHANGE_TYPE config)
{
int status = 0;
#if defined(CONFIG_PM)
}
int
-HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode,
+HIFConfigureDevice(struct hif_device *device, HIF_DEVICE_CONFIG_OPCODE opcode,
void *config, u32 configLen)
{
u32 count;
}
void
-HIFShutDownDevice(HIF_DEVICE *device)
+HIFShutDownDevice(struct hif_device *device)
{
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +HIFShutDownDevice\n"));
if (device != NULL) {
hifIRQHandler(struct sdio_func *func)
{
int status;
- HIF_DEVICE *device;
+ struct hif_device *device;
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifIRQHandler\n"));
device = getHifDevice(func);
/* handle HTC startup via thread*/
static int startup_task(void *param)
{
- HIF_DEVICE *device;
+ struct hif_device *device;
- device = (HIF_DEVICE *)param;
+ device = (struct hif_device *)param;
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: call HTC from startup_task\n"));
/* start up inform DRV layer */
if ((osdrvCallbacks.deviceInsertedHandler(osdrvCallbacks.context,device)) != 0) {
#if defined(CONFIG_PM)
static int enable_task(void *param)
{
- HIF_DEVICE *device;
- device = (HIF_DEVICE *)param;
+ struct hif_device *device;
+ device = (struct hif_device *)param;
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: call from resume_task\n"));
/* start up inform DRV layer */
static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id)
{
int ret;
- HIF_DEVICE * device;
+ struct hif_device * device;
int count;
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
void
-HIFAckInterrupt(HIF_DEVICE *device)
+HIFAckInterrupt(struct hif_device *device)
{
AR_DEBUG_ASSERT(device != NULL);
}
void
-HIFUnMaskInterrupt(HIF_DEVICE *device)
+HIFUnMaskInterrupt(struct hif_device *device)
{
int ret;
AR_DEBUG_ASSERT(ret == 0);
}
-void HIFMaskInterrupt(HIF_DEVICE *device)
+void HIFMaskInterrupt(struct hif_device *device)
{
int ret;
AR_DEBUG_ASSERT(device != NULL);
AR_DEBUG_ASSERT(ret == 0);
}
-BUS_REQUEST *hifAllocateBusRequest(HIF_DEVICE *device)
+BUS_REQUEST *hifAllocateBusRequest(struct hif_device *device)
{
BUS_REQUEST *busrequest;
unsigned long flag;
}
void
-hifFreeBusRequest(HIF_DEVICE *device, BUS_REQUEST *busrequest)
+hifFreeBusRequest(struct hif_device *device, BUS_REQUEST *busrequest)
{
unsigned long flag;
spin_unlock_irqrestore(&device->lock, flag);
}
-static int hifDisableFunc(HIF_DEVICE *device, struct sdio_func *func)
+static int hifDisableFunc(struct hif_device *device, struct sdio_func *func)
{
int ret;
int status = 0;
return status;
}
-static int hifEnableFunc(HIF_DEVICE *device, struct sdio_func *func)
+static int hifEnableFunc(struct hif_device *device, struct sdio_func *func)
{
struct task_struct* pTask;
const char *taskName = NULL;
{
struct sdio_func *func=dev_to_sdio_func(dev);
int status = 0;
- HIF_DEVICE *device;
+ struct hif_device *device;
device = getHifDevice(func);
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceSuspend\n"));
{
struct sdio_func *func=dev_to_sdio_func(dev);
int status = 0;
- HIF_DEVICE *device;
+ struct hif_device *device;
device = getHifDevice(func);
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceResume\n"));
static void hifDeviceRemoved(struct sdio_func *func)
{
int status = 0;
- HIF_DEVICE *device;
+ struct hif_device *device;
AR_DEBUG_ASSERT(func != NULL);
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceRemoved\n"));
/*
* This should be moved to AR6K HTC layer.
*/
-int hifWaitForPendingRecv(HIF_DEVICE *device)
+int hifWaitForPendingRecv(struct hif_device *device)
{
s32 cnt = 10;
u8 host_int_status;
}
-static HIF_DEVICE *
+static struct hif_device *
addHifDevice(struct sdio_func *func)
{
- HIF_DEVICE *hifdevice;
+ struct hif_device *hifdevice;
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: addHifDevice\n"));
AR_DEBUG_ASSERT(func != NULL);
- hifdevice = kzalloc(sizeof(HIF_DEVICE), GFP_KERNEL);
+ hifdevice = kzalloc(sizeof(struct hif_device), GFP_KERNEL);
AR_DEBUG_ASSERT(hifdevice != NULL);
#if HIF_USE_DMA_BOUNCE_BUFFER
hifdevice->dma_buffer = kmalloc(HIF_DMA_BUFFER_SIZE, GFP_KERNEL);
return hifdevice;
}
-static HIF_DEVICE *
+static struct hif_device *
getHifDevice(struct sdio_func *func)
{
AR_DEBUG_ASSERT(func != NULL);
- return (HIF_DEVICE *)sdio_get_drvdata(func);
+ return (struct hif_device *)sdio_get_drvdata(func);
}
static void
-delHifDevice(HIF_DEVICE * device)
+delHifDevice(struct hif_device * device)
{
AR_DEBUG_ASSERT(device!= NULL);
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: delHifDevice; 0x%p\n", device));
{
}
-void HIFClaimDevice(HIF_DEVICE *device, void *context)
+void HIFClaimDevice(struct hif_device *device, void *context)
{
device->claimedContext = context;
}
-void HIFReleaseDevice(HIF_DEVICE *device)
+void HIFReleaseDevice(struct hif_device *device)
{
device->claimedContext = NULL;
}
-int HIFAttachHTC(HIF_DEVICE *device, HTC_CALLBACKS *callbacks)
+int HIFAttachHTC(struct hif_device *device, HTC_CALLBACKS *callbacks)
{
if (device->htcCallbacks.context != NULL) {
/* already in use! */
return 0;
}
-void HIFDetachHTC(HIF_DEVICE *device)
+void HIFDetachHTC(struct hif_device *device)
{
A_MEMZERO(&device->htcCallbacks,sizeof(device->htcCallbacks));
}
(((address) & 0x1FFFF) << 9) | \
((bytes_blocks) & 0x1FF)
-static void FreeScatterReq(HIF_DEVICE *device, struct hif_scatter_req *pReq)
+static void FreeScatterReq(struct hif_device *device, struct hif_scatter_req *pReq)
{
unsigned long flag;
}
-static struct hif_scatter_req *AllocScatterReq(HIF_DEVICE *device)
+static struct hif_scatter_req *AllocScatterReq(struct hif_device *device)
{
struct dl_list *pItem;
unsigned long flag;
}
/* called by async task to perform the operation synchronously using direct MMC APIs */
-int DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest)
+int DoHifReadWriteScatter(struct hif_device *device, BUS_REQUEST *busrequest)
{
int i;
u8 rw;
}
/* callback to issue a read-write scatter request */
-static int HifReadWriteScatter(HIF_DEVICE *device, struct hif_scatter_req *pReq)
+static int HifReadWriteScatter(struct hif_device *device, struct hif_scatter_req *pReq)
{
int status = A_EINVAL;
u32 request = pReq->Request;
}
/* setup of HIF scatter resources */
-int SetupHIFScatterSupport(HIF_DEVICE *device, struct hif_device_scatter_support_info *pInfo)
+int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_support_info *pInfo)
{
int status = A_ERROR;
int i;
}
/* clean up scatter support */
-void CleanupHIFScatterResources(HIF_DEVICE *device)
+void CleanupHIFScatterResources(struct hif_device *device)
{
struct hif_scatter_req_priv *pReqPriv;
struct hif_scatter_req *pReq;
#define DEV_GET_VIRT_DMA_INFO(p) ((struct dev_scatter_dma_virtual_info *)((p)->HIFPrivate[0]))
-static struct hif_scatter_req *DevAllocScatterReq(HIF_DEVICE *Context)
+static struct hif_scatter_req *DevAllocScatterReq(struct hif_device *Context)
{
struct dl_list *pItem;
struct ar6k_device *pDev = (struct ar6k_device *)Context;
return NULL;
}
-static void DevFreeScatterReq(HIF_DEVICE *Context, struct hif_scatter_req *pReq)
+static void DevFreeScatterReq(struct hif_device *Context, struct hif_scatter_req *pReq)
{
struct ar6k_device *pDev = (struct ar6k_device *)Context;
LOCK_AR6K(pDev);
AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-DevReadWriteScatterAsyncHandler \n"));
}
-static int DevReadWriteScatter(HIF_DEVICE *Context, struct hif_scatter_req *pReq)
+static int DevReadWriteScatter(struct hif_device *Context, struct hif_scatter_req *pReq)
{
struct ar6k_device *pDev = (struct ar6k_device *)Context;
int status = 0;
struct hif_scatter_req *pReq;
while (1) {
- pReq = DevAllocScatterReq((HIF_DEVICE *)pDev);
+ pReq = DevAllocScatterReq((struct hif_device *)pDev);
if (NULL == pReq) {
break;
}
pReq->ScatterMethod = HIF_SCATTER_DMA_BOUNCE;
pReq->pScatterBounceBuffer = pVirtualInfo->pVirtDmaBuffer;
/* free request to the list */
- DevFreeScatterReq((HIF_DEVICE *)pDev,pReq);
+ DevFreeScatterReq((struct hif_device *)pDev,pReq);
}
if (status) {
int HCI_TransportSetBaudRate(HCI_TRANSPORT_HANDLE HciTrans, u32 Baud)
{
struct gmbox_proto_hci_uart *pProt = (struct gmbox_proto_hci_uart *)HciTrans;
- HIF_DEVICE *pHIFDevice = (HIF_DEVICE *)(pProt->pDev->HIFDevice);
+ struct hif_device *pHIFDevice = (struct hif_device *)(pProt->pDev->HIFDevice);
u32 scaledBaud, scratchAddr;
int status = 0;
u32 Flags; /* config flags */
void *pHCIDev; /* HCI bridge device */
struct hci_transport_properties *pHCIProps; /* HCI bridge props */
- HIF_DEVICE *pHIFDevice; /* HIF layer device */
+ struct hif_device *pHIFDevice; /* HIF layer device */
u32 AR3KBaudRate; /* AR3K operational baud rate */
u16 AR6KScale; /* AR6K UART scale value */
int
-ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data);
+ar6000_ReadRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
int
-ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data);
+ar6000_WriteRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
int
-ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, u32 address,
+ar6000_ReadDataDiag(struct hif_device *hifDevice, u32 address,
u8 *data, u32 length);
int
-ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, u32 address,
+ar6000_WriteDataDiag(struct hif_device *hifDevice, u32 address,
u8 *data, u32 length);
int
-ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval);
+ar6k_ReadTargetRegister(struct hif_device *hifDevice, int regsel, u32 *regval);
void
-ar6k_FetchTargetRegs(HIF_DEVICE *hifDevice, u32 *targregs);
+ar6k_FetchTargetRegs(struct hif_device *hifDevice, u32 *targregs);
#endif /*AR6000_DIAG_H_*/
BMICleanup(void);
int
-BMIDone(HIF_DEVICE *device);
+BMIDone(struct hif_device *device);
int
-BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info);
+BMIGetTargetInfo(struct hif_device *device, struct bmi_target_info *targ_info);
int
-BMIReadMemory(HIF_DEVICE *device,
+BMIReadMemory(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length);
int
-BMIWriteMemory(HIF_DEVICE *device,
+BMIWriteMemory(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length);
int
-BMIExecute(HIF_DEVICE *device,
+BMIExecute(struct hif_device *device,
u32 address,
u32 *param);
int
-BMISetAppStart(HIF_DEVICE *device,
+BMISetAppStart(struct hif_device *device,
u32 address);
int
-BMIReadSOCRegister(HIF_DEVICE *device,
+BMIReadSOCRegister(struct hif_device *device,
u32 address,
u32 *param);
int
-BMIWriteSOCRegister(HIF_DEVICE *device,
+BMIWriteSOCRegister(struct hif_device *device,
u32 address,
u32 param);
int
-BMIrompatchInstall(HIF_DEVICE *device,
+BMIrompatchInstall(struct hif_device *device,
u32 ROM_addr,
u32 RAM_addr,
u32 nbytes,
u32 *patch_id);
int
-BMIrompatchUninstall(HIF_DEVICE *device,
+BMIrompatchUninstall(struct hif_device *device,
u32 rompatch_id);
int
-BMIrompatchActivate(HIF_DEVICE *device,
+BMIrompatchActivate(struct hif_device *device,
u32 rompatch_count,
u32 *rompatch_list);
int
-BMIrompatchDeactivate(HIF_DEVICE *device,
+BMIrompatchDeactivate(struct hif_device *device,
u32 rompatch_count,
u32 *rompatch_list);
int
-BMILZStreamStart(HIF_DEVICE *device,
+BMILZStreamStart(struct hif_device *device,
u32 address);
int
-BMILZData(HIF_DEVICE *device,
+BMILZData(struct hif_device *device,
u8 *buffer,
u32 length);
int
-BMIFastDownload(HIF_DEVICE *device,
+BMIFastDownload(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length);
int
-BMIRawWrite(HIF_DEVICE *device,
+BMIRawWrite(struct hif_device *device,
u8 *buffer,
u32 length);
int
-BMIRawRead(HIF_DEVICE *device,
+BMIRawRead(struct hif_device *device,
u8 *buffer,
u32 length,
bool want_timeout);
/* OS-independent APIs */
int ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, struct common_credit_state_info *pCredInfo);
-int ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data);
+int ar6000_ReadRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
-int ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data);
+int ar6000_WriteRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
-int ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, u32 address, u8 *data, u32 length);
+int ar6000_ReadDataDiag(struct hif_device *hifDevice, u32 address, u8 *data, u32 length);
-int ar6000_reset_device(HIF_DEVICE *hifDevice, u32 TargetType, bool waitForCompletion, bool coldReset);
+int ar6000_reset_device(struct hif_device *hifDevice, u32 TargetType, bool waitForCompletion, bool coldReset);
-void ar6000_dump_target_assert_info(HIF_DEVICE *hifDevice, u32 TargetType);
+void ar6000_dump_target_assert_info(struct hif_device *hifDevice, u32 TargetType);
-int ar6000_set_htc_params(HIF_DEVICE *hifDevice,
+int ar6000_set_htc_params(struct hif_device *hifDevice,
u32 TargetType,
u32 MboxIsrYieldValue,
u8 HtcControlBuffers);
-int ar6000_prepare_target(HIF_DEVICE *hifDevice,
+int ar6000_prepare_target(struct hif_device *hifDevice,
u32 TargetType,
u32 TargetVersion);
-int ar6000_set_hci_bridge_flags(HIF_DEVICE *hifDevice,
+int ar6000_set_hci_bridge_flags(struct hif_device *hifDevice,
u32 TargetType,
u32 Flags);
-void ar6000_copy_cust_data_from_target(HIF_DEVICE *hifDevice, u32 TargetType);
+void ar6000_copy_cust_data_from_target(struct hif_device *hifDevice, u32 TargetType);
u8 *ar6000_get_cust_data_buffer(u32 TargetType);
typedef struct htc_callbacks HTC_CALLBACKS;
-typedef struct hif_device HIF_DEVICE;
+struct hif_device;
/*
* direction - Direction of transfer (HIF_READ/HIF_WRITE).
struct hif_scatter_item ScatterList[1]; /* start of scatter list */
};
-typedef struct hif_scatter_req * ( *HIF_ALLOCATE_SCATTER_REQUEST)(HIF_DEVICE *device);
-typedef void ( *HIF_FREE_SCATTER_REQUEST)(HIF_DEVICE *device, struct hif_scatter_req *request);
-typedef int ( *HIF_READWRITE_SCATTER)(HIF_DEVICE *device, struct hif_scatter_req *request);
+typedef struct hif_scatter_req * ( *HIF_ALLOCATE_SCATTER_REQUEST)(struct hif_device *device);
+typedef void ( *HIF_FREE_SCATTER_REQUEST)(struct hif_device *device, struct hif_scatter_req *request);
+typedef int ( *HIF_READWRITE_SCATTER)(struct hif_device *device, struct hif_scatter_req *request);
struct hif_device_scatter_support_info {
/* information returned from HIF layer */
/* function to get pending events , some HIF modules use special mechanisms
* to detect packet available and other interrupts */
-typedef int ( *HIF_PENDING_EVENTS_FUNC)(HIF_DEVICE *device,
+typedef int ( *HIF_PENDING_EVENTS_FUNC)(struct hif_device *device,
struct hif_pending_events_info *pEvents,
void *AsyncContext);
#define HIF_MASK_RECV true
#define HIF_UNMASK_RECV false
/* function to mask recv events */
-typedef int ( *HIF_MASK_UNMASK_RECV_EVENT)(HIF_DEVICE *device,
+typedef int ( *HIF_MASK_UNMASK_RECV_EVENT)(struct hif_device *device,
bool Mask,
void *AsyncContext);
/* This API claims the HIF device and provides a context for handling removal.
* The device removal callback is only called when the OSDRV layer claims
* a device. The claimed context must be non-NULL */
-void HIFClaimDevice(HIF_DEVICE *device, void *claimedContext);
+void HIFClaimDevice(struct hif_device *device, void *claimedContext);
/* release the claimed device */
-void HIFReleaseDevice(HIF_DEVICE *device);
+void HIFReleaseDevice(struct hif_device *device);
/* This API allows the HTC layer to attach to the HIF device */
-int HIFAttachHTC(HIF_DEVICE *device, HTC_CALLBACKS *callbacks);
+int HIFAttachHTC(struct hif_device *device, HTC_CALLBACKS *callbacks);
/* This API detaches the HTC layer from the HIF device */
-void HIFDetachHTC(HIF_DEVICE *device);
+void HIFDetachHTC(struct hif_device *device);
/*
* This API is used to provide the read/write interface over the specific bus
* request - Characterizes the attributes of the command.
*/
int
-HIFReadWrite(HIF_DEVICE *device,
+HIFReadWrite(struct hif_device *device,
u32 address,
u8 *buffer,
u32 length,
* This can be initiated from the unload driver context when the OSDRV layer has no more use for
* the device.
*/
-void HIFShutDownDevice(HIF_DEVICE *device);
+void HIFShutDownDevice(struct hif_device *device);
/*
* This should translate to an acknowledgment to the bus driver indicating that
* This should prevent the bus driver from raising an interrupt unless the
* previous one has been serviced and acknowledged using the previous API.
*/
-void HIFAckInterrupt(HIF_DEVICE *device);
+void HIFAckInterrupt(struct hif_device *device);
-void HIFMaskInterrupt(HIF_DEVICE *device);
+void HIFMaskInterrupt(struct hif_device *device);
-void HIFUnMaskInterrupt(HIF_DEVICE *device);
+void HIFUnMaskInterrupt(struct hif_device *device);
#ifdef THREAD_X
/*
#endif
int
-HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode,
+HIFConfigureDevice(struct hif_device *device, HIF_DEVICE_CONFIG_OPCODE opcode,
void *config, u32 configLen);
/*
* This API wait for the remaining MBOX messages to be drained
* This should be moved to HTC AR6K layer
*/
-int hifWaitForPendingRecv(HIF_DEVICE *device);
+int hifWaitForPendingRecv(struct hif_device *device);
#ifdef __cplusplus
}
#ifdef USE_4BYTE_REGISTER_ACCESS
/* set the window address register (using 4-byte register access ). */
-int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32 Address)
+int ar6000_SetAddressWindowRegister(struct hif_device *hifDevice, u32 RegisterAddr, u32 Address)
{
int status;
u8 addrValue[4];
#else
/* set the window address register */
-int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32 Address)
+int ar6000_SetAddressWindowRegister(struct hif_device *hifDevice, u32 RegisterAddr, u32 Address)
{
int status;
* No cooperation from the Target is required for this.
*/
int
-ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
+ar6000_ReadRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data)
{
int status;
* No cooperation from the Target is required for this.
*/
int
-ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
+ar6000_WriteRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data)
{
int status;
}
int
-ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, u32 address,
+ar6000_ReadDataDiag(struct hif_device *hifDevice, u32 address,
u8 *data, u32 length)
{
u32 count;
}
int
-ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, u32 address,
+ar6000_WriteDataDiag(struct hif_device *hifDevice, u32 address,
u8 *data, u32 length)
{
u32 count;
}
int
-ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval)
+ar6k_ReadTargetRegister(struct hif_device *hifDevice, int regsel, u32 *regval)
{
int status;
u8 vals[4];
}
void
-ar6k_FetchTargetRegs(HIF_DEVICE *hifDevice, u32 *targregs)
+ar6k_FetchTargetRegs(struct hif_device *hifDevice, u32 *targregs)
{
int i;
u32 val;
#if 0
static int
-_do_write_diag(HIF_DEVICE *hifDevice, u32 addr, u32 value)
+_do_write_diag(struct hif_device *hifDevice, u32 addr, u32 value)
{
int status;
*/
#if 0
static int
-_delay_until_target_alive(HIF_DEVICE *hifDevice, s32 wait_msecs, u32 TargetType)
+_delay_until_target_alive(struct hif_device *hifDevice, s32 wait_msecs, u32 TargetType)
{
s32 actual_wait;
s32 i;
#define AR6002_RESET_CONTROL_ADDRESS 0x00004000
#define AR6003_RESET_CONTROL_ADDRESS 0x00004000
/* reset device */
-int ar6000_reset_device(HIF_DEVICE *hifDevice, u32 TargetType, bool waitForCompletion, bool coldReset)
+int ar6000_reset_device(struct hif_device *hifDevice, u32 TargetType, bool waitForCompletion, bool coldReset)
{
int status = 0;
u32 address;
/* This should be called in BMI phase after firmware is downloaded */
void
-ar6000_copy_cust_data_from_target(HIF_DEVICE *hifDevice, u32 TargetType)
+ar6000_copy_cust_data_from_target(struct hif_device *hifDevice, u32 TargetType)
{
u32 eepHeaderAddr;
u8 AR6003CustDataShadow[AR6003_CUST_DATA_SIZE+4];
#endif
-void ar6000_dump_target_assert_info(HIF_DEVICE *hifDevice, u32 TargetType)
+void ar6000_dump_target_assert_info(struct hif_device *hifDevice, u32 TargetType)
{
u32 address;
u32 regDumpArea = 0;
/* set HTC/Mbox operational parameters, this can only be called when the target is in the
* BMI phase */
-int ar6000_set_htc_params(HIF_DEVICE *hifDevice,
+int ar6000_set_htc_params(struct hif_device *hifDevice,
u32 TargetType,
u32 MboxIsrYieldValue,
u8 HtcControlBuffers)
}
-static int prepare_ar6002(HIF_DEVICE *hifDevice, u32 TargetVersion)
+static int prepare_ar6002(struct hif_device *hifDevice, u32 TargetVersion)
{
int status = 0;
return status;
}
-static int prepare_ar6003(HIF_DEVICE *hifDevice, u32 TargetVersion)
+static int prepare_ar6003(struct hif_device *hifDevice, u32 TargetVersion)
{
int status = 0;
}
/* this function assumes the caller has already initialized the BMI APIs */
-int ar6000_prepare_target(HIF_DEVICE *hifDevice,
+int ar6000_prepare_target(struct hif_device *hifDevice,
u32 TargetType,
u32 TargetVersion)
{
* TBDXXX: Remove this function when REV 1.x is desupported.
*/
int
-ar6002_REV1_reset_force_host (HIF_DEVICE *hifDevice)
+ar6002_REV1_reset_force_host (struct hif_device *hifDevice)
{
s32 i;
struct forceROM_s {
}
/* can only be called during bmi init stage */
-int ar6000_set_hci_bridge_flags(HIF_DEVICE *hifDevice,
+int ar6000_set_hci_bridge_flags(struct hif_device *hifDevice,
u32 TargetType,
u32 Flags)
{
static u8 eeprom_data[EEPROM_SZ];
static u32 sys_sleep_reg;
-static HIF_DEVICE *p_bmi_device;
+static struct hif_device *p_bmi_device;
//
// Functions
* so we can access the EEPROM.
*/
static void
-enable_SI(HIF_DEVICE *p_device)
+enable_SI(struct hif_device *p_device)
{
u32 regval;
}
/* ATHENV */
#ifdef ANDROID_ENV
-void eeprom_ar6000_transfer(HIF_DEVICE *device, char *fake_file, char *p_mac)
+void eeprom_ar6000_transfer(struct hif_device *device, char *fake_file, char *p_mac)
{
u32 first_word;
u32 board_data_addr;
}
int
-ar6000_get_hif_dev(HIF_DEVICE *device, void *config)
+ar6000_get_hif_dev(struct hif_device *device, void *config)
{
int status;
return status;
}
-int ar6000_set_uart_config(HIF_DEVICE *hifDevice,
+int ar6000_set_uart_config(struct hif_device *hifDevice,
u32 scale,
u32 step)
{
return status;
}
-int ar6000_get_core_clock_config(HIF_DEVICE *hifDevice, u32 *data)
+int ar6000_get_core_clock_config(struct hif_device *hifDevice, u32 *data)
{
u32 regAddress;
int status;
ar3kconfig.pHCIDev = pHcidevInfo->pHCIDev;
ar3kconfig.pHCIProps = &pHcidevInfo->HCIProps;
#ifdef EXPORT_HCI_BRIDGE_INTERFACE
- ar3kconfig.pHIFDevice = (HIF_DEVICE *)(pHcidevInfo->HCITransHdl.hifDevice);
+ ar3kconfig.pHIFDevice = (struct hif_device *)(pHcidevInfo->HCITransHdl.hifDevice);
#else
ar3kconfig.pHIFDevice = pHcidevInfo->ar->arHifDevice;
#endif
A_MEMZERO(&osDevInfo,sizeof(osDevInfo));
/* get the underlying OS device */
#ifdef EXPORT_HCI_BRIDGE_INTERFACE
- status = ar6000_get_hif_dev((HIF_DEVICE *)(pHcidevInfo->HCITransHdl.hifDevice),
+ status = ar6000_get_hif_dev((struct hif_device *)(pHcidevInfo->HCITransHdl.hifDevice),
&osDevInfo);
#else
status = HIFConfigureDevice(pHcidevInfo->ar->arHifDevice,
#define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING)
-int ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data);
-int ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data);
+int ar6000_ReadRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
+int ar6000_WriteRegDiag(struct hif_device *hifDevice, u32 *address, u32 *data);
#ifdef __cplusplus
extern "C" {
extern int ar6000_register_hci_transport(struct hci_transport_callbacks *hciTransCallbacks);
-extern int ar6000_get_hif_dev(HIF_DEVICE *device, void *config);
+extern int ar6000_get_hif_dev(struct hif_device *device, void *config);
-extern int ar6000_set_uart_config(HIF_DEVICE *hifDevice, u32 scale, u32 step);
+extern int ar6000_set_uart_config(struct hif_device *hifDevice, u32 scale, u32 step);
/* get core clock register settings
* data: 0 - 40/44MHz
* where (5G band/2.4G band)
* assume 2.4G band for now
*/
-extern int ar6000_get_core_clock_config(HIF_DEVICE *hifDevice, u32 *data);
+extern int ar6000_get_core_clock_config(struct hif_device *hifDevice, u32 *data);
int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct ar6_softc *ar = (struct ar6_softc *)ar6k_priv(dev);
- HIF_DEVICE *hifDevice = ar->arHifDevice;
+ struct hif_device *hifDevice = ar->arHifDevice;
int ret = 0, param;
unsigned int address = 0;
unsigned int length = 0;