|
@@ -87,6 +87,12 @@ static inline uint8_t isapnp_read_byte ( uint8_t address ) {
|
87
|
87
|
return isapnp_read_data ();
|
88
|
88
|
}
|
89
|
89
|
|
|
90
|
+static inline uint16_t isapnp_read_word ( uint8_t address ) {
|
|
91
|
+ /* Yes, they're in big-endian order */
|
|
92
|
+ return ( ( isapnp_read_byte ( address ) << 8 )
|
|
93
|
+ + isapnp_read_byte ( address + 1 ) );
|
|
94
|
+}
|
|
95
|
+
|
90
|
96
|
static inline void isapnp_set_read_port ( void ) {
|
91
|
97
|
isapnp_write_byte ( ISAPNP_READPORT, isapnp_read_port >> 2 );
|
92
|
98
|
}
|
|
@@ -133,6 +139,14 @@ static inline void isapnp_deactivate ( uint8_t logdev ) {
|
133
|
139
|
isapnp_write_byte ( ISAPNP_ACTIVATE, 0 );
|
134
|
140
|
}
|
135
|
141
|
|
|
142
|
+static inline uint16_t isapnp_read_iobase ( unsigned int index ) {
|
|
143
|
+ return isapnp_read_word ( ISAPNP_IOBASE ( index ) );
|
|
144
|
+}
|
|
145
|
+
|
|
146
|
+static inline uint8_t isapnp_read_irqno ( unsigned int index ) {
|
|
147
|
+ return isapnp_read_byte ( ISAPNP_IRQNO ( index ) );
|
|
148
|
+}
|
|
149
|
+
|
136
|
150
|
static void isapnp_delay ( void ) {
|
137
|
151
|
udelay ( 1000 );
|
138
|
152
|
}
|
|
@@ -388,6 +402,13 @@ static int fill_isapnp_device ( struct isapnp_device *isapnp ) {
|
388
|
402
|
isapnp->vendor_id = identifier.vendor_id;
|
389
|
403
|
isapnp->prod_id = identifier.prod_id;
|
390
|
404
|
|
|
405
|
+ /* I/O addresses and IRQs are associated with logical devices,
|
|
406
|
+ * not with cards. They will be assigned when
|
|
407
|
+ * activate_isapnp_device() is called.
|
|
408
|
+ */
|
|
409
|
+ isapnp->ioaddr = 0;
|
|
410
|
+ isapnp->irqno = 0;
|
|
411
|
+
|
391
|
412
|
/* Return all cards to Wait for Key state */
|
392
|
413
|
isapnp_wait_for_key ();
|
393
|
414
|
|
|
@@ -471,7 +492,8 @@ int find_isapnp_boot_device ( struct dev *dev, struct isapnp_driver *driver ) {
|
471
|
492
|
}
|
472
|
493
|
|
473
|
494
|
/*
|
474
|
|
- * Activate a logical function on an ISAPnP device
|
|
495
|
+ * Activate a logical function on an ISAPnP device, and fill in the
|
|
496
|
+ * ioaddr and irqno fields in the isapnp struct.
|
475
|
497
|
*
|
476
|
498
|
* This routine simply activates the device in its current
|
477
|
499
|
* configuration. It does not attempt any kind of resource
|
|
@@ -488,6 +510,10 @@ void activate_isapnp_device ( struct isapnp_device *isapnp,
|
488
|
510
|
/* Select the specified logical device */
|
489
|
511
|
isapnp_activate ( logdev );
|
490
|
512
|
isapnp_delay();
|
|
513
|
+
|
|
514
|
+ /* Read the current ioaddr and irqno */
|
|
515
|
+ isapnp->ioaddr = isapnp_read_iobase ( 0 );
|
|
516
|
+ isapnp->irqno = isapnp_read_irqno ( 0 );
|
491
|
517
|
|
492
|
518
|
/* Return all cards to Wait for Key state */
|
493
|
519
|
isapnp_wait_for_key ();
|
|
@@ -498,7 +524,7 @@ void activate_isapnp_device ( struct isapnp_device *isapnp,
|
498
|
524
|
*
|
499
|
525
|
*/
|
500
|
526
|
void deactivate_isapnp_device ( struct isapnp_device *isapnp,
|
501
|
|
- uint8_t logdev ) {
|
|
527
|
+ uint8_t logdev ) {
|
502
|
528
|
/* Wake the device */
|
503
|
529
|
isapnp_wait_for_key ();
|
504
|
530
|
isapnp_send_key ();
|