aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ps3_gelic_net.c
diff options
context:
space:
mode:
authorMasakazu Mokuno <mokuno@sm.sony.co.jp>2007-07-20 04:31:07 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-24 16:28:40 -0400
commit92548d601c45d76db337795d71c34846631dc7d6 (patch)
treec46a8b557cff63f3a3d9681f1ddc7627bb9386a2 /drivers/net/ps3_gelic_net.c
parent78f710dc186f34fb14d8b22a33749a56013e7b85 (diff)
ps3: use net_device_stats of net_device structure
Removed the statistics information from private structre. Instead, use net_device_stats in net_device structure. Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ps3_gelic_net.c')
-rw-r--r--drivers/net/ps3_gelic_net.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 549e69bc5e80..2f515b82f8c2 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -404,13 +404,13 @@ static void gelic_net_release_tx_chain(struct gelic_net_card *card, int stop)
404 "%s: forcing end of tx descriptor " \ 404 "%s: forcing end of tx descriptor " \
405 "with status %x\n", 405 "with status %x\n",
406 __func__, status); 406 __func__, status);
407 card->netdev_stats.tx_dropped++; 407 card->netdev->stats.tx_dropped++;
408 break; 408 break;
409 409
410 case GELIC_NET_DESCR_COMPLETE: 410 case GELIC_NET_DESCR_COMPLETE:
411 if (tx_chain->tail->skb) { 411 if (tx_chain->tail->skb) {
412 card->netdev_stats.tx_packets++; 412 card->netdev->stats.tx_packets++;
413 card->netdev_stats.tx_bytes += 413 card->netdev->stats.tx_bytes +=
414 tx_chain->tail->skb->len; 414 tx_chain->tail->skb->len;
415 } 415 }
416 break; 416 break;
@@ -790,7 +790,7 @@ static int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
790 * DMA map failed. As chanses are that failure 790 * DMA map failed. As chanses are that failure
791 * would continue, just release skb and return 791 * would continue, just release skb and return
792 */ 792 */
793 card->netdev_stats.tx_dropped++; 793 card->netdev->stats.tx_dropped++;
794 dev_kfree_skb_any(skb); 794 dev_kfree_skb_any(skb);
795 spin_unlock_irqrestore(&card->tx_dma_lock, flags); 795 spin_unlock_irqrestore(&card->tx_dma_lock, flags);
796 return NETDEV_TX_OK; 796 return NETDEV_TX_OK;
@@ -810,7 +810,7 @@ static int gelic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
810 * kick failed. 810 * kick failed.
811 * release descriptors which were just prepared 811 * release descriptors which were just prepared
812 */ 812 */
813 card->netdev_stats.tx_dropped++; 813 card->netdev->stats.tx_dropped++;
814 gelic_net_release_tx_descr(card, descr); 814 gelic_net_release_tx_descr(card, descr);
815 gelic_net_release_tx_descr(card, descr->next); 815 gelic_net_release_tx_descr(card, descr->next);
816 card->tx_chain.tail = descr->next->next; 816 card->tx_chain.tail = descr->next->next;
@@ -872,8 +872,8 @@ static void gelic_net_pass_skb_up(struct gelic_net_descr *descr,
872 skb->ip_summed = CHECKSUM_NONE; 872 skb->ip_summed = CHECKSUM_NONE;
873 873
874 /* update netdevice statistics */ 874 /* update netdevice statistics */
875 card->netdev_stats.rx_packets++; 875 card->netdev->stats.rx_packets++;
876 card->netdev_stats.rx_bytes += skb->len; 876 card->netdev->stats.rx_bytes += skb->len;
877 877
878 /* pass skb up to stack */ 878 /* pass skb up to stack */
879 netif_receive_skb(skb); 879 netif_receive_skb(skb);
@@ -913,7 +913,7 @@ static int gelic_net_decode_one_descr(struct gelic_net_card *card)
913 (status == GELIC_NET_DESCR_FORCE_END)) { 913 (status == GELIC_NET_DESCR_FORCE_END)) {
914 dev_info(ctodev(card), "dropping RX descriptor with state %x\n", 914 dev_info(ctodev(card), "dropping RX descriptor with state %x\n",
915 status); 915 status);
916 card->netdev_stats.rx_dropped++; 916 card->netdev->stats.rx_dropped++;
917 goto refill; 917 goto refill;
918 } 918 }
919 919
@@ -986,20 +986,6 @@ static int gelic_net_poll(struct net_device *netdev, int *budget)
986 } else 986 } else
987 return 1; 987 return 1;
988} 988}
989
990/**
991 * gelic_net_get_stats - get interface statistics
992 * @netdev: interface device structure
993 *
994 * returns the interface statistics residing in the gelic_net_card struct
995 */
996static struct net_device_stats *gelic_net_get_stats(struct net_device *netdev)
997{
998 struct gelic_net_card *card = netdev_priv(netdev);
999
1000 return &card->netdev_stats;
1001}
1002
1003/** 989/**
1004 * gelic_net_change_mtu - changes the MTU of an interface 990 * gelic_net_change_mtu - changes the MTU of an interface
1005 * @netdev: interface device structure 991 * @netdev: interface device structure
@@ -1337,7 +1323,6 @@ static void gelic_net_setup_netdev_ops(struct net_device *netdev)
1337 netdev->open = &gelic_net_open; 1323 netdev->open = &gelic_net_open;
1338 netdev->stop = &gelic_net_stop; 1324 netdev->stop = &gelic_net_stop;
1339 netdev->hard_start_xmit = &gelic_net_xmit; 1325 netdev->hard_start_xmit = &gelic_net_xmit;
1340 netdev->get_stats = &gelic_net_get_stats;
1341 netdev->set_multicast_list = &gelic_net_set_multi; 1326 netdev->set_multicast_list = &gelic_net_set_multi;
1342 netdev->change_mtu = &gelic_net_change_mtu; 1327 netdev->change_mtu = &gelic_net_change_mtu;
1343 /* tx watchdog */ 1328 /* tx watchdog */