diff options
Diffstat (limited to 'drivers/staging/vt6656/usbpipe.c')
-rw-r--r-- | drivers/staging/vt6656/usbpipe.c | 138 |
1 files changed, 72 insertions, 66 deletions
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 65e91a332a66..fd2355e34fb0 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -71,36 +71,36 @@ static int msglevel =MSG_LEVEL_INFO; /*--------------------- Static Functions --------------------------*/ static -VOID +void s_nsInterruptUsbIoCompleteRead( - IN struct urb *urb + struct urb *urb ); static -VOID +void s_nsBulkInUsbIoCompleteRead( - IN struct urb *urb + struct urb *urb ); static -VOID +void s_nsBulkOutIoCompleteWrite( - IN struct urb *urb + struct urb *urb ); static -VOID +void s_nsControlInUsbIoCompleteRead( - IN struct urb *urb + struct urb *urb ); static -VOID +void s_nsControlInUsbIoCompleteWrite( - IN struct urb *urb + struct urb *urb ); /*--------------------- Export Variables --------------------------*/ @@ -111,12 +111,12 @@ s_nsControlInUsbIoCompleteWrite( NTSTATUS PIPEnsControlOutAsyn( - IN PSDevice pDevice, - IN BYTE byRequest, - IN WORD wValue, - IN WORD wIndex, - IN WORD wLength, - IN PBYTE pbyBuffer + PSDevice pDevice, + BYTE byRequest, + WORD wValue, + WORD wIndex, + WORD wLength, + PBYTE pbyBuffer ) { NTSTATUS ntStatus; @@ -142,7 +142,7 @@ PIPEnsControlOutAsyn( 0x40, // RequestType wValue, wIndex, - (PVOID) pbyBuffer, + (void *) pbyBuffer, wLength, HZ ); @@ -162,12 +162,12 @@ PIPEnsControlOutAsyn( NTSTATUS PIPEnsControlOut( - IN PSDevice pDevice, - IN BYTE byRequest, - IN WORD wValue, - IN WORD wIndex, - IN WORD wLength, - IN PBYTE pbyBuffer + PSDevice pDevice, + BYTE byRequest, + WORD wValue, + WORD wIndex, + WORD wLength, + PBYTE pbyBuffer ) { NTSTATUS ntStatus = 0; @@ -193,7 +193,8 @@ PIPEnsControlOut( usb_sndctrlpipe(pDevice->usb , 0), (char *) &pDevice->sUsbCtlRequest, pbyBuffer, wLength, s_nsControlInUsbIoCompleteWrite, pDevice); - if ((ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC)) != 0) { + ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC); + if (ntStatus != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control send request submission failed: %d\n", ntStatus); return STATUS_FAILURE; } @@ -223,12 +224,12 @@ PIPEnsControlOut( NTSTATUS PIPEnsControlIn( - IN PSDevice pDevice, - IN BYTE byRequest, - IN WORD wValue, - IN WORD wIndex, - IN WORD wLength, - IN OUT PBYTE pbyBuffer + PSDevice pDevice, + BYTE byRequest, + WORD wValue, + WORD wIndex, + WORD wLength, + PBYTE pbyBuffer ) { NTSTATUS ntStatus = 0; @@ -251,7 +252,8 @@ PIPEnsControlIn( usb_rcvctrlpipe(pDevice->usb , 0), (char *) &pDevice->sUsbCtlRequest, pbyBuffer, wLength, s_nsControlInUsbIoCompleteRead, pDevice); - if ((ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC)) != 0) { + ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC); + if (ntStatus != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control request submission failed: %d\n", ntStatus); }else { MP_SET_FLAG(pDevice, fMP_CONTROL_READS); @@ -277,9 +279,9 @@ PIPEnsControlIn( } static -VOID +void s_nsControlInUsbIoCompleteWrite( - IN struct urb *urb + struct urb *urb ) { PSDevice pDevice; @@ -318,9 +320,9 @@ s_nsControlInUsbIoCompleteWrite( * */ static -VOID +void s_nsControlInUsbIoCompleteRead( - IN struct urb *urb + struct urb *urb ) { PSDevice pDevice; @@ -360,7 +362,7 @@ s_nsControlInUsbIoCompleteRead( */ NTSTATUS PIPEnsInterruptRead( - IN PSDevice pDevice + PSDevice pDevice ) { NTSTATUS ntStatus = STATUS_FAILURE; @@ -383,7 +385,7 @@ PIPEnsInterruptRead( usb_fill_int_urb(pDevice->pInterruptURB, pDevice->usb, usb_rcvintpipe(pDevice->usb, 1), - (PVOID) pDevice->intBuf.pDataBuf, + (void *) pDevice->intBuf.pDataBuf, MAX_INTERRUPT_SIZE, s_nsInterruptUsbIoCompleteRead, pDevice, @@ -394,7 +396,7 @@ PIPEnsInterruptRead( usb_fill_int_urb(pDevice->pInterruptURB, pDevice->usb, usb_rcvintpipe(pDevice->usb, 1), - (PVOID) pDevice->intBuf.pDataBuf, + (void *) pDevice->intBuf.pDataBuf, MAX_INTERRUPT_SIZE, s_nsInterruptUsbIoCompleteRead, pDevice, @@ -407,14 +409,15 @@ PIPEnsInterruptRead( usb_fill_bulk_urb(pDevice->pInterruptURB, pDevice->usb, usb_rcvbulkpipe(pDevice->usb, 1), - (PVOID) pDevice->intBuf.pDataBuf, + (void *) pDevice->intBuf.pDataBuf, MAX_INTERRUPT_SIZE, s_nsInterruptUsbIoCompleteRead, pDevice); #endif #endif - if ((ntStatus = usb_submit_urb(pDevice->pInterruptURB, GFP_ATOMIC)) != 0) { + ntStatus = usb_submit_urb(pDevice->pInterruptURB, GFP_ATOMIC); + if (ntStatus != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus); } @@ -438,9 +441,9 @@ usb_fill_bulk_urb(pDevice->pInterruptURB, * */ static -VOID +void s_nsInterruptUsbIoCompleteRead( - IN struct urb *urb + struct urb *urb ) { @@ -481,12 +484,11 @@ s_nsInterruptUsbIoCompleteRead( pDevice->fKillEventPollingThread = TRUE; // } DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"IntUSBIoCompleteControl STATUS = %d\n", ntStatus ); - } - else { - pDevice->ulIntInBytesRead += (ULONG)urb->actual_length; - pDevice->ulIntInContCRCError = 0; - pDevice->bEventAvailable = TRUE; - INTnsProcessData(pDevice); + } else { + pDevice->ulIntInBytesRead += (unsigned long) urb->actual_length; + pDevice->ulIntInContCRCError = 0; + pDevice->bEventAvailable = TRUE; + INTnsProcessData(pDevice); } STAvUpdateUSBCounter(&pDevice->scStatistic.USB_InterruptStat, ntStatus); @@ -494,7 +496,8 @@ s_nsInterruptUsbIoCompleteRead( if (pDevice->fKillEventPollingThread != TRUE) { #if 0 //reserve int URB submit - if ((ntStatus = usb_submit_urb(urb, GFP_ATOMIC)) != 0) { + ntStatus = usb_submit_urb(urb, GFP_ATOMIC); + if (ntStatus != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Re-Submit int URB failed %d\n", ntStatus); } #else //replace int URB submit by bulk transfer @@ -502,12 +505,13 @@ s_nsInterruptUsbIoCompleteRead( usb_fill_bulk_urb(pDevice->pInterruptURB, pDevice->usb, usb_rcvbulkpipe(pDevice->usb, 1), - (PVOID) pDevice->intBuf.pDataBuf, + (void *) pDevice->intBuf.pDataBuf, MAX_INTERRUPT_SIZE, s_nsInterruptUsbIoCompleteRead, pDevice); - if ((ntStatus = usb_submit_urb(pDevice->pInterruptURB, GFP_ATOMIC)) != 0) { + ntStatus = usb_submit_urb(pDevice->pInterruptURB, GFP_ATOMIC); + if (ntStatus != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus); } @@ -538,8 +542,8 @@ s_nsInterruptUsbIoCompleteRead( */ NTSTATUS PIPEnsBulkInUsbRead( - IN PSDevice pDevice, - IN PRCB pRCB + PSDevice pDevice, + PRCB pRCB ) { NTSTATUS ntStatus= 0; @@ -567,12 +571,13 @@ PIPEnsBulkInUsbRead( usb_fill_bulk_urb(pUrb, pDevice->usb, usb_rcvbulkpipe(pDevice->usb, 2), - (PVOID) (pRCB->skb->data), + (void *) (pRCB->skb->data), MAX_TOTAL_SIZE_WITH_ALL_HEADERS, s_nsBulkInUsbIoCompleteRead, pRCB); - if((ntStatus = usb_submit_urb(pUrb, GFP_ATOMIC)) != 0){ + ntStatus = usb_submit_urb(pUrb, GFP_ATOMIC); + if (ntStatus != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit Rx URB failed %d\n", ntStatus); return STATUS_FAILURE ; } @@ -600,15 +605,15 @@ PIPEnsBulkInUsbRead( * */ static -VOID +void s_nsBulkInUsbIoCompleteRead( - IN struct urb *urb + struct urb *urb ) { PRCB pRCB = (PRCB)urb->context; PSDevice pDevice = (PSDevice)pRCB->pDevice; - ULONG bytesRead; + unsigned long bytesRead; BOOL bIndicateReceive = FALSE; BOOL bReAllocSkb = FALSE; NTSTATUS status; @@ -681,8 +686,8 @@ s_nsBulkInUsbIoCompleteRead( */ NDIS_STATUS PIPEnsSendBulkOut( - IN PSDevice pDevice, - IN PUSB_SEND_CONTEXT pContext + PSDevice pDevice, + PUSB_SEND_CONTEXT pContext ) { NTSTATUS status; @@ -712,13 +717,14 @@ PIPEnsSendBulkOut( usb_fill_bulk_urb( pUrb, pDevice->usb, - usb_sndbulkpipe(pDevice->usb, 3), - (PVOID) &(pContext->Data[0]), + usb_sndbulkpipe(pDevice->usb, 3), + (void *) &(pContext->Data[0]), pContext->uBufLen, s_nsBulkOutIoCompleteWrite, pContext); - if((status = usb_submit_urb(pUrb, GFP_ATOMIC))!=0) + status = usb_submit_urb(pUrb, GFP_ATOMIC); + if (status != 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit Tx URB failed %d\n", status); return STATUS_FAILURE; @@ -759,15 +765,15 @@ PIPEnsSendBulkOut( * */ static -VOID +void s_nsBulkOutIoCompleteWrite( - IN struct urb *urb + struct urb *urb ) { PSDevice pDevice; NTSTATUS status; CONTEXT_TYPE ContextType; - ULONG ulBufLen; + unsigned long ulBufLen; PUSB_SEND_CONTEXT pContext; |