diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2009-03-26 11:11:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-27 03:46:44 -0400 |
commit | ac99533fb716171db12798039671f19631cf3586 (patch) | |
tree | 1cc931278f4dba812c816aed3db16ab8194be6af | |
parent | f70d59492ed8bc1d74b364ebe2b97ef6705910b1 (diff) |
wan: convert sdla driver to net_device_ops
Also use internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wan/sdla.c | 36 | ||||
-rw-r--r-- | include/linux/if_frad.h | 1 |
2 files changed, 15 insertions, 22 deletions
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c index 6a07ba9371db..1d637f407a0c 100644 --- a/drivers/net/wan/sdla.c +++ b/drivers/net/wan/sdla.c | |||
@@ -714,19 +714,19 @@ static int sdla_transmit(struct sk_buff *skb, struct net_device *dev) | |||
714 | switch (ret) | 714 | switch (ret) |
715 | { | 715 | { |
716 | case SDLA_RET_OK: | 716 | case SDLA_RET_OK: |
717 | flp->stats.tx_packets++; | 717 | dev->stats.tx_packets++; |
718 | ret = DLCI_RET_OK; | 718 | ret = DLCI_RET_OK; |
719 | break; | 719 | break; |
720 | 720 | ||
721 | case SDLA_RET_CIR_OVERFLOW: | 721 | case SDLA_RET_CIR_OVERFLOW: |
722 | case SDLA_RET_BUF_OVERSIZE: | 722 | case SDLA_RET_BUF_OVERSIZE: |
723 | case SDLA_RET_NO_BUFS: | 723 | case SDLA_RET_NO_BUFS: |
724 | flp->stats.tx_dropped++; | 724 | dev->stats.tx_dropped++; |
725 | ret = DLCI_RET_DROP; | 725 | ret = DLCI_RET_DROP; |
726 | break; | 726 | break; |
727 | 727 | ||
728 | default: | 728 | default: |
729 | flp->stats.tx_errors++; | 729 | dev->stats.tx_errors++; |
730 | ret = DLCI_RET_ERR; | 730 | ret = DLCI_RET_ERR; |
731 | break; | 731 | break; |
732 | } | 732 | } |
@@ -807,7 +807,7 @@ static void sdla_receive(struct net_device *dev) | |||
807 | if (i == CONFIG_DLCI_MAX) | 807 | if (i == CONFIG_DLCI_MAX) |
808 | { | 808 | { |
809 | printk(KERN_NOTICE "%s: Received packet from invalid DLCI %i, ignoring.", dev->name, dlci); | 809 | printk(KERN_NOTICE "%s: Received packet from invalid DLCI %i, ignoring.", dev->name, dlci); |
810 | flp->stats.rx_errors++; | 810 | dev->stats.rx_errors++; |
811 | success = 0; | 811 | success = 0; |
812 | } | 812 | } |
813 | } | 813 | } |
@@ -819,7 +819,7 @@ static void sdla_receive(struct net_device *dev) | |||
819 | if (skb == NULL) | 819 | if (skb == NULL) |
820 | { | 820 | { |
821 | printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name); | 821 | printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name); |
822 | flp->stats.rx_dropped++; | 822 | dev->stats.rx_dropped++; |
823 | success = 0; | 823 | success = 0; |
824 | } | 824 | } |
825 | else | 825 | else |
@@ -859,7 +859,7 @@ static void sdla_receive(struct net_device *dev) | |||
859 | 859 | ||
860 | if (success) | 860 | if (success) |
861 | { | 861 | { |
862 | flp->stats.rx_packets++; | 862 | dev->stats.rx_packets++; |
863 | dlp = netdev_priv(master); | 863 | dlp = netdev_priv(master); |
864 | (*dlp->receive)(skb, master); | 864 | (*dlp->receive)(skb, master); |
865 | } | 865 | } |
@@ -1590,13 +1590,14 @@ fail: | |||
1590 | return err; | 1590 | return err; |
1591 | } | 1591 | } |
1592 | 1592 | ||
1593 | static struct net_device_stats *sdla_stats(struct net_device *dev) | 1593 | static const struct net_device_ops sdla_netdev_ops = { |
1594 | { | 1594 | .ndo_open = sdla_open, |
1595 | struct frad_local *flp; | 1595 | .ndo_stop = sdla_close, |
1596 | flp = netdev_priv(dev); | 1596 | .ndo_do_ioctl = sdla_ioctl, |
1597 | 1597 | .ndo_set_config = sdla_set_config, | |
1598 | return(&flp->stats); | 1598 | .ndo_start_xmit = sdla_transmit, |
1599 | } | 1599 | .ndo_change_mtu = sdla_change_mtu, |
1600 | }; | ||
1600 | 1601 | ||
1601 | static void setup_sdla(struct net_device *dev) | 1602 | static void setup_sdla(struct net_device *dev) |
1602 | { | 1603 | { |
@@ -1604,20 +1605,13 @@ static void setup_sdla(struct net_device *dev) | |||
1604 | 1605 | ||
1605 | netdev_boot_setup_check(dev); | 1606 | netdev_boot_setup_check(dev); |
1606 | 1607 | ||
1608 | dev->netdev_ops = &sdla_netdev_ops; | ||
1607 | dev->flags = 0; | 1609 | dev->flags = 0; |
1608 | dev->type = 0xFFFF; | 1610 | dev->type = 0xFFFF; |
1609 | dev->hard_header_len = 0; | 1611 | dev->hard_header_len = 0; |
1610 | dev->addr_len = 0; | 1612 | dev->addr_len = 0; |
1611 | dev->mtu = SDLA_MAX_MTU; | 1613 | dev->mtu = SDLA_MAX_MTU; |
1612 | 1614 | ||
1613 | dev->open = sdla_open; | ||
1614 | dev->stop = sdla_close; | ||
1615 | dev->do_ioctl = sdla_ioctl; | ||
1616 | dev->set_config = sdla_set_config; | ||
1617 | dev->get_stats = sdla_stats; | ||
1618 | dev->hard_start_xmit = sdla_transmit; | ||
1619 | dev->change_mtu = sdla_change_mtu; | ||
1620 | |||
1621 | flp->activate = sdla_activate; | 1615 | flp->activate = sdla_activate; |
1622 | flp->deactivate = sdla_deactivate; | 1616 | flp->deactivate = sdla_deactivate; |
1623 | flp->assoc = sdla_assoc; | 1617 | flp->assoc = sdla_assoc; |
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index 60e16a551dd6..673f2209453d 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
@@ -153,7 +153,6 @@ struct frhdr | |||
153 | 153 | ||
154 | struct dlci_local | 154 | struct dlci_local |
155 | { | 155 | { |
156 | struct net_device_stats stats; | ||
157 | struct net_device *master; | 156 | struct net_device *master; |
158 | struct net_device *slave; | 157 | struct net_device *slave; |
159 | struct dlci_conf config; | 158 | struct dlci_conf config; |