Explorar el Código

Make isa_probe_addr a simple integer rather than a struct, to facilitate

specification of ISA_PROBE_ADDRS.
tags/v0.9.3
Michael Brown hace 19 años
padre
commit
9f02376409

+ 6
- 3
src/drivers/bus/isa.c Ver fichero

13
  * instead.  Some cards (e.g. the 3c509) implement a proprietary
13
  * instead.  Some cards (e.g. the 3c509) implement a proprietary
14
  * ISAPnP-like mechanism.
14
  * ISAPnP-like mechanism.
15
  *
15
  *
16
- * The ISA probe address list can be overridden by config.c; if 
16
+ * The ISA probe address list can be overridden by config.c; if the
17
+ * user specifies ISA_PROBE_ADDRS then that list will be used first.
18
+ * (If ISA_PROBE_ADDRS ends with a zero, the driver's own list will
19
+ * never be used).
17
  */
20
  */
18
 
21
 
19
 /*
22
 /*
49
 		}
52
 		}
50
 
53
 
51
 		/* Set I/O address */
54
 		/* Set I/O address */
52
-		ioaddr = isa_extra_probe_addrs[i].addr;
55
+		ioaddr = isa_extra_probe_addrs[i];
53
 
56
 
54
 		/* An I/O address of 0 in extra_probe_addrs list means
57
 		/* An I/O address of 0 in extra_probe_addrs list means
55
 		 * stop probing (i.e. don't continue to the
58
 		 * stop probing (i.e. don't continue to the
80
 		}
83
 		}
81
 
84
 
82
 		/* Set I/O address */
85
 		/* Set I/O address */
83
-		ioaddr = driver->probe_addrs[i].addr;
86
+		ioaddr = driver->probe_addrs[i];
84
 
87
 
85
 		/* Use probe_addr method to see if there's a device
88
 		/* Use probe_addr method to see if there's a device
86
 		 * present at this address.
89
 		 * present at this address.

+ 6
- 6
src/drivers/net/cs89x0.c Ver fichero

463
 ETH_PROBE - Look for an adapter
463
 ETH_PROBE - Look for an adapter
464
 ***************************************************************************/
464
 ***************************************************************************/
465
 
465
 
466
-static int cs89x0_probe_addr ( uint16_t ioaddr ) {
466
+static int cs89x0_probe_addr ( isa_probe_addr_t ioaddr ) {
467
 	/* if they give us an odd I/O address, then do ONE write to
467
 	/* if they give us an odd I/O address, then do ONE write to
468
 	   the address port, to get it back to address zero, where we
468
 	   the address port, to get it back to address zero, where we
469
 	   expect to find the EISA signature word. */
469
 	   expect to find the EISA signature word. */
685
 	return 1;
685
 	return 1;
686
 }
686
 }
687
 	
687
 	
688
-static struct isa_probe_addr cs89x0_probe_addrs[] = { 
688
+static isa_probe_addr_t cs89x0_probe_addrs[] = { 
689
 #ifndef EMBEDDED
689
 #ifndef EMBEDDED
690
 	/* use "conservative" default values for autoprobing */
690
 	/* use "conservative" default values for autoprobing */
691
-	{ 0x300 }, { 0x320 }, { 0x340 }, { 0x200 }, { 0x220 }, { 0x240 },
692
-	{ 0x260 }, { 0x280 }, { 0x2a0 }, { 0x2c0 }, { 0x2e0 },
691
+	0x300, 0x320, 0x340, 0x200, 0x220, 0x240,
692
+	0x260, 0x280, 0x2a0, 0x2c0, 0x2e0,
693
 	/* if that did not work, then be more aggressive */
693
 	/* if that did not work, then be more aggressive */
694
-	{ 0x301 }, { 0x321 }, { 0x341 }, { 0x201 }, { 0x221 }, { 0x241 },
695
-	{ 0x261 }, { 0x281 }, { 0x2a1 }, { 0x2c1 }, { 0x2e1 },
694
+	0x301, 0x321, 0x341, 0x201, 0x221, 0x241,
695
+	0x261, 0x281, 0x2a1, 0x2c1, 0x2e1,
696
 #else
696
 #else
697
 	0x01000300,
697
 	0x01000300,
698
 #endif
698
 #endif

+ 3
- 3
src/drivers/net/depca.c Ver fichero

695
 static u8 nicsr;
695
 static u8 nicsr;
696
 
696
 
697
 
697
 
698
-static int depca_probe1 ( uint16_t ioaddr ) {
698
+static int depca_probe1 ( isa_probe_addr_t ioaddr ) {
699
 	u8	data;
699
 	u8	data;
700
 	/* This is only correct for little endian machines, but then
700
 	/* This is only correct for little endian machines, but then
701
 	   Etherboot doesn't work on anything but a PC */
701
 	   Etherboot doesn't work on anything but a PC */
787
 	return 1;
787
 	return 1;
788
 }
788
 }
789
 
789
 
790
-static struct isa_probe_addr depca_probe_addrs[] = {
791
-	{ 0x300 }, { 0x200 },
790
+static isa_probe_addr_t depca_probe_addrs[] = {
791
+	0x300, 0x200,
792
 };
792
 };
793
 
793
 
794
 static struct isa_driver depca_driver =
794
 static struct isa_driver depca_driver =

+ 3
- 5
src/drivers/net/eepro.c Ver fichero

516
 	return (retval);
516
 	return (retval);
517
 }
517
 }
518
 
518
 
519
-static int eepro_probe1 ( uint16_t ioaddr ) {
519
+static int eepro_probe1 ( isa_probe_addr_t ioaddr ) {
520
 	int		id, counter;
520
 	int		id, counter;
521
 
521
 
522
 	id = inb(ioaddr + ID_REG);
522
 	id = inb(ioaddr + ID_REG);
600
 	return 1;
600
 	return 1;
601
 }
601
 }
602
 
602
 
603
-static struct isa_probe_addr eepro_probe_addrs[] = {
604
-	{ 0x300 },
605
-	{ 0x210 }, { 0x240 }, { 0x280 }, { 0x2C0 }, { 0x200 },
606
-	{ 0x320 }, { 0x340 }, { 0x360 },
603
+static isa_probe_addr_t eepro_probe_addrs[] = {
604
+	0x300, 0x210, 0x240, 0x280, 0x2C0, 0x200, 0x320, 0x340, 0x360,
607
 };
605
 };
608
 
606
 
609
 static struct isa_driver eepro_driver =
607
 static struct isa_driver eepro_driver =

+ 3
- 3
src/drivers/net/skel.c Ver fichero

349
  *
349
  *
350
  **************************************************************************
350
  **************************************************************************
351
  */
351
  */
352
-static int skel_isa_probe_addr ( uint16_t ioaddr __unused ) {
352
+static int skel_isa_probe_addr ( isa_probe_addr_t ioaddr __unused ) {
353
 	return 0;
353
 	return 0;
354
 }
354
 }
355
 
355
 
372
 	return 1;
372
 	return 1;
373
 }
373
 }
374
 
374
 
375
-static struct isa_probe_addr skel_isa_probe_addrs[] = {
375
+static isa_probe_addr_t skel_isa_probe_addrs[] = {
376
 	/*
376
 	/*
377
-	   { 0x200 }, { 0x240 },
377
+	   0x200, 0x240,
378
 	*/
378
 	*/
379
 };
379
 };
380
 
380
 

+ 4
- 6
src/drivers/net/smc9000.c Ver fichero

108
  *
108
  *
109
  * ---------------------------------------------------------------------
109
  * ---------------------------------------------------------------------
110
  */
110
  */
111
-static int smc9000_probe_addr( unsigned short ioaddr )
111
+static int smc9000_probe_addr( isa_probe_addr_t ioaddr )
112
 {
112
 {
113
    word bank;
113
    word bank;
114
    word	revision_register;
114
    word	revision_register;
483
  * change for a slightly different card, you can add it to the array.
483
  * change for a slightly different card, you can add it to the array.
484
  *
484
  *
485
  */
485
  */
486
-static struct isa_probe_addr smc9000_probe_addrs[] = {
487
-   { 0x200 }, { 0x220 }, { 0x240 }, { 0x260 },
488
-   { 0x280 }, { 0x2A0 }, { 0x2C0 }, { 0x2E0 },
489
-   { 0x300 }, { 0x320 }, { 0x340 }, { 0x360 },
490
-   { 0x380 }, { 0x3A0 }, { 0x3C0 }, { 0x3E0 },
486
+static isa_probe_addr_t smc9000_probe_addrs[] = {
487
+   0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0,
488
+   0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0, 0x3C0, 0x3E0,
491
 };
489
 };
492
 
490
 
493
 static struct isa_driver smc9000_driver =
491
 static struct isa_driver smc9000_driver =

+ 4
- 6
src/include/isa.h Ver fichero

19
  * An individual ISA device, identified by probe address
19
  * An individual ISA device, identified by probe address
20
  *
20
  *
21
  */
21
  */
22
-struct isa_probe_addr {
23
-	uint16_t addr;
24
-} __attribute__ (( packed ));
22
+typedef uint16_t isa_probe_addr_t;
25
 
23
 
26
 /*
24
 /*
27
  * An ISA driver, with a probe address list and a probe_addr method.
25
  * An ISA driver, with a probe address list and a probe_addr method.
32
  */
30
  */
33
 struct isa_driver {
31
 struct isa_driver {
34
 	const char *name;
32
 	const char *name;
35
-	struct isa_probe_addr *probe_addrs;
33
+	isa_probe_addr_t *probe_addrs;
36
 	unsigned int addr_count;
34
 	unsigned int addr_count;
37
-	int ( * probe_addr ) ( uint16_t addr );
35
+	int ( * probe_addr ) ( isa_probe_addr_t addr );
38
 	uint16_t mfg_id;
36
 	uint16_t mfg_id;
39
 	uint16_t prod_id;
37
 	uint16_t prod_id;
40
 };
38
 };
72
  * config.c defines isa_extra_probe_addrs and isa_extra_probe_addr_count.
70
  * config.c defines isa_extra_probe_addrs and isa_extra_probe_addr_count.
73
  *
71
  *
74
  */
72
  */
75
-extern struct isa_probe_addr isa_extra_probe_addrs[];
73
+extern isa_probe_addr_t isa_extra_probe_addrs[];
76
 extern unsigned int isa_extra_probe_addr_count;
74
 extern unsigned int isa_extra_probe_addr_count;
77
 
75
 
78
 #endif /* ISA_H */
76
 #endif /* ISA_H */

Loading…
Cancelar
Guardar