aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/vlsi_ir.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/irda/vlsi_ir.c')
-rw-r--r--drivers/net/irda/vlsi_ir.c78
1 files changed, 36 insertions, 42 deletions
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 0d30f8d659a1..723c4588c803 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -291,14 +291,14 @@ static void vlsi_proc_ndev(struct seq_file *seq, struct net_device *ndev)
291 now.tv_sec - idev->last_rx.tv_sec - delta1, delta2); 291 now.tv_sec - idev->last_rx.tv_sec - delta1, delta2);
292 292
293 seq_printf(seq, "RX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu", 293 seq_printf(seq, "RX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu",
294 idev->stats.rx_packets, idev->stats.rx_bytes, idev->stats.rx_errors, 294 ndev->stats.rx_packets, ndev->stats.rx_bytes, ndev->stats.rx_errors,
295 idev->stats.rx_dropped); 295 ndev->stats.rx_dropped);
296 seq_printf(seq, " / overrun=%lu / length=%lu / frame=%lu / crc=%lu\n", 296 seq_printf(seq, " / overrun=%lu / length=%lu / frame=%lu / crc=%lu\n",
297 idev->stats.rx_over_errors, idev->stats.rx_length_errors, 297 ndev->stats.rx_over_errors, ndev->stats.rx_length_errors,
298 idev->stats.rx_frame_errors, idev->stats.rx_crc_errors); 298 ndev->stats.rx_frame_errors, ndev->stats.rx_crc_errors);
299 seq_printf(seq, "TX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu / fifo=%lu\n", 299 seq_printf(seq, "TX: packets=%lu / bytes=%lu / errors=%lu / dropped=%lu / fifo=%lu\n",
300 idev->stats.tx_packets, idev->stats.tx_bytes, idev->stats.tx_errors, 300 ndev->stats.tx_packets, ndev->stats.tx_bytes, ndev->stats.tx_errors,
301 idev->stats.tx_dropped, idev->stats.tx_fifo_errors); 301 ndev->stats.tx_dropped, ndev->stats.tx_fifo_errors);
302 302
303} 303}
304 304
@@ -651,21 +651,21 @@ static void vlsi_rx_interrupt(struct net_device *ndev)
651 651
652 if (ret < 0) { 652 if (ret < 0) {
653 ret = -ret; 653 ret = -ret;
654 idev->stats.rx_errors++; 654 ndev->stats.rx_errors++;
655 if (ret & VLSI_RX_DROP) 655 if (ret & VLSI_RX_DROP)
656 idev->stats.rx_dropped++; 656 ndev->stats.rx_dropped++;
657 if (ret & VLSI_RX_OVER) 657 if (ret & VLSI_RX_OVER)
658 idev->stats.rx_over_errors++; 658 ndev->stats.rx_over_errors++;
659 if (ret & VLSI_RX_LENGTH) 659 if (ret & VLSI_RX_LENGTH)
660 idev->stats.rx_length_errors++; 660 ndev->stats.rx_length_errors++;
661 if (ret & VLSI_RX_FRAME) 661 if (ret & VLSI_RX_FRAME)
662 idev->stats.rx_frame_errors++; 662 ndev->stats.rx_frame_errors++;
663 if (ret & VLSI_RX_CRC) 663 if (ret & VLSI_RX_CRC)
664 idev->stats.rx_crc_errors++; 664 ndev->stats.rx_crc_errors++;
665 } 665 }
666 else if (ret > 0) { 666 else if (ret > 0) {
667 idev->stats.rx_packets++; 667 ndev->stats.rx_packets++;
668 idev->stats.rx_bytes += ret; 668 ndev->stats.rx_bytes += ret;
669 } 669 }
670 } 670 }
671 671
@@ -686,6 +686,7 @@ static void vlsi_rx_interrupt(struct net_device *ndev)
686 686
687static void vlsi_unarm_rx(vlsi_irda_dev_t *idev) 687static void vlsi_unarm_rx(vlsi_irda_dev_t *idev)
688{ 688{
689 struct net_device *ndev = pci_get_drvdata(idev->pdev);
689 struct vlsi_ring *r = idev->rx_ring; 690 struct vlsi_ring *r = idev->rx_ring;
690 struct ring_descr *rd; 691 struct ring_descr *rd;
691 int ret; 692 int ret;
@@ -711,21 +712,21 @@ static void vlsi_unarm_rx(vlsi_irda_dev_t *idev)
711 712
712 if (ret < 0) { 713 if (ret < 0) {
713 ret = -ret; 714 ret = -ret;
714 idev->stats.rx_errors++; 715 ndev->stats.rx_errors++;
715 if (ret & VLSI_RX_DROP) 716 if (ret & VLSI_RX_DROP)
716 idev->stats.rx_dropped++; 717 ndev->stats.rx_dropped++;
717 if (ret & VLSI_RX_OVER) 718 if (ret & VLSI_RX_OVER)
718 idev->stats.rx_over_errors++; 719 ndev->stats.rx_over_errors++;
719 if (ret & VLSI_RX_LENGTH) 720 if (ret & VLSI_RX_LENGTH)
720 idev->stats.rx_length_errors++; 721 ndev->stats.rx_length_errors++;
721 if (ret & VLSI_RX_FRAME) 722 if (ret & VLSI_RX_FRAME)
722 idev->stats.rx_frame_errors++; 723 ndev->stats.rx_frame_errors++;
723 if (ret & VLSI_RX_CRC) 724 if (ret & VLSI_RX_CRC)
724 idev->stats.rx_crc_errors++; 725 ndev->stats.rx_crc_errors++;
725 } 726 }
726 else if (ret > 0) { 727 else if (ret > 0) {
727 idev->stats.rx_packets++; 728 ndev->stats.rx_packets++;
728 idev->stats.rx_bytes += ret; 729 ndev->stats.rx_bytes += ret;
729 } 730 }
730 } 731 }
731} 732}
@@ -1050,8 +1051,8 @@ drop_unlock:
1050drop: 1051drop:
1051 IRDA_WARNING("%s: dropping packet - %s\n", __func__, msg); 1052 IRDA_WARNING("%s: dropping packet - %s\n", __func__, msg);
1052 dev_kfree_skb_any(skb); 1053 dev_kfree_skb_any(skb);
1053 idev->stats.tx_errors++; 1054 ndev->stats.tx_errors++;
1054 idev->stats.tx_dropped++; 1055 ndev->stats.tx_dropped++;
1055 /* Don't even think about returning NET_XMIT_DROP (=1) here! 1056 /* Don't even think about returning NET_XMIT_DROP (=1) here!
1056 * In fact any retval!=0 causes the packet scheduler to requeue the 1057 * In fact any retval!=0 causes the packet scheduler to requeue the
1057 * packet for later retry of transmission - which isn't exactly 1058 * packet for later retry of transmission - which isn't exactly
@@ -1078,15 +1079,15 @@ static void vlsi_tx_interrupt(struct net_device *ndev)
1078 1079
1079 if (ret < 0) { 1080 if (ret < 0) {
1080 ret = -ret; 1081 ret = -ret;
1081 idev->stats.tx_errors++; 1082 ndev->stats.tx_errors++;
1082 if (ret & VLSI_TX_DROP) 1083 if (ret & VLSI_TX_DROP)
1083 idev->stats.tx_dropped++; 1084 ndev->stats.tx_dropped++;
1084 if (ret & VLSI_TX_FIFO) 1085 if (ret & VLSI_TX_FIFO)
1085 idev->stats.tx_fifo_errors++; 1086 ndev->stats.tx_fifo_errors++;
1086 } 1087 }
1087 else if (ret > 0){ 1088 else if (ret > 0){
1088 idev->stats.tx_packets++; 1089 ndev->stats.tx_packets++;
1089 idev->stats.tx_bytes += ret; 1090 ndev->stats.tx_bytes += ret;
1090 } 1091 }
1091 } 1092 }
1092 1093
@@ -1122,6 +1123,7 @@ static void vlsi_tx_interrupt(struct net_device *ndev)
1122 1123
1123static void vlsi_unarm_tx(vlsi_irda_dev_t *idev) 1124static void vlsi_unarm_tx(vlsi_irda_dev_t *idev)
1124{ 1125{
1126 struct net_device *ndev = pci_get_drvdata(idev->pdev);
1125 struct vlsi_ring *r = idev->tx_ring; 1127 struct vlsi_ring *r = idev->tx_ring;
1126 struct ring_descr *rd; 1128 struct ring_descr *rd;
1127 int ret; 1129 int ret;
@@ -1145,15 +1147,15 @@ static void vlsi_unarm_tx(vlsi_irda_dev_t *idev)
1145 1147
1146 if (ret < 0) { 1148 if (ret < 0) {
1147 ret = -ret; 1149 ret = -ret;
1148 idev->stats.tx_errors++; 1150 ndev->stats.tx_errors++;
1149 if (ret & VLSI_TX_DROP) 1151 if (ret & VLSI_TX_DROP)
1150 idev->stats.tx_dropped++; 1152 ndev->stats.tx_dropped++;
1151 if (ret & VLSI_TX_FIFO) 1153 if (ret & VLSI_TX_FIFO)
1152 idev->stats.tx_fifo_errors++; 1154 ndev->stats.tx_fifo_errors++;
1153 } 1155 }
1154 else if (ret > 0){ 1156 else if (ret > 0){
1155 idev->stats.tx_packets++; 1157 ndev->stats.tx_packets++;
1156 idev->stats.tx_bytes += ret; 1158 ndev->stats.tx_bytes += ret;
1157 } 1159 }
1158 } 1160 }
1159 1161
@@ -1373,13 +1375,6 @@ static int vlsi_stop_hw(vlsi_irda_dev_t *idev)
1373 1375
1374/**************************************************************/ 1376/**************************************************************/
1375 1377
1376static struct net_device_stats * vlsi_get_stats(struct net_device *ndev)
1377{
1378 vlsi_irda_dev_t *idev = netdev_priv(ndev);
1379
1380 return &idev->stats;
1381}
1382
1383static void vlsi_tx_timeout(struct net_device *ndev) 1378static void vlsi_tx_timeout(struct net_device *ndev)
1384{ 1379{
1385 vlsi_irda_dev_t *idev = netdev_priv(ndev); 1380 vlsi_irda_dev_t *idev = netdev_priv(ndev);
@@ -1615,7 +1610,6 @@ static int vlsi_irda_init(struct net_device *ndev)
1615 1610
1616 ndev->open = vlsi_open; 1611 ndev->open = vlsi_open;
1617 ndev->stop = vlsi_close; 1612 ndev->stop = vlsi_close;
1618 ndev->get_stats = vlsi_get_stats;
1619 ndev->hard_start_xmit = vlsi_hard_start_xmit; 1613 ndev->hard_start_xmit = vlsi_hard_start_xmit;
1620 ndev->do_ioctl = vlsi_ioctl; 1614 ndev->do_ioctl = vlsi_ioctl;
1621 ndev->tx_timeout = vlsi_tx_timeout; 1615 ndev->tx_timeout = vlsi_tx_timeout;