diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:36:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-22 01:37:58 -0400 |
commit | 07d117cf0a2c71160d3fcc0068d1f1fe1237c47a (patch) | |
tree | f29f2c93dccd26e52425cdfeeb21fa4e9fa8fc31 /drivers/net/wan/dlci.c | |
parent | 48f26ad5c097d751caef070ba057448d8a9c9a8d (diff) |
dlci: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/dlci.c')
-rw-r--r-- | drivers/net/wan/dlci.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c index a297e3efa05d..a1b0b0d7391a 100644 --- a/drivers/net/wan/dlci.c +++ b/drivers/net/wan/dlci.c | |||
@@ -114,7 +114,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | |||
114 | if (!pskb_may_pull(skb, sizeof(*hdr))) { | 114 | if (!pskb_may_pull(skb, sizeof(*hdr))) { |
115 | printk(KERN_NOTICE "%s: invalid data no header\n", | 115 | printk(KERN_NOTICE "%s: invalid data no header\n", |
116 | dev->name); | 116 | dev->name); |
117 | dlp->stats.rx_errors++; | 117 | dev->stats.rx_errors++; |
118 | kfree_skb(skb); | 118 | kfree_skb(skb); |
119 | return; | 119 | return; |
120 | } | 120 | } |
@@ -127,7 +127,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | |||
127 | if (hdr->control != FRAD_I_UI) | 127 | if (hdr->control != FRAD_I_UI) |
128 | { | 128 | { |
129 | printk(KERN_NOTICE "%s: Invalid header flag 0x%02X.\n", dev->name, hdr->control); | 129 | printk(KERN_NOTICE "%s: Invalid header flag 0x%02X.\n", dev->name, hdr->control); |
130 | dlp->stats.rx_errors++; | 130 | dev->stats.rx_errors++; |
131 | } | 131 | } |
132 | else | 132 | else |
133 | switch(hdr->IP_NLPID) | 133 | switch(hdr->IP_NLPID) |
@@ -136,14 +136,14 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | |||
136 | if (hdr->NLPID != FRAD_P_SNAP) | 136 | if (hdr->NLPID != FRAD_P_SNAP) |
137 | { | 137 | { |
138 | printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->NLPID); | 138 | printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->NLPID); |
139 | dlp->stats.rx_errors++; | 139 | dev->stats.rx_errors++; |
140 | break; | 140 | break; |
141 | } | 141 | } |
142 | 142 | ||
143 | if (hdr->OUI[0] + hdr->OUI[1] + hdr->OUI[2] != 0) | 143 | if (hdr->OUI[0] + hdr->OUI[1] + hdr->OUI[2] != 0) |
144 | { | 144 | { |
145 | printk(KERN_NOTICE "%s: Unsupported organizationally unique identifier 0x%02X-%02X-%02X.\n", dev->name, hdr->OUI[0], hdr->OUI[1], hdr->OUI[2]); | 145 | printk(KERN_NOTICE "%s: Unsupported organizationally unique identifier 0x%02X-%02X-%02X.\n", dev->name, hdr->OUI[0], hdr->OUI[1], hdr->OUI[2]); |
146 | dlp->stats.rx_errors++; | 146 | dev->stats.rx_errors++; |
147 | break; | 147 | break; |
148 | } | 148 | } |
149 | 149 | ||
@@ -164,12 +164,12 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | |||
164 | case FRAD_P_Q933: | 164 | case FRAD_P_Q933: |
165 | case FRAD_P_CLNP: | 165 | case FRAD_P_CLNP: |
166 | printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->pad); | 166 | printk(KERN_NOTICE "%s: Unsupported NLPID 0x%02X.\n", dev->name, hdr->pad); |
167 | dlp->stats.rx_errors++; | 167 | dev->stats.rx_errors++; |
168 | break; | 168 | break; |
169 | 169 | ||
170 | default: | 170 | default: |
171 | printk(KERN_NOTICE "%s: Invalid pad byte 0x%02X.\n", dev->name, hdr->pad); | 171 | printk(KERN_NOTICE "%s: Invalid pad byte 0x%02X.\n", dev->name, hdr->pad); |
172 | dlp->stats.rx_errors++; | 172 | dev->stats.rx_errors++; |
173 | break; | 173 | break; |
174 | } | 174 | } |
175 | 175 | ||
@@ -178,9 +178,9 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev) | |||
178 | /* we've set up the protocol, so discard the header */ | 178 | /* we've set up the protocol, so discard the header */ |
179 | skb_reset_mac_header(skb); | 179 | skb_reset_mac_header(skb); |
180 | skb_pull(skb, header); | 180 | skb_pull(skb, header); |
181 | dlp->stats.rx_bytes += skb->len; | 181 | dev->stats.rx_bytes += skb->len; |
182 | netif_rx(skb); | 182 | netif_rx(skb); |
183 | dlp->stats.rx_packets++; | 183 | dev->stats.rx_packets++; |
184 | } | 184 | } |
185 | else | 185 | else |
186 | dev_kfree_skb(skb); | 186 | dev_kfree_skb(skb); |
@@ -204,15 +204,15 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev) | |||
204 | switch (ret) | 204 | switch (ret) |
205 | { | 205 | { |
206 | case DLCI_RET_OK: | 206 | case DLCI_RET_OK: |
207 | dlp->stats.tx_packets++; | 207 | dev->stats.tx_packets++; |
208 | ret = 0; | 208 | ret = 0; |
209 | break; | 209 | break; |
210 | case DLCI_RET_ERR: | 210 | case DLCI_RET_ERR: |
211 | dlp->stats.tx_errors++; | 211 | dev->stats.tx_errors++; |
212 | ret = 0; | 212 | ret = 0; |
213 | break; | 213 | break; |
214 | case DLCI_RET_DROP: | 214 | case DLCI_RET_DROP: |
215 | dlp->stats.tx_dropped++; | 215 | dev->stats.tx_dropped++; |
216 | ret = 1; | 216 | ret = 1; |
217 | break; | 217 | break; |
218 | } | 218 | } |
@@ -342,15 +342,6 @@ static int dlci_close(struct net_device *dev) | |||
342 | return 0; | 342 | return 0; |
343 | } | 343 | } |
344 | 344 | ||
345 | static struct net_device_stats *dlci_get_stats(struct net_device *dev) | ||
346 | { | ||
347 | struct dlci_local *dlp; | ||
348 | |||
349 | dlp = netdev_priv(dev); | ||
350 | |||
351 | return(&dlp->stats); | ||
352 | } | ||
353 | |||
354 | static int dlci_add(struct dlci_add *dlci) | 345 | static int dlci_add(struct dlci_add *dlci) |
355 | { | 346 | { |
356 | struct net_device *master, *slave; | 347 | struct net_device *master, *slave; |
@@ -498,7 +489,6 @@ static void dlci_setup(struct net_device *dev) | |||
498 | dev->do_ioctl = dlci_dev_ioctl; | 489 | dev->do_ioctl = dlci_dev_ioctl; |
499 | dev->hard_start_xmit = dlci_transmit; | 490 | dev->hard_start_xmit = dlci_transmit; |
500 | dev->header_ops = &dlci_header_ops; | 491 | dev->header_ops = &dlci_header_ops; |
501 | dev->get_stats = dlci_get_stats; | ||
502 | dev->change_mtu = dlci_change_mtu; | 492 | dev->change_mtu = dlci_change_mtu; |
503 | dev->destructor = free_netdev; | 493 | dev->destructor = free_netdev; |
504 | 494 | ||