Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic getting prism2 firm ver routine to wi_get_id().
details: https://anonhg.NetBSD.org/src/rev/919eff1b1462
branches: trunk
changeset: 509894:919eff1b1462
user: ichiro <ichiro%NetBSD.org@localhost>
date: Tue May 15 09:01:27 2001 +0000
description:
getting prism2 firm ver routine to wi_get_id().
if firm ver is more than 0.8c3, promiscuous mode is off.
typo WI_RID_STA_IDENEITY -> WI_RID_STA_IDENTITY
diffstat:
sys/dev/ic/wi.c | 38 ++++++++++++++++++++++++++------------
sys/dev/ic/wi_ieee.h | 4 ++--
sys/dev/ic/wireg.h | 3 ++-
sys/dev/ic/wivar.h | 3 ++-
4 files changed, 32 insertions(+), 16 deletions(-)
diffs (149 lines):
diff -r 347d5eaa6923 -r 919eff1b1462 sys/dev/ic/wi.c
--- a/sys/dev/ic/wi.c Tue May 15 08:54:56 2001 +0000
+++ b/sys/dev/ic/wi.c Tue May 15 09:01:27 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wi.c,v 1.5 2001/05/15 04:27:22 ichiro Exp $ */
+/* $NetBSD: wi.c,v 1.6 2001/05/15 09:01:27 ichiro Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1404,13 +1404,16 @@
wi_write_record(sc, (struct wi_ltv_gen *)&sc->wi_keys);
if (sc->sc_prism2 && sc->wi_use_wep) {
/*
- * Prism firm version < ver.0.8.3
+ * Prism2 Firmware version < ver 0.8c3
* If promiscuous mode disable, Prism2 chip
* does not work with WEP .
* It is under investigation for details.
* (ichiro%netbsd.org@localhost)
*/
- WI_SETVAL(WI_RID_PROMISC, 1); /* XXX firm ver < 0.8.3 */
+ if (sc->sc_prism2_ver < 803 ) {
+ /* firm ver < 0.8c3 */
+ WI_SETVAL(WI_RID_PROMISC, 1);
+ }
WI_SETVAL(WI_RID_AUTH_CNTL, sc->wi_authtype);
}
}
@@ -1662,41 +1665,39 @@
{
struct wi_ltv_ver ver;
-#if 0
- DELAY(10*1000); /* 10 m sec */
-#endif
+ /* getting chip identity */
memset(&ver, 0, sizeof(ver));
ver.wi_type = WI_RID_CARDID;
ver.wi_len = 5;
wi_read_record(sc, (struct wi_ltv_gen *)&ver);
switch (ver.wi_ver[0]) {
case WI_NIC_EVB2:
- printf("%s: using PRISM2 HFA3841(EVB2) chip.\n",
+ printf("%s: using PRISM2 HFA3841(EVB2)",
sc->sc_dev.dv_xname);
sc->sc_prism2 = 1;
break;
case WI_NIC_HWB3763:
- printf("%s: using PRISM2 HWB3763 rev.B chip.\n",
+ printf("%s: using PRISM2 HWB3763 rev.B",
sc->sc_dev.dv_xname);
sc->sc_prism2 = 1;
break;
case WI_NIC_HWB3163:
- printf("%s: using PRISM2 HWB3163 rev.A chip.\n",
+ printf("%s: using PRISM2 HWB3163 rev.A",
sc->sc_dev.dv_xname);
sc->sc_prism2 = 1;
break;
case WI_NIC_HWB3163B:
- printf("%s: using PRISM2 HWB3163 rev.B chip.\n",
+ printf("%s: using PRISM2 HWB3163 rev.B",
sc->sc_dev.dv_xname);
sc->sc_prism2 = 1;
break;
case WI_NIC_EVB3:
- printf("%s: using PRISM2 HFA3842(EVB3) chip.\n",
+ printf("%s: using PRISM2 HFA3842(EVB3)",
sc->sc_dev.dv_xname);
sc->sc_prism2 = 1;
break;
case WI_NIC_HWB1153:
- printf("%s: using PRISM2 HFA1153 chip.\n",
+ printf("%s: using PRISM2 HFA1153",
sc->sc_dev.dv_xname);
sc->sc_prism2 = 1;
break;
@@ -1706,6 +1707,19 @@
sc->sc_prism2 = 0;
break;
}
+
+ if (sc->sc_prism2) {
+ /* try to get prism2 firm version */
+ memset(&ver, 0, sizeof(ver));
+ ver.wi_type = WI_RID_IDENT;
+ ver.wi_len = 5;
+ wi_read_record(sc, (struct wi_ltv_gen *)&ver);
+ printf(" ,Firmware Ver: %i.%i.%i \n", ver.wi_ver[1],
+ ver.wi_ver[2], ver.wi_ver[3]);
+ sc->sc_prism2_ver = ver.wi_ver[1] * 100 +
+ ver.wi_ver[2] * 10 + ver.wi_ver[3];
+ }
+
return;
}
diff -r 347d5eaa6923 -r 919eff1b1462 sys/dev/ic/wi_ieee.h
--- a/sys/dev/ic/wi_ieee.h Tue May 15 08:54:56 2001 +0000
+++ b/sys/dev/ic/wi_ieee.h Tue May 15 09:01:27 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wi_ieee.h,v 1.2 2001/05/15 04:14:06 ichiro Exp $ */
+/* $NetBSD: wi_ieee.h,v 1.3 2001/05/15 09:01:27 ichiro Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -297,7 +297,7 @@
#define WI_RID_REG_DOMAINS 0xFD11 /* list of intendted regulatory doms */
#define WI_RID_TEMP_TYPE 0xFD12 /* hw temp range code */
#define WI_RID_CIS 0xFD13 /* PC card info struct */
-#define WI_RID_STA_IDENEITY 0xFD20 /* station funcs firmware ident */
+#define WI_RID_STA_IDENTITY 0xFD20 /* station funcs firmware ident */
#define WI_RID_STA_SUP_RANGE 0xFD21 /* station supplier compat */
#define WI_RID_MFI_ACT_RANGE 0xFD22
#define WI_RID_CFI_ACT_RANGE 0xFD33
diff -r 347d5eaa6923 -r 919eff1b1462 sys/dev/ic/wireg.h
--- a/sys/dev/ic/wireg.h Tue May 15 08:54:56 2001 +0000
+++ b/sys/dev/ic/wireg.h Tue May 15 09:01:27 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wireg.h,v 1.2 2001/05/15 04:14:06 ichiro Exp $ */
+/* $NetBSD: wireg.h,v 1.3 2001/05/15 09:01:27 ichiro Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -343,6 +343,7 @@
* NIC Identification (0xFD0B)
*/
#define WI_RID_CARDID 0xFD0B
+#define WI_RID_IDENT 0xFD20
struct wi_ltv_ver {
u_int16_t wi_len;
u_int16_t wi_type;
diff -r 347d5eaa6923 -r 919eff1b1462 sys/dev/ic/wivar.h
--- a/sys/dev/ic/wivar.h Tue May 15 08:54:56 2001 +0000
+++ b/sys/dev/ic/wivar.h Tue May 15 09:01:27 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wivar.h,v 1.3 2001/05/15 04:14:06 ichiro Exp $ */
+/* $NetBSD: wivar.h,v 1.4 2001/05/15 09:01:28 ichiro Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -49,6 +49,7 @@
int sc_attached;
int sc_enabled;
int sc_prism2;
+ int sc_prism2_ver;
bus_space_tag_t sc_iot; /* bus cookie */
bus_space_handle_t sc_ioh; /* bus i/o handle */
Home |
Main Index |
Thread Index |
Old Index