Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[pandora-kernel.git] / drivers / staging / rtl8192su / r8192U_core.c
index f15be1e..7d0305c 100644 (file)
@@ -110,7 +110,7 @@ u32 rt_global_debug_component = \
 #define TOTAL_CAM_ENTRY 32
 #define CAM_CONTENT_COUNT 8
 
-static struct usb_device_id rtl8192_usb_id_tbl[] = {
+static const struct usb_device_id rtl8192_usb_id_tbl[] = {
        /* Realtek */
        {USB_DEVICE(0x0bda, 0x8192)},
        {USB_DEVICE(0x0bda, 0x8709)},
@@ -2340,25 +2340,24 @@ short rtl8192SU_tx(struct net_device *dev, struct sk_buff* skb)
                                    skb->len, rtl8192_tx_isr, skb);
 
        status = usb_submit_urb(tx_urb, GFP_ATOMIC);
-       if (!status){
-//we need to send 0 byte packet whenever 512N bytes/64N(HIGN SPEED/NORMAL SPEED) bytes packet has been transmitted. Otherwise, it will be halt to wait for another packet. WB. 2008.08.27
+       if (!status) {
+               /*
+                * we need to send 0 byte packet whenever 512N bytes/64N(HIGN SPEED/NORMAL SPEED) bytes packet has been transmitted.
+                * Otherwise, it will be halt to wait for another packet. WB. 2008.08.27
+                */
                bool bSend0Byte = false;
                u8 zero = 0;
-               if(udev->speed == USB_SPEED_HIGH)
-               {
+               if(udev->speed == USB_SPEED_HIGH) {
                        if (skb->len > 0 && skb->len % 512 == 0)
                                bSend0Byte = true;
                }
-               else
-               {
+               else {
                        if (skb->len > 0 && skb->len % 64 == 0)
                                bSend0Byte = true;
                }
-               if (bSend0Byte)
-               {
-#if 1
+               if (bSend0Byte) {
                        tx_urb_zero = usb_alloc_urb(0,GFP_ATOMIC);
-                       if(!tx_urb_zero){
+                       if(!tx_urb_zero) {
                                RT_TRACE(COMP_ERR, "can't alloc urb for zero byte\n");
                                return -ENOMEM;
                        }
@@ -2366,16 +2365,23 @@ short rtl8192SU_tx(struct net_device *dev, struct sk_buff* skb)
                                        usb_sndbulkpipe(udev,idx_pipe), &zero,
                                        0, tx_zero_isr, dev);
                        status = usb_submit_urb(tx_urb_zero, GFP_ATOMIC);
-                       if (status){
-                       RT_TRACE(COMP_ERR, "Error TX URB for zero byte %d, error %d", atomic_read(&priv->tx_pending[tcb_desc->queue_index]), status);
-                       return -1;
+                       switch (status) {
+                               case 0:
+                                       break;
+                               case -ECONNRESET:
+                               case -ENOENT:
+                               case -ESHUTDOWN:
+                                       break;
+                               default:
+                                       RT_TRACE(COMP_ERR, "Error TX URB for zero byte %d, error %d",
+                                               atomic_read(&priv->tx_pending[tcb_desc->queue_index]), status);
+                                       return -1;
                        }
-#endif
                }
                dev->trans_start = jiffies;
                atomic_inc(&priv->tx_pending[tcb_desc->queue_index]);
                return 0;
-       }else{
+       } else {
                RT_TRACE(COMP_ERR, "Error TX URB %d, error %d", atomic_read(&priv->tx_pending[tcb_desc->queue_index]),
                                status);
                return -1;
@@ -6125,7 +6131,7 @@ void rtl8192_process_phyinfo(struct r8192_priv * priv,u8* buffer, struct ieee802
        u16 sc ;
        unsigned int frag,seq;
        hdr = (struct ieee80211_hdr_3addr *)buffer;
-       sc = le16_to_cpu(hdr->seq_ctl);
+       sc = le16_to_cpu(hdr->seq_ctrl);
        frag = WLAN_GET_SEQ_FRAG(sc);
        seq = WLAN_GET_SEQ_SEQ(sc);
        //cosa add 04292008 to record the sequence number
@@ -6784,7 +6790,7 @@ void rtl8192SU_TranslateRxSignalStuff(struct sk_buff *skb,
        tmp_buf = (u8*)skb->data;// + get_rxpacket_shiftbytes_819xusb(pstats);
 
        hdr = (struct ieee80211_hdr_3addr *)tmp_buf;
-       fc = le16_to_cpu(hdr->frame_ctl);
+       fc = le16_to_cpu(hdr->frame_control);
        type = WLAN_FC_GET_TYPE(fc);
        praddr = hdr->addr1;