Commit 529e5b32 authored by Andres More's avatar Andres More Committed by Greg Kroah-Hartman

staging: vt6656: code cleanup in device_netdev_ops' device_xmit()

Lindented, cleared checkpatch findings and simplified error handling.
Signed-off-by: default avatarAndres More <more.andres@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6d4e807c
...@@ -1306,39 +1306,37 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) ...@@ -1306,39 +1306,37 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
static int device_xmit(struct sk_buff *skb, struct net_device *dev) { static int device_xmit(struct sk_buff *skb, struct net_device *dev)
PSDevice pDevice=netdev_priv(dev); {
struct net_device_stats* pStats = &pDevice->stats; PSDevice pDevice = netdev_priv(dev);
struct net_device_stats *stats = &pDevice->stats;
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
netif_stop_queue(pDevice->dev); netif_stop_queue(dev);
if (pDevice->bLinkPass == FALSE) { if (!pDevice->bLinkPass) {
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
spin_unlock_irq(&pDevice->lock); goto out;
return 0;
} }
if (pDevice->bStopDataPkt == TRUE) {
if (pDevice->bStopDataPkt) {
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
pStats->tx_dropped++; stats->tx_dropped++;
spin_unlock_irq(&pDevice->lock); goto out;
return 0;
} }
if(nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb) !=0) { //mike add:xmit fail! if (nsDMA_tx_packet(pDevice, TYPE_AC0DMA, skb)) {
if (netif_queue_stopped(pDevice->dev)) if (netif_queue_stopped(dev))
netif_wake_queue(pDevice->dev); netif_wake_queue(dev);
} }
out:
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return 0; return NETDEV_TX_OK;
} }
static unsigned const ethernet_polynomial = 0x04c11db7U; static unsigned const ethernet_polynomial = 0x04c11db7U;
static inline u32 ether_crc(int length, unsigned char *data) static inline u32 ether_crc(int length, unsigned char *data)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment