]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/linux-mtx-1-2.4.27/20-au1x00_ethernet_tx_stats.diff
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / linux-mtx-1-2.4.27 / 20-au1x00_ethernet_tx_stats.diff
1 diff -p -u -r1.5.2.33 linux/drivers/net/au1000_eth.c
2 --- linux/drivers/net/au1000_eth.c      26 Nov 2004 08:40:13 -0000      1.5.2.33
3 +++ linux/drivers/net/au1000_eth.c      21 Jan 2005 14:33:47 -0000
4 @@ -83,7 +83,7 @@ static void au1000_tx_timeout(struct net
5  static int au1000_set_config(struct net_device *dev, struct ifmap *map);
6  static void set_rx_mode(struct net_device *);
7  static struct net_device_stats *au1000_get_stats(struct net_device *);
8 -static inline void update_tx_stats(struct net_device *, u32, u32);
9 +static inline void update_tx_stats(struct net_device *, u32);
10  static inline void update_rx_stats(struct net_device *, u32);
11  static void au1000_timer(unsigned long);
12  static int au1000_ioctl(struct net_device *, struct ifreq *, int);
13 @@ -1542,14 +1542,11 @@ static void __exit au1000_cleanup_module
14  
15  
16  static inline void 
17 -update_tx_stats(struct net_device *dev, u32 status, u32 pkt_len)
18 +update_tx_stats(struct net_device *dev, u32 status)
19  {
20         struct au1000_private *aup = (struct au1000_private *) dev->priv;
21         struct net_device_stats *ps = &aup->stats;
22  
23 -       ps->tx_packets++;
24 -       ps->tx_bytes += pkt_len;
25 -
26         if (status & TX_FRAME_ABORTED) {
27                 if (dev->if_port == IF_PORT_100BASEFX) {
28                         if (status & (TX_JAB_TIMEOUT | TX_UNDERRUN)) {
29 @@ -1582,7 +1579,7 @@ static void au1000_tx_ack(struct net_dev
30         ptxd = aup->tx_dma_ring[aup->tx_tail];
31  
32         while (ptxd->buff_stat & TX_T_DONE) {
33 -               update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
34 +               update_tx_stats(dev, ptxd->status);
35                 ptxd->buff_stat &= ~TX_T_DONE;
36                 ptxd->len = 0;
37                 au_sync();
38 @@ -1604,6 +1601,7 @@ static void au1000_tx_ack(struct net_dev
39  static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
40  {
41         struct au1000_private *aup = (struct au1000_private *) dev->priv;
42 +       struct net_device_stats *ps = &aup->stats;
43         volatile tx_dma_t *ptxd;
44         u32 buff_stat;
45         db_dest_t *pDB;
46 @@ -1623,7 +1621,7 @@ static int au1000_tx(struct sk_buff *skb
47                 return 1;
48         }
49         else if (buff_stat & TX_T_DONE) {
50 -               update_tx_stats(dev, ptxd->status, ptxd->len & 0x3ff);
51 +               update_tx_stats(dev, ptxd->status);
52                 ptxd->len = 0;
53         }
54  
55 @@ -1643,6 +1641,9 @@ static int au1000_tx(struct sk_buff *skb
56         else
57                 ptxd->len = skb->len;
58  
59 +       ps->tx_packets++;
60 +       ps->tx_bytes += ptxd->len;
61 +
62         ptxd->buff_stat = pDB->dma_addr | TX_DMA_ENABLE;
63         au_sync();
64         dev_kfree_skb(skb);