From ab8911150f824f496c67b3bab19c15ff62ddff27 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:55:58 -0700 Subject: ath6kl: s|A_FREE|kfree|g for i in $(find ./drivers/staging/ath6kl/ -name \*.[ch]) ; do \ sed -r -i -e "s/A_FREE/kfree/g" $i; done Tested-by: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c index a1fdcc189f7e..7516d913dab3 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif_scatter.c @@ -309,7 +309,7 @@ int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_ (MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item))); if (NULL == pReqPriv->pHifScatterReq) { - A_FREE(pReqPriv); + kfree(pReqPriv); break; } /* just zero the main part of the scatter request */ @@ -319,8 +319,8 @@ int SetupHIFScatterSupport(struct hif_device *device, struct hif_device_scatter_ /* allocate a bus request for this scatter request */ busrequest = hifAllocateBusRequest(device); if (NULL == busrequest) { - A_FREE(pReqPriv->pHifScatterReq); - A_FREE(pReqPriv); + kfree(pReqPriv->pHifScatterReq); + kfree(pReqPriv); break; } /* assign the scatter request to this bus request */ @@ -382,11 +382,11 @@ void CleanupHIFScatterResources(struct hif_device *device) } if (pReqPriv->pHifScatterReq != NULL) { - A_FREE(pReqPriv->pHifScatterReq); + kfree(pReqPriv->pHifScatterReq); pReqPriv->pHifScatterReq = NULL; } - A_FREE(pReqPriv); + kfree(pReqPriv); } } -- cgit v1.2.3 From 711908df76bedee2df653be057465168ed626742 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:56:21 -0700 Subject: ath6kl: propagate errors on module setup This propagates initial platform registration failures and also HIF initialization failures. Cc: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 32 ++++++++++------------ drivers/staging/ath6kl/os/linux/ar6000_drv.c | 12 ++++---- drivers/staging/ath6kl/os/linux/ar6000_pm.c | 26 ++++++++++-------- .../ath6kl/os/linux/include/ar6xapi_linux.h | 2 +- 4 files changed, 37 insertions(+), 35 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index e6d9cd802dee..001f99375445 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -125,31 +125,27 @@ ATH_DEBUG_INSTANTIATE_MODULE_VAR(hif, /* ------ Functions ------ */ int HIFInit(OSDRV_CALLBACKS *callbacks) { - int status; - AR_DEBUG_ASSERT(callbacks != NULL); + int r; + AR_DEBUG_ASSERT(callbacks != NULL); + + A_REGISTER_MODULE_DEBUG_INFO(hif); - A_REGISTER_MODULE_DEBUG_INFO(hif); + /* store the callback handlers */ + osdrvCallbacks = *callbacks; - /* store the callback handlers */ - osdrvCallbacks = *callbacks; + /* Register with bus driver core */ + registered = 1; - /* Register with bus driver core */ - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: HIFInit registering\n")); - registered = 1; #if defined(CONFIG_PM) - if (callbacks->deviceSuspendHandler && callbacks->deviceResumeHandler) { - ar6k_driver.drv.pm = &ar6k_device_pm_ops; - } + if (callbacks->deviceSuspendHandler && callbacks->deviceResumeHandler) + ar6k_driver.drv.pm = &ar6k_device_pm_ops; #endif /* CONFIG_PM */ - status = sdio_register_driver(&ar6k_driver); - AR_DEBUG_ASSERT(status==0); - if (status != 0) { - return A_ERROR; - } - - return 0; + r = sdio_register_driver(&ar6k_driver); + if (r < 0) + return r; + return 0; } static int diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c index f08f165f4d97..5f73182911ed 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c @@ -603,7 +603,7 @@ static int __init ar6000_init_module(void) { static int probed = 0; - int status; + int r; OSDRV_CALLBACKS osdrvCallbacks; a_module_debug_support_init(); @@ -636,7 +636,9 @@ ar6000_init_module(void) osdrvCallbacks.devicePowerChangeHandler = ar6000_power_change_ev; #endif - ar6000_pm_init(); + r = ar6000_pm_init(); + if (r) + return r; #ifdef DEBUG /* Set the debug flags if specified at load time */ @@ -655,9 +657,9 @@ ar6000_init_module(void) memset(&aptcTR, 0, sizeof(APTC_TRAFFIC_RECORD)); #endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ - status = HIFInit(&osdrvCallbacks); - if (status) - return -ENODEV; + r = HIFInit(&osdrvCallbacks); + if (r) + return r; return 0; } diff --git a/drivers/staging/ath6kl/os/linux/ar6000_pm.c b/drivers/staging/ath6kl/os/linux/ar6000_pm.c index 1004f245d795..be401aa6dfcb 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_pm.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_pm.c @@ -660,24 +660,28 @@ ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) return status; } -void ar6000_pm_init() +int ar6000_pm_init() { - A_REGISTER_MODULE_DEBUG_INFO(pm); + int r; + A_REGISTER_MODULE_DEBUG_INFO(pm); + #ifdef CONFIG_PM - /* - * Register ar6000_pm_device into system. - * We should also add platform_device into the first item of array - * of devices[] in file arch/xxx/mach-xxx/board-xxxx.c - */ - if (platform_driver_register(&ar6000_pm_device)) { - AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000: fail to register the power control driver.\n")); - } + /* + * Register ar6000_pm_device into system. + * We should also add platform_device into the first item of array + * of devices[] in file arch/xxx/mach-xxx/board-xxxx.c + */ + r = platform_driver_register(&ar6000_pm_device); + if (r < 0) + return -ENODEV; #endif /* CONFIG_PM */ + + return 0; } void ar6000_pm_exit() { #ifdef CONFIG_PM - platform_driver_unregister(&ar6000_pm_device); + platform_driver_unregister(&ar6000_pm_device); #endif /* CONFIG_PM */ } diff --git a/drivers/staging/ath6kl/os/linux/include/ar6xapi_linux.h b/drivers/staging/ath6kl/os/linux/include/ar6xapi_linux.h index dd6905c41b76..a8e8e36e60ad 100644 --- a/drivers/staging/ath6kl/os/linux/include/ar6xapi_linux.h +++ b/drivers/staging/ath6kl/os/linux/include/ar6xapi_linux.h @@ -178,7 +178,7 @@ int ar6000_power_change_ev(void *context, u32 config); void ar6000_check_wow_status(struct ar6_softc *ar, struct sk_buff *skb, bool isEvent); #endif -void ar6000_pm_init(void); +int ar6000_pm_init(void); void ar6000_pm_exit(void); #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT -- cgit v1.2.3 From 4f56a12dd58ca2025b22ac4caabb89c90e1f1b7b Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:56:23 -0700 Subject: ath6kl: propagate errors on hifEnableFunc() failures This will be passed along to the SDIO probe routine when it fails. This will generate better error code to the user when loading the module if it fails. Cc: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index 001f99375445..1752b33f8d90 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -1012,7 +1012,7 @@ static int hifEnableFunc(struct hif_device *device, struct sdio_func *func) if (ret) { AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("AR6000: failed to enable 4-bit ASYNC IRQ mode %d \n",ret)); sdio_release_host(func); - return A_ERROR; + return ret; } AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: 4-bit ASYNC IRQ mode enabled\n")); } @@ -1023,14 +1023,14 @@ static int hifEnableFunc(struct hif_device *device, struct sdio_func *func) AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), Unable to enable AR6K: 0x%X\n", __FUNCTION__, ret)); sdio_release_host(func); - return A_ERROR; + return ret; } ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE); sdio_release_host(func); if (ret) { AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), Unable to set block size 0x%x AR6K: 0x%X\n", __FUNCTION__, HIF_MBOX_BLOCK_SIZE, ret)); - return A_ERROR; + return ret; } device->is_disabled = false; /* create async I/O thread */ @@ -1041,7 +1041,7 @@ static int hifEnableFunc(struct hif_device *device, struct sdio_func *func) "AR6K Async"); if (IS_ERR(device->async_task)) { AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), to create async task\n", __FUNCTION__)); - return A_ERROR; + return -ENOMEM; } AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: start async task\n")); wake_up_process(device->async_task ); @@ -1056,14 +1056,14 @@ static int hifEnableFunc(struct hif_device *device, struct sdio_func *func) } else { taskFunc = enable_task; taskName = "AR6K enable"; - ret = A_PENDING; + ret = -ENOMEM; #endif /* CONFIG_PM */ } /* create resume thread */ pTask = kthread_create(taskFunc, (void *)device, taskName); if (IS_ERR(pTask)) { AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("AR6000: %s(), to create enabel task\n", __FUNCTION__)); - return A_ERROR; + return -ENOMEM; } wake_up_process(pTask); AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifEnableFunc\n")); -- cgit v1.2.3 From 09b6b5e916afa32a4a4a4c9d7cb3ed00563d6b0e Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:56:24 -0700 Subject: ath6kl: cleanup allocation and getting of the hif dev Removes verbose debug messages and checks that are just not needed, and renames the functions to something more sensible. While we clean this up, just move the routines above and remove the forward declarations. Cc: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 65 ++++++++++------------ 1 file changed, 28 insertions(+), 37 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index 1752b33f8d90..c862a199a73b 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -58,8 +58,6 @@ static int hifDeviceResume(struct device *dev); #endif /* CONFIG_PM */ static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id); static void hifDeviceRemoved(struct sdio_func *func); -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); @@ -69,6 +67,26 @@ module_param(reset_sdio_on_unload, int, 0644); extern u32 nohifscattersupport; +static struct hif_device *ath6kl_alloc_hifdev(struct sdio_func *func) +{ + struct hif_device *hifdevice; + + hifdevice = kzalloc(sizeof(struct hif_device), GFP_KERNEL); + +#if HIF_USE_DMA_BOUNCE_BUFFER + hifdevice->dma_buffer = kmalloc(HIF_DMA_BUFFER_SIZE, GFP_KERNEL); +#endif + hifdevice->func = func; + hifdevice->powerConfig = HIF_DEVICE_POWER_UP; + sdio_set_drvdata(func, hifdevice); + + return hifdevice; +} + +static struct hif_device *ath6kl_get_hifdev(struct sdio_func *func) +{ + return (struct hif_device *) sdio_get_drvdata(func); +} /* ------ Static Variables ------ */ static const struct sdio_device_id ar6k_id_table[] = { @@ -774,7 +792,7 @@ hifIRQHandler(struct sdio_func *func) struct hif_device *device; AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifIRQHandler\n")); - device = getHifDevice(func); + device = ath6kl_get_hifdev(func); atomic_set(&device->irqHandling, 1); /* release the host during ints so we can pick it back up when we process cmds */ sdio_release_host(device->func); @@ -829,8 +847,8 @@ static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id ("AR6000: hifDeviceInserted, Function: 0x%X, Vendor ID: 0x%X, Device ID: 0x%X, block size: 0x%X/0x%X\n", func->num, func->vendor, func->device, func->max_blksize, func->cur_blksize)); - addHifDevice(func); - device = getHifDevice(func); + ath6kl_alloc_hifdev(func); + device = ath6kl_get_hifdev(func); device->id = id; device->is_disabled = true; @@ -951,7 +969,7 @@ static int hifDisableFunc(struct hif_device *device, struct sdio_func *func) int status = 0; AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDisableFunc\n")); - device = getHifDevice(func); + device = ath6kl_get_hifdev(func); if (!IS_ERR(device->async_task)) { init_completion(&device->async_completion); device->async_shutdown = 1; @@ -1000,7 +1018,7 @@ static int hifEnableFunc(struct hif_device *device, struct sdio_func *func) int ret = 0; AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifEnableFunc\n")); - device = getHifDevice(func); + device = ath6kl_get_hifdev(func); if (device->is_disabled) { /* enable the SDIO function */ @@ -1079,7 +1097,7 @@ static int hifDeviceSuspend(struct device *dev) int status = 0; struct hif_device *device; - device = getHifDevice(func); + device = ath6kl_get_hifdev(func); AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceSuspend\n")); if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { device->is_suspend = true; /* set true first for PowerStateChangeNotify(..) */ @@ -1107,7 +1125,7 @@ static int hifDeviceResume(struct device *dev) int status = 0; struct hif_device *device; - device = getHifDevice(func); + device = ath6kl_get_hifdev(func); AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceResume\n")); if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { status = osdrvCallbacks.deviceResumeHandler(device->claimedContext); @@ -1128,7 +1146,7 @@ static void hifDeviceRemoved(struct sdio_func *func) AR_DEBUG_ASSERT(func != NULL); AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceRemoved\n")); - device = getHifDevice(func); + device = ath6kl_get_hifdev(func); if (device->claimedContext != NULL) { status = osdrvCallbacks.deviceRemovedHandler(device->claimedContext, device); } @@ -1178,33 +1196,6 @@ int hifWaitForPendingRecv(struct hif_device *device) return 0; } - -static struct hif_device * -addHifDevice(struct sdio_func *func) -{ - struct hif_device *hifdevice; - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: addHifDevice\n")); - AR_DEBUG_ASSERT(func != NULL); - 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); - AR_DEBUG_ASSERT(hifdevice->dma_buffer != NULL); -#endif - hifdevice->func = func; - hifdevice->powerConfig = HIF_DEVICE_POWER_UP; - sdio_set_drvdata(func, hifdevice); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: addHifDevice; 0x%p\n", hifdevice)); - return hifdevice; -} - -static struct hif_device * -getHifDevice(struct sdio_func *func) -{ - AR_DEBUG_ASSERT(func != NULL); - return (struct hif_device *)sdio_get_drvdata(func); -} - static void delHifDevice(struct hif_device * device) { -- cgit v1.2.3 From 60a9bc57804bd6a629ff1016fea43766f3f6eaf3 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:56:25 -0700 Subject: ath6kl: style cleanup on struct sdio_driver components No functional changes except renames of the routines and id data structure. Cc: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 172 ++++++++++----------- 1 file changed, 85 insertions(+), 87 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index c862a199a73b..9420c40f2993 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -56,12 +56,14 @@ static int hifDeviceSuspend(struct device *dev); static int hifDeviceResume(struct device *dev); #endif /* CONFIG_PM */ -static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id); -static void hifDeviceRemoved(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); +static int hifEnableFunc(struct hif_device *device, struct sdio_func *func); +static int hifDisableFunc(struct hif_device *device, struct sdio_func *func); +OSDRV_CALLBACKS osdrvCallbacks; + int reset_sdio_on_unload = 0; module_param(reset_sdio_on_unload, int, 0644); @@ -88,21 +90,86 @@ static struct hif_device *ath6kl_get_hifdev(struct sdio_func *func) return (struct hif_device *) sdio_get_drvdata(func); } -/* ------ Static Variables ------ */ -static const struct sdio_device_id ar6k_id_table[] = { - { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6002_BASE | 0x0)) }, - { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6002_BASE | 0x1)) }, - { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x0)) }, - { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x1)) }, - { /* null */ }, +static const struct sdio_device_id ath6kl_hifdev_ids[] = { + { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6002_BASE | 0x0)) }, + { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6002_BASE | 0x1)) }, + { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x0)) }, + { SDIO_DEVICE(MANUFACTURER_CODE, (MANUFACTURER_ID_AR6003_BASE | 0x1)) }, + { /* null */ }, }; -MODULE_DEVICE_TABLE(sdio, ar6k_id_table); -static struct sdio_driver ar6k_driver = { - .name = "ar6k_wlan", - .id_table = ar6k_id_table, - .probe = hifDeviceInserted, - .remove = hifDeviceRemoved, +MODULE_DEVICE_TABLE(sdio, ath6kl_hifdev_ids); + +static int ath6kl_hifdev_probe(struct sdio_func *func, + const struct sdio_device_id *id) +{ + int ret; + struct hif_device *device; + int count; + + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, + ("ath6kl: Function: 0x%X, Vendor ID: 0x%X, " + "Device ID: 0x%X, block size: 0x%X/0x%X\n", + func->num, func->vendor, func->device, + func->max_blksize, func->cur_blksize)); + + ath6kl_alloc_hifdev(func); + device = ath6kl_get_hifdev(func); + + device->id = id; + device->is_disabled = true; + + spin_lock_init(&device->lock); + spin_lock_init(&device->asynclock); + + DL_LIST_INIT(&device->ScatterReqHead); + + /* Try to allow scatter unless globally overridden */ + if (!nohifscattersupport) + device->scatter_enabled = true; + + A_MEMZERO(device->busRequest, sizeof(device->busRequest)); + + for (count = 0; count < BUS_REQUEST_MAX_NUM; count++) { + sema_init(&device->busRequest[count].sem_req, 0); + hifFreeBusRequest(device, &device->busRequest[count]); + } + + sema_init(&device->sem_async, 0); + + ret = hifEnableFunc(device, func); + + return ret; +} + +static void ath6kl_hifdev_remove(struct sdio_func *func) +{ + int status = 0; + struct hif_device *device; + AR_DEBUG_ASSERT(func != NULL); + + device = ath6kl_get_hifdev(func); + if (device->claimedContext != NULL) + status = osdrvCallbacks. + deviceRemovedHandler(device->claimedContext, device); + + if (device->is_disabled) + device->is_disabled = false; + else + status = hifDisableFunc(device, func); + + CleanupHIFScatterResources(device); + + delHifDevice(device); + AR_DEBUG_ASSERT(status == 0); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceRemoved\n")); +} + +static struct sdio_driver ath6kl_hifdev_driver = { + .name = "ath6kl_hifdev", + .id_table = ath6kl_hifdev_ids, + .probe = ath6kl_hifdev_probe, + .remove = ath6kl_hifdev_remove, }; #if defined(CONFIG_PM) @@ -119,14 +186,11 @@ static struct dev_pm_ops ar6k_device_pm_ops = { /* make sure we only unregister when registered. */ static int registered = 0; -OSDRV_CALLBACKS osdrvCallbacks; extern u32 onebitmode; extern u32 busspeedlow; extern u32 debughif; static void ResetAllCards(void); -static int hifDisableFunc(struct hif_device *device, struct sdio_func *func); -static int hifEnableFunc(struct hif_device *device, struct sdio_func *func); #ifdef DEBUG @@ -156,10 +220,10 @@ int HIFInit(OSDRV_CALLBACKS *callbacks) #if defined(CONFIG_PM) if (callbacks->deviceSuspendHandler && callbacks->deviceResumeHandler) - ar6k_driver.drv.pm = &ar6k_device_pm_ops; + ath6kl_hifdev_driver.drv.pm = &ar6k_device_pm_ops; #endif /* CONFIG_PM */ - r = sdio_register_driver(&ar6k_driver); + r = sdio_register_driver(&ath6kl_hifdev_driver); if (r < 0) return r; @@ -777,7 +841,7 @@ HIFShutDownDevice(struct hif_device *device) registered = 0; AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Unregistering with the bus driver\n")); - sdio_unregister_driver(&ar6k_driver); + sdio_unregister_driver(&ath6kl_hifdev_driver); AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: Unregistered\n")); } @@ -837,48 +901,6 @@ static int enable_task(void *param) } #endif -static int hifDeviceInserted(struct sdio_func *func, const struct sdio_device_id *id) -{ - int ret; - struct hif_device * device; - int count; - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, - ("AR6000: hifDeviceInserted, Function: 0x%X, Vendor ID: 0x%X, Device ID: 0x%X, block size: 0x%X/0x%X\n", - func->num, func->vendor, func->device, func->max_blksize, func->cur_blksize)); - - ath6kl_alloc_hifdev(func); - device = ath6kl_get_hifdev(func); - - device->id = id; - device->is_disabled = true; - - spin_lock_init(&device->lock); - - spin_lock_init(&device->asynclock); - - DL_LIST_INIT(&device->ScatterReqHead); - - if (!nohifscattersupport) { - /* try to allow scatter operation on all instances, - * unless globally overridden */ - device->scatter_enabled = true; - } - - /* Initialize the bus requests to be used later */ - A_MEMZERO(device->busRequest, sizeof(device->busRequest)); - for (count = 0; count < BUS_REQUEST_MAX_NUM; count ++) { - sema_init(&device->busRequest[count].sem_req, 0); - hifFreeBusRequest(device, &device->busRequest[count]); - } - sema_init(&device->sem_async, 0); - - ret = hifEnableFunc(device, func); - - return ret; -} - - void HIFAckInterrupt(struct hif_device *device) { @@ -1139,30 +1161,6 @@ static int hifDeviceResume(struct device *dev) } #endif /* CONFIG_PM */ -static void hifDeviceRemoved(struct sdio_func *func) -{ - int status = 0; - struct hif_device *device; - AR_DEBUG_ASSERT(func != NULL); - - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceRemoved\n")); - device = ath6kl_get_hifdev(func); - if (device->claimedContext != NULL) { - status = osdrvCallbacks.deviceRemovedHandler(device->claimedContext, device); - } - - if (device->is_disabled) { - device->is_disabled = false; - } else { - status = hifDisableFunc(device, func); - } - CleanupHIFScatterResources(device); - - delHifDevice(device); - AR_DEBUG_ASSERT(status == 0); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceRemoved\n")); -} - /* * This should be moved to AR6K HTC layer. */ -- cgit v1.2.3 From 0174d3c26448a132d01e6741fb80749dc81180b7 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:56:27 -0700 Subject: ath6kl: cleanup and move the ath6kl pm ops to be assigned statically There should be no need to assign the pm ops dynamically, so assign them statically and make them const. While we are doing this just do some simple code style cleanup on the routines and move them above prior to their assignment into the driver ops. This has no functional change other than assigning the pm ops statically. Cc: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 130 ++++++++++----------- 1 file changed, 64 insertions(+), 66 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index 9420c40f2993..359261ba3de1 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -53,8 +53,6 @@ #if defined(CONFIG_PM) #define dev_to_sdio_func(d) container_of(d, struct sdio_func, dev) #define to_sdio_driver(d) container_of(d, struct sdio_driver, drv) -static int hifDeviceSuspend(struct device *dev); -static int hifDeviceResume(struct device *dev); #endif /* CONFIG_PM */ static void delHifDevice(struct hif_device * device); static int Func0_CMD52WriteByte(struct mmc_card *card, unsigned int address, unsigned char byte); @@ -165,23 +163,77 @@ static void ath6kl_hifdev_remove(struct sdio_func *func) AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceRemoved\n")); } +#if defined(CONFIG_PM) +static int hifDeviceSuspend(struct device *dev) +{ + struct sdio_func *func = dev_to_sdio_func(dev); + int status = 0; + struct hif_device *device; + + device = ath6kl_get_hifdev(func); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceSuspend\n")); + + if (device && device->claimedContext && + osdrvCallbacks.deviceSuspendHandler) { + /* set true first for PowerStateChangeNotify(..) */ + device->is_suspend = true; + status = osdrvCallbacks. + deviceSuspendHandler(device->claimedContext); + if (status) + device->is_suspend = false; + } + + CleanupHIFScatterResources(device); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceSuspend\n")); + + switch (status) { + case 0: + return 0; + case A_EBUSY: + /* Hack for kernel in order to support deep sleep and wow */ + return -EBUSY; + default: + return -1; + } +} + +static int hifDeviceResume(struct device *dev) +{ + struct sdio_func *func = dev_to_sdio_func(dev); + int status = 0; + struct hif_device *device; + + device = ath6kl_get_hifdev(func); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceResume\n")); + if (device && device->claimedContext && + osdrvCallbacks.deviceSuspendHandler) { + status = osdrvCallbacks. + deviceResumeHandler(device->claimedContext); + if (status == 0) + device->is_suspend = false; + } + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceResume\n")); + + return status; +} + +static const struct dev_pm_ops ar6k_device_pm_ops = { + .suspend = hifDeviceSuspend, + .resume = hifDeviceResume, +}; +#endif /* CONFIG_PM */ + static struct sdio_driver ath6kl_hifdev_driver = { .name = "ath6kl_hifdev", .id_table = ath6kl_hifdev_ids, .probe = ath6kl_hifdev_probe, .remove = ath6kl_hifdev_remove, -}; - #if defined(CONFIG_PM) -/* New suspend/resume based on linux-2.6.32 - * Need to patch linux-2.6.32 with mmc2.6.32_suspend.patch - * Need to patch with msmsdcc2.6.29_suspend.patch for msm_sdcc host - */ -static struct dev_pm_ops ar6k_device_pm_ops = { - .suspend = hifDeviceSuspend, - .resume = hifDeviceResume, + .drv = { + .pm = &ar6k_device_pm_ops, + }, +#endif }; -#endif /* CONFIG_PM */ /* make sure we only unregister when registered. */ static int registered = 0; @@ -218,11 +270,6 @@ int HIFInit(OSDRV_CALLBACKS *callbacks) /* Register with bus driver core */ registered = 1; -#if defined(CONFIG_PM) - if (callbacks->deviceSuspendHandler && callbacks->deviceResumeHandler) - ath6kl_hifdev_driver.drv.pm = &ar6k_device_pm_ops; -#endif /* CONFIG_PM */ - r = sdio_register_driver(&ath6kl_hifdev_driver); if (r < 0) return r; @@ -1112,55 +1159,6 @@ static int hifEnableFunc(struct hif_device *device, struct sdio_func *func) return ret; } -#if defined(CONFIG_PM) -static int hifDeviceSuspend(struct device *dev) -{ - struct sdio_func *func=dev_to_sdio_func(dev); - int status = 0; - struct hif_device *device; - - device = ath6kl_get_hifdev(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceSuspend\n")); - if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { - device->is_suspend = true; /* set true first for PowerStateChangeNotify(..) */ - status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext); - if (status) { - device->is_suspend = false; - } - } - CleanupHIFScatterResources(device); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceSuspend\n")); - - switch (status) { - case 0: - return 0; - case A_EBUSY: - return -EBUSY; /* Hack for kernel in order to support deep sleep and wow */ - default: - return -1; - } -} - -static int hifDeviceResume(struct device *dev) -{ - struct sdio_func *func=dev_to_sdio_func(dev); - int status = 0; - struct hif_device *device; - - device = ath6kl_get_hifdev(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceResume\n")); - if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { - status = osdrvCallbacks.deviceResumeHandler(device->claimedContext); - if (status == 0) { - device->is_suspend = false; - } - } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceResume\n")); - - return status; -} -#endif /* CONFIG_PM */ - /* * This should be moved to AR6K HTC layer. */ -- cgit v1.2.3 From 437c567b1a02bdd50a9d0ce57c1310b827eb0ae4 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:56:28 -0700 Subject: ath6kl: rename the pm ops to something more sensible This has no functional changes. Cc: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index 359261ba3de1..314c5525dbc2 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -164,14 +164,14 @@ static void ath6kl_hifdev_remove(struct sdio_func *func) } #if defined(CONFIG_PM) -static int hifDeviceSuspend(struct device *dev) +static int ath6kl_hifdev_suspend(struct device *dev) { struct sdio_func *func = dev_to_sdio_func(dev); int status = 0; struct hif_device *device; device = ath6kl_get_hifdev(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceSuspend\n")); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +ath6kl_hifdev_suspend\n")); if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { @@ -184,7 +184,7 @@ static int hifDeviceSuspend(struct device *dev) } CleanupHIFScatterResources(device); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceSuspend\n")); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -ath6kl_hifdev_suspend\n")); switch (status) { case 0: @@ -197,14 +197,14 @@ static int hifDeviceSuspend(struct device *dev) } } -static int hifDeviceResume(struct device *dev) +static int ath6kl_hifdev_resume(struct device *dev) { struct sdio_func *func = dev_to_sdio_func(dev); int status = 0; struct hif_device *device; device = ath6kl_get_hifdev(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +hifDeviceResume\n")); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +ath6kl_hifdev_resume\n")); if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { status = osdrvCallbacks. @@ -212,14 +212,14 @@ static int hifDeviceResume(struct device *dev) if (status == 0) device->is_suspend = false; } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceResume\n")); + AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -ath6kl_hifdev_resume\n")); return status; } -static const struct dev_pm_ops ar6k_device_pm_ops = { - .suspend = hifDeviceSuspend, - .resume = hifDeviceResume, +static const struct dev_pm_ops ath6kl_hifdev_pmops = { + .suspend = ath6kl_hifdev_suspend, + .resume = ath6kl_hifdev_resume, }; #endif /* CONFIG_PM */ @@ -230,7 +230,7 @@ static struct sdio_driver ath6kl_hifdev_driver = { .remove = ath6kl_hifdev_remove, #if defined(CONFIG_PM) .drv = { - .pm = &ar6k_device_pm_ops, + .pm = &ath6kl_hifdev_pmops, }, #endif }; -- cgit v1.2.3 From 628a7dd85cff27db40a1759d883a76a6fef20346 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 29 Mar 2011 17:56:29 -0700 Subject: ath6kl: remove chatty debug messages on ath6kl driver ops These do not help in any way. Cc: Naveen Singh Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index 314c5525dbc2..c8f1a6ec37ad 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -144,7 +144,6 @@ static void ath6kl_hifdev_remove(struct sdio_func *func) { int status = 0; struct hif_device *device; - AR_DEBUG_ASSERT(func != NULL); device = ath6kl_get_hifdev(func); if (device->claimedContext != NULL) @@ -159,8 +158,6 @@ static void ath6kl_hifdev_remove(struct sdio_func *func) CleanupHIFScatterResources(device); delHifDevice(device); - AR_DEBUG_ASSERT(status == 0); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceRemoved\n")); } #if defined(CONFIG_PM) @@ -171,7 +168,6 @@ static int ath6kl_hifdev_suspend(struct device *dev) struct hif_device *device; device = ath6kl_get_hifdev(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +ath6kl_hifdev_suspend\n")); if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { @@ -184,7 +180,6 @@ static int ath6kl_hifdev_suspend(struct device *dev) } CleanupHIFScatterResources(device); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -ath6kl_hifdev_suspend\n")); switch (status) { case 0: @@ -204,7 +199,6 @@ static int ath6kl_hifdev_resume(struct device *dev) struct hif_device *device; device = ath6kl_get_hifdev(func); - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: +ath6kl_hifdev_resume\n")); if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) { status = osdrvCallbacks. @@ -212,7 +206,6 @@ static int ath6kl_hifdev_resume(struct device *dev) if (status == 0) device->is_suspend = false; } - AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -ath6kl_hifdev_resume\n")); return status; } -- cgit v1.2.3 From e428b6d67d33d2ea8a0d68ddf5cb4809e0cc1900 Mon Sep 17 00:00:00 2001 From: Vasanthakumar Thiagarajan Date: Mon, 2 May 2011 11:22:39 +0530 Subject: ath6kl: Remove duplicate mbox_host_reg.h Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ath6kl/bmi/include/bmi_internal.h | 2 +- .../staging/ath6kl/hif/sdio/linux_sdio/src/hif.c | 2 +- drivers/staging/ath6kl/htc2/AR6000/ar6k.c | 2 +- drivers/staging/ath6kl/htc2/AR6000/ar6k_events.c | 2 +- .../include/common/AR6002/hw2.0/hw/mbox_host_reg.h | 386 --------------------- .../common/AR6002/hw4.0/hw/mbox_wlan_host_reg.h | 51 --- drivers/staging/ath6kl/miscdrv/common_drv.c | 2 +- 7 files changed, 5 insertions(+), 442 deletions(-) delete mode 100644 drivers/staging/ath6kl/include/common/AR6002/hw2.0/hw/mbox_host_reg.h (limited to 'drivers/staging/ath6kl/hif/sdio/linux_sdio/src') diff --git a/drivers/staging/ath6kl/bmi/include/bmi_internal.h b/drivers/staging/ath6kl/bmi/include/bmi_internal.h index 6ae2ea7233d8..b18d3d33255f 100644 --- a/drivers/staging/ath6kl/bmi/include/bmi_internal.h +++ b/drivers/staging/ath6kl/bmi/include/bmi_internal.h @@ -30,7 +30,7 @@ #include "a_osapi.h" #define ATH_MODULE_NAME bmi #include "a_debug.h" -#include "AR6002/hw2.0/hw/mbox_host_reg.h" +#include "hw/mbox_host_reg.h" #include "bmi_msg.h" #define ATH_DEBUG_BMI ATH_DEBUG_MAKE_MODULE_MASK(0) diff --git a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c index c8f1a6ec37ad..5f5d67720fa4 100644 --- a/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c +++ b/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c @@ -37,7 +37,7 @@ #include "hif_internal.h" #define ATH_MODULE_NAME hif #include "a_debug.h" -#include "AR6002/hw2.0/hw/mbox_host_reg.h" +#include "hw/mbox_host_reg.h" #if HIF_USE_DMA_BOUNCE_BUFFER /* macro to check if DMA buffer is WORD-aligned and DMA-able. Most host controllers assume the diff --git a/drivers/staging/ath6kl/htc2/AR6000/ar6k.c b/drivers/staging/ath6kl/htc2/AR6000/ar6k.c index 05f6d157d34a..c90f976568d8 100644 --- a/drivers/staging/ath6kl/htc2/AR6000/ar6k.c +++ b/drivers/staging/ath6kl/htc2/AR6000/ar6k.c @@ -26,7 +26,7 @@ #include "a_config.h" #include "athdefs.h" #include "a_types.h" -#include "AR6002/hw2.0/hw/mbox_host_reg.h" +#include "hw/mbox_host_reg.h" #include "a_osapi.h" #include "../htc_debug.h" #include "hif.h" diff --git a/drivers/staging/ath6kl/htc2/AR6000/ar6k_events.c b/drivers/staging/ath6kl/htc2/AR6000/ar6k_events.c index 5e6d1e062922..0f209d3a173c 100644 --- a/drivers/staging/ath6kl/htc2/AR6000/ar6k_events.c +++ b/drivers/staging/ath6kl/htc2/AR6000/ar6k_events.c @@ -26,7 +26,7 @@ #include "a_config.h" #include "athdefs.h" #include "a_types.h" -#include "AR6002/hw2.0/hw/mbox_host_reg.h" +#include "hw/mbox_host_reg.h" #include "a_osapi.h" #include "../htc_debug.h" #include "hif.h" diff --git a/drivers/staging/ath6kl/include/common/AR6002/hw2.0/hw/mbox_host_reg.h b/drivers/staging/ath6kl/include/common/AR6002/hw2.0/hw/mbox_host_reg.h deleted file mode 100644 index f836ae47a303..000000000000 --- a/drivers/staging/ath6kl/include/common/AR6002/hw2.0/hw/mbox_host_reg.h +++ /dev/null @@ -1,386 +0,0 @@ -#ifndef _MBOX_HOST_REG_REG_H_ -#define _MBOX_HOST_REG_REG_H_ - -#define HOST_INT_STATUS_ADDRESS 0x00000400 -#define HOST_INT_STATUS_OFFSET 0x00000400 -#define HOST_INT_STATUS_ERROR_MSB 7 -#define HOST_INT_STATUS_ERROR_LSB 7 -#define HOST_INT_STATUS_ERROR_MASK 0x00000080 -#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB) -#define HOST_INT_STATUS_ERROR_SET(x) (((x) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK) -#define HOST_INT_STATUS_CPU_MSB 6 -#define HOST_INT_STATUS_CPU_LSB 6 -#define HOST_INT_STATUS_CPU_MASK 0x00000040 -#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB) -#define HOST_INT_STATUS_CPU_SET(x) (((x) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK) -#define HOST_INT_STATUS_DRAGON_INT_MSB 5 -#define HOST_INT_STATUS_DRAGON_INT_LSB 5 -#define HOST_INT_STATUS_DRAGON_INT_MASK 0x00000020 -#define HOST_INT_STATUS_DRAGON_INT_GET(x) (((x) & HOST_INT_STATUS_DRAGON_INT_MASK) >> HOST_INT_STATUS_DRAGON_INT_LSB) -#define HOST_INT_STATUS_DRAGON_INT_SET(x) (((x) << HOST_INT_STATUS_DRAGON_INT_LSB) & HOST_INT_STATUS_DRAGON_INT_MASK) -#define HOST_INT_STATUS_COUNTER_MSB 4 -#define HOST_INT_STATUS_COUNTER_LSB 4 -#define HOST_INT_STATUS_COUNTER_MASK 0x00000010 -#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB) -#define HOST_INT_STATUS_COUNTER_SET(x) (((x) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK) -#define HOST_INT_STATUS_MBOX_DATA_MSB 3 -#define HOST_INT_STATUS_MBOX_DATA_LSB 0 -#define HOST_INT_STATUS_MBOX_DATA_MASK 0x0000000f -#define HOST_INT_STATUS_MBOX_DATA_GET(x) (((x) & HOST_INT_STATUS_MBOX_DATA_MASK) >> HOST_INT_STATUS_MBOX_DATA_LSB) -#define HOST_INT_STATUS_MBOX_DATA_SET(x) (((x) << HOST_INT_STATUS_MBOX_DATA_LSB) & HOST_INT_STATUS_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ADDRESS 0x00000401 -#define CPU_INT_STATUS_OFFSET 0x00000401 -#define CPU_INT_STATUS_BIT_MSB 7 -#define CPU_INT_STATUS_BIT_LSB 0 -#define CPU_INT_STATUS_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_BIT_GET(x) (((x) & CPU_INT_STATUS_BIT_MASK) >> CPU_INT_STATUS_BIT_LSB) -#define CPU_INT_STATUS_BIT_SET(x) (((x) << CPU_INT_STATUS_BIT_LSB) & CPU_INT_STATUS_BIT_MASK) - -#define ERROR_INT_STATUS_ADDRESS 0x00000402 -#define ERROR_INT_STATUS_OFFSET 0x00000402 -#define ERROR_INT_STATUS_SPI_MSB 3 -#define ERROR_INT_STATUS_SPI_LSB 3 -#define ERROR_INT_STATUS_SPI_MASK 0x00000008 -#define ERROR_INT_STATUS_SPI_GET(x) (((x) & ERROR_INT_STATUS_SPI_MASK) >> ERROR_INT_STATUS_SPI_LSB) -#define ERROR_INT_STATUS_SPI_SET(x) (((x) << ERROR_INT_STATUS_SPI_LSB) & ERROR_INT_STATUS_SPI_MASK) -#define ERROR_INT_STATUS_WAKEUP_MSB 2 -#define ERROR_INT_STATUS_WAKEUP_LSB 2 -#define ERROR_INT_STATUS_WAKEUP_MASK 0x00000004 -#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB) -#define ERROR_INT_STATUS_WAKEUP_SET(x) (((x) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK) -#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1 -#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB) -#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) -#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0 -#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB) -#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ADDRESS 0x00000403 -#define COUNTER_INT_STATUS_OFFSET 0x00000403 -#define COUNTER_INT_STATUS_COUNTER_MSB 7 -#define COUNTER_INT_STATUS_COUNTER_LSB 0 -#define COUNTER_INT_STATUS_COUNTER_MASK 0x000000ff -#define COUNTER_INT_STATUS_COUNTER_GET(x) (((x) & COUNTER_INT_STATUS_COUNTER_MASK) >> COUNTER_INT_STATUS_COUNTER_LSB) -#define COUNTER_INT_STATUS_COUNTER_SET(x) (((x) << COUNTER_INT_STATUS_COUNTER_LSB) & COUNTER_INT_STATUS_COUNTER_MASK) - -#define MBOX_FRAME_ADDRESS 0x00000404 -#define MBOX_FRAME_OFFSET 0x00000404 -#define MBOX_FRAME_RX_EOM_MSB 7 -#define MBOX_FRAME_RX_EOM_LSB 4 -#define MBOX_FRAME_RX_EOM_MASK 0x000000f0 -#define MBOX_FRAME_RX_EOM_GET(x) (((x) & MBOX_FRAME_RX_EOM_MASK) >> MBOX_FRAME_RX_EOM_LSB) -#define MBOX_FRAME_RX_EOM_SET(x) (((x) << MBOX_FRAME_RX_EOM_LSB) & MBOX_FRAME_RX_EOM_MASK) -#define MBOX_FRAME_RX_SOM_MSB 3 -#define MBOX_FRAME_RX_SOM_LSB 0 -#define MBOX_FRAME_RX_SOM_MASK 0x0000000f -#define MBOX_FRAME_RX_SOM_GET(x) (((x) & MBOX_FRAME_RX_SOM_MASK) >> MBOX_FRAME_RX_SOM_LSB) -#define MBOX_FRAME_RX_SOM_SET(x) (((x) << MBOX_FRAME_RX_SOM_LSB) & MBOX_FRAME_RX_SOM_MASK) - -#define RX_LOOKAHEAD_VALID_ADDRESS 0x00000405 -#define RX_LOOKAHEAD_VALID_OFFSET 0x00000405 -#define RX_LOOKAHEAD_VALID_MBOX_MSB 3 -#define RX_LOOKAHEAD_VALID_MBOX_LSB 0 -#define RX_LOOKAHEAD_VALID_MBOX_MASK 0x0000000f -#define RX_LOOKAHEAD_VALID_MBOX_GET(x) (((x) & RX_LOOKAHEAD_VALID_MBOX_MASK) >> RX_LOOKAHEAD_VALID_MBOX_LSB) -#define RX_LOOKAHEAD_VALID_MBOX_SET(x) (((x) << RX_LOOKAHEAD_VALID_MBOX_LSB) & RX_LOOKAHEAD_VALID_MBOX_MASK) - -#define RX_LOOKAHEAD0_ADDRESS 0x00000408 -#define RX_LOOKAHEAD0_OFFSET 0x00000408 -#define RX_LOOKAHEAD0_DATA_MSB 7 -#define RX_LOOKAHEAD0_DATA_LSB 0 -#define RX_LOOKAHEAD0_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD0_DATA_GET(x) (((x) & RX_LOOKAHEAD0_DATA_MASK) >> RX_LOOKAHEAD0_DATA_LSB) -#define RX_LOOKAHEAD0_DATA_SET(x) (((x) << RX_LOOKAHEAD0_DATA_LSB) & RX_LOOKAHEAD0_DATA_MASK) - -#define RX_LOOKAHEAD1_ADDRESS 0x0000040c -#define RX_LOOKAHEAD1_OFFSET 0x0000040c -#define RX_LOOKAHEAD1_DATA_MSB 7 -#define RX_LOOKAHEAD1_DATA_LSB 0 -#define RX_LOOKAHEAD1_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD1_DATA_GET(x) (((x) & RX_LOOKAHEAD1_DATA_MASK) >> RX_LOOKAHEAD1_DATA_LSB) -#define RX_LOOKAHEAD1_DATA_SET(x) (((x) << RX_LOOKAHEAD1_DATA_LSB) & RX_LOOKAHEAD1_DATA_MASK) - -#define RX_LOOKAHEAD2_ADDRESS 0x00000410 -#define RX_LOOKAHEAD2_OFFSET 0x00000410 -#define RX_LOOKAHEAD2_DATA_MSB 7 -#define RX_LOOKAHEAD2_DATA_LSB 0 -#define RX_LOOKAHEAD2_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD2_DATA_GET(x) (((x) & RX_LOOKAHEAD2_DATA_MASK) >> RX_LOOKAHEAD2_DATA_LSB) -#define RX_LOOKAHEAD2_DATA_SET(x) (((x) << RX_LOOKAHEAD2_DATA_LSB) & RX_LOOKAHEAD2_DATA_MASK) - -#define RX_LOOKAHEAD3_ADDRESS 0x00000414 -#define RX_LOOKAHEAD3_OFFSET 0x00000414 -#define RX_LOOKAHEAD3_DATA_MSB 7 -#define RX_LOOKAHEAD3_DATA_LSB 0 -#define RX_LOOKAHEAD3_DATA_MASK 0x000000ff -#define RX_LOOKAHEAD3_DATA_GET(x) (((x) & RX_LOOKAHEAD3_DATA_MASK) >> RX_LOOKAHEAD3_DATA_LSB) -#define RX_LOOKAHEAD3_DATA_SET(x) (((x) << RX_LOOKAHEAD3_DATA_LSB) & RX_LOOKAHEAD3_DATA_MASK) - -#define INT_STATUS_ENABLE_ADDRESS 0x00000418 -#define INT_STATUS_ENABLE_OFFSET 0x00000418 -#define INT_STATUS_ENABLE_ERROR_MSB 7 -#define INT_STATUS_ENABLE_ERROR_LSB 7 -#define INT_STATUS_ENABLE_ERROR_MASK 0x00000080 -#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB) -#define INT_STATUS_ENABLE_ERROR_SET(x) (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK) -#define INT_STATUS_ENABLE_CPU_MSB 6 -#define INT_STATUS_ENABLE_CPU_LSB 6 -#define INT_STATUS_ENABLE_CPU_MASK 0x00000040 -#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB) -#define INT_STATUS_ENABLE_CPU_SET(x) (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK) -#define INT_STATUS_ENABLE_DRAGON_INT_MSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_LSB 5 -#define INT_STATUS_ENABLE_DRAGON_INT_MASK 0x00000020 -#define INT_STATUS_ENABLE_DRAGON_INT_GET(x) (((x) & INT_STATUS_ENABLE_DRAGON_INT_MASK) >> INT_STATUS_ENABLE_DRAGON_INT_LSB) -#define INT_STATUS_ENABLE_DRAGON_INT_SET(x) (((x) << INT_STATUS_ENABLE_DRAGON_INT_LSB) & INT_STATUS_ENABLE_DRAGON_INT_MASK) -#define INT_STATUS_ENABLE_COUNTER_MSB 4 -#define INT_STATUS_ENABLE_COUNTER_LSB 4 -#define INT_STATUS_ENABLE_COUNTER_MASK 0x00000010 -#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB) -#define INT_STATUS_ENABLE_COUNTER_SET(x) (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK) -#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3 -#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0 -#define INT_STATUS_ENABLE_MBOX_DATA_MASK 0x0000000f -#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB) -#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK) - -#define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419 -#define CPU_INT_STATUS_ENABLE_OFFSET 0x00000419 -#define CPU_INT_STATUS_ENABLE_BIT_MSB 7 -#define CPU_INT_STATUS_ENABLE_BIT_LSB 0 -#define CPU_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB) -#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK) - -#define ERROR_STATUS_ENABLE_ADDRESS 0x0000041a -#define ERROR_STATUS_ENABLE_OFFSET 0x0000041a -#define ERROR_STATUS_ENABLE_WAKEUP_MSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_LSB 2 -#define ERROR_STATUS_ENABLE_WAKEUP_MASK 0x00000004 -#define ERROR_STATUS_ENABLE_WAKEUP_GET(x) (((x) & ERROR_STATUS_ENABLE_WAKEUP_MASK) >> ERROR_STATUS_ENABLE_WAKEUP_LSB) -#define ERROR_STATUS_ENABLE_WAKEUP_SET(x) (((x) << ERROR_STATUS_ENABLE_WAKEUP_LSB) & ERROR_STATUS_ENABLE_WAKEUP_MASK) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002 -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) -#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 0x00000001 -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) -#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) - -#define COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_OFFSET 0x0000041b -#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7 -#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0 -#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 0x000000ff -#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB) -#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) - -#define COUNT_ADDRESS 0x00000420 -#define COUNT_OFFSET 0x00000420 -#define COUNT_VALUE_MSB 7 -#define COUNT_VALUE_LSB 0 -#define COUNT_VALUE_MASK 0x000000ff -#define COUNT_VALUE_GET(x) (((x) & COUNT_VALUE_MASK) >> COUNT_VALUE_LSB) -#define COUNT_VALUE_SET(x) (((x) << COUNT_VALUE_LSB) & COUNT_VALUE_MASK) - -#define COUNT_DEC_ADDRESS 0x00000440 -#define COUNT_DEC_OFFSET 0x00000440 -#define COUNT_DEC_VALUE_MSB 7 -#define COUNT_DEC_VALUE_LSB 0 -#define COUNT_DEC_VALUE_MASK 0x000000ff -#define COUNT_DEC_VALUE_GET(x) (((x) & COUNT_DEC_VALUE_MASK) >> COUNT_DEC_VALUE_LSB) -#define COUNT_DEC_VALUE_SET(x) (((x) << COUNT_DEC_VALUE_LSB) & COUNT_DEC_VALUE_MASK) - -#define SCRATCH_ADDRESS 0x00000460 -#define SCRATCH_OFFSET 0x00000460 -#define SCRATCH_VALUE_MSB 7 -#define SCRATCH_VALUE_LSB 0 -#define SCRATCH_VALUE_MASK 0x000000ff -#define SCRATCH_VALUE_GET(x) (((x) & SCRATCH_VALUE_MASK) >> SCRATCH_VALUE_LSB) -#define SCRATCH_VALUE_SET(x) (((x) << SCRATCH_VALUE_LSB) & SCRATCH_VALUE_MASK) - -#define FIFO_TIMEOUT_ADDRESS 0x00000468 -#define FIFO_TIMEOUT_OFFSET 0x00000468 -#define FIFO_TIMEOUT_VALUE_MSB 7 -#define FIFO_TIMEOUT_VALUE_LSB 0 -#define FIFO_TIMEOUT_VALUE_MASK 0x000000ff -#define FIFO_TIMEOUT_VALUE_GET(x) (((x) & FIFO_TIMEOUT_VALUE_MASK) >> FIFO_TIMEOUT_VALUE_LSB) -#define FIFO_TIMEOUT_VALUE_SET(x) (((x) << FIFO_TIMEOUT_VALUE_LSB) & FIFO_TIMEOUT_VALUE_MASK) - -#define FIFO_TIMEOUT_ENABLE_ADDRESS 0x00000469 -#define FIFO_TIMEOUT_ENABLE_OFFSET 0x00000469 -#define FIFO_TIMEOUT_ENABLE_SET_MSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_LSB 0 -#define FIFO_TIMEOUT_ENABLE_SET_MASK 0x00000001 -#define FIFO_TIMEOUT_ENABLE_SET_GET(x) (((x) & FIFO_TIMEOUT_ENABLE_SET_MASK) >> FIFO_TIMEOUT_ENABLE_SET_LSB) -#define FIFO_TIMEOUT_ENABLE_SET_SET(x) (((x) << FIFO_TIMEOUT_ENABLE_SET_LSB) & FIFO_TIMEOUT_ENABLE_SET_MASK) - -#define DISABLE_SLEEP_ADDRESS 0x0000046a -#define DISABLE_SLEEP_OFFSET 0x0000046a -#define DISABLE_SLEEP_FOR_INT_MSB 1 -#define DISABLE_SLEEP_FOR_INT_LSB 1 -#define DISABLE_SLEEP_FOR_INT_MASK 0x00000002 -#define DISABLE_SLEEP_FOR_INT_GET(x) (((x) & DISABLE_SLEEP_FOR_INT_MASK) >> DISABLE_SLEEP_FOR_INT_LSB) -#define DISABLE_SLEEP_FOR_INT_SET(x) (((x) << DISABLE_SLEEP_FOR_INT_LSB) & DISABLE_SLEEP_FOR_INT_MASK) -#define DISABLE_SLEEP_ON_MSB 0 -#define DISABLE_SLEEP_ON_LSB 0 -#define DISABLE_SLEEP_ON_MASK 0x00000001 -#define DISABLE_SLEEP_ON_GET(x) (((x) & DISABLE_SLEEP_ON_MASK) >> DISABLE_SLEEP_ON_LSB) -#define DISABLE_SLEEP_ON_SET(x) (((x) << DISABLE_SLEEP_ON_LSB) & DISABLE_SLEEP_ON_MASK) - -#define LOCAL_BUS_ADDRESS 0x00000470 -#define LOCAL_BUS_OFFSET 0x00000470 -#define LOCAL_BUS_STATE_MSB 1 -#define LOCAL_BUS_STATE_LSB 0 -#define LOCAL_BUS_STATE_MASK 0x00000003 -#define LOCAL_BUS_STATE_GET(x) (((x) & LOCAL_BUS_STATE_MASK) >> LOCAL_BUS_STATE_LSB) -#define LOCAL_BUS_STATE_SET(x) (((x) << LOCAL_BUS_STATE_LSB) & LOCAL_BUS_STATE_MASK) - -#define INT_WLAN_ADDRESS 0x00000472 -#define INT_WLAN_OFFSET 0x00000472 -#define INT_WLAN_VECTOR_MSB 7 -#define INT_WLAN_VECTOR_LSB 0 -#define INT_WLAN_VECTOR_MASK 0x000000ff -#define INT_WLAN_VECTOR_GET(x) (((x) & INT_WLAN_VECTOR_MASK) >> INT_WLAN_VECTOR_LSB) -#define INT_WLAN_VECTOR_SET(x) (((x) << INT_WLAN_VECTOR_LSB) & INT_WLAN_VECTOR_MASK) - -#define WINDOW_DATA_ADDRESS 0x00000474 -#define WINDOW_DATA_OFFSET 0x00000474 -#define WINDOW_DATA_DATA_MSB 7 -#define WINDOW_DATA_DATA_LSB 0 -#define WINDOW_DATA_DATA_MASK 0x000000ff -#define WINDOW_DATA_DATA_GET(x) (((x) & WINDOW_DATA_DATA_MASK) >> WINDOW_DATA_DATA_LSB) -#define WINDOW_DATA_DATA_SET(x) (((x) << WINDOW_DATA_DATA_LSB) & WINDOW_DATA_DATA_MASK) - -#define WINDOW_WRITE_ADDR_ADDRESS 0x00000478 -#define WINDOW_WRITE_ADDR_OFFSET 0x00000478 -#define WINDOW_WRITE_ADDR_ADDR_MSB 7 -#define WINDOW_WRITE_ADDR_ADDR_LSB 0 -#define WINDOW_WRITE_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_WRITE_ADDR_ADDR_GET(x) (((x) & WINDOW_WRITE_ADDR_ADDR_MASK) >> WINDOW_WRITE_ADDR_ADDR_LSB) -#define WINDOW_WRITE_ADDR_ADDR_SET(x) (((x) << WINDOW_WRITE_ADDR_ADDR_LSB) & WINDOW_WRITE_ADDR_ADDR_MASK) - -#define WINDOW_READ_ADDR_ADDRESS 0x0000047c -#define WINDOW_READ_ADDR_OFFSET 0x0000047c -#define WINDOW_READ_ADDR_ADDR_MSB 7 -#define WINDOW_READ_ADDR_ADDR_LSB 0 -#define WINDOW_READ_ADDR_ADDR_MASK 0x000000ff -#define WINDOW_READ_ADDR_ADDR_GET(x) (((x) & WINDOW_READ_ADDR_ADDR_MASK) >> WINDOW_READ_ADDR_ADDR_LSB) -#define WINDOW_READ_ADDR_ADDR_SET(x) (((x) << WINDOW_READ_ADDR_ADDR_LSB) & WINDOW_READ_ADDR_ADDR_MASK) - -#define SPI_CONFIG_ADDRESS 0x00000480 -#define SPI_CONFIG_OFFSET 0x00000480 -#define SPI_CONFIG_SPI_RESET_MSB 4 -#define SPI_CONFIG_SPI_RESET_LSB 4 -#define SPI_CONFIG_SPI_RESET_MASK 0x00000010 -#define SPI_CONFIG_SPI_RESET_GET(x) (((x) & SPI_CONFIG_SPI_RESET_MASK) >> SPI_CONFIG_SPI_RESET_LSB) -#define SPI_CONFIG_SPI_RESET_SET(x) (((x) << SPI_CONFIG_SPI_RESET_LSB) & SPI_CONFIG_SPI_RESET_MASK) -#define SPI_CONFIG_INTERRUPT_ENABLE_MSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_LSB 3 -#define SPI_CONFIG_INTERRUPT_ENABLE_MASK 0x00000008 -#define SPI_CONFIG_INTERRUPT_ENABLE_GET(x) (((x) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) >> SPI_CONFIG_INTERRUPT_ENABLE_LSB) -#define SPI_CONFIG_INTERRUPT_ENABLE_SET(x) (((x) << SPI_CONFIG_INTERRUPT_ENABLE_LSB) & SPI_CONFIG_INTERRUPT_ENABLE_MASK) -#define SPI_CONFIG_TEST_MODE_MSB 2 -#define SPI_CONFIG_TEST_MODE_LSB 2 -#define SPI_CONFIG_TEST_MODE_MASK 0x00000004 -#define SPI_CONFIG_TEST_MODE_GET(x) (((x) & SPI_CONFIG_TEST_MODE_MASK) >> SPI_CONFIG_TEST_MODE_LSB) -#define SPI_CONFIG_TEST_MODE_SET(x) (((x) << SPI_CONFIG_TEST_MODE_LSB) & SPI_CONFIG_TEST_MODE_MASK) -#define SPI_CONFIG_DATA_SIZE_MSB 1 -#define SPI_CONFIG_DATA_SIZE_LSB 0 -#define SPI_CONFIG_DATA_SIZE_MASK 0x00000003 -#define SPI_CONFIG_DATA_SIZE_GET(x) (((x) & SPI_CONFIG_DATA_SIZE_MASK) >> SPI_CONFIG_DATA_SIZE_LSB) -#define SPI_CONFIG_DATA_SIZE_SET(x) (((x) << SPI_CONFIG_DATA_SIZE_LSB) & SPI_CONFIG_DATA_SIZE_MASK) - -#define SPI_STATUS_ADDRESS 0x00000481 -#define SPI_STATUS_OFFSET 0x00000481 -#define SPI_STATUS_ADDR_ERR_MSB 3 -#define SPI_STATUS_ADDR_ERR_LSB 3 -#define SPI_STATUS_ADDR_ERR_MASK 0x00000008 -#define SPI_STATUS_ADDR_ERR_GET(x) (((x) & SPI_STATUS_ADDR_ERR_MASK) >> SPI_STATUS_ADDR_ERR_LSB) -#define SPI_STATUS_ADDR_ERR_SET(x) (((x) << SPI_STATUS_ADDR_ERR_LSB) & SPI_STATUS_ADDR_ERR_MASK) -#define SPI_STATUS_RD_ERR_MSB 2 -#define SPI_STATUS_RD_ERR_LSB 2 -#define SPI_STATUS_RD_ERR_MASK 0x00000004 -#define SPI_STATUS_RD_ERR_GET(x) (((x) & SPI_STATUS_RD_ERR_MASK) >> SPI_STATUS_RD_ERR_LSB) -#define SPI_STATUS_RD_ERR_SET(x) (((x) << SPI_STATUS_RD_ERR_LSB) & SPI_STATUS_RD_ERR_MASK) -#define SPI_STATUS_WR_ERR_MSB 1 -#define SPI_STATUS_WR_ERR_LSB 1 -#define SPI_STATUS_WR_ERR_MASK 0x00000002 -#define SPI_STATUS_WR_ERR_GET(x) (((x) & SPI_STATUS_WR_ERR_MASK) >> SPI_STATUS_WR_ERR_LSB) -#define SPI_STATUS_WR_ERR_SET(x) (((x) << SPI_STATUS_WR_ERR_LSB) & SPI_STATUS_WR_ERR_MASK) -#define SPI_STATUS_READY_MSB 0 -#define SPI_STATUS_READY_LSB 0 -#define SPI_STATUS_READY_MASK 0x00000001 -#define SPI_STATUS_READY_GET(x) (((x) & SPI_STATUS_READY_MASK) >> SPI_STATUS_READY_LSB) -#define SPI_STATUS_READY_SET(x) (((x) << SPI_STATUS_READY_LSB) & SPI_STATUS_READY_MASK) - -#define NON_ASSOC_SLEEP_EN_ADDRESS 0x00000482 -#define NON_ASSOC_SLEEP_EN_OFFSET 0x00000482 -#define NON_ASSOC_SLEEP_EN_BIT_MSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_LSB 0 -#define NON_ASSOC_SLEEP_EN_BIT_MASK 0x00000001 -#define NON_ASSOC_SLEEP_EN_BIT_GET(x) (((x) & NON_ASSOC_SLEEP_EN_BIT_MASK) >> NON_ASSOC_SLEEP_EN_BIT_LSB) -#define NON_ASSOC_SLEEP_EN_BIT_SET(x) (((x) << NON_ASSOC_SLEEP_EN_BIT_LSB) & NON_ASSOC_SLEEP_EN_BIT_MASK) - -#define CIS_WINDOW_ADDRESS 0x00000600 -#define CIS_WINDOW_OFFSET 0x00000600 -#define CIS_WINDOW_DATA_MSB 7 -#define CIS_WINDOW_DATA_LSB 0 -#define CIS_WINDOW_DATA_MASK 0x000000ff -#define CIS_WINDOW_DATA_GET(x) (((x) & CIS_WINDOW_DATA_MASK) >> CIS_WINDOW_DATA_LSB) -#define CIS_WINDOW_DATA_SET(x) (((x) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) - - -#ifndef __ASSEMBLER__ - -typedef struct mbox_host_reg_reg_s { - unsigned char pad0[1024]; /* pad to 0x400 */ - volatile unsigned char host_int_status; - volatile unsigned char cpu_int_status; - volatile unsigned char error_int_status; - volatile unsigned char counter_int_status; - volatile unsigned char mbox_frame; - volatile unsigned char rx_lookahead_valid; - unsigned char pad1[2]; /* pad to 0x408 */ - volatile unsigned char rx_lookahead0[4]; - volatile unsigned char rx_lookahead1[4]; - volatile unsigned char rx_lookahead2[4]; - volatile unsigned char rx_lookahead3[4]; - volatile unsigned char int_status_enable; - volatile unsigned char cpu_int_status_enable; - volatile unsigned char error_status_enable; - volatile unsigned char counter_int_status_enable; - unsigned char pad2[4]; /* pad to 0x420 */ - volatile unsigned char count[8]; - unsigned char pad3[24]; /* pad to 0x440 */ - volatile unsigned char count_dec[32]; - volatile unsigned char scratch[8]; - volatile unsigned char fifo_timeout; - volatile unsigned char fifo_timeout_enable; - volatile unsigned char disable_sleep; - unsigned char pad4[5]; /* pad to 0x470 */ - volatile unsigned char local_bus; - unsigned char pad5[1]; /* pad to 0x472 */ - volatile unsigned char int_wlan; - unsigned char pad6[1]; /* pad to 0x474 */ - volatile unsigned char window_data[4]; - volatile unsigned char window_write_addr[4]; - volatile unsigned char window_read_addr[4]; - volatile unsigned char spi_config; - volatile unsigned char spi_status; - volatile unsigned char non_assoc_sleep_en; - unsigned char pad7[381]; /* pad to 0x600 */ - volatile unsigned char cis_window[512]; -} mbox_host_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - -#endif /* _MBOX_HOST_REG_H_ */ diff --git a/drivers/staging/ath6kl/include/common/AR6002/hw4.0/hw/mbox_wlan_host_reg.h b/drivers/staging/ath6kl/include/common/AR6002/hw4.0/hw/mbox_wlan_host_reg.h index 60855021c2b0..038d0d019273 100644 --- a/drivers/staging/ath6kl/include/common/AR6002/hw4.0/hw/mbox_wlan_host_reg.h +++ b/drivers/staging/ath6kl/include/common/AR6002/hw4.0/hw/mbox_wlan_host_reg.h @@ -468,55 +468,4 @@ #define CIS_WINDOW_DATA_SET(x) (((x) << CIS_WINDOW_DATA_LSB) & CIS_WINDOW_DATA_MASK) -#ifndef __ASSEMBLER__ - -typedef struct mbox_wlan_host_reg_reg_s { - unsigned char pad0[1024]; /* pad to 0x400 */ - volatile unsigned char host_int_status; - volatile unsigned char cpu_int_status; - volatile unsigned char error_int_status; - volatile unsigned char counter_int_status; - volatile unsigned char mbox_frame; - volatile unsigned char rx_lookahead_valid; - volatile unsigned char host_int_status2; - volatile unsigned char gmbox_rx_avail; - volatile unsigned char rx_lookahead0[4]; - volatile unsigned char rx_lookahead1[4]; - volatile unsigned char rx_lookahead2[4]; - volatile unsigned char rx_lookahead3[4]; - volatile unsigned char int_status_enable; - volatile unsigned char cpu_int_status_enable; - volatile unsigned char error_status_enable; - volatile unsigned char counter_int_status_enable; - unsigned char pad1[4]; /* pad to 0x420 */ - volatile unsigned char count[8]; - unsigned char pad2[24]; /* pad to 0x440 */ - volatile unsigned char count_dec[32]; - volatile unsigned char scratch[8]; - volatile unsigned char fifo_timeout; - volatile unsigned char fifo_timeout_enable; - volatile unsigned char disable_sleep; - unsigned char pad3[5]; /* pad to 0x470 */ - volatile unsigned char local_bus; - unsigned char pad4[1]; /* pad to 0x472 */ - volatile unsigned char int_wlan; - unsigned char pad5[1]; /* pad to 0x474 */ - volatile unsigned char window_data[4]; - volatile unsigned char window_write_addr[4]; - volatile unsigned char window_read_addr[4]; - volatile unsigned char host_ctrl_spi_config; - volatile unsigned char host_ctrl_spi_status; - volatile unsigned char non_assoc_sleep_en; - volatile unsigned char cpu_dbg_sel; - volatile unsigned char cpu_dbg[4]; - volatile unsigned char int_status2_enable; - unsigned char pad6[7]; /* pad to 0x490 */ - volatile unsigned char gmbox_rx_lookahead[8]; - volatile unsigned char gmbox_rx_lookahead_mux; - unsigned char pad7[359]; /* pad to 0x600 */ - volatile unsigned char cis_window[512]; -} mbox_wlan_host_reg_reg_t; - -#endif /* __ASSEMBLER__ */ - #endif /* _MBOX_WLAN_HOST_REG_H_ */ diff --git a/drivers/staging/ath6kl/miscdrv/common_drv.c b/drivers/staging/ath6kl/miscdrv/common_drv.c index 1434d1b9cfc9..23d972ad91dc 100644 --- a/drivers/staging/ath6kl/miscdrv/common_drv.c +++ b/drivers/staging/ath6kl/miscdrv/common_drv.c @@ -25,7 +25,7 @@ #include "athdefs.h" #include "a_types.h" -#include "AR6002/hw2.0/hw/mbox_host_reg.h" +#include "hw/mbox_host_reg.h" #include "AR6002/hw2.0/hw/si_reg.h" #include "AR6002/hw2.0/hw/gpio_reg.h" #include "AR6002/hw2.0/hw/rtc_reg.h" -- cgit v1.2.3