Browse Source

Hand-finished

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
3616de915e
2 changed files with 37 additions and 30 deletions
  1. 16
    12
      src/drivers/net/via-rhine.c
  2. 21
    18
      src/drivers/net/w89c840.c

+ 16
- 12
src/drivers/net/via-rhine.c View File

@@ -950,27 +950,23 @@ void rhine_irq ( struct nic *nic, irq_action_t action ) {
950 950
         }
951 951
 }
952 952
 
953
+static struct nic_operations rhine_operations;
954
+static struct pci_driver rhine_driver;
955
+
953 956
 static int
954 957
 rhine_probe ( struct dev *dev ) {
955
-
956 958
     struct nic *nic = nic_device ( dev );
957
-
958 959
     struct pci_device *pci = pci_device ( dev );
959 960
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
961
+
962
+    if ( ! find_pci_device ( pci, &rhine_driver ) )
963
+	    return 0;
964
+
960 965
     if (!pci->ioaddr)
961 966
 	return 0;
962 967
     rhine_probe1 (nic, pci, pci->ioaddr, pci->dev_id, -1);
963 968
 
964
-    adjust_pci_device(pci);
965 969
     rhine_reset (nic);
966
-static struct nic_operations rhine_operations;
967
-static struct nic_operations rhine_operations = {
968
-	.connect	= dummy_connect,
969
-	.poll		= rhine_poll,
970
-	.transmit	= rhine_transmit,
971
-	.irq		= rhine_irq,
972
-	.disable	= rhine_disable,
973
-};
974 970
     nic->nic_op	= &rhine_operations;
975 971
     nic->irqno	  = pci->irq;
976 972
     nic->ioaddr   = tp->ioaddr;
@@ -997,7 +993,7 @@ rhine_probe1 (struct nic *nic, struct pci_device *pci, int ioaddr, int chip_id,
997 993
 {
998 994
     struct rhine_private *tp;
999 995
     static int did_version = 0;	/* Already printed version info. */
1000
-    int i, ww;
996
+    unsigned int i, ww;
1001 997
     unsigned int timeout;
1002 998
     int FDXFlag;
1003 999
     int byMIIvalue, LineSpeed, MIICRbak;
@@ -1410,6 +1406,14 @@ rhine_transmit (struct nic *nic,
1410 1406
     /*tp->tx_skbuff[entry] = 0; */
1411 1407
 }
1412 1408
 
1409
+static struct nic_operations rhine_operations = {
1410
+	.connect	= dummy_connect,
1411
+	.poll		= rhine_poll,
1412
+	.transmit	= rhine_transmit,
1413
+	.irq		= rhine_irq,
1414
+	.disable	= rhine_disable,
1415
+};
1416
+
1413 1417
 static struct pci_id rhine_nics[] = {
1414 1418
 PCI_ROM(0x1106, 0x3065, "dlink-530tx",     "VIA 6102"),
1415 1419
 PCI_ROM(0x1106, 0x3106, "via-rhine-6105",  "VIA 6105"),

+ 21
- 18
src/drivers/net/w89c840.c View File

@@ -604,14 +604,32 @@ static void w89c840_irq(struct nic *nic __unused, irq_action_t action __unused)
604 604
   }
605 605
 }
606 606
 
607
+static struct nic_operations w89c840_operations = {
608
+	.connect	= dummy_connect,
609
+	.poll		= w89c840_poll,
610
+	.transmit	= w89c840_transmit,
611
+	.irq		= w89c840_irq,
612
+	.disable	= w89c840_disable,
613
+};
614
+
615
+static struct pci_id w89c840_nics[] = {
616
+PCI_ROM(0x1050, 0x0840, "winbond840",     "Winbond W89C840F"),
617
+PCI_ROM(0x11f6, 0x2011, "compexrl100atx", "Compex RL100ATX"),
618
+};
619
+
620
+static struct pci_driver w89c840_driver =
621
+	PCI_DRIVER ( "W89C840F", w89c840_nics, PCI_NO_CLASS );
622
+
607 623
 /**************************************************************************
608 624
 w89c840_probe - Look for an adapter, this routine's visible to the outside
609 625
 ***************************************************************************/
610 626
 static int w89c840_probe ( struct dev *dev ) {
611
-
612 627
     struct nic *nic = nic_device ( dev );
613
-
614 628
     struct pci_device *p = pci_device ( dev );
629
+
630
+    if ( ! find_pci_device ( p, &w89c840_driver ) )
631
+	    return 0;
632
+
615 633
     u16 sum = 0;
616 634
     int i, j;
617 635
     unsigned short value;
@@ -698,14 +716,7 @@ static int w89c840_probe ( struct dev *dev ) {
698 716
     }
699 717
 
700 718
     /* point to NIC specific routines */
701
-static struct nic_operations w89c840_operations;
702
-static struct nic_operations w89c840_operations = {
703
-	.connect	= dummy_connect,
704
-	.poll		= w89c840_poll,
705
-	.transmit	= w89c840_transmit,
706
-	.irq		= w89c840_irq,
707
-	.disable	= w89c840_disable,
708
-};    nic->nic_op	= &w89c840_operations;
719
+    nic->nic_op	= &w89c840_operations;
709 720
 
710 721
     w89c840_reset(nic);
711 722
 
@@ -947,12 +958,4 @@ static void init_ring(void)
947 958
 }
948 959
 
949 960
 
950
-static struct pci_id w89c840_nics[] = {
951
-PCI_ROM(0x1050, 0x0840, "winbond840",     "Winbond W89C840F"),
952
-PCI_ROM(0x11f6, 0x2011, "compexrl100atx", "Compex RL100ATX"),
953
-};
954
-
955
-static struct pci_driver w89c840_driver =
956
-	PCI_DRIVER ( "W89C840F", w89c840_nics, PCI_NO_CLASS );
957
-
958 961
 BOOT_DRIVER ( "W89C840F", w89c840_probe );

Loading…
Cancel
Save