Browse Source

Automatically updated with the program

#!/usr/bin/perl -w -pi -0777

use strict;

( my $type ) = /find_(\w+?)_boot_device/ or die "Could not find type\n";

( my $disable ) = /\.disable\s*=\s*(\w+)/ or die "Could not locate disable\n";

s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*\{)(\s*)/${1}, struct ${type}_device \*${type} __unused${2}${3}nic_disable ( nic );${3}/s;

s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*;)/${1}, struct ${type}_device \*${type}${2}/g;

s/^\s*.disable\s*=\s*${disable}\s*,\s*?$//m;

s/(_probe\s*\(\s*)struct\s+dev\s+\*dev/${1}struct nic \*nic/g;

s/^\s*struct\s+nic\s+\*nic\s*=\s*nic_device\s*\(\s*dev\s*\)\s*;\s*?$//m;

s/^(\s*)(nic->(ioaddr|irqno)\s*=\s*${type})/${1}${type}_fill_nic ( nic, ${type} );\n${1}${2}/m;
tags/v0.9.3
Michael Brown 20 years ago
parent
commit
614c39a8a4

+ 11
- 7
src/drivers/net/3c515.c View File

565
 /**************************************************************************
565
 /**************************************************************************
566
 DISABLE - Turn off ethernet interface
566
 DISABLE - Turn off ethernet interface
567
 ***************************************************************************/
567
 ***************************************************************************/
568
-static void t515_disable ( struct nic *nic ) {
568
+static void t515_disable ( struct nic *nic, struct isapnp_device *isapnp __unused ) {
569
+
570
+	nic_disable ( nic );
569
 
571
 
570
 	/* merge reset an disable */
572
 	/* merge reset an disable */
571
 	t515_reset(nic);
573
 	t515_reset(nic);
610
 	.poll		= t515_poll,
612
 	.poll		= t515_poll,
611
 	.transmit	= t515_transmit,
613
 	.transmit	= t515_transmit,
612
 	.irq		= t515_irq,
614
 	.irq		= t515_irq,
613
-	.disable	= t515_disable,
615
+
614
 };
616
 };
615
 
617
 
616
 /**************************************************************************
618
 /**************************************************************************
617
 PROBE - Look for an adapter, this routine's visible to the outside
619
 PROBE - Look for an adapter, this routine's visible to the outside
618
 You should omit the last argument struct pci_device * for a non-PCI NIC
620
 You should omit the last argument struct pci_device * for a non-PCI NIC
619
 ***************************************************************************/
621
 ***************************************************************************/
620
-static int t515_probe ( struct dev *dev, struct isapnp_device *isapnp ) {
621
-	struct nic *nic = nic_device ( dev );
622
+static int t515_probe ( struct nic *nic, struct isapnp_device *isapnp ) {
623
+
622
 	/* Direct copy from Beckers 3c515.c removing any ISAPNP sections */
624
 	/* Direct copy from Beckers 3c515.c removing any ISAPNP sections */
623
 
625
 
626
+	isapnp_fill_nic ( nic, isapnp );
627
+
624
 	nic->ioaddr = isapnp->ioaddr;
628
 	nic->ioaddr = isapnp->ioaddr;
625
 	nic->irqno = isapnp->irqno;
629
 	nic->irqno = isapnp->irqno;
626
 	activate_isapnp_device ( isapnp, 1 );
630
 	activate_isapnp_device ( isapnp, 1 );
762
 };
766
 };
763
 
767
 
764
 static struct isapnp_driver t515_driver =
768
 static struct isapnp_driver t515_driver =
765
-	ISAPNP_DRIVER ( "3c515", t515_adapters );
769
+	ISAPNP_DRIVER ( t515_adapters );
766
 
770
 
767
-BOOT_DRIVER ( "3c515", find_isapnp_boot_device, t515_driver,
768
-	      t515_probe );
771
+DRIVER ( "3c515", nic_driver, isapnp_driver, t515_driver,
772
+	 t515_probe, t515_disable );
769
 
773
 
770
 ISA_ROM ( "3c515", "3c515 Fast EtherLink ISAPnP" );
774
 ISA_ROM ( "3c515", "3c515 Fast EtherLink ISAPnP" );

+ 9
- 6
src/drivers/net/3c595.c View File

443
     GO_WINDOW(1); 
443
     GO_WINDOW(1); 
444
 }
444
 }
445
 
445
 
446
-static void t595_disable ( struct nic *nic ) {
446
+static void t595_disable ( struct nic *nic, struct pci_device *pci __unused ) {
447
+	nic_disable ( nic );
447
 	t595_reset(nic);
448
 	t595_reset(nic);
448
 
449
 
449
 	outw(STOP_TRANSCEIVER, BASE + VX_COMMAND);
450
 	outw(STOP_TRANSCEIVER, BASE + VX_COMMAND);
468
 /**************************************************************************
469
 /**************************************************************************
469
 ETH_PROBE - Look for an adapter
470
 ETH_PROBE - Look for an adapter
470
 ***************************************************************************/
471
 ***************************************************************************/
471
-static int t595_probe ( struct dev *dev, struct pci_device *pci ) {
472
-	struct nic *nic = nic_device ( dev );
472
+static int t595_probe ( struct nic *nic, struct pci_device *pci ) {
473
+
473
 	int i;
474
 	int i;
474
 	unsigned short *p;
475
 	unsigned short *p;
475
 
476
 
478
 	eth_nic_base = pci->ioaddr;
479
 	eth_nic_base = pci->ioaddr;
479
 
480
 
480
 	nic->irqno  = 0;
481
 	nic->irqno  = 0;
482
+	pci_fill_nic ( nic, pci );
481
 	nic->ioaddr = pci->ioaddr;
483
 	nic->ioaddr = pci->ioaddr;
482
 
484
 
483
 	GO_WINDOW(0);
485
 	GO_WINDOW(0);
517
 	.poll		= t595_poll,
519
 	.poll		= t595_poll,
518
 	.transmit	= t595_transmit,
520
 	.transmit	= t595_transmit,
519
 	.irq		= t595_irq,
521
 	.irq		= t595_irq,
520
-	.disable	= t595_disable,
522
+
521
 };
523
 };
522
 
524
 
523
 static struct pci_id t595_nics[] = {
525
 static struct pci_id t595_nics[] = {
538
 };
540
 };
539
 
541
 
540
 static struct pci_driver t595_driver =
542
 static struct pci_driver t595_driver =
541
-	PCI_DRIVER ( "3C595", t595_nics, PCI_NO_CLASS );
543
+	PCI_DRIVER ( t595_nics, PCI_NO_CLASS );
542
 
544
 
543
-BOOT_DRIVER ( "3C595", find_pci_boot_device, t595_driver, t595_probe );
545
+DRIVER ( "3C595", nic_driver, pci_driver, t595_driver,
546
+	 t595_probe, t595_disable );
544
 
547
 
545
 /*
548
 /*
546
  * Local variables:
549
  * Local variables:

+ 8
- 5
src/drivers/net/3c90x.c View File

690
  *** initialization.  If this routine is called, the pci functions did find the
690
  *** initialization.  If this routine is called, the pci functions did find the
691
  *** card.  We just have to init it here.
691
  *** card.  We just have to init it here.
692
  ***/
692
  ***/
693
-static int a3c90x_probe ( struct dev *dev, struct pci_device *pci ) {
694
-    struct nic *nic = nic_device ( dev );
693
+static int a3c90x_probe ( struct nic *nic, struct pci_device *pci ) {
694
+
695
     int i, c;
695
     int i, c;
696
     unsigned short eeprom[0x21];
696
     unsigned short eeprom[0x21];
697
     unsigned int cfg;
697
     unsigned int cfg;
705
 
705
 
706
     adjust_pci_device(pci);
706
     adjust_pci_device(pci);
707
 
707
 
708
+    pci_fill_nic ( nic, pci );
709
+
708
     nic->ioaddr = pci->ioaddr;
710
     nic->ioaddr = pci->ioaddr;
709
     nic->irqno = 0;
711
     nic->irqno = 0;
710
 
712
 
960
 	.poll		= a3c90x_poll,
962
 	.poll		= a3c90x_poll,
961
 	.transmit	= a3c90x_transmit,
963
 	.transmit	= a3c90x_transmit,
962
 	.irq		= a3c90x_irq,
964
 	.irq		= a3c90x_irq,
963
-	.disable	= a3c90x_disable,
965
+
964
 };
966
 };
965
 
967
 
966
 static struct pci_id a3c90x_nics[] = {
968
 static struct pci_id a3c90x_nics[] = {
991
 };
993
 };
992
 
994
 
993
 static struct pci_driver a3c90x_driver =
995
 static struct pci_driver a3c90x_driver =
994
-	PCI_DRIVER ( "3C90X", a3c90x_nics, PCI_NO_CLASS );
996
+	PCI_DRIVER ( a3c90x_nics, PCI_NO_CLASS );
995
 
997
 
996
-BOOT_DRIVER ( "3C90X", find_pci_boot_device, a3c90x_driver, a3c90x_probe );
998
+DRIVER ( "3C90X", nic_driver, pci_driver, a3c90x_driver,
999
+	 a3c90x_probe, a3c90x_disable );

+ 11
- 8
src/drivers/net/davicom.c View File

157
 /*********************************************************************/
157
 /*********************************************************************/
158
 static void whereami(const char *str);
158
 static void whereami(const char *str);
159
 static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
159
 static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
160
-static int davicom_probe(struct dev *dev,struct pci_device *pci);
160
+static int davicom_probe(struct nic *nic,struct pci_device *pci);
161
 static void davicom_init_chain(struct nic *nic);	/* Sten 10/9 */
161
 static void davicom_init_chain(struct nic *nic);	/* Sten 10/9 */
162
 static void davicom_reset(struct nic *nic);
162
 static void davicom_reset(struct nic *nic);
163
 static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
163
 static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
164
 			   unsigned int s, const char *p);
164
 			   unsigned int s, const char *p);
165
 static int davicom_poll(struct nic *nic, int retrieve);
165
 static int davicom_poll(struct nic *nic, int retrieve);
166
-static void davicom_disable(struct nic *nic);
166
+static void davicom_disable(struct nic *nic, struct pci_device *pci);
167
 #ifdef	DAVICOM_DEBUG
167
 #ifdef	DAVICOM_DEBUG
168
 static void davicom_more(void);
168
 static void davicom_more(void);
169
 #endif /* DAVICOM_DEBUG */
169
 #endif /* DAVICOM_DEBUG */
620
 /*********************************************************************/
620
 /*********************************************************************/
621
 /* eth_disable - Disable the interface                               */
621
 /* eth_disable - Disable the interface                               */
622
 /*********************************************************************/
622
 /*********************************************************************/
623
-static void davicom_disable ( struct nic *nic ) {
623
+static void davicom_disable ( struct nic *nic, struct pci_device *pci __unused ) {
624
+  nic_disable ( nic );
624
   whereami("davicom_disable\n");
625
   whereami("davicom_disable\n");
625
 
626
 
626
   davicom_reset(nic);
627
   davicom_reset(nic);
655
 /*********************************************************************/
656
 /*********************************************************************/
656
 /* eth_probe - Look for an adapter                                   */
657
 /* eth_probe - Look for an adapter                                   */
657
 /*********************************************************************/
658
 /*********************************************************************/
658
-static int davicom_probe ( struct dev *dev, struct pci_device *pci ) {
659
-  struct nic *nic = nic_device ( dev );
659
+static int davicom_probe ( struct nic *nic, struct pci_device *pci ) {
660
+
660
   unsigned int i;
661
   unsigned int i;
661
 
662
 
662
   whereami("davicom_probe\n");
663
   whereami("davicom_probe\n");
669
   ioaddr  = pci->ioaddr;
670
   ioaddr  = pci->ioaddr;
670
 
671
 
671
   nic->irqno  = 0;
672
   nic->irqno  = 0;
673
+  pci_fill_nic ( nic, pci );
672
   nic->ioaddr = pci->ioaddr;
674
   nic->ioaddr = pci->ioaddr;
673
 
675
 
674
   /* wakeup chip */
676
   /* wakeup chip */
703
 	.poll		= davicom_poll,
705
 	.poll		= davicom_poll,
704
 	.transmit	= davicom_transmit,
706
 	.transmit	= davicom_transmit,
705
 	.irq		= davicom_irq,
707
 	.irq		= davicom_irq,
706
-	.disable	= davicom_disable,
708
+
707
 };
709
 };
708
 
710
 
709
 static struct pci_id davicom_nics[] = {
711
 static struct pci_id davicom_nics[] = {
714
 };
716
 };
715
 
717
 
716
 static struct pci_driver davicom_driver =
718
 static struct pci_driver davicom_driver =
717
-	PCI_DRIVER ( "DAVICOM", davicom_nics, PCI_NO_CLASS );
719
+	PCI_DRIVER ( davicom_nics, PCI_NO_CLASS );
718
 
720
 
719
-BOOT_DRIVER ( "DAVICOM", find_pci_boot_device, davicom_driver, davicom_probe );
721
+DRIVER ( "DAVICOM", nic_driver, pci_driver, davicom_driver,
722
+	 davicom_probe, davicom_disable );

+ 9
- 6
src/drivers/net/depca.c View File

648
 /**************************************************************************
648
 /**************************************************************************
649
 DISABLE - Turn off ethernet interface
649
 DISABLE - Turn off ethernet interface
650
 ***************************************************************************/
650
 ***************************************************************************/
651
-static void depca_disable ( struct nic *nic ) {
651
+static void depca_disable ( struct nic *nic, struct isa_device *isa __unused ) {
652
+	nic_disable ( nic );
652
 	/* reset and disable merge */
653
 	/* reset and disable merge */
653
 	depca_reset(nic);
654
 	depca_reset(nic);
654
 
655
 
736
 	.poll		= depca_poll,
737
 	.poll		= depca_poll,
737
 	.transmit	= depca_transmit,
738
 	.transmit	= depca_transmit,
738
 	.irq		= depca_irq,
739
 	.irq		= depca_irq,
739
-	.disable	= depca_disable,
740
+
740
 };
741
 };
741
 
742
 
742
 /**************************************************************************
743
 /**************************************************************************
743
 PROBE - Look for an adapter, this routine's visible to the outside
744
 PROBE - Look for an adapter, this routine's visible to the outside
744
 ***************************************************************************/
745
 ***************************************************************************/
745
-static int depca_probe ( struct dev *dev, struct isa_device *isa ) {
746
-	struct nic *nic = nic_device ( dev );
746
+static int depca_probe ( struct nic *nic, struct isa_device *isa ) {
747
+
747
 	int	i, j;
748
 	int	i, j;
748
 	long	sum, chksum;
749
 	long	sum, chksum;
749
 
750
 
750
 	nic->irqno    = 0;
751
 	nic->irqno    = 0;
752
+	isa_fill_nic ( nic, isa );
751
 	nic->ioaddr   = isa->ioaddr;
753
 	nic->ioaddr   = isa->ioaddr;
752
 
754
 
753
 	for (i = 0, j = 0, sum = 0; j < 3; j++) {
755
 	for (i = 0, j = 0, sum = 0; j < 3; j++) {
792
 };
794
 };
793
 
795
 
794
 static struct isa_driver depca_driver =
796
 static struct isa_driver depca_driver =
795
-	ISA_DRIVER ( "depca", depca_probe_addrs, depca_probe1,
797
+	ISA_DRIVER ( depca_probe_addrs, depca_probe1,
796
 		     GENERIC_ISAPNP_VENDOR, 0x80f7 );
798
 		     GENERIC_ISAPNP_VENDOR, 0x80f7 );
797
 
799
 
798
-BOOT_DRIVER ( "depce", find_isa_boot_device, depca_driver, depca_probe );
800
+DRIVER ( "depce", nic_driver, isa_driver, depca_driver,
801
+	 depca_probe, depca_disable );
799
 
802
 
800
 ISA_ROM ( "depca", "Digital DE100 and DE200" );
803
 ISA_ROM ( "depca", "Digital DE100 and DE200" );

+ 7
- 5
src/drivers/net/dmfe.c View File

459
 
459
 
460
 #define board_found 1
460
 #define board_found 1
461
 #define valid_link 0
461
 #define valid_link 0
462
-static int dmfe_probe ( struct dev *dev, struct pci_device *pci ) {
463
-	struct nic *nic = nic_device ( dev );
462
+static int dmfe_probe ( struct nic *nic, struct pci_device *pci ) {
463
+
464
 	uint32_t dev_rev, pci_pmr;
464
 	uint32_t dev_rev, pci_pmr;
465
 	int i;
465
 	int i;
466
 
466
 
508
 	dmfe_reset(nic);
508
 	dmfe_reset(nic);
509
 
509
 
510
 	nic->irqno  = 0;
510
 	nic->irqno  = 0;
511
+	pci_fill_nic ( nic, pci );
511
 	nic->ioaddr = pci->ioaddr;
512
 	nic->ioaddr = pci->ioaddr;
512
 
513
 
513
 	/* point to NIC specific routines */
514
 	/* point to NIC specific routines */
1213
 	.poll		= dmfe_poll,
1214
 	.poll		= dmfe_poll,
1214
 	.transmit	= dmfe_transmit,
1215
 	.transmit	= dmfe_transmit,
1215
 	.irq		= dmfe_irq,
1216
 	.irq		= dmfe_irq,
1216
-	.disable	= dmfe_disable,
1217
+
1217
 };
1218
 };
1218
 
1219
 
1219
 static struct pci_id dmfe_nics[] = {
1220
 static struct pci_id dmfe_nics[] = {
1224
 };
1225
 };
1225
 
1226
 
1226
 static struct pci_driver dmfe_driver =
1227
 static struct pci_driver dmfe_driver =
1227
-	PCI_DRIVER ( "DMFE/PCI", dmfe_nics, PCI_NO_CLASS );
1228
+	PCI_DRIVER ( dmfe_nics, PCI_NO_CLASS );
1228
 
1229
 
1229
-BOOT_DRIVER ( "DMFE/PCI", find_pci_boot_device, dmfe_driver, dmfe_probe );
1230
+DRIVER ( "DMFE/PCI", nic_driver, pci_driver, dmfe_driver,
1231
+	 dmfe_probe, dmfe_disable );

+ 6
- 5
src/drivers/net/e1000.c View File

3582
 PROBE - Look for an adapter, this routine's visible to the outside
3582
 PROBE - Look for an adapter, this routine's visible to the outside
3583
 You should omit the last argument struct pci_device * for a non-PCI NIC
3583
 You should omit the last argument struct pci_device * for a non-PCI NIC
3584
 ***************************************************************************/
3584
 ***************************************************************************/
3585
-static int e1000_probe ( struct dev *dev, struct pci_device *p ) {
3586
-	struct nic *nic = nic_device ( dev );
3585
+static int e1000_probe ( struct nic *nic, struct pci_device *p ) {
3586
+
3587
 	unsigned long mmio_start, mmio_len;
3587
 	unsigned long mmio_start, mmio_len;
3588
 	int ret_val, i;
3588
 	int ret_val, i;
3589
 
3589
 
3671
 	.poll		= e1000_poll,
3671
 	.poll		= e1000_poll,
3672
 	.transmit	= e1000_transmit,
3672
 	.transmit	= e1000_transmit,
3673
 	.irq		= e1000_irq,
3673
 	.irq		= e1000_irq,
3674
-	.disable	= e1000_disable,
3674
+
3675
 };
3675
 };
3676
 
3676
 
3677
 static struct pci_id e1000_nics[] = {
3677
 static struct pci_id e1000_nics[] = {
3708
 };
3708
 };
3709
 
3709
 
3710
 static struct pci_driver e1000_driver =
3710
 static struct pci_driver e1000_driver =
3711
-	PCI_DRIVER ( "E1000", e1000_nics, PCI_NO_CLASS );
3711
+	PCI_DRIVER ( e1000_nics, PCI_NO_CLASS );
3712
 
3712
 
3713
-BOOT_DRIVER ( "E1000", find_pci_boot_device, e1000_driver, e1000_probe );
3713
+DRIVER ( "E1000", nic_driver, pci_driver, e1000_driver,
3714
+	 e1000_probe, e1000_disable );

+ 9
- 6
src/drivers/net/eepro.c View File

450
 /**************************************************************************
450
 /**************************************************************************
451
 DISABLE - Turn off ethernet interface
451
 DISABLE - Turn off ethernet interface
452
 ***************************************************************************/
452
 ***************************************************************************/
453
-static void eepro_disable ( struct nic *nic ) {
453
+static void eepro_disable ( struct nic *nic, struct isa_device *isa __unused ) {
454
+	nic_disable ( nic );
454
 	eepro_sw2bank0(nic->ioaddr);	/* Switch to bank 0 */
455
 	eepro_sw2bank0(nic->ioaddr);	/* Switch to bank 0 */
455
 	/* Flush the Tx and disable Rx */
456
 	/* Flush the Tx and disable Rx */
456
 	outb(STOP_RCV_CMD, nic->ioaddr);
457
 	outb(STOP_RCV_CMD, nic->ioaddr);
534
 	.poll		= eepro_poll,
535
 	.poll		= eepro_poll,
535
 	.transmit	= eepro_transmit,
536
 	.transmit	= eepro_transmit,
536
 	.irq		= eepro_irq,
537
 	.irq		= eepro_irq,
537
-	.disable	= eepro_disable,
538
+
538
 };
539
 };
539
 
540
 
540
 /**************************************************************************
541
 /**************************************************************************
541
 PROBE - Look for an adapter, this routine's visible to the outside
542
 PROBE - Look for an adapter, this routine's visible to the outside
542
 ***************************************************************************/
543
 ***************************************************************************/
543
-static int eepro_probe ( struct dev *dev, struct isa_device *isa ) {
544
-	struct nic *nic = nic_device ( dev );
544
+static int eepro_probe ( struct nic *nic, struct isa_device *isa ) {
545
+
545
 	int		i, l_eepro = 0;
546
 	int		i, l_eepro = 0;
546
 	union {
547
 	union {
547
 		unsigned char	caddr[ETH_ALEN];
548
 		unsigned char	caddr[ETH_ALEN];
549
 	} station_addr;
550
 	} station_addr;
550
 
551
 
551
 	nic->irqno  = 0;
552
 	nic->irqno  = 0;
553
+	isa_fill_nic ( nic, isa );
552
 	nic->ioaddr = isa->ioaddr;
554
 	nic->ioaddr = isa->ioaddr;
553
 
555
 
554
 	station_addr.saddr[2] = read_eeprom(nic->ioaddr,2);
556
 	station_addr.saddr[2] = read_eeprom(nic->ioaddr,2);
605
 };
607
 };
606
 
608
 
607
 static struct isa_driver eepro_driver =
609
 static struct isa_driver eepro_driver =
608
-	ISA_DRIVER ( "eepro", eepro_probe_addrs, eepro_probe1,
610
+	ISA_DRIVER ( eepro_probe_addrs, eepro_probe1,
609
 		     GENERIC_ISAPNP_VENDOR, 0x828a );
611
 		     GENERIC_ISAPNP_VENDOR, 0x828a );
610
 
612
 
611
-BOOT_DRIVER ( "eepro", find_isa_boot_device, eepro_driver, eepro_probe );
613
+DRIVER ( "eepro", nic_driver, isa_driver, eepro_driver,
614
+	 eepro_probe, eepro_disable );
612
 
615
 
613
 ISA_ROM ( "eepro", "Intel Etherexpress Pro/10" );
616
 ISA_ROM ( "eepro", "Intel Etherexpress Pro/10" );

+ 6
- 5
src/drivers/net/eepro100.c View File

603
  *            leaves the 82557 initialized, and ready to recieve packets.
603
  *            leaves the 82557 initialized, and ready to recieve packets.
604
  */
604
  */
605
 
605
 
606
-static int eepro100_probe ( struct dev *dev, struct pci_device *p ) {
607
-	struct nic *nic = nic_device ( dev );
606
+static int eepro100_probe ( struct nic *nic, struct pci_device *p ) {
607
+
608
 	unsigned short sum = 0;
608
 	unsigned short sum = 0;
609
 	int i;
609
 	int i;
610
 	int read_cmd, ee_size;
610
 	int read_cmd, ee_size;
796
 	.poll		= eepro100_poll,
796
 	.poll		= eepro100_poll,
797
 	.transmit	= eepro100_transmit,
797
 	.transmit	= eepro100_transmit,
798
 	.irq		= eepro100_irq,
798
 	.irq		= eepro100_irq,
799
-	.disable	= eepro100_disable,
799
+
800
 };
800
 };
801
 
801
 
802
 static struct pci_id eepro100_nics[] = {
802
 static struct pci_id eepro100_nics[] = {
837
 
837
 
838
 
838
 
839
 static struct pci_driver eepro100_driver =
839
 static struct pci_driver eepro100_driver =
840
-	PCI_DRIVER ( "EEPRO100", eepro100_nics, PCI_NO_CLASS );
840
+	PCI_DRIVER ( eepro100_nics, PCI_NO_CLASS );
841
 
841
 
842
-BOOT_DRIVER ( "EEPRO100", find_pci_boot_device, eepro100_driver, eepro100_probe );
842
+DRIVER ( "EEPRO100", nic_driver, pci_driver, eepro100_driver,
843
+	 eepro100_probe, eepro100_disable );

+ 8
- 6
src/drivers/net/epic100.c View File

50
 
50
 
51
 static void	epic100_open(void);
51
 static void	epic100_open(void);
52
 static void	epic100_init_ring(void);
52
 static void	epic100_init_ring(void);
53
-static void	epic100_disable(struct nic *nic);
53
+static void	epic100_disable(struct nic *nic, struct pci_device *pci);
54
 static int	epic100_poll(struct nic *nic, int retrieve);
54
 static int	epic100_poll(struct nic *nic, int retrieve);
55
 static void	epic100_transmit(struct nic *nic, const char *destaddr,
55
 static void	epic100_transmit(struct nic *nic, const char *destaddr,
56
 				 unsigned int type, unsigned int len, const char *data);
56
 				 unsigned int type, unsigned int len, const char *data);
99
 
99
 
100
 
100
 
101
 static int
101
 static int
102
-epic100_probe ( struct dev *dev, struct pci_device *pci ) {
103
-    struct nic *nic = nic_device ( dev );
102
+epic100_probe ( struct nic *nic, struct pci_device *pci ) {
103
+
104
     int i;
104
     int i;
105
     unsigned short* ap;
105
     unsigned short* ap;
106
     unsigned int phy, phy_idx;
106
     unsigned int phy, phy_idx;
115
 
115
 
116
     ioaddr = pci->ioaddr;
116
     ioaddr = pci->ioaddr;
117
     nic->irqno  = 0;
117
     nic->irqno  = 0;
118
+    pci_fill_nic ( nic, pci );
118
     nic->ioaddr = pci->ioaddr & ~3;
119
     nic->ioaddr = pci->ioaddr & ~3;
119
 
120
 
120
     /* compute all used static epic100 registers address */
121
     /* compute all used static epic100 registers address */
507
 	.poll		= epic100_poll,
508
 	.poll		= epic100_poll,
508
 	.transmit	= epic100_transmit,
509
 	.transmit	= epic100_transmit,
509
 	.irq		= epic100_irq,
510
 	.irq		= epic100_irq,
510
-	.disable	= epic100_disable,
511
+
511
 };
512
 };
512
 
513
 
513
 static struct pci_id epic100_nics[] = {
514
 static struct pci_id epic100_nics[] = {
516
 };
517
 };
517
 
518
 
518
 static struct pci_driver epic100_driver =
519
 static struct pci_driver epic100_driver =
519
-	PCI_DRIVER ( "EPIC100", epic100_nics, PCI_NO_CLASS );
520
+	PCI_DRIVER ( epic100_nics, PCI_NO_CLASS );
520
 
521
 
521
-BOOT_DRIVER ( "EPIC100", find_pci_boot_device, epic100_driver, epic100_probe );
522
+DRIVER ( "EPIC100", nic_driver, pci_driver, epic100_driver,
523
+	 epic100_probe, epic100_disable );

+ 7
- 5
src/drivers/net/forcedeth.c View File

923
 	.poll		= forcedeth_poll,
923
 	.poll		= forcedeth_poll,
924
 	.transmit	= forcedeth_transmit,
924
 	.transmit	= forcedeth_transmit,
925
 	.irq		= forcedeth_irq,
925
 	.irq		= forcedeth_irq,
926
-	.disable	= forcedeth_disable,
926
+
927
 };
927
 };
928
 
928
 
929
 static struct pci_id forcedeth_nics[] = {
929
 static struct pci_id forcedeth_nics[] = {
933
 };
933
 };
934
 
934
 
935
 static struct pci_driver forcedeth_driver =
935
 static struct pci_driver forcedeth_driver =
936
-	PCI_DRIVER ( "forcedeth", forcedeth_nics, PCI_NO_CLASS );
936
+	PCI_DRIVER ( forcedeth_nics, PCI_NO_CLASS );
937
 
937
 
938
 /**************************************************************************
938
 /**************************************************************************
939
 PROBE - Look for an adapter, this routine's visible to the outside
939
 PROBE - Look for an adapter, this routine's visible to the outside
941
 #define IORESOURCE_MEM 0x00000200
941
 #define IORESOURCE_MEM 0x00000200
942
 #define board_found 1
942
 #define board_found 1
943
 #define valid_link 0
943
 #define valid_link 0
944
-static int forcedeth_probe ( struct dev *dev, struct pci_device *pci ) {
945
-	struct nic *nic = nic_device ( dev );
944
+static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
945
+
946
 	unsigned long addr;
946
 	unsigned long addr;
947
 	int sz;
947
 	int sz;
948
 	u8 *base;
948
 	u8 *base;
954
 	       dev->name, pci->vendor, pci->dev_id);
954
 	       dev->name, pci->vendor, pci->dev_id);
955
 
955
 
956
 	nic->irqno  = 0;
956
 	nic->irqno  = 0;
957
+	pci_fill_nic ( nic, pci );
957
 	nic->ioaddr = pci->ioaddr;
958
 	nic->ioaddr = pci->ioaddr;
958
 
959
 
959
 	/* point to private storage */
960
 	/* point to private storage */
1035
 	/* else */
1036
 	/* else */
1036
 }
1037
 }
1037
 
1038
 
1038
-BOOT_DRIVER ( "forcedeth", find_pci_boot_device, forcedeth_driver, forcedeth_probe );
1039
+DRIVER ( "forcedeth", nic_driver, pci_driver, forcedeth_driver,
1040
+	 forcedeth_probe, forcedeth_disable );

+ 8
- 6
src/drivers/net/mtd80x.c View File

644
 /**************************************************************************
644
 /**************************************************************************
645
 DISABLE - Turn off ethernet interface
645
 DISABLE - Turn off ethernet interface
646
 ***************************************************************************/
646
 ***************************************************************************/
647
-static void mtd_disable ( struct nic *nic ) {
647
+static void mtd_disable ( struct nic *nic, struct pci_device *pci __unused ) {
648
+    nic_disable ( nic );
648
     /* put the card in its initial state */
649
     /* put the card in its initial state */
649
     /* Disable Tx Rx*/
650
     /* Disable Tx Rx*/
650
     outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
651
     outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
658
 	.poll		= mtd_poll,
659
 	.poll		= mtd_poll,
659
 	.transmit	= mtd_transmit,
660
 	.transmit	= mtd_transmit,
660
 	.irq		= dummy_irq,
661
 	.irq		= dummy_irq,
661
-	.disable	= mtd_disable,
662
+
662
 };
663
 };
663
 
664
 
664
 static struct pci_id mtd80x_nics[] = {
665
 static struct pci_id mtd80x_nics[] = {
668
 };
669
 };
669
 
670
 
670
 static struct pci_driver mtd80x_driver =
671
 static struct pci_driver mtd80x_driver =
671
-	PCI_DRIVER ( "MTD80X", mtd80x_nics, PCI_NO_CLASS );
672
+	PCI_DRIVER ( mtd80x_nics, PCI_NO_CLASS );
672
 
673
 
673
 /**************************************************************************
674
 /**************************************************************************
674
 PROBE - Look for an adapter, this routine's visible to the outside
675
 PROBE - Look for an adapter, this routine's visible to the outside
675
 ***************************************************************************/
676
 ***************************************************************************/
676
 
677
 
677
-static int mtd_probe ( struct dev *dev, struct pci_device *pci ) {
678
-    struct nic *nic = nic_device ( dev );
678
+static int mtd_probe ( struct nic *nic, struct pci_device *pci ) {
679
+
679
     int i;
680
     int i;
680
 
681
 
681
     if (pci->ioaddr == 0)
682
     if (pci->ioaddr == 0)
1086
     }
1087
     }
1087
 }
1088
 }
1088
 
1089
 
1089
-BOOT_DRIVER ( "MTD80X", find_pci_boot_device, mtd80x_driver, mtd_probe );
1090
+DRIVER ( "MTD80X", nic_driver, pci_driver, mtd80x_driver,
1091
+	 mtd_probe, mtd_disable );

+ 10
- 8
src/drivers/net/natsemi.c View File

213
 
213
 
214
 /* Function Prototypes */
214
 /* Function Prototypes */
215
 
215
 
216
-static int natsemi_probe(struct dev *dev,struct pci_device *pci);
216
+static int natsemi_probe(struct nic *nic,struct pci_device *pci);
217
 static int eeprom_read(long addr, int location);
217
 static int eeprom_read(long addr, int location);
218
 static int mdio_read(int phy_id, int location);
218
 static int mdio_read(int phy_id, int location);
219
 static void natsemi_init(struct nic *nic);
219
 static void natsemi_init(struct nic *nic);
225
 static void natsemi_check_duplex(struct nic *nic);
225
 static void natsemi_check_duplex(struct nic *nic);
226
 static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
226
 static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
227
 static int  natsemi_poll(struct nic *nic, int retrieve);
227
 static int  natsemi_poll(struct nic *nic, int retrieve);
228
-static void natsemi_disable(struct nic *nic);
228
+static void natsemi_disable(struct nic *nic, struct pci_device *pci);
229
 static void natsemi_irq(struct nic *nic, irq_action_t action);
229
 static void natsemi_irq(struct nic *nic, irq_action_t action);
230
 
230
 
231
 /* 
231
 /* 
243
  */
243
  */
244
 
244
 
245
 static int
245
 static int
246
-natsemi_probe ( struct dev *dev, struct pci_device *pci ) {
246
+natsemi_probe ( struct nic *nic, struct pci_device *pci ) {
247
 
247
 
248
-    struct nic *nic = nic_device ( dev );
249
     int i;
248
     int i;
250
     int prev_eedata;
249
     int prev_eedata;
251
     u32 tmp;
250
     u32 tmp;
258
     /* initialize some commonly used globals */
257
     /* initialize some commonly used globals */
259
 	
258
 	
260
     nic->irqno  = 0;
259
     nic->irqno  = 0;
260
+    pci_fill_nic ( nic, pci );
261
     nic->ioaddr = pci->ioaddr;
261
     nic->ioaddr = pci->ioaddr;
262
 
262
 
263
     ioaddr     = pci->ioaddr;
263
     ioaddr     = pci->ioaddr;
725
  */
725
  */
726
 
726
 
727
 static void
727
 static void
728
-natsemi_disable ( struct nic *nic ) {
728
+natsemi_disable ( struct nic *nic, struct pci_device *pci __unused ) {
729
+    nic_disable ( nic );
729
     /* merge reset and disable */
730
     /* merge reset and disable */
730
     natsemi_init(nic);
731
     natsemi_init(nic);
731
 
732
 
768
 	.poll		= natsemi_poll,
769
 	.poll		= natsemi_poll,
769
 	.transmit	= natsemi_transmit,
770
 	.transmit	= natsemi_transmit,
770
 	.irq		= natsemi_irq,
771
 	.irq		= natsemi_irq,
771
-	.disable	= natsemi_disable,
772
+
772
 };
773
 };
773
 
774
 
774
 static struct pci_id natsemi_nics[] = {
775
 static struct pci_id natsemi_nics[] = {
776
 };
777
 };
777
 
778
 
778
 static struct pci_driver natsemi_driver =
779
 static struct pci_driver natsemi_driver =
779
-	PCI_DRIVER ( "NATSEMI", natsemi_nics, PCI_NO_CLASS );
780
+	PCI_DRIVER ( natsemi_nics, PCI_NO_CLASS );
780
 
781
 
781
-BOOT_DRIVER ( "NATSEMI", find_pci_boot_device, natsemi_driver, natsemi_probe );
782
+DRIVER ( "NATSEMI", nic_driver, pci_driver, natsemi_driver,
783
+	 natsemi_probe, natsemi_disable );

+ 9
- 6
src/drivers/net/ns83820.c View File

756
 /**************************************************************************
756
 /**************************************************************************
757
 DISABLE - Turn off ethernet interface
757
 DISABLE - Turn off ethernet interface
758
 ***************************************************************************/
758
 ***************************************************************************/
759
-static void ns83820_disable ( struct nic *nic ) {
759
+static void ns83820_disable ( struct nic *nic, struct pci_device *pci __unused ) {
760
+	nic_disable ( nic );
760
 	/* put the card in its initial state */
761
 	/* put the card in its initial state */
761
 	/* This function serves 3 purposes.
762
 	/* This function serves 3 purposes.
762
 	 * This disables DMA and interrupts so we don't receive
763
 	 * This disables DMA and interrupts so we don't receive
809
 	.poll		= ns83820_poll,
810
 	.poll		= ns83820_poll,
810
 	.transmit	= ns83820_transmit,
811
 	.transmit	= ns83820_transmit,
811
 	.irq		= ns83820_irq,
812
 	.irq		= ns83820_irq,
812
-	.disable	= ns83820_disable,
813
+
813
 };
814
 };
814
 
815
 
815
 static struct pci_id ns83820_nics[] = {
816
 static struct pci_id ns83820_nics[] = {
817
 };
818
 };
818
 
819
 
819
 static struct pci_driver ns83820_driver =
820
 static struct pci_driver ns83820_driver =
820
-	PCI_DRIVER ( "NS83820/PCI", ns83820_nics, PCI_NO_CLASS );
821
+	PCI_DRIVER ( ns83820_nics, PCI_NO_CLASS );
821
 
822
 
822
 /**************************************************************************
823
 /**************************************************************************
823
 PROBE - Look for an adapter, this routine's visible to the outside
824
 PROBE - Look for an adapter, this routine's visible to the outside
825
 
826
 
826
 #define board_found 1
827
 #define board_found 1
827
 #define valid_link 0
828
 #define valid_link 0
828
-static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
829
-	struct nic *nic = nic_device ( dev );
829
+static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
830
+
830
 	int sz;
831
 	int sz;
831
 	long addr;
832
 	long addr;
832
 	int using_dac = 0;
833
 	int using_dac = 0;
852
 		return 0;
853
 		return 0;
853
 
854
 
854
 	nic->irqno  = 0;
855
 	nic->irqno  = 0;
856
+	pci_fill_nic ( nic, pci );
855
 	nic->ioaddr = pci->ioaddr & ~3;
857
 	nic->ioaddr = pci->ioaddr & ~3;
856
 
858
 
857
 	/* disable interrupts */
859
 	/* disable interrupts */
1016
 	return 1;
1018
 	return 1;
1017
 }
1019
 }
1018
 
1020
 
1019
-BOOT_DRIVER ( "NS83820/PCI", find_pci_boot_device, ns83820_driver, ns83820_probe );
1021
+DRIVER ( "NS83820/PCI", nic_driver, pci_driver, ns83820_driver,
1022
+	 ns83820_probe, ns83820_disable );

+ 7
- 5
src/drivers/net/pcnet32.c View File

666
 PROBE - Look for an adapter, this routine's visible to the outside
666
 PROBE - Look for an adapter, this routine's visible to the outside
667
 You should omit the last argument struct pci_device * for a non-PCI NIC
667
 You should omit the last argument struct pci_device * for a non-PCI NIC
668
 ***************************************************************************/
668
 ***************************************************************************/
669
-static int pcnet32_probe ( struct dev *dev, struct pci_device *pci ) {
670
-	struct nic *nic = nic_device ( dev );
669
+static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
670
+
671
 	int i, media;
671
 	int i, media;
672
 	int fdx, mii, fset, dxsuflo, ltint;
672
 	int fdx, mii, fset, dxsuflo, ltint;
673
 	int chip_version;
673
 	int chip_version;
685
 	       dev->name, pci->vendor, pci->dev_id);
685
 	       dev->name, pci->vendor, pci->dev_id);
686
 
686
 
687
 	nic->irqno  = 0;
687
 	nic->irqno  = 0;
688
+	pci_fill_nic ( nic, pci );
688
 	nic->ioaddr = pci->ioaddr & ~3;
689
 	nic->ioaddr = pci->ioaddr & ~3;
689
 
690
 
690
 	/* reset the chip */
691
 	/* reset the chip */
990
 	.poll		= pcnet32_poll,
991
 	.poll		= pcnet32_poll,
991
 	.transmit	= pcnet32_transmit,
992
 	.transmit	= pcnet32_transmit,
992
 	.irq		= pcnet32_irq,
993
 	.irq		= pcnet32_irq,
993
-	.disable	= pcnet32_disable,
994
+
994
 };
995
 };
995
 
996
 
996
 static struct pci_id pcnet32_nics[] = {
997
 static struct pci_id pcnet32_nics[] = {
1000
 };
1001
 };
1001
 
1002
 
1002
 static struct pci_driver pcnet32_driver =
1003
 static struct pci_driver pcnet32_driver =
1003
-	PCI_DRIVER ( "PCNET32/PCI", pcnet32_nics, PCI_NO_CLASS );
1004
+	PCI_DRIVER ( pcnet32_nics, PCI_NO_CLASS );
1004
 
1005
 
1005
-BOOT_DRIVER ( "PCNET32/PCI", find_pci_boot_device, pcnet32_driver, pcnet32_probe );
1006
+DRIVER ( "PCNET32/PCI", nic_driver, pci_driver, pcnet32_driver,
1007
+	 pcnet32_probe, pcnet32_disable );

+ 7
- 5
src/drivers/net/r8169.c View File

707
 	.poll		= r8169_poll,
707
 	.poll		= r8169_poll,
708
 	.transmit	= r8169_transmit,
708
 	.transmit	= r8169_transmit,
709
 	.irq		= r8169_irq,
709
 	.irq		= r8169_irq,
710
-	.disable	= r8169_disable,
710
+
711
 };
711
 };
712
 
712
 
713
 static struct pci_id r8169_nics[] = {
713
 static struct pci_id r8169_nics[] = {
715
 };
715
 };
716
 
716
 
717
 static struct pci_driver r8169_driver =
717
 static struct pci_driver r8169_driver =
718
-	PCI_DRIVER ( "r8169/PCI", r8169_nics, PCI_NO_CLASS );
718
+	PCI_DRIVER ( r8169_nics, PCI_NO_CLASS );
719
 
719
 
720
 /**************************************************************************
720
 /**************************************************************************
721
 PROBE - Look for an adapter, this routine's visible to the outside
721
 PROBE - Look for an adapter, this routine's visible to the outside
723
 
723
 
724
 #define board_found 1
724
 #define board_found 1
725
 #define valid_link 0
725
 #define valid_link 0
726
-static int r8169_probe ( struct dev *dev, struct pci_device *pci ) {
727
-	struct nic *nic = nic_device ( dev );
726
+static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
727
+
728
 	static int board_idx = -1;
728
 	static int board_idx = -1;
729
 	static int printed_version = 0;
729
 	static int printed_version = 0;
730
 	int i, rc;
730
 	int i, rc;
844
 	r8169_reset(nic);
844
 	r8169_reset(nic);
845
 	/* point to NIC specific routines */
845
 	/* point to NIC specific routines */
846
 	nic->nic_op	= &r8169_operations;
846
 	nic->nic_op	= &r8169_operations;
847
+	pci_fill_nic ( nic, pci );
847
 	nic->irqno = pci->irq;
848
 	nic->irqno = pci->irq;
848
 	nic->ioaddr = ioaddr;
849
 	nic->ioaddr = ioaddr;
849
 	return 1;
850
 	return 1;
850
 
851
 
851
 }
852
 }
852
 
853
 
853
-BOOT_DRIVER ( "r8169/PCI", find_pci_boot_device, r8169_driver, r8169_probe );
854
+DRIVER ( "r8169/PCI", nic_driver, pci_driver, r8169_driver,
855
+	 r8169_probe, r8169_disable );

+ 11
- 8
src/drivers/net/rtl8139.c View File

172
 static unsigned char tx_buffer[TX_BUF_SIZE] __attribute__((aligned(4)));
172
 static unsigned char tx_buffer[TX_BUF_SIZE] __attribute__((aligned(4)));
173
 static unsigned char rx_ring[RX_BUF_LEN+16] __attribute__((aligned(4)));
173
 static unsigned char rx_ring[RX_BUF_LEN+16] __attribute__((aligned(4)));
174
 
174
 
175
-static int rtl8139_probe(struct dev *dev,struct pci_device *pci);
175
+static int rtl8139_probe(struct nic *nic,struct pci_device *pci);
176
 static int read_eeprom(struct nic *nic, int location, int addr_len);
176
 static int read_eeprom(struct nic *nic, int location, int addr_len);
177
 static void rtl_reset(struct nic *nic);
177
 static void rtl_reset(struct nic *nic);
178
 static void rtl_transmit(struct nic *nic, const char *destaddr,
178
 static void rtl_transmit(struct nic *nic, const char *destaddr,
179
 	unsigned int type, unsigned int len, const char *data);
179
 	unsigned int type, unsigned int len, const char *data);
180
 static int rtl_poll(struct nic *nic, int retrieve);
180
 static int rtl_poll(struct nic *nic, int retrieve);
181
-static void rtl_disable(struct nic *nic);
181
+static void rtl_disable(struct nic *nic, struct pci_device *pci);
182
 static void rtl_irq(struct nic *nic, irq_action_t action);
182
 static void rtl_irq(struct nic *nic, irq_action_t action);
183
 static struct nic_operations rtl_operations;
183
 static struct nic_operations rtl_operations;
184
 static struct pci_driver rtl8139_driver;
184
 static struct pci_driver rtl8139_driver;
185
 
185
 
186
-static int rtl8139_probe ( struct dev *dev, struct pci_device *pci ) {
187
-	struct nic *nic = nic_device ( dev );
186
+static int rtl8139_probe ( struct nic *nic, struct pci_device *pci ) {
187
+
188
 	int i;
188
 	int i;
189
 	int speed10, fullduplex;
189
 	int speed10, fullduplex;
190
 	int addr_len;
190
 	int addr_len;
191
 	unsigned short *ap = (unsigned short*)nic->node_addr;
191
 	unsigned short *ap = (unsigned short*)nic->node_addr;
192
 
192
 
193
 	/* Copy ioaddr and IRQ from PCI information */
193
 	/* Copy ioaddr and IRQ from PCI information */
194
+	pci_fill_nic ( nic, pci );
194
 	nic->ioaddr = pci->ioaddr;
195
 	nic->ioaddr = pci->ioaddr;
195
 	nic->irqno = pci->irq;
196
 	nic->irqno = pci->irq;
196
 
197
 
501
 	}
502
 	}
502
 }
503
 }
503
 
504
 
504
-static void rtl_disable ( struct nic *nic ) {
505
+static void rtl_disable ( struct nic *nic, struct pci_device *pci __unused ) {
506
+	nic_disable ( nic );
505
 	/* merge reset and disable */
507
 	/* merge reset and disable */
506
 	rtl_reset(nic);
508
 	rtl_reset(nic);
507
 
509
 
519
 	.poll		= rtl_poll,
521
 	.poll		= rtl_poll,
520
 	.transmit	= rtl_transmit,
522
 	.transmit	= rtl_transmit,
521
 	.irq		= rtl_irq,
523
 	.irq		= rtl_irq,
522
-	.disable	= rtl_disable,
524
+
523
 };
525
 };
524
 
526
 
525
 static struct pci_id rtl8139_nics[] = {
527
 static struct pci_id rtl8139_nics[] = {
540
 };
542
 };
541
 
543
 
542
 static struct pci_driver rtl8139_driver =
544
 static struct pci_driver rtl8139_driver =
543
-	PCI_DRIVER ( "RTL8139", rtl8139_nics, PCI_NO_CLASS );
545
+	PCI_DRIVER ( rtl8139_nics, PCI_NO_CLASS );
544
 
546
 
545
-BOOT_DRIVER ( "RTL8139", find_pci_boot_device, rtl8139_driver, rtl8139_probe );
547
+DRIVER ( "RTL8139", nic_driver, pci_driver, rtl8139_driver,
548
+	 rtl8139_probe, rtl_disable );

+ 11
- 8
src/drivers/net/sis900.c View File

123
 
123
 
124
 
124
 
125
 static struct pci_driver sis_bridge_driver =
125
 static struct pci_driver sis_bridge_driver =
126
-	PCI_DRIVER ( "sis_bridge", pci_isa_bridge_list, PCI_NO_CLASS );
126
+	PCI_DRIVER ( pci_isa_bridge_list, PCI_NO_CLASS );
127
 
127
 
128
 /* Function Prototypes */
128
 /* Function Prototypes */
129
 
129
 
130
-static int sis900_probe(struct dev *dev,struct pci_device *pci);
130
+static int sis900_probe(struct nic *nic,struct pci_device *pci);
131
 
131
 
132
 static u16  sis900_read_eeprom(int location);
132
 static u16  sis900_read_eeprom(int location);
133
 static void sis900_mdio_reset(long mdio_addr);
133
 static void sis900_mdio_reset(long mdio_addr);
150
                             unsigned int t, unsigned int s, const char *p);
150
                             unsigned int t, unsigned int s, const char *p);
151
 static int  sis900_poll(struct nic *nic, int retrieve);
151
 static int  sis900_poll(struct nic *nic, int retrieve);
152
 
152
 
153
-static void sis900_disable(struct nic *nic);
153
+static void sis900_disable(struct nic *nic, struct pci_device *pci);
154
 
154
 
155
 static void sis900_irq(struct nic *nic, irq_action_t action);
155
 static void sis900_irq(struct nic *nic, irq_action_t action);
156
 
156
 
309
  * Returns:   struct nic *:          pointer to NIC data structure
309
  * Returns:   struct nic *:          pointer to NIC data structure
310
  */
310
  */
311
 
311
 
312
-static int sis900_probe ( struct dev *dev, struct pci_device *pci ) {
313
-    struct nic *nic = nic_device ( dev );
312
+static int sis900_probe ( struct nic *nic, struct pci_device *pci ) {
313
+
314
     int i;
314
     int i;
315
     int found=0;
315
     int found=0;
316
     int phy_addr;
316
     int phy_addr;
321
         return 0;
321
         return 0;
322
 
322
 
323
     nic->irqno  = 0;
323
     nic->irqno  = 0;
324
+    pci_fill_nic ( nic, pci );
324
     nic->ioaddr = pci->ioaddr;
325
     nic->ioaddr = pci->ioaddr;
325
     ioaddr  = pci->ioaddr;
326
     ioaddr  = pci->ioaddr;
326
     vendor  = pci->vendor;
327
     vendor  = pci->vendor;
1208
  */
1209
  */
1209
 
1210
 
1210
 static void
1211
 static void
1211
-sis900_disable ( struct nic *nic ) {
1212
+sis900_disable ( struct nic *nic, struct pci_device *pci __unused ) {
1213
+    nic_disable ( nic );
1212
     /* merge reset and disable */
1214
     /* merge reset and disable */
1213
     sis900_init(nic);
1215
     sis900_init(nic);
1214
 
1216
 
1249
 	.poll		= sis900_poll,
1251
 	.poll		= sis900_poll,
1250
 	.transmit	= sis900_transmit,
1252
 	.transmit	= sis900_transmit,
1251
 	.irq		= sis900_irq,
1253
 	.irq		= sis900_irq,
1252
-	.disable	= sis900_disable,
1254
+
1253
 };
1255
 };
1254
 
1256
 
1255
 static struct pci_id sis900_nics[] = {
1257
 static struct pci_id sis900_nics[] = {
1260
 static struct pci_driver sis900_driver =
1262
 static struct pci_driver sis900_driver =
1261
 	PCI_DRIVER ( "SIS900", sis900_nics, PCI_NO_CLASS );
1263
 	PCI_DRIVER ( "SIS900", sis900_nics, PCI_NO_CLASS );
1262
 
1264
 
1263
-BOOT_DRIVER ( "SIS900", find_pci_boot_device, sis900_driver, sis900_probe );
1265
+DRIVER ( "SIS900", nic_driver, pci_driver, sis900_driver,
1266
+	 sis900_probe, sis900_disable );

+ 13
- 10
src/drivers/net/skel.c View File

163
 	.poll		= skel_poll,
163
 	.poll		= skel_poll,
164
 	.transmit	= skel_transmit,
164
 	.transmit	= skel_transmit,
165
 	.irq		= skel_irq,
165
 	.irq		= skel_irq,
166
-	.disable	= skel_disable,
166
+
167
 };
167
 };
168
 
168
 
169
 /**************************************************************************
169
 /**************************************************************************
189
  * PCI PROBE - Look for an adapter
189
  * PCI PROBE - Look for an adapter
190
  **************************************************************************
190
  **************************************************************************
191
  */
191
  */
192
-static int skel_pci_probe ( struct dev *dev, struct pci_device *pci ) {
193
-	struct nic *nic = nic_device ( dev );
192
+static int skel_pci_probe ( struct nic *nic, struct pci_device *pci ) {
193
+
194
+
195
+	pci_fill_nic ( nic, pci );
196
+
194
 
197
 
195
 	nic->ioaddr = pci->ioaddr;
198
 	nic->ioaddr = pci->ioaddr;
196
 	nic->irqno = pci->irq;
199
 	nic->irqno = pci->irq;
213
 };
216
 };
214
 
217
 
215
 static struct pci_driver skel_pci_driver =
218
 static struct pci_driver skel_pci_driver =
216
-	PCI_DRIVER ( "SKEL/PCI", skel_pci_nics, PCI_NO_CLASS );
219
+	PCI_DRIVER ( skel_pci_nics, PCI_NO_CLASS );
217
 
220
 
218
-BOOT_DRIVER ( "SKEL/PCI", find_pci_boot_device,
219
-	      skel_pci_driver, skel_pci_probe );
221
+DRIVER ( "SKEL/PCI", nic_driver, pci_driver, skel_pci_driver,
222
+	 skel_pci_probe, skel_disable );
220
 
223
 
221
 /**************************************************************************
224
 /**************************************************************************
222
  * EISA PROBE - Look for an adapter
225
  * EISA PROBE - Look for an adapter
223
  **************************************************************************
226
  **************************************************************************
224
  */
227
  */
225
-static int skel_eisa_probe ( struct dev *dev, struct eisa_device *eisa ) {
228
+static int skel_eisa_probe ( struct nic *nic, struct eisa_device *eisa ) {
226
 	struct nic *nic = nic_device ( dev );
229
 	struct nic *nic = nic_device ( dev );
227
 
230
 
228
 	enable_eisa_device ( eisa );
231
 	enable_eisa_device ( eisa );
258
  * ISAPnP PROBE - Look for an adapter
261
  * ISAPnP PROBE - Look for an adapter
259
  **************************************************************************
262
  **************************************************************************
260
  */
263
  */
261
-static int skel_isapnp_probe ( struct dev *dev,
264
+static int skel_isapnp_probe ( struct nic *nic,
262
 			       struct isapnp_device *isapnp ) {
265
 			       struct isapnp_device *isapnp ) {
263
 	struct nic *nic = nic_device ( dev );
266
 	struct nic *nic = nic_device ( dev );
264
 
267
 
295
  * MCA PROBE - Look for an adapter
298
  * MCA PROBE - Look for an adapter
296
  **************************************************************************
299
  **************************************************************************
297
  */
300
  */
298
-static int skel_mca_probe ( struct dev *dev,
301
+static int skel_mca_probe ( struct nic *nic,
299
 			    struct mca_device *mca __unused ) {
302
 			    struct mca_device *mca __unused ) {
300
 	struct nic *nic = nic_device ( dev );
303
 	struct nic *nic = nic_device ( dev );
301
 
304
 
354
 	return 0;
357
 	return 0;
355
 }
358
 }
356
 
359
 
357
-static int skel_isa_probe ( struct dev *dev, struct isa_device *isa ) {
360
+static int skel_isa_probe ( struct nic *nic, struct isa_device *isa ) {
358
 	struct nic *nic = nic_device ( dev );
361
 	struct nic *nic = nic_device ( dev );
359
 
362
 
360
 	nic->ioaddr = isa->ioaddr;
363
 	nic->ioaddr = isa->ioaddr;

+ 9
- 6
src/drivers/net/smc9000.c View File

346
    return 0;
346
    return 0;
347
 }
347
 }
348
 
348
 
349
-static void smc9000_disable ( struct nic *nic ) {
349
+static void smc9000_disable ( struct nic *nic, struct isa_device *isa __unused ) {
350
+   nic_disable ( nic );
350
    smc_reset(nic->ioaddr);
351
    smc_reset(nic->ioaddr);
351
 
352
 
352
    /* no more interrupts for me */
353
    /* no more interrupts for me */
376
 	.poll		= smc9000_poll,
377
 	.poll		= smc9000_poll,
377
 	.transmit	= smc9000_transmit,
378
 	.transmit	= smc9000_transmit,
378
 	.irq		= smc9000_irq,
379
 	.irq		= smc9000_irq,
379
-	.disable	= smc9000_disable,
380
+
380
 };
381
 };
381
 
382
 
382
 /**************************************************************************
383
 /**************************************************************************
383
  * ETH_PROBE - Look for an adapter
384
  * ETH_PROBE - Look for an adapter
384
  ***************************************************************************/
385
  ***************************************************************************/
385
 
386
 
386
-static int smc9000_probe ( struct dev *dev, struct isa_device *isa ) {
387
-   struct nic *nic = nic_device ( dev );
387
+static int smc9000_probe ( struct nic *nic, struct isa_device *isa ) {
388
+
388
    unsigned short   revision;
389
    unsigned short   revision;
389
    int	            memory;
390
    int	            memory;
390
    int              media;
391
    int              media;
393
    int              i;
394
    int              i;
394
 
395
 
395
    nic->irqno  = 0;
396
    nic->irqno  = 0;
397
+   isa_fill_nic ( nic, isa );
396
    nic->ioaddr = isa->ioaddr;
398
    nic->ioaddr = isa->ioaddr;
397
 
399
 
398
    /*
400
    /*
489
 };
491
 };
490
 
492
 
491
 static struct isa_driver smc9000_driver =
493
 static struct isa_driver smc9000_driver =
492
-	ISA_DRIVER ( "SMC9000", smc9000_probe_addrs, smc9000_probe_addr,
494
+	ISA_DRIVER ( smc9000_probe_addrs, smc9000_probe_addr,
493
 		     GENERIC_ISAPNP_VENDOR, 0x8228 );
495
 		     GENERIC_ISAPNP_VENDOR, 0x8228 );
494
 
496
 
495
-BOOT_DRIVER ( "SMC9000", find_isa_boot_device, smc9000_driver, smc9000_probe );
497
+DRIVER ( "SMC9000", nic_driver, isa_driver, smc9000_driver,
498
+	 smc9000_probe, smc9000_disable );
496
 
499
 
497
 ISA_ROM ( "smc9000", "SMC9000" );
500
 ISA_ROM ( "smc9000", "SMC9000" );
498
 
501
 

+ 7
- 5
src/drivers/net/sundance.c View File

576
 	.poll		= sundance_poll,
576
 	.poll		= sundance_poll,
577
 	.transmit	= sundance_transmit,
577
 	.transmit	= sundance_transmit,
578
 	.irq		= sundance_irq,
578
 	.irq		= sundance_irq,
579
-	.disable	= sundance_disable,
579
+
580
 };
580
 };
581
 static struct pci_driver sundance_driver;
581
 static struct pci_driver sundance_driver;
582
 
582
 
583
 /**************************************************************************
583
 /**************************************************************************
584
 PROBE - Look for an adapter, this routine's visible to the outside
584
 PROBE - Look for an adapter, this routine's visible to the outside
585
 ***************************************************************************/
585
 ***************************************************************************/
586
-static int sundance_probe ( struct dev *dev, struct pci_device *pci ) {
587
-	struct nic *nic = nic_device ( dev );
586
+static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
587
+
588
 	u8 ee_data[EEPROM_SIZE];
588
 	u8 ee_data[EEPROM_SIZE];
589
 	u16 mii_ctl;
589
 	u16 mii_ctl;
590
 	int i;
590
 	int i;
740
 
740
 
741
 	/* point to NIC specific routines */
741
 	/* point to NIC specific routines */
742
 	nic->nic_op	= &sundance_operations;
742
 	nic->nic_op	= &sundance_operations;
743
+	pci_fill_nic ( nic, pci );
743
 	nic->irqno = pci->irq;
744
 	nic->irqno = pci->irq;
744
 	nic->ioaddr = BASE;
745
 	nic->ioaddr = BASE;
745
 
746
 
884
 };
885
 };
885
 
886
 
886
 static struct pci_driver sundance_driver =
887
 static struct pci_driver sundance_driver =
887
-	PCI_DRIVER ( "SUNDANCE/PCI", sundance_nics, PCI_NO_CLASS );
888
+	PCI_DRIVER ( sundance_nics, PCI_NO_CLASS );
888
 
889
 
889
-BOOT_DRIVER ( "SUNDANCE/PCI", find_pci_boot_device, sundance_driver, sundance_probe );
890
+DRIVER ( "SUNDANCE/PCI", nic_driver, pci_driver, sundance_driver,
891
+	 sundance_probe, sundance_disable );

+ 6
- 5
src/drivers/net/tg3.c View File

3224
 	.poll		= tg3_poll,
3224
 	.poll		= tg3_poll,
3225
 	.transmit	= tg3_transmit,
3225
 	.transmit	= tg3_transmit,
3226
 	.irq		= tg3_irq,
3226
 	.irq		= tg3_irq,
3227
-	.disable	= tg3_disable,
3227
+
3228
 };
3228
 };
3229
 
3229
 
3230
 /**************************************************************************
3230
 /**************************************************************************
3231
 PROBE - Look for an adapter, this routine's visible to the outside
3231
 PROBE - Look for an adapter, this routine's visible to the outside
3232
 You should omit the last argument struct pci_device * for a non-PCI NIC
3232
 You should omit the last argument struct pci_device * for a non-PCI NIC
3233
 ***************************************************************************/
3233
 ***************************************************************************/
3234
-static int tg3_probe ( struct dev *dev, struct pci_device *pdev ) {
3235
-	struct nic *nic = nic_device ( dev );
3234
+static int tg3_probe ( struct nic *nic, struct pci_device *pdev ) {
3235
+
3236
 	struct tg3 *tp = &tg3;
3236
 	struct tg3 *tp = &tg3;
3237
 	unsigned long tg3reg_base, tg3reg_len;
3237
 	unsigned long tg3reg_base, tg3reg_len;
3238
 	int i, err, pm_cap;
3238
 	int i, err, pm_cap;
3385
 };
3385
 };
3386
 
3386
 
3387
 static struct pci_driver tg3_driver =
3387
 static struct pci_driver tg3_driver =
3388
-	PCI_DRIVER ( "TG3", tg3_nics, PCI_NO_CLASS );
3388
+	PCI_DRIVER ( tg3_nics, PCI_NO_CLASS );
3389
 
3389
 
3390
-BOOT_DRIVER ( "TG3", find_pci_boot_device, tg3_driver, tg3_probe );
3390
+DRIVER ( "TG3", nic_driver, pci_driver, tg3_driver,
3391
+	 tg3_probe, tg3_disable );

+ 7
- 5
src/drivers/net/tlan.c View File

756
 	.poll		= tlan_poll,
756
 	.poll		= tlan_poll,
757
 	.transmit	= tlan_transmit,
757
 	.transmit	= tlan_transmit,
758
 	.irq		= tlan_irq,
758
 	.irq		= tlan_irq,
759
-	.disable	= tlan_disable,
759
+
760
 };
760
 };
761
 
761
 
762
 static void TLan_SetMulticastList(struct nic *nic) {
762
 static void TLan_SetMulticastList(struct nic *nic) {
781
 
781
 
782
 #define board_found 1
782
 #define board_found 1
783
 #define valid_link 0
783
 #define valid_link 0
784
-static int tlan_probe ( struct dev *dev, struct pci_device *pci ) {
785
-	struct nic *nic = nic_device ( dev );
784
+static int tlan_probe ( struct nic *nic, struct pci_device *pci ) {
785
+
786
 	u16 data = 0;
786
 	u16 data = 0;
787
 	int err;
787
 	int err;
788
 	int i;
788
 	int i;
791
 		return 0;
791
 		return 0;
792
 
792
 
793
 	nic->irqno  = 0;
793
 	nic->irqno  = 0;
794
+	pci_fill_nic ( nic, pci );
794
 	nic->ioaddr = pci->ioaddr;
795
 	nic->ioaddr = pci->ioaddr;
795
 
796
 
796
 	BASE = pci->ioaddr;
797
 	BASE = pci->ioaddr;
1715
 };
1716
 };
1716
 
1717
 
1717
 static struct pci_driver tlan_driver =
1718
 static struct pci_driver tlan_driver =
1718
-	PCI_DRIVER ( "TLAN/PCI", tlan_nics, PCI_NO_CLASS );
1719
+	PCI_DRIVER ( tlan_nics, PCI_NO_CLASS );
1719
 
1720
 
1720
-BOOT_DRIVER ( "TLAN/PCI", find_pci_boot_device, tlan_driver, tlan_probe );
1721
+DRIVER ( "TLAN/PCI", nic_driver, pci_driver, tlan_driver,
1722
+	 tlan_probe, tlan_disable );

+ 11
- 8
src/drivers/net/tulip.c View File

486
 static void mdio_write(struct nic *nic, int phy_id, int location, int value);
486
 static void mdio_write(struct nic *nic, int phy_id, int location, int value);
487
 static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
487
 static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
488
 static void parse_eeprom(struct nic *nic);
488
 static void parse_eeprom(struct nic *nic);
489
-static int tulip_probe(struct dev *dev,struct pci_device *pci);
489
+static int tulip_probe(struct nic *nic,struct pci_device *pci);
490
 static void tulip_init_ring(struct nic *nic);
490
 static void tulip_init_ring(struct nic *nic);
491
 static void tulip_reset(struct nic *nic);
491
 static void tulip_reset(struct nic *nic);
492
 static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
492
 static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
493
                            unsigned int s, const char *p);
493
                            unsigned int s, const char *p);
494
 static int tulip_poll(struct nic *nic, int retrieve);
494
 static int tulip_poll(struct nic *nic, int retrieve);
495
-static void tulip_disable(struct nic *nic);
495
+static void tulip_disable(struct nic *nic, struct pci_device *pci);
496
 static void nway_start(struct nic *nic);
496
 static void nway_start(struct nic *nic);
497
 static void pnic_do_nway(struct nic *nic);
497
 static void pnic_do_nway(struct nic *nic);
498
 static void select_media(struct nic *nic, int startup);
498
 static void select_media(struct nic *nic, int startup);
1180
 /*********************************************************************/
1180
 /*********************************************************************/
1181
 /* eth_disable - Disable the interface                               */
1181
 /* eth_disable - Disable the interface                               */
1182
 /*********************************************************************/
1182
 /*********************************************************************/
1183
-static void tulip_disable ( struct nic *nic ) {
1183
+static void tulip_disable ( struct nic *nic, struct pci_device *pci __unused ) {
1184
+nic_disable ( nic );
1184
 #ifdef TULIP_DEBUG_WHERE
1185
 #ifdef TULIP_DEBUG_WHERE
1185
     whereami("tulip_disable\n");
1186
     whereami("tulip_disable\n");
1186
 #endif
1187
 #endif
1218
 	.poll		= tulip_poll,
1219
 	.poll		= tulip_poll,
1219
 	.transmit	= tulip_transmit,
1220
 	.transmit	= tulip_transmit,
1220
 	.irq		= tulip_irq,
1221
 	.irq		= tulip_irq,
1221
-	.disable	= tulip_disable,
1222
+
1222
 };
1223
 };
1223
 
1224
 
1224
 /*********************************************************************/
1225
 /*********************************************************************/
1225
 /* eth_probe - Look for an adapter                                   */
1226
 /* eth_probe - Look for an adapter                                   */
1226
 /*********************************************************************/
1227
 /*********************************************************************/
1227
-static int tulip_probe ( struct dev *dev, struct pci_device *pci ) {
1228
-    struct nic *nic = nic_device ( dev );
1228
+static int tulip_probe ( struct nic *nic, struct pci_device *pci ) {
1229
+
1229
     u32 i;
1230
     u32 i;
1230
     u8  chip_rev;
1231
     u8  chip_rev;
1231
     u8 ee_data[EEPROM_SIZE];
1232
     u8 ee_data[EEPROM_SIZE];
1237
         return 0;
1238
         return 0;
1238
 
1239
 
1239
     ioaddr         = pci->ioaddr;
1240
     ioaddr         = pci->ioaddr;
1241
+    pci_fill_nic ( nic, pci );
1240
     nic->ioaddr    = pci->ioaddr & ~3;
1242
     nic->ioaddr    = pci->ioaddr & ~3;
1241
     nic->irqno     = 0;
1243
     nic->irqno     = 0;
1242
 
1244
 
2074
 };
2076
 };
2075
 
2077
 
2076
 static struct pci_driver tulip_driver =
2078
 static struct pci_driver tulip_driver =
2077
-	PCI_DRIVER ( "Tulip", tulip_nics, PCI_NO_CLASS );
2079
+	PCI_DRIVER ( tulip_nics, PCI_NO_CLASS );
2078
 
2080
 
2079
-BOOT_DRIVER ( "Tulip", find_pci_boot_device, tulip_driver, tulip_probe );
2081
+DRIVER ( "Tulip", nic_driver, pci_driver, tulip_driver,
2082
+	 tulip_probe, tulip_disable );

+ 10
- 7
src/drivers/net/via-rhine.c View File

685
 static void WriteMII (char, char, char, int);
685
 static void WriteMII (char, char, char, int);
686
 static void MIIDelay (void);
686
 static void MIIDelay (void);
687
 static void rhine_init_ring (struct nic *dev);
687
 static void rhine_init_ring (struct nic *dev);
688
-static void rhine_disable (struct nic *nic);
688
+static void rhine_disable (struct nic *nic, struct pci_device *pci);
689
 static void rhine_reset (struct nic *nic);
689
 static void rhine_reset (struct nic *nic);
690
 static int rhine_poll (struct nic *nic, int retreive);
690
 static int rhine_poll (struct nic *nic, int retreive);
691
 static void rhine_transmit (struct nic *nic, const char *d, unsigned int t,
691
 static void rhine_transmit (struct nic *nic, const char *d, unsigned int t,
954
 static struct pci_driver rhine_driver;
954
 static struct pci_driver rhine_driver;
955
 
955
 
956
 static int
956
 static int
957
-rhine_probe ( struct dev *dev, struct pci_device *pci ) {
958
-    struct nic *nic = nic_device ( dev );
957
+rhine_probe ( struct nic *nic, struct pci_device *pci ) {
958
+
959
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
959
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
960
 
960
 
961
     if (!pci->ioaddr)
961
     if (!pci->ioaddr)
965
     adjust_pci_device ( pci );
965
     adjust_pci_device ( pci );
966
     rhine_reset (nic);
966
     rhine_reset (nic);
967
     nic->nic_op	= &rhine_operations;
967
     nic->nic_op	= &rhine_operations;
968
+    pci_fill_nic ( nic, pci );
968
     nic->irqno	  = pci->irq;
969
     nic->irqno	  = pci->irq;
969
     nic->ioaddr   = tp->ioaddr;
970
     nic->ioaddr   = tp->ioaddr;
970
     return 1;
971
     return 1;
1157
 }
1158
 }
1158
 
1159
 
1159
 static void 
1160
 static void 
1160
-rhine_disable ( struct nic *nic ) {
1161
+rhine_disable ( struct nic *nic, struct pci_device *pci __unused ) {
1162
+    nic_disable ( nic );
1161
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
1163
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
1162
     int ioaddr = tp->ioaddr;
1164
     int ioaddr = tp->ioaddr;
1163
 
1165
 
1406
 	.poll		= rhine_poll,
1408
 	.poll		= rhine_poll,
1407
 	.transmit	= rhine_transmit,
1409
 	.transmit	= rhine_transmit,
1408
 	.irq		= rhine_irq,
1410
 	.irq		= rhine_irq,
1409
-	.disable	= rhine_disable,
1411
+
1410
 };
1412
 };
1411
 
1413
 
1412
 static struct pci_id rhine_nics[] = {
1414
 static struct pci_id rhine_nics[] = {
1418
 };
1420
 };
1419
 
1421
 
1420
 static struct pci_driver rhine_driver =
1422
 static struct pci_driver rhine_driver =
1421
-	PCI_DRIVER ( "VIA 86C100", rhine_nics, PCI_NO_CLASS );
1423
+	PCI_DRIVER ( rhine_nics, PCI_NO_CLASS );
1422
 
1424
 
1423
-BOOT_DRIVER ( "VIA 86C100", find_pci_boot_device, rhine_driver, rhine_probe );
1425
+DRIVER ( "VIA 86C100", nic_driver, pci_driver, rhine_driver,
1426
+	 rhine_probe, rhine_disable );
1424
 
1427
 
1425
 /* EOF via-rhine.c */
1428
 /* EOF via-rhine.c */

+ 8
- 6
src/drivers/net/w89c840.c View File

579
 /**************************************************************************
579
 /**************************************************************************
580
 w89c840_disable - Turn off ethernet interface
580
 w89c840_disable - Turn off ethernet interface
581
 ***************************************************************************/
581
 ***************************************************************************/
582
-static void w89c840_disable ( struct nic *nic ) {
582
+static void w89c840_disable ( struct nic *nic, struct pci_device *pci __unused ) {
583
+    nic_disable ( nic );
583
     /* merge reset and disable */
584
     /* merge reset and disable */
584
     w89c840_reset(nic);
585
     w89c840_reset(nic);
585
 
586
 
609
 	.poll		= w89c840_poll,
610
 	.poll		= w89c840_poll,
610
 	.transmit	= w89c840_transmit,
611
 	.transmit	= w89c840_transmit,
611
 	.irq		= w89c840_irq,
612
 	.irq		= w89c840_irq,
612
-	.disable	= w89c840_disable,
613
+
613
 };
614
 };
614
 
615
 
615
 static struct pci_id w89c840_nics[] = {
616
 static struct pci_id w89c840_nics[] = {
618
 };
619
 };
619
 
620
 
620
 static struct pci_driver w89c840_driver =
621
 static struct pci_driver w89c840_driver =
621
-	PCI_DRIVER ( "W89C840F", w89c840_nics, PCI_NO_CLASS );
622
+	PCI_DRIVER ( w89c840_nics, PCI_NO_CLASS );
622
 
623
 
623
 /**************************************************************************
624
 /**************************************************************************
624
 w89c840_probe - Look for an adapter, this routine's visible to the outside
625
 w89c840_probe - Look for an adapter, this routine's visible to the outside
625
 ***************************************************************************/
626
 ***************************************************************************/
626
-static int w89c840_probe ( struct dev *dev, struct pci_device *p ) {
627
-    struct nic *nic = nic_device ( dev );
627
+static int w89c840_probe ( struct nic *nic, struct pci_device *p ) {
628
+
628
 
629
 
629
     u16 sum = 0;
630
     u16 sum = 0;
630
     int i, j;
631
     int i, j;
954
 }
955
 }
955
 
956
 
956
 
957
 
957
-BOOT_DRIVER ( "W89C840F", find_pci_boot_device, w89c840_driver, w89c840_probe );
958
+DRIVER ( "W89C840F", nic_driver, pci_driver, w89c840_driver,
959
+	 w89c840_probe, w89c840_disable );

Loading…
Cancel
Save