aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656
diff options
context:
space:
mode:
authorAndres More <more.andres@gmail.com>2010-07-12 18:28:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-22 14:43:05 -0400
commit529e5b32355305d2488363ba7404c6041d73995d (patch)
tree22a64cb4d9cac7c49854cde068af8e9aff137ac9 /drivers/staging/vt6656
parent6d4e807c5a302f10a3b80c7382c9a2a04ed6ec3f (diff)
staging: vt6656: code cleanup in device_netdev_ops' device_xmit()
Lindented, cleared checkpatch findings and simplified error handling. Signed-off-by: Andres More <more.andres@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r--drivers/staging/vt6656/main_usb.c46
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
1309static int device_xmit(struct sk_buff *skb, struct net_device *dev) { 1309static 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); 1334out:
1335 spin_unlock_irq(&pDevice->lock);
1336 1336
1337 return 0; 1337 return NETDEV_TX_OK;
1338} 1338}
1339 1339
1340
1341
1342static unsigned const ethernet_polynomial = 0x04c11db7U; 1340static unsigned const ethernet_polynomial = 0x04c11db7U;
1343static inline u32 ether_crc(int length, unsigned char *data) 1341static inline u32 ether_crc(int length, unsigned char *data)
1344{ 1342{