Date: Sun, 20 Jul 2003 21:23:32 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 34762 for review Message-ID: <200307210423.h6L4NWj4091573@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=34762 Change 34762 by marcel@marcel_nfs on 2003/07/20 21:22:37 IFC @34761 Affected files ... .. //depot/projects/ia64/Makefile#29 integrate .. //depot/projects/ia64/bin/ed/Makefile#8 integrate .. //depot/projects/ia64/bin/ed/re.c#4 integrate .. //depot/projects/ia64/contrib/smbfs/mount_smbfs/mount_smbfs.c#4 integrate .. //depot/projects/ia64/lib/libpthread/arch/amd64/include/pthread_md.h#2 integrate .. //depot/projects/ia64/lib/libtelnet/Makefile#5 integrate .. //depot/projects/ia64/libexec/telnetd/Makefile#5 integrate .. //depot/projects/ia64/rescue/rescue/Makefile#7 integrate .. //depot/projects/ia64/sys/dev/acpica/acpi_ec.c#14 integrate .. //depot/projects/ia64/sys/dev/ath/if_ath.c#4 integrate .. //depot/projects/ia64/sys/dev/ath/if_athvar.h#3 integrate .. //depot/projects/ia64/sys/dev/usb/usb_mem.c#2 integrate .. //depot/projects/ia64/sys/dev/wi/if_wi.c#44 integrate .. //depot/projects/ia64/sys/dev/wi/if_wivar.h#15 integrate .. //depot/projects/ia64/sys/kern/kern_sig.c#61 integrate .. //depot/projects/ia64/sys/net/if_media.h#11 integrate .. //depot/projects/ia64/sys/net80211/ieee80211.c#4 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_input.c#3 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_ioctl.c#4 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_node.c#4 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_node.h#3 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_output.c#3 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_proto.c#3 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_proto.h#3 integrate .. //depot/projects/ia64/sys/net80211/ieee80211_var.h#3 integrate .. //depot/projects/ia64/usr.bin/calendar/calendars/calendar.freebsd#34 integrate .. //depot/projects/ia64/usr.bin/telnet/Makefile#5 integrate Differences ... ==== //depot/projects/ia64/Makefile#29 (text+ko) ==== @@ -1,5 +1,5 @@ # -# $FreeBSD: src/Makefile,v 1.285 2003/07/19 23:17:08 ru Exp $ +# $FreeBSD: src/Makefile,v 1.286 2003/07/20 12:38:29 ru Exp $ # # The user-driven targets are: # @@ -65,7 +65,7 @@ hierarchy install installcheck installkernel installkernel.debug\ reinstallkernel reinstallkernel.debug installmost installworld \ libraries lint maninstall \ - mk most obj objlink regress rerelease tags update + most obj objlink regress rerelease tags update BITGTS= files includes BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} ==== //depot/projects/ia64/bin/ed/Makefile#8 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/bin/ed/Makefile,v 1.26 2003/06/29 10:03:35 ru Exp $ +# $FreeBSD: src/bin/ed/Makefile,v 1.28 2003/07/20 12:26:24 ru Exp $ PROG= ed SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c @@ -8,7 +8,7 @@ .if exists(${.CURDIR}/../../crypto) && !defined(NOCRYPT) && !defined(NO_OPENSSL) DISTRIBUTION=crypto CFLAGS+=-DDES -WARNS= 2 +WARNS?= 2 DPADD= ${LIBCRYPTO} LDADD= -lcrypto .endif ==== //depot/projects/ia64/bin/ed/re.c#4 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/bin/ed/re.c,v 1.19 2002/06/30 05:13:53 obrien Exp $"); +__FBSDID("$FreeBSD: src/bin/ed/re.c,v 1.20 2003/07/20 10:24:09 ru Exp $"); #include "ed.h" @@ -41,10 +41,10 @@ pattern_t * get_compiled_pattern(void) { - static pattern_t *exp = NULL; + static pattern_t *expr = NULL; static char error[1024]; - char *exps; + char *exprs; char delimiter; int n; @@ -52,27 +52,27 @@ errmsg = "invalid pattern delimiter"; return NULL; } else if (delimiter == '\n' || *++ibufp == '\n' || *ibufp == delimiter) { - if (!exp) + if (!expr) errmsg = "no previous pattern"; - return exp; - } else if ((exps = extract_pattern(delimiter)) == NULL) + return expr; + } else if ((exprs = extract_pattern(delimiter)) == NULL) return NULL; /* buffer alloc'd && not reserved */ - if (exp && !patlock) - regfree(exp); - else if ((exp = (pattern_t *) malloc(sizeof(pattern_t))) == NULL) { + if (expr && !patlock) + regfree(expr); + else if ((expr = (pattern_t *) malloc(sizeof(pattern_t))) == NULL) { fprintf(stderr, "%s\n", strerror(errno)); errmsg = "out of memory"; return NULL; } patlock = 0; - if ((n = regcomp(exp, exps, 0))) { - regerror(n, exp, error, sizeof error); + if ((n = regcomp(expr, exprs, 0))) { + regerror(n, expr, error, sizeof error); errmsg = error; - free(exp); - return exp = NULL; + free(expr); + return expr = NULL; } - return exp; + return expr; } ==== //depot/projects/ia64/contrib/smbfs/mount_smbfs/mount_smbfs.c#4 (text+ko) ==== @@ -30,6 +30,7 @@ * SUCH DAMAGE. * * $Id: mount_smbfs.c,v 1.17 2002/04/10 04:17:51 bp Exp $ + * $FreeBSD: src/contrib/smbfs/mount_smbfs/mount_smbfs.c,v 1.2 2003/07/20 11:27:54 tjr Exp $ */ #include <sys/param.h> #include <sys/stat.h> @@ -75,7 +76,7 @@ extern void dropsuid(); extern int loadsmbvfs(); #else - struct vfsconf vfc; + struct xvfsconf vfc; #endif /* APPLE */ char *next; int opt, error, mntflags, caseopt; ==== //depot/projects/ia64/lib/libpthread/arch/amd64/include/pthread_md.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/lib/libpthread/arch/amd64/include/pthread_md.h,v 1.1 2003/07/19 04:44:21 deischen Exp $ + * $FreeBSD: src/lib/libpthread/arch/amd64/include/pthread_md.h,v 1.2 2003/07/20 12:41:38 deischen Exp $ */ /* * Machine-dependent thread prototypes/definitions for the thread kernel. @@ -33,8 +33,10 @@ #include <ucontext.h> -#define THR_GETCONTEXT(ucp) (void)_amd64_save_context(&(ucp)->uc_mcontext) -#define THR_SETCONTEXT(ucp) (void)_amd64_restore_context(&(ucp)->uc_mcontext) +#define THR_GETCONTEXT(ucp) \ + (void)_amd64_save_context(&(ucp)->uc_mcontext) +#define THR_SETCONTEXT(ucp) \ + (void)_amd64_restore_context(&(ucp)->uc_mcontext, NULL, NULL) #define THR_ALIGNBYTES 15 #define THR_ALIGN(td) (((uintptr_t)(td) + THR_ALIGNBYTES) & ~THR_ALIGNBYTES) ==== //depot/projects/ia64/lib/libtelnet/Makefile#5 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)Makefile 8.2 (Berkeley) 12/15/93 -# $FreeBSD: src/lib/libtelnet/Makefile,v 1.15 2003/07/16 20:59:14 markm Exp $ +# $FreeBSD: src/lib/libtelnet/Makefile,v 1.16 2003/07/20 23:29:46 markm Exp $ TELNETDIR= ${.CURDIR}/../../contrib/telnet .PATH: ${TELNETDIR}/libtelnet @@ -13,7 +13,7 @@ WARNS?= 2 -.if !defined(NO_CRYPTO) +.if !defined(NOCRYPT) && !defined(NO_OPENSSL) SRCS+= encrypt.c auth.c enc_des.c sra.c pk.c CFLAGS+= -DENCRYPTION -DAUTHENTICATION -DSRA .if !defined(NO_KERBEROS) ==== //depot/projects/ia64/libexec/telnetd/Makefile#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/libexec/telnetd/Makefile,v 1.20 2003/07/16 20:59:14 markm Exp $ +# $FreeBSD: src/libexec/telnetd/Makefile,v 1.21 2003/07/20 23:29:46 markm Exp $ # Do not define -DKLUDGELINEMODE, as it does not interact well with many # telnet implementations. @@ -28,7 +28,7 @@ DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET} LDADD= -lutil -ltermcap ${LIBTELNET} -.if !defined(NO_CRYPTO) +.if !defined(NOCRYPT) && !defined(NO_OPENSSL) SRCS+= authenc.c CFLAGS+= -DAUTHENTICATION -DENCRYPTION DPADD+= ${LIBMP} ${LIBCRYPTO} ${LIBCRYPT} ${LIBPAM} ==== //depot/projects/ia64/rescue/rescue/Makefile#7 (text+ko) ==== @@ -1,4 +1,4 @@ -#$FreeBSD: src/rescue/rescue/Makefile,v 1.12 2003/07/19 20:40:37 obrien Exp $ +#$FreeBSD: src/rescue/rescue/Makefile,v 1.13 2003/07/21 02:47:04 obrien Exp $ # @(#)Makefile 8.1 (Berkeley) 6/2/93 PROG= rescue @@ -105,7 +105,7 @@ CRUNCH_PROGS_sbin= atm atacontrol badsect bsdlabel camcontrol \ ccdconfig clri devfs dmesg dump \ dumpfs dumpon fore_dnld fsck fsck_ffs fsck_msdosfs fsdb \ - fsirand gbde ifconfig ilmid init ip6fw \ + fsirand gbde ifconfig ilmid init \ kldconfig kldload kldstat kldunload ldconfig \ md5 mdconfig mdmfs mknod mount mount_cd9660 mount_ext2fs \ mount_msdosfs mount_nfs mount_ntfs mount_nullfs \ ==== //depot/projects/ia64/sys/dev/acpica/acpi_ec.c#14 (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.34 2003/07/20 00:48:38 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.36 2003/07/20 21:12:21 njl Exp $ */ /****************************************************************************** * @@ -232,7 +232,7 @@ } ACPI_TABLE_ECDT; /* Indicate that this device has already been probed via ECDT. */ -#define DEV_ECDT_FLAG 0x80000000 +#define DEV_ECDT(x) (acpi_get_private(x) == &acpi_ec_devclass) /* Indicate that this device should use the global lock. */ #define DEV_GLK_FLAG 0x40000000 @@ -247,7 +247,8 @@ struct acpi_ec_softc { device_t ec_dev; ACPI_HANDLE ec_handle; - UINT32 ec_gpebit; + UINT8 ec_gpebit; + UINT8 ec_csrvalue; int ec_data_rid; struct resource *ec_data_res; @@ -262,7 +263,7 @@ int ec_glk; int ec_glkhandle; struct mtx ec_mtx; - UINT32 ec_polldelay; + int ec_polldelay; }; /* @@ -321,7 +322,6 @@ UINT32 width, ACPI_INTEGER *Value, void *Context, void *RegionContext); static ACPI_STATUS EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event); -static ACPI_STATUS EcQuery(struct acpi_ec_softc *sc, UINT8 *Data); static ACPI_STATUS EcCommand(struct acpi_ec_softc *sc, EC_COMMAND cmd); static ACPI_STATUS EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data); @@ -401,7 +401,8 @@ * We'll determine whether we really want to use the global lock * in a later call to attach. */ - magic = DEV_ECDT_FLAG | DEV_GLK_FLAG; + acpi_set_private(child, &acpi_ec_devclass); + magic = DEV_GLK_FLAG; DEV_SET_GPEBIT(magic, ecdt->gpe_bit); acpi_set_magic(child, magic); @@ -419,11 +420,9 @@ char desc[64]; int magic, uid, glk, gpebit, ret = ENXIO; - /* Check that this is an EC device and it's not disabled. */ - if (acpi_get_type(dev) != ACPI_TYPE_DEVICE || acpi_disabled("ec") || - !acpi_MatchHid(dev, "PNP0C09")) { + /* Check that this is a device and that EC is not disabled. */ + if (acpi_get_type(dev) != ACPI_TYPE_DEVICE || acpi_disabled("ec")) return (ENXIO); - } /* * If probed via ECDT, set description and continue. Otherwise, @@ -431,12 +430,12 @@ * duplicate probe. */ magic = acpi_get_magic(dev); - if ((magic & DEV_ECDT_FLAG) != 0) { + if (DEV_ECDT(dev)) { snprintf(desc, sizeof(desc), "embedded controller: ECDT, GPE %#x, GLK", DEV_GET_GPEBIT(magic)); device_set_desc_copy(dev, desc); ret = 0; - } else { + } else if (acpi_MatchHid(dev, "PNP0C09")) { h = acpi_get_handle(dev); /* @@ -590,29 +589,6 @@ return (errval); } -static ACPI_STATUS -EcQuery(struct acpi_ec_softc *sc, UINT8 *Data) -{ - ACPI_STATUS Status; - - Status = EcLock(sc); - if (ACPI_FAILURE(Status)) - return (Status); - - /* - * Send a query command to the EC to find out which _Qxx call it - * wants to make. This command clears the SCI bit and also the - * interrupt source since we are edge-triggered. - */ - Status = EcCommand(sc, EC_COMMAND_QUERY); - if (ACPI_SUCCESS(Status)) - *Data = EC_GET_DATA(sc); - - EcUnlock(sc); - - return (Status); -} - static void EcGpeQueryHandler(void *Context) { @@ -625,32 +601,39 @@ ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); + Status = EcLock(sc); + if (ACPI_FAILURE(Status)) { + ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev), + "GpeQuery lock error: %s\n", AcpiFormatException(Status)); + return; + } + /* - * Check status for EC_SCI. - * - * Bail out if the EC_SCI bit of the status register is not set. - * Note that this function should only be called when - * this bit is set (polling is used to detect IBE/OBF events). - * - * We don't acquire the global lock here but do protect against other - * running commands (read/write/query) by grabbing ec_mtx. + * If the EC_SCI bit of the status register is not set, then pass + * it along to any potential waiters as it may be an IBE/OBF event. */ - mtx_lock(&sc->ec_mtx); EcStatus = EC_GET_CSR(sc); - mtx_unlock(&sc->ec_mtx); if ((EcStatus & EC_EVENT_SCI) == 0) { - /* If it's not an SCI, wakeup the EcWaitEvent sleep. */ - wakeup(&sc->ec_polldelay); + sc->ec_csrvalue = EcStatus; + wakeup(&sc->ec_csrvalue); + EcUnlock(sc); goto re_enable; } - /* Find out why the EC is signaling us. */ - Status = EcQuery(sc, &Data); + /* + * Send a query command to the EC to find out which _Qxx call it + * wants to make. This command clears the SCI bit and also the + * interrupt source since we are edge-triggered. + */ + Status = EcCommand(sc, EC_COMMAND_QUERY); if (ACPI_FAILURE(Status)) { + EcUnlock(sc); ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev), "GPE query failed - %s\n", AcpiFormatException(Status)); goto re_enable; } + Data = EC_GET_DATA(sc); + EcUnlock(sc); /* Ignore the value for "no outstanding event". (13.3.5) */ if (Data == 0) @@ -770,7 +753,7 @@ { EC_STATUS EcStatus; ACPI_STATUS Status; - UINT32 i, period; + int i, period, retval; mtx_assert(&sc->ec_mtx, MA_OWNED); Status = AE_NO_HARDWARE_RESPONSE; @@ -812,13 +795,18 @@ * for completion, sleeping for chunks of 10 ms. */ if (Status != AE_OK) { + retval = -1; for (i = 0; i < EC_POLL_TIMEOUT / 10; i++) { - EcStatus = EC_GET_CSR(sc); + if (retval != 0) + EcStatus = EC_GET_CSR(sc); + else + EcStatus = sc->ec_csrvalue; if (EVENT_READY(Event, EcStatus)) { Status = AE_OK; break; } - msleep(&sc->ec_polldelay, &sc->ec_mtx, PZERO, "ecpoll", 10/*ms*/); + retval = msleep(&sc->ec_csrvalue, &sc->ec_mtx, PZERO, "ecpoll", + 10/*ms*/); } } ==== //depot/projects/ia64/sys/dev/ath/if_ath.c#4 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.3 2003/07/13 17:07:25 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.4 2003/07/20 21:38:20 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -129,7 +129,7 @@ static int ath_startrecv(struct ath_softc *); static void ath_next_scan(void *); static void ath_calibrate(void *); -static int ath_newstate(void *, enum ieee80211_state); +static int ath_newstate(struct ieee80211com *, enum ieee80211_state, int); static void ath_newassoc(struct ieee80211com *, struct ieee80211_node *, int); static int ath_getchannels(struct ath_softc *, u_int cc, HAL_BOOL outdoor); @@ -281,7 +281,6 @@ ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ic->ic_softc = sc; - ic->ic_newstate = ath_newstate; ic->ic_newassoc = ath_newassoc; /* XXX not right but it's not used anywhere important */ ic->ic_phytype = IEEE80211_T_OFDM; @@ -300,7 +299,9 @@ ic->ic_node_alloc = ath_node_alloc; ic->ic_node_free = ath_node_free; ic->ic_node_copy = ath_node_copy; - + sc->sc_newstate = ic->ic_newstate; + ic->ic_newstate = ath_newstate; + /* complete initialization */ ieee80211_media_init(ifp, ath_media_change, ieee80211_media_status); if_printf(ifp, "802.11 address: %s\n", ether_sprintf(ic->ic_myaddr)); @@ -453,13 +454,12 @@ { struct ath_softc *sc = arg; struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; DPRINTF(("ath_bmiss_proc: pending %u\n", pending)); KASSERT(ic->ic_opmode == IEEE80211_M_STA, ("unexpect operating mode %u", ic->ic_opmode)); if (ic->ic_state == IEEE80211_S_RUN) - ieee80211_new_state(ifp, IEEE80211_S_SCAN, -1); + ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); } static u_int @@ -546,7 +546,7 @@ mode = ieee80211_chan2mode(ic, ni->ni_chan); if (mode != sc->sc_curmode) ath_setcurmode(sc, mode); - ieee80211_new_state(ifp, IEEE80211_S_SCAN, -1); + ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); done: mtx_unlock(&sc->sc_mtx); } @@ -554,6 +554,7 @@ static void ath_stop(struct ifnet *ifp) { + struct ieee80211com *ic = (struct ieee80211com *) ifp; struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; @@ -587,7 +588,7 @@ sc->sc_rxlink = NULL; IF_DRAIN(&ifp->if_snd); ath_beacon_free(sc); - ieee80211_new_state(ifp, IEEE80211_S_INIT, -1); + ieee80211_new_state(ic, IEEE80211_S_INIT, -1); if (!sc->sc_invalid) ath_hal_setpower(ah, HAL_PM_FULL_SLEEP, 0); } @@ -2156,21 +2157,15 @@ } static int -ath_newstate(void *arg, enum ieee80211_state nstate) +ath_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) { - struct ath_softc *sc = arg; + struct ifnet *ifp = &ic->ic_if; + struct ath_softc *sc = ifp->if_softc; struct ath_hal *ah = sc->sc_ah; - struct ieee80211com *ic = &sc->sc_ic; - struct ifnet *ifp = &ic->ic_if; struct ieee80211_node *ni; int i, error; u_int8_t *bssid; u_int32_t rfilt; - enum ieee80211_state ostate; -#ifdef AR_DEBUG - static const char *stname[] = - { "INIT", "SCAN", "AUTH", "ASSOC", "RUN" }; -#endif /* AR_DEBUG */ static const HAL_LED_STATE leds[] = { HAL_LED_INIT, /* IEEE80211_S_INIT */ HAL_LED_SCAN, /* IEEE80211_S_SCAN */ @@ -2179,17 +2174,18 @@ HAL_LED_RUN, /* IEEE80211_S_RUN */ }; - ostate = ic->ic_state; - - DPRINTF(("%s: %s -> %s\n", __func__, stname[ostate], stname[nstate])); + DPRINTF(("%s: %s -> %s\n", __func__, + ieee80211_state_name[ic->ic_state], + ieee80211_state_name[nstate])); ath_hal_setledstate(ah, leds[nstate]); /* set LED */ if (nstate == IEEE80211_S_INIT) { sc->sc_imask &= ~(HAL_INT_SWBA | HAL_INT_BMISS); ath_hal_intrset(ah, sc->sc_imask); - error = 0; /* cheat + use error return */ - goto bad; + callout_stop(&sc->sc_scan_ch); + callout_stop(&sc->sc_cal_ch); + return (*sc->sc_newstate)(ic, nstate, arg); } ni = ic->ic_bss; error = ath_chan_set(sc, ni->ni_chan); @@ -2259,10 +2255,14 @@ * Reset the rate control state. */ ath_rate_ctl_reset(sc, nstate); - return 0; + /* + * Invoke the parent method to complete the work. + */ + return (*sc->sc_newstate)(ic, nstate, arg); bad: callout_stop(&sc->sc_scan_ch); callout_stop(&sc->sc_cal_ch); + /* NB: do not invoke the parent */ return error; } ==== //depot/projects/ia64/sys/dev/ath/if_athvar.h#3 (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.2 2003/07/13 17:07:25 sam Exp $ + * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.3 2003/07/20 21:38:20 sam Exp $ */ /* @@ -78,6 +78,8 @@ struct ath_softc { struct ieee80211com sc_ic; /* IEEE 802.11 common */ + int (*sc_newstate)(struct ieee80211com *, + enum ieee80211_state, int); device_t sc_dev; bus_space_tag_t sc_st; /* bus space tag */ bus_space_handle_t sc_sh; /* bus space handle */ ==== //depot/projects/ia64/sys/dev/usb/usb_mem.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $ */ -/* $FreeBSD: src/sys/dev/usb/usb_mem.c,v 1.1 2003/07/15 22:42:37 jmg Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usb_mem.c,v 1.2 2003/07/21 02:41:01 jmg Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/usb/usb_mem.c,v 1.1 2003/07/15 22:42:37 jmg Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/usb/usb_mem.c,v 1.2 2003/07/21 02:41:01 jmg Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -84,7 +84,7 @@ #endif #define USB_MEM_SMALL 64 -#define USB_MEM_CHUNKS (PAGE_SIZE / 64) +#define USB_MEM_CHUNKS (PAGE_SIZE / USB_MEM_SMALL) #define USB_MEM_BLOCK (USB_MEM_SMALL * USB_MEM_CHUNKS) /* This struct is overlayed on free fragments. */ @@ -256,6 +256,10 @@ return (err); } b->fullblock = 0; + /* XXX - override the tag, ok since we never free it */ + b->tag = tag; + KASSERT(sizeof *f <= USB_MEM_SMALL, ("USB_MEM_SMALL(%d) is too small for struct usb_frag_dma(%d)\n", + USB_MEM_SMALL, sizeof *f)); for (i = 0; i < USB_MEM_BLOCK; i += USB_MEM_SMALL) { f = (struct usb_frag_dma *)((char *)b->kaddr + i); f->block = b; ==== //depot/projects/ia64/sys/dev/wi/if_wi.c#44 (text+ko) ==== @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.147 2003/07/03 10:16:40 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/wi/if_wi.c,v 1.148 2003/07/20 21:37:32 sam Exp $"); #define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ @@ -146,7 +146,7 @@ static int wi_read_rid(struct wi_softc *, int, void *, int *); static int wi_write_rid(struct wi_softc *, int, void *, int); -static int wi_newstate(void *, enum ieee80211_state); +static int wi_newstate(struct ieee80211com *, enum ieee80211_state, int); static int wi_scan_ap(struct wi_softc *, u_int16_t, u_int16_t); static void wi_scan_result(struct wi_softc *, int, int); @@ -312,7 +312,6 @@ ic->ic_opmode = IEEE80211_M_STA; ic->ic_caps = IEEE80211_C_PMGT | IEEE80211_C_AHDEMO; ic->ic_state = IEEE80211_S_INIT; - ic->ic_newstate = wi_newstate; /* * Query the card for available channels and setup the @@ -452,6 +451,9 @@ * Call MI attach routine. */ ieee80211_ifattach(ifp); + /* override state transition method */ + sc->sc_newstate = ic->ic_newstate; + ic->ic_newstate = wi_newstate; ieee80211_media_init(ifp, wi_media_change, wi_media_status); return (0); @@ -716,7 +718,7 @@ ifp->if_flags &= ~IFF_OACTIVE; if (ic->ic_opmode == IEEE80211_M_AHDEMO || ic->ic_opmode == IEEE80211_M_HOSTAP) - wi_newstate(sc, IEEE80211_S_RUN); + ieee80211_new_state(ic, IEEE80211_S_RUN, -1); /* Enable interrupts */ CSR_WRITE_2(sc, WI_INT_EN, WI_INTRS); @@ -758,12 +760,13 @@ void wi_stop(struct ifnet *ifp, int disable) { + struct ieee80211com *ic = (struct ieee80211com *) ifp; struct wi_softc *sc = ifp->if_softc; WI_LOCK_DECL(); WI_LOCK(sc); - ieee80211_new_state(ifp, IEEE80211_S_INIT, -1); + ieee80211_new_state(ic, IEEE80211_S_INIT, -1); if (sc->sc_enabled && !sc->wi_gone) { CSR_WRITE_2(sc, WI_INT_EN, 0); wi_cmd(sc, WI_CMD_DISABLE | sc->sc_portnum, 0, 0, 0); @@ -996,10 +999,11 @@ if (sc->sc_syn_timer) { if (--sc->sc_syn_timer == 0) { + struct ieee80211com *ic = (struct ieee80211com *) ifp; DPRINTF2(("wi_watchdog: %d false syns\n", sc->sc_false_syns)); sc->sc_false_syns = 0; - ieee80211_new_state(ifp, IEEE80211_S_RUN, -1); + ieee80211_new_state(ic, IEEE80211_S_RUN, -1); sc->sc_syn_timer = 5; } ifp->if_timer = 1; @@ -1244,7 +1248,7 @@ sc->sc_false_syns >= WI_MAX_FALSE_SYNS) return; - ieee80211_new_state(ifp, IEEE80211_S_RUN, -1); + ieee80211_new_state(ic, IEEE80211_S_RUN, -1); } static void @@ -1547,7 +1551,7 @@ break; /* FALLTHROUGH */ case WI_INFO_LINK_STAT_AP_CHG: - ieee80211_new_state(ifp, IEEE80211_S_RUN, -1); + ieee80211_new_state(ic, IEEE80211_S_RUN, -1); break; case WI_INFO_LINK_STAT_AP_INR: sc->sc_flags &= ~WI_FLAGS_OUTRANGE; @@ -1566,7 +1570,7 @@ case WI_INFO_LINK_STAT_DISCONNECTED: case WI_INFO_LINK_STAT_ASSOC_FAILED: if (ic->ic_opmode == IEEE80211_M_STA) - ieee80211_new_state(ifp, IEEE80211_S_INIT, -1); + ieee80211_new_state(ic, IEEE80211_S_INIT, -1); break; } break; @@ -2519,30 +2523,25 @@ } static int -wi_newstate(void *arg, enum ieee80211_state nstate) +wi_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) { - struct wi_softc *sc = arg; - struct ieee80211com *ic = &sc->sc_ic; + struct ifnet *ifp = &ic->ic_if; + struct wi_softc *sc = ifp->if_softc; struct ieee80211_node *ni = ic->ic_bss; int buflen; u_int16_t val; struct wi_ssid ssid; u_int8_t old_bssid[IEEE80211_ADDR_LEN]; - enum ieee80211_state ostate; -#ifdef WI_DEBUG - static const char *stname[] = - { "INIT", "SCAN", "AUTH", "ASSOC", "RUN" }; -#endif /* WI_DEBUG */ - ostate = ic->ic_state; - DPRINTF(("wi_newstate: %s -> %s\n", stname[ostate], stname[nstate])); + DPRINTF(("%s: %s -> %s\n", __func__, + ieee80211_state_name[ic->ic_state], + ieee80211_state_name[nstate])); - ic->ic_state = nstate; switch (nstate) { case IEEE80211_S_INIT: ic->ic_flags &= ~IEEE80211_F_SIBSS; sc->sc_flags &= ~WI_FLAGS_OUTRANGE; - return 0; + return (*sc->sc_newstate)(ic, nstate, arg); case IEEE80211_S_RUN: sc->sc_flags &= ~WI_FLAGS_OUTRANGE; @@ -2584,8 +2583,8 @@ break; } - /* skip standard ieee80211 handling */ - return EINPROGRESS; + ic->ic_state = nstate; /* NB: skip normal ieee80211 handling */ + return 0; } static int ==== //depot/projects/ia64/sys/dev/wi/if_wivar.h#15 (text+ko) ==== @@ -31,7 +31,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/wi/if_wivar.h,v 1.18 2003/06/28 06:17:26 sam Exp $ + * $FreeBSD: src/sys/dev/wi/if_wivar.h,v 1.19 2003/07/20 21:37:32 sam Exp $ */ #if 0 @@ -61,6 +61,8 @@ struct wi_softc { struct ieee80211com sc_ic; + int (*sc_newstate)(struct ieee80211com *, + enum ieee80211_state, int); device_t sc_dev; #if __FreeBSD_version >= 500000 struct mtx sc_mtx; ==== //depot/projects/ia64/sys/kern/kern_sig.c#61 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.252 2003/07/17 22:52:55 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_sig.c,v 1.253 2003/07/21 00:26:52 davidxu Exp $"); #include "opt_compat.h" #include "opt_ktrace.h" @@ -1515,6 +1515,9 @@ if (td->td_upcall) td->td_upcall->ku_flags |= KUF_DOUPCALL; mtx_unlock_spin(&sched_lock); + } else { + /* UTS caused a sync signal */ + sigexit(td, SIGILL); } } else { PROC_LOCK(p); @@ -1540,6 +1543,7 @@ error = copyout(&siginfo, &td->td_mailbox->tm_syncsig, sizeof(siginfo)); PROC_LOCK(p); + /* UTS memory corrupted */ if (error) sigexit(td, SIGILL); SIGADDSET(td->td_sigmask, sig); @@ -2282,7 +2286,8 @@ #endif _STOPEVENT(p, S_SIG, sig); - if (action == SIG_DFL) { + if (!(td->td_flags & TDF_SA && td->td_mailbox) && + action == SIG_DFL) { /* * Default action, where the default is to kill * the process. (Other cases were ignored above.) @@ -2291,6 +2296,13 @@ sigexit(td, sig); /* NOTREACHED */ } else { + if (td->td_flags & TDF_SA && td->td_mailbox) { + if (sig == SIGKILL) { + mtx_unlock(&ps->ps_mtx); + sigexit(td, sig); + } + } + /* * If we get here, the signal must be caught. */ @@ -2333,7 +2345,7 @@ p->p_code = 0; p->p_sig = 0; } - if (td->td_flags & TDF_SA) + if (td->td_flags & TDF_SA && td->td_mailbox) thread_signal_add(curthread, sig); else (*p->p_sysent->sv_sendsig)(action, sig, ==== //depot/projects/ia64/sys/net/if_media.h#11 (text+ko) ==== @@ -1,5 +1,5 @@ /* $NetBSD: if_media.h,v 1.3 1997/03/26 01:19:27 thorpej Exp $ */ -/* $FreeBSD: src/sys/net/if_media.h,v 1.22 2003/06/25 15:03:05 sam Exp $ */ +/* $FreeBSD: src/sys/net/if_media.h,v 1.23 2003/07/21 02:48:35 sam Exp $ */ /* * Copyright (c) 1997 @@ -194,6 +194,7 @@ #define IFM_IEEE80211_IBSS 0x00000400 /* Operate in IBSS mode */ #define IFM_IEEE80211_IBSSMASTER 0x00000800 /* Operate as an IBSS master */ #define IFM_IEEE80211_TURBO 0x00001000 /* Operate in turbo mode */ +#define IFM_IEEE80211_MONITOR 0x00002000 /* Operate in monitor mode */ /* operating mode for multi-mode devices */ #define IFM_IEEE80211_11A 1 /* 5Ghz, OFDM mode */ #define IFM_IEEE80211_11B 2 /* Direct Sequence mode */ @@ -443,6 +444,7 @@ { IFM_IEEE80211_IBSS, "ibss" }, \ { IFM_IEEE80211_IBSSMASTER, "ibss-master" }, \ { IFM_IEEE80211_TURBO, "turbo" }, \ + { IFM_IEEE80211_MONITOR, "monitor" }, \ { 0, NULL }, \ } ==== //depot/projects/ia64/sys/net80211/ieee80211.c#4 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211.c,v 1.4 2003/06/29 20:10:54 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211.c,v 1.6 2003/07/21 02:49:42 sam Exp $"); /* * IEEE 802.11 generic handler @@ -275,6 +275,8 @@ ADD(ic, IFM_AUTO, mopt | IFM_IEEE80211_HOSTAP); if (ic->ic_caps & IEEE80211_C_AHDEMO) ADD(ic, IFM_AUTO, mopt | IFM_IEEE80211_ADHOC | IFM_FLAG0); + if (ic->ic_caps & IEEE80211_C_MONITOR) + ADD(ic, IFM_AUTO, mopt | IFM_IEEE80211_MONITOR); if (mode == IEEE80211_MODE_AUTO) continue; if_printf(ifp, "%s rates: ", ieee80211_phymode_name[mode]); @@ -294,6 +296,8 @@ ADD(ic, mword, mopt | IFM_IEEE80211_HOSTAP); if (ic->ic_caps & IEEE80211_C_AHDEMO) ADD(ic, mword, mopt | IFM_IEEE80211_ADHOC | IFM_FLAG0); + if (ic->ic_caps & IEEE80211_C_MONITOR) + ADD(ic, mword, mopt | IFM_IEEE80211_MONITOR); /* * Add rate to the collection of all rates. */ @@ -325,6 +329,8 @@ ADD(ic, mword, IFM_IEEE80211_HOSTAP); if (ic->ic_caps & IEEE80211_C_AHDEMO) ADD(ic, mword, IFM_IEEE80211_ADHOC | IFM_FLAG0); + if (ic->ic_caps & IEEE80211_C_MONITOR) + ADD(ic, mword, IFM_IEEE80211_MONITOR); } ieee80211_media_status(ifp, &imr); ifmedia_set(&ic->ic_media, imr.ifm_active); @@ -441,6 +447,8 @@ newopmode = IEEE80211_M_HOSTAP; else if (ime->ifm_media & IFM_IEEE80211_ADHOC) newopmode = IEEE80211_M_IBSS; + else if (ime->ifm_media & IFM_IEEE80211_MONITOR) + newopmode = IEEE80211_M_MONITOR; else newopmode = IEEE80211_M_STA; @@ -486,6 +494,7 @@ case IEEE80211_M_AHDEMO: case IEEE80211_M_HOSTAP: case IEEE80211_M_STA: + case IEEE80211_M_MONITOR: ic->ic_flags &= ~IEEE80211_F_IBSSON; break; case IEEE80211_M_IBSS: @@ -534,6 +543,9 @@ case IEEE80211_M_HOSTAP: imr->ifm_active |= IFM_IEEE80211_HOSTAP; break; + case IEEE80211_M_MONITOR: + imr->ifm_active |= IFM_IEEE80211_MONITOR; + break; } switch (ic->ic_curmode) { case IEEE80211_MODE_11A: @@ -558,7 +570,7 @@ struct ieee80211com *ic = (void *)ifp; if (ic->ic_mgt_timer && --ic->ic_mgt_timer == 0) - ieee80211_new_state(ifp, IEEE80211_S_SCAN, -1); + ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); if (ic->ic_inact_timer && --ic->ic_inact_timer == 0) ieee80211_timeout_nodes(ic); ==== //depot/projects/ia64/sys/net80211/ieee80211_input.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.4 2003/06/27 05:13:52 sam Exp $"); +__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.6 2003/07/21 02:49:42 sam Exp $"); #include "opt_inet.h" @@ -138,6 +138,9 @@ ni = ieee80211_ref_node(ic->ic_bss); } break; + case IEEE80211_M_MONITOR: + /* NB: this should collect everything */ + goto out; default: >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307210423.h6L4NWj4091573>