svn commit: r244794 - in user/attilio/membarclean: arm/broadcom/bcm2835 arm/versatile cddl/contrib/opensolaris/uts/common/fs/zfs cddl/dev/dtrace dev/ath dev/ath/ath_hal/ar5416 dev/pci dev/usb dev/u...
Attilio Rao
attilio at FreeBSD.org
Fri Dec 28 22:21:29 UTC 2012
Author: attilio
Date: Fri Dec 28 22:21:25 2012
New Revision: 244794
URL: http://svnweb.freebsd.org/changeset/base/244794
Log:
MFC
Modified:
user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_fb.c
user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_systimer.c
user/attilio/membarclean/arm/versatile/versatile_clcd.c
user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
user/attilio/membarclean/cddl/dev/dtrace/dtrace_debug.c
user/attilio/membarclean/dev/ath/ath_hal/ar5416/ar5416phy.h
user/attilio/membarclean/dev/ath/if_ath.c
user/attilio/membarclean/dev/pci/pci_user.c
user/attilio/membarclean/dev/usb/quirk/usb_quirk.c
user/attilio/membarclean/dev/usb/storage/ustorage_fs.c
user/attilio/membarclean/dev/usb/usb_msctest.c
user/attilio/membarclean/dev/usb/usbdevs
user/attilio/membarclean/dev/usb/wlan/if_urtw.c
user/attilio/membarclean/dev/wbwd/wbwd.c
user/attilio/membarclean/fs/devfs/devfs_vnops.c
user/attilio/membarclean/geom/geom_io.c
user/attilio/membarclean/kern/subr_syscall.c
user/attilio/membarclean/kern/sys_generic.c
user/attilio/membarclean/kern/vfs_mount.c
user/attilio/membarclean/kern/vfs_subr.c
user/attilio/membarclean/net/if_stf.c
user/attilio/membarclean/netgraph/bluetooth/drivers/ubt/ng_ubt.c
user/attilio/membarclean/netinet/in.c
user/attilio/membarclean/netinet/ip_carp.c
user/attilio/membarclean/netinet/sctp_pcb.c
user/attilio/membarclean/netinet/sctp_usrreq.c
user/attilio/membarclean/netinet/sctputil.c
user/attilio/membarclean/netinet/tcp_reass.c
user/attilio/membarclean/netinet/tcp_syncache.c
user/attilio/membarclean/netinet6/in6.c
user/attilio/membarclean/netpfil/ipfw/ip_fw2.c
user/attilio/membarclean/netpfil/ipfw/ip_fw_dynamic.c
user/attilio/membarclean/netpfil/ipfw/ip_fw_log.c
user/attilio/membarclean/netpfil/ipfw/ip_fw_private.h
user/attilio/membarclean/netpfil/pf/if_pflog.c
user/attilio/membarclean/netpfil/pf/if_pfsync.c
user/attilio/membarclean/netpfil/pf/pf.c
user/attilio/membarclean/netpfil/pf/pf_if.c
user/attilio/membarclean/netpfil/pf/pf_ioctl.c
user/attilio/membarclean/netpfil/pf/pf_lb.c
user/attilio/membarclean/netpfil/pf/pf_norm.c
user/attilio/membarclean/netpfil/pf/pf_osfp.c
user/attilio/membarclean/netpfil/pf/pf_ruleset.c
user/attilio/membarclean/netpfil/pf/pf_table.c
user/attilio/membarclean/sys/buf_ring.h
user/attilio/membarclean/sys/file.h
user/attilio/membarclean/tools/vnode_if.awk
Directory Properties:
user/attilio/membarclean/ (props changed)
user/attilio/membarclean/cddl/contrib/opensolaris/ (props changed)
Modified: user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_fb.c
==============================================================================
--- user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -94,6 +94,12 @@ static struct argb bcmfb_palette[16] = {
{0x00, 0xff, 0xff, 0xff}
};
+/* mouse pointer from dev/syscons/scgfbrndr.c */
+static u_char mouse_pointer[16] = {
+ 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68,
+ 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00
+};
+
#define FB_WIDTH 640
#define FB_HEIGHT 480
#define FB_DEPTH 24
@@ -420,10 +426,141 @@ static video_switch_t bcmfbvidsw = {
VIDEO_DRIVER(bcmfb, bcmfbvidsw, bcmfb_configure);
-extern sc_rndr_sw_t txtrndrsw;
-RENDERER(bcmfb, 0, txtrndrsw, gfb_set);
+static vr_init_t bcmrend_init;
+static vr_clear_t bcmrend_clear;
+static vr_draw_border_t bcmrend_draw_border;
+static vr_draw_t bcmrend_draw;
+static vr_set_cursor_t bcmrend_set_cursor;
+static vr_draw_cursor_t bcmrend_draw_cursor;
+static vr_blink_cursor_t bcmrend_blink_cursor;
+static vr_set_mouse_t bcmrend_set_mouse;
+static vr_draw_mouse_t bcmrend_draw_mouse;
+
+/*
+ * We use our own renderer; this is because we must emulate a hardware
+ * cursor.
+ */
+static sc_rndr_sw_t bcmrend = {
+ bcmrend_init,
+ bcmrend_clear,
+ bcmrend_draw_border,
+ bcmrend_draw,
+ bcmrend_set_cursor,
+ bcmrend_draw_cursor,
+ bcmrend_blink_cursor,
+ bcmrend_set_mouse,
+ bcmrend_draw_mouse
+};
+
+RENDERER(bcmfb, 0, bcmrend, gfb_set);
RENDERER_MODULE(bcmfb, gfb_set);
+static void
+bcmrend_init(scr_stat* scp)
+{
+}
+
+static void
+bcmrend_clear(scr_stat* scp, int c, int attr)
+{
+}
+
+static void
+bcmrend_draw_border(scr_stat* scp, int color)
+{
+}
+
+static void
+bcmrend_draw(scr_stat* scp, int from, int count, int flip)
+{
+ video_adapter_t* adp = scp->sc->adp;
+ int i, c, a;
+
+ if (!flip) {
+ /* Normal printing */
+ vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count);
+ } else {
+ /* This is for selections and such: invert the color attribute */
+ for (i = count; i-- > 0; ++from) {
+ c = sc_vtb_getc(&scp->vtb, from);
+ a = sc_vtb_geta(&scp->vtb, from) >> 8;
+ vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4));
+ }
+ }
+}
+
+static void
+bcmrend_set_cursor(scr_stat* scp, int base, int height, int blink)
+{
+}
+
+static void
+bcmrend_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip)
+{
+ video_adapter_t* adp = scp->sc->adp;
+ struct video_adapter_softc *sc;
+ int row, col;
+ uint8_t *addr;
+ int i, j, bytes;
+
+ sc = (struct video_adapter_softc *)adp;
+
+ if (scp->curs_attr.height <= 0)
+ return;
+
+ if (sc->fb_addr == 0)
+ return;
+
+ if (off >= adp->va_info.vi_width * adp->va_info.vi_height)
+ return;
+
+ /* calculate the coordinates in the video buffer */
+ row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight;
+ col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth;
+
+ addr = (uint8_t *)sc->fb_addr
+ + (row + sc->ymargin)*(sc->stride)
+ + (sc->depth/8) * (col + sc->xmargin);
+
+ bytes = sc->depth/8;
+
+ /* our cursor consists of simply inverting the char under it */
+ for (i = 0; i < adp->va_info.vi_cheight; i++) {
+ for (j = 0; j < adp->va_info.vi_cwidth; j++) {
+ switch (sc->depth) {
+ case 32:
+ case 24:
+ addr[bytes*j + 2] ^= 0xff;
+ /* FALLTHROUGH */
+ case 16:
+ addr[bytes*j + 1] ^= 0xff;
+ addr[bytes*j] ^= 0xff;
+ break;
+ default:
+ break;
+ }
+ }
+
+ addr += sc->stride;
+ }
+}
+
+static void
+bcmrend_blink_cursor(scr_stat* scp, int at, int flip)
+{
+}
+
+static void
+bcmrend_set_mouse(scr_stat* scp)
+{
+}
+
+static void
+bcmrend_draw_mouse(scr_stat* scp, int x, int y, int on)
+{
+ vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8);
+}
+
static uint16_t bcmfb_static_window[ROW*COL];
extern u_char dflt_font_16[];
Modified: user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_systimer.c
==============================================================================
--- user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_systimer.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/arm/broadcom/bcm2835/bcm2835_systimer.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
#define DEFAULT_TIMER 3
#define DEFAULT_FREQUENCY 1000000
+#define MIN_PERIOD 100LLU
#define SYSTIMER_CS 0x00
#define SYSTIMER_CLO 0x04
@@ -123,17 +124,24 @@ bcm_systimer_start(struct eventtimer *et
struct systimer *st = et->et_priv;
uint32_t clo;
uint32_t count;
+ register_t s;
if (first != NULL) {
- st->enabled = 1;
count = (st->et.et_frequency * (first->frac >> 32)) >> 32;
if (first->sec != 0)
count += st->et.et_frequency * first->sec;
+ s = intr_disable();
clo = bcm_systimer_tc_read_4(SYSTIMER_CLO);
clo += count;
+ /*
+ * Clear pending interrupts
+ */
+ bcm_systimer_tc_write_4(SYSTIMER_CS, (1 << st->index));
bcm_systimer_tc_write_4(SYSTIMER_C0 + st->index*4, clo);
+ st->enabled = 1;
+ intr_restore(s);
return (0);
}
@@ -154,7 +162,13 @@ static int
bcm_systimer_intr(void *arg)
{
struct systimer *st = (struct systimer *)arg;
+ uint32_t cs;
+
+ cs = bcm_systimer_tc_read_4(SYSTIMER_CS);
+ if ((cs & (1 << st->index)) == 0)
+ return (FILTER_STRAY);
+ /* ACK interrupt */
bcm_systimer_tc_write_4(SYSTIMER_CS, (1 << st->index));
if (st->enabled) {
if (st->et.et_active) {
@@ -226,7 +240,7 @@ bcm_systimer_attach(device_t dev)
sc->st[DEFAULT_TIMER].et.et_frequency = sc->sysclk_freq;
sc->st[DEFAULT_TIMER].et.et_min_period.sec = 0;
sc->st[DEFAULT_TIMER].et.et_min_period.frac =
- ((0x00000002LLU << 32) / sc->st[DEFAULT_TIMER].et.et_frequency) << 32;
+ ((MIN_PERIOD << 32) / sc->st[DEFAULT_TIMER].et.et_frequency) << 32;
sc->st[DEFAULT_TIMER].et.et_max_period.sec = 0xfffffff0U / sc->st[DEFAULT_TIMER].et.et_frequency;
sc->st[DEFAULT_TIMER].et.et_max_period.frac =
((0xfffffffeLLU << 32) / sc->st[DEFAULT_TIMER].et.et_frequency) << 32;
Modified: user/attilio/membarclean/arm/versatile/versatile_clcd.c
==============================================================================
--- user/attilio/membarclean/arm/versatile/versatile_clcd.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/arm/versatile/versatile_clcd.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -194,6 +194,12 @@ static struct argb versatilefb_palette[1
{0x00, 0xff, 0xff, 0xff}
};
+/* mouse pointer from dev/syscons/scgfbrndr.c */
+static u_char mouse_pointer[16] = {
+ 0x00, 0x40, 0x60, 0x70, 0x78, 0x7c, 0x7e, 0x68,
+ 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00
+};
+
#define FB_WIDTH 640
#define FB_HEIGHT 480
#define FB_DEPTH 16
@@ -450,10 +456,131 @@ static video_switch_t versatilefbvidsw =
VIDEO_DRIVER(versatilefb, versatilefbvidsw, versatilefb_configure);
-extern sc_rndr_sw_t txtrndrsw;
-RENDERER(versatilefb, 0, txtrndrsw, gfb_set);
+static vr_init_t clcdr_init;
+static vr_clear_t clcdr_clear;
+static vr_draw_border_t clcdr_draw_border;
+static vr_draw_t clcdr_draw;
+static vr_set_cursor_t clcdr_set_cursor;
+static vr_draw_cursor_t clcdr_draw_cursor;
+static vr_blink_cursor_t clcdr_blink_cursor;
+static vr_set_mouse_t clcdr_set_mouse;
+static vr_draw_mouse_t clcdr_draw_mouse;
+
+/*
+ * We use our own renderer; this is because we must emulate a hardware
+ * cursor.
+ */
+static sc_rndr_sw_t clcdrend = {
+ clcdr_init,
+ clcdr_clear,
+ clcdr_draw_border,
+ clcdr_draw,
+ clcdr_set_cursor,
+ clcdr_draw_cursor,
+ clcdr_blink_cursor,
+ clcdr_set_mouse,
+ clcdr_draw_mouse
+};
+
+RENDERER(versatilefb, 0, clcdrend, gfb_set);
RENDERER_MODULE(versatilefb, gfb_set);
+static void
+clcdr_init(scr_stat* scp)
+{
+}
+
+static void
+clcdr_clear(scr_stat* scp, int c, int attr)
+{
+}
+
+static void
+clcdr_draw_border(scr_stat* scp, int color)
+{
+}
+
+static void
+clcdr_draw(scr_stat* scp, int from, int count, int flip)
+{
+ video_adapter_t* adp = scp->sc->adp;
+ int i, c, a;
+
+ if (!flip) {
+ /* Normal printing */
+ vidd_puts(adp, from, (uint16_t*)sc_vtb_pointer(&scp->vtb, from), count);
+ } else {
+ /* This is for selections and such: invert the color attribute */
+ for (i = count; i-- > 0; ++from) {
+ c = sc_vtb_getc(&scp->vtb, from);
+ a = sc_vtb_geta(&scp->vtb, from) >> 8;
+ vidd_putc(adp, from, c, (a >> 4) | ((a & 0xf) << 4));
+ }
+ }
+}
+
+static void
+clcdr_set_cursor(scr_stat* scp, int base, int height, int blink)
+{
+}
+
+static void
+clcdr_draw_cursor(scr_stat* scp, int off, int blink, int on, int flip)
+{
+ video_adapter_t* adp = scp->sc->adp;
+ struct video_adapter_softc *sc;
+ int row, col;
+ uint8_t *addr;
+ int i,j;
+
+ sc = (struct video_adapter_softc *)adp;
+
+ if (scp->curs_attr.height <= 0)
+ return;
+
+ if (sc->fb_addr == 0)
+ return;
+
+ if (off >= adp->va_info.vi_width * adp->va_info.vi_height)
+ return;
+
+ /* calculate the coordinates in the video buffer */
+ row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight;
+ col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth;
+
+ addr = (uint8_t *)sc->fb_addr
+ + (row + sc->ymargin)*(sc->stride)
+ + (sc->depth/8) * (col + sc->xmargin);
+
+ /* our cursor consists of simply inverting the char under it */
+ for (i = 0; i < adp->va_info.vi_cheight; i++) {
+ for (j = 0; j < adp->va_info.vi_cwidth; j++) {
+
+ addr[2*j] ^= 0xff;
+ addr[2*j + 1] ^= 0xff;
+ }
+
+ addr += sc->stride;
+ }
+}
+
+static void
+clcdr_blink_cursor(scr_stat* scp, int at, int flip)
+{
+}
+
+static void
+clcdr_set_mouse(scr_stat* scp)
+{
+}
+
+static void
+clcdr_draw_mouse(scr_stat* scp, int x, int y, int on)
+{
+ vidd_putm(scp->sc->adp, x, y, mouse_pointer, 0xffffffff, 16, 8);
+
+}
+
static uint16_t versatilefb_static_window[ROW*COL];
extern u_char dflt_font_16[];
@@ -629,6 +756,7 @@ versatilefb_read_hw_cursor(video_adapter
static int
versatilefb_set_hw_cursor(video_adapter_t *adp, int col, int row)
{
+
return (0);
}
@@ -753,6 +881,9 @@ versatilefb_putc(video_adapter_t *adp, v
if (sc->fb_addr == 0)
return (0);
+ if (off >= adp->va_info.vi_width * adp->va_info.vi_height)
+ return (0);
+
row = (off / adp->va_info.vi_width) * adp->va_info.vi_cheight;
col = (off % adp->va_info.vi_width) * adp->va_info.vi_cwidth;
p = sc->font + c*VERSATILE_FONT_HEIGHT;
Modified: user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -3799,7 +3799,7 @@ spa_generate_rootconf(const char *name)
nvlist_lookup_uint64_array(best_cfg, ZPOOL_CONFIG_HOLE_ARRAY,
&holes, &nholes);
- tops = kmem_alloc(nchildren * sizeof(void *), KM_SLEEP | KM_ZERO);
+ tops = kmem_zalloc(nchildren * sizeof(void *), KM_SLEEP);
for (i = 0; i < nchildren; i++) {
if (i >= count)
break;
Modified: user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
==============================================================================
--- user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -300,8 +300,8 @@ resize_configs(nvlist_t ***configs, uint
if (id < *count)
return;
- new_configs = kmem_alloc((id + 1) * sizeof(nvlist_t *),
- KM_SLEEP | KM_ZERO);
+ new_configs = kmem_zalloc((id + 1) * sizeof(nvlist_t *),
+ KM_SLEEP);
for (i = 0; i < *count; i++)
new_configs[i] = (*configs)[i];
if (*configs != NULL)
Modified: user/attilio/membarclean/cddl/dev/dtrace/dtrace_debug.c
==============================================================================
--- user/attilio/membarclean/cddl/dev/dtrace/dtrace_debug.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/cddl/dev/dtrace/dtrace_debug.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -33,11 +33,10 @@
#include <machine/atomic.h>
-#define dtrace_cmpset_long atomic_cmpset_long
-
#define DTRACE_DEBUG_BUFR_SIZE (32 * 1024)
struct dtrace_debug_data {
+ uintptr_t lock __aligned(CACHE_LINE_SIZE);
char bufr[DTRACE_DEBUG_BUFR_SIZE];
char *first;
char *last;
@@ -46,20 +45,22 @@ struct dtrace_debug_data {
static char dtrace_debug_bufr[DTRACE_DEBUG_BUFR_SIZE];
-static volatile u_long dtrace_debug_flag[MAXCPU];
-
static void
dtrace_debug_lock(int cpu)
{
- while (dtrace_cmpset_long(&dtrace_debug_flag[cpu], 0, 1) == 0)
- /* Loop until the lock is obtained. */
+ uintptr_t tid;
+
+ tid = (uintptr_t)curthread;
+ spinlock_enter();
+ while (atomic_cmpset_acq_ptr(&dtrace_debug_data[cpu].lock, 0, tid) == 0) /* Loop until the lock is obtained. */
;
}
static void
dtrace_debug_unlock(int cpu)
{
- dtrace_debug_flag[cpu] = 0;
+ atomic_store_rel_ptr(&dtrace_debug_data[cpu].lock, 0);
+ spinlock_exit();
}
static void
@@ -151,10 +152,11 @@ dtrace_debug_output(void)
*/
static __inline void
-dtrace_debug__putc(char c)
+dtrace_debug__putc(int cpu, char c)
{
- struct dtrace_debug_data *d = &dtrace_debug_data[curcpu];
+ struct dtrace_debug_data *d;
+ d = &dtrace_debug_data[cpu];
*d->next++ = c;
if (d->next == d->last)
@@ -172,24 +174,30 @@ dtrace_debug__putc(char c)
static void __used
dtrace_debug_putc(char c)
{
- dtrace_debug_lock(curcpu);
+ int cpu;
+
+ cpu = curcpu;
+ dtrace_debug_lock(cpu);
- dtrace_debug__putc(c);
+ dtrace_debug__putc(cpu, c);
- dtrace_debug_unlock(curcpu);
+ dtrace_debug_unlock(cpu);
}
static void __used
dtrace_debug_puts(const char *s)
{
- dtrace_debug_lock(curcpu);
+ int cpu;
+
+ cpu = curcpu;
+ dtrace_debug_lock(cpu);
while (*s != '\0')
- dtrace_debug__putc(*s++);
+ dtrace_debug__putc(cpu, *s++);
- dtrace_debug__putc('\0');
+ dtrace_debug__putc(cpu, '\0');
- dtrace_debug_unlock(curcpu);
+ dtrace_debug_unlock(cpu);
}
/*
@@ -219,7 +227,7 @@ dtrace_debug_ksprintn(char *nbuf, uintma
#define MAXNBUF (sizeof(intmax_t) * NBBY + 1)
static void
-dtrace_debug_vprintf(const char *fmt, va_list ap)
+dtrace_debug_vprintf(int cpu, const char *fmt, va_list ap)
{
char nbuf[MAXNBUF];
const char *p, *percent, *q;
@@ -243,10 +251,10 @@ dtrace_debug_vprintf(const char *fmt, va
width = 0;
while ((ch = (u_char)*fmt++) != '%' || stop) {
if (ch == '\0') {
- dtrace_debug__putc('\0');
+ dtrace_debug__putc(cpu, '\0');
return;
}
- dtrace_debug__putc(ch);
+ dtrace_debug__putc(cpu, ch);
}
percent = fmt - 1;
qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0;
@@ -266,7 +274,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
ladjust = 1;
goto reswitch;
case '%':
- dtrace_debug__putc(ch);
+ dtrace_debug__putc(cpu, ch);
break;
case '*':
if (!dot) {
@@ -301,7 +309,7 @@ reswitch: switch (ch = (u_char)*fmt++) {
num = (u_int)va_arg(ap, int);
p = va_arg(ap, char *);
for (q = dtrace_debug_ksprintn(nbuf, num, *p++, NULL, 0); *q;)
- dtrace_debug__putc(*q--);
+ dtrace_debug__putc(cpu, *q--);
if (num == 0)
break;
@@ -309,19 +317,19 @@ reswitch: switch (ch = (u_char)*fmt++) {
for (tmp = 0; *p;) {
n = *p++;
if (num & (1 << (n - 1))) {
- dtrace_debug__putc(tmp ? ',' : '<');
+ dtrace_debug__putc(cpu, tmp ? ',' : '<');
for (; (n = *p) > ' '; ++p)
- dtrace_debug__putc(n);
+ dtrace_debug__putc(cpu, n);
tmp = 1;
} else
for (; *p > ' '; ++p)
continue;
}
if (tmp)
- dtrace_debug__putc('>');
+ dtrace_debug__putc(cpu, '>');
break;
case 'c':
- dtrace_debug__putc(va_arg(ap, int));
+ dtrace_debug__putc(cpu, va_arg(ap, int));
break;
case 'D':
up = va_arg(ap, u_char *);
@@ -329,12 +337,12 @@ reswitch: switch (ch = (u_char)*fmt++) {
if (!width)
width = 16;
while(width--) {
- dtrace_debug__putc(hex2ascii(*up >> 4));
- dtrace_debug__putc(hex2ascii(*up & 0x0f));
+ dtrace_debug__putc(cpu, hex2ascii(*up >> 4));
+ dtrace_debug__putc(cpu, hex2ascii(*up & 0x0f));
up++;
if (width)
for (q=p;*q;q++)
- dtrace_debug__putc(*q);
+ dtrace_debug__putc(cpu, *q);
}
break;
case 'd':
@@ -406,12 +414,12 @@ reswitch: switch (ch = (u_char)*fmt++) {
if (!ladjust && width > 0)
while (width--)
- dtrace_debug__putc(padc);
+ dtrace_debug__putc(cpu, padc);
while (n--)
- dtrace_debug__putc(*p++);
+ dtrace_debug__putc(cpu, *p++);
if (ladjust && width > 0)
while (width--)
- dtrace_debug__putc(padc);
+ dtrace_debug__putc(cpu, padc);
break;
case 't':
tflag = 1;
@@ -485,32 +493,32 @@ number:
if (!ladjust && padc != '0' && width
&& (width -= tmp) > 0)
while (width--)
- dtrace_debug__putc(padc);
+ dtrace_debug__putc(cpu, padc);
if (neg)
- dtrace_debug__putc('-');
+ dtrace_debug__putc(cpu, '-');
if (sharpflag && num != 0) {
if (base == 8) {
- dtrace_debug__putc('0');
+ dtrace_debug__putc(cpu, '0');
} else if (base == 16) {
- dtrace_debug__putc('0');
- dtrace_debug__putc('x');
+ dtrace_debug__putc(cpu, '0');
+ dtrace_debug__putc(cpu, 'x');
}
}
if (!ladjust && width && (width -= tmp) > 0)
while (width--)
- dtrace_debug__putc(padc);
+ dtrace_debug__putc(cpu, padc);
while (*p)
- dtrace_debug__putc(*p--);
+ dtrace_debug__putc(cpu, *p--);
if (ladjust && width && (width -= tmp) > 0)
while (width--)
- dtrace_debug__putc(padc);
+ dtrace_debug__putc(cpu, padc);
break;
default:
while (percent < fmt)
- dtrace_debug__putc(*percent++);
+ dtrace_debug__putc(cpu, *percent++);
/*
* Since we ignore an formatting argument it is no
* longer safe to obey the remaining formatting
@@ -522,23 +530,25 @@ number:
}
}
- dtrace_debug__putc('\0');
+ dtrace_debug__putc(cpu, '\0');
}
void
dtrace_debug_printf(const char *fmt, ...)
{
va_list ap;
+ int cpu;
- dtrace_debug_lock(curcpu);
+ cpu = curcpu;
+ dtrace_debug_lock(cpu);
va_start(ap, fmt);
- dtrace_debug_vprintf(fmt, ap);
+ dtrace_debug_vprintf(cpu, fmt, ap);
va_end(ap);
- dtrace_debug_unlock(curcpu);
+ dtrace_debug_unlock(cpu);
}
#else
Modified: user/attilio/membarclean/dev/ath/ath_hal/ar5416/ar5416phy.h
==============================================================================
--- user/attilio/membarclean/dev/ath/ath_hal/ar5416/ar5416phy.h Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/ath/ath_hal/ar5416/ar5416phy.h Fri Dec 28 22:21:25 2012 (r244794)
@@ -57,6 +57,20 @@
#define AR_BT_DISABLE_BT_ANT 0x00100000
#define AR_BT_DISABLE_BT_ANT_S 20
+#define AR_PHY_SPECTRAL_SCAN 0x9910
+#define AR_PHY_SPECTRAL_SCAN_ENA 0x00000001
+#define AR_PHY_SPECTRAL_SCAN_ENA_S 0
+#define AR_PHY_SPECTRAL_SCAN_ACTIVE 0x00000002
+#define AR_PHY_SPECTRAL_SCAN_ACTIVE_S 1
+#define AR_PHY_SPECTRAL_SCAN_FFT_PERIOD 0x000000F0
+#define AR_PHY_SPECTRAL_SCAN_FFT_PERIOD_S 4
+#define AR_PHY_SPECTRAL_SCAN_PERIOD 0x0000FF00
+#define AR_PHY_SPECTRAL_SCAN_PERIOD_S 8
+#define AR_PHY_SPECTRAL_SCAN_COUNT 0x00FF0000
+#define AR_PHY_SPECTRAL_SCAN_COUNT_S 16
+#define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT 0x01000000
+#define AR_PHY_SPECTRAL_SCAN_SHORT_REPEAT_S 24
+
/* For AR_PHY_RADAR0 */
#define AR_PHY_RADAR_0_FFT_ENA 0x80000000
@@ -64,6 +78,8 @@
#define AR_PHY_RADAR_EXT_ENA 0x00004000
#define AR_PHY_RADAR_1 0x9958
+#define AR_PHY_RADAR_1_BIN_THRESH_SEL 0x07000000
+#define AR_PHY_RADAR_1_BIN_THRESH_SEL_S 24
#define AR_PHY_RADAR_1_RELPWR_ENA 0x00800000
#define AR_PHY_RADAR_1_USE_FIR128 0x00400000
#define AR_PHY_RADAR_1_RELPWR_THRESH 0x003F0000
Modified: user/attilio/membarclean/dev/ath/if_ath.c
==============================================================================
--- user/attilio/membarclean/dev/ath/if_ath.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/ath/if_ath.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -5620,7 +5620,7 @@ ath_node_set_tim(struct ieee80211_node *
struct ath_vap *avp = ATH_VAP(ni->ni_vap);
/*
- * Some operating omdes don't set av_set_tim(), so don't
+ * Some operating modes don't set av_set_tim(), so don't
* update it here.
*/
if (avp->av_set_tim == NULL)
Modified: user/attilio/membarclean/dev/pci/pci_user.c
==============================================================================
--- user/attilio/membarclean/dev/pci/pci_user.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/pci/pci_user.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -425,12 +425,12 @@ pci_ioctl(struct cdev *dev, u_long cmd,
#ifdef COMPAT_FREEBSD32
struct pci_conf_io32 *cio32 = NULL;
struct pci_conf_old32 conf_old32;
- struct pci_match_conf_old32 *pattern_buf_old32;
+ struct pci_match_conf_old32 *pattern_buf_old32 = NULL;
#endif
struct pci_conf_old conf_old;
struct pci_io iodata;
struct pci_io_old *io_old;
- struct pci_match_conf_old *pattern_buf_old;
+ struct pci_match_conf_old *pattern_buf_old = NULL;
io_old = NULL;
@@ -470,10 +470,8 @@ pci_ioctl(struct cdev *dev, u_long cmd,
#ifdef PRE7_COMPAT
#ifdef COMPAT_FREEBSD32
case PCIOCGETCONF_OLD32:
- pattern_buf_old32 = NULL;
#endif
case PCIOCGETCONF_OLD:
- pattern_buf_old = NULL;
#endif
case PCIOCGETCONF:
Modified: user/attilio/membarclean/dev/usb/quirk/usb_quirk.c
==============================================================================
--- user/attilio/membarclean/dev/usb/quirk/usb_quirk.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/usb/quirk/usb_quirk.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -482,6 +482,7 @@ static struct usb_quirk_entry usb_quirks
* after issuing non-supported commands:
*/
USB_QUIRK(ALCOR, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_TEST_UNIT_READY, UQ_MATCH_VENDOR_ONLY),
+ USB_QUIRK(APPLE, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
USB_QUIRK(FEIYA, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
USB_QUIRK(REALTEK, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
USB_QUIRK(INITIO, DUMMY, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE, UQ_MATCH_VENDOR_ONLY),
Modified: user/attilio/membarclean/dev/usb/storage/ustorage_fs.c
==============================================================================
--- user/attilio/membarclean/dev/usb/storage/ustorage_fs.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/usb/storage/ustorage_fs.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -603,6 +603,8 @@ tr_setup:
usbd_xfer_set_stall(xfer);
DPRINTF("stall pipe\n");
}
+ usbd_xfer_set_frame_len(xfer, 0,
+ sizeof(ustorage_fs_bbb_cbw_t));
usbd_transfer_submit(xfer);
break;
@@ -827,6 +829,8 @@ tr_setup:
sc->sc_transfer.data_error = 0;
usbd_xfer_set_stall(xfer);
}
+ usbd_xfer_set_frame_len(xfer, 0,
+ sizeof(ustorage_fs_bbb_csw_t));
usbd_transfer_submit(xfer);
break;
Modified: user/attilio/membarclean/dev/usb/usb_msctest.c
==============================================================================
--- user/attilio/membarclean/dev/usb/usb_msctest.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/usb/usb_msctest.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -83,7 +83,7 @@ enum {
DIR_NONE,
};
-#define SCSI_MAX_LEN 0x100
+#define SCSI_MAX_LEN MAX(0x100, BULK_SIZE)
#define SCSI_INQ_LEN 0x24
#define SCSI_SENSE_LEN 0xFF
@@ -150,6 +150,7 @@ struct bbb_transfer {
usb_size_t data_rem; /* bytes */
usb_timeout_t data_timeout; /* ms */
usb_frlength_t actlen; /* bytes */
+ usb_frlength_t buffer_size; /* bytes */
uint8_t cmd_len; /* bytes */
uint8_t dir;
@@ -192,7 +193,7 @@ static const struct usb_config bbb_confi
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
- .bufsize = MAX(SCSI_MAX_LEN, BULK_SIZE),
+ .bufsize = SCSI_MAX_LEN,
.flags = {.proxy_buffer = 1,.short_xfer_ok = 1,},
.callback = &bbb_data_read_callback,
.timeout = 4 * USB_MS_HZ, /* 4 seconds */
@@ -211,7 +212,7 @@ static const struct usb_config bbb_confi
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
- .bufsize = BULK_SIZE,
+ .bufsize = SCSI_MAX_LEN,
.flags = {.ext_buffer = 1,.proxy_buffer = 1,},
.callback = &bbb_data_write_callback,
.timeout = 4 * USB_MS_HZ, /* 4 seconds */
@@ -299,6 +300,8 @@ bbb_command_callback(struct usb_xfer *xf
sc->cbw->bCDBLength = sizeof(sc->cbw->CBWCDB);
DPRINTFN(0, "Truncating long command\n");
}
+ usbd_xfer_set_frame_len(xfer, 0,
+ sizeof(struct bbb_cbw));
usbd_transfer_submit(xfer);
break;
@@ -385,7 +388,7 @@ bbb_data_write_callback(struct usb_xfer
if (sc->data_rem == 0) {
bbb_transfer_start(sc, ST_STATUS);
- return;
+ break;
}
if (max_bulk > sc->data_rem) {
max_bulk = sc->data_rem;
@@ -393,7 +396,7 @@ bbb_data_write_callback(struct usb_xfer
usbd_xfer_set_timeout(xfer, sc->data_timeout);
usbd_xfer_set_frame_data(xfer, 0, sc->data_ptr, max_bulk);
usbd_transfer_submit(xfer);
- return;
+ break;
default: /* Error */
if (error == USB_ERR_CANCELLED) {
@@ -401,8 +404,7 @@ bbb_data_write_callback(struct usb_xfer
} else {
bbb_transfer_start(sc, ST_DATA_WR_CS);
}
- return;
-
+ break;
}
}
@@ -437,6 +439,8 @@ bbb_status_callback(struct usb_xfer *xfe
break;
case USB_ST_SETUP:
+ usbd_xfer_set_frame_len(xfer, 0,
+ sizeof(struct bbb_csw));
usbd_transfer_submit(xfer);
break;
@@ -553,6 +557,8 @@ bbb_attach(struct usb_device *udev, uint
/* store pointer to DMA buffers */
sc->buffer = usbd_xfer_get_frame_buffer(
sc->xfer[ST_DATA_RD], 0);
+ sc->buffer_size =
+ usbd_xfer_max_len(sc->xfer[ST_DATA_RD]);
sc->cbw = usbd_xfer_get_frame_buffer(
sc->xfer[ST_COMMAND], 0);
sc->csw = usbd_xfer_get_frame_buffer(
@@ -833,8 +839,8 @@ usb_msc_eject(struct usb_device *udev, u
* TCTMobile needs DIR_IN flag. To get it, we
* supply a dummy data with the command.
*/
- err = bbb_command_start(sc, DIR_IN, 0, &sc->buffer,
- sizeof(sc->buffer), &scsi_tct_eject,
+ err = bbb_command_start(sc, DIR_IN, 0, sc->buffer,
+ sc->buffer_size, &scsi_tct_eject,
sizeof(scsi_tct_eject), USB_MS_HZ);
break;
default:
Modified: user/attilio/membarclean/dev/usb/usbdevs
==============================================================================
--- user/attilio/membarclean/dev/usb/usbdevs Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/usb/usbdevs Fri Dec 28 22:21:25 2012 (r244794)
@@ -1050,6 +1050,7 @@ product AOX USB101 0x0008 Ethernet
product APC UPS 0x0002 Uninterruptible Power Supply
/* Apple Computer products */
+product APPLE DUMMY 0x0000 Dummy product
product APPLE IMAC_KBD 0x0201 USB iMac Keyboard
product APPLE KBD 0x0202 USB Keyboard M2452
product APPLE EXT_KBD 0x020c Apple Extended USB Keyboard
Modified: user/attilio/membarclean/dev/usb/wlan/if_urtw.c
==============================================================================
--- user/attilio/membarclean/dev/usb/wlan/if_urtw.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/usb/wlan/if_urtw.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -4127,6 +4127,7 @@ urtw_bulk_tx_status_callback(struct usb_
case USB_ST_SETUP:
setup:
memcpy(dma_buf, &sc->sc_txstatus, sizeof(uint64_t));
+ usbd_xfer_set_frame_len(xfer, 0, sizeof(uint64_t));
usbd_transfer_submit(xfer);
break;
default:
Modified: user/attilio/membarclean/dev/wbwd/wbwd.c
==============================================================================
--- user/attilio/membarclean/dev/wbwd/wbwd.c Fri Dec 28 22:18:41 2012 (r244793)
+++ user/attilio/membarclean/dev/wbwd/wbwd.c Fri Dec 28 22:21:25 2012 (r244794)
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2011 Sandvine Incorporated ULC.
+ * Copyright (c) 2012 iXsystems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -93,15 +94,6 @@ __FBSDID("$FreeBSD$");
#define WB_LDN8_CRF7_CLEAR_MASK \
(WB_LDN8_CRF7_MOUSE|WB_LDN8_CRF7_KEYB|WB_LDN8_CRF7_TS|WB_LDN8_CRF7_IRQS)
-#define write_efir_1(sc, value) \
- bus_space_write_1((sc)->bst, (sc)->bsh, 0, (value))
-#define read_efir_1(sc) \
- bus_space_read_1((sc)->bst, (sc)->bsh, 0)
-#define write_efdr_1(sc, value) \
- bus_space_write_1((sc)->bst, (sc)->bsh, 1, (value))
-#define read_efdr_1(sc) \
- bus_space_read_1((sc)->bst, (sc)->bsh, 1)
-
struct wb_softc {
device_t dev;
struct resource *portres;
@@ -109,8 +101,8 @@ struct wb_softc {
bus_space_handle_t bsh;
int rid;
eventhandler_tag ev_tag;
- int (*ext_cfg_enter_f)(struct wb_softc *);
- void (*ext_cfg_exit_f)(struct wb_softc *);
+ int (*ext_cfg_enter_f)(struct wb_softc *, u_short);
+ void (*ext_cfg_exit_f)(struct wb_softc *, u_short);
int debug_verbose;
/*
@@ -131,13 +123,13 @@ struct wb_softc {
uint8_t reg_2;
};
-static int ext_cfg_enter_0x87_0x87(struct wb_softc *);
-static void ext_cfg_exit_0xaa(struct wb_softc *);
+static int ext_cfg_enter_0x87_0x87(struct wb_softc *, u_short);
+static void ext_cfg_exit_0xaa(struct wb_softc *, u_short);
struct winbond_superio_cfg {
uint8_t efer; /* and efir */
- int (*ext_cfg_enter_f)(struct wb_softc *);
- void (*ext_cfg_exit_f)(struct wb_softc *);
+ int (*ext_cfg_enter_f)(struct wb_softc *, u_short);
+ void (*ext_cfg_exit_f)(struct wb_softc *, u_short);
} probe_addrs[] = {
{
.efer = 0x2e,
@@ -189,6 +181,50 @@ struct winbond_vendor_device_id {
},
};
+static void
+write_efir_1(struct wb_softc *sc, u_short baseport, uint8_t value)
+{
+
+ MPASS(sc != NULL || baseport != 0);
+ if (sc != NULL)
+ bus_space_write_1((sc)->bst, (sc)->bsh, 0, (value));
+ else
+ outb(baseport, value);
+}
+
+static uint8_t __unused
+read_efir_1(struct wb_softc *sc, u_short baseport)
+{
+
+ MPASS(sc != NULL || baseport != 0);
+ if (sc != NULL)
+ return (bus_space_read_1((sc)->bst, (sc)->bsh, 0));
+ else
+ return (inb(baseport));
+}
+
+static void
+write_efdr_1(struct wb_softc *sc, u_short baseport, uint8_t value)
+{
+
+ MPASS(sc != NULL || baseport != 0);
+ if (sc != NULL)
+ bus_space_write_1((sc)->bst, (sc)->bsh, 1, (value));
+ else
+ outb(baseport + 1, value);
+}
+
+static uint8_t
+read_efdr_1(struct wb_softc *sc, u_short baseport)
+{
+
+ MPASS(sc != NULL || baseport != 0);
+ if (sc != NULL)
+ return (bus_space_read_1((sc)->bst, (sc)->bsh, 1));
+ else
+ return (inb(baseport + 1));
+}
+
/*
* Return the watchdog related registers as we last read them. This will
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list