diff options
Diffstat (limited to 'drivers/staging/winbond/wb35rx.c')
| -rw-r--r-- | drivers/staging/winbond/wb35rx.c | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/drivers/staging/winbond/wb35rx.c b/drivers/staging/winbond/wb35rx.c index 448514aada4..f006b166aeb 100644 --- a/drivers/staging/winbond/wb35rx.c +++ b/drivers/staging/winbond/wb35rx.c @@ -14,10 +14,10 @@ #include <linux/slab.h> #include "core.h" -#include "sysdef.h" #include "wb35rx_f.h" -static void packet_came(struct ieee80211_hw *hw, char *pRxBufferAddress, int PacketSize) +static void packet_came(struct ieee80211_hw *hw, char *pRxBufferAddress, + int PacketSize) { struct wbsoft_priv *priv = hw->priv; struct sk_buff *skb; @@ -65,7 +65,8 @@ static void Wb35Rx_adjust(struct wb35_descriptor *pRxDes) } else if (DecryptionMethod) { /* For TKIP and CCMP */ for (i = 7; i > 1; i--) pRxBufferAddress[i] = pRxBufferAddress[i - 2]; - pRxDes->buffer_address[0] = pRxBufferAddress + 2; /* Update the descriptor, shift 8 byte */ + /* Update the descriptor, shift 8 byte */ + pRxDes->buffer_address[0] = pRxBufferAddress + 2; BufferSize -= 8; /* 8 byte for IV + ICV */ } pRxDes->buffer_size[0] = BufferSize; @@ -96,7 +97,9 @@ static u16 Wb35Rx_indicate(struct ieee80211_hw *hw) /* Parse the bulkin buffer */ while (BufferSize >= 4) { - if ((cpu_to_le32(*(u32 *)pRxBufferAddress) & 0x0fffffff) == RX_END_TAG) /* Is ending? */ + /* Is ending? */ + if ((cpu_to_le32(*(u32 *)pRxBufferAddress) & 0x0fffffff) == + RX_END_TAG) break; /* Get the R00 R01 first */ @@ -109,10 +112,8 @@ static u16 Wb35Rx_indicate(struct ieee80211_hw *hw) /* Basic check for Rx length. Is length valid? */ if (PacketSize > MAX_PACKET_SIZE) { -#ifdef _PE_RX_DUMP_ - printk("Serious ERROR : Rx data size too long, size =%d\n", PacketSize); -#endif - + pr_debug("Serious ERROR : Rx data size too long, size =%d\n", + PacketSize); pWb35Rx->EP3vm_state = VM_STOP; pWb35Rx->Ep3ErrorCount2++; break; @@ -122,7 +123,8 @@ static u16 Wb35Rx_indicate(struct ieee80211_hw *hw) * Wb35Rx_indicate() is called synchronously so it isn't * necessary to set "RxDes.Desctriptor_ID = RxBufferID;" */ - BufferSize -= 8; /* subtract 8 byte for 35's USB header length */ + /* subtract 8 byte for 35's USB header length */ + BufferSize -= 8; pRxBufferAddress += 8; RxDes.buffer_address[0] = pRxBufferAddress; @@ -174,7 +176,7 @@ static void Wb35Rx_Complete(struct urb *urb) /* The IRP is completed */ pWb35Rx->EP3vm_state = VM_COMPLETED; - if (pHwData->SurpriseRemove || pHwData->HwStop) /* Must be here, or RxBufferId is invalid */ + if (pHwData->SurpriseRemove) /* Must be here, or RxBufferId is invalid */ goto error; if (pWb35Rx->rx_halt) @@ -186,9 +188,7 @@ static void Wb35Rx_Complete(struct urb *urb) /* The URB is completed, check the result */ if (pWb35Rx->EP3VM_status != 0) { -#ifdef _PE_USB_STATE_DUMP_ - printk("EP3 IoCompleteRoutine return error\n"); -#endif + pr_debug("EP3 IoCompleteRoutine return error\n"); pWb35Rx->EP3vm_state = VM_STOP; goto error; } @@ -239,7 +239,7 @@ static void Wb35Rx(struct ieee80211_hw *hw) u32 RxBufferId; /* Issuing URB */ - if (pHwData->SurpriseRemove || pHwData->HwStop) + if (pHwData->SurpriseRemove) goto error; if (pWb35Rx->rx_halt) @@ -249,9 +249,7 @@ static void Wb35Rx(struct ieee80211_hw *hw) RxBufferId = pWb35Rx->RxBufferId; if (!pWb35Rx->RxOwner[RxBufferId]) { /* It's impossible to run here. */ -#ifdef _PE_RX_DUMP_ - printk("Rx driver fifo unavailable\n"); -#endif + pr_debug("Rx driver fifo unavailable\n"); goto error; } @@ -263,13 +261,13 @@ static void Wb35Rx(struct ieee80211_hw *hw) pWb35Rx->pDRx = kzalloc(MAX_USB_RX_BUFFER, GFP_ATOMIC); if (!pWb35Rx->pDRx) { - printk("w35und: Rx memory alloc failed\n"); + dev_info(&hw->wiphy->dev, "w35und: Rx memory alloc failed\n"); goto error; } pRxBufferAddress = pWb35Rx->pDRx; - usb_fill_bulk_urb(urb, pHwData->WbUsb.udev, - usb_rcvbulkpipe(pHwData->WbUsb.udev, 3), + usb_fill_bulk_urb(urb, pHwData->udev, + usb_rcvbulkpipe(pHwData->udev, 3), pRxBufferAddress, MAX_USB_RX_BUFFER, Wb35Rx_Complete, hw); @@ -278,7 +276,7 @@ static void Wb35Rx(struct ieee80211_hw *hw) retv = usb_submit_urb(urb, GFP_ATOMIC); if (retv != 0) { - printk("Rx URB sending error\n"); + dev_info(&hw->wiphy->dev, "Rx URB sending error\n"); goto error; } return; @@ -314,7 +312,9 @@ static void Wb35Rx_reset_descriptor(struct hw_data *pHwData) pWb35Rx->EP3vm_state = VM_STOP; pWb35Rx->rx_halt = 0; - /* Initial the Queue. The last buffer is reserved for used if the Rx resource is unavailable. */ + /* Initial the Queue. The last buffer is reserved for used + * if the Rx resource is unavailable. + */ for (i = 0; i < MAX_USB_RX_BUFFER_NUMBER; i++) pWb35Rx->RxOwner[i] = 1; } @@ -336,10 +336,9 @@ void Wb35Rx_stop(struct hw_data *pHwData) /* Canceling the Irp if already sends it out. */ if (pWb35Rx->EP3vm_state == VM_RUNNING) { - usb_unlink_urb(pWb35Rx->RxUrb); /* Only use unlink, let Wb35Rx_destroy to free them */ -#ifdef _PE_RX_DUMP_ - printk("EP3 Rx stop\n"); -#endif + /* Only use unlink, let Wb35Rx_destroy to free them */ + usb_unlink_urb(pWb35Rx->RxUrb); + pr_debug("EP3 Rx stop\n"); } } @@ -353,10 +352,7 @@ void Wb35Rx_destroy(struct hw_data *pHwData) } while (pWb35Rx->EP3vm_state != VM_STOP); msleep(10); /* Delay for waiting function exit */ - if (pWb35Rx->RxUrb) - usb_free_urb(pWb35Rx->RxUrb); -#ifdef _PE_RX_DUMP_ - printk("Wb35Rx_destroy OK\n"); -#endif + usb_free_urb(pWb35Rx->RxUrb); + pr_debug("Wb35Rx_destroy OK\n"); } |
