aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-01-07 21:02:53 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-07 21:02:53 -0500
commitfb875333c80942455551f690f306a899ceeee5df (patch)
tree8c830ff61d8e9da4f24dad49d8d8ea0816693297 /drivers/media/dvb
parent2a97e6b735416054dcc1b3cf7f4d358f43b45c6e (diff)
dvb: update network device to current API
Use internal network_device_stats that exist in network device and net_device_ops. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c57
1 files changed, 28 insertions, 29 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index 03fd9dd5c685..f6ba8468858e 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -125,7 +125,6 @@ static void hexdump( const unsigned char *buf, unsigned short len )
125 125
126struct dvb_net_priv { 126struct dvb_net_priv {
127 int in_use; 127 int in_use;
128 struct net_device_stats stats;
129 u16 pid; 128 u16 pid;
130 struct net_device *net; 129 struct net_device *net;
131 struct dvb_net *host; 130 struct dvb_net *host;
@@ -384,8 +383,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
384 if (priv->ule_skb) { 383 if (priv->ule_skb) {
385 dev_kfree_skb( priv->ule_skb ); 384 dev_kfree_skb( priv->ule_skb );
386 /* Prepare for next SNDU. */ 385 /* Prepare for next SNDU. */
387 priv->stats.rx_errors++; 386 dev->stats.rx_errors++;
388 priv->stats.rx_frame_errors++; 387 dev->stats.rx_frame_errors++;
389 } 388 }
390 reset_ule(priv); 389 reset_ule(priv);
391 priv->need_pusi = 1; 390 priv->need_pusi = 1;
@@ -438,8 +437,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
438 dev_kfree_skb( priv->ule_skb ); 437 dev_kfree_skb( priv->ule_skb );
439 /* Prepare for next SNDU. */ 438 /* Prepare for next SNDU. */
440 // reset_ule(priv); moved to below. 439 // reset_ule(priv); moved to below.
441 priv->stats.rx_errors++; 440 dev->stats.rx_errors++;
442 priv->stats.rx_frame_errors++; 441 dev->stats.rx_frame_errors++;
443 } 442 }
444 reset_ule(priv); 443 reset_ule(priv);
445 /* skip to next PUSI. */ 444 /* skip to next PUSI. */
@@ -460,8 +459,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
460 /* Drop partly decoded SNDU, reset state, resync on PUSI. */ 459 /* Drop partly decoded SNDU, reset state, resync on PUSI. */
461 if (priv->ule_skb) { 460 if (priv->ule_skb) {
462 dev_kfree_skb( priv->ule_skb ); 461 dev_kfree_skb( priv->ule_skb );
463 priv->stats.rx_errors++; 462 dev->stats.rx_errors++;
464 priv->stats.rx_frame_errors++; 463 dev->stats.rx_frame_errors++;
465 } 464 }
466 reset_ule(priv); 465 reset_ule(priv);
467 priv->need_pusi = 1; 466 priv->need_pusi = 1;
@@ -477,8 +476,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
477 if (priv->ule_sndu_remain > 183) { 476 if (priv->ule_sndu_remain > 183) {
478 /* Current SNDU lacks more data than there could be available in the 477 /* Current SNDU lacks more data than there could be available in the
479 * current TS cell. */ 478 * current TS cell. */
480 priv->stats.rx_errors++; 479 dev->stats.rx_errors++;
481 priv->stats.rx_length_errors++; 480 dev->stats.rx_length_errors++;
482 printk(KERN_WARNING "%lu: Expected %d more SNDU bytes, but " 481 printk(KERN_WARNING "%lu: Expected %d more SNDU bytes, but "
483 "got PUSI (pf %d, ts_remain %d). Flushing incomplete payload.\n", 482 "got PUSI (pf %d, ts_remain %d). Flushing incomplete payload.\n",
484 priv->ts_count, priv->ule_sndu_remain, ts[4], ts_remain); 483 priv->ts_count, priv->ule_sndu_remain, ts[4], ts_remain);
@@ -520,8 +519,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
520 if (priv->ule_sndu_len < 5) { 519 if (priv->ule_sndu_len < 5) {
521 printk(KERN_WARNING "%lu: Invalid ULE SNDU length %u. " 520 printk(KERN_WARNING "%lu: Invalid ULE SNDU length %u. "
522 "Resyncing.\n", priv->ts_count, priv->ule_sndu_len); 521 "Resyncing.\n", priv->ts_count, priv->ule_sndu_len);
523 priv->stats.rx_errors++; 522 dev->stats.rx_errors++;
524 priv->stats.rx_length_errors++; 523 dev->stats.rx_length_errors++;
525 priv->ule_sndu_len = 0; 524 priv->ule_sndu_len = 0;
526 priv->need_pusi = 1; 525 priv->need_pusi = 1;
527 new_ts = 1; 526 new_ts = 1;
@@ -573,7 +572,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
573 if (priv->ule_skb == NULL) { 572 if (priv->ule_skb == NULL) {
574 printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", 573 printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n",
575 dev->name); 574 dev->name);
576 priv->stats.rx_dropped++; 575 dev->stats.rx_dropped++;
577 return; 576 return;
578 } 577 }
579 578
@@ -637,8 +636,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
637 ule_dump = 1; 636 ule_dump = 1;
638#endif 637#endif
639 638
640 priv->stats.rx_errors++; 639 dev->stats.rx_errors++;
641 priv->stats.rx_crc_errors++; 640 dev->stats.rx_crc_errors++;
642 dev_kfree_skb(priv->ule_skb); 641 dev_kfree_skb(priv->ule_skb);
643 } else { 642 } else {
644 /* CRC32 verified OK. */ 643 /* CRC32 verified OK. */
@@ -744,8 +743,8 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
744 * receive the packet anyhow. */ 743 * receive the packet anyhow. */
745 /* if (priv->ule_dbit && skb->pkt_type == PACKET_OTHERHOST) 744 /* if (priv->ule_dbit && skb->pkt_type == PACKET_OTHERHOST)
746 priv->ule_skb->pkt_type = PACKET_HOST; */ 745 priv->ule_skb->pkt_type = PACKET_HOST; */
747 priv->stats.rx_packets++; 746 dev->stats.rx_packets++;
748 priv->stats.rx_bytes += priv->ule_skb->len; 747 dev->stats.rx_bytes += priv->ule_skb->len;
749 netif_rx(priv->ule_skb); 748 netif_rx(priv->ule_skb);
750 } 749 }
751 sndu_done: 750 sndu_done:
@@ -800,8 +799,7 @@ static void dvb_net_sec(struct net_device *dev,
800{ 799{
801 u8 *eth; 800 u8 *eth;
802 struct sk_buff *skb; 801 struct sk_buff *skb;
803 struct net_device_stats *stats = 802 struct net_device_stats *stats = &dev->stats;
804 &((struct dvb_net_priv *) netdev_priv(dev))->stats;
805 int snap = 0; 803 int snap = 0;
806 804
807 /* note: pkt_len includes a 32bit checksum */ 805 /* note: pkt_len includes a 32bit checksum */
@@ -1216,28 +1214,29 @@ static int dvb_net_stop(struct net_device *dev)
1216 return dvb_net_feed_stop(dev); 1214 return dvb_net_feed_stop(dev);
1217} 1215}
1218 1216
1219static struct net_device_stats * dvb_net_get_stats(struct net_device *dev)
1220{
1221 return &((struct dvb_net_priv *) netdev_priv(dev))->stats;
1222}
1223
1224static const struct header_ops dvb_header_ops = { 1217static const struct header_ops dvb_header_ops = {
1225 .create = eth_header, 1218 .create = eth_header,
1226 .parse = eth_header_parse, 1219 .parse = eth_header_parse,
1227 .rebuild = eth_rebuild_header, 1220 .rebuild = eth_rebuild_header,
1228}; 1221};
1229 1222
1223
1224static const struct net_device_ops dvb_netdev_ops = {
1225 .ndo_open = dvb_net_open,
1226 .ndo_stop = dvb_net_stop,
1227 .ndo_start_xmit = dvb_net_tx,
1228 .ndo_set_multicast_list = dvb_net_set_multicast_list,
1229 .ndo_set_mac_address = dvb_net_set_mac,
1230 .ndo_change_mtu = eth_change_mtu,
1231 .ndo_validate_addr = eth_validate_addr,
1232};
1233
1230static void dvb_net_setup(struct net_device *dev) 1234static void dvb_net_setup(struct net_device *dev)
1231{ 1235{
1232 ether_setup(dev); 1236 ether_setup(dev);
1233 1237
1234 dev->header_ops = &dvb_header_ops; 1238 dev->header_ops = &dvb_header_ops;
1235 dev->open = dvb_net_open; 1239 dev->netdev_ops = &dvb_netdev_ops;
1236 dev->stop = dvb_net_stop;
1237 dev->hard_start_xmit = dvb_net_tx;
1238 dev->get_stats = dvb_net_get_stats;
1239 dev->set_multicast_list = dvb_net_set_multicast_list;
1240 dev->set_mac_address = dvb_net_set_mac;
1241 dev->mtu = 4096; 1240 dev->mtu = 4096;
1242 dev->mc_count = 0; 1241 dev->mc_count = 0;
1243 1242