svn commit: r245210 - in projects/bhyve: sys/amd64/amd64 sys/arm/arm sys/arm/include sys/arm/ti/omap4 sys/dev/ath sys/netinet6 usr.bin/tail
Neel Natu
neel at FreeBSD.org
Wed Jan 9 03:32:26 UTC 2013
Author: neel
Date: Wed Jan 9 03:32:23 2013
New Revision: 245210
URL: http://svnweb.freebsd.org/changeset/base/245210
Log:
IFC @ r245205
Modified:
projects/bhyve/sys/amd64/amd64/vm_machdep.c
projects/bhyve/sys/arm/arm/pl310.c
projects/bhyve/sys/arm/include/pcpu.h
projects/bhyve/sys/arm/ti/omap4/std.omap4
projects/bhyve/sys/dev/ath/if_ath_rx.c
projects/bhyve/sys/dev/ath/if_ath_spectral.c
projects/bhyve/sys/dev/ath/if_athioctl.h
projects/bhyve/sys/netinet6/scope6.c
projects/bhyve/usr.bin/tail/read.c
Directory Properties:
projects/bhyve/ (props changed)
projects/bhyve/sys/ (props changed)
Modified: projects/bhyve/sys/amd64/amd64/vm_machdep.c
==============================================================================
--- projects/bhyve/sys/amd64/amd64/vm_machdep.c Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/amd64/amd64/vm_machdep.c Wed Jan 9 03:32:23 2013 (r245210)
@@ -574,10 +574,9 @@ cpu_reset_proxy()
cpuset_t tcrp;
cpu_reset_proxy_active = 1;
- while (cpu_reset_proxy_active == 1) {
- ia32_pause();
- ; /* Wait for other cpu to see that we've started */
- }
+ while (cpu_reset_proxy_active == 1)
+ ia32_pause(); /* Wait for other cpu to see that we've started */
+
CPU_SETOF(cpu_reset_proxyid, &tcrp);
stop_cpus(tcrp);
printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid);
Modified: projects/bhyve/sys/arm/arm/pl310.c
==============================================================================
--- projects/bhyve/sys/arm/arm/pl310.c Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/arm/arm/pl310.c Wed Jan 9 03:32:23 2013 (r245210)
@@ -73,13 +73,6 @@ __FBSDID("$FreeBSD$");
static int pl310_enabled = 1;
TUNABLE_INT("pl310.enabled", &pl310_enabled);
-void omap4_l2cache_wbinv_range(vm_paddr_t physaddr, vm_size_t size);
-void omap4_l2cache_inv_range(vm_paddr_t physaddr, vm_size_t size);
-void omap4_l2cache_wb_range(vm_paddr_t physaddr, vm_size_t size);
-void omap4_l2cache_wbinv_all(void);
-void omap4_l2cache_inv_all(void);
-void omap4_l2cache_wb_all(void);
-
static uint32_t g_l2cache_way_mask;
static const uint32_t g_l2cache_line_size = 32;
Modified: projects/bhyve/sys/arm/include/pcpu.h
==============================================================================
--- projects/bhyve/sys/arm/include/pcpu.h Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/arm/include/pcpu.h Wed Jan 9 03:32:23 2013 (r245210)
@@ -100,8 +100,8 @@ set_tls(void *tls)
#define PCPU_GET(member) (get_pcpu()->pc_ ## member)
#define PCPU_ADD(member, value) (get_pcpu()->pc_ ## member += (value))
#define PCPU_INC(member) PCPU_ADD(member, 1)
-#define PCPU_PTR(member) (&pcpup->pc_ ## member)
-#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value))
+#define PCPU_PTR(member) (&get_pcpu()->pc_ ## member)
+#define PCPU_SET(member,value) (get_pcpu()->pc_ ## member = (value))
void pcpu0_init(void);
#endif /* _KERNEL */
Modified: projects/bhyve/sys/arm/ti/omap4/std.omap4
==============================================================================
--- projects/bhyve/sys/arm/ti/omap4/std.omap4 Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/arm/ti/omap4/std.omap4 Wed Jan 9 03:32:23 2013 (r245210)
@@ -19,3 +19,7 @@ options STARTUP_PAGETABLE_ADDR=0x800000
options SOC_OMAP4
options ARM_L2_PIPT
+
+options IPI_IRQ_START=0
+options IPI_IRQ_END=15
+
Modified: projects/bhyve/sys/dev/ath/if_ath_rx.c
==============================================================================
--- projects/bhyve/sys/dev/ath/if_ath_rx.c Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/dev/ath/if_ath_rx.c Wed Jan 9 03:32:23 2013 (r245210)
@@ -210,6 +210,13 @@ ath_calcrxfilter(struct ath_softc *sc)
if (sc->sc_dodfs)
rfilt |= HAL_RX_FILTER_PHYRADAR;
+ /*
+ * Enable spectral PHY errors if requested by the
+ * spectral module.
+ */
+ if (sc->sc_dospectral)
+ rfilt |= HAL_RX_FILTER_PHYRADAR;
+
DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, %s if_flags 0x%x\n",
__func__, rfilt, ieee80211_opmode_name[ic->ic_opmode], ifp->if_flags);
return rfilt;
Modified: projects/bhyve/sys/dev/ath/if_ath_spectral.c
==============================================================================
--- projects/bhyve/sys/dev/ath/if_ath_spectral.c Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/dev/ath/if_ath_spectral.c Wed Jan 9 03:32:23 2013 (r245210)
@@ -73,8 +73,21 @@ __FBSDID("$FreeBSD$");
struct ath_spectral_state {
HAL_SPECTRAL_PARAM spectral_state;
- int spectral_active;
- int spectral_enabled;
+
+ /*
+ * Should we enable spectral scan upon
+ * each network interface reset/change?
+ *
+ * This is intended to allow spectral scan
+ * frame reporting during channel scans.
+ *
+ * Later on it can morph into a larger
+ * scale config method where it pushes
+ * a "channel scan" config into the hardware
+ * rather than just the spectral_state
+ * config.
+ */
+ int spectral_enable_after_reset;
};
/*
@@ -135,7 +148,20 @@ ath_spectral_detach(struct ath_softc *sc
int
ath_spectral_enable(struct ath_softc *sc, struct ieee80211_channel *ch)
{
+ struct ath_spectral_state *ss = sc->sc_spectral;
+ /* Default to disable spectral PHY reporting */
+ sc->sc_dospectral = 0;
+
+ if (ss == NULL)
+ return (0);
+
+ if (ss->spectral_enable_after_reset) {
+ ath_hal_spectral_configure(sc->sc_ah,
+ &ss->spectral_state);
+ (void) ath_hal_spectral_start(sc->sc_ah);
+ sc->sc_dospectral = 1;
+ }
return (0);
}
@@ -158,6 +184,7 @@ ath_ioctl_spectral(struct ath_softc *sc,
HAL_SPECTRAL_PARAM peout;
HAL_SPECTRAL_PARAM *pe;
struct ath_spectral_state *ss = sc->sc_spectral;
+ int val;
if (! ath_hal_spectral_supported(sc->sc_ah))
return (EINVAL);
@@ -212,9 +239,32 @@ ath_ioctl_spectral(struct ath_softc *sc,
ath_hal_spectral_configure(sc->sc_ah,
&ss->spectral_state);
(void) ath_hal_spectral_start(sc->sc_ah);
+ sc->sc_dospectral = 1;
+ /* XXX need to update the PHY mask in the driver */
break;
case SPECTRAL_CONTROL_STOP:
(void) ath_hal_spectral_stop(sc->sc_ah);
+ sc->sc_dospectral = 0;
+ /* XXX need to update the PHY mask in the driver */
+ break;
+ case SPECTRAL_CONTROL_ENABLE_AT_RESET:
+ if (insize < sizeof(int)) {
+ device_printf(sc->sc_dev, "%d != %d\n",
+ insize,
+ (int) sizeof(int));
+ error = EINVAL;
+ break;
+ }
+ if (indata == NULL) {
+ device_printf(sc->sc_dev, "indata=NULL\n");
+ error = EINVAL;
+ break;
+ }
+ val = * ((int *) indata);
+ if (val == 0)
+ ss->spectral_enable_after_reset = 0;
+ else
+ ss->spectral_enable_after_reset = 1;
break;
case SPECTRAL_CONTROL_ENABLE:
/* XXX TODO */
Modified: projects/bhyve/sys/dev/ath/if_athioctl.h
==============================================================================
--- projects/bhyve/sys/dev/ath/if_athioctl.h Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/dev/ath/if_athioctl.h Wed Jan 9 03:32:23 2013 (r245210)
@@ -427,5 +427,7 @@ struct ath_tx_radiotap_header {
#define SPECTRAL_CONTROL_STOP 5
#define SPECTRAL_CONTROL_GET_PARAMS 6
#define SPECTRAL_CONTROL_SET_PARAMS 7
+#define SPECTRAL_CONTROL_ENABLE_AT_RESET 8
+#define SPECTRAL_CONTROL_DISABLE_AT_RESET 9
#endif /* _DEV_ATH_ATHIOCTL_H */
Modified: projects/bhyve/sys/netinet6/scope6.c
==============================================================================
--- projects/bhyve/sys/netinet6/scope6.c Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/sys/netinet6/scope6.c Wed Jan 9 03:32:23 2013 (r245210)
@@ -420,33 +420,34 @@ in6_setscope(struct in6_addr *in6, struc
u_int32_t zoneid = 0;
struct scope6_id *sid;
- IF_AFDATA_RLOCK(ifp);
-
- sid = SID(ifp);
-
-#ifdef DIAGNOSTIC
- if (sid == NULL) { /* should not happen */
- panic("in6_setscope: scope array is NULL");
- /* NOTREACHED */
- }
-#endif
-
/*
* special case: the loopback address can only belong to a loopback
* interface.
*/
if (IN6_IS_ADDR_LOOPBACK(in6)) {
if (!(ifp->if_flags & IFF_LOOPBACK)) {
- IF_AFDATA_RUNLOCK(ifp);
return (EINVAL);
} else {
if (ret_id != NULL)
*ret_id = 0; /* there's no ambiguity */
- IF_AFDATA_RUNLOCK(ifp);
return (0);
}
}
+ if (ret_id == NULL && !IN6_IS_SCOPE_EMBED(in6))
+ return (0);
+
+ IF_AFDATA_RLOCK(ifp);
+
+ sid = SID(ifp);
+
+#ifdef DIAGNOSTIC
+ if (sid == NULL) { /* should not happen */
+ panic("in6_setscope: scope array is NULL");
+ /* NOTREACHED */
+ }
+#endif
+
scope = in6_addrscope(in6);
switch (scope) {
case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */
@@ -474,7 +475,7 @@ in6_setscope(struct in6_addr *in6, struc
if (ret_id != NULL)
*ret_id = zoneid;
- if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6))
+ if (IN6_IS_SCOPE_EMBED(in6))
in6->s6_addr16[1] = htons(zoneid & 0xffff); /* XXX */
return (0);
Modified: projects/bhyve/usr.bin/tail/read.c
==============================================================================
--- projects/bhyve/usr.bin/tail/read.c Wed Jan 9 03:04:15 2013 (r245209)
+++ projects/bhyve/usr.bin/tail/read.c Wed Jan 9 03:32:23 2013 (r245210)
@@ -143,9 +143,8 @@ lines(FILE *fp, const char *fn, off_t of
char *p, *sp;
int blen, cnt, recno, wrap;
- if ((llines = malloc(off * sizeof(*llines))) == NULL)
- err(1, "malloc");
- bzero(llines, off * sizeof(*llines));
+ if ((llines = calloc(off, sizeof(*llines))) == NULL)
+ err(1, "calloc");
p = sp = NULL;
blen = cnt = recno = wrap = 0;
rc = 0;
More information about the svn-src-projects
mailing list