Michael Brown пре 20 година
родитељ
комит
3616de915e
2 измењених фајлова са 37 додато и 30 уклоњено
  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 Прегледај датотеку

950
         }
950
         }
951
 }
951
 }
952
 
952
 
953
+static struct nic_operations rhine_operations;
954
+static struct pci_driver rhine_driver;
955
+
953
 static int
956
 static int
954
 rhine_probe ( struct dev *dev ) {
957
 rhine_probe ( struct dev *dev ) {
955
-
956
     struct nic *nic = nic_device ( dev );
958
     struct nic *nic = nic_device ( dev );
957
-
958
     struct pci_device *pci = pci_device ( dev );
959
     struct pci_device *pci = pci_device ( dev );
959
     struct rhine_private *tp = (struct rhine_private *) nic->priv_data;
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
     if (!pci->ioaddr)
965
     if (!pci->ioaddr)
961
 	return 0;
966
 	return 0;
962
     rhine_probe1 (nic, pci, pci->ioaddr, pci->dev_id, -1);
967
     rhine_probe1 (nic, pci, pci->ioaddr, pci->dev_id, -1);
963
 
968
 
964
-    adjust_pci_device(pci);
965
     rhine_reset (nic);
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
     nic->nic_op	= &rhine_operations;
970
     nic->nic_op	= &rhine_operations;
975
     nic->irqno	  = pci->irq;
971
     nic->irqno	  = pci->irq;
976
     nic->ioaddr   = tp->ioaddr;
972
     nic->ioaddr   = tp->ioaddr;
997
 {
993
 {
998
     struct rhine_private *tp;
994
     struct rhine_private *tp;
999
     static int did_version = 0;	/* Already printed version info. */
995
     static int did_version = 0;	/* Already printed version info. */
1000
-    int i, ww;
996
+    unsigned int i, ww;
1001
     unsigned int timeout;
997
     unsigned int timeout;
1002
     int FDXFlag;
998
     int FDXFlag;
1003
     int byMIIvalue, LineSpeed, MIICRbak;
999
     int byMIIvalue, LineSpeed, MIICRbak;
1410
     /*tp->tx_skbuff[entry] = 0; */
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
 static struct pci_id rhine_nics[] = {
1417
 static struct pci_id rhine_nics[] = {
1414
 PCI_ROM(0x1106, 0x3065, "dlink-530tx",     "VIA 6102"),
1418
 PCI_ROM(0x1106, 0x3065, "dlink-530tx",     "VIA 6102"),
1415
 PCI_ROM(0x1106, 0x3106, "via-rhine-6105",  "VIA 6105"),
1419
 PCI_ROM(0x1106, 0x3106, "via-rhine-6105",  "VIA 6105"),

+ 21
- 18
src/drivers/net/w89c840.c Прегледај датотеку

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
 w89c840_probe - Look for an adapter, this routine's visible to the outside
624
 w89c840_probe - Look for an adapter, this routine's visible to the outside
609
 ***************************************************************************/
625
 ***************************************************************************/
610
 static int w89c840_probe ( struct dev *dev ) {
626
 static int w89c840_probe ( struct dev *dev ) {
611
-
612
     struct nic *nic = nic_device ( dev );
627
     struct nic *nic = nic_device ( dev );
613
-
614
     struct pci_device *p = pci_device ( dev );
628
     struct pci_device *p = pci_device ( dev );
629
+
630
+    if ( ! find_pci_device ( p, &w89c840_driver ) )
631
+	    return 0;
632
+
615
     u16 sum = 0;
633
     u16 sum = 0;
616
     int i, j;
634
     int i, j;
617
     unsigned short value;
635
     unsigned short value;
698
     }
716
     }
699
 
717
 
700
     /* point to NIC specific routines */
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
     w89c840_reset(nic);
721
     w89c840_reset(nic);
711
 
722
 
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
 BOOT_DRIVER ( "W89C840F", w89c840_probe );
961
 BOOT_DRIVER ( "W89C840F", w89c840_probe );

Loading…
Откажи
Сачувај