summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-04-06 23:48:39 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-04-06 23:48:39 +0000
commite6c640754dcadaf3216f9bc864026ef93311152a (patch)
tree5a013fcf3b41061b72f000053fcf6d3411eea0d9 /sys/dev
parentf3b4f74459e7cca45dfa34a88554fec8f0eb24e4 (diff)
Add support for setting antenna diversity on Symbol cards.
Also add some more Symbol-specific RID values I noticed in the Linux orinoco driver.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/if_wi.c20
-rw-r--r--sys/dev/ic/if_wi_ieee.h7
-rw-r--r--sys/dev/ic/if_wireg.h4
-rw-r--r--sys/dev/ic/if_wivar.h3
4 files changed, 28 insertions, 6 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 8fa834a7c4c..a0078e5ec14 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.47 2002/04/06 21:58:12 millert Exp $ */
+/* $OpenBSD: if_wi.c,v 1.48 2002/04/06 23:48:38 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -124,7 +124,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.47 2002/04/06 21:58:12 millert Exp $";
+ "$OpenBSD: if_wi.c,v 1.48 2002/04/06 23:48:38 millert Exp $";
#endif /* lint */
#ifdef foo
@@ -229,6 +229,7 @@ wi_attach(sc)
sc->wi_max_sleep = WI_DEFAULT_MAX_SLEEP;
sc->wi_roaming = WI_DEFAULT_ROAMING;
sc->wi_authtype = WI_DEFAULT_AUTHTYPE;
+ sc->wi_diversity = WI_DEFAULT_DIVERSITY;
/*
* Read the default channel from the NIC. This may vary
@@ -1155,6 +1156,9 @@ wi_setdef(sc, wreq)
case WI_RID_ROAMING_MODE:
sc->wi_roaming = letoh16(wreq->wi_val[0]);
break;
+ case WI_RID_SYMBOL_DIVERSITY:
+ sc->wi_diversity = letoh16(wreq->wi_val[0]);
+ break;
case WI_RID_ENCRYPTION:
sc->wi_use_wep = letoh16(wreq->wi_val[0]);
break;
@@ -1320,9 +1324,15 @@ wi_ioctl(ifp, command, data)
error = wi_mgmt_xmit(sc, (caddr_t)&wreq.wi_val,
wreq.wi_len);
break;
+ case WI_RID_SYMBOL_DIVERSITY:
case WI_RID_ROAMING_MODE:
+ /* Only Symbol cards support antenna diversity */
+ if (wreq.wi_type == WI_RID_SYMBOL_DIVERSITY &&
+ sc->sc_firmware_type != WI_SYMBOL)
+ break;
/* Symbol cards use 0xFC2D for something else. */
- if (sc->sc_firmware_type == WI_SYMBOL)
+ if (wreq.wi_type == WI_RID_ROAMING_MODE &&
+ sc->sc_firmware_type == WI_SYMBOL)
break;
/* FALLTHROUGH */
default:
@@ -1448,6 +1458,10 @@ wi_init(sc)
if (sc->sc_firmware_type != WI_SYMBOL)
WI_SETVAL(WI_RID_ROAMING_MODE, sc->wi_roaming);
+ /* Set Antenna Diversity if this is a Symbol card. */
+ if (sc->sc_firmware_type == WI_SYMBOL)
+ WI_SETVAL(WI_RID_SYMBOL_DIVERSITY, sc->wi_diversity);
+
/* Specify the network name */
WI_SETSTR(WI_RID_DESIRED_SSID, sc->wi_net_name);
diff --git a/sys/dev/ic/if_wi_ieee.h b/sys/dev/ic/if_wi_ieee.h
index ac4531e3acd..4c8ba575b8d 100644
--- a/sys/dev/ic/if_wi_ieee.h
+++ b/sys/dev/ic/if_wi_ieee.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_ieee.h,v 1.5 2002/04/06 20:31:56 millert Exp $ */
+/* $OpenBSD: if_wi_ieee.h,v 1.6 2002/04/06 23:48:38 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -207,6 +207,7 @@ struct wi_counters {
#define WI_RID_MCAST_PM_BUF 0xFC17 /* PM buffering of mcast */
#define WI_RID_ENCRYPTION 0xFC20 /* enable/disable WEP */
#define WI_RID_AUTHTYPE 0xFC21 /* specify authentication type */
+#define WI_RID_SYMBOL_MANDATORYBSSID 0xFC21
#define WI_RID_P2_TX_CRYPT_KEY 0xFC23
#define WI_RID_P2_CRYPT_KEY0 0xFC24
#define WI_RID_P2_CRYPT_KEY1 0xFC25
@@ -224,9 +225,13 @@ struct wi_counters {
#define HOST_DECRYPT 0x80
#define WI_RID_WEP_MAPTABLE 0xFC29
#define WI_RID_CNFAUTHMODE 0xFC2A
+#define WI_RID_SYMBOL_KEYLENGTH 0xFC2B
+#define WI_RID_SYMBOL_PREAMBLE 0xFC2C /* Enable/disable short preamble */
#define WI_RID_ROAMING_MODE 0xFC2D /* Roaming mode (1:firm,3:disable) */
#define WI_RID_BASIC_RATE 0xFCB3
#define WI_RID_SUPPORT_RATE 0xFCB4
+#define WI_RID_SYMBOL_DIVERSITY 0xFC87 /* Symbol antenna diversity */
+#define WI_RID_SYMBOL_BASIC_RATE 0xFC90
/*
* Network parameters, dynamic configuration entities
diff --git a/sys/dev/ic/if_wireg.h b/sys/dev/ic/if_wireg.h
index b9aee89668e..21301dd8a42 100644
--- a/sys/dev/ic/if_wireg.h
+++ b/sys/dev/ic/if_wireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wireg.h,v 1.17 2002/04/06 20:31:56 millert Exp $ */
+/* $OpenBSD: if_wireg.h,v 1.18 2002/04/06 23:48:38 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -76,6 +76,8 @@
#define WI_DEFAULT_AUTHTYPE 1
+#define WI_DEFAULT_DIVERSITY 0
+
/*
* register space access macros
*/
diff --git a/sys/dev/ic/if_wivar.h b/sys/dev/ic/if_wivar.h
index 73a54871165..3cfd244dd30 100644
--- a/sys/dev/ic/if_wivar.h
+++ b/sys/dev/ic/if_wivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wivar.h,v 1.7 2002/04/06 20:31:56 millert Exp $ */
+/* $OpenBSD: if_wivar.h,v 1.8 2002/04/06 23:48:38 millert Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -65,6 +65,7 @@ struct wi_softc {
u_int16_t wi_authtype;
u_int16_t wi_roaming;
u_int16_t wi_supprates;
+ u_int16_t wi_diversity;
struct ieee80211_nwid wi_node_name;
struct ieee80211_nwid wi_net_name;