Przeglądaj źródła

3c90x driver fix (legacy) from Geert Staapers

From: Geert Stappers <stappers@stappers.nl>
To: etherboot-developers@lists.sourceforge.net
Subject: [Etherboot-developers] 3c90x polling again [patch]
Date: Thu, 29 Nov 2007 09:22:36 +0100
User-Agent: Mutt/1.5.16 (2007-06-11)

Hello,

gPXE didn't work on 3COM 905C Tornado cards for me.
It did transmit the DHCP request, but it didn't see the DHCP offer.

Adding debug print statements allready solved the problem.
Attached is a patch that has a cleaner delay then print statements.
The core of it is
-    for(i=0;i<40000;i++);
+    mdelay(1);

There was no research if the change is about a longer delay
or about code NOT being optimized away. It works for me   :-)

Cheers
Geert Stappers
tags/v0.9.3
Marty Connor 16 lat temu
rodzic
commit
9d4e4dbc32
1 zmienionych plików z 6 dodań i 4 usunięć
  1. 6
    4
      src/drivers/net/3c90x.c

+ 6
- 4
src/drivers/net/3c90x.c Wyświetl plik

34
  * v2.01    5-26-2003 NN Fixed driver alignment issue which
34
  * v2.01    5-26-2003 NN Fixed driver alignment issue which
35
  *                  caused system lockups if driver structures
35
  *                  caused system lockups if driver structures
36
  *                  not 8-byte aligned.
36
  *                  not 8-byte aligned.
37
+ * v2.02   11-28-2007 GSt Got polling working again by replacing
38
+ * 			"for(i=0;i<40000;i++);" with "mdelay(1);"
37
  *
39
  *
38
  */
40
  */
39
 
41
 
613
 static int
615
 static int
614
 a3c90x_poll(struct nic *nic, int retrieve)
616
 a3c90x_poll(struct nic *nic, int retrieve)
615
     {
617
     {
616
-    int i, errcode;
618
+    int errcode;
617
 
619
 
618
     if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0010))
620
     if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0010))
619
 	{
621
 	{
637
          INF_3C90X.IOAddr + regUpListPtr_l);
639
          INF_3C90X.IOAddr + regUpListPtr_l);
638
 
640
 
639
     /** Wait for upload completion (upComplete(15) or upError (14)) **/
641
     /** Wait for upload completion (upComplete(15) or upError (14)) **/
640
-    for(i=0;i<40000;i++);
642
+    mdelay(1);
641
     while((INF_3C90X.ReceiveUPD.UpPktStatus & ((1<<14) | (1<<15))) == 0)
643
     while((INF_3C90X.ReceiveUPD.UpPktStatus & ((1<<14) | (1<<15))) == 0)
642
-	for(i=0;i<40000;i++);
644
+    	mdelay(1);
643
 
645
 
644
     /** Check for Error (else we have good packet) **/
646
     /** Check for Error (else we have good packet) **/
645
     if (INF_3C90X.ReceiveUPD.UpPktStatus & (1<<14))
647
     if (INF_3C90X.ReceiveUPD.UpPktStatus & (1<<14))
779
 	}
781
 	}
780
 
782
 
781
     /** Print identification message **/
783
     /** Print identification message **/
782
-    printf("\n\n3C90X Driver 2.00 "
784
+    printf("\n\n3C90X Driver 2.02 "
783
            "Copyright 1999 LightSys Technology Services, Inc.\n"
785
            "Copyright 1999 LightSys Technology Services, Inc.\n"
784
            "Portions Copyright 1999 Steve Smith\n");
786
            "Portions Copyright 1999 Steve Smith\n");
785
     printf("Provided with ABSOLUTELY NO WARRANTY.\n");
787
     printf("Provided with ABSOLUTELY NO WARRANTY.\n");

Ładowanie…
Anuluj
Zapisz