ath6kl: remove-typedef HIF_SCATTER_REQ

This requird two passes:

remove-typedef -s HIF_SCATTER_REQ \
	"struct hif_scatter_req" drivers/staging/ath6kl/

remove-typedef -s _HIF_SCATTER_REQ \
	"struct hif_scatter_req" drivers/staging/ath6kl/

Tested-by: Naveen Singh <nsingh@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Luis R. Rodriguez 2011-03-14 10:58:49 -07:00 committed by Greg Kroah-Hartman
parent 7038aac116
commit 0aaabb8e9c
7 changed files with 34 additions and 35 deletions

View file

@ -99,7 +99,7 @@ void AddToAsyncList(HIF_DEVICE *device, BUS_REQUEST *busrequest);
#define MAX_SCATTER_REQ_TRANSFER_SIZE 32*1024 #define MAX_SCATTER_REQ_TRANSFER_SIZE 32*1024
struct hif_scatter_req_priv { struct hif_scatter_req_priv {
HIF_SCATTER_REQ *pHifScatterReq; /* HIF scatter request with allocated entries */ struct hif_scatter_req *pHifScatterReq; /* HIF scatter request with allocated entries */
HIF_DEVICE *device; /* this device */ HIF_DEVICE *device; /* this device */
BUS_REQUEST *busrequest; /* request associated with request */ BUS_REQUEST *busrequest; /* request associated with request */
/* scatter list for linux */ /* scatter list for linux */

View file

@ -48,7 +48,7 @@
(((address) & 0x1FFFF) << 9) | \ (((address) & 0x1FFFF) << 9) | \
((bytes_blocks) & 0x1FF) ((bytes_blocks) & 0x1FF)
static void FreeScatterReq(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) static void FreeScatterReq(HIF_DEVICE *device, struct hif_scatter_req *pReq)
{ {
unsigned long flag; unsigned long flag;
@ -60,7 +60,7 @@ static void FreeScatterReq(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq)
} }
static HIF_SCATTER_REQ *AllocScatterReq(HIF_DEVICE *device) static struct hif_scatter_req *AllocScatterReq(HIF_DEVICE *device)
{ {
struct dl_list *pItem; struct dl_list *pItem;
unsigned long flag; unsigned long flag;
@ -72,7 +72,7 @@ static HIF_SCATTER_REQ *AllocScatterReq(HIF_DEVICE *device)
spin_unlock_irqrestore(&device->lock, flag); spin_unlock_irqrestore(&device->lock, flag);
if (pItem != NULL) { if (pItem != NULL) {
return A_CONTAINING_STRUCT(pItem, HIF_SCATTER_REQ, ListLink); return A_CONTAINING_STRUCT(pItem, struct hif_scatter_req, ListLink);
} }
return NULL; return NULL;
@ -88,7 +88,7 @@ int DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest)
struct mmc_command cmd; struct mmc_command cmd;
struct mmc_data data; struct mmc_data data;
struct hif_scatter_req_priv *pReqPriv; struct hif_scatter_req_priv *pReqPriv;
HIF_SCATTER_REQ *pReq; struct hif_scatter_req *pReq;
int status = 0; int status = 0;
struct scatterlist *pSg; struct scatterlist *pSg;
@ -199,7 +199,7 @@ int DoHifReadWriteScatter(HIF_DEVICE *device, BUS_REQUEST *busrequest)
} }
/* callback to issue a read-write scatter request */ /* callback to issue a read-write scatter request */
static int HifReadWriteScatter(HIF_DEVICE *device, HIF_SCATTER_REQ *pReq) static int HifReadWriteScatter(HIF_DEVICE *device, struct hif_scatter_req *pReq)
{ {
int status = A_EINVAL; int status = A_EINVAL;
u32 request = pReq->Request; u32 request = pReq->Request;
@ -305,7 +305,7 @@ int SetupHIFScatterSupport(HIF_DEVICE *device, struct hif_device_scatter_support
/* save the device instance*/ /* save the device instance*/
pReqPriv->device = device; pReqPriv->device = device;
/* allocate the scatter request */ /* allocate the scatter request */
pReqPriv->pHifScatterReq = (HIF_SCATTER_REQ *)A_MALLOC(sizeof(HIF_SCATTER_REQ) + pReqPriv->pHifScatterReq = (struct hif_scatter_req *)A_MALLOC(sizeof(struct hif_scatter_req) +
(MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item))); (MAX_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item)));
if (NULL == pReqPriv->pHifScatterReq) { if (NULL == pReqPriv->pHifScatterReq) {
@ -313,7 +313,7 @@ int SetupHIFScatterSupport(HIF_DEVICE *device, struct hif_device_scatter_support
break; break;
} }
/* just zero the main part of the scatter request */ /* just zero the main part of the scatter request */
A_MEMZERO(pReqPriv->pHifScatterReq, sizeof(HIF_SCATTER_REQ)); A_MEMZERO(pReqPriv->pHifScatterReq, sizeof(struct hif_scatter_req));
/* back pointer to the private struct */ /* back pointer to the private struct */
pReqPriv->pHifScatterReq->HIFPrivate[0] = pReqPriv; pReqPriv->pHifScatterReq->HIFPrivate[0] = pReqPriv;
/* allocate a bus request for this scatter request */ /* allocate a bus request for this scatter request */
@ -359,7 +359,7 @@ int SetupHIFScatterSupport(HIF_DEVICE *device, struct hif_device_scatter_support
void CleanupHIFScatterResources(HIF_DEVICE *device) void CleanupHIFScatterResources(HIF_DEVICE *device)
{ {
struct hif_scatter_req_priv *pReqPriv; struct hif_scatter_req_priv *pReqPriv;
HIF_SCATTER_REQ *pReq; struct hif_scatter_req *pReq;
/* empty the free list */ /* empty the free list */

View file

@ -587,7 +587,7 @@ void DevDumpRegisters(struct ar6k_device *pDev,
#define DEV_GET_VIRT_DMA_INFO(p) ((struct dev_scatter_dma_virtual_info *)((p)->HIFPrivate[0])) #define DEV_GET_VIRT_DMA_INFO(p) ((struct dev_scatter_dma_virtual_info *)((p)->HIFPrivate[0]))
static HIF_SCATTER_REQ *DevAllocScatterReq(HIF_DEVICE *Context) static struct hif_scatter_req *DevAllocScatterReq(HIF_DEVICE *Context)
{ {
struct dl_list *pItem; struct dl_list *pItem;
struct ar6k_device *pDev = (struct ar6k_device *)Context; struct ar6k_device *pDev = (struct ar6k_device *)Context;
@ -595,12 +595,12 @@ static HIF_SCATTER_REQ *DevAllocScatterReq(HIF_DEVICE *Context)
pItem = DL_ListRemoveItemFromHead(&pDev->ScatterReqHead); pItem = DL_ListRemoveItemFromHead(&pDev->ScatterReqHead);
UNLOCK_AR6K(pDev); UNLOCK_AR6K(pDev);
if (pItem != NULL) { if (pItem != NULL) {
return A_CONTAINING_STRUCT(pItem, HIF_SCATTER_REQ, ListLink); return A_CONTAINING_STRUCT(pItem, struct hif_scatter_req, ListLink);
} }
return NULL; return NULL;
} }
static void DevFreeScatterReq(HIF_DEVICE *Context, HIF_SCATTER_REQ *pReq) static void DevFreeScatterReq(HIF_DEVICE *Context, struct hif_scatter_req *pReq)
{ {
struct ar6k_device *pDev = (struct ar6k_device *)Context; struct ar6k_device *pDev = (struct ar6k_device *)Context;
LOCK_AR6K(pDev); LOCK_AR6K(pDev);
@ -608,7 +608,7 @@ static void DevFreeScatterReq(HIF_DEVICE *Context, HIF_SCATTER_REQ *pReq)
UNLOCK_AR6K(pDev); UNLOCK_AR6K(pDev);
} }
int DevCopyScatterListToFromDMABuffer(HIF_SCATTER_REQ *pReq, bool FromDMA) int DevCopyScatterListToFromDMABuffer(struct hif_scatter_req *pReq, bool FromDMA)
{ {
u8 *pDMABuffer = NULL; u8 *pDMABuffer = NULL;
int i, remaining; int i, remaining;
@ -651,7 +651,7 @@ int DevCopyScatterListToFromDMABuffer(HIF_SCATTER_REQ *pReq, bool FromDMA)
static void DevReadWriteScatterAsyncHandler(void *Context, HTC_PACKET *pPacket) static void DevReadWriteScatterAsyncHandler(void *Context, HTC_PACKET *pPacket)
{ {
struct ar6k_device *pDev = (struct ar6k_device *)Context; struct ar6k_device *pDev = (struct ar6k_device *)Context;
HIF_SCATTER_REQ *pReq = (HIF_SCATTER_REQ *)pPacket->pPktContext; struct hif_scatter_req *pReq = (struct hif_scatter_req *)pPacket->pPktContext;
AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+DevReadWriteScatterAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev)); AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+DevReadWriteScatterAsyncHandler: (dev: 0x%lX)\n", (unsigned long)pDev));
@ -664,7 +664,7 @@ static void DevReadWriteScatterAsyncHandler(void *Context, HTC_PACKET *pPacket)
AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-DevReadWriteScatterAsyncHandler \n")); AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-DevReadWriteScatterAsyncHandler \n"));
} }
static int DevReadWriteScatter(HIF_DEVICE *Context, HIF_SCATTER_REQ *pReq) static int DevReadWriteScatter(HIF_DEVICE *Context, struct hif_scatter_req *pReq)
{ {
struct ar6k_device *pDev = (struct ar6k_device *)Context; struct ar6k_device *pDev = (struct ar6k_device *)Context;
int status = 0; int status = 0;
@ -736,7 +736,7 @@ static int DevReadWriteScatter(HIF_DEVICE *Context, HIF_SCATTER_REQ *pReq)
static void DevCleanupVirtualScatterSupport(struct ar6k_device *pDev) static void DevCleanupVirtualScatterSupport(struct ar6k_device *pDev)
{ {
HIF_SCATTER_REQ *pReq; struct hif_scatter_req *pReq;
while (1) { while (1) {
pReq = DevAllocScatterReq((HIF_DEVICE *)pDev); pReq = DevAllocScatterReq((HIF_DEVICE *)pDev);
@ -755,17 +755,17 @@ static int DevSetupVirtualScatterSupport(struct ar6k_device *pDev)
int bufferSize, sgreqSize; int bufferSize, sgreqSize;
int i; int i;
struct dev_scatter_dma_virtual_info *pVirtualInfo; struct dev_scatter_dma_virtual_info *pVirtualInfo;
HIF_SCATTER_REQ *pReq; struct hif_scatter_req *pReq;
bufferSize = sizeof(struct dev_scatter_dma_virtual_info) + bufferSize = sizeof(struct dev_scatter_dma_virtual_info) +
2 * (A_GET_CACHE_LINE_BYTES()) + AR6K_MAX_TRANSFER_SIZE_PER_SCATTER; 2 * (A_GET_CACHE_LINE_BYTES()) + AR6K_MAX_TRANSFER_SIZE_PER_SCATTER;
sgreqSize = sizeof(HIF_SCATTER_REQ) + sgreqSize = sizeof(struct hif_scatter_req) +
(AR6K_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item)); (AR6K_SCATTER_ENTRIES_PER_REQ - 1) * (sizeof(struct hif_scatter_item));
for (i = 0; i < AR6K_SCATTER_REQS; i++) { for (i = 0; i < AR6K_SCATTER_REQS; i++) {
/* allocate the scatter request, buffer info and the actual virtual buffer itself */ /* allocate the scatter request, buffer info and the actual virtual buffer itself */
pReq = (HIF_SCATTER_REQ *)A_MALLOC(sgreqSize + bufferSize); pReq = (struct hif_scatter_req *)A_MALLOC(sgreqSize + bufferSize);
if (NULL == pReq) { if (NULL == pReq) {
status = A_NO_MEMORY; status = A_NO_MEMORY;
@ -885,7 +885,7 @@ int DevSetupMsgBundling(struct ar6k_device *pDev, int MaxMsgsPerTransfer)
return status; return status;
} }
int DevSubmitScatterRequest(struct ar6k_device *pDev, HIF_SCATTER_REQ *pScatterReq, bool Read, bool Async) int DevSubmitScatterRequest(struct ar6k_device *pDev, struct hif_scatter_req *pScatterReq, bool Read, bool Async)
{ {
int status; int status;

View file

@ -272,7 +272,7 @@ static INLINE int DevRecvPacket(struct ar6k_device *pDev, HTC_PACKET *pPacket, u
* *
*/ */
int DevCopyScatterListToFromDMABuffer(HIF_SCATTER_REQ *pReq, bool FromDMA); int DevCopyScatterListToFromDMABuffer(struct hif_scatter_req *pReq, bool FromDMA);
/* copy any READ data back into scatter list */ /* copy any READ data back into scatter list */
#define DEV_FINISH_SCATTER_OPERATION(pR) \ #define DEV_FINISH_SCATTER_OPERATION(pR) \
@ -287,7 +287,7 @@ do { \
} while (0) } while (0)
/* copy any WRITE data to bounce buffer */ /* copy any WRITE data to bounce buffer */
static INLINE int DEV_PREPARE_SCATTER_OPERATION(HIF_SCATTER_REQ *pReq) { static INLINE int DEV_PREPARE_SCATTER_OPERATION(struct hif_scatter_req *pReq) {
if ((pReq->Request & HIF_WRITE) && (pReq->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) { if ((pReq->Request & HIF_WRITE) && (pReq->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) {
return DevCopyScatterListToFromDMABuffer(pReq,TO_DMA_BUFFER); return DevCopyScatterListToFromDMABuffer(pReq,TO_DMA_BUFFER);
} else { } else {
@ -315,7 +315,7 @@ int DevCleanupMsgBundling(struct ar6k_device *pDev);
#define DEV_SCATTER_WRITE false #define DEV_SCATTER_WRITE false
#define DEV_SCATTER_ASYNC true #define DEV_SCATTER_ASYNC true
#define DEV_SCATTER_SYNC false #define DEV_SCATTER_SYNC false
int DevSubmitScatterRequest(struct ar6k_device *pDev, HIF_SCATTER_REQ *pScatterReq, bool Read, bool Async); int DevSubmitScatterRequest(struct ar6k_device *pDev, struct hif_scatter_req *pScatterReq, bool Read, bool Async);
#ifdef MBOXHW_UNIT_TEST #ifdef MBOXHW_UNIT_TEST
int DoMboxHWTest(struct ar6k_device *pDev); int DoMboxHWTest(struct ar6k_device *pDev);

View file

@ -879,7 +879,7 @@ static int AllocAndPrepareRxPackets(HTC_TARGET *target,
return status; return status;
} }
static void HTCAsyncRecvScatterCompletion(HIF_SCATTER_REQ *pScatterReq) static void HTCAsyncRecvScatterCompletion(struct hif_scatter_req *pScatterReq)
{ {
int i; int i;
HTC_PACKET *pPacket; HTC_PACKET *pPacket;
@ -991,7 +991,7 @@ static int HTCIssueRecvPacketBundle(HTC_TARGET *target,
bool PartialBundle) bool PartialBundle)
{ {
int status = 0; int status = 0;
HIF_SCATTER_REQ *pScatterReq; struct hif_scatter_req *pScatterReq;
int i, totalLength; int i, totalLength;
int pktsToScatter; int pktsToScatter;
HTC_PACKET *pPacket; HTC_PACKET *pPacket;

View file

@ -264,7 +264,7 @@ static INLINE void GetHTCSendPackets(HTC_TARGET *target,
} }
static void HTCAsyncSendScatterCompletion(HIF_SCATTER_REQ *pScatterReq) static void HTCAsyncSendScatterCompletion(struct hif_scatter_req *pScatterReq)
{ {
int i; int i;
HTC_PACKET *pPacket; HTC_PACKET *pPacket;
@ -316,7 +316,7 @@ static void HTCIssueSendBundle(HTC_ENDPOINT *pEndpoint,
{ {
int pktsToScatter; int pktsToScatter;
unsigned int scatterSpaceRemaining; unsigned int scatterSpaceRemaining;
HIF_SCATTER_REQ *pScatterReq = NULL; struct hif_scatter_req *pScatterReq = NULL;
int i, packetsInScatterReq; int i, packetsInScatterReq;
unsigned int transferLength; unsigned int transferLength;
HTC_PACKET *pPacket; HTC_PACKET *pPacket;

View file

@ -276,9 +276,8 @@ struct hif_scatter_item {
void *pCallerContexts[2]; /* space for caller to insert a context associated with this item */ void *pCallerContexts[2]; /* space for caller to insert a context associated with this item */
}; };
struct _HIF_SCATTER_REQ; struct hif_scatter_req;
typedef void ( *HIF_SCATTER_COMP_CB)(struct hif_scatter_req *);
typedef void ( *HIF_SCATTER_COMP_CB)(struct _HIF_SCATTER_REQ *);
typedef enum _HIF_SCATTER_METHOD { typedef enum _HIF_SCATTER_METHOD {
HIF_SCATTER_NONE = 0, HIF_SCATTER_NONE = 0,
@ -286,7 +285,7 @@ typedef enum _HIF_SCATTER_METHOD {
HIF_SCATTER_DMA_BOUNCE, /* Uses SG DMA but HIF layer uses an internal bounce buffer */ HIF_SCATTER_DMA_BOUNCE, /* Uses SG DMA but HIF layer uses an internal bounce buffer */
} HIF_SCATTER_METHOD; } HIF_SCATTER_METHOD;
typedef struct _HIF_SCATTER_REQ { struct hif_scatter_req {
struct dl_list ListLink; /* link management */ struct dl_list ListLink; /* link management */
u32 Address; /* address for the read/write operation */ u32 Address; /* address for the read/write operation */
u32 Request; /* request flags */ u32 Request; /* request flags */
@ -300,11 +299,11 @@ typedef struct _HIF_SCATTER_REQ {
void *HIFPrivate[4]; /* HIF private area */ void *HIFPrivate[4]; /* HIF private area */
u8 *pScatterBounceBuffer; /* bounce buffer for upper layers to copy to/from */ u8 *pScatterBounceBuffer; /* bounce buffer for upper layers to copy to/from */
struct hif_scatter_item ScatterList[1]; /* start of scatter list */ struct hif_scatter_item ScatterList[1]; /* start of scatter list */
} HIF_SCATTER_REQ; };
typedef HIF_SCATTER_REQ * ( *HIF_ALLOCATE_SCATTER_REQUEST)(HIF_DEVICE *device); typedef struct hif_scatter_req * ( *HIF_ALLOCATE_SCATTER_REQUEST)(HIF_DEVICE *device);
typedef void ( *HIF_FREE_SCATTER_REQUEST)(HIF_DEVICE *device, HIF_SCATTER_REQ *request); typedef void ( *HIF_FREE_SCATTER_REQUEST)(HIF_DEVICE *device, struct hif_scatter_req *request);
typedef int ( *HIF_READWRITE_SCATTER)(HIF_DEVICE *device, HIF_SCATTER_REQ *request); typedef int ( *HIF_READWRITE_SCATTER)(HIF_DEVICE *device, struct hif_scatter_req *request);
struct hif_device_scatter_support_info { struct hif_device_scatter_support_info {
/* information returned from HIF layer */ /* information returned from HIF layer */