diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-24 17:52:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-24 17:52:16 -0500 |
commit | 486bf8de17361232c40e092a219f328093e34dca (patch) | |
tree | 719719d85325099e2332ab0ae4cf73be556808fa /drivers/net/wan | |
parent | 5c94afd79cd9e68cb9899fe7788342329e9f445f (diff) |
netdevice sbni: Convert directly reference of netdev->priv
1. convert netdev->priv to netdev_priv().
2. make sbni_pci_probe() be static.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r-- | drivers/net/wan/sbni.c | 99 |
1 files changed, 52 insertions, 47 deletions
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 6db063e2d5bb..0aa28e1d4366 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -186,6 +186,7 @@ static unsigned int netcard_portlist[ ] __initdata = { | |||
186 | 0x2b0, 0x2b4, 0x2c0, 0x2c4, 0x2d0, 0x2d4, 0x2e0, 0x2e4, 0x2f0, 0x2f4, | 186 | 0x2b0, 0x2b4, 0x2c0, 0x2c4, 0x2d0, 0x2d4, 0x2e0, 0x2e4, 0x2f0, 0x2f4, |
187 | 0 }; | 187 | 0 }; |
188 | 188 | ||
189 | #define NET_LOCAL_LOCK(dev) (((struct net_local *)netdev_priv(dev))->lock) | ||
189 | 190 | ||
190 | /* | 191 | /* |
191 | * Look for SBNI card which addr stored in dev->base_addr, if nonzero. | 192 | * Look for SBNI card which addr stored in dev->base_addr, if nonzero. |
@@ -287,7 +288,7 @@ static int __init sbni_init(struct net_device *dev) | |||
287 | } | 288 | } |
288 | 289 | ||
289 | 290 | ||
290 | int __init | 291 | static int __init |
291 | sbni_pci_probe( struct net_device *dev ) | 292 | sbni_pci_probe( struct net_device *dev ) |
292 | { | 293 | { |
293 | struct pci_dev *pdev = NULL; | 294 | struct pci_dev *pdev = NULL; |
@@ -378,22 +379,23 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) | |||
378 | dev->irq = irq; | 379 | dev->irq = irq; |
379 | dev->base_addr = ioaddr; | 380 | dev->base_addr = ioaddr; |
380 | 381 | ||
381 | /* Allocate dev->priv and fill in sbni-specific dev fields. */ | 382 | /* Fill in sbni-specific dev fields. */ |
382 | nl = dev->priv; | 383 | nl = netdev_priv(dev); |
383 | if( !nl ) { | 384 | if( !nl ) { |
384 | printk( KERN_ERR "%s: unable to get memory!\n", dev->name ); | 385 | printk( KERN_ERR "%s: unable to get memory!\n", dev->name ); |
385 | release_region( ioaddr, SBNI_IO_EXTENT ); | 386 | release_region( ioaddr, SBNI_IO_EXTENT ); |
386 | return NULL; | 387 | return NULL; |
387 | } | 388 | } |
388 | 389 | ||
389 | dev->priv = nl; | ||
390 | memset( nl, 0, sizeof(struct net_local) ); | 390 | memset( nl, 0, sizeof(struct net_local) ); |
391 | spin_lock_init( &nl->lock ); | 391 | spin_lock_init( &nl->lock ); |
392 | 392 | ||
393 | /* store MAC address (generate if that isn't known) */ | 393 | /* store MAC address (generate if that isn't known) */ |
394 | *(__be16 *)dev->dev_addr = htons( 0x00ff ); | 394 | *(__be16 *)dev->dev_addr = htons( 0x00ff ); |
395 | *(__be32 *)(dev->dev_addr + 2) = htonl( 0x01000000 | | 395 | *(__be32 *)(dev->dev_addr + 2) = htonl( 0x01000000 | |
396 | ( (mac[num] ? mac[num] : (u32)((long)dev->priv)) & 0x00ffffff) ); | 396 | ((mac[num] ? |
397 | mac[num] : | ||
398 | (u32)((long)netdev_priv(dev))) & 0x00ffffff)); | ||
397 | 399 | ||
398 | /* store link settings (speed, receive level ) */ | 400 | /* store link settings (speed, receive level ) */ |
399 | nl->maxframe = DEFAULT_FRAME_LEN; | 401 | nl->maxframe = DEFAULT_FRAME_LEN; |
@@ -447,7 +449,7 @@ sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
447 | 449 | ||
448 | /* Looking for idle device in the list */ | 450 | /* Looking for idle device in the list */ |
449 | for( p = dev; p; ) { | 451 | for( p = dev; p; ) { |
450 | struct net_local *nl = (struct net_local *) p->priv; | 452 | struct net_local *nl = netdev_priv(p); |
451 | spin_lock( &nl->lock ); | 453 | spin_lock( &nl->lock ); |
452 | if( nl->tx_buf_p || (nl->state & FL_LINE_DOWN) ) { | 454 | if( nl->tx_buf_p || (nl->state & FL_LINE_DOWN) ) { |
453 | p = nl->link; | 455 | p = nl->link; |
@@ -469,7 +471,7 @@ sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
469 | static int | 471 | static int |
470 | sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) | 472 | sbni_start_xmit( struct sk_buff *skb, struct net_device *dev ) |
471 | { | 473 | { |
472 | struct net_local *nl = (struct net_local *) dev->priv; | 474 | struct net_local *nl = netdev_priv(dev); |
473 | 475 | ||
474 | netif_stop_queue( dev ); | 476 | netif_stop_queue( dev ); |
475 | spin_lock( &nl->lock ); | 477 | spin_lock( &nl->lock ); |
@@ -503,12 +505,12 @@ static irqreturn_t | |||
503 | sbni_interrupt( int irq, void *dev_id ) | 505 | sbni_interrupt( int irq, void *dev_id ) |
504 | { | 506 | { |
505 | struct net_device *dev = dev_id; | 507 | struct net_device *dev = dev_id; |
506 | struct net_local *nl = dev->priv; | 508 | struct net_local *nl = netdev_priv(dev); |
507 | int repeat; | 509 | int repeat; |
508 | 510 | ||
509 | spin_lock( &nl->lock ); | 511 | spin_lock( &nl->lock ); |
510 | if( nl->second ) | 512 | if( nl->second ) |
511 | spin_lock( &((struct net_local *) nl->second->priv)->lock ); | 513 | spin_lock(&NET_LOCAL_LOCK(nl->second)); |
512 | 514 | ||
513 | do { | 515 | do { |
514 | repeat = 0; | 516 | repeat = 0; |
@@ -522,7 +524,7 @@ sbni_interrupt( int irq, void *dev_id ) | |||
522 | } while( repeat ); | 524 | } while( repeat ); |
523 | 525 | ||
524 | if( nl->second ) | 526 | if( nl->second ) |
525 | spin_unlock( &((struct net_local *)nl->second->priv)->lock ); | 527 | spin_unlock(&NET_LOCAL_LOCK(nl->second)); |
526 | spin_unlock( &nl->lock ); | 528 | spin_unlock( &nl->lock ); |
527 | return IRQ_HANDLED; | 529 | return IRQ_HANDLED; |
528 | } | 530 | } |
@@ -531,7 +533,7 @@ sbni_interrupt( int irq, void *dev_id ) | |||
531 | static void | 533 | static void |
532 | handle_channel( struct net_device *dev ) | 534 | handle_channel( struct net_device *dev ) |
533 | { | 535 | { |
534 | struct net_local *nl = (struct net_local *) dev->priv; | 536 | struct net_local *nl = netdev_priv(dev); |
535 | unsigned long ioaddr = dev->base_addr; | 537 | unsigned long ioaddr = dev->base_addr; |
536 | 538 | ||
537 | int req_ans; | 539 | int req_ans; |
@@ -540,7 +542,7 @@ handle_channel( struct net_device *dev ) | |||
540 | #ifdef CONFIG_SBNI_MULTILINE | 542 | #ifdef CONFIG_SBNI_MULTILINE |
541 | /* Lock the master device because we going to change its local data */ | 543 | /* Lock the master device because we going to change its local data */ |
542 | if( nl->state & FL_SLAVE ) | 544 | if( nl->state & FL_SLAVE ) |
543 | spin_lock( &((struct net_local *) nl->master->priv)->lock ); | 545 | spin_lock(&NET_LOCAL_LOCK(nl->master)); |
544 | #endif | 546 | #endif |
545 | 547 | ||
546 | outb( (inb( ioaddr + CSR0 ) & ~EN_INT) | TR_REQ, ioaddr + CSR0 ); | 548 | outb( (inb( ioaddr + CSR0 ) & ~EN_INT) | TR_REQ, ioaddr + CSR0 ); |
@@ -576,7 +578,7 @@ handle_channel( struct net_device *dev ) | |||
576 | 578 | ||
577 | #ifdef CONFIG_SBNI_MULTILINE | 579 | #ifdef CONFIG_SBNI_MULTILINE |
578 | if( nl->state & FL_SLAVE ) | 580 | if( nl->state & FL_SLAVE ) |
579 | spin_unlock( &((struct net_local *) nl->master->priv)->lock ); | 581 | spin_unlock(&NET_LOCAL_LOCK(nl->master)); |
580 | #endif | 582 | #endif |
581 | } | 583 | } |
582 | 584 | ||
@@ -589,7 +591,7 @@ handle_channel( struct net_device *dev ) | |||
589 | static int | 591 | static int |
590 | recv_frame( struct net_device *dev ) | 592 | recv_frame( struct net_device *dev ) |
591 | { | 593 | { |
592 | struct net_local *nl = (struct net_local *) dev->priv; | 594 | struct net_local *nl = netdev_priv(dev); |
593 | unsigned long ioaddr = dev->base_addr; | 595 | unsigned long ioaddr = dev->base_addr; |
594 | 596 | ||
595 | u32 crc = CRC32_INITIAL; | 597 | u32 crc = CRC32_INITIAL; |
@@ -623,7 +625,7 @@ recv_frame( struct net_device *dev ) | |||
623 | static void | 625 | static void |
624 | send_frame( struct net_device *dev ) | 626 | send_frame( struct net_device *dev ) |
625 | { | 627 | { |
626 | struct net_local *nl = (struct net_local *) dev->priv; | 628 | struct net_local *nl = netdev_priv(dev); |
627 | 629 | ||
628 | u32 crc = CRC32_INITIAL; | 630 | u32 crc = CRC32_INITIAL; |
629 | 631 | ||
@@ -680,7 +682,7 @@ do_send: | |||
680 | static void | 682 | static void |
681 | download_data( struct net_device *dev, u32 *crc_p ) | 683 | download_data( struct net_device *dev, u32 *crc_p ) |
682 | { | 684 | { |
683 | struct net_local *nl = (struct net_local *) dev->priv; | 685 | struct net_local *nl = netdev_priv(dev); |
684 | struct sk_buff *skb = nl->tx_buf_p; | 686 | struct sk_buff *skb = nl->tx_buf_p; |
685 | 687 | ||
686 | unsigned len = min_t(unsigned int, skb->len - nl->outpos, nl->framelen); | 688 | unsigned len = min_t(unsigned int, skb->len - nl->outpos, nl->framelen); |
@@ -699,7 +701,7 @@ static int | |||
699 | upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, | 701 | upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, |
700 | unsigned is_first, u32 crc ) | 702 | unsigned is_first, u32 crc ) |
701 | { | 703 | { |
702 | struct net_local *nl = (struct net_local *) dev->priv; | 704 | struct net_local *nl = netdev_priv(dev); |
703 | 705 | ||
704 | int frame_ok; | 706 | int frame_ok; |
705 | 707 | ||
@@ -721,9 +723,9 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, | |||
721 | nl->wait_frameno = 0, | 723 | nl->wait_frameno = 0, |
722 | nl->inppos = 0, | 724 | nl->inppos = 0, |
723 | #ifdef CONFIG_SBNI_MULTILINE | 725 | #ifdef CONFIG_SBNI_MULTILINE |
724 | ((struct net_local *) nl->master->priv) | 726 | ((struct net_local *)netdev_priv(nl->master)) |
725 | ->stats.rx_errors++, | 727 | ->stats.rx_errors++, |
726 | ((struct net_local *) nl->master->priv) | 728 | ((struct net_local *)netdev_priv(nl->master)) |
727 | ->stats.rx_missed_errors++; | 729 | ->stats.rx_missed_errors++; |
728 | #else | 730 | #else |
729 | nl->stats.rx_errors++, | 731 | nl->stats.rx_errors++, |
@@ -740,8 +742,10 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, | |||
740 | */ | 742 | */ |
741 | nl->wait_frameno = 0, | 743 | nl->wait_frameno = 0, |
742 | #ifdef CONFIG_SBNI_MULTILINE | 744 | #ifdef CONFIG_SBNI_MULTILINE |
743 | ((struct net_local *) nl->master->priv)->stats.rx_errors++, | 745 | ((struct net_local *)netdev_priv(nl->master)) |
744 | ((struct net_local *) nl->master->priv)->stats.rx_crc_errors++; | 746 | ->stats.rx_errors++, |
747 | ((struct net_local *)netdev_priv(nl->master)) | ||
748 | ->stats.rx_crc_errors++; | ||
745 | #else | 749 | #else |
746 | nl->stats.rx_errors++, | 750 | nl->stats.rx_errors++, |
747 | nl->stats.rx_crc_errors++; | 751 | nl->stats.rx_crc_errors++; |
@@ -755,8 +759,8 @@ static inline void | |||
755 | send_complete( struct net_local *nl ) | 759 | send_complete( struct net_local *nl ) |
756 | { | 760 | { |
757 | #ifdef CONFIG_SBNI_MULTILINE | 761 | #ifdef CONFIG_SBNI_MULTILINE |
758 | ((struct net_local *) nl->master->priv)->stats.tx_packets++; | 762 | ((struct net_local *)netdev_priv(nl->master))->stats.tx_packets++; |
759 | ((struct net_local *) nl->master->priv)->stats.tx_bytes | 763 | ((struct net_local *)netdev_priv(nl->master))->stats.tx_bytes |
760 | += nl->tx_buf_p->len; | 764 | += nl->tx_buf_p->len; |
761 | #else | 765 | #else |
762 | nl->stats.tx_packets++; | 766 | nl->stats.tx_packets++; |
@@ -775,7 +779,7 @@ send_complete( struct net_local *nl ) | |||
775 | static void | 779 | static void |
776 | interpret_ack( struct net_device *dev, unsigned ack ) | 780 | interpret_ack( struct net_device *dev, unsigned ack ) |
777 | { | 781 | { |
778 | struct net_local *nl = (struct net_local *) dev->priv; | 782 | struct net_local *nl = netdev_priv(dev); |
779 | 783 | ||
780 | if( ack == FRAME_SENT_OK ) { | 784 | if( ack == FRAME_SENT_OK ) { |
781 | nl->state &= ~FL_NEED_RESEND; | 785 | nl->state &= ~FL_NEED_RESEND; |
@@ -809,7 +813,7 @@ interpret_ack( struct net_device *dev, unsigned ack ) | |||
809 | static int | 813 | static int |
810 | append_frame_to_pkt( struct net_device *dev, unsigned framelen, u32 crc ) | 814 | append_frame_to_pkt( struct net_device *dev, unsigned framelen, u32 crc ) |
811 | { | 815 | { |
812 | struct net_local *nl = (struct net_local *) dev->priv; | 816 | struct net_local *nl = netdev_priv(dev); |
813 | 817 | ||
814 | u8 *p; | 818 | u8 *p; |
815 | 819 | ||
@@ -840,7 +844,7 @@ append_frame_to_pkt( struct net_device *dev, unsigned framelen, u32 crc ) | |||
840 | static void | 844 | static void |
841 | prepare_to_send( struct sk_buff *skb, struct net_device *dev ) | 845 | prepare_to_send( struct sk_buff *skb, struct net_device *dev ) |
842 | { | 846 | { |
843 | struct net_local *nl = (struct net_local *) dev->priv; | 847 | struct net_local *nl = netdev_priv(dev); |
844 | 848 | ||
845 | unsigned int len; | 849 | unsigned int len; |
846 | 850 | ||
@@ -871,15 +875,15 @@ prepare_to_send( struct sk_buff *skb, struct net_device *dev ) | |||
871 | static void | 875 | static void |
872 | drop_xmit_queue( struct net_device *dev ) | 876 | drop_xmit_queue( struct net_device *dev ) |
873 | { | 877 | { |
874 | struct net_local *nl = (struct net_local *) dev->priv; | 878 | struct net_local *nl = netdev_priv(dev); |
875 | 879 | ||
876 | if( nl->tx_buf_p ) | 880 | if( nl->tx_buf_p ) |
877 | dev_kfree_skb_any( nl->tx_buf_p ), | 881 | dev_kfree_skb_any( nl->tx_buf_p ), |
878 | nl->tx_buf_p = NULL, | 882 | nl->tx_buf_p = NULL, |
879 | #ifdef CONFIG_SBNI_MULTILINE | 883 | #ifdef CONFIG_SBNI_MULTILINE |
880 | ((struct net_local *) nl->master->priv) | 884 | ((struct net_local *)netdev_priv(nl->master)) |
881 | ->stats.tx_errors++, | 885 | ->stats.tx_errors++, |
882 | ((struct net_local *) nl->master->priv) | 886 | ((struct net_local *)netdev_priv(nl->master)) |
883 | ->stats.tx_carrier_errors++; | 887 | ->stats.tx_carrier_errors++; |
884 | #else | 888 | #else |
885 | nl->stats.tx_errors++, | 889 | nl->stats.tx_errors++, |
@@ -903,7 +907,7 @@ drop_xmit_queue( struct net_device *dev ) | |||
903 | static void | 907 | static void |
904 | send_frame_header( struct net_device *dev, u32 *crc_p ) | 908 | send_frame_header( struct net_device *dev, u32 *crc_p ) |
905 | { | 909 | { |
906 | struct net_local *nl = (struct net_local *) dev->priv; | 910 | struct net_local *nl = netdev_priv(dev); |
907 | 911 | ||
908 | u32 crc = *crc_p; | 912 | u32 crc = *crc_p; |
909 | u32 len_field = nl->framelen + 6; /* CRC + frameno + reserved */ | 913 | u32 len_field = nl->framelen + 6; /* CRC + frameno + reserved */ |
@@ -1005,7 +1009,7 @@ get_rx_buf( struct net_device *dev ) | |||
1005 | static void | 1009 | static void |
1006 | indicate_pkt( struct net_device *dev ) | 1010 | indicate_pkt( struct net_device *dev ) |
1007 | { | 1011 | { |
1008 | struct net_local *nl = (struct net_local *) dev->priv; | 1012 | struct net_local *nl = netdev_priv(dev); |
1009 | struct sk_buff *skb = nl->rx_buf_p; | 1013 | struct sk_buff *skb = nl->rx_buf_p; |
1010 | 1014 | ||
1011 | skb_put( skb, nl->inppos ); | 1015 | skb_put( skb, nl->inppos ); |
@@ -1013,8 +1017,9 @@ indicate_pkt( struct net_device *dev ) | |||
1013 | #ifdef CONFIG_SBNI_MULTILINE | 1017 | #ifdef CONFIG_SBNI_MULTILINE |
1014 | skb->protocol = eth_type_trans( skb, nl->master ); | 1018 | skb->protocol = eth_type_trans( skb, nl->master ); |
1015 | netif_rx( skb ); | 1019 | netif_rx( skb ); |
1016 | ++((struct net_local *) nl->master->priv)->stats.rx_packets; | 1020 | ++((struct net_local *)netdev_priv(nl->master))->stats.rx_packets; |
1017 | ((struct net_local *) nl->master->priv)->stats.rx_bytes += nl->inppos; | 1021 | ((struct net_local *)netdev_priv(nl->master))->stats.rx_bytes += |
1022 | nl->inppos; | ||
1018 | #else | 1023 | #else |
1019 | skb->protocol = eth_type_trans( skb, dev ); | 1024 | skb->protocol = eth_type_trans( skb, dev ); |
1020 | netif_rx( skb ); | 1025 | netif_rx( skb ); |
@@ -1036,7 +1041,7 @@ static void | |||
1036 | sbni_watchdog( unsigned long arg ) | 1041 | sbni_watchdog( unsigned long arg ) |
1037 | { | 1042 | { |
1038 | struct net_device *dev = (struct net_device *) arg; | 1043 | struct net_device *dev = (struct net_device *) arg; |
1039 | struct net_local *nl = (struct net_local *) dev->priv; | 1044 | struct net_local *nl = netdev_priv(dev); |
1040 | struct timer_list *w = &nl->watchdog; | 1045 | struct timer_list *w = &nl->watchdog; |
1041 | unsigned long flags; | 1046 | unsigned long flags; |
1042 | unsigned char csr0; | 1047 | unsigned char csr0; |
@@ -1089,7 +1094,7 @@ static unsigned char timeout_rxl_tab[] = { | |||
1089 | static void | 1094 | static void |
1090 | card_start( struct net_device *dev ) | 1095 | card_start( struct net_device *dev ) |
1091 | { | 1096 | { |
1092 | struct net_local *nl = (struct net_local *) dev->priv; | 1097 | struct net_local *nl = netdev_priv(dev); |
1093 | 1098 | ||
1094 | nl->timer_ticks = CHANGE_LEVEL_START_TICKS; | 1099 | nl->timer_ticks = CHANGE_LEVEL_START_TICKS; |
1095 | nl->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND); | 1100 | nl->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND); |
@@ -1111,7 +1116,7 @@ card_start( struct net_device *dev ) | |||
1111 | static void | 1116 | static void |
1112 | change_level( struct net_device *dev ) | 1117 | change_level( struct net_device *dev ) |
1113 | { | 1118 | { |
1114 | struct net_local *nl = (struct net_local *) dev->priv; | 1119 | struct net_local *nl = netdev_priv(dev); |
1115 | 1120 | ||
1116 | if( nl->delta_rxl == 0 ) /* do not auto-negotiate RxL */ | 1121 | if( nl->delta_rxl == 0 ) /* do not auto-negotiate RxL */ |
1117 | return; | 1122 | return; |
@@ -1135,7 +1140,7 @@ change_level( struct net_device *dev ) | |||
1135 | static void | 1140 | static void |
1136 | timeout_change_level( struct net_device *dev ) | 1141 | timeout_change_level( struct net_device *dev ) |
1137 | { | 1142 | { |
1138 | struct net_local *nl = (struct net_local *) dev->priv; | 1143 | struct net_local *nl = netdev_priv(dev); |
1139 | 1144 | ||
1140 | nl->cur_rxl_index = timeout_rxl_tab[ nl->timeout_rxl ]; | 1145 | nl->cur_rxl_index = timeout_rxl_tab[ nl->timeout_rxl ]; |
1141 | if( ++nl->timeout_rxl >= 4 ) | 1146 | if( ++nl->timeout_rxl >= 4 ) |
@@ -1158,7 +1163,7 @@ timeout_change_level( struct net_device *dev ) | |||
1158 | static int | 1163 | static int |
1159 | sbni_open( struct net_device *dev ) | 1164 | sbni_open( struct net_device *dev ) |
1160 | { | 1165 | { |
1161 | struct net_local *nl = (struct net_local *) dev->priv; | 1166 | struct net_local *nl = netdev_priv(dev); |
1162 | struct timer_list *w = &nl->watchdog; | 1167 | struct timer_list *w = &nl->watchdog; |
1163 | 1168 | ||
1164 | /* | 1169 | /* |
@@ -1174,7 +1179,7 @@ sbni_open( struct net_device *dev ) | |||
1174 | || (*p)->base_addr == dev->base_addr - 4) | 1179 | || (*p)->base_addr == dev->base_addr - 4) |
1175 | && (*p)->flags & IFF_UP ) { | 1180 | && (*p)->flags & IFF_UP ) { |
1176 | 1181 | ||
1177 | ((struct net_local *) ((*p)->priv)) | 1182 | ((struct net_local *) (netdev_priv(*p))) |
1178 | ->second = dev; | 1183 | ->second = dev; |
1179 | printk( KERN_NOTICE "%s: using shared irq " | 1184 | printk( KERN_NOTICE "%s: using shared irq " |
1180 | "with %s\n", dev->name, (*p)->name ); | 1185 | "with %s\n", dev->name, (*p)->name ); |
@@ -1214,7 +1219,7 @@ handler_attached: | |||
1214 | static int | 1219 | static int |
1215 | sbni_close( struct net_device *dev ) | 1220 | sbni_close( struct net_device *dev ) |
1216 | { | 1221 | { |
1217 | struct net_local *nl = (struct net_local *) dev->priv; | 1222 | struct net_local *nl = netdev_priv(dev); |
1218 | 1223 | ||
1219 | if( nl->second && nl->second->flags & IFF_UP ) { | 1224 | if( nl->second && nl->second->flags & IFF_UP ) { |
1220 | printk( KERN_NOTICE "Secondary channel (%s) is active!\n", | 1225 | printk( KERN_NOTICE "Secondary channel (%s) is active!\n", |
@@ -1298,7 +1303,7 @@ sbni_card_probe( unsigned long ioaddr ) | |||
1298 | static int | 1303 | static int |
1299 | sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | 1304 | sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) |
1300 | { | 1305 | { |
1301 | struct net_local *nl = (struct net_local *) dev->priv; | 1306 | struct net_local *nl = netdev_priv(dev); |
1302 | struct sbni_flags flags; | 1307 | struct sbni_flags flags; |
1303 | int error = 0; | 1308 | int error = 0; |
1304 | 1309 | ||
@@ -1388,8 +1393,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | |||
1388 | static int | 1393 | static int |
1389 | enslave( struct net_device *dev, struct net_device *slave_dev ) | 1394 | enslave( struct net_device *dev, struct net_device *slave_dev ) |
1390 | { | 1395 | { |
1391 | struct net_local *nl = (struct net_local *) dev->priv; | 1396 | struct net_local *nl = netdev_priv(dev); |
1392 | struct net_local *snl = (struct net_local *) slave_dev->priv; | 1397 | struct net_local *snl = netdev_priv(slave_dev); |
1393 | 1398 | ||
1394 | if( nl->state & FL_SLAVE ) /* This isn't master or free device */ | 1399 | if( nl->state & FL_SLAVE ) /* This isn't master or free device */ |
1395 | return -EBUSY; | 1400 | return -EBUSY; |
@@ -1423,9 +1428,9 @@ enslave( struct net_device *dev, struct net_device *slave_dev ) | |||
1423 | static int | 1428 | static int |
1424 | emancipate( struct net_device *dev ) | 1429 | emancipate( struct net_device *dev ) |
1425 | { | 1430 | { |
1426 | struct net_local *snl = (struct net_local *) dev->priv; | 1431 | struct net_local *snl = netdev_priv(dev); |
1427 | struct net_device *p = snl->master; | 1432 | struct net_device *p = snl->master; |
1428 | struct net_local *nl = (struct net_local *) p->priv; | 1433 | struct net_local *nl = netdev_priv(p); |
1429 | 1434 | ||
1430 | if( !(snl->state & FL_SLAVE) ) | 1435 | if( !(snl->state & FL_SLAVE) ) |
1431 | return -EINVAL; | 1436 | return -EINVAL; |
@@ -1436,7 +1441,7 @@ emancipate( struct net_device *dev ) | |||
1436 | 1441 | ||
1437 | /* exclude from list */ | 1442 | /* exclude from list */ |
1438 | for(;;) { /* must be in list */ | 1443 | for(;;) { /* must be in list */ |
1439 | struct net_local *t = (struct net_local *) p->priv; | 1444 | struct net_local *t = netdev_priv(p); |
1440 | if( t->link == dev ) { | 1445 | if( t->link == dev ) { |
1441 | t->link = snl->link; | 1446 | t->link = snl->link; |
1442 | break; | 1447 | break; |
@@ -1463,7 +1468,7 @@ emancipate( struct net_device *dev ) | |||
1463 | static struct net_device_stats * | 1468 | static struct net_device_stats * |
1464 | sbni_get_stats( struct net_device *dev ) | 1469 | sbni_get_stats( struct net_device *dev ) |
1465 | { | 1470 | { |
1466 | return &((struct net_local *) dev->priv)->stats; | 1471 | return &((struct net_local *)netdev_priv(dev))->stats; |
1467 | } | 1472 | } |
1468 | 1473 | ||
1469 | 1474 | ||