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
  * The EISA probe function
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
 	enable_eisa_device ( eisa );
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
 	/* Hand off to generic t5x9 probe routine */
21
 	/* Hand off to generic t5x9 probe routine */
25
 	return t5x9_probe ( nic, ISA_PROD_ID ( PROD_ID ), ISA_PROD_ID_MASK );
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
 static struct eisa_id el3_eisa_adapters[] = {
30
 static struct eisa_id el3_eisa_adapters[] = {
29
 	{ "3Com 3c509 EtherLink III (EISA)", MFG_ID, PROD_ID },
31
 	{ "3Com 3c509 EtherLink III (EISA)", MFG_ID, PROD_ID },
30
 };
32
 };
31
 
33
 
32
 static struct eisa_driver el3_eisa_driver =
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
 ISA_ROM ( "3c509-eisa","3c509 (EISA)" );
40
 ISA_ROM ( "3c509-eisa","3c509 (EISA)" );

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

379
  */
379
  */
380
 extern int t5x9_probe ( struct nic *nic,
380
 extern int t5x9_probe ( struct nic *nic,
381
 			uint16_t prod_id_check, uint16_t prod_id_mask );
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
  * Local variables:
385
  * Local variables:

+ 5
- 8
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, struct isapnp_device *isapnp __unused ) {
568
+static void t515_disable ( struct nic *nic,
569
+			   struct isapnp_device *isapnp ) {
569
 
570
 
570
 	nic_disable ( nic );
571
 	nic_disable ( nic );
571
 
572
 
586
 
587
 
587
 
588
 
588
 	outw(SetIntrEnb | 0x0000, nic->ioaddr + EL3_CMD);
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
 	return;
592
 	return;
596
 }
593
 }
597
 
594
 
627
 
624
 
628
 	nic->ioaddr = isapnp->ioaddr;
625
 	nic->ioaddr = isapnp->ioaddr;
629
 	nic->irqno = isapnp->irqno;
626
 	nic->irqno = isapnp->irqno;
630
-	activate_isapnp_device ( isapnp, 1 );
627
+	activate_isapnp_device ( isapnp );
631
 
628
 
632
 	/* Check the resource configuration for a matching ioaddr. */
629
 	/* Check the resource configuration for a matching ioaddr. */
633
 	if ((unsigned)(inw(nic->ioaddr + 0x2002) & 0x1f0)
630
 	if ((unsigned)(inw(nic->ioaddr + 0x2002) & 0x1f0)

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

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
 	/* Retrieve NIC parameters from MCA device parameters */
25
 	/* Retrieve NIC parameters from MCA device parameters */
26
+	mca_fill_nic ( nic, mca );
27
 	nic->ioaddr = ( ( mca->pos[4] & 0xfc ) | 0x02 ) << 8;
27
 	nic->ioaddr = ( ( mca->pos[4] & 0xfc ) | 0x02 ) << 8;
28
 	nic->irqno = mca->pos[5] & 0x0f;
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
 	/* Hand off to generic t5x9 probe routine */
32
 	/* Hand off to generic t5x9 probe routine */
33
 	return t5x9_probe ( nic, MCA_ID ( mca ), 0xffff );
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
 static struct mca_id el3_mca_adapters[] = {
40
 static struct mca_id el3_mca_adapters[] = {
37
         { "3Com 3c529 EtherLink III (10base2)", 0x627c },
41
         { "3Com 3c529 EtherLink III (10base2)", 0x627c },
38
         { "3Com 3c529 EtherLink III (10baseT)", 0x627d },
42
         { "3Com 3c529 EtherLink III (10baseT)", 0x627d },
42
 };
46
 };
43
 
47
 
44
 static struct mca_driver t529_driver
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
 ISA_ROM( "3c529", "3c529 == MCA 3c509" );
54
 ISA_ROM( "3c529", "3c529 == MCA 3c509" );

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

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

Loading…
Cancel
Save