Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
[sfrench/cifs-2.6.git] / drivers / staging / vt6656 / main_usb.c
index 51a858fa79ab7689989191c8c309d9b644aa706e..c528ef0f8ed4c81872728f8c659f021ecc26c1b2 100644 (file)
@@ -366,7 +366,7 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
     BYTE            byAntenna;
     unsigned int            ii;
     CMD_CARD_INIT   sInitCmd;
-    NTSTATUS        ntStatus = STATUS_SUCCESS;
+    int ntStatus = STATUS_SUCCESS;
     RSP_CARD_INIT   sInitRsp;
     PSMgmtObject    pMgmt = &(pDevice->sMgmtObj);
     BYTE            byTmp;
@@ -1046,7 +1046,6 @@ BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) {
 static int  device_open(struct net_device *dev) {
     PSDevice    pDevice=(PSDevice) netdev_priv(dev);
 
-#ifdef WPA_SM_Transtatus
      extern SWPAResult wpa_Result;
      memset(wpa_Result.ifname,0,sizeof(wpa_Result.ifname));
      wpa_Result.proto = 0;
@@ -1054,7 +1053,6 @@ static int  device_open(struct net_device *dev) {
      wpa_Result.eap_type = 0;
      wpa_Result.authenticated = FALSE;
      pDevice->fWPA_Authened = FALSE;
-#endif
 
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " device_open...\n");
 
@@ -1292,67 +1290,53 @@ static void __devexit vt6656_disconnect(struct usb_interface *intf)
        }
 }
 
-static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
-    PSDevice        pDevice=netdev_priv(dev);
-    PBYTE           pbMPDU;
-    unsigned int            cbMPDULen = 0;
-
-
-    DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_dma0_tx_80211\n");
-    spin_lock_irq(&pDevice->lock);
-
-    if (pDevice->bStopTx0Pkt == TRUE) {
-        dev_kfree_skb_irq(skb);
-        spin_unlock_irq(&pDevice->lock);
-        return 0;
-    };
-
-
-    cbMPDULen = skb->len;
-    pbMPDU = skb->data;
+static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev)
+{
+       PSDevice pDevice = netdev_priv(dev);
 
-    vDMA0_tx_80211(pDevice, skb);
+       spin_lock_irq(&pDevice->lock);
 
-    spin_unlock_irq(&pDevice->lock);
+       if (unlikely(pDevice->bStopTx0Pkt))
+               dev_kfree_skb_irq(skb);
+       else
+               vDMA0_tx_80211(pDevice, skb);
 
-    return 0;
+       spin_unlock_irq(&pDevice->lock);
 
+       return NETDEV_TX_OK;
 }
 
+static int device_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+       PSDevice pDevice = netdev_priv(dev);
+       struct net_device_stats *stats = &pDevice->stats;
 
-static int  device_xmit(struct sk_buff *skb, struct net_device *dev) {
-    PSDevice    pDevice=netdev_priv(dev);
-    struct net_device_stats* pStats = &pDevice->stats;
-
+       spin_lock_irq(&pDevice->lock);
 
-    spin_lock_irq(&pDevice->lock);
+       netif_stop_queue(dev);
 
-    netif_stop_queue(pDevice->dev);
+       if (!pDevice->bLinkPass) {
+               dev_kfree_skb_irq(skb);
+               goto out;
+       }
 
-    if (pDevice->bLinkPass == FALSE) {
-        dev_kfree_skb_irq(skb);
-        spin_unlock_irq(&pDevice->lock);
-        return 0;
-    }
-    if (pDevice->bStopDataPkt == TRUE) {
-        dev_kfree_skb_irq(skb);
-        pStats->tx_dropped++;
-        spin_unlock_irq(&pDevice->lock);
-        return 0;
-    }
+       if (pDevice->bStopDataPkt) {
+               dev_kfree_skb_irq(skb);
+               stats->tx_dropped++;
+               goto out;
+       }
 
-    if(nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) !=0) {  //mike add:xmit fail!
-         if (netif_queue_stopped(pDevice->dev))
-              netif_wake_queue(pDevice->dev);
-    }
+       if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb)) {
+               if (netif_queue_stopped(dev))
+                       netif_wake_queue(dev);
+       }
 
-    spin_unlock_irq(&pDevice->lock);
+out:
+       spin_unlock_irq(&pDevice->lock);
 
-    return 0;
+       return NETDEV_TX_OK;
 }
 
-
-
 static unsigned const ethernet_polynomial = 0x04c11db7U;
 static inline u32 ether_crc(int length, unsigned char *data)
 {