Browse Source

Updated to current API.

tags/v0.9.3
Michael Brown 20 years ago
parent
commit
e596c42ade

+ 10
- 8
src/drivers/net/3c509-eisa.c View File

@@ -13,26 +13,28 @@
13 13
  * The EISA probe function
14 14
  *
15 15
  */
16
-static int el3_eisa_probe ( struct dev *dev, struct eisa_device *eisa ) {
17
-	struct nic *nic = nic_device ( dev );
16
+static int el3_eisa_probe ( struct nic *nic, struct eisa_device *eisa ) {
18 17
 	
19 18
 	enable_eisa_device ( eisa );
20
-	nic->ioaddr = eisa->ioaddr;
21
-	nic->irqno = 0;
22
-	printf ( "3C5x9 board on EISA at %#hx - ", nic->ioaddr );
19
+	eisa_fill_nic ( nic, eisa );
23 20
 
24 21
 	/* Hand off to generic t5x9 probe routine */
25 22
 	return t5x9_probe ( nic, ISA_PROD_ID ( PROD_ID ), ISA_PROD_ID_MASK );
26 23
 }
27 24
 
25
+static void el3_eisa_disable ( struct nic *nic, struct eisa_device *eisa ) {
26
+	t5x9_disable ( nic );
27
+	disable_eisa_device ( eisa );
28
+}
29
+
28 30
 static struct eisa_id el3_eisa_adapters[] = {
29 31
 	{ "3Com 3c509 EtherLink III (EISA)", MFG_ID, PROD_ID },
30 32
 };
31 33
 
32 34
 static struct eisa_driver el3_eisa_driver =
33
-	EISA_DRIVER ( "3c509 (EISA)", el3_eisa_adapters );
35
+	EISA_DRIVER ( el3_eisa_adapters );
34 36
 
35
-BOOT_DRIVER ( "3c509 (EISA)", find_eisa_boot_device, el3_eisa_driver,
36
-	      el3_eisa_probe );
37
+DRIVER ( "3c509 (EISA)", nic_driver, eisa_driver, el3_eisa_driver,
38
+	 el3_eisa_probe, el3_eisa_disable );
37 39
 
38 40
 ISA_ROM ( "3c509-eisa","3c509 (EISA)" );

+ 1
- 1
src/drivers/net/3c509.h View File

@@ -379,7 +379,7 @@
379 379
  */
380 380
 extern int t5x9_probe ( struct nic *nic,
381 381
 			uint16_t prod_id_check, uint16_t prod_id_mask );
382
-
382
+extern void t5x9_disable ( struct nic *nic );
383 383
 
384 384
 /*
385 385
  * Local variables:

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

@@ -565,7 +565,8 @@ 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, struct isapnp_device *isapnp __unused ) {
568
+static void t515_disable ( struct nic *nic,
569
+			   struct isapnp_device *isapnp ) {
569 570
 
570 571
 	nic_disable ( nic );
571 572
 
@@ -586,12 +587,8 @@ static void t515_disable ( struct nic *nic, struct isapnp_device *isapnp __unuse
586 587
 
587 588
 
588 589
 	outw(SetIntrEnb | 0x0000, nic->ioaddr + EL3_CMD);
589
-#ifdef ISA_PNP
590
-	/*Deactivate */
591
-/*    ACTIVATE;
592
-    WRITE_DATA(0);
593
-    */
594
-#endif
590
+
591
+	deactivate_isapnp_device ( isapnp );
595 592
 	return;
596 593
 }
597 594
 
@@ -627,7 +624,7 @@ static int t515_probe ( struct nic *nic, struct isapnp_device *isapnp ) {
627 624
 
628 625
 	nic->ioaddr = isapnp->ioaddr;
629 626
 	nic->irqno = isapnp->irqno;
630
-	activate_isapnp_device ( isapnp, 1 );
627
+	activate_isapnp_device ( isapnp );
631 628
 
632 629
 	/* Check the resource configuration for a matching ioaddr. */
633 630
 	if ((unsigned)(inw(nic->ioaddr + 0x2002) & 0x1f0)

+ 11
- 6
src/drivers/net/3c529.c View File

@@ -20,19 +20,23 @@
20 20
  *
21 21
  */
22 22
 
23
-static int t529_probe ( struct dev *dev, struct mca_device *mca ) {
24
-	struct nic *nic = nic_device ( dev );
23
+static int t529_probe ( struct nic *nic, struct mca_device *mca ) {
25 24
 
26 25
 	/* Retrieve NIC parameters from MCA device parameters */
26
+	mca_fill_nic ( nic, mca );
27 27
 	nic->ioaddr = ( ( mca->pos[4] & 0xfc ) | 0x02 ) << 8;
28 28
 	nic->irqno = mca->pos[5] & 0x0f;
29
-	printf ( "%s board found on MCA at %#hx IRQ %d -",
30
-		 dev->name, nic->ioaddr, nic->irqno );
29
+	printf ( "3c529 board found on MCA at %#hx IRQ %d -",
30
+		 nic->ioaddr, nic->irqno );
31 31
 
32 32
 	/* Hand off to generic t5x9 probe routine */
33 33
 	return t5x9_probe ( nic, MCA_ID ( mca ), 0xffff );
34 34
 }
35 35
 
36
+static int t529_disable ( struct nic *nic, struct mca_device *mca __unused ) {
37
+	t5x9_disable ( nic );
38
+}
39
+
36 40
 static struct mca_id el3_mca_adapters[] = {
37 41
         { "3Com 3c529 EtherLink III (10base2)", 0x627c },
38 42
         { "3Com 3c529 EtherLink III (10baseT)", 0x627d },
@@ -42,8 +46,9 @@ static struct mca_id el3_mca_adapters[] = {
42 46
 };
43 47
 
44 48
 static struct mca_driver t529_driver
45
-	= MCA_DRIVER ( "3c529", el3_mca_adapters );
49
+	= MCA_DRIVER ( el3_mca_adapters );
46 50
 
47
-BOOT_DRIVER ( "3c529", find_mca_boot_device, t529_driver, t529_probe );
51
+DRIVER ( "3c529", nic_driver, mca_driver, t529_driver,
52
+	 t529_probe, t529_disable );
48 53
 
49 54
 ISA_ROM( "3c529", "3c529 == MCA 3c509" );

+ 2
- 3
src/drivers/net/3c5x9.c View File

@@ -35,7 +35,7 @@ static enum { none, bnc, utp } connector = none;	/* for 3C509 */
35 35
 /**************************************************************************
36 36
 ETH_RESET - Reset adapter
37 37
 ***************************************************************************/
38
-static void t509_disable ( struct nic *nic ) {
38
+void t5x9_disable ( struct nic *nic ) {
39 39
 	/* stop card */
40 40
 	outw(RX_DISABLE, nic->ioaddr + EP_COMMAND);
41 41
 	outw(RX_DISCARD_TOP_PACK, nic->ioaddr + EP_COMMAND);
@@ -120,7 +120,7 @@ static void t509_enable ( struct nic *nic ) {
120 120
 }
121 121
 
122 122
 static void t509_reset ( struct nic *nic ) {
123
-	t509_disable ( nic );
123
+	t5x9_disable ( nic );
124 124
 	t509_enable ( nic );
125 125
 }    
126 126
 
@@ -332,7 +332,6 @@ struct nic_operations t509_operations = {
332 332
 	.poll		= t509_poll,
333 333
 	.transmit	= t509_transmit,
334 334
 	.irq		= t509_irq,
335
-	.disable	= t509_disable,
336 335
 };
337 336
 
338 337
 /**************************************************************************

Loading…
Cancel
Save