Commit dad72fed authored by Jim Lieb's avatar Jim Lieb Committed by Greg Kroah-Hartman

Staging: vt665x: cleanup USB definitions

Remove gratuitous macros re-defining usb functions.
One result is to make kcompat.h now identical in both driver dirs
Signed-off-by: default avatarJim Lieb <lieb@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f9de7e7b
...@@ -35,10 +35,5 @@ ...@@ -35,10 +35,5 @@
#define netdev_priv(dev) (dev->priv) #define netdev_priv(dev) (dev->priv)
#endif #endif
#define vntwusb_submit_urb(val) usb_submit_urb(val, GFP_ATOMIC)
#define vntwusb_alloc_urb(val) usb_alloc_urb(val, GFP_ATOMIC)
#define vntwusb_unlink_urb(val) usb_kill_urb(val)
#endif #endif
...@@ -859,7 +859,7 @@ static VOID device_free_tx_bufs(PSDevice pDevice) { ...@@ -859,7 +859,7 @@ static VOID device_free_tx_bufs(PSDevice pDevice) {
pTxContext = pDevice->apTD[ii]; pTxContext = pDevice->apTD[ii];
//de-allocate URBs //de-allocate URBs
if (pTxContext->pUrb) { if (pTxContext->pUrb) {
vntwusb_unlink_urb(pTxContext->pUrb); usb_kill_urb(pTxContext->pUrb);
usb_free_urb(pTxContext->pUrb); usb_free_urb(pTxContext->pUrb);
} }
if (pTxContext) if (pTxContext)
...@@ -878,7 +878,7 @@ static VOID device_free_rx_bufs(PSDevice pDevice) { ...@@ -878,7 +878,7 @@ static VOID device_free_rx_bufs(PSDevice pDevice) {
pRCB = pDevice->apRCB[ii]; pRCB = pDevice->apRCB[ii];
//de-allocate URBs //de-allocate URBs
if (pRCB->pUrb) { if (pRCB->pUrb) {
vntwusb_unlink_urb(pRCB->pUrb); usb_kill_urb(pRCB->pUrb);
usb_free_urb(pRCB->pUrb); usb_free_urb(pRCB->pUrb);
} }
//de-allocate skb //de-allocate skb
...@@ -926,7 +926,7 @@ static BOOL device_alloc_bufs(PSDevice pDevice) { ...@@ -926,7 +926,7 @@ static BOOL device_alloc_bufs(PSDevice pDevice) {
pDevice->apTD[ii] = pTxContext; pDevice->apTD[ii] = pTxContext;
pTxContext->pDevice = (PVOID) pDevice; pTxContext->pDevice = (PVOID) pDevice;
//allocate URBs //allocate URBs
pTxContext->pUrb = vntwusb_alloc_urb(0);; pTxContext->pUrb = usb_alloc_urb(0, GFP_ATOMIC);
if (pTxContext->pUrb == NULL) { if (pTxContext->pUrb == NULL) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "alloc tx urb failed\n"); DBG_PRT(MSG_LEVEL_ERR,KERN_ERR "alloc tx urb failed\n");
goto free_tx; goto free_tx;
...@@ -955,7 +955,7 @@ static BOOL device_alloc_bufs(PSDevice pDevice) { ...@@ -955,7 +955,7 @@ static BOOL device_alloc_bufs(PSDevice pDevice) {
pDevice->apRCB[ii] = pRCB; pDevice->apRCB[ii] = pRCB;
pRCB->pDevice = (PVOID) pDevice; pRCB->pDevice = (PVOID) pDevice;
//allocate URBs //allocate URBs
pRCB->pUrb = vntwusb_alloc_urb(0); pRCB->pUrb = usb_alloc_urb(0, GFP_ATOMIC);
if (pRCB->pUrb == NULL) { if (pRCB->pUrb == NULL) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR" Failed to alloc rx urb\n"); DBG_PRT(MSG_LEVEL_ERR,KERN_ERR" Failed to alloc rx urb\n");
...@@ -974,16 +974,16 @@ static BOOL device_alloc_bufs(PSDevice pDevice) { ...@@ -974,16 +974,16 @@ static BOOL device_alloc_bufs(PSDevice pDevice) {
} }
pDevice->pControlURB = vntwusb_alloc_urb(0); pDevice->pControlURB = usb_alloc_urb(0, GFP_ATOMIC);
if (pDevice->pControlURB == NULL) { if (pDevice->pControlURB == NULL) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR"Failed to alloc control urb\n"); DBG_PRT(MSG_LEVEL_ERR,KERN_ERR"Failed to alloc control urb\n");
goto free_rx_tx; goto free_rx_tx;
} }
pDevice->pInterruptURB = vntwusb_alloc_urb(0); pDevice->pInterruptURB = usb_alloc_urb(0, GFP_ATOMIC);
if (pDevice->pInterruptURB == NULL) { if (pDevice->pInterruptURB == NULL) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR"Failed to alloc int urb\n"); DBG_PRT(MSG_LEVEL_ERR,KERN_ERR"Failed to alloc int urb\n");
vntwusb_unlink_urb(pDevice->pControlURB); usb_kill_urb(pDevice->pControlURB);
usb_free_urb(pDevice->pControlURB); usb_free_urb(pDevice->pControlURB);
goto free_rx_tx; goto free_rx_tx;
} }
...@@ -991,8 +991,8 @@ static BOOL device_alloc_bufs(PSDevice pDevice) { ...@@ -991,8 +991,8 @@ static BOOL device_alloc_bufs(PSDevice pDevice) {
pDevice->intBuf.pDataBuf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL); pDevice->intBuf.pDataBuf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL);
if (pDevice->intBuf.pDataBuf == NULL) { if (pDevice->intBuf.pDataBuf == NULL) {
DBG_PRT(MSG_LEVEL_ERR,KERN_ERR"Failed to alloc int buf\n"); DBG_PRT(MSG_LEVEL_ERR,KERN_ERR"Failed to alloc int buf\n");
vntwusb_unlink_urb(pDevice->pControlURB); usb_kill_urb(pDevice->pControlURB);
vntwusb_unlink_urb(pDevice->pInterruptURB); usb_kill_urb(pDevice->pInterruptURB);
usb_free_urb(pDevice->pControlURB); usb_free_urb(pDevice->pControlURB);
usb_free_urb(pDevice->pInterruptURB); usb_free_urb(pDevice->pInterruptURB);
goto free_rx_tx; goto free_rx_tx;
...@@ -1193,8 +1193,8 @@ static int device_open(struct net_device *dev) { ...@@ -1193,8 +1193,8 @@ static int device_open(struct net_device *dev) {
device_free_rx_bufs(pDevice); device_free_rx_bufs(pDevice);
device_free_tx_bufs(pDevice); device_free_tx_bufs(pDevice);
device_free_int_bufs(pDevice); device_free_int_bufs(pDevice);
vntwusb_unlink_urb(pDevice->pControlURB); usb_kill_urb(pDevice->pControlURB);
vntwusb_unlink_urb(pDevice->pInterruptURB); usb_kill_urb(pDevice->pInterruptURB);
usb_free_urb(pDevice->pControlURB); usb_free_urb(pDevice->pControlURB);
usb_free_urb(pDevice->pInterruptURB); usb_free_urb(pDevice->pInterruptURB);
...@@ -1280,8 +1280,8 @@ device_release_WPADEV(pDevice); ...@@ -1280,8 +1280,8 @@ device_release_WPADEV(pDevice);
device_free_int_bufs(pDevice); device_free_int_bufs(pDevice);
device_free_frag_bufs(pDevice); device_free_frag_bufs(pDevice);
vntwusb_unlink_urb(pDevice->pControlURB); usb_kill_urb(pDevice->pControlURB);
vntwusb_unlink_urb(pDevice->pInterruptURB); usb_kill_urb(pDevice->pInterruptURB);
usb_free_urb(pDevice->pControlURB); usb_free_urb(pDevice->pControlURB);
usb_free_urb(pDevice->pInterruptURB); usb_free_urb(pDevice->pInterruptURB);
......
...@@ -193,7 +193,7 @@ PIPEnsControlOut( ...@@ -193,7 +193,7 @@ PIPEnsControlOut(
usb_sndctrlpipe(pDevice->usb , 0), (char *) &pDevice->sUsbCtlRequest, usb_sndctrlpipe(pDevice->usb , 0), (char *) &pDevice->sUsbCtlRequest,
pbyBuffer, wLength, s_nsControlInUsbIoCompleteWrite, pDevice); pbyBuffer, wLength, s_nsControlInUsbIoCompleteWrite, pDevice);
if ((ntStatus = vntwusb_submit_urb(pDevice->pControlURB) != 0)) { if ((ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control send request submission failed: %d\n", ntStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control send request submission failed: %d\n", ntStatus);
return STATUS_FAILURE; return STATUS_FAILURE;
} }
...@@ -251,7 +251,7 @@ PIPEnsControlIn( ...@@ -251,7 +251,7 @@ PIPEnsControlIn(
usb_rcvctrlpipe(pDevice->usb , 0), (char *) &pDevice->sUsbCtlRequest, usb_rcvctrlpipe(pDevice->usb , 0), (char *) &pDevice->sUsbCtlRequest,
pbyBuffer, wLength, s_nsControlInUsbIoCompleteRead, pDevice); pbyBuffer, wLength, s_nsControlInUsbIoCompleteRead, pDevice);
if ((ntStatus = vntwusb_submit_urb(pDevice->pControlURB) != 0)) { if ((ntStatus = usb_submit_urb(pDevice->pControlURB, GFP_ATOMIC)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control request submission failed: %d\n", ntStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control request submission failed: %d\n", ntStatus);
}else { }else {
MP_SET_FLAG(pDevice, fMP_CONTROL_READS); MP_SET_FLAG(pDevice, fMP_CONTROL_READS);
...@@ -414,7 +414,7 @@ usb_fill_bulk_urb(pDevice->pInterruptURB, ...@@ -414,7 +414,7 @@ usb_fill_bulk_urb(pDevice->pInterruptURB,
#endif #endif
#endif #endif
if ((ntStatus = vntwusb_submit_urb(pDevice->pInterruptURB)) != 0) { if ((ntStatus = usb_submit_urb(pDevice->pInterruptURB, GFP_ATOMIC)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus);
} }
...@@ -494,7 +494,7 @@ s_nsInterruptUsbIoCompleteRead( ...@@ -494,7 +494,7 @@ s_nsInterruptUsbIoCompleteRead(
if (pDevice->fKillEventPollingThread != TRUE) { if (pDevice->fKillEventPollingThread != TRUE) {
#if 0 //reserve int URB submit #if 0 //reserve int URB submit
if ((ntStatus = vntwusb_submit_urb(urb)) != 0) { if ((ntStatus = usb_submit_urb(urb, GFP_ATOMIC)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Re-Submit int URB failed %d\n", ntStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Re-Submit int URB failed %d\n", ntStatus);
} }
#else //replace int URB submit by bulk transfer #else //replace int URB submit by bulk transfer
...@@ -507,7 +507,7 @@ s_nsInterruptUsbIoCompleteRead( ...@@ -507,7 +507,7 @@ s_nsInterruptUsbIoCompleteRead(
s_nsInterruptUsbIoCompleteRead, s_nsInterruptUsbIoCompleteRead,
pDevice); pDevice);
if ((ntStatus = vntwusb_submit_urb(pDevice->pInterruptURB)) != 0) { if ((ntStatus = usb_submit_urb(pDevice->pInterruptURB, GFP_ATOMIC)) != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit int URB failed %d\n", ntStatus);
} }
...@@ -572,7 +572,7 @@ PIPEnsBulkInUsbRead( ...@@ -572,7 +572,7 @@ PIPEnsBulkInUsbRead(
s_nsBulkInUsbIoCompleteRead, s_nsBulkInUsbIoCompleteRead,
pRCB); pRCB);
if((ntStatus = vntwusb_submit_urb(pUrb)!=0)){ if((ntStatus = usb_submit_urb(pUrb, GFP_ATOMIC)) != 0){
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit Rx URB failed %d\n", ntStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit Rx URB failed %d\n", ntStatus);
return STATUS_FAILURE ; return STATUS_FAILURE ;
} }
...@@ -718,7 +718,7 @@ PIPEnsSendBulkOut( ...@@ -718,7 +718,7 @@ PIPEnsSendBulkOut(
s_nsBulkOutIoCompleteWrite, s_nsBulkOutIoCompleteWrite,
pContext); pContext);
if((status = vntwusb_submit_urb(pUrb))!=0) if((status = usb_submit_urb(pUrb, GFP_ATOMIC))!=0)
{ {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit Tx URB failed %d\n", status); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Submit Tx URB failed %d\n", status);
return STATUS_FAILURE; return STATUS_FAILURE;
......
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