Fixes checkpatch warnings 'open brace should be on the previous line'.
Signed-off-by: Elena Ufimtseva <ufimtseva@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
buffer[n] = 0; /* terminate for debug purposes */
mutex_lock(&pdx->io_mutex); /* Protect disconnect from new i/o */
- if (n > 0) /* do nothing if nowt to do! */
- {
+ if (n > 0) { /* do nothing if nowt to do! */
dev_dbg(&pdx->interface->dev, "%s n=%d>%s<", __func__, n,
buffer);
iReturn = PutChars(pdx, buffer, n);
*error = pdx->statBuf[1];
nDevice = pdx->udev->descriptor.bcdDevice >> 8; /* 1401 type code value */
- switch (nDevice) /* so we can clean up current state */
- {
+ switch (nDevice) { /* so we can clean up current state */
case 0:
pdx->sCurrentState = U14ERR_U1401;
break;
/* We can fill this in when we know how we will implement the staged transfer stuff */
spin_lock_irq(&pdx->stagedLock);
- if (pdx->bStagedUrbPending) /* anything to be cancelled? May need more... */
- {
+ if (pdx->bStagedUrbPending) { /* anything to be cancelled? May need more... */
dev_info(&pdx->interface - dev,
"ReadWrite_Cancel about to cancel Urb");
/* Clear the staging done flag */
/* release the io_mutex because if we don't, we will deadlock due to system */
/* calls back into the driver. */
mutex_unlock(&pdx->io_mutex); /* locked, so we will not get system calls */
- if (iReturn >= 0) /* if we failed */
- {
+ if (iReturn >= 0) { /* if we failed */
iReturn = usb_reset_device(pdx->udev); /* try to do the reset */
usb_unlock_device(pdx->udev); /* undo the lock */
}
mutex_lock(&pdx->io_mutex); /* hold stuff off while we wait */
pdx->dwDMAFlag = MODE_CHAR; /* Clear DMA mode flag regardless! */
- if (iReturn == 0) /* if all is OK still */
- {
+ if (iReturn == 0) { /* if all is OK still */
unsigned int state;
iReturn = InSelfTest(pdx, &state); /* see if likely in self test */
- if (iReturn > 0) /* do we need to wait for self-test? */
- {
+ if (iReturn > 0) { /* do we need to wait for self-test? */
unsigned long ulTimeOut = jiffies + 30 * HZ; /* when to give up */
while ((iReturn > 0) && time_before(jiffies, ulTimeOut)) {
schedule(); /* let other stuff run */
bTestBuff, bShortTest);
if ((bTestBuff) && /* Buffer check requested, and... */
- (pdx->dwNumInput || pdx->dwNumOutput)) /* ...characters were in the buffer? */
- {
+ (pdx->dwNumInput || pdx->dwNumOutput)) { /* ...characters were in the buffer? */
bShortTest = false; /* Then do the full test */
dev_dbg(&pdx->interface->dev,
"%s will reset as buffers not empty", __func__);
}
- if (bShortTest || !bCanReset) /* Still OK to try the short test? */
- { /* Always test if no reset - we want state update */
+ if (bShortTest || !bCanReset) { /* Still OK to try the short test? */
+ /* Always test if no reset - we want state update */
unsigned int state, error;
dev_dbg(&pdx->interface->dev, "%s->Get1401State", __func__);
- if (Get1401State(pdx, &state, &error) == U14ERR_NOERROR) /* Check on the 1401 state */
- {
+ if (Get1401State(pdx, &state, &error) == U14ERR_NOERROR) { /* Check on the 1401 state */
if ((state & 0xFF) == 0) /* If call worked, check the status value */
bRet = true; /* If that was zero, all is OK, no reset needed */
}
}
- if (!bRet && bCanReset) /* If all not OK, then */
- {
+ if (!bRet && bCanReset) { /* If all not OK, then */
dev_info(&pdx->interface->dev, "%s->Is1401 %d %d %d %d",
__func__, bShortTest, pdx->sCurrentState, bTestBuff,
pdx->bForceReset);
SendChars(pdx); /* and send any buffered chars */
spin_lock_irq(&pdx->charInLock);
- if (pdx->dwNumInput > 0) /* worth looking */
- {
+ if (pdx->dwNumInput > 0) { /* worth looking */
iReturn = pdx->inputBuffer[pdx->dwInBuffGet++];
if (pdx->dwInBuffGet >= INBUF_SZ)
pdx->dwInBuffGet = 0;
if (nAvailable > n) /* read max of space in pUser... */
nAvailable = n; /* ...or input characters */
- if (nAvailable > 0) /* worth looking? */
- {
+ if (nAvailable > 0) { /* worth looking? */
char buffer[INBUF_SZ + 1]; /* space for a linear copy of data */
int nGot = 0;
int nCopyToUser; /* number to copy to user */
pdx->dwInBuffGet = 0; /* wrap buffer pointer */
buffer[nGot++] = cData; /* save the output */
- }
- while ((nGot < nAvailable) && cData);
+ } while ((nGot < nAvailable) && cData);
nCopyToUser = nGot; /* what to copy... */
- if (cData) /* do we need null */
- {
+ if (cData) { /* do we need null */
buffer[nGot] = (char)0; /* make it tidy */
if (nGot < n) /* if space in user buffer... */
++nCopyToUser; /* ...copy the 0 as well. */
SendChars(pdx); /* and send any buffered chars */
spin_lock_irq(&pdx->charInLock); /* Get protection */
- if (pdx->dwNumInput > 0) /* worth looking? */
- {
+ if (pdx->dwNumInput > 0) { /* worth looking? */
unsigned int dwIndex = pdx->dwInBuffGet; /* start at first available */
unsigned int dwEnd = pdx->dwInBuffPut; /* Position for search end */
do {
if (dwIndex >= INBUF_SZ) /* see if we fall off buff */
dwIndex = 0;
- }
- while (dwIndex != dwEnd); /* go to last available */
+ } while (dwIndex != dwEnd); /* go to last available */
}
spin_unlock_irq(&pdx->charInLock);
}
spin_unlock_irq(&pdx->stagedLock);
- if (pPages) /* if we decided to release the memory */
- {
+ if (pPages) { /* if we decided to release the memory */
/* Now we must undo the pinning down of the pages. We will assume the worst and mark */
/* all the pages as dirty. Don't be tempted to move this up above as you must not be */
/* holding a spin lock to do this stuff as it is not atomic. */
up_read(¤t->mm->mmap_sem); /* release the semaphore */
dev_dbg(&pdx->interface->dev, "%s nPages = %d", __func__, nPages);
- if (nPages > 0) /* if we succeeded */
- {
+ if (nPages > 0) { /* if we succeeded */
/* If you are tempted to use page_address (form LDD3), forget it. You MUST use */
/* kmap() or kmap_atomic() to get a virtual address. page_address will give you */
/* (null) or at least it does in this context with an x86 machine. */
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 */
- {
+ if (pTA->bUsed) { /* area must be in use */
pTA->dwEventSt = te.dwStart; /* set area regions */
pTA->dwEventSz = te.dwLength; /* set size (0 cancels it) */
pTA->bEventToHost = te.wFlags & 1; /* set the direction */
if (iReturn == U14ERR_NOERROR) /* Only accept zero if it happens twice */
iReturn = Get1401State(pdx, &state, &error);
- if (iReturn != U14ERR_NOERROR) /* Self-test can cause comms errors */
- { /* so we assume still testing */
+ if (iReturn != U14ERR_NOERROR) { /* Self-test can cause comms errors */
+ /* so we assume still testing */
dev_err(&pdx->interface->dev,
"%s Get1401State=%d, assuming still testing", __func__,
iReturn);
iReturn = U14ERR_NOERROR;
}
- if ((state == -1) && (error == -1)) /* If Get1401State had problems */
- {
+ if ((state == -1) && (error == -1)) { /* If Get1401State had problems */
dev_err(&pdx->interface->dev,
"%s Get1401State failed, assuming still testing",
__func__);
error = 0;
}
- if ((state & 0xFF) == 0x80) /* If we are still in self-test */
- {
- if (state & 0x00FF0000) /* Have we got an error? */
- {
+ if ((state & 0xFF) == 0x80) { /* If we are still in self-test */
+ if (state & 0x00FF0000) { /* Have we got an error? */
gst.code = (state & 0x00FF0000) >> 16; /* read the error code */
gst.x = error & 0x0000FFFF; /* Error data X */
gst.y = (error & 0xFFFF0000) >> 16; /* and data Y */
dev_dbg(&pdx->interface->dev, "Self-test error code %d",
gst.code);
- } else /* No error, check for timeout */
- {
+ } else { /* No error, check for timeout */
unsigned long ulNow = jiffies; /* get current time */
if (time_after(ulNow, pdx->ulSelfTestTime)) {
gst.code = -2; /* Flag the timeout */
dev_dbg(&pdx->interface->dev, "Self-test done");
}
- if (gst.code < 0) /* If we have a problem or finished */
- { /* If using the 2890 we should reset properly */
+ if (gst.code < 0) { /* If we have a problem or finished */
+ /* If using the 2890 we should reset properly */
if ((pdx->nPipes == 4) && (pdx->s1401Type <= TYPEPOWER))
Is1401(pdx); /* Get 1401 reset and OK */
else
cb.dwOffset = 0; /* set default result (nothing) */
cb.dwSize = 0;
- if (nArea < MAX_TRANSAREAS) /* The area number must be OK */
- {
+ if (nArea < MAX_TRANSAREAS) { /* The area number must be OK */
TRANSAREA *pArea = &pdx->rTransDef[nArea]; /* Pointer to relevant info */
spin_lock_irq(&pdx->stagedLock); /* Lock others out */
if ((pArea->bUsed) && (pArea->bCircular) && /* Must be circular area */
- (pArea->bCircToHost)) /* For now at least must be to host */
- {
- if (pArea->aBlocks[0].dwSize > 0) /* Got anything? */
- {
+ (pArea->bCircToHost)) { /* For now at least must be to host */
+ if (pArea->aBlocks[0].dwSize > 0) { /* Got anything? */
cb.dwOffset = pArea->aBlocks[0].dwOffset;
cb.dwSize = pArea->aBlocks[0].dwSize;
dev_dbg(&pdx->interface->dev,
cb.dwOffset = 0; /* then set default result (nothing) */
cb.dwSize = 0;
- if (nArea < MAX_TRANSAREAS) /* The area number must be OK */
- {
+ if (nArea < MAX_TRANSAREAS) { /* The area number must be OK */
TRANSAREA *pArea = &pdx->rTransDef[nArea]; /* Pointer to relevant info */
spin_lock_irq(&pdx->stagedLock); /* Lock others out */
if ((pArea->bUsed) && (pArea->bCircular) && /* Must be circular area */
- (pArea->bCircToHost)) /* For now at least must be to host */
- {
+ (pArea->bCircToHost)) { /* For now at least must be to host */
bool bWaiting = false;
if ((pArea->aBlocks[0].dwSize >= uSize) && /* Got anything? */
- (pArea->aBlocks[0].dwOffset == uStart)) /* Must be legal data */
- {
+ (pArea->aBlocks[0].dwOffset == uStart)) { /* Must be legal data */
pArea->aBlocks[0].dwSize -= uSize;
pArea->aBlocks[0].dwOffset += uSize;
- if (pArea->aBlocks[0].dwSize == 0) /* Have we emptied this block? */
- {
- if (pArea->aBlocks[1].dwSize) /* Is there a second block? */
- {
+ if (pArea->aBlocks[0].dwSize == 0) { /* Have we emptied this block? */
+ if (pArea->aBlocks[1].dwSize) { /* Is there a second block? */
pArea->aBlocks[0] = pArea->aBlocks[1]; /* Copy down block 2 data */
pArea->aBlocks[1].dwSize = 0; /* and mark the second block as unused */
pArea->aBlocks[1].dwOffset = 0;
pdx->bXFerWaiting);
/* Return the next available block of memory as well */
- if (pArea->aBlocks[0].dwSize > 0) /* Got anything? */
- {
+ if (pArea->aBlocks[0].dwSize > 0) { /* Got anything? */
cb.dwOffset =
pArea->aBlocks[0].dwOffset;
cb.dwSize = pArea->aBlocks[0].dwSize;
}
/* If we have one, kick off pending transfer */
- if (bWaiting) /* Got a block xfer waiting? */
- {
+ if (bWaiting) { /* Got a block xfer waiting? */
int RWMStat =
ReadWriteMem(pdx, !pdx->rDMAInfo.bOutWard,
pdx->rDMAInfo.wIdent,
if (pdx->dwOutBuffGet >= OUTBUF_SZ) /* Can't do this any earlier as data could be overwritten */
pdx->dwOutBuffGet = 0;
- if (pdx->dwNumOutput > 0) /* if more to be done... */
- {
+ if (pdx->dwNumOutput > 0) { /* if more to be done... */
int nPipe = 0; /* The pipe number to use */
int iReturn;
char *pDat = &pdx->outputBuffer[pdx->dwOutBuffGet];
if ((!pdx->bSendCharsPending) && /* Not currently sending */
(pdx->dwNumOutput > 0) && /* has characters to output */
- (CanAcceptIoRequests(pdx))) /* and current activity is OK */
- {
+ (CanAcceptIoRequests(pdx))) { /* and current activity is OK */
unsigned int dwCount = pdx->dwNumOutput; /* Get a copy of the character count */
pdx->bSendCharsPending = true; /* Set flag to lock out other threads */
pdx->StagedDone, pdx->StagedLength);
if ((pdx->StagedDone == pdx->StagedLength) || /* If no more to do */
- (bCancel)) /* or this IRP was cancelled */
- {
+ (bCancel)) { /* or this IRP was cancelled */
TRANSAREA *pArea = &pdx->rTransDef[pdx->StagedId]; /* Transfer area info */
dev_dbg(&pdx->interface->dev,
"%s transfer done, bytes %d, cancel %d", __func__,
/* add this to the end of a growing block or to use it to start a new block unless the code */
/* that calculates the offset to use (in ReadWriteMem) is totally duff. */
if ((pArea->bCircular) && (pArea->bCircToHost) && (!bCancel) && /* Time to sort out circular buffer info? */
- (pdx->StagedRead)) /* Only for tohost transfers for now */
- {
- if (pArea->aBlocks[1].dwSize > 0) /* If block 1 is in use we must append to it */
- {
+ (pdx->StagedRead)) { /* Only for tohost transfers for now */
+ if (pArea->aBlocks[1].dwSize > 0) { /* If block 1 is in use we must append to it */
if (pdx->StagedOffset ==
(pArea->aBlocks[1].dwOffset +
pArea->aBlocks[1].dwSize)) {
pArea->aBlocks[1].dwSize,
pArea->aBlocks[1].dwOffset);
}
- } else /* If block 1 is not used, we try to add to block 0 */
- {
- if (pArea->aBlocks[0].dwSize > 0) /* Got stored block 0 information? */
- { /* Must append onto the existing block 0 */
+ } else { /* If block 1 is not used, we try to add to block 0 */
+ if (pArea->aBlocks[0].dwSize > 0) { /* Got stored block 0 information? */
+ /* Must append onto the existing block 0 */
if (pdx->StagedOffset ==
(pArea->aBlocks[0].dwOffset +
pArea->aBlocks[0].dwSize)) {
dwSize,
pArea->aBlocks[0].
dwOffset);
- } else /* If it doesn't append, put into new block 1 */
- {
+ } else { /* If it doesn't append, put into new block 1 */
pArea->aBlocks[1].dwOffset =
pdx->StagedOffset;
pArea->aBlocks[1].dwSize =
pArea->aBlocks[1].
dwOffset);
}
- } else /* No info stored yet, just save in block 0 */
- {
+ } else { /* No info stored yet, just save in block 0 */
pArea->aBlocks[0].dwOffset =
pdx->StagedOffset;
pArea->aBlocks[0].dwSize =
}
}
- if (!bCancel) /* Don't generate an event if cancelled */
- {
+ if (!bCancel) { /* Don't generate an event if cancelled */
dev_dbg(&pdx->interface->dev,
"RWM_Complete, bCircular %d, bToHost %d, eStart %d, eSize %d",
pArea->bCircular, pArea->bEventToHost,
pArea->dwEventSt, pArea->dwEventSz);
if ((pArea->dwEventSz) && /* Set a user-mode event... */
- (pdx->StagedRead == pArea->bEventToHost)) /* ...on transfers in this direction? */
- {
+ (pdx->StagedRead == pArea->bEventToHost)) { /* ...on transfers in this direction? */
int iWakeUp = 0; /* assume */
/* If we have completed the right sort of DMA transfer then set the event to notify */
/* the user code to wake up anyone that is waiting. */
if ((pArea->bCircular) && /* Circular areas use a simpler test */
- (pArea->bCircToHost)) /* only in supported direction */
- { /* Is total data waiting up to size limit? */
+ (pArea->bCircToHost)) { /* only in supported direction */
+ /* Is total data waiting up to size limit? */
unsigned int dwTotal =
pArea->aBlocks[0].dwSize +
pArea->aBlocks[1].dwSize;
pdx->dwDMAFlag = MODE_CHAR; /* Switch back to char mode before ReadWriteMem call */
- if (!bCancel) /* Don't look for waiting transfer if cancelled */
- {
+ if (!bCancel) { /* Don't look for waiting transfer if cancelled */
/* If we have a transfer waiting, kick it off */
- if (pdx->bXFerWaiting) /* Got a block xfer waiting? */
- {
+ if (pdx->bXFerWaiting) { /* Got a block xfer waiting? */
int iReturn;
dev_info(&pdx->interface->dev,
"*** RWM_Complete *** pending transfer will now be set up!!!");
if (nPipe < 0) /* and trap case that should never happen */
return U14ERR_FAIL;
- if (!CanAcceptIoRequests(pdx)) /* got sudden remove? */
- {
+ if (!CanAcceptIoRequests(pdx)) { /* got sudden remove? */
dev_info(&pdx->interface->dev, "%s sudden remove, giving up",
__func__);
return U14ERR_FAIL; /* could do with a better error */
{
TRANSAREA *pArea = &pdx->rTransDef[wIdent]; /* Transfer area info */
- if (!CanAcceptIoRequests(pdx)) /* Are we in a state to accept new requests? */
- {
+ if (!CanAcceptIoRequests(pdx)) { /* Are we in a state to accept new requests? */
dev_err(&pdx->interface->dev, "%s can't accept requests",
__func__);
return U14ERR_FAIL;
return U14ERR_NOERROR;
}
- if (dwLen == 0) /* allow 0-len read or write; just return success */
- {
+ if (dwLen == 0) { /* allow 0-len read or write; just return success */
dev_dbg(&pdx->interface->dev,
"%s OK; zero-len read/write request", __func__);
return U14ERR_NOERROR;
}
if ((pArea->bCircular) && /* Circular transfer? */
- (pArea->bCircToHost) && (Read)) /* In a supported direction */
- { /* If so, we sort out offset ourself */
+ (pArea->bCircToHost) && (Read)) { /* In a supported direction */
+ /* If so, we sort out offset ourself */
bool bWait = false; /* Flag for transfer having to wait */
dev_dbg(&pdx->interface->dev,
"Circular buffers are %d at %d and %d at %d",
pArea->aBlocks[0].dwSize, pArea->aBlocks[0].dwOffset,
pArea->aBlocks[1].dwSize, pArea->aBlocks[1].dwOffset);
- if (pArea->aBlocks[1].dwSize > 0) /* Using the second block already? */
- {
+ if (pArea->aBlocks[1].dwSize > 0) { /* Using the second block already? */
dwOffs = pArea->aBlocks[1].dwOffset + pArea->aBlocks[1].dwSize; /* take offset from that */
bWait = (dwOffs + dwLen) > pArea->aBlocks[0].dwOffset; /* Wait if will overwrite block 0? */
bWait |= (dwOffs + dwLen) > pArea->dwLength; /* or if it overflows the buffer */
- } else /* Area 1 not in use, try to use area 0 */
- {
+ } else { /* Area 1 not in use, try to use area 0 */
if (pArea->aBlocks[0].dwSize == 0) /* Reset block 0 if not in use */
pArea->aBlocks[0].dwOffset = 0;
dwOffs =
pArea->aBlocks[0].dwOffset +
pArea->aBlocks[0].dwSize;
- if ((dwOffs + dwLen) > pArea->dwLength) /* Off the end of the buffer? */
- {
+ if ((dwOffs + dwLen) > pArea->dwLength) { /* Off the end of the buffer? */
pArea->aBlocks[1].dwOffset = 0; /* Set up to use second block */
dwOffs = 0;
bWait = (dwOffs + dwLen) > pArea->aBlocks[0].dwOffset; /* Wait if will overwrite block 0? */
}
}
- if (bWait) /* This transfer will have to wait? */
- {
+ if (bWait) { /* This transfer will have to wait? */
pdx->bXFerWaiting = true; /* Flag we are waiting */
dev_dbg(&pdx->interface->dev,
"%s xfer waiting for circular buffer space",
bool bRead = false;
unsigned int dDone = *pdDone;
- if (dDone < dGot) /* If there is more data */
- {
+ if (dDone < dGot) { /* If there is more data */
*pChar = (unsigned char)pBuf[dDone]; /* Extract the next char */
dDone++; /* Increment the done count */
*pdDone = dDone;
/* I have no idea what this next test is about. '?' is 0x3f, which is area 3, code */
/* 15. At the moment, this is not used, so it does no harm, but unless someone can */
/* tell me what this is for, it should be removed from this and the Windows driver. */
- if (pCh[0] == '?') /* Is this an information response */
- { /* Parse and save the information */
+ if (pCh[0] == '?') { /* Is this an information response */
+ /* Parse and save the information */
} else {
spin_lock(&pdx->stagedLock); /* Lock others out */
- if (ReadDMAInfo(&pdx->rDMAInfo, pdx, pCh, dwCount)) /* Get DMA parameters */
- {
+ if (ReadDMAInfo(&pdx->rDMAInfo, pdx, pCh, dwCount)) { /* Get DMA parameters */
unsigned short wTransType = pdx->rDMAInfo.wTransType; /* check transfer type */
dev_dbg(&pdx->interface->dev,
pdx->rDMAInfo.bOutWard ? "1401" : "host",
pdx->rDMAInfo.dwOffset, pdx->rDMAInfo.dwSize);
- if (pdx->bXFerWaiting) /* Check here for badly out of kilter... */
- { /* This can never happen, really */
+ if (pdx->bXFerWaiting) { /* Check here for badly out of kilter... */
+ /* This can never happen, really */
dev_err(&pdx->interface->dev,
"ERROR: DMA setup while transfer still waiting");
- spin_unlock(&pdx->stagedLock);
+ spin_unlock(&pdx->stagedLock);
} else {
if ((wTransType == TM_EXTTOHOST)
|| (wTransType == TM_EXTTO1401)) {
DEVICE_EXTENSION *pdx = pUrb->context;
int nGot = pUrb->actual_length; /* what we transferred */
- if (pUrb->status) /* Do we have a problem to handle? */
- {
+ if (pUrb->status) { /* Do we have a problem to handle? */
int nPipe = pdx->nPipes == 4 ? 1 : 0; /* The pipe number to use for error */
/* sync/async unlink faults aren't errors... just saying device removed or stopped */
if (!
spin_lock(&pdx->charInLock); /* already at irq level */
pdx->bPipeError[nPipe] = 1; /* Flag an error for later */
} else {
- if ((nGot > 1) && ((pdx->pCoherCharIn[0] & 0x7f) == 0x1b)) /* Esc sequence? */
- {
+ if ((nGot > 1) && ((pdx->pCoherCharIn[0] & 0x7f) == 0x1b)) { /* Esc sequence? */
Handle1401Esc(pdx, &pdx->pCoherCharIn[1], nGot - 1); /* handle it */
spin_lock(&pdx->charInLock); /* already at irq level */
} else {
(pdx->dwNumInput < (INBUF_SZ / 2)) && /* and there is some space */
(pdx->dwDMAFlag == MODE_CHAR) && /* not doing any DMA */
(!pdx->bXFerWaiting) && /* no xfer waiting to start */
- (CanAcceptIoRequests(pdx))) /* and activity is generally OK */
- { /* then off we go */
+ (CanAcceptIoRequests(pdx))) { /* and activity is generally OK */
+ /* then off we go */
unsigned int nMax = INBUF_SZ - pdx->dwNumInput; /* max we could read */
int nPipe = pdx->nPipes == 4 ? 1 : 0; /* The pipe number to use */
if (!pdx)
goto error;
- for (i = 0; i < MAX_TRANSAREAS; ++i) /* Initialise the wait queues */
- {
+ for (i = 0; i < MAX_TRANSAREAS; ++i) { /* Initialise the wait queues */
init_waitqueue_head(&pdx->rTransDef[i].wqEvent);
}
pdx->bInterval);
}
/* Detect USB2 by checking last ep size (64 if USB1) */
- if (i == pdx->nPipes - 1) /* if this is the last ep (bulk) */
- {
+ if (i == pdx->nPipes - 1) { /* if this is the last ep (bulk) */
pdx->bIsUSB2 =
le16_to_cpu(endpoint->wMaxPacketSize) > 64;
dev_info(&pdx->interface->dev, "USB%d",
#define CR_CHAR_80 0x8d /* and with bit 7 set */
/* A structure holding information about a block of memory for use in circular transfers */
-typedef struct circBlk
-{
+typedef struct circBlk {
volatile UINT dwOffset; /* Offset within area of block start */
volatile UINT dwSize; /* Size of the block, in bytes (0 = unused) */
} CIRCBLK;
/* 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
-{
+typedef struct transarea {
void *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 */
/* 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. */
-typedef struct dmadesc
-{
+typedef struct dmadesc {
unsigned short wTransType; /* transfer type as TM_xxx above */
unsigned short wIdent; /* identifier word */
unsigned int dwSize; /* bytes to transfer */
/* Structure to hold all of our device specific stuff. We are making this as similar as we */
/* can to the Windows driver to help in our understanding of what is going on. */
-typedef struct _DEVICE_EXTENSION
-{
+typedef struct _DEVICE_EXTENSION {
char inputBuffer[INBUF_SZ]; /* The two buffers */
char outputBuffer[OUTBUF_SZ]; /* accessed by the host functions */
volatile unsigned int dwNumInput; /* num of chars in input buffer */
typedef TCSBLOCK* LPTCSBLOCK;
-typedef struct paramBlk
-{
+typedef struct paramBlk {
short sState;
TCSBLOCK csBlock;
} PARAMBLK;