diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/irda/irlan/irlan_eth.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c index 5bb8353105cc..8ee1ff6c742f 100644 --- a/net/irda/irlan/irlan_eth.c +++ b/net/irda/irlan/irlan_eth.c | |||
@@ -45,13 +45,11 @@ static int irlan_eth_close(struct net_device *dev); | |||
45 | static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb, | 45 | static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb, |
46 | struct net_device *dev); | 46 | struct net_device *dev); |
47 | static void irlan_eth_set_multicast_list( struct net_device *dev); | 47 | static void irlan_eth_set_multicast_list( struct net_device *dev); |
48 | static struct net_device_stats *irlan_eth_get_stats(struct net_device *dev); | ||
49 | 48 | ||
50 | static const struct net_device_ops irlan_eth_netdev_ops = { | 49 | static const struct net_device_ops irlan_eth_netdev_ops = { |
51 | .ndo_open = irlan_eth_open, | 50 | .ndo_open = irlan_eth_open, |
52 | .ndo_stop = irlan_eth_close, | 51 | .ndo_stop = irlan_eth_close, |
53 | .ndo_start_xmit = irlan_eth_xmit, | 52 | .ndo_start_xmit = irlan_eth_xmit, |
54 | .ndo_get_stats = irlan_eth_get_stats, | ||
55 | .ndo_set_multicast_list = irlan_eth_set_multicast_list, | 53 | .ndo_set_multicast_list = irlan_eth_set_multicast_list, |
56 | .ndo_change_mtu = eth_change_mtu, | 54 | .ndo_change_mtu = eth_change_mtu, |
57 | .ndo_validate_addr = eth_validate_addr, | 55 | .ndo_validate_addr = eth_validate_addr, |
@@ -208,10 +206,10 @@ static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb, | |||
208 | * tried :-) DB | 206 | * tried :-) DB |
209 | */ | 207 | */ |
210 | /* irttp_data_request already free the packet */ | 208 | /* irttp_data_request already free the packet */ |
211 | self->stats.tx_dropped++; | 209 | dev->stats.tx_dropped++; |
212 | } else { | 210 | } else { |
213 | self->stats.tx_packets++; | 211 | dev->stats.tx_packets++; |
214 | self->stats.tx_bytes += len; | 212 | dev->stats.tx_bytes += len; |
215 | } | 213 | } |
216 | 214 | ||
217 | return NETDEV_TX_OK; | 215 | return NETDEV_TX_OK; |
@@ -226,15 +224,16 @@ static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb, | |||
226 | int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb) | 224 | int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb) |
227 | { | 225 | { |
228 | struct irlan_cb *self = instance; | 226 | struct irlan_cb *self = instance; |
227 | struct net_device *dev = self->dev; | ||
229 | 228 | ||
230 | if (skb == NULL) { | 229 | if (skb == NULL) { |
231 | ++self->stats.rx_dropped; | 230 | dev->stats.rx_dropped++; |
232 | return 0; | 231 | return 0; |
233 | } | 232 | } |
234 | if (skb->len < ETH_HLEN) { | 233 | if (skb->len < ETH_HLEN) { |
235 | IRDA_DEBUG(0, "%s() : IrLAN frame too short (%d)\n", | 234 | IRDA_DEBUG(0, "%s() : IrLAN frame too short (%d)\n", |
236 | __func__, skb->len); | 235 | __func__, skb->len); |
237 | ++self->stats.rx_dropped; | 236 | dev->stats.rx_dropped++; |
238 | dev_kfree_skb(skb); | 237 | dev_kfree_skb(skb); |
239 | return 0; | 238 | return 0; |
240 | } | 239 | } |
@@ -244,10 +243,10 @@ int irlan_eth_receive(void *instance, void *sap, struct sk_buff *skb) | |||
244 | * might have been previously set by the low level IrDA network | 243 | * might have been previously set by the low level IrDA network |
245 | * device driver | 244 | * device driver |
246 | */ | 245 | */ |
247 | skb->protocol = eth_type_trans(skb, self->dev); /* Remove eth header */ | 246 | skb->protocol = eth_type_trans(skb, dev); /* Remove eth header */ |
248 | 247 | ||
249 | self->stats.rx_packets++; | 248 | dev->stats.rx_packets++; |
250 | self->stats.rx_bytes += skb->len; | 249 | dev->stats.rx_bytes += skb->len; |
251 | 250 | ||
252 | netif_rx(skb); /* Eat it! */ | 251 | netif_rx(skb); /* Eat it! */ |
253 | 252 | ||
@@ -348,16 +347,3 @@ static void irlan_eth_set_multicast_list(struct net_device *dev) | |||
348 | else | 347 | else |
349 | irlan_set_broadcast_filter(self, FALSE); | 348 | irlan_set_broadcast_filter(self, FALSE); |
350 | } | 349 | } |
351 | |||
352 | /* | ||
353 | * Function irlan_get_stats (dev) | ||
354 | * | ||
355 | * Get the current statistics for this device | ||
356 | * | ||
357 | */ | ||
358 | static struct net_device_stats *irlan_eth_get_stats(struct net_device *dev) | ||
359 | { | ||
360 | struct irlan_cb *self = netdev_priv(dev); | ||
361 | |||
362 | return &self->stats; | ||
363 | } | ||