Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Support WI_RID_SCAN_APS (wiconfig -D) for Symbol ...
details: https://anonhg.NetBSD.org/src/rev/51bd3b00e22c
branches: trunk
changeset: 525721:51bd3b00e22c
user: onoe <onoe%NetBSD.org@localhost>
date: Tue Apr 16 07:24:06 2002 +0000
description:
Support WI_RID_SCAN_APS (wiconfig -D) for Symbol CF Card.
It apparently requires newer firmware (3.10.4), and doesn't work on
Intel PRO/Wireless 2011 (2.0.11).
diffstat:
sys/dev/ic/wi.c | 51 ++++++++++++++++++++++++++++++++++++++++-----------
sys/dev/ic/wi_ieee.h | 7 ++++++-
sys/dev/ic/wireg.h | 3 ++-
3 files changed, 48 insertions(+), 13 deletions(-)
diffs (155 lines):
diff -r f5379f882352 -r 51bd3b00e22c sys/dev/ic/wi.c
--- a/sys/dev/ic/wi.c Tue Apr 16 06:36:02 2002 +0000
+++ b/sys/dev/ic/wi.c Tue Apr 16 07:24:06 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wi.c,v 1.70 2002/04/14 19:55:23 onoe Exp $ */
+/* $NetBSD: wi.c,v 1.71 2002/04/16 07:24:06 onoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.70 2002/04/14 19:55:23 onoe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.71 2002/04/16 07:24:06 onoe Exp $");
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
@@ -527,6 +527,7 @@
switch (gen.wi_type) {
case WI_INFO_SCAN_RESULTS:
+ case WI_INFO_HOST_SCAN_RESULTS:
if (gen.wi_len <= 3) {
sc->wi_naps = 0;
sc->wi_scanning = 0;
@@ -534,18 +535,29 @@
}
switch (sc->sc_firmware_type) {
case WI_INTERSIL:
- naps = 2 * (gen.wi_len - 3) / sizeof(ap2);
+ case WI_SYMBOL:
+ if (sc->sc_firmware_type == WI_INTERSIL) {
+ naps = 2 * (gen.wi_len - 3) / sizeof(ap2);
+ /* Read Header */
+ for(j=0; j < sizeof(ap2_header) / 2; j++)
+ ((u_int16_t *)&ap2_header)[j] =
+ CSR_READ_2(sc, WI_DATA1);
+ } else { /* WI_SYMBOL */
+ naps = 2 * (gen.wi_len - 1) / (sizeof(ap2) + 6);
+ ap2_header.wi_reason = 0;
+ }
naps = naps > MAXAPINFO ? MAXAPINFO : naps;
sc->wi_naps = naps;
- /* Read Header */
- for(j=0; j < sizeof(ap2_header) / 2; j++)
- ((u_int16_t *)&ap2_header)[j] =
- CSR_READ_2(sc, WI_DATA1);
/* Read Data */
for (i=0; i < naps; i++) {
for(j=0; j < sizeof(ap2) / 2; j++)
((u_int16_t *)&ap2)[j] =
CSR_READ_2(sc, WI_DATA1);
+ if (sc->sc_firmware_type == WI_SYMBOL) {
+ /* 3 more words */
+ for (j = 0; j < 3; j++)
+ CSR_READ_2(sc, WI_DATA1);
+ }
/* unswap 8 bit data fields: */
for(j=0;j<sizeof(ap.wi_bssid)/2;j++)
LE16TOH(((u_int16_t *)&ap.wi_bssid[0])[j]);
@@ -596,9 +608,6 @@
ap.wi_namelen);
}
break;
- case WI_SYMBOL:
- /* unknown */
- break;
}
/* Done scanning */
sc->wi_scanning = 0;
@@ -647,6 +656,10 @@
#endif
break;
}
+ if (sc->sc_firmware_type == WI_SYMBOL && t == 4) {
+ wi_cmd(sc, WI_CMD_INQUIRE, WI_INFO_HOST_SCAN_RESULTS);
+ break;
+ }
/*
* Some cards issue streams of "connected" messages while
* trying to find a peer. Don't bother the user with this
@@ -699,6 +712,7 @@
break;
}
}
+
default:
#ifdef WI_DEBUG
printf("%s: got info type: 0x%04x len=0x%04x\n",
@@ -1564,10 +1578,25 @@
break;
}
if (!sc->wi_scanning) {
- if (sc->sc_firmware_type != WI_LUCENT) {
+ switch (sc->sc_firmware_type) {
+ case WI_LUCENT:
+ break;
+ case WI_INTERSIL:
wreq.wi_type = WI_RID_SCAN_REQ;
error = wi_write_record(sc,
(struct wi_ltv_gen *)&wreq);
+ break;
+ case WI_SYMBOL:
+ /*
+ * XXX only supported on 3.x ?
+ */
+ wreq.wi_type = WI_RID_BCAST_SCAN_REQ;
+ wreq.wi_val[0] =
+ BSCAN_BCAST | BSCAN_ONETIME;
+ wreq.wi_len = 2;
+ error = wi_write_record(sc,
+ (struct wi_ltv_gen *)&wreq);
+ break;
}
if (!error) {
sc->wi_scanning = 1;
diff -r f5379f882352 -r 51bd3b00e22c sys/dev/ic/wi_ieee.h
--- a/sys/dev/ic/wi_ieee.h Tue Apr 16 06:36:02 2002 +0000
+++ b/sys/dev/ic/wi_ieee.h Tue Apr 16 07:24:06 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wi_ieee.h,v 1.13 2002/03/31 05:54:19 ichiro Exp $ */
+/* $NetBSD: wi_ieee.h,v 1.14 2002/04/16 07:24:07 onoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -337,6 +337,11 @@
/*
* Scan Information
*/
+#define WI_RID_BCAST_SCAN_REQ 0xFCAB /* Broadcast Scan request (Symbol) */
+#define BSCAN_5SEC 0x01
+#define BSCAN_ONETIME 0x02
+#define BSCAN_PASSIVE 0x40
+#define BSCAN_BCAST 0x80
#define WI_RID_SCAN_REQ 0xFCE1 /* Scan request (STA only) */
#define WI_RID_JOIN_REQ 0xFCE2 /* Join request (STA only) */
#define WI_RID_AUTH_STATION 0xFCE3 /* Authenticates Station (AP) */
diff -r f5379f882352 -r 51bd3b00e22c sys/dev/ic/wireg.h
--- a/sys/dev/ic/wireg.h Tue Apr 16 06:36:02 2002 +0000
+++ b/sys/dev/ic/wireg.h Tue Apr 16 07:24:06 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wireg.h,v 1.32 2002/04/15 15:05:58 onoe Exp $ */
+/* $NetBSD: wireg.h,v 1.33 2002/04/16 07:24:07 onoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -612,6 +612,7 @@
#define WI_INFO_NOTIFY 0xF000 /* Handover address */
#define WI_INFO_COUNTERS 0xF100 /* Statistics counters */
#define WI_INFO_SCAN_RESULTS 0xF101 /* Scan results */
+#define WI_INFO_HOST_SCAN_RESULTS 0xF104 /* Scan results */
#define WI_INFO_LINK_STAT 0xF200 /* Link status */
#define WI_INFO_ASSOC_STAT 0xF201 /* Association status */
struct wi_assoc {
Home |
Main Index |
Thread Index |
Old Index