Subject: kern/14882: wi(4) don't show firmware version if it hasn't prism2 chip.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <naoki@fukaumi.org>
List: netbsd-bugs
Date: 12/09/2001 23:33:38
>Number: 14882
>Category: kern
>Synopsis: wi(4) don't show firmware version if it hasn't prism2 chip.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Dec 09 06:34:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:
>Release: NetBSD 1.5Z (2001/12/1)
>Organization:
FUKAUMI Naoki
>Environment:
NetBSD 1.5Z on {i386,hpcmips}
>Description:
When wi(4) device is attached, kernel shows some infomation about
hardware spec.
If it has prism2 (or similer one), firmware version is printed.
If it hasn't prism2 (lucent, etc), firmware version is NOT printed.
>How-To-Repeat:
Insert wi(4) device.
>Fix:
This patch is not perfect, but more useful than current code
for me. My wi card which has lucent firm works fine.
I don't know other card is O.K. or not with this change...
Index: wi.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/wi.c,v
retrieving revision 1.29
diff -u -r1.29 wi.c
--- wi.c 2001/11/13 13:14:46 1.29
+++ wi.c 2001/12/02 10:02:27
@@ -1913,24 +1913,27 @@
sc->sc_prism2 = 1;
break;
default:
- printf("Lucent chip or unknown chip\n");
+ printf("Lucent chip or unknown chip");
sc->sc_prism2 = 0;
break;
}
+ /* try to get firm version */
+ memset(&ver, 0, sizeof(ver));
+ ver.wi_type = WI_RID_STA_IDENTITY;
+ ver.wi_len = 5;
+ wi_read_record(sc, (struct wi_ltv_gen *)&ver);
+ LE16TOH(ver.wi_ver[1]);
+ LE16TOH(ver.wi_ver[2]);
+ LE16TOH(ver.wi_ver[3]);
if (sc->sc_prism2) {
- /* try to get prism2 firm version */
- memset(&ver, 0, sizeof(ver));
- ver.wi_type = WI_RID_STA_IDENTITY;
- ver.wi_len = 5;
- wi_read_record(sc, (struct wi_ltv_gen *)&ver);
- LE16TOH(ver.wi_ver[1]);
- LE16TOH(ver.wi_ver[2]);
- LE16TOH(ver.wi_ver[3]);
printf(", Firmware: %i.%i variant %i\n", ver.wi_ver[2],
ver.wi_ver[3], ver.wi_ver[1]);
sc->sc_prism2_ver = ver.wi_ver[2] * 100 +
ver.wi_ver[3] * 10 + ver.wi_ver[1];
+ } else {
+ printf(", Firmware: %i.%02i variant %i\n", ver.wi_ver[2],
+ ver.wi_ver[3], ver.wi_ver[1]);
}
return;
>Release-Note:
>Audit-Trail:
>Unformatted: