Commit 0dfcb0b9 authored by Luca Ellero's avatar Luca Ellero Committed by Greg Kroah-Hartman

staging: ced1401: rename members of struct dmadesc

Rename members with CamelCase and Hungarian notation
Signed-off-by: default avatarLuca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3d50f62a
...@@ -620,7 +620,7 @@ int ced_clear_area(struct ced_data *ced, int nArea) ...@@ -620,7 +620,7 @@ int ced_clear_area(struct ced_data *ced, int nArea)
wake_up_interruptible(&pTA->event); /* release anything that was waiting */ wake_up_interruptible(&pTA->event); /* release anything that was waiting */
if (ced->bXFerWaiting if (ced->bXFerWaiting
&& (ced->rDMAInfo.wIdent == nArea)) && (ced->rDMAInfo.ident == nArea))
ced->bXFerWaiting = false; /* Cannot have pending xfer if area cleared */ ced->bXFerWaiting = false; /* Cannot have pending xfer if area cleared */
/* Clean out the struct 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 */
...@@ -1461,10 +1461,11 @@ int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB) ...@@ -1461,10 +1461,11 @@ int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB)
/* If we have one, kick off pending transfer */ /* If we have one, kick off pending transfer */
if (bWaiting) { /* Got a block xfer waiting? */ if (bWaiting) { /* Got a block xfer waiting? */
int RWMStat = int RWMStat =
ced_read_write_mem(ced, !ced->rDMAInfo.bOutWard, ced_read_write_mem(ced,
ced->rDMAInfo.wIdent, !ced->rDMAInfo.outward,
ced->rDMAInfo.dwOffset, ced->rDMAInfo.ident,
ced->rDMAInfo.dwSize); ced->rDMAInfo.offset,
ced->rDMAInfo.size);
if (RWMStat != U14ERR_NOERROR) if (RWMStat != U14ERR_NOERROR)
dev_err(&ced->interface->dev, dev_err(&ced->interface->dev,
"%s: rw setup failed %d\n", "%s: rw setup failed %d\n",
......
...@@ -662,10 +662,10 @@ static void staged_callback(struct urb *pUrb) ...@@ -662,10 +662,10 @@ static void staged_callback(struct urb *pUrb)
dev_info(&ced->interface->dev, dev_info(&ced->interface->dev,
"*** RWM_Complete *** pending transfer will now be set up!!!\n"); "*** RWM_Complete *** pending transfer will now be set up!!!\n");
iReturn = iReturn =
ced_read_write_mem(ced, !ced->rDMAInfo.bOutWard, ced_read_write_mem(ced, !ced->rDMAInfo.outward,
ced->rDMAInfo.wIdent, ced->rDMAInfo.ident,
ced->rDMAInfo.dwOffset, ced->rDMAInfo.offset,
ced->rDMAInfo.dwSize); ced->rDMAInfo.size);
if (iReturn) if (iReturn)
dev_err(&ced->interface->dev, dev_err(&ced->interface->dev,
...@@ -962,36 +962,36 @@ static bool ced_read_dma_info(volatile struct dmadesc *pDmaDesc, ...@@ -962,36 +962,36 @@ static bool ced_read_dma_info(volatile struct dmadesc *pDmaDesc,
unsigned short wIdent = ((ucData >> 4) & 0x07); /* and area identifier */ unsigned short wIdent = ((ucData >> 4) & 0x07); /* and area identifier */
/* fill in the structure we were given */ /* fill in the structure we were given */
pDmaDesc->wTransType = ucTransCode; /* type of transfer */ pDmaDesc->trans_type = ucTransCode; /* type of transfer */
pDmaDesc->wIdent = wIdent; /* area to use */ pDmaDesc->ident = wIdent; /* area to use */
pDmaDesc->dwSize = 0; /* initialise other bits */ pDmaDesc->size = 0; /* initialise other bits */
pDmaDesc->dwOffset = 0; pDmaDesc->offset = 0;
dev_dbg(&ced->interface->dev, "%s: type: %d ident: %d\n", dev_dbg(&ced->interface->dev, "%s: type: %d ident: %d\n",
__func__, pDmaDesc->wTransType, pDmaDesc->wIdent); __func__, pDmaDesc->trans_type, pDmaDesc->ident);
pDmaDesc->bOutWard = (ucTransCode != TM_EXTTOHOST); /* set transfer direction */ pDmaDesc->outward = (ucTransCode != TM_EXTTOHOST); /* set transfer direction */
switch (ucTransCode) { switch (ucTransCode) {
case TM_EXTTOHOST: /* Extended linear transfer modes (the only ones!) */ case TM_EXTTOHOST: /* Extended linear transfer modes (the only ones!) */
case TM_EXTTO1401: case TM_EXTTO1401:
{ {
bResult = bResult =
ced_read_huff(&(pDmaDesc->dwOffset), pBuf, ced_read_huff(&(pDmaDesc->offset), pBuf,
&dDone, dwCount) &dDone, dwCount)
&& ced_read_huff(&(pDmaDesc->dwSize), pBuf, && ced_read_huff(&(pDmaDesc->size), pBuf,
&dDone, dwCount); &dDone, dwCount);
if (bResult) { if (bResult) {
dev_dbg(&ced->interface->dev, dev_dbg(&ced->interface->dev,
"%s: xfer offset & size %d %d\n", "%s: xfer offset & size %d %d\n",
__func__, pDmaDesc->dwOffset, __func__, pDmaDesc->offset,
pDmaDesc->dwSize); pDmaDesc->size);
if ((wIdent >= MAX_TRANSAREAS) || /* Illegal area number, or... */ if ((wIdent >= MAX_TRANSAREAS) || /* Illegal area number, or... */
(!ced->rTransDef[wIdent].used) || /* area not set up, or... */ (!ced->rTransDef[wIdent].used) || /* area not set up, or... */
(pDmaDesc->dwOffset > ced->rTransDef[wIdent].length) || /* range/size */ (pDmaDesc->offset > ced->rTransDef[wIdent].length) || /* range/size */
((pDmaDesc->dwOffset + ((pDmaDesc->offset +
pDmaDesc->dwSize) > pDmaDesc->size) >
(ced->rTransDef[wIdent]. (ced->rTransDef[wIdent].
length))) { length))) {
bResult = false; /* bad parameter(s) */ bResult = false; /* bad parameter(s) */
...@@ -1000,8 +1000,8 @@ static bool ced_read_dma_info(volatile struct dmadesc *pDmaDesc, ...@@ -1000,8 +1000,8 @@ static bool ced_read_dma_info(volatile struct dmadesc *pDmaDesc,
__func__, wIdent, __func__, wIdent,
ced->rTransDef[wIdent]. ced->rTransDef[wIdent].
used, used,
pDmaDesc->dwOffset, pDmaDesc->offset,
pDmaDesc->dwSize, pDmaDesc->size,
ced->rTransDef[wIdent]. ced->rTransDef[wIdent].
length); length);
} }
...@@ -1049,13 +1049,13 @@ static int ced_handle_esc(struct ced_data *ced, char *pCh, ...@@ -1049,13 +1049,13 @@ static int ced_handle_esc(struct ced_data *ced, char *pCh,
spin_lock(&ced->stagedLock); /* Lock others out */ spin_lock(&ced->stagedLock); /* Lock others out */
if (ced_read_dma_info(&ced->rDMAInfo, ced, pCh, dwCount)) { /* Get DMA parameters */ if (ced_read_dma_info(&ced->rDMAInfo, ced, pCh, dwCount)) { /* Get DMA parameters */
unsigned short wTransType = ced->rDMAInfo.wTransType; /* check transfer type */ unsigned short wTransType = ced->rDMAInfo.trans_type; /* check transfer type */
dev_dbg(&ced->interface->dev, dev_dbg(&ced->interface->dev,
"%s: xfer to %s, offset %d, length %d\n", "%s: xfer to %s, offset %d, length %d\n",
__func__, __func__,
ced->rDMAInfo.bOutWard ? "1401" : "host", ced->rDMAInfo.outward ? "1401" : "host",
ced->rDMAInfo.dwOffset, ced->rDMAInfo.dwSize); ced->rDMAInfo.offset, ced->rDMAInfo.size);
if (ced->bXFerWaiting) { /* Check here for badly out of kilter... */ if (ced->bXFerWaiting) { /* Check here for badly out of kilter... */
/* This can never happen, really */ /* This can never happen, really */
...@@ -1066,11 +1066,10 @@ static int ced_handle_esc(struct ced_data *ced, char *pCh, ...@@ -1066,11 +1066,10 @@ static int ced_handle_esc(struct ced_data *ced, char *pCh,
|| (wTransType == TM_EXTTO1401)) { || (wTransType == TM_EXTTO1401)) {
iReturn = iReturn =
ced_read_write_mem(ced, ced_read_write_mem(ced,
!ced->rDMAInfo. !ced->rDMAInfo.outward,
bOutWard, ced->rDMAInfo.ident,
ced->rDMAInfo.wIdent, ced->rDMAInfo.offset,
ced->rDMAInfo.dwOffset, ced->rDMAInfo.size);
ced->rDMAInfo.dwSize);
if (iReturn != U14ERR_NOERROR) if (iReturn != U14ERR_NOERROR)
dev_err(&ced->interface->dev, dev_err(&ced->interface->dev,
"%s: ced_read_write_mem() failed %d\n", "%s: ced_read_write_mem() failed %d\n",
......
...@@ -125,14 +125,15 @@ struct transarea { ...@@ -125,14 +125,15 @@ struct transarea {
/* area MUST BE LAST */ /* area MUST BE LAST */
}; };
/* The DMADESC structure is used to hold information on the transfer in progress. It */ /* The dmadesc structure is used to hold information on the transfer in */
/* is set up by ReadDMAInfo, using information sent by the 1401 in an escape sequence. */ /* progress. It is set up by ReadDMAInfo, using information sent by the 1401 */
/* in an escape sequence. */
struct dmadesc { struct dmadesc {
unsigned short wTransType; /* transfer type as TM_xxx above */ unsigned short trans_type; /* transfer type as TM_xxx above */
unsigned short wIdent; /* identifier word */ unsigned short ident; /* identifier word */
unsigned int dwSize; /* bytes to transfer */ unsigned int size; /* bytes to transfer */
unsigned int dwOffset; /* offset into transfer area for trans */ unsigned int offset; /* offset into transfer area for trans */
bool bOutWard; /* true when data is going TO 1401 */ bool outward; /* true when data is going TO 1401 */
}; };
#define INBUF_SZ 256 /* input buffer size */ #define INBUF_SZ 256 /* input buffer size */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment