Browse Source

t5x9 code relies on nic->ioaddr being set

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
13137a4d61
1 changed files with 11 additions and 7 deletions
  1. 11
    7
      src/drivers/net/3c509.c

+ 11
- 7
src/drivers/net/3c509.c View File

@@ -124,7 +124,7 @@ static inline int t509_find_id_port ( void ) {
124 124
 		outb ( 0xff, t509_id_port );
125 125
 		if ( inb ( t509_id_port ) & 0x01 ) {
126 126
 			/* Found a suitable port */
127
-			DBG ( "T509 using ID port at %hx\n", t509_id_port );
127
+			DBG ( "T509 using ID port at %04x\n", t509_id_port );
128 128
 			return 0;
129 129
 		}
130 130
 	}
@@ -186,7 +186,7 @@ static int t509_isolate ( void ) {
186 186
 	int rc;
187 187
 
188 188
 	/* Find a suitable ID port */
189
-	if ( ( rc = t509_find_id_port () ) != 0 )
189
+	if ( ( rc = t509_find_id_port() ) != 0 )
190 190
 		return rc;
191 191
 
192 192
 	while ( 1 ) {
@@ -196,7 +196,7 @@ static int t509_isolate ( void ) {
196 196
 		 */
197 197
 
198 198
 		/* Send the ID sequence */
199
-		t509_send_id_sequence ();
199
+		t509_send_id_sequence();
200 200
 
201 201
 		/* First time through, reset all tags.  On subsequent
202 202
 		 * iterations, kill off any already-tagged cards
@@ -204,7 +204,7 @@ static int t509_isolate ( void ) {
204 204
 		if ( t509_max_tag == 0 ) {
205 205
 			t509_reset_tag();
206 206
 		} else {
207
-			t509_select_tag(0);
207
+			t509_select_tag ( 0 );
208 208
 		}
209 209
 	
210 210
 		/* Read the manufacturer ID, to see if there are any
@@ -274,16 +274,20 @@ static inline void deactivate_t509_device ( struct t509_device *t509 ) {
274 274
  * The ISA probe function
275 275
  *
276 276
  */
277
-static int legacy_t509_probe ( struct nic *nic, void *t509 ) {
278
-	
277
+static int legacy_t509_probe ( struct nic *nic, void *hwdev ) {
278
+	struct t509_device *t509 = hwdev;
279
+
279 280
 	/* We could change t509->ioaddr if we wanted to */
280 281
 	activate_t509_device ( t509 );
282
+	nic->ioaddr = t509->ioaddr;
281 283
 
282 284
 	/* Hand off to generic t5x9 probe routine */
283 285
 	return t5x9_probe ( nic, ISA_PROD_ID ( PROD_ID ), ISA_PROD_ID_MASK );
284 286
 }
285 287
 
286
-static void legacy_t509_disable ( struct nic *nic, void *t509 ) {
288
+static void legacy_t509_disable ( struct nic *nic, void *hwdev ) {
289
+	struct t509_device *t509 = hwdev;
290
+
287 291
 	t5x9_disable ( nic );
288 292
 	deactivate_t509_device ( t509 );
289 293
 }

Loading…
Cancel
Save