Browse Source

Updated to new API.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
091a579be1
1 changed files with 12 additions and 11 deletions
  1. 12
    11
      src/drivers/net/cs89x0.c

+ 12
- 11
src/drivers/net/cs89x0.c View File

435
 	return 1;
435
 	return 1;
436
 }
436
 }
437
 
437
 
438
-static void cs89x0_disable ( struct nic *nic ) {
439
-	cs89x0_reset(nic);
440
-}
441
-
442
 static void cs89x0_irq(struct nic *nic __unused, irq_action_t action __unused)
438
 static void cs89x0_irq(struct nic *nic __unused, irq_action_t action __unused)
443
 {
439
 {
444
   switch ( action ) {
440
   switch ( action ) {
456
 	.poll		= cs89x0_poll,
452
 	.poll		= cs89x0_poll,
457
 	.transmit	= cs89x0_transmit,
453
 	.transmit	= cs89x0_transmit,
458
 	.irq		= cs89x0_irq,
454
 	.irq		= cs89x0_irq,
459
-	.disable	= cs89x0_disable,
460
 };
455
 };
461
 
456
 
462
 /**************************************************************************
457
 /**************************************************************************
480
 	return 1;
475
 	return 1;
481
 }
476
 }
482
 
477
 
483
-static int cs89x0_probe ( struct dev *dev, struct isa_device *isa ) {
484
-	struct nic *nic = nic_device ( dev );
485
-
478
+static int cs89x0_probe ( struct nic *nic, struct isa_device *isa ) {
486
 	int      i, result = -1;
479
 	int      i, result = -1;
487
 	unsigned rev_type = 0, isa_cnf, cs_revision;
480
 	unsigned rev_type = 0, isa_cnf, cs_revision;
488
 	unsigned short eeprom_buff[CHKSUM_LEN];
481
 	unsigned short eeprom_buff[CHKSUM_LEN];
489
 
482
 
490
-	nic->ioaddr = ( isa->ioaddr & ~1 );
491
-	nic->irqno  = 0;
483
+	isa_fill_nic ( nic, isa );
484
+	nic->ioaddr &= ~1; /* LSB = 1 indicates a more aggressive probe */
492
 
485
 
493
 	eth_nic_base = nic->ioaddr;
486
 	eth_nic_base = nic->ioaddr;
494
 
487
 
684
 	nic->nic_op   = &cs89x0_operations;
677
 	nic->nic_op   = &cs89x0_operations;
685
 	return 1;
678
 	return 1;
686
 }
679
 }
680
+
681
+static void cs89x0_disable ( struct nic *nic,
682
+			     struct isa_device *isa __unused ) {
683
+	cs89x0_reset(nic);
684
+}
687
 	
685
 	
688
 static isa_probe_addr_t cs89x0_probe_addrs[] = { 
686
 static isa_probe_addr_t cs89x0_probe_addrs[] = { 
689
 #ifndef EMBEDDED
687
 #ifndef EMBEDDED
699
 };
697
 };
700
 
698
 
701
 static struct isa_driver cs89x0_driver =
699
 static struct isa_driver cs89x0_driver =
702
-	ISA_DRIVER ( "CS89x0", cs89x0_probe_addrs, cs89x0_probe_addr,
700
+	ISA_DRIVER ( cs89x0_probe_addrs, cs89x0_probe_addr,
703
 		     ISAPNP_VENDOR('C','S','C'), 0x0007 );
701
 		     ISAPNP_VENDOR('C','S','C'), 0x0007 );
704
 
702
 
703
+DRIVER ( "cs89x0", nic_driver, isa_driver, cs89x0_driver,
704
+	 cs89x0_probe, cs89x0_disable );
705
+
705
 ISA_ROM ( "cs89x0", "Crystal Semiconductor CS89x0" );
706
 ISA_ROM ( "cs89x0", "Crystal Semiconductor CS89x0" );
706
 
707
 
707
 /*
708
 /*

Loading…
Cancel
Save