From owner-p4-projects@FreeBSD.ORG Mon Sep 15 16:32:29 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CA90316A4C0; Mon, 15 Sep 2003 16:32:28 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E5C116A4B3 for ; Mon, 15 Sep 2003 16:32:28 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E99043F3F for ; Mon, 15 Sep 2003 16:32:27 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h8FNWR0U098289 for ; Mon, 15 Sep 2003 16:32:27 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h8FNWQ9r098286 for perforce@freebsd.org; Mon, 15 Sep 2003 16:32:26 -0700 (PDT) Date: Mon, 15 Sep 2003 16:32:26 -0700 (PDT) Message-Id: <200309152332.h8FNWQ9r098286@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 38101 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2003 23:32:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=38101 Change 38101 by marcel@marcel_nfs on 2003/09/15 16:32:13 IFC @38099 Affected files ... .. //depot/projects/uart/amd64/amd64/pmap.c#16 integrate .. //depot/projects/uart/amd64/conf/GENERIC#4 integrate .. //depot/projects/uart/boot/forth/beastie.4th#2 integrate .. //depot/projects/uart/cam/scsi/scsi_sa.c#2 integrate .. //depot/projects/uart/coda/coda_vfsops.c#3 integrate .. //depot/projects/uart/conf/files#24 integrate .. //depot/projects/uart/dev/acpica/acpi.c#10 integrate .. //depot/projects/uart/dev/acpica/acpi_acad.c#4 integrate .. //depot/projects/uart/dev/acpica/acpi_cmbat.c#5 integrate .. //depot/projects/uart/dev/acpica/acpi_ec.c#9 integrate .. //depot/projects/uart/dev/acpica/acpiio.h#4 integrate .. //depot/projects/uart/dev/ath/if_ath.c#10 integrate .. //depot/projects/uart/dev/ath/if_athvar.h#6 integrate .. //depot/projects/uart/dev/isp/isp.c#4 integrate .. //depot/projects/uart/dev/isp/isp_freebsd.c#3 integrate .. //depot/projects/uart/dev/isp/isp_freebsd.h#2 integrate .. //depot/projects/uart/dev/isp/isp_inline.h#2 integrate .. //depot/projects/uart/dev/isp/isp_target.c#2 integrate .. //depot/projects/uart/dev/isp/isp_target.h#2 integrate .. //depot/projects/uart/dev/isp/isp_tpublic.h#2 integrate .. //depot/projects/uart/dev/isp/ispvar.h#2 integrate .. //depot/projects/uart/dev/pci/pci.c#10 integrate .. //depot/projects/uart/dev/pci/pcireg.h#6 integrate .. //depot/projects/uart/dev/pci/pcivar.h#3 integrate .. //depot/projects/uart/dev/re/if_re.c#3 integrate .. //depot/projects/uart/dev/sio/sio.c#6 integrate .. //depot/projects/uart/dev/sound/pci/ich.c#9 integrate .. //depot/projects/uart/dev/uart/uart_bus_pccard.c#1 branch .. //depot/projects/uart/dev/uart/uart_dev_ns8250.c#28 integrate .. //depot/projects/uart/i386/i386/pmap.c#17 integrate .. //depot/projects/uart/kern/kern_prot.c#4 integrate .. //depot/projects/uart/kern/kern_xxx.c#3 integrate .. //depot/projects/uart/kern/vfs_bio.c#6 integrate .. //depot/projects/uart/modules/uart/Makefile#8 integrate .. //depot/projects/uart/net/if_iso88025subr.c#2 integrate .. //depot/projects/uart/net80211/ieee80211.c#5 integrate .. //depot/projects/uart/net80211/ieee80211.h#2 integrate .. //depot/projects/uart/net80211/ieee80211_input.c#5 integrate .. //depot/projects/uart/net80211/ieee80211_ioctl.c#4 integrate .. //depot/projects/uart/net80211/ieee80211_node.c#6 integrate .. //depot/projects/uart/net80211/ieee80211_output.c#5 integrate .. //depot/projects/uart/net80211/ieee80211_var.h#4 integrate .. //depot/projects/uart/netinet6/in6_ifattach.c#2 integrate .. //depot/projects/uart/netinet6/nd6.c#3 integrate .. //depot/projects/uart/netinet6/nd6_nbr.c#2 integrate .. //depot/projects/uart/pc98/pc98/fd.c#4 integrate .. //depot/projects/uart/pci/if_rlreg.h#8 integrate .. //depot/projects/uart/pci/if_xl.c#8 integrate .. //depot/projects/uart/pci/if_xlreg.h#3 integrate .. //depot/projects/uart/posix4/ksched.c#2 integrate .. //depot/projects/uart/vm/vm_kern.c#6 integrate .. //depot/projects/uart/vm/vm_object.c#5 integrate Differences ... ==== //depot/projects/uart/amd64/amd64/pmap.c#16 (text+ko) ==== @@ -73,7 +73,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.436 2003/09/12 07:07:48 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.437 2003/09/13 21:57:38 alc Exp $"); /* * Manages physical address maps. @@ -986,10 +986,6 @@ if (va >= VM_MAXUSER_ADDRESS) return 0; - if (mpte == NULL) { - mpte = PHYS_TO_VM_PAGE(*pmap_pde(pmap, va)); - } - return pmap_unwire_pte_hold(pmap, va, mpte); } @@ -1467,7 +1463,7 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t va) { pt_entry_t oldpte; - vm_page_t m; + vm_page_t m, mpte; oldpte = pte_load_clear(ptq); if (oldpte & PG_W) @@ -1496,10 +1492,9 @@ vm_page_flag_set(m, PG_REFERENCED); return pmap_remove_entry(pmap, m, va); } else { - return pmap_unuse_pt(pmap, va, NULL); + mpte = PHYS_TO_VM_PAGE(*pmap_pde(pmap, va)); + return pmap_unuse_pt(pmap, va, mpte); } - - return 0; } /* ==== //depot/projects/uart/amd64/conf/GENERIC#4 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.394 2003/09/10 18:54:58 obrien Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.395 2003/09/15 22:40:00 obrien Exp $ machine amd64 cpu HAMMER @@ -249,3 +249,5 @@ device firewire # FireWire bus code device sbp # SCSI over FireWire (Requires scbus and da) device fwe # Ethernet over FireWire (non-standard!) + +device pcm # Sound ==== //depot/projects/uart/boot/forth/beastie.4th#2 (text+ko) ==== @@ -1,4 +1,5 @@ \ Copyright (c) 2003 Scott Long +\ Copyright (c) 2003 Aleksander Fafula \ All rights reserved. \ \ Redistribution and use in source and binary forms, with or without @@ -22,7 +23,7 @@ \ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF \ SUCH DAMAGE. \ -\ $FreeBSD: src/sys/boot/forth/beastie.4th,v 1.4 2003/06/10 22:04:09 scottl Exp $ +\ $FreeBSD: src/sys/boot/forth/beastie.4th,v 1.5 2003/09/13 18:35:01 scottl Exp $ marker task-beastie.4th @@ -48,7 +49,29 @@ 46 constant dot \ The BSD Daemon. He is 19 rows high and 34 columns wide -: print-beastie ( x y -- ) +: technicolor-beastie ( x y -- ) +2dup at-xy ." , ," 1+ +2dup at-xy ." /( )`" 1+ +2dup at-xy ." \ \___ / |" 1+ +2dup at-xy ." /- _ `-/ '" 1+ +2dup at-xy ." (/\/ \ \ /\" 1+ +2dup at-xy ." / / | ` \" 1+ +2dup at-xy ." O O ) / |" 1+ +2dup at-xy ." `-^--'`< '" 1+ +2dup at-xy ." (_.) _ ) /" 1+ +2dup at-xy ." `.___/` / " 1+ +2dup at-xy ." `-----' /" 1+ +2dup at-xy ." <----. __ / __ \" 1+ +2dup at-xy ." <----|====O)))==) \) /====|" 1+ +2dup at-xy ." <----' `--' `.__,' \" 1+ +2dup at-xy ." | |" 1+ +2dup at-xy ." \ / /\" 1+ +2dup at-xy ." ______( (_ / \______/" 1+ +2dup at-xy ." ,' ,-----' |" 1+ +at-xy ." `--{__________) " 1+ +; + +: boring-beastie ( x y -- ) 2dup at-xy ." , ," 1+ 2dup at-xy ." /( )`" 1+ 2dup at-xy ." \ \___ / |" 1+ @@ -70,6 +93,20 @@ at-xy ." `--{__________)" ; +: print-beastie ( x y -- ) + s" loader_color" getenv + dup -1 = if + drop + boring-beastie + exit + then + s" YES" compare-insensitive 0<> if + boring-beastie + exit + then + technicolor-beastie +; + : acpienabled? ( -- flag ) s" acpi_load" getenv dup -1 = if ==== //depot/projects/uart/cam/scsi/scsi_sa.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.96 2003/06/10 18:14:05 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_sa.c,v 1.97 2003/09/13 02:01:56 mjacob Exp $"); #include #include @@ -2765,8 +2765,10 @@ /* set the speed to the current value */ mode_hdr->dev_spec = current_speed; - /* set single-initiator buffering mode */ - mode_hdr->dev_spec |= SMH_SA_BUF_MODE_SIBUF; + /* if set, set single-initiator buffering mode */ + if (softc->buffer_mode == SMH_SA_BUF_MODE_SIBUF) { + mode_hdr->dev_spec |= SMH_SA_BUF_MODE_SIBUF; + } if (mode_blk) mode_hdr->blk_desc_len = sizeof(struct scsi_mode_blk_desc); ==== //depot/projects/uart/coda/coda_vfsops.c#3 (text+ko) ==== @@ -41,7 +41,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/coda/coda_vfsops.c,v 1.46 2003/09/07 07:43:09 tjr Exp $"); +__FBSDID("$FreeBSD: src/sys/coda/coda_vfsops.c,v 1.47 2003/09/13 01:13:56 tjr Exp $"); #include @@ -253,7 +253,9 @@ ASSERT_VOP_LOCKED(mi->mi_rootvp, "coda_unmount"); mi->mi_rootvp->v_vflag &= ~VV_ROOT; error = vflush(mi->mi_vfsp, 0, FORCECLOSE); +#ifdef CODA_VERBOSE printf("coda_unmount: active = %d, vflush active %d\n", active, error); +#endif error = 0; /* I'm going to take this out to allow lookups to go through. I'm * not sure it's important anyway. -- DCS 2/2/94 ==== //depot/projects/uart/conf/files#24 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.824 2003/09/11 03:53:46 wpaul Exp $ +# $FreeBSD: src/sys/conf/files,v 1.825 2003/09/14 17:02:59 takawata Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -790,6 +790,7 @@ dev/uart/uart_bus_ebus.c optional uart ebus dev/uart/uart_bus_isa.c optional uart isa #dev/uart/uart_bus_cbus.c optional uart cbus +dev/uart/uart_bus_pccard.c optional uart pccard dev/uart/uart_bus_pci.c optional uart cardbus dev/uart/uart_bus_pci.c optional uart pci dev/uart/uart_bus_puc.c optional uart puc ==== //depot/projects/uart/dev/acpica/acpi.c#10 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.99 2003/09/09 04:09:25 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.100 2003/09/15 06:29:31 njl Exp $ */ #include "opt_acpi.h" @@ -431,7 +431,6 @@ */ sc->acpi_sleep_delay = 5; sc->acpi_disable_on_poweroff = 1; - sc->acpi_s4bios = 1; if (bootverbose) sc->acpi_verbose = 1; if ((env = getenv("hw.acpi.verbose")) && strcmp(env, "0")) { @@ -439,6 +438,10 @@ freeenv(env); } + /* Only enable S4BIOS by default if the FACS says it is available. */ + if (AcpiGbl_FACS->S4Bios_f != 0) + sc->acpi_s4bios = 1; + /* * Dispatch the default sleep state to devices. * TBD: should be configured from userland policy manager. @@ -1980,10 +1983,12 @@ break; } state = *(int *)addr; - if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) - acpi_SetSleepState(sc, state); - else + if (state >= ACPI_STATE_S0 && state <= ACPI_S_STATES_MAX) { + if (ACPI_FAILURE(acpi_SetSleepState(sc, state))) + error = EINVAL; + } else { error = EINVAL; + } break; default: if (error == 0) ==== //depot/projects/uart/dev/acpica/acpi_acad.c#4 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_acad.c,v 1.17 2003/08/15 06:33:11 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_acad.c,v 1.18 2003/09/14 17:47:44 njl Exp $ */ #include "opt_acpi.h" @@ -117,7 +117,7 @@ device_t dev = context; ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev), - "Notify %d\n", notify); + "Notify 0x%x\n", notify); switch (notify) { case ACPI_DEVICE_CHECK_PNP: ==== //depot/projects/uart/dev/acpica/acpi_cmbat.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.23 2003/09/11 03:17:33 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.24 2003/09/13 20:13:01 njl Exp $ */ #include "opt_acpi.h" @@ -264,7 +264,7 @@ goto end; } - PKG_GETINT(res, tmp, 0, sc->bif.unit, end); + PKG_GETINT(res, tmp, 0, sc->bif.units, end); PKG_GETINT(res, tmp, 1, sc->bif.dcap, end); PKG_GETINT(res, tmp, 2, sc->bif.lfcap, end); PKG_GETINT(res, tmp, 3, sc->bif.btech, end); @@ -404,7 +404,7 @@ case ACPIIO_CMBAT_GET_BIF: acpi_cmbat_get_bif(dev); bifp = &ioctl_arg->bif; - bifp->unit = sc->bif.unit; + bifp->units = sc->bif.units; bifp->dcap = sc->bif.dcap; bifp->lfcap = sc->bif.lfcap; bifp->btech = sc->bif.btech; ==== //depot/projects/uart/dev/acpica/acpi_ec.c#9 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.39 2003/08/24 17:48:01 obrien Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.40 2003/09/15 21:20:55 njl Exp $ */ /****************************************************************************** * @@ -137,7 +137,7 @@ *****************************************************************************/ #include -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.39 2003/08/24 17:48:01 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.40 2003/09/15 21:20:55 njl Exp $"); #include "opt_acpi.h" #include @@ -283,7 +283,7 @@ #define EC_POLL_DELAY 1 /* Total time in ms spent in the poll loop waiting for a response. */ -#define EC_POLL_TIMEOUT 50 +#define EC_POLL_TIMEOUT 100 #define EVENT_READY(event, status) \ (((event) == EC_EVENT_OUTPUT_BUFFER_FULL && \ ==== //depot/projects/uart/dev/acpica/acpiio.h#4 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpiio.h,v 1.8 2003/08/28 16:06:30 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpiio.h,v 1.9 2003/09/13 20:13:01 njl Exp $ */ /* @@ -50,10 +50,10 @@ #define ACPI_CMBAT_MAXSTRLEN 32 struct acpi_bif { - u_int32_t unit; /* 0 for mWh, 1 for mAh */ + u_int32_t units; /* 0 for mWh, 1 for mAh */ u_int32_t dcap; /* Design Capacity */ u_int32_t lfcap; /* Last Full capacity */ - u_int32_t btech; /* Battery Technorogy */ + u_int32_t btech; /* Battery Technology */ u_int32_t dvol; /* Design voltage (mV) */ u_int32_t wcap; /* WARN capacity */ u_int32_t lcap; /* Low capacity */ ==== //depot/projects/uart/dev/ath/if_ath.c#10 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.14 2003/09/05 22:22:49 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.18 2003/09/15 22:34:46 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -114,6 +114,8 @@ static void ath_node_free(struct ieee80211com *, struct ieee80211_node *); static void ath_node_copy(struct ieee80211com *, struct ieee80211_node *, const struct ieee80211_node *); +static u_int8_t ath_node_getrssi(struct ieee80211com *, + struct ieee80211_node *); static int ath_rxbuf_init(struct ath_softc *, struct ath_buf *); static void ath_rx_proc(void *, int); static int ath_tx_start(struct ath_softc *, struct ieee80211_node *, @@ -279,10 +281,7 @@ ic->ic_phytype = IEEE80211_T_OFDM; ic->ic_opmode = IEEE80211_M_STA; ic->ic_caps = IEEE80211_C_WEP | IEEE80211_C_IBSS | IEEE80211_C_HOSTAP - | IEEE80211_C_MONITOR; - /* NB: 11g support is identified when we fetch the channel set */ - if (sc->sc_have11g) - ic->ic_caps |= IEEE80211_C_SHPREAMBLE; + | IEEE80211_C_MONITOR | IEEE80211_C_SHPREAMBLE; /* get mac address from hardware */ ath_hal_getmac(ah, ic->ic_myaddr); @@ -293,6 +292,7 @@ ic->ic_node_alloc = ath_node_alloc; ic->ic_node_free = ath_node_free; ic->ic_node_copy = ath_node_copy; + ic->ic_node_getrssi = ath_node_getrssi; sc->sc_newstate = ic->ic_newstate; ic->ic_newstate = ath_newstate; /* complete initialization */ @@ -406,6 +406,7 @@ ath_hal_dumpstate(ah); } #endif /* AR_DEBUG */ + status &= sc->sc_imask; /* discard unasked for bits */ if (status & HAL_INT_FATAL) { sc->sc_stats.ast_hardware++; ath_hal_intrset(ah, 0); /* disable intr's until reset */ @@ -765,13 +766,6 @@ } } - /* - * TODO: - * The duration field of 802.11 header should be filled. - * XXX This may be done in the ieee80211 layer, but the upper - * doesn't know the detail of parameters such as IFS - * for now.. - */ if (ath_tx_start(sc, ni, bf, m)) { bad: mtx_lock(&sc->sc_txbuflock); @@ -931,7 +925,8 @@ if (ic->ic_opmode != IEEE80211_M_HOSTAP && (ifp->if_flags & IFF_PROMISC)) rfilt |= HAL_RX_FILTER_PROM; - if (ic->ic_state == IEEE80211_S_SCAN) + if (ic->ic_opmode == IEEE80211_M_STA || + ic->ic_state == IEEE80211_S_SCAN) rfilt |= HAL_RX_FILTER_BEACON; ath_hal_setrxfilter(ah, rfilt); @@ -1045,7 +1040,8 @@ capinfo = IEEE80211_CAPINFO_ESS; if (ic->ic_flags & IEEE80211_F_WEPON) capinfo |= IEEE80211_CAPINFO_PRIVACY; - if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) + if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE; if (ic->ic_flags & IEEE80211_F_SHSLOT) capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME; @@ -1395,7 +1391,14 @@ { struct ath_node *an = malloc(sizeof(struct ath_node), M_DEVBUF, M_NOWAIT | M_ZERO); - return an ? &an->an_node : NULL; + if (an) { + int i; + for (i = 0; i < ATH_RHIST_SIZE; i++) + an->an_rx_hist[i].arh_ticks = ATH_RHIST_NOTIME; + an->an_rx_hist_next = ATH_RHIST_SIZE-1; + return &an->an_node; + } else + return NULL; } static void @@ -1418,6 +1421,41 @@ *(struct ath_node *)dst = *(const struct ath_node *)src; } + +static u_int8_t +ath_node_getrssi(struct ieee80211com *ic, struct ieee80211_node *ni) +{ + struct ath_node *an = ATH_NODE(ni); + int i, now, nsamples, rssi; + + /* + * Calculate the average over the last second of sampled data. + */ + now = ticks; + nsamples = 0; + rssi = 0; + i = an->an_rx_hist_next; + do { + struct ath_recv_hist *rh = &an->an_rx_hist[i]; + if (rh->arh_ticks == ATH_RHIST_NOTIME) + goto done; + if (now - rh->arh_ticks > hz) + goto done; + rssi += rh->arh_rssi; + nsamples++; + if (i == 0) + i = ATH_RHIST_SIZE-1; + else + i--; + } while (i != an->an_rx_hist_next); +done: + /* + * Return either the average or the last known + * value if there is no recent data. + */ + return (nsamples ? rssi / nsamples : an->an_rx_hist[i].arh_rssi); +} + static int ath_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) { @@ -1486,6 +1524,8 @@ struct mbuf *m; struct ieee80211_frame *wh, whbuf; struct ieee80211_node *ni; + struct ath_node *an; + struct ath_recv_hist *rh; int len; u_int phyerr; HAL_STATUS status; @@ -1528,7 +1568,7 @@ } len = ds->ds_rxstat.rs_datalen; - if (len < sizeof(struct ieee80211_frame)) { + if (len < IEEE80211_MIN_LEN) { DPRINTF(("ath_rx_proc: short packet %d\n", len)); sc->sc_stats.ast_rx_tooshort++; goto rx_next; @@ -1537,18 +1577,6 @@ bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_POSTREAD); - wh = mtod(m, struct ieee80211_frame *); - if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == - IEEE80211_FC0_TYPE_CTL && - ic->ic_opmode != IEEE80211_M_MONITOR) { - /* - * Discard control frame when not in monitor mode. - */ - DPRINTF(("ath_rx_proc: control frame\n")); - sc->sc_stats.ast_rx_ctl++; - goto rx_next; - } - bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); bf->bf_m = NULL; m->m_pkthdr.rcvif = ifp; @@ -1579,6 +1607,7 @@ } m_adj(m, -IEEE80211_CRC_LEN); + wh = mtod(m, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_WEP) { /* * WEP is decrypted by hardware. Clear WEP bit @@ -1607,12 +1636,24 @@ ni = ieee80211_ref_node(ic->ic_bss); } else ni = ieee80211_ref_node(ic->ic_bss); - ATH_NODE(ni)->an_rx_antenna = ds->ds_rxstat.rs_antenna; + + /* + * Record driver-specific state. + */ + an = ATH_NODE(ni); + if (++(an->an_rx_hist_next) == ATH_RHIST_SIZE) + an->an_rx_hist_next = 0; + rh = &an->an_rx_hist[an->an_rx_hist_next]; + rh->arh_ticks = ticks; + rh->arh_rssi = ds->ds_rxstat.rs_rssi; + rh->arh_antenna = ds->ds_rxstat.rs_antenna; + /* * Send frame up for processing. */ ieee80211_input(ifp, m, ni, ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); + /* * The frame may have caused the node to be marked for * reclamation (e.g. in response to a DEAUTH message) @@ -1797,7 +1838,8 @@ * use short preamble based on the current mode and * negotiated parameters. */ - if (ic->ic_flags & IEEE80211_F_SHPREAMBLE) { + if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && + (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE)) { txrate = rt->info[rix].rateCode | rt->info[rix].shortPreamble; shortPreamble = AH_TRUE; sc->sc_stats.ast_tx_shortpre++; @@ -1819,6 +1861,21 @@ } /* + * Calculate duration. This logically belongs in the 802.11 + * layer but it lacks sufficient information to calculate it. + */ + if ((flags & HAL_TXDESC_NOACK) == 0 && + (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_CTL) { + u_int16_t dur; + /* + * XXX not right with fragmentation. + */ + dur = ath_hal_computetxtime(ah, rt, IEEE80211_ACK_SIZE, + rix, shortPreamble); + *((u_int16_t*) wh->i_dur) = htole16(dur); + } + + /* * Calculate RTS/CTS rate and duration if needed. */ ctsduration = 0; @@ -1862,7 +1919,7 @@ if (an->an_tx_antenna) antenna = an->an_tx_antenna; else - antenna = an->an_rx_antenna; + antenna = an->an_rx_hist[an->an_rx_hist_next].arh_antenna; /* * Formulate first tx descriptor with tx controls. @@ -2291,11 +2348,13 @@ if (ic->ic_opmode != IEEE80211_M_HOSTAP && (ifp->if_flags & IFF_PROMISC)) rfilt |= HAL_RX_FILTER_PROM; + if (ic->ic_opmode == IEEE80211_M_STA || + ic->ic_state == IEEE80211_S_SCAN) + rfilt |= HAL_RX_FILTER_BEACON; if (nstate == IEEE80211_S_SCAN) { callout_reset(&sc->sc_scan_ch, (hz * ath_dwelltime) / 1000, ath_next_scan, sc); bssid = ifp->if_broadcastaddr; - rfilt |= HAL_RX_FILTER_BEACON; } else { callout_stop(&sc->sc_scan_ch); bssid = ni->ni_bssid; @@ -2395,7 +2454,6 @@ HAL_CHANNEL *chans; int i, ix, nchan; - sc->sc_have11g = 0; chans = malloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL), M_TEMP, M_NOWAIT); if (chans == NULL) { @@ -2429,8 +2487,6 @@ /* channels overlap; e.g. 11g and 11b */ ic->ic_channels[ix].ic_flags |= c->channelFlags; } - if ((c->channelFlags & CHANNEL_G) == CHANNEL_G) - sc->sc_have11g = 1; } free(chans, M_TEMP); return 0; ==== //depot/projects/uart/dev/ath/if_athvar.h#6 (text+ko) ==== @@ -33,7 +33,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES. * - * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.6 2003/09/05 22:22:49 sam Exp $ + * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.8 2003/09/15 22:34:46 sam Exp $ */ /* @@ -54,6 +54,14 @@ #define ATH_TXBUF 60 /* number of TX buffers */ #define ATH_TXDESC 8 /* number of descriptors per buffer */ +struct ath_recv_hist { + int arh_ticks; /* sample time by system clock */ + u_int8_t arh_rssi; /* rssi */ + u_int8_t arh_antenna; /* antenna */ +}; +#define ATH_RHIST_SIZE 16 /* number of samples */ +#define ATH_RHIST_NOTIME (~0) + /* driver-specific node */ struct ath_node { struct ieee80211_node an_node; /* base class */ @@ -63,6 +71,8 @@ int an_tx_upper; /* tx upper rate req cnt */ u_int an_tx_antenna; /* antenna for last good frame */ u_int an_rx_antenna; /* antenna for last rcvd frame */ + struct ath_recv_hist an_rx_hist[ATH_RHIST_SIZE]; + u_int an_rx_hist_next;/* index of next ``free entry'' */ }; #define ATH_NODE(_n) ((struct ath_node *)(_n)) @@ -90,7 +100,6 @@ struct mtx sc_mtx; /* master lock (recursive) */ struct ath_hal *sc_ah; /* Atheros HAL */ unsigned int sc_invalid : 1,/* disable hardware accesses */ - sc_have11g : 1,/* have 11g support */ sc_doani : 1,/* dynamic noise immunity */ sc_probing : 1;/* probing AP on beacon miss */ /* rate tables */ ==== //depot/projects/uart/dev/isp/isp.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp.c,v 1.107 2003/08/25 17:58:23 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp.c,v 1.108 2003/09/13 01:55:44 mjacob Exp $ */ /* * Machine and OS Independent (well, as best as possible) * code for the Qlogic ISP SCSI adapters. @@ -1249,6 +1249,17 @@ icbp->icb_retry_delay = fcp->isp_retry_delay; icbp->icb_retry_count = fcp->isp_retry_count; icbp->icb_hardaddr = loopid; + if (icbp->icb_hardaddr >= 125) { + /* + * We end up with a Loop ID of 255 for F-Port topologies + */ + if (icbp->icb_hardaddr != 255) { + isp_prt(isp, ISP_LOGERR, + "bad hard address %u- resetting to zero", + icbp->icb_hardaddr); + } + icbp->icb_hardaddr = 0; + } /* * Right now we just set extended options to prefer point-to-point * over loop based upon some soft config options. @@ -1371,7 +1382,13 @@ icbp->icb_fwoptions &= ~(ICBOPT_BOTH_WWNS|ICBOPT_FULL_LOGIN); } icbp->icb_rqstqlen = RQUEST_QUEUE_LEN(isp); + if (icbp->icb_rqstqlen < 1) { + isp_prt(isp, ISP_LOGERR, "bad request queue length"); + } icbp->icb_rsltqlen = RESULT_QUEUE_LEN(isp); + if (icbp->icb_rsltqlen < 1) { + isp_prt(isp, ISP_LOGERR, "bad result queue length"); + } icbp->icb_rqstaddr[RQRSP_ADDR0015] = DMA_WD0(isp->isp_rquest_dma); icbp->icb_rqstaddr[RQRSP_ADDR1631] = DMA_WD1(isp->isp_rquest_dma); icbp->icb_rqstaddr[RQRSP_ADDR3247] = DMA_WD2(isp->isp_rquest_dma); @@ -3859,7 +3876,7 @@ } /* - * Free any dma resources. As a side effect, this may + * Free any DMA resources. As a side effect, this may * also do any cache flushing necessary for data coherence. */ if (XS_XFRLEN(xs)) { ISP_DMAFREE(isp, xs, sp->req_handle); ==== //depot/projects/uart/dev/isp/isp_freebsd.c#3 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.91 2003/08/24 17:49:14 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/isp/isp_freebsd.c,v 1.93 2003/09/15 06:41:33 markm Exp $"); #include #include @@ -39,6 +39,7 @@ MODULE_VERSION(isp, 1); +MODULE_DEPEND(isp, cam, 1, 1, 1); int isp_announced = 0; ispfwfunc *isp_get_firmware_p = NULL; @@ -399,8 +400,10 @@ hba->fc_scsi_supported = 1; hba->fc_topology = FCPARAM(isp)->isp_topo + 1; hba->fc_loopid = FCPARAM(isp)->isp_loopid; - hba->active_node_wwn = FCPARAM(isp)->isp_nodewwn; - hba->active_port_wwn = FCPARAM(isp)->isp_portwwn; + hba->nvram_node_wwn = FCPARAM(isp)->isp_nodewwn; + hba->nvram_port_wwn = FCPARAM(isp)->isp_portwwn; + hba->active_node_wwn = ISP_NODEWWN(isp); + hba->active_port_wwn = ISP_PORTWWN(isp); ISP_UNLOCK(isp); retval = 0; break; ==== //depot/projects/uart/dev/isp/isp_freebsd.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.71 2002/09/23 05:00:14 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_freebsd.h,v 1.72 2003/09/13 01:56:45 mjacob Exp $ */ /* * Qlogic ISP SCSI Host Adapter FreeBSD Wrapper Definitions * Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 by Matthew Jacob @@ -76,8 +76,7 @@ #endif #define HANDLE_LOOPSTATE_IN_OUTER_LAYERS 1 -/* turn this off for now */ -/* #define ISP_SMPLOCK 1 */ +#define ISP_SMPLOCK 1 #ifdef ISP_SMPLOCK #define ISP_IFLAGS INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE ==== //depot/projects/uart/dev/isp/isp_inline.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_inline.h,v 1.28 2002/09/23 05:00:37 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_inline.h,v 1.29 2003/09/13 01:57:31 mjacob Exp $ */ /* * Qlogic Host Adapter Inline Functions * @@ -975,7 +975,7 @@ ISP_IOXPUT_16(isp, atsrc->at_rxid, &atdst->at_rxid); ISP_IOXPUT_16(isp, atsrc->at_flags, &atdst->at_flags); ISP_IOXPUT_16(isp, atsrc->at_status, &atdst->at_status); - ISP_IOXPUT_8(isp, atsrc->at_reserved1, &atdst->at_reserved1); + ISP_IOXPUT_8(isp, atsrc->at_crn, &atdst->at_crn); ISP_IOXPUT_8(isp, atsrc->at_taskcodes, &atdst->at_taskcodes); ISP_IOXPUT_8(isp, atsrc->at_taskflags, &atdst->at_taskflags); ISP_IOXPUT_8(isp, atsrc->at_execodes, &atdst->at_execodes); @@ -1005,7 +1005,7 @@ ISP_IOXGET_16(isp, &atsrc->at_rxid, atdst->at_rxid); ISP_IOXGET_16(isp, &atsrc->at_flags, atdst->at_flags); ISP_IOXGET_16(isp, &atsrc->at_status, atdst->at_status); - ISP_IOXGET_8(isp, &atsrc->at_reserved1, atdst->at_reserved1); + ISP_IOXGET_8(isp, &atsrc->at_crn, atdst->at_crn); ISP_IOXGET_8(isp, &atsrc->at_taskcodes, atdst->at_taskcodes); ISP_IOXGET_8(isp, &atsrc->at_taskflags, atdst->at_taskflags); ISP_IOXGET_8(isp, &atsrc->at_execodes, atdst->at_execodes); @@ -1193,7 +1193,6 @@ static INLINE void isp_get_ctio2(struct ispsoftc *isp, ct2_entry_t *ctsrc, ct2_entry_t *ctdst) { - int i; isp_copy_in_hdr(isp, &ctsrc->ct_header, &ctdst->ct_header); ISP_IOXGET_16(isp, &ctsrc->ct_reserved, ctdst->ct_reserved); ISP_IOXGET_16(isp, &ctsrc->ct_fwhandle, ctdst->ct_fwhandle); @@ -1206,16 +1205,6 @@ ISP_IOXGET_16(isp, &ctsrc->ct_seg_count, ctdst->ct_seg_count); ISP_IOXGET_32(isp, &ctsrc->ct_reloff, ctdst->ct_reloff); ISP_IOXGET_32(isp, &ctsrc->ct_resid, ctdst->ct_resid); - for (i = 0; i < 4; i++) { - ISP_IOXGET_32(isp, &ctsrc->rsp.fw._reserved[i], - ctdst->rsp.fw._reserved[i]); - } - ISP_IOXGET_16(isp, &ctsrc->rsp.fw.ct_scsi_status, - ctdst->rsp.fw.ct_scsi_status); - for (i = 0; i < QLTM_SENSELEN; i++) { - ISP_IOXGET_8(isp, &ctsrc->rsp.fw.ct_sense[i], - ctdst->rsp.fw.ct_sense[i]); - } } static INLINE void ==== //depot/projects/uart/dev/isp/isp_target.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_target.c,v 1.26 2003/05/31 19:49:49 phk Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_target.c,v 1.27 2003/09/13 01:58:26 mjacob Exp $ */ /* * Machine and OS Independent Target Mode Code for the Qlogic SCSI/FC adapters. * @@ -363,7 +363,7 @@ return (-1); } - ISP_TDQE(isp, "isp_target_put_entry", (int) optr, ap);; + ISP_TDQE(isp, "isp_target_put_entry", (int) optr, ap); ISP_ADD_REQUEST(isp, nxti); return (0); } @@ -539,6 +539,11 @@ msg.nt_msg[0] = MSG_BUS_DEV_RESET; (void) isp_async(isp, ISPASYNC_TARGET_MESSAGE, &msg); break; + case ASYNC_CTIO_DONE: + evt.ev_bus = bus; + evt.ev_event = event; + (void) isp_async(isp, ISPASYNC_TARGET_EVENT, &evt); + return (0); default: isp_prt(isp, ISP_LOGERR, "isp_target_async: unknown event 0x%x", event); @@ -611,14 +616,18 @@ msg.nt_tagval = inp->in_seqid; msg.nt_lun = lun; - if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK) { - isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK", + if (inp->in_task_flags & TASK_FLAGS_ABORT_TASK_SET) { + isp_prt(isp, ISP_LOGINFO, f1, "ABORT TASK SET", inp->in_iid, lun, inp->in_seqid); - msg.nt_msg[0] = MSG_ABORT_TAG; + msg.nt_msg[0] = MSG_ABORT; } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_TASK_SET) { isp_prt(isp, ISP_LOGINFO, f1, "CLEAR TASK SET", inp->in_iid, lun, inp->in_seqid); msg.nt_msg[0] = MSG_CLEAR_QUEUE; + } else if (inp->in_task_flags & TASK_FLAGS_LUN_RESET) { + isp_prt(isp, ISP_LOGINFO, f1, "LUN RESET", + inp->in_iid, lun, inp->in_seqid); + msg.nt_msg[0] = MSG_LUN_RESET; } else if (inp->in_task_flags & TASK_FLAGS_TARGET_RESET) { isp_prt(isp, ISP_LOGINFO, f1, "TARGET RESET", inp->in_iid, lun, inp->in_seqid); @@ -626,12 +635,7 @@ } else if (inp->in_task_flags & TASK_FLAGS_CLEAR_ACA) { isp_prt(isp, ISP_LOGINFO, f1, "CLEAR ACA", inp->in_iid, lun, inp->in_seqid); - /* ???? */ msg.nt_msg[0] = MSG_REL_RECOVERY; - } else if (inp->in_task_flags & TASK_FLAGS_TERMINATE_TASK) { - isp_prt(isp, ISP_LOGINFO, f1, "TERMINATE TASK", - inp->in_iid, lun, inp->in_seqid); - msg.nt_msg[0] = MSG_TERM_IO_PROC; } else { isp_prt(isp, ISP_LOGWARN, f2, "task flag", inp->in_status, lun, inp->in_iid, @@ -1091,7 +1095,7 @@ /* * CTIO rejected by the firmware - invalid data direction. */ - isp_prt(isp, ISP_LOGERR, "CTIO2 had wrong data directiond"); + isp_prt(isp, ISP_LOGERR, "CTIO2 had wrong data direction"); break; case CT_RSELTMO: ==== //depot/projects/uart/dev/isp/isp_target.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/dev/isp/isp_target.h,v 1.20 2002/06/16 04:54:46 mjacob Exp $ */ +/* $FreeBSD: src/sys/dev/isp/isp_target.h,v 1.21 2003/09/13 01:58:26 mjacob Exp $ */ /* * Qlogic Target Mode Structure and Flag Definitions * @@ -36,11 +36,8 @@ #ifndef _ISP_TARGET_H #define _ISP_TARGET_H -/* - * Defines for all entry types - */ +#define QLTM_SENSELEN 18 /* non-FC cards only */ #define QLTM_SVALID 0x80 -#define QLTM_SENSELEN 18 /* * Structure for Enable Lun and Modify Lun queue entries @@ -141,28 +138,33 @@ /* * Values for the in_task_flags field- should only get one at a time! */ -#define TASK_FLAGS_ABORT_TASK (1<<9) +#define TASK_FLAGS_CLEAR_ACA (1<<14) +#define TASK_FLAGS_TARGET_RESET (1<<13) +#define TASK_FLAGS_LUN_RESET (1<<12) #define TASK_FLAGS_CLEAR_TASK_SET (1<<10) -#define TASK_FLAGS_TARGET_RESET (1<<13) -#define TASK_FLAGS_CLEAR_ACA (1<<14) >>> TRUNCATED FOR MAIL (1000 lines) <<<