Quellcode durchsuchen

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 vor 20 Jahren
Ursprung
Commit
614c39a8a4

+ 11
- 7
src/drivers/net/3c515.c Datei anzeigen

@@ -565,7 +565,9 @@ static void t515_transmit(struct nic *nic, const char *d,	/* Destination */
565 565
 /**************************************************************************
566 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 572
 	/* merge reset an disable */
571 573
 	t515_reset(nic);
@@ -610,17 +612,19 @@ static struct nic_operations t515_operations = {
610 612
 	.poll		= t515_poll,
611 613
 	.transmit	= t515_transmit,
612 614
 	.irq		= t515_irq,
613
-	.disable	= t515_disable,
615
+
614 616
 };
615 617
 
616 618
 /**************************************************************************
617 619
 PROBE - Look for an adapter, this routine's visible to the outside
618 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 624
 	/* Direct copy from Beckers 3c515.c removing any ISAPNP sections */
623 625
 
626
+	isapnp_fill_nic ( nic, isapnp );
627
+
624 628
 	nic->ioaddr = isapnp->ioaddr;
625 629
 	nic->irqno = isapnp->irqno;
626 630
 	activate_isapnp_device ( isapnp, 1 );
@@ -762,9 +766,9 @@ static struct isapnp_id t515_adapters[] = {
762 766
 };
763 767
 
764 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 774
 ISA_ROM ( "3c515", "3c515 Fast EtherLink ISAPnP" );

+ 9
- 6
src/drivers/net/3c595.c Datei anzeigen

@@ -443,7 +443,8 @@ vxsetlink(void)
443 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 448
 	t595_reset(nic);
448 449
 
449 450
 	outw(STOP_TRANSCEIVER, BASE + VX_COMMAND);
@@ -468,8 +469,8 @@ static void t595_irq(struct nic *nic __unused, irq_action_t action __unused)
468 469
 /**************************************************************************
469 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 474
 	int i;
474 475
 	unsigned short *p;
475 476
 
@@ -478,6 +479,7 @@ static int t595_probe ( struct dev *dev, struct pci_device *pci ) {
478 479
 	eth_nic_base = pci->ioaddr;
479 480
 
480 481
 	nic->irqno  = 0;
482
+	pci_fill_nic ( nic, pci );
481 483
 	nic->ioaddr = pci->ioaddr;
482 484
 
483 485
 	GO_WINDOW(0);
@@ -517,7 +519,7 @@ static struct nic_operations t595_operations = {
517 519
 	.poll		= t595_poll,
518 520
 	.transmit	= t595_transmit,
519 521
 	.irq		= t595_irq,
520
-	.disable	= t595_disable,
522
+
521 523
 };
522 524
 
523 525
 static struct pci_id t595_nics[] = {
@@ -538,9 +540,10 @@ PCI_ROM(0x10b7, 0x4500, "3c450-1",         "3Com450 HomePNA Tornado"),
538 540
 };
539 541
 
540 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 549
  * Local variables:

+ 8
- 5
src/drivers/net/3c90x.c Datei anzeigen

@@ -690,8 +690,8 @@ static void a3c90x_irq(struct nic *nic __unused, irq_action_t action __unused)
690 690
  *** initialization.  If this routine is called, the pci functions did find the
691 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 695
     int i, c;
696 696
     unsigned short eeprom[0x21];
697 697
     unsigned int cfg;
@@ -705,6 +705,8 @@ static int a3c90x_probe ( struct dev *dev, struct pci_device *pci ) {
705 705
 
706 706
     adjust_pci_device(pci);
707 707
 
708
+    pci_fill_nic ( nic, pci );
709
+
708 710
     nic->ioaddr = pci->ioaddr;
709 711
     nic->irqno = 0;
710 712
 
@@ -960,7 +962,7 @@ static struct nic_operations a3c90x_operations = {
960 962
 	.poll		= a3c90x_poll,
961 963
 	.transmit	= a3c90x_transmit,
962 964
 	.irq		= a3c90x_irq,
963
-	.disable	= a3c90x_disable,
965
+
964 966
 };
965 967
 
966 968
 static struct pci_id a3c90x_nics[] = {
@@ -991,6 +993,7 @@ PCI_ROM(0x10b7, 0x1202, "3c982b",        "3Com982B"),
991 993
 };
992 994
 
993 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 Datei anzeigen

@@ -157,13 +157,13 @@ static int TxPtr;
157 157
 /*********************************************************************/
158 158
 static void whereami(const char *str);
159 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 161
 static void davicom_init_chain(struct nic *nic);	/* Sten 10/9 */
162 162
 static void davicom_reset(struct nic *nic);
163 163
 static void davicom_transmit(struct nic *nic, const char *d, unsigned int t,
164 164
 			   unsigned int s, const char *p);
165 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 167
 #ifdef	DAVICOM_DEBUG
168 168
 static void davicom_more(void);
169 169
 #endif /* DAVICOM_DEBUG */
@@ -620,7 +620,8 @@ static int davicom_poll(struct nic *nic, int retrieve)
620 620
 /*********************************************************************/
621 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 625
   whereami("davicom_disable\n");
625 626
 
626 627
   davicom_reset(nic);
@@ -655,8 +656,8 @@ static void davicom_irq(struct nic *nic __unused, irq_action_t action __unused)
655 656
 /*********************************************************************/
656 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 661
   unsigned int i;
661 662
 
662 663
   whereami("davicom_probe\n");
@@ -669,6 +670,7 @@ static int davicom_probe ( struct dev *dev, struct pci_device *pci ) {
669 670
   ioaddr  = pci->ioaddr;
670 671
 
671 672
   nic->irqno  = 0;
673
+  pci_fill_nic ( nic, pci );
672 674
   nic->ioaddr = pci->ioaddr;
673 675
 
674 676
   /* wakeup chip */
@@ -703,7 +705,7 @@ static struct nic_operations davicom_operations = {
703 705
 	.poll		= davicom_poll,
704 706
 	.transmit	= davicom_transmit,
705 707
 	.irq		= davicom_irq,
706
-	.disable	= davicom_disable,
708
+
707 709
 };
708 710
 
709 711
 static struct pci_id davicom_nics[] = {
@@ -714,6 +716,7 @@ PCI_ROM(0x1282, 0x9132, "davicom9132", "Davicom 9132"),	/* Needs probably some f
714 716
 };
715 717
 
716 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 Datei anzeigen

@@ -648,7 +648,8 @@ static void depca_transmit(
648 648
 /**************************************************************************
649 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 653
 	/* reset and disable merge */
653 654
 	depca_reset(nic);
654 655
 
@@ -736,18 +737,19 @@ static struct nic_operations depca_operations = {
736 737
 	.poll		= depca_poll,
737 738
 	.transmit	= depca_transmit,
738 739
 	.irq		= depca_irq,
739
-	.disable	= depca_disable,
740
+
740 741
 };
741 742
 
742 743
 /**************************************************************************
743 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 748
 	int	i, j;
748 749
 	long	sum, chksum;
749 750
 
750 751
 	nic->irqno    = 0;
752
+	isa_fill_nic ( nic, isa );
751 753
 	nic->ioaddr   = isa->ioaddr;
752 754
 
753 755
 	for (i = 0, j = 0, sum = 0; j < 3; j++) {
@@ -792,9 +794,10 @@ static isa_probe_addr_t depca_probe_addrs[] = {
792 794
 };
793 795
 
794 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 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 803
 ISA_ROM ( "depca", "Digital DE100 and DE200" );

+ 7
- 5
src/drivers/net/dmfe.c Datei anzeigen

@@ -459,8 +459,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
459 459
 
460 460
 #define board_found 1
461 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 464
 	uint32_t dev_rev, pci_pmr;
465 465
 	int i;
466 466
 
@@ -508,6 +508,7 @@ static int dmfe_probe ( struct dev *dev, struct pci_device *pci ) {
508 508
 	dmfe_reset(nic);
509 509
 
510 510
 	nic->irqno  = 0;
511
+	pci_fill_nic ( nic, pci );
511 512
 	nic->ioaddr = pci->ioaddr;
512 513
 
513 514
 	/* point to NIC specific routines */
@@ -1213,7 +1214,7 @@ static struct nic_operations dmfe_operations = {
1213 1214
 	.poll		= dmfe_poll,
1214 1215
 	.transmit	= dmfe_transmit,
1215 1216
 	.irq		= dmfe_irq,
1216
-	.disable	= dmfe_disable,
1217
+
1217 1218
 };
1218 1219
 
1219 1220
 static struct pci_id dmfe_nics[] = {
@@ -1224,6 +1225,7 @@ static struct pci_id dmfe_nics[] = {
1224 1225
 };
1225 1226
 
1226 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 Datei anzeigen

@@ -3582,8 +3582,8 @@ static void e1000_irq(struct nic *nic __unused, irq_action_t action)
3582 3582
 PROBE - Look for an adapter, this routine's visible to the outside
3583 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 3587
 	unsigned long mmio_start, mmio_len;
3588 3588
 	int ret_val, i;
3589 3589
 
@@ -3671,7 +3671,7 @@ static struct nic_operations e1000_operations = {
3671 3671
 	.poll		= e1000_poll,
3672 3672
 	.transmit	= e1000_transmit,
3673 3673
 	.irq		= e1000_irq,
3674
-	.disable	= e1000_disable,
3674
+
3675 3675
 };
3676 3676
 
3677 3677
 static struct pci_id e1000_nics[] = {
@@ -3708,6 +3708,7 @@ PCI_ROM(0x8086, 0x107b, "e1000-82546gb-serdes",	     "Intel EtherExpressPro1000
3708 3708
 };
3709 3709
 
3710 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 Datei anzeigen

@@ -450,7 +450,8 @@ static void eepro_transmit(
450 450
 /**************************************************************************
451 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 455
 	eepro_sw2bank0(nic->ioaddr);	/* Switch to bank 0 */
455 456
 	/* Flush the Tx and disable Rx */
456 457
 	outb(STOP_RCV_CMD, nic->ioaddr);
@@ -534,14 +535,14 @@ static struct nic_operations eepro_operations = {
534 535
 	.poll		= eepro_poll,
535 536
 	.transmit	= eepro_transmit,
536 537
 	.irq		= eepro_irq,
537
-	.disable	= eepro_disable,
538
+
538 539
 };
539 540
 
540 541
 /**************************************************************************
541 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 546
 	int		i, l_eepro = 0;
546 547
 	union {
547 548
 		unsigned char	caddr[ETH_ALEN];
@@ -549,6 +550,7 @@ static int eepro_probe ( struct dev *dev, struct isa_device *isa ) {
549 550
 	} station_addr;
550 551
 
551 552
 	nic->irqno  = 0;
553
+	isa_fill_nic ( nic, isa );
552 554
 	nic->ioaddr = isa->ioaddr;
553 555
 
554 556
 	station_addr.saddr[2] = read_eeprom(nic->ioaddr,2);
@@ -605,9 +607,10 @@ static isa_probe_addr_t eepro_probe_addrs[] = {
605 607
 };
606 608
 
607 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 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 616
 ISA_ROM ( "eepro", "Intel Etherexpress Pro/10" );

+ 6
- 5
src/drivers/net/eepro100.c Datei anzeigen

@@ -603,8 +603,8 @@ static void eepro100_disable ( struct nic *nic __unused ) {
603 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 608
 	unsigned short sum = 0;
609 609
 	int i;
610 610
 	int read_cmd, ee_size;
@@ -796,7 +796,7 @@ static struct nic_operations eepro100_operations = {
796 796
 	.poll		= eepro100_poll,
797 797
 	.transmit	= eepro100_transmit,
798 798
 	.irq		= eepro100_irq,
799
-	.disable	= eepro100_disable,
799
+
800 800
 };
801 801
 
802 802
 static struct pci_id eepro100_nics[] = {
@@ -837,6 +837,7 @@ PCI_ROM(0x8086, 0x5201, "eepro100-5201", "Intel EtherExpress PRO/100 Intelligent
837 837
 
838 838
 
839 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 Datei anzeigen

@@ -50,7 +50,7 @@ struct epic_tx_desc {
50 50
 
51 51
 static void	epic100_open(void);
52 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 54
 static int	epic100_poll(struct nic *nic, int retrieve);
55 55
 static void	epic100_transmit(struct nic *nic, const char *destaddr,
56 56
 				 unsigned int type, unsigned int len, const char *data);
@@ -99,8 +99,8 @@ static unsigned char		tx_packet[PKT_BUF_SZ * TX_RING_SIZE];
99 99
 
100 100
 
101 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 104
     int i;
105 105
     unsigned short* ap;
106 106
     unsigned int phy, phy_idx;
@@ -115,6 +115,7 @@ epic100_probe ( struct dev *dev, struct pci_device *pci ) {
115 115
 
116 116
     ioaddr = pci->ioaddr;
117 117
     nic->irqno  = 0;
118
+    pci_fill_nic ( nic, pci );
118 119
     nic->ioaddr = pci->ioaddr & ~3;
119 120
 
120 121
     /* compute all used static epic100 registers address */
@@ -507,7 +508,7 @@ static struct nic_operations epic100_operations = {
507 508
 	.poll		= epic100_poll,
508 509
 	.transmit	= epic100_transmit,
509 510
 	.irq		= epic100_irq,
510
-	.disable	= epic100_disable,
511
+
511 512
 };
512 513
 
513 514
 static struct pci_id epic100_nics[] = {
@@ -516,6 +517,7 @@ PCI_ROM(0x10b8, 0x0006, "smc-83c175", "SMC EPIC/C 83c175"),
516 517
 };
517 518
 
518 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 Datei anzeigen

@@ -923,7 +923,7 @@ static struct nic_operations forcedeth_operations = {
923 923
 	.poll		= forcedeth_poll,
924 924
 	.transmit	= forcedeth_transmit,
925 925
 	.irq		= forcedeth_irq,
926
-	.disable	= forcedeth_disable,
926
+
927 927
 };
928 928
 
929 929
 static struct pci_id forcedeth_nics[] = {
@@ -933,7 +933,7 @@ static struct pci_id forcedeth_nics[] = {
933 933
 };
934 934
 
935 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 939
 PROBE - Look for an adapter, this routine's visible to the outside
@@ -941,8 +941,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
941 941
 #define IORESOURCE_MEM 0x00000200
942 942
 #define board_found 1
943 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 946
 	unsigned long addr;
947 947
 	int sz;
948 948
 	u8 *base;
@@ -954,6 +954,7 @@ static int forcedeth_probe ( struct dev *dev, struct pci_device *pci ) {
954 954
 	       dev->name, pci->vendor, pci->dev_id);
955 955
 
956 956
 	nic->irqno  = 0;
957
+	pci_fill_nic ( nic, pci );
957 958
 	nic->ioaddr = pci->ioaddr;
958 959
 
959 960
 	/* point to private storage */
@@ -1035,4 +1036,5 @@ static int forcedeth_probe ( struct dev *dev, struct pci_device *pci ) {
1035 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 Datei anzeigen

@@ -644,7 +644,8 @@ static void mtd_transmit(
644 644
 /**************************************************************************
645 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 649
     /* put the card in its initial state */
649 650
     /* Disable Tx Rx*/
650 651
     outl( mtdx.crvalue & (~TxEnable) & (~RxEnable), mtdx.ioaddr + TCRRCR);
@@ -658,7 +659,7 @@ static struct nic_operations mtd_operations = {
658 659
 	.poll		= mtd_poll,
659 660
 	.transmit	= mtd_transmit,
660 661
 	.irq		= dummy_irq,
661
-	.disable	= mtd_disable,
662
+
662 663
 };
663 664
 
664 665
 static struct pci_id mtd80x_nics[] = {
@@ -668,14 +669,14 @@ static struct pci_id mtd80x_nics[] = {
668 669
 };
669 670
 
670 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 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 680
     int i;
680 681
 
681 682
     if (pci->ioaddr == 0)
@@ -1086,4 +1087,5 @@ static void getlinktype(struct nic *dev)
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 Datei anzeigen

@@ -213,7 +213,7 @@ static unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE] __attribute__ ((aligned(4)))
213 213
 
214 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 217
 static int eeprom_read(long addr, int location);
218 218
 static int mdio_read(int phy_id, int location);
219 219
 static void natsemi_init(struct nic *nic);
@@ -225,7 +225,7 @@ static void natsemi_set_rx_mode(struct nic *nic);
225 225
 static void natsemi_check_duplex(struct nic *nic);
226 226
 static void natsemi_transmit(struct nic *nic, const char *d, unsigned int t, unsigned int s, const char *p);
227 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 229
 static void natsemi_irq(struct nic *nic, irq_action_t action);
230 230
 
231 231
 /* 
@@ -243,9 +243,8 @@ static void natsemi_irq(struct nic *nic, irq_action_t action);
243 243
  */
244 244
 
245 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 248
     int i;
250 249
     int prev_eedata;
251 250
     u32 tmp;
@@ -258,6 +257,7 @@ natsemi_probe ( struct dev *dev, struct pci_device *pci ) {
258 257
     /* initialize some commonly used globals */
259 258
 	
260 259
     nic->irqno  = 0;
260
+    pci_fill_nic ( nic, pci );
261 261
     nic->ioaddr = pci->ioaddr;
262 262
 
263 263
     ioaddr     = pci->ioaddr;
@@ -725,7 +725,8 @@ natsemi_poll(struct nic *nic, int retrieve)
725 725
  */
726 726
 
727 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 730
     /* merge reset and disable */
730 731
     natsemi_init(nic);
731 732
 
@@ -768,7 +769,7 @@ static struct nic_operations natsemi_operations = {
768 769
 	.poll		= natsemi_poll,
769 770
 	.transmit	= natsemi_transmit,
770 771
 	.irq		= natsemi_irq,
771
-	.disable	= natsemi_disable,
772
+
772 773
 };
773 774
 
774 775
 static struct pci_id natsemi_nics[] = {
@@ -776,6 +777,7 @@ PCI_ROM(0x100b, 0x0020, "dp83815", "DP83815"),
776 777
 };
777 778
 
778 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 Datei anzeigen

@@ -756,7 +756,8 @@ static void ns83820_transmit(struct nic *nic, const char *d,	/* Destination */
756 756
 /**************************************************************************
757 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 761
 	/* put the card in its initial state */
761 762
 	/* This function serves 3 purposes.
762 763
 	 * This disables DMA and interrupts so we don't receive
@@ -809,7 +810,7 @@ static struct nic_operations ns83820_operations = {
809 810
 	.poll		= ns83820_poll,
810 811
 	.transmit	= ns83820_transmit,
811 812
 	.irq		= ns83820_irq,
812
-	.disable	= ns83820_disable,
813
+
813 814
 };
814 815
 
815 816
 static struct pci_id ns83820_nics[] = {
@@ -817,7 +818,7 @@ static struct pci_id ns83820_nics[] = {
817 818
 };
818 819
 
819 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 824
 PROBE - Look for an adapter, this routine's visible to the outside
@@ -825,8 +826,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
825 826
 
826 827
 #define board_found 1
827 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 831
 	int sz;
831 832
 	long addr;
832 833
 	int using_dac = 0;
@@ -852,6 +853,7 @@ static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
852 853
 		return 0;
853 854
 
854 855
 	nic->irqno  = 0;
856
+	pci_fill_nic ( nic, pci );
855 857
 	nic->ioaddr = pci->ioaddr & ~3;
856 858
 
857 859
 	/* disable interrupts */
@@ -1016,4 +1018,5 @@ static int ns83820_probe ( struct dev *dev, struct pci_device *pci ) {
1016 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 Datei anzeigen

@@ -666,8 +666,8 @@ static void pcnet32_irq(struct nic *nic __unused, irq_action_t action __unused)
666 666
 PROBE - Look for an adapter, this routine's visible to the outside
667 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 671
 	int i, media;
672 672
 	int fdx, mii, fset, dxsuflo, ltint;
673 673
 	int chip_version;
@@ -685,6 +685,7 @@ static int pcnet32_probe ( struct dev *dev, struct pci_device *pci ) {
685 685
 	       dev->name, pci->vendor, pci->dev_id);
686 686
 
687 687
 	nic->irqno  = 0;
688
+	pci_fill_nic ( nic, pci );
688 689
 	nic->ioaddr = pci->ioaddr & ~3;
689 690
 
690 691
 	/* reset the chip */
@@ -990,7 +991,7 @@ static struct nic_operations pcnet32_operations = {
990 991
 	.poll		= pcnet32_poll,
991 992
 	.transmit	= pcnet32_transmit,
992 993
 	.irq		= pcnet32_irq,
993
-	.disable	= pcnet32_disable,
994
+
994 995
 };
995 996
 
996 997
 static struct pci_id pcnet32_nics[] = {
@@ -1000,6 +1001,7 @@ static struct pci_id pcnet32_nics[] = {
1000 1001
 };
1001 1002
 
1002 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 Datei anzeigen

@@ -707,7 +707,7 @@ static struct nic_operations r8169_operations = {
707 707
 	.poll		= r8169_poll,
708 708
 	.transmit	= r8169_transmit,
709 709
 	.irq		= r8169_irq,
710
-	.disable	= r8169_disable,
710
+
711 711
 };
712 712
 
713 713
 static struct pci_id r8169_nics[] = {
@@ -715,7 +715,7 @@ static struct pci_id r8169_nics[] = {
715 715
 };
716 716
 
717 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 721
 PROBE - Look for an adapter, this routine's visible to the outside
@@ -723,8 +723,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
723 723
 
724 724
 #define board_found 1
725 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 728
 	static int board_idx = -1;
729 729
 	static int printed_version = 0;
730 730
 	int i, rc;
@@ -844,10 +844,12 @@ static int r8169_probe ( struct dev *dev, struct pci_device *pci ) {
844 844
 	r8169_reset(nic);
845 845
 	/* point to NIC specific routines */
846 846
 	nic->nic_op	= &r8169_operations;
847
+	pci_fill_nic ( nic, pci );
847 848
 	nic->irqno = pci->irq;
848 849
 	nic->ioaddr = ioaddr;
849 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 Datei anzeigen

@@ -172,25 +172,26 @@ static unsigned int cur_rx,cur_tx;
172 172
 static unsigned char tx_buffer[TX_BUF_SIZE] __attribute__((aligned(4)));
173 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 176
 static int read_eeprom(struct nic *nic, int location, int addr_len);
177 177
 static void rtl_reset(struct nic *nic);
178 178
 static void rtl_transmit(struct nic *nic, const char *destaddr,
179 179
 	unsigned int type, unsigned int len, const char *data);
180 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 182
 static void rtl_irq(struct nic *nic, irq_action_t action);
183 183
 static struct nic_operations rtl_operations;
184 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 188
 	int i;
189 189
 	int speed10, fullduplex;
190 190
 	int addr_len;
191 191
 	unsigned short *ap = (unsigned short*)nic->node_addr;
192 192
 
193 193
 	/* Copy ioaddr and IRQ from PCI information */
194
+	pci_fill_nic ( nic, pci );
194 195
 	nic->ioaddr = pci->ioaddr;
195 196
 	nic->irqno = pci->irq;
196 197
 
@@ -501,7 +502,8 @@ static void rtl_irq(struct nic *nic, irq_action_t action)
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 507
 	/* merge reset and disable */
506 508
 	rtl_reset(nic);
507 509
 
@@ -519,7 +521,7 @@ static struct nic_operations rtl_operations = {
519 521
 	.poll		= rtl_poll,
520 522
 	.transmit	= rtl_transmit,
521 523
 	.irq		= rtl_irq,
522
-	.disable	= rtl_disable,
524
+
523 525
 };
524 526
 
525 527
 static struct pci_id rtl8139_nics[] = {
@@ -540,6 +542,7 @@ PCI_ROM(0xffff, 0x8139, "clone-rtl8139", "Cloned 8139"),
540 542
 };
541 543
 
542 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 Datei anzeigen

@@ -123,11 +123,11 @@ static struct pci_id   pci_isa_bridge_list[] = {
123 123
 
124 124
 
125 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 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 132
 static u16  sis900_read_eeprom(int location);
133 133
 static void sis900_mdio_reset(long mdio_addr);
@@ -150,7 +150,7 @@ static void sis900_transmit(struct nic *nic, const char *d,
150 150
                             unsigned int t, unsigned int s, const char *p);
151 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 155
 static void sis900_irq(struct nic *nic, irq_action_t action);
156 156
 
@@ -309,8 +309,8 @@ static int sis635_get_mac_addr(struct pci_device * pci_dev __unused, struct nic
309 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 314
     int i;
315 315
     int found=0;
316 316
     int phy_addr;
@@ -321,6 +321,7 @@ static int sis900_probe ( struct dev *dev, struct pci_device *pci ) {
321 321
         return 0;
322 322
 
323 323
     nic->irqno  = 0;
324
+    pci_fill_nic ( nic, pci );
324 325
     nic->ioaddr = pci->ioaddr;
325 326
     ioaddr  = pci->ioaddr;
326 327
     vendor  = pci->vendor;
@@ -1208,7 +1209,8 @@ sis900_poll(struct nic *nic, int retrieve)
1208 1209
  */
1209 1210
 
1210 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 1214
     /* merge reset and disable */
1213 1215
     sis900_init(nic);
1214 1216
 
@@ -1249,7 +1251,7 @@ static struct nic_operations sis900_operations = {
1249 1251
 	.poll		= sis900_poll,
1250 1252
 	.transmit	= sis900_transmit,
1251 1253
 	.irq		= sis900_irq,
1252
-	.disable	= sis900_disable,
1254
+
1253 1255
 };
1254 1256
 
1255 1257
 static struct pci_id sis900_nics[] = {
@@ -1260,4 +1262,5 @@ PCI_ROM(0x1039, 0x7016, "sis7016", "SIS7016"),
1260 1262
 static struct pci_driver sis900_driver =
1261 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 Datei anzeigen

@@ -163,7 +163,7 @@ static struct nic_operations skel_operations = {
163 163
 	.poll		= skel_poll,
164 164
 	.transmit	= skel_transmit,
165 165
 	.irq		= skel_irq,
166
-	.disable	= skel_disable,
166
+
167 167
 };
168 168
 
169 169
 /**************************************************************************
@@ -189,8 +189,11 @@ static struct nic_operations skel_operations = {
189 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 198
 	nic->ioaddr = pci->ioaddr;
196 199
 	nic->irqno = pci->irq;
@@ -213,16 +216,16 @@ PCI_ROM ( 0x0000, 0x0000, "skel-pci", "Skeleton PCI Adapter" ),
213 216
 };
214 217
 
215 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 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 229
 	struct nic *nic = nic_device ( dev );
227 230
 
228 231
 	enable_eisa_device ( eisa );
@@ -258,7 +261,7 @@ ISA_ROM ( "skel-eisa", "Skeleton EISA Adapter" );
258 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 265
 			       struct isapnp_device *isapnp ) {
263 266
 	struct nic *nic = nic_device ( dev );
264 267
 
@@ -295,7 +298,7 @@ ISA_ROM ( "skel-isapnp", "Skeleton ISAPnP Adapter" );
295 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 302
 			    struct mca_device *mca __unused ) {
300 303
 	struct nic *nic = nic_device ( dev );
301 304
 
@@ -354,7 +357,7 @@ static int skel_isa_probe_addr ( isa_probe_addr_t ioaddr __unused ) {
354 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 361
 	struct nic *nic = nic_device ( dev );
359 362
 
360 363
 	nic->ioaddr = isa->ioaddr;

+ 9
- 6
src/drivers/net/smc9000.c Datei anzeigen

@@ -346,7 +346,8 @@ static int smc9000_poll(struct nic *nic, int retrieve)
346 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 351
    smc_reset(nic->ioaddr);
351 352
 
352 353
    /* no more interrupts for me */
@@ -376,15 +377,15 @@ static struct nic_operations smc9000_operations = {
376 377
 	.poll		= smc9000_poll,
377 378
 	.transmit	= smc9000_transmit,
378 379
 	.irq		= smc9000_irq,
379
-	.disable	= smc9000_disable,
380
+
380 381
 };
381 382
 
382 383
 /**************************************************************************
383 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 389
    unsigned short   revision;
389 390
    int	            memory;
390 391
    int              media;
@@ -393,6 +394,7 @@ static int smc9000_probe ( struct dev *dev, struct isa_device *isa ) {
393 394
    int              i;
394 395
 
395 396
    nic->irqno  = 0;
397
+   isa_fill_nic ( nic, isa );
396 398
    nic->ioaddr = isa->ioaddr;
397 399
 
398 400
    /*
@@ -489,10 +491,11 @@ static isa_probe_addr_t smc9000_probe_addrs[] = {
489 491
 };
490 492
 
491 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 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 500
 ISA_ROM ( "smc9000", "SMC9000" );
498 501
 

+ 7
- 5
src/drivers/net/sundance.c Datei anzeigen

@@ -576,15 +576,15 @@ static struct nic_operations sundance_operations = {
576 576
 	.poll		= sundance_poll,
577 577
 	.transmit	= sundance_transmit,
578 578
 	.irq		= sundance_irq,
579
-	.disable	= sundance_disable,
579
+
580 580
 };
581 581
 static struct pci_driver sundance_driver;
582 582
 
583 583
 /**************************************************************************
584 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 588
 	u8 ee_data[EEPROM_SIZE];
589 589
 	u16 mii_ctl;
590 590
 	int i;
@@ -740,6 +740,7 @@ static int sundance_probe ( struct dev *dev, struct pci_device *pci ) {
740 740
 
741 741
 	/* point to NIC specific routines */
742 742
 	nic->nic_op	= &sundance_operations;
743
+	pci_fill_nic ( nic, pci );
743 744
 	nic->irqno = pci->irq;
744 745
 	nic->ioaddr = BASE;
745 746
 
@@ -884,6 +885,7 @@ static struct pci_id sundance_nics[] = {
884 885
 };
885 886
 
886 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 Datei anzeigen

@@ -3224,15 +3224,15 @@ static struct nic_operations tg3_operations = {
3224 3224
 	.poll		= tg3_poll,
3225 3225
 	.transmit	= tg3_transmit,
3226 3226
 	.irq		= tg3_irq,
3227
-	.disable	= tg3_disable,
3227
+
3228 3228
 };
3229 3229
 
3230 3230
 /**************************************************************************
3231 3231
 PROBE - Look for an adapter, this routine's visible to the outside
3232 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 3236
 	struct tg3 *tp = &tg3;
3237 3237
 	unsigned long tg3reg_base, tg3reg_len;
3238 3238
 	int i, err, pm_cap;
@@ -3385,6 +3385,7 @@ PCI_ROM(0x173b, 0x03eb, "tg3-ac1003",      "Altima AC1003"),
3385 3385
 };
3386 3386
 
3387 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 Datei anzeigen

@@ -756,7 +756,7 @@ static struct nic_operations tlan_operations = {
756 756
 	.poll		= tlan_poll,
757 757
 	.transmit	= tlan_transmit,
758 758
 	.irq		= tlan_irq,
759
-	.disable	= tlan_disable,
759
+
760 760
 };
761 761
 
762 762
 static void TLan_SetMulticastList(struct nic *nic) {
@@ -781,8 +781,8 @@ PROBE - Look for an adapter, this routine's visible to the outside
781 781
 
782 782
 #define board_found 1
783 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 786
 	u16 data = 0;
787 787
 	int err;
788 788
 	int i;
@@ -791,6 +791,7 @@ static int tlan_probe ( struct dev *dev, struct pci_device *pci ) {
791 791
 		return 0;
792 792
 
793 793
 	nic->irqno  = 0;
794
+	pci_fill_nic ( nic, pci );
794 795
 	nic->ioaddr = pci->ioaddr;
795 796
 
796 797
 	BASE = pci->ioaddr;
@@ -1715,6 +1716,7 @@ static struct pci_id tlan_nics[] = {
1715 1716
 };
1716 1717
 
1717 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 Datei anzeigen

@@ -486,13 +486,13 @@ static int mdio_read(struct nic *nic, int phy_id, int location);
486 486
 static void mdio_write(struct nic *nic, int phy_id, int location, int value);
487 487
 static int read_eeprom(unsigned long ioaddr, int location, int addr_len);
488 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 490
 static void tulip_init_ring(struct nic *nic);
491 491
 static void tulip_reset(struct nic *nic);
492 492
 static void tulip_transmit(struct nic *nic, const char *d, unsigned int t,
493 493
                            unsigned int s, const char *p);
494 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 496
 static void nway_start(struct nic *nic);
497 497
 static void pnic_do_nway(struct nic *nic);
498 498
 static void select_media(struct nic *nic, int startup);
@@ -1180,7 +1180,8 @@ static int tulip_poll(struct nic *nic, int retrieve)
1180 1180
 /*********************************************************************/
1181 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 1185
 #ifdef TULIP_DEBUG_WHERE
1185 1186
     whereami("tulip_disable\n");
1186 1187
 #endif
@@ -1218,14 +1219,14 @@ static struct nic_operations tulip_operations = {
1218 1219
 	.poll		= tulip_poll,
1219 1220
 	.transmit	= tulip_transmit,
1220 1221
 	.irq		= tulip_irq,
1221
-	.disable	= tulip_disable,
1222
+
1222 1223
 };
1223 1224
 
1224 1225
 /*********************************************************************/
1225 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 1230
     u32 i;
1230 1231
     u8  chip_rev;
1231 1232
     u8 ee_data[EEPROM_SIZE];
@@ -1237,6 +1238,7 @@ static int tulip_probe ( struct dev *dev, struct pci_device *pci ) {
1237 1238
         return 0;
1238 1239
 
1239 1240
     ioaddr         = pci->ioaddr;
1241
+    pci_fill_nic ( nic, pci );
1240 1242
     nic->ioaddr    = pci->ioaddr & ~3;
1241 1243
     nic->irqno     = 0;
1242 1244
 
@@ -2074,6 +2076,7 @@ PCI_ROM(0x1737, 0xab09, "tulip-ab09",  "Tulip 0x1737 0xab09"),
2074 2076
 };
2075 2077
 
2076 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 Datei anzeigen

@@ -685,7 +685,7 @@ static int ReadMII (int byMIIIndex, int);
685 685
 static void WriteMII (char, char, char, int);
686 686
 static void MIIDelay (void);
687 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 689
 static void rhine_reset (struct nic *nic);
690 690
 static int rhine_poll (struct nic *nic, int retreive);
691 691
 static void rhine_transmit (struct nic *nic, const char *d, unsigned int t,
@@ -954,8 +954,8 @@ static struct nic_operations rhine_operations;
954 954
 static struct pci_driver rhine_driver;
955 955
 
956 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 959
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
960 960
 
961 961
     if (!pci->ioaddr)
@@ -965,6 +965,7 @@ rhine_probe ( struct dev *dev, struct pci_device *pci ) {
965 965
     adjust_pci_device ( pci );
966 966
     rhine_reset (nic);
967 967
     nic->nic_op	= &rhine_operations;
968
+    pci_fill_nic ( nic, pci );
968 969
     nic->irqno	  = pci->irq;
969 970
     nic->ioaddr   = tp->ioaddr;
970 971
     return 1;
@@ -1157,7 +1158,8 @@ rhine_probe1 (struct nic *nic, struct pci_device *pci, int ioaddr, int chip_id,
1157 1158
 }
1158 1159
 
1159 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 1163
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
1162 1164
     int ioaddr = tp->ioaddr;
1163 1165
 
@@ -1406,7 +1408,7 @@ static struct nic_operations rhine_operations = {
1406 1408
 	.poll		= rhine_poll,
1407 1409
 	.transmit	= rhine_transmit,
1408 1410
 	.irq		= rhine_irq,
1409
-	.disable	= rhine_disable,
1411
+
1410 1412
 };
1411 1413
 
1412 1414
 static struct pci_id rhine_nics[] = {
@@ -1418,8 +1420,9 @@ PCI_ROM(0x1106, 0x6100, "via-rhine-old",   "VIA 86C100A"),	/* Rhine-II */
1418 1420
 };
1419 1421
 
1420 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 1428
 /* EOF via-rhine.c */

+ 8
- 6
src/drivers/net/w89c840.c Datei anzeigen

@@ -579,7 +579,8 @@ static void w89c840_transmit(
579 579
 /**************************************************************************
580 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 584
     /* merge reset and disable */
584 585
     w89c840_reset(nic);
585 586
 
@@ -609,7 +610,7 @@ static struct nic_operations w89c840_operations = {
609 610
 	.poll		= w89c840_poll,
610 611
 	.transmit	= w89c840_transmit,
611 612
 	.irq		= w89c840_irq,
612
-	.disable	= w89c840_disable,
613
+
613 614
 };
614 615
 
615 616
 static struct pci_id w89c840_nics[] = {
@@ -618,13 +619,13 @@ PCI_ROM(0x11f6, 0x2011, "compexrl100atx", "Compex RL100ATX"),
618 619
 };
619 620
 
620 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 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 630
     u16 sum = 0;
630 631
     int i, j;
@@ -954,4 +955,5 @@ static void init_ring(void)
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 );

Laden…
Abbrechen
Speichern