summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/vm_machdep.c7
-rw-r--r--sys/arm/arm/pl310.c7
-rw-r--r--sys/arm/include/pcpu.h4
-rw-r--r--sys/arm/ti/omap4/std.omap44
-rw-r--r--sys/dev/ath/if_ath_rx.c7
-rw-r--r--sys/dev/ath/if_ath_spectral.c54
-rw-r--r--sys/dev/ath/if_athioctl.h2
-rw-r--r--sys/netinet6/scope6.c29
-rw-r--r--usr.bin/tail/read.c5
9 files changed, 87 insertions, 32 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index a40eaba..9883715 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -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);
diff --git a/sys/arm/arm/pl310.c b/sys/arm/arm/pl310.c
index 4e78375..9d4fc4a 100644
--- a/sys/arm/arm/pl310.c
+++ b/sys/arm/arm/pl310.c
@@ -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;
diff --git a/sys/arm/include/pcpu.h b/sys/arm/include/pcpu.h
index f12f903..43ffb44 100644
--- a/sys/arm/include/pcpu.h
+++ b/sys/arm/include/pcpu.h
@@ -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 */
diff --git a/sys/arm/ti/omap4/std.omap4 b/sys/arm/ti/omap4/std.omap4
index 056a823..bbdd432 100644
--- a/sys/arm/ti/omap4/std.omap4
+++ b/sys/arm/ti/omap4/std.omap4
@@ -19,3 +19,7 @@ options STARTUP_PAGETABLE_ADDR=0x80000000
options SOC_OMAP4
options ARM_L2_PIPT
+
+options IPI_IRQ_START=0
+options IPI_IRQ_END=15
+
diff --git a/sys/dev/ath/if_ath_rx.c b/sys/dev/ath/if_ath_rx.c
index 78f19e2..5a39d16 100644
--- a/sys/dev/ath/if_ath_rx.c
+++ b/sys/dev/ath/if_ath_rx.c
@@ -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;
diff --git a/sys/dev/ath/if_ath_spectral.c b/sys/dev/ath/if_ath_spectral.c
index 0dc0114..5cfb1a9 100644
--- a/sys/dev/ath/if_ath_spectral.c
+++ b/sys/dev/ath/if_ath_spectral.c
@@ -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, struct ath_diag *ad)
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, struct ath_diag *ad)
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 */
diff --git a/sys/dev/ath/if_athioctl.h b/sys/dev/ath/if_athioctl.h
index d6adf94..f7b8600 100644
--- a/sys/dev/ath/if_athioctl.h
+++ b/sys/dev/ath/if_athioctl.h
@@ -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 */
diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c
index 060fe59..74d034e 100644
--- a/sys/netinet6/scope6.c
+++ b/sys/netinet6/scope6.c
@@ -420,33 +420,34 @@ in6_setscope(struct in6_addr *in6, struct ifnet *ifp, u_int32_t *ret_id)
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, struct ifnet *ifp, u_int32_t *ret_id)
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);
diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c
index 2cff3a3..79c4fa5 100644
--- a/usr.bin/tail/read.c
+++ b/usr.bin/tail/read.c
@@ -143,9 +143,8 @@ lines(FILE *fp, const char *fn, off_t off)
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;
OpenPOWER on IntegriCloud