diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/vt6656/main_usb.c | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 217e8a62a60..0b95db43fc2 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c | |||
@@ -1306,39 +1306,37 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) | |||
1306 | return NETDEV_TX_OK; | 1306 | return NETDEV_TX_OK; |
1307 | } | 1307 | } |
1308 | 1308 | ||
1309 | static int device_xmit(struct sk_buff *skb, struct net_device *dev) { | 1309 | static int device_xmit(struct sk_buff *skb, struct net_device *dev) |
1310 | PSDevice pDevice=netdev_priv(dev); | 1310 | { |
1311 | struct net_device_stats* pStats = &pDevice->stats; | 1311 | PSDevice pDevice = netdev_priv(dev); |
1312 | struct net_device_stats *stats = &pDevice->stats; | ||
1312 | 1313 | ||
1314 | spin_lock_irq(&pDevice->lock); | ||
1313 | 1315 | ||
1314 | spin_lock_irq(&pDevice->lock); | 1316 | netif_stop_queue(dev); |
1315 | 1317 | ||
1316 | netif_stop_queue(pDevice->dev); | 1318 | if (!pDevice->bLinkPass) { |
1319 | dev_kfree_skb_irq(skb); | ||
1320 | goto out; | ||
1321 | } | ||
1317 | 1322 | ||
1318 | if (pDevice->bLinkPass == FALSE) { | 1323 | if (pDevice->bStopDataPkt) { |
1319 | dev_kfree_skb_irq(skb); | 1324 | dev_kfree_skb_irq(skb); |
1320 | spin_unlock_irq(&pDevice->lock); | 1325 | stats->tx_dropped++; |
1321 | return 0; | 1326 | goto out; |
1322 | } | 1327 | } |
1323 | if (pDevice->bStopDataPkt == TRUE) { | ||
1324 | dev_kfree_skb_irq(skb); | ||
1325 | pStats->tx_dropped++; | ||
1326 | spin_unlock_irq(&pDevice->lock); | ||
1327 | return 0; | ||
1328 | } | ||
1329 | 1328 | ||
1330 | if(nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) !=0) { //mike add:xmit fail! | 1329 | if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb)) { |
1331 | if (netif_queue_stopped(pDevice->dev)) | 1330 | if (netif_queue_stopped(dev)) |
1332 | netif_wake_queue(pDevice->dev); | 1331 | netif_wake_queue(dev); |
1333 | } | 1332 | } |
1334 | 1333 | ||
1335 | spin_unlock_irq(&pDevice->lock); | 1334 | out: |
1335 | spin_unlock_irq(&pDevice->lock); | ||
1336 | 1336 | ||
1337 | return 0; | 1337 | return NETDEV_TX_OK; |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | |||
1341 | |||
1342 | static unsigned const ethernet_polynomial = 0x04c11db7U; | 1340 | static unsigned const ethernet_polynomial = 0x04c11db7U; |
1343 | static inline u32 ether_crc(int length, unsigned char *data) | 1341 | static inline u32 ether_crc(int length, unsigned char *data) |
1344 | { | 1342 | { |