Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 249012
b: refs/heads/master
c: 09b6b5e
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and Greg Kroah-Hartman committed Apr 5, 2011
1 parent fce2207 commit 2c547e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f56a12dd58ca2025b22ac4caabb89c90e1f1b7b
refs/heads/master: 09b6b5e916afa32a4a4a4c9d7cb3ed00563d6b0e
65 changes: 28 additions & 37 deletions trunk/drivers/staging/ath6kl/hif/sdio/linux_sdio/src/hif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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[] = {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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(..) */
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 2c547e4

Please sign in to comment.