summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-10-14 01:59:57 +0000
committerimp <imp@FreeBSD.org>2002-10-14 01:59:57 +0000
commit2cf51225e1370232cb1606878600b9f10c5fd223 (patch)
tree6b4639b34c2a0e77f2c87ff6e3d463e3f4285b98
parentbfd4cfc4dcdce3760135607f6c95799431eb7367 (diff)
downloadFreeBSD-src-2cf51225e1370232cb1606878600b9f10c5fd223.zip
FreeBSD-src-2cf51225e1370232cb1606878600b9f10c5fd223.tar.gz
o Comment out the symbol download code for 4.x.
o Add hooks for doing power management of the output signal. o Minor hacks to make flexlint happy wrt staticness of functions.
-rw-r--r--sys/dev/wi/if_wavelan_ieee.h6
-rw-r--r--sys/dev/wi/if_wi.c22
-rw-r--r--sys/dev/wi/if_wi_pccard.c2
-rw-r--r--sys/dev/wi/if_wireg.h18
4 files changed, 42 insertions, 6 deletions
diff --git a/sys/dev/wi/if_wavelan_ieee.h b/sys/dev/wi/if_wavelan_ieee.h
index e350c32..8916750 100644
--- a/sys/dev/wi/if_wavelan_ieee.h
+++ b/sys/dev/wi/if_wavelan_ieee.h
@@ -50,7 +50,6 @@
#ifndef SIOCGWAVELAN
#define SIOCGWAVELAN SIOCGIFGENERIC
#endif
-#define WI_RID_MONITOR_MODE 0x0500
/*
* Technically I don't think there's a limit to a record
@@ -76,6 +75,9 @@ struct wi_req {
#define WI_RID_ZERO_CACHE 0x0300
#define WI_RID_READ_CACHE 0x0400
#define WI_RID_FWDOWNLOAD 0x0500
+#define WI_RID_MONITOR_MODE 0x0600
+#define WI_RID_MIF 0x0700
+
struct wi_80211_hdr {
u_int16_t frame_ctl;
@@ -698,8 +700,6 @@ struct wi_scan_p2_hdr {
#define SIOCSPRISM2DEBUG _IOW('i', 137, struct ifreq)
#define SIOCGPRISM2DEBUG _IOWR('i', 138, struct ifreq)
-#define WI_CMD_DEBUG 0x0038 /* prism2 debug */
-
#define WI_DEBUG_RESET 0x00
#define WI_DEBUG_INIT 0x01
#define WI_DEBUG_SLEEP 0x02
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 9fdc0c5..2ffe11f 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -142,10 +142,12 @@ static void wi_media_status(struct ifnet *, struct ifmediareq *);
static int wi_get_debug(struct wi_softc *, struct wi_req *);
static int wi_set_debug(struct wi_softc *, struct wi_req *);
+#if __FreeBSD_version >= 500000
/* support to download firmware for symbol CF card */
static int wi_symbol_write_firm(struct wi_softc *, const void *, int,
const void *, int);
static int wi_symbol_set_hcr(struct wi_softc *, int);
+#endif
devclass_t wi_devclass;
@@ -842,7 +844,7 @@ wi_txeof(sc, status)
return;
}
-void
+static void
wi_inquire(xsc)
void *xsc;
{
@@ -866,7 +868,7 @@ wi_inquire(xsc)
return;
}
-void
+static void
wi_update_stats(sc)
struct wi_softc *sc;
{
@@ -1651,6 +1653,9 @@ wi_ioctl(ifp, command, data)
{
int error = 0;
int len;
+ int s;
+ uint16_t mif;
+ uint16_t val;
u_int8_t tmpkey[14];
char tmpssid[IEEE80211_NWID_LEN];
struct wi_softc *sc;
@@ -1662,7 +1667,6 @@ wi_ioctl(ifp, command, data)
#else
struct proc *td = curproc; /* Little white lie */
#endif
- int s;
sc = ifp->if_softc;
WI_LOCK(sc, s);
@@ -1763,6 +1767,12 @@ wi_ioctl(ifp, command, data)
memcpy((char *)wreq.wi_val, (char *)sc->wi_scanbuf,
sc->wi_scanbuf_len * 2);
wreq.wi_len = sc->wi_scanbuf_len;
+ } else if (wreq.wi_type == WI_RID_MIF) {
+ mif = wreq.wi_val[0];
+ error = wi_cmd(sc, WI_CMD_READMIF, mif, 0, 0);
+ val = CSR_READ_2(sc, WI_RESP0);
+ wreq.wi_len = 2;
+ wreq.wi_val[0] = val;
} else {
if (wi_read_record(sc, (struct wi_ltv_gen *)&wreq)) {
error = EINVAL;
@@ -1799,6 +1809,10 @@ wi_ioctl(ifp, command, data)
} else if (wreq.wi_type == WI_RID_SCAN_REQ &&
sc->sc_firmware_type == WI_LUCENT) {
wi_cmd(sc, WI_CMD_INQUIRE, WI_INFO_SCAN_RESULTS, 0, 0);
+ } else if (wreq.wi_type == WI_RID_MIF) {
+ mif = wreq.wi_val[0];
+ val = wreq.wi_val[1];
+ error = wi_cmd(sc, WI_CMD_WRITEMIF, mif, val, 0);
} else {
error = wi_write_record(sc, (struct wi_ltv_gen *)&wreq);
if (!error)
@@ -3137,6 +3151,7 @@ wi_set_debug(sc, wreq)
return (error);
}
+#if __FreeBSD_version >= 500000
/*
* Special routines to download firmware for Symbol CF card.
* XXX: This should be modified generic into any PRISM-2 based card.
@@ -3273,3 +3288,4 @@ wi_symbol_set_hcr(struct wi_softc *sc, int mode)
tsleep(sc, PWAIT, "wiinit", 1);
return 0;
}
+#endif
diff --git a/sys/dev/wi/if_wi_pccard.c b/sys/dev/wi/if_wi_pccard.c
index 5ec0773..0e21691 100644
--- a/sys/dev/wi/if_wi_pccard.c
+++ b/sys/dev/wi/if_wi_pccard.c
@@ -222,6 +222,7 @@ wi_pccard_attach(device_t dev)
return (error);
}
+#if __FreeBSD_version > 500000
/*
* The cute little Symbol LA4100-series CF cards need to have
* code downloaded to them.
@@ -242,6 +243,7 @@ wi_pccard_attach(device_t dev)
return (ENXIO);
#endif
}
+#endif
return (wi_generic_attach(dev));
}
diff --git a/sys/dev/wi/if_wireg.h b/sys/dev/wi/if_wireg.h
index 548c09a..ce7a0e3 100644
--- a/sys/dev/wi/if_wireg.h
+++ b/sys/dev/wi/if_wireg.h
@@ -214,12 +214,24 @@
#define WI_CMD_NOTIFY 0x0010
#define WI_CMD_INQUIRE 0x0011
#define WI_CMD_ACCESS 0x0021
+#define WI_CMD_ACCESS_WRITE 0x0121
#define WI_CMD_PROGRAM 0x0022
#define WI_CMD_READEE 0x0030 /* symbol only */
+#define WI_CMD_READMIF 0x0030 /* prism2 */
+#define WI_CMD_WRITEMIF 0x0031 /* prism2 */
+#define WI_CMD_DEBUG 0x0038 /* Various test commands */
#define WI_CMD_CODE_MASK 0x003F
/*
+ * Various cmd test stuff.
+ */
+#define WI_TEST_MONITOR 0x0B
+#define WI_TEST_STOP 0x0F
+#define WI_TEST_CFG_BITS 0x15
+#define WI_TEST_CFG_BIT_ALC 0x08
+
+/*
* Reclaim qualifier bit, applicable to the
* TX and INQUIRE commands.
*/
@@ -664,3 +676,9 @@ struct wi_frame {
#define WI_SNAP_WORD1 (WI_SNAP_K2 | (WI_SNAP_CONTROL << 8))
#define WI_SNAPHDR_LEN 0x6
#define WI_FCS_LEN 0x4
+
+/*
+ * HFA3861/3863 (BBP) Control Registers
+ */
+#define WI_HFA386X_CR_A_D_TEST_MODES2 0x1A
+#define WI_HFA386X_CR_MANUAL_TX_POWER 0x3E
OpenPOWER on IntegriCloud