Browse Source

[3c90x] Clean up reset code

Remove duplicate hardware resets, remove network interface logic
reset.

This also fixes a bug where some 3c905C variants would return bogus
EEPROM values because of a too short delay after the network reset.

Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Reported-by: Peter Huewe <peterhuewe@gmx.de>
Tested-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Thomas Miletich 13 years ago
parent
commit
72d387eac1
2 changed files with 16 additions and 15 deletions
  1. 10
    15
      src/drivers/net/3c90x.c
  2. 6
    0
      src/drivers/net/3c90x.h

+ 10
- 15
src/drivers/net/3c90x.c View File

@@ -206,7 +206,14 @@ static void a3c90x_reset(struct INF_3C90X *inf_3c90x)
206 206
 	DBGP("a3c90x_reset\n");
207 207
 	/* Send the reset command to the card */
208 208
 	DBG2("3c90x: Issuing RESET\n");
209
-	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdGlobalReset, 0);
209
+
210
+	/* reset of the receiver on B-revision cards re-negotiates the link
211
+	 * takes several seconds (a computer eternity), so we don't reset
212
+	 * it here.
213
+	 */
214
+	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr,
215
+				     cmdGlobalReset,
216
+				     globalResetMaskNetwork);
210 217
 
211 218
 	/* global reset command resets station mask, non-B revision cards
212 219
 	 * require explicit reset of values
@@ -216,26 +223,14 @@ static void a3c90x_reset(struct INF_3C90X *inf_3c90x)
216 223
 	outw(0, inf_3c90x->IOAddr + regStationMask_2_3w + 2);
217 224
 	outw(0, inf_3c90x->IOAddr + regStationMask_2_3w + 4);
218 225
 
219
-	/* Issue transmit reset, wait for command completion */
220
-	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdTxReset, 0);
221
-
222 226
 	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdTxEnable, 0);
223
-
224
-	/*
225
-	 * reset of the receiver on B-revision cards re-negotiates the link
226
-	 * takes several seconds (a computer eternity)
227
-	 */
228
-	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdRxReset,
229
-				     inf_3c90x->isBrev ? 0x04 : 0x00);
230
-
231 227
 	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr, cmdRxEnable, 0);
232 228
 
233
-	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr,
234
-				     cmdSetInterruptEnable, 0);
235
-	/* enable rxComplete and txComplete */
229
+	/* enable rxComplete and txComplete indications */
236 230
 	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr,
237 231
 				     cmdSetIndicationEnable,
238 232
 				     INT_TXCOMPLETE | INT_UPCOMPLETE);
233
+
239 234
 	/* acknowledge any pending status flags */
240 235
 	a3c90x_internal_IssueCommand(inf_3c90x->IOAddr,
241 236
 				     cmdAcknowledgeInterrupt, 0x661);

+ 6
- 0
src/drivers/net/3c90x.h View File

@@ -193,6 +193,12 @@ enum Commands {
193 193
 	cmdSetHashFilterBit = 0x19,	/*                                   */
194 194
 };
195 195
 
196
+enum GlobalResetParams {
197
+	globalResetAll = 0,
198
+	globalResetMaskNetwork = (1<<2),
199
+	globalResetMaskAll = 0x1ff,
200
+};
201
+
196 202
 enum FrameStartHeader {
197 203
 	fshTxIndicate = 0x8000,
198 204
 	fshDnComplete = 0x10000,

Loading…
Cancel
Save