Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94f9d298 authored by Paulius Zaleckas's avatar Paulius Zaleckas Committed by Jeff Garzik
Browse files

3c359: use netstats in net_device structure



Use net_device_stats from net_device structure instead of local.
Kill xl_get_stats function, because by default it is used identical
internal_stats function from net/core/dev.c

Signed-off-by: default avatarPaulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 4711c841
Loading
Loading
Loading
Loading
+6 −14
Original line number Original line Diff line number Diff line
@@ -132,7 +132,6 @@ static void xl_dn_comp(struct net_device *dev);
static int xl_close(struct net_device *dev);
static int xl_close(struct net_device *dev);
static void xl_set_rx_mode(struct net_device *dev);
static void xl_set_rx_mode(struct net_device *dev);
static irqreturn_t xl_interrupt(int irq, void *dev_id);
static irqreturn_t xl_interrupt(int irq, void *dev_id);
static struct net_device_stats * xl_get_stats(struct net_device *dev);
static int xl_set_mac_address(struct net_device *dev, void *addr) ; 
static int xl_set_mac_address(struct net_device *dev, void *addr) ; 
static void xl_arb_cmd(struct net_device *dev);
static void xl_arb_cmd(struct net_device *dev);
static void xl_asb_cmd(struct net_device *dev) ; 
static void xl_asb_cmd(struct net_device *dev) ; 
@@ -343,7 +342,6 @@ static int __devinit xl_probe(struct pci_dev *pdev,
	dev->stop=&xl_close;
	dev->stop=&xl_close;
	dev->do_ioctl=NULL;
	dev->do_ioctl=NULL;
	dev->set_multicast_list=&xl_set_rx_mode;
	dev->set_multicast_list=&xl_set_rx_mode;
	dev->get_stats=&xl_get_stats ;
	dev->set_mac_address=&xl_set_mac_address ; 
	dev->set_mac_address=&xl_set_mac_address ; 
	SET_NETDEV_DEV(dev, &pdev->dev);
	SET_NETDEV_DEV(dev, &pdev->dev);


@@ -921,7 +919,7 @@ static void xl_rx(struct net_device *dev)
					adv_rx_ring(dev) ; 
					adv_rx_ring(dev) ; 
				
				
				adv_rx_ring(dev) ; /* One more time just for luck :) */ 
				adv_rx_ring(dev) ; /* One more time just for luck :) */ 
				xl_priv->xl_stats.rx_dropped++ ; 
				dev->stats.rx_dropped++ ; 


				writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; 
				writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; 
				return ; 				
				return ; 				
@@ -957,7 +955,7 @@ static void xl_rx(struct net_device *dev)
			if (skb==NULL) { /* Still need to fix the rx ring */
			if (skb==NULL) { /* Still need to fix the rx ring */
				printk(KERN_WARNING "%s: dev_alloc_skb failed in rx, single buffer \n",dev->name) ; 
				printk(KERN_WARNING "%s: dev_alloc_skb failed in rx, single buffer \n",dev->name) ; 
				adv_rx_ring(dev) ; 
				adv_rx_ring(dev) ; 
				xl_priv->xl_stats.rx_dropped++ ; 
				dev->stats.rx_dropped++ ; 
				writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; 
				writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; 
				return ; 
				return ; 
			}
			}
@@ -971,8 +969,8 @@ static void xl_rx(struct net_device *dev)
			xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE));
			xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE));
			xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG;
			xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG;
			adv_rx_ring(dev) ; 
			adv_rx_ring(dev) ; 
			xl_priv->xl_stats.rx_packets++ ; 
			dev->stats.rx_packets++ ; 
			xl_priv->xl_stats.rx_bytes += frame_length ; 	
			dev->stats.rx_bytes += frame_length ; 	


			netif_rx(skb2) ; 		
			netif_rx(skb2) ; 		
		 } /* if multiple buffers */
		 } /* if multiple buffers */
@@ -1182,8 +1180,8 @@ static int xl_xmit(struct sk_buff *skb, struct net_device *dev)
		txd->buffer = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE));
		txd->buffer = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE));
		txd->buffer_length = cpu_to_le32(skb->len) | TXDNFRAGLAST;
		txd->buffer_length = cpu_to_le32(skb->len) | TXDNFRAGLAST;
		xl_priv->tx_ring_skb[tx_head] = skb ; 
		xl_priv->tx_ring_skb[tx_head] = skb ; 
		xl_priv->xl_stats.tx_packets++ ; 
		dev->stats.tx_packets++ ; 
		xl_priv->xl_stats.tx_bytes += skb->len ;
		dev->stats.tx_bytes += skb->len ;


		/* 
		/* 
		 * Set the nextptr of the previous descriptor equal to this descriptor, add XL_TX_RING_SIZE -1 
		 * Set the nextptr of the previous descriptor equal to this descriptor, add XL_TX_RING_SIZE -1 
@@ -1463,12 +1461,6 @@ static void xl_srb_bh(struct net_device *dev)
	return ; 	
	return ; 	
} 
} 


static struct net_device_stats * xl_get_stats(struct net_device *dev)
{
	struct xl_private *xl_priv = netdev_priv(dev);
	return (struct net_device_stats *) &xl_priv->xl_stats; 
}

static int xl_set_mac_address (struct net_device *dev, void *addr) 
static int xl_set_mac_address (struct net_device *dev, void *addr) 
{
{
	struct sockaddr *saddr = addr ; 
	struct sockaddr *saddr = addr ; 
+0 −2
Original line number Original line Diff line number Diff line
@@ -273,8 +273,6 @@ struct xl_private {
	struct wait_queue *srb_wait;
	struct wait_queue *srb_wait;
	volatile int asb_queued;   
	volatile int asb_queued;   


	struct net_device_stats xl_stats ;

	u16 mac_buffer ; 	
	u16 mac_buffer ; 	
	u16 xl_lan_status ;
	u16 xl_lan_status ;
	u8 xl_ring_speed ;
	u8 xl_ring_speed ;