dev_err(&pdx->interface->dev, "%s: Attempt to clear area %d\n",
__func__, nArea);
} else {
- TRANSAREA *pTA = &pdx->rTransDef[nArea]; /* to save typing */
+ /* to save typing */
+ struct transarea *pTA = &pdx->rTransDef[nArea];
if (!pTA->bUsed) /* if not used... */
iReturn = U14ERR_NOTSET; /* ...nothing to be done */
else {
&& (pdx->rDMAInfo.wIdent == nArea))
pdx->bXFerWaiting = false; /* Cannot have pending xfer if area cleared */
- /* Clean out the TRANSAREA except for the wait queue, which is at the end */
+ /* Clean out the struct transarea except for the wait queue, which is at the end */
/* This sets bUsed to false and dwEventSz to 0 to say area not used and no events. */
memset(pTA, 0,
- sizeof(TRANSAREA) -
+ sizeof(struct transarea) -
sizeof(wait_queue_head_t));
}
spin_unlock_irq(&pdx->stagedLock);
unsigned int ulOffset = ((unsigned long)puBuf) & (PAGE_SIZE - 1);
int len = (dwLength + ulOffset + PAGE_SIZE - 1) >> PAGE_SHIFT;
- TRANSAREA *pTA = &pdx->rTransDef[nArea]; /* to save typing */
+ struct transarea *pTA = &pdx->rTransDef[nArea]; /* to save typing */
struct page **pPages = NULL; /* space for page tables */
int nPages = 0; /* and number of pages */
if (te.wAreaNum >= MAX_TRANSAREAS) /* the area must exist */
return U14ERR_BADAREA;
else {
- TRANSAREA *pTA = &pdx->rTransDef[te.wAreaNum];
+ struct transarea *pTA = &pdx->rTransDef[te.wAreaNum];
mutex_lock(&pdx->io_mutex); /* make sure we have no competitor */
spin_lock_irq(&pdx->stagedLock);
if (pTA->bUsed) { /* area must be in use */
return U14ERR_BADAREA;
else {
int iWait;
- TRANSAREA *pTA = &pdx->rTransDef[nArea];
+ struct transarea *pTA = &pdx->rTransDef[nArea];
msTimeOut = (msTimeOut * HZ + 999) / 1000; /* convert timeout to jiffies */
/* We cannot wait holding the mutex, but we check the flags while holding */
if ((unsigned)nArea >= MAX_TRANSAREAS)
iReturn = U14ERR_BADAREA;
else {
- TRANSAREA *pTA = &pdx->rTransDef[nArea];
+ struct transarea *pTA = &pdx->rTransDef[nArea];
mutex_lock(&pdx->io_mutex); /* make sure we have no competitor */
spin_lock_irq(&pdx->stagedLock);
iReturn = pTA->iWakeUp; /* get wakeup count since last call */
cb.dwSize = 0;
if (nArea < MAX_TRANSAREAS) { /* The area number must be OK */
- TRANSAREA *pArea = &pdx->rTransDef[nArea]; /* Pointer to relevant info */
+ /* Pointer to relevant info */
+ struct transarea *pArea = &pdx->rTransDef[nArea];
spin_lock_irq(&pdx->stagedLock); /* Lock others out */
if ((pArea->bUsed) && (pArea->bCircular) && /* Must be circular area */
cb.dwSize = 0;
if (nArea < MAX_TRANSAREAS) { /* The area number must be OK */
- TRANSAREA *pArea = &pdx->rTransDef[nArea]; /* Pointer to relevant info */
+ /* Pointer to relevant info */
+ struct transarea *pArea = &pdx->rTransDef[nArea];
spin_lock_irq(&pdx->stagedLock); /* Lock others out */
if ((pArea->bUsed) && (pArea->bCircular) && /* Must be circular area */
{
unsigned int nArea = pdx->StagedId;
if (nArea < MAX_TRANSAREAS) {
- TRANSAREA *pArea = &pdx->rTransDef[nArea]; /* area to be used */
+ /* area to be used */
+ struct transarea *pArea = &pdx->rTransDef[nArea];
unsigned int dwOffset =
pdx->StagedDone + pdx->StagedOffset + pArea->dwBaseOffset;
char *pCoherBuf = pdx->pCoherStagedIO; /* coherent buffer */
if ((pdx->StagedDone == pdx->StagedLength) || /* If no more to do */
(bCancel)) { /* or this IRP was cancelled */
- TRANSAREA *pArea = &pdx->rTransDef[pdx->StagedId]; /* Transfer area info */
+ /* Transfer area info */
+ struct transarea *pArea = &pdx->rTransDef[pdx->StagedId];
dev_dbg(&pdx->interface->dev,
"%s: transfer done, bytes %d, cancel %d\n",
__func__, pdx->StagedDone, bCancel);
int ced_read_write_mem(DEVICE_EXTENSION *pdx, bool Read, unsigned short wIdent,
unsigned int dwOffs, unsigned int dwLen)
{
- TRANSAREA *pArea = &pdx->rTransDef[wIdent]; /* Transfer area info */
+ /* Transfer area info */
+ struct transarea *pArea = &pdx->rTransDef[wIdent];
if (!can_accept_io_requests(pdx)) { /* Are we in a state to accept new requests? */
dev_err(&pdx->interface->dev, "%s: can't accept requests\n",
/* A structure holding all of the information about a transfer area - an area of */
/* memory set up for use either as a source or destination in DMA transfers. */
-typedef struct transarea {
+struct transarea {
void __user *lpvBuff; /* User address of xfer area saved for completeness */
UINT dwBaseOffset; /* offset to start of xfer area in first page */
UINT dwLength; /* Length of xfer area, in bytes */
UINT dwEventSz; /* ...notification by the event SZ is 0 if unset */
struct circ_blk aBlocks[2]; /* Info on a pair of circular blocks */
wait_queue_head_t wqEvent; /* The wait queue for events in this area MUST BE LAST */
-} TRANSAREA;
+};
/* The DMADESC structure is used to hold information on the transfer in progress. It */
/* is set up by ReadDMAInfo, using information sent by the 1401 in an escape sequence. */
__u8 bInterval; /* Interrupt end point interval */
volatile unsigned int dwDMAFlag; /* state of DMA */
- TRANSAREA rTransDef[MAX_TRANSAREAS];/* transfer area info */
+ struct transarea rTransDef[MAX_TRANSAREAS]; /* transfer area info */
volatile DMADESC rDMAInfo; /* info on current DMA transfer */
volatile bool bXFerWaiting; /* Flag set if DMA transfer stalled */
volatile bool bInDrawDown; /* Flag that we want to halt transfers */