svn commit: r205003 - head/sys/dev/siba
Author: thompsa Date: Thu Mar 11 08:03:56 2010 New Revision: 205003 URL: http://svn.freebsd.org/changeset/base/205003 Log: Revert r204992 and just wrap it all in ifdef INVARIANTS to fix the debug and non-debug cases. Modified: head/sys/dev/siba/siba_core.c Modified: head/sys/dev/siba/siba_core.c == --- head/sys/dev/siba/siba_core.c Thu Mar 11 07:46:17 2010 (r205002) +++ head/sys/dev/siba/siba_core.c Thu Mar 11 08:03:56 2010 (r205003) @@ -2031,11 +2031,13 @@ siba_pcie_mdio_write(struct siba_pci *sp uint32_t siba_dma_translation(device_t dev) { +#ifdef INVARIANTS + struct siba_dev_softc *sd = device_get_ivars(dev); + struct siba_softc *siba = sd-sd_bus; - KASSERT(device_get_ivars(dev)-sd_bus-siba_type == SIBA_TYPE_PCI, - (unsupported bustype %d\n, -device_get_ivars(dev)-sd_bus-siba_type)); - + KASSERT(siba-siba_type == SIBA_TYPE_PCI, + (unsupported bustype %d\n, siba-siba_type)); +#endif return (SIBA_PCI_DMA); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205005 - head/sys/dev/usb/controller
Author: thompsa Date: Thu Mar 11 08:33:39 2010 New Revision: 205005 URL: http://svn.freebsd.org/changeset/base/205005 Log: Wrap the proc wakeup special case for ddb in ifdef DDB. Submitted by: Giovanni Trematerra Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c == --- head/sys/dev/usb/controller/usb_controller.cThu Mar 11 08:30:05 2010(r205004) +++ head/sys/dev/usb/controller/usb_controller.cThu Mar 11 08:33:39 2010(r205005) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include opt_ddb.h + #include sys/stdint.h #include sys/stddef.h #include sys/param.h @@ -220,6 +222,7 @@ usb_bus_explore(struct usb_proc_msg *pm) bus-driver_added_refcount = 1; } +#ifdef DDB /* * The following three lines of code are only here to * recover from DDB: @@ -227,6 +230,7 @@ usb_bus_explore(struct usb_proc_msg *pm) usb_proc_rewakeup(bus-control_xfer_proc); usb_proc_rewakeup(bus-giant_callback_proc); usb_proc_rewakeup(bus-non_giant_callback_proc); +#endif USB_BUS_UNLOCK(bus); @@ -289,11 +293,13 @@ usb_power_wdog(void *arg) usb_callout_reset(bus-power_wdog, 4 * hz, usb_power_wdog, arg); +#ifdef DDB /* * The following line of code is only here to recover from * DDB: */ usb_proc_rewakeup(bus-explore_proc); /* recover from DDB */ +#endif USB_BUS_UNLOCK(bus); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205008 - head/usr.bin/script
Author: ed Date: Thu Mar 11 11:09:58 2010 New Revision: 205008 URL: http://svn.freebsd.org/changeset/base/205008 Log: Make script(1) a little less broken. Close the file descriptor to the TTY. There is no reason why the parent process should keep track of the descriptor. This ensures that the application inside properly drains the TTY during exit(2). Reported by: alfred MFC after:2 weeks Modified: head/usr.bin/script/script.c Modified: head/usr.bin/script/script.c == --- head/usr.bin/script/script.cThu Mar 11 08:58:13 2010 (r205007) +++ head/usr.bin/script/script.cThu Mar 11 11:09:58 2010 (r205008) @@ -158,6 +158,8 @@ main(int argc, char *argv[]) } if (child == 0) doshell(argv); + else + close(slave); if (flushtime 0) tvp = tv; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205009 - head/usr.bin/script
Author: ed Date: Thu Mar 11 11:28:29 2010 New Revision: 205009 URL: http://svn.freebsd.org/changeset/base/205009 Log: Improve the change made in the previous commit. doshell() never returns, so there is no need to see whether we are the parent process. Modified: head/usr.bin/script/script.c Modified: head/usr.bin/script/script.c == --- head/usr.bin/script/script.cThu Mar 11 11:09:58 2010 (r205008) +++ head/usr.bin/script/script.cThu Mar 11 11:28:29 2010 (r205009) @@ -158,8 +158,7 @@ main(int argc, char *argv[]) } if (child == 0) doshell(argv); - else - close(slave); + close(slave); if (flushtime 0) tvp = tv; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205016 - head/sys/compat/freebsd32
Author: nwhitehorn Date: Thu Mar 11 14:56:59 2010 New Revision: 205016 URL: http://svn.freebsd.org/changeset/base/205016 Log: Regen after big endian compatibility import. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h == --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Mar 11 14:54:54 2010 (r205015) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Mar 11 14:56:59 2010 (r205016) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 2010-03-11 14:49:06Z nwhitehorn */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h == --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Mar 11 14:54:54 2010(r205015) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Mar 11 14:56:59 2010(r205016) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 2010-03-11 14:49:06Z nwhitehorn */ #defineFREEBSD32_SYS_syscall 0 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c == --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Mar 11 14:54:54 2010(r205015) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Mar 11 14:56:59 2010(r205016) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 2010-03-11 14:49:06Z nwhitehorn */ const char *freebsd32_syscallnames[] = { Modified: head/sys/compat/freebsd32/freebsd32_sysent.c == --- head/sys/compat/freebsd32/freebsd32_sysent.cThu Mar 11 14:54:54 2010(r205015) +++ head/sys/compat/freebsd32/freebsd32_sysent.cThu Mar 11 14:56:59 2010(r205016) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 2010-02-08 10:02:01Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 2010-03-11 14:49:06Z nwhitehorn */ #include opt_compat.h ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205020 - head/lib/libc/rpc
Author: jhb Date: Thu Mar 11 16:58:15 2010 New Revision: 205020 URL: http://svn.freebsd.org/changeset/base/205020 Log: Fix a bug in the previous change: remove function-local definition of tcp_key and udp_key that shadows the global definition. PR: threads/144558 Submitted by: Sam Robb Modified: head/lib/libc/rpc/rpc_generic.c Modified: head/lib/libc/rpc/rpc_generic.c == --- head/lib/libc/rpc/rpc_generic.c Thu Mar 11 15:33:12 2010 (r205019) +++ head/lib/libc/rpc/rpc_generic.c Thu Mar 11 16:58:15 2010 (r205020) @@ -248,7 +248,6 @@ __rpc_getconfip(nettype) static char *netid_udp_main; struct netconfig *dummy; int main_thread; - static thread_key_t tcp_key, udp_key; if ((main_thread = thr_main())) { netid_udp = netid_udp_main; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205013 - in head/sys: amd64/amd64 i386/i386
thanks for the commit. :) a few thoughts: 1) why does stepping remain to be printed in dec while family and model are in hex? is this the way amd/intel cpu docs refer to stepping/model/family? 2) the hex value for Id and (AMD) Features(2) gets printed with an 0x prepended to indicate it's in hex. maybe this should also be the case here. cheers. alex ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205021 - head/lib/libc/stdio
Author: jhb Date: Thu Mar 11 17:03:32 2010 New Revision: 205021 URL: http://svn.freebsd.org/changeset/base/205021 Log: - Use an initializer macro to initialize fields in 'fake' FILE objects used by *sprintf(), etc. - Explicitly initialize _fl_mutex to PTHREAD_MUTEX_INITIALIZER for all FILE objects. This is currently a nop on FreeBSD, but is import for other platforms (or in the future) where PTHREAD_MUTEX_INITIALIZER is not simply zero. PR: threads/141198 Reported by: Jeremy Huddleston @ Apple MFC after:2 weeks Modified: head/lib/libc/stdio/findfp.c head/lib/libc/stdio/local.h head/lib/libc/stdio/snprintf.c head/lib/libc/stdio/vasprintf.c head/lib/libc/stdio/vdprintf.c head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vsnprintf.c head/lib/libc/stdio/vsprintf.c head/lib/libc/stdio/vsscanf.c head/lib/libc/stdio/vswprintf.c head/lib/libc/stdio/vswscanf.c head/lib/libc/stdio/xprintf.c Modified: head/lib/libc/stdio/findfp.c == --- head/lib/libc/stdio/findfp.cThu Mar 11 16:58:15 2010 (r205020) +++ head/lib/libc/stdio/findfp.cThu Mar 11 17:03:32 2010 (r205021) @@ -61,6 +61,7 @@ int __sdidinit; ._read = __sread, \ ._seek = __sseek, \ ._write = __swrite, \ + ._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \ } /* the usual - (stdin + stdout + stderr) */ static FILE usual[FOPEN_MAX - 3]; @@ -96,7 +97,7 @@ moreglue(n) int n; { struct glue *g; - static FILE empty; + static FILE empty = { ._fl_mutex = PTHREAD_MUTEX_INITIALIZER }; FILE *p; g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE)); @@ -154,7 +155,7 @@ found: fp-_ub._size = 0; fp-_lb._base = NULL; /* no line buffer */ fp-_lb._size = 0; -/* fp-_lock = NULL; *//* once set always set (reused) */ +/* fp-_fl_mutex = NULL; */ /* once set always set (reused) */ fp-_orientation = 0; memset(fp-_mbstate, 0, sizeof(mbstate_t)); return (fp); Modified: head/lib/libc/stdio/local.h == --- head/lib/libc/stdio/local.h Thu Mar 11 16:58:15 2010(r205020) +++ head/lib/libc/stdio/local.h Thu Mar 11 17:03:32 2010(r205021) @@ -110,6 +110,14 @@ extern int __sdidinit; } /* + * Structure initializations for 'fake' FILE objects. + */ +#defineFAKE_FILE { \ + ._file = -1,\ + ._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \ +} + +/* * Set the orientation for a stream. If o 0, the stream has wide- * orientation. If o 0, the stream has byte-orientation. */ Modified: head/lib/libc/stdio/snprintf.c == --- head/lib/libc/stdio/snprintf.c Thu Mar 11 16:58:15 2010 (r205020) +++ head/lib/libc/stdio/snprintf.c Thu Mar 11 17:03:32 2010 (r205021) @@ -48,7 +48,7 @@ snprintf(char * __restrict str, size_t n size_t on; int ret; va_list ap; - FILE f; + FILE f = FAKE_FILE; on = n; if (n != 0) @@ -56,12 +56,9 @@ snprintf(char * __restrict str, size_t n if (n INT_MAX) n = INT_MAX; va_start(ap, fmt); - f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n; - f._orientation = 0; - memset(f._mbstate, 0, sizeof(mbstate_t)); ret = __vfprintf(f, fmt, ap); if (on 0) *f._p = '\0'; Modified: head/lib/libc/stdio/vasprintf.c == --- head/lib/libc/stdio/vasprintf.c Thu Mar 11 16:58:15 2010 (r205020) +++ head/lib/libc/stdio/vasprintf.c Thu Mar 11 17:03:32 2010 (r205021) @@ -42,9 +42,8 @@ vasprintf(str, fmt, ap) __va_list ap; { int ret; - FILE f; + FILE f = FAKE_FILE; - f._file = -1; f._flags = __SWR | __SSTR | __SALC; f._bf._base = f._p = (unsigned char *)malloc(128); if (f._bf._base == NULL) { @@ -53,8 +52,6 @@ vasprintf(str, fmt, ap) return (-1); } f._bf._size = f._w = 127; /* Leave room for the NUL */ - f._orientation = 0; - memset(f._mbstate, 0, sizeof(mbstate_t)); ret = __vfprintf(f, fmt, ap); if (ret 0) { free(f._bf._base); Modified: head/lib/libc/stdio/vdprintf.c == --- head/lib/libc/stdio/vdprintf.c Thu Mar 11 16:58:15 2010 (r205020) +++ head/lib/libc/stdio/vdprintf.c Thu Mar 11 17:03:32 2010
Re: svn commit: r205013 - in head/sys: amd64/amd64 i386/i386
On Thursday 11 March 2010 12:01:28 pm Alexander Best wrote: thanks for the commit. :) a few thoughts: 1) why does stepping remain to be printed in dec while family and model are in hex? is this the way amd/intel cpu docs refer to stepping/model/family? 2) the hex value for Id and (AMD) Features(2) gets printed with an 0x prepended to indicate it's in hex. maybe this should also be the case here. cheers. alex -- John Baldwin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205024 - head/sys/net
Author: qingli Date: Thu Mar 11 17:56:46 2010 New Revision: 205024 URL: http://svn.freebsd.org/changeset/base/205024 Log: The if_tap interface is of IFT_ETHERNET type, but it does not set or update the if_link_state variable. As such RT_LINK_IS_UP() fails for the if_tap interface. Also, the RT_LINK_IS_UP() needs to bypass all loopback interfaces because loopback interfaces are considered up logically as long as the system is running. This patch fixes the above issues by setting and updating the if_link_state variable when the tap interface is opened or closed respectively. Similary approach is already done in the if_tun device. MFC after:3 days Modified: head/sys/net/if_tap.c head/sys/net/route.h Modified: head/sys/net/if_tap.c == --- head/sys/net/if_tap.c Thu Mar 11 17:15:40 2010(r205023) +++ head/sys/net/if_tap.c Thu Mar 11 17:56:46 2010(r205024) @@ -502,6 +502,7 @@ tapopen(struct cdev *dev, int flag, int ifp-if_drv_flags = ~IFF_DRV_OACTIVE; if (tapuponopen) ifp-if_flags |= IFF_UP; + if_link_state_change(ifp, LINK_STATE_UP); splx(s); TAPDEBUG(%s is open. minor = %#x\n, ifp-if_xname, dev2unit(dev)); @@ -547,6 +548,7 @@ tapclose(struct cdev *dev, int foo, int } else mtx_unlock(tp-tap_mtx); + if_link_state_change(ifp, LINK_STATE_DOWN); funsetown(tp-tap_sigio); selwakeuppri(tp-tap_rsel, PZERO+1); KNOTE_UNLOCKED(tp-tap_rsel.si_note, 0); Modified: head/sys/net/route.h == --- head/sys/net/route.hThu Mar 11 17:15:40 2010(r205023) +++ head/sys/net/route.hThu Mar 11 17:56:46 2010(r205024) @@ -319,7 +319,9 @@ struct rt_addrinfo { #ifdef _KERNEL -#define RT_LINK_IS_UP(ifp) ((ifp)-if_link_state == LINK_STATE_UP) +#define RT_LINK_IS_UP(ifp) (((ifp)-if_flags \ + (IFF_LOOPBACK | IFF_POINTOPOINT)) \ +|| (ifp)-if_link_state == LINK_STATE_UP) #defineRT_LOCK_INIT(_rt) \ mtx_init((_rt)-rt_mtx, rtentry, NULL, MTX_DEF | MTX_DUPOK) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205026 - head/sys/dev/usb
Author: thompsa Date: Thu Mar 11 20:41:21 2010 New Revision: 205026 URL: http://svn.freebsd.org/changeset/base/205026 Log: Reapply r185998 which was overwritten at some point. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsThu Mar 11 20:32:28 2010(r205025) +++ head/sys/dev/usb/usbdevsThu Mar 11 20:41:21 2010(r205026) @@ -2003,9 +2003,6 @@ product MSI RT3070_7 0x899a RT3070 product MSI RT2573_3 0xa861 RT2573 product MSI RT2573_4 0xa874 RT2573 -/* Microdia products */ -product MICRODIA TWINKLECAM0x600d TwinkleCam USB camera - /* Microsoft products */ product MICROSOFT SIDEPREC 0x0008 SideWinder Precision Pro product MICROSOFT INTELLIMOUSE 0x0009 IntelliMouse ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205027 - head/sys/arm/arm
Author: raj Date: Thu Mar 11 21:04:29 2010 New Revision: 205027 URL: http://svn.freebsd.org/changeset/base/205027 Log: Let detailed info about CPU features print on Marvell Sheeva CPU as well. Provide missing entry in the cpu_classes[]. Reported by: Maks Verver MFC after:1 week Modified: head/sys/arm/arm/identcpu.c Modified: head/sys/arm/arm/identcpu.c == --- head/sys/arm/arm/identcpu.c Thu Mar 11 20:41:21 2010(r205026) +++ head/sys/arm/arm/identcpu.c Thu Mar 11 21:04:29 2010(r205027) @@ -329,6 +329,7 @@ const struct cpu_classtab cpu_classes[] { SA-1, CPU_SA110 }, /* CPU_CLASS_SA1 */ { XScale, CPU_XSCALE_... }, /* CPU_CLASS_XSCALE */ { ARM11J, CPU_ARM11 }, /* CPU_CLASS_ARM11J */ + { Marvell,CPU_MARVELL },/* CPU_CLASS_MARVELL */ }; /* @@ -404,6 +405,7 @@ identify_arm_cpu(void) case CPU_CLASS_SA1: case CPU_CLASS_XSCALE: case CPU_CLASS_ARM11J: + case CPU_CLASS_MARVELL: if ((ctrl CPU_CONTROL_DC_ENABLE) == 0) printf( DC disabled); else ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205028 - head/sys/arm/arm
Author: raj Date: Thu Mar 11 21:16:54 2010 New Revision: 205028 URL: http://svn.freebsd.org/changeset/base/205028 Log: Fix ARM cache handling yet more. 1) vm_machdep.c: remove the dangling allocations so they do not un-necessarily turn off the cache upon consecutive access. 2) busdma_machdep.c: remove the same amount than shadow mapped. Reported by: Maks Verver Submitted by: Mark Tinguely Reviewed by: Grzegorz Bernacki MFC after:3 days Modified: head/sys/arm/arm/busdma_machdep.c head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/busdma_machdep.c == --- head/sys/arm/arm/busdma_machdep.c Thu Mar 11 21:04:29 2010 (r205027) +++ head/sys/arm/arm/busdma_machdep.c Thu Mar 11 21:16:54 2010 (r205028) @@ -649,7 +649,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void KASSERT(map-allocbuffer == vaddr, (Trying to freeing the wrong DMA buffer)); vaddr = map-origbuffer; - arm_unmap_nocache(map-allocbuffer, dmat-maxsize); + arm_unmap_nocache(map-allocbuffer, + dmat-maxsize + ((vm_offset_t)vaddr PAGE_MASK)); } if (dmat-maxsize = PAGE_SIZE dmat-alignment dmat-maxsize Modified: head/sys/arm/arm/vm_machdep.c == --- head/sys/arm/arm/vm_machdep.c Thu Mar 11 21:04:29 2010 (r205027) +++ head/sys/arm/arm/vm_machdep.c Thu Mar 11 21:16:54 2010 (r205028) @@ -171,6 +171,9 @@ sf_buf_free(struct sf_buf *sf) if (sf-ref_count == 0) { TAILQ_INSERT_TAIL(sf_buf_freelist, sf, free_entry); nsfbufsused--; +pmap_kremove(sf-kva); +sf-m = NULL; +LIST_REMOVE(sf, list_entry); if (sf_buf_alloc_want 0) wakeup_one(sf_buf_freelist); } @@ -502,9 +505,12 @@ arm_unmap_nocache(void *addr, vm_size_t size = round_page(size); i = (raddr - arm_nocache_startaddr) / (PAGE_SIZE); - for (; size 0; size -= PAGE_SIZE, i++) + for (; size 0; size -= PAGE_SIZE, i++) { arm_nocache_allocated[i / BITS_PER_INT] = ~(1 (i % BITS_PER_INT)); + pmap_kremove(raddr); + raddr += PAGE_SIZE; + } } #ifdef ARM_USE_SMALL_ALLOC ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
On Thu, 11 Mar 2010, Qing Li wrote: The if_tap interface is of IFT_ETHERNET type, but it does not set or update the if_link_state variable. As such RT_LINK_IS_UP() fails for the if_tap interface. Also, the RT_LINK_IS_UP() needs to bypass all loopback interfaces because loopback interfaces are considered up logically as long as the system is running. This patch fixes the above issues by setting and updating the if_link_state variable when the tap interface is opened or closed respectively. Similary approach is already done in the if_tun device. A couple of questions: (1) It used to be the case that quite a few interface drivers and types didn't have a notion of link up -- especially older ethernet devices. Do those all have the same problem? It was probably a design oversight that devices don't declare an explicit capability for can report link state. (2) While loopback interfaces don't really have a link state, they can be administratively down -- should/do you check that as well as link state? And more generally, even if link is up, administratively down should be obeyed? Finally, it would be neat if there were a way to have information beyond link state influence the choice to balance to a particular route/interface. For example, imagine if I have a router with ECMP, and on the other side on a single ethernet segment, I have two DSL modems. The ethernet link will remain up, but I may (via out-of-band mechanisms, such as SNMP or an active probe) be able to tell that one of the DSL lines is down. Is there a way to push that information into the kernel currently without deleting the routes, and instead say yeah, but for ECMP purposes this is 'down'? Robert ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205030 - head/sys/dev/usb/template
Author: thompsa Date: Thu Mar 11 21:45:31 2010 New Revision: 205030 URL: http://svn.freebsd.org/changeset/base/205030 Log: - make the usb_temp_setup() and usb_temp_unsetup() functions public so that other modules can generate USB descriptors. - extend the vendor specific request function by one length pointer argument, because not all descriptors store the length in the first byte. For example HID descriptors. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/template/usb_template.h head/sys/dev/usb/template/usb_template_mtp.c Modified: head/sys/dev/usb/template/usb_template.c == --- head/sys/dev/usb/template/usb_template.cThu Mar 11 21:42:09 2010 (r205029) +++ head/sys/dev/usb/template/usb_template.cThu Mar 11 21:45:31 2010 (r205030) @@ -98,13 +98,10 @@ static void *usb_temp_get_config_desc(st static const void *usb_temp_get_string_desc(struct usb_device *, uint16_t, uint8_t); static const void *usb_temp_get_vendor_desc(struct usb_device *, - const struct usb_device_request *); + const struct usb_device_request *, uint16_t *plen); static const void *usb_temp_get_hub_desc(struct usb_device *); static usb_error_t usb_temp_get_desc(struct usb_device *, struct usb_device_request *, const void **, uint16_t *); -static usb_error_t usb_temp_setup(struct usb_device *, - const struct usb_temp_device_desc *); -static voidusb_temp_unsetup(struct usb_device *); static usb_error_t usb_temp_setup_by_index(struct usb_device *, uint16_t index); static voidusb_temp_init(void *); @@ -1035,7 +1032,7 @@ usb_temp_get_config_desc(struct usb_devi **/ static const void * usb_temp_get_vendor_desc(struct usb_device *udev, -const struct usb_device_request *req) +const struct usb_device_request *req, uint16_t *plen) { const struct usb_temp_device_desc *tdd; @@ -1046,7 +1043,7 @@ usb_temp_get_vendor_desc(struct usb_devi if (tdd-getVendorDesc == NULL) { return (NULL); } - return ((tdd-getVendorDesc) (req)); + return ((tdd-getVendorDesc) (req, plen)); } /** @@ -1109,7 +1106,6 @@ usb_temp_get_desc(struct usb_device *ude default: goto tr_stalled; } - break; case UT_READ_CLASS_DEVICE: switch (req-bRequest) { case UR_GET_DESCRIPTOR: @@ -1117,11 +1113,6 @@ usb_temp_get_desc(struct usb_device *ude default: goto tr_stalled; } - break; - case UT_READ_VENDOR_DEVICE: - case UT_READ_VENDOR_OTHER: - buf = usb_temp_get_vendor_desc(udev, req); - goto tr_valid; default: goto tr_stalled; } @@ -1158,7 +1149,6 @@ tr_handle_get_descriptor: default: goto tr_stalled; } - goto tr_stalled; tr_handle_get_class_descriptor: if (req-wValue[0]) { @@ -1168,17 +1158,20 @@ tr_handle_get_class_descriptor: goto tr_valid; tr_valid: - if (buf == NULL) { + if (buf == NULL) goto tr_stalled; - } - if (len == 0) { + if (len == 0) len = buf[0]; - } *pPtr = buf; *pLength = len; return (0); /* success */ tr_stalled: + /* try to get a vendor specific descriptor */ + len = 0; + buf = usb_temp_get_vendor_desc(udev, req, len); + if (buf != NULL) + goto tr_valid; *pPtr = NULL; *pLength = 0; return (0); /* we ignore failures */ @@ -1195,7 +1188,7 @@ tr_stalled: *0: Success * Else: Failure **/ -static usb_error_t +usb_error_t usb_temp_setup(struct usb_device *udev, const struct usb_temp_device_desc *tdd) { @@ -1285,7 +1278,7 @@ error: * This function frees any memory associated with the currently * setup template, if any. **/ -static void +void usb_temp_unsetup(struct usb_device *udev) { if (udev-usb_template_ptr) { Modified: head/sys/dev/usb/template/usb_template.h == --- head/sys/dev/usb/template/usb_template.hThu Mar 11 21:42:09 2010 (r205029) +++ head/sys/dev/usb/template/usb_template.hThu Mar 11 21:45:31 2010 (r205030) @@ -31,7 +31,7 @@ #define_USB_TEMPLATE_H_ typedef const void
svn commit: r205031 - head/sys/dev/usb/serial
Author: thompsa Date: Thu Mar 11 21:46:33 2010 New Revision: 205031 URL: http://svn.freebsd.org/changeset/base/205031 Log: It appears that some UVISOR devices do not handle when the clear stall command is issued at the beginning of the initial IN/OUT data transfers. Reason unknown, probably firmware fault. Now the stall is only cleared on data transfer errors. PR: usb/144199 Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/serial/uvisor.c Modified: head/sys/dev/usb/serial/uvisor.c == --- head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:45:31 2010 (r205030) +++ head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:46:33 2010 (r205031) @@ -338,11 +338,6 @@ uvisor_attach(device_t dev) DPRINTF(could not allocate all pipes\n); goto detach; } - /* clear stall at first run */ - mtx_lock(sc-sc_mtx); - usbd_xfer_set_stall(sc-sc_xfer[UVISOR_BULK_DT_WR]); - usbd_xfer_set_stall(sc-sc_xfer[UVISOR_BULK_DT_RD]); - mtx_unlock(sc-sc_mtx); error = ucom_attach(sc-sc_super_ucom, sc-sc_ucom, 1, sc, uvisor_callback, sc-sc_mtx); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205032 - in head/sys/dev/usb: . serial
Author: thompsa Date: Thu Mar 11 21:47:25 2010 New Revision: 205032 URL: http://svn.freebsd.org/changeset/base/205032 Log: Add new uvisor(4) device ID. PR: usb/144201 Modified: head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uvisor.c == --- head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:46:33 2010 (r205031) +++ head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:47:25 2010 (r205032) @@ -256,6 +256,7 @@ MODULE_DEPEND(uvisor, usb, 1, 1, 1); static const struct usb_device_id uvisor_devs[] = { #defineUVISOR_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } UVISOR_DEV(ACEECA, MEZ1000, UVISOR_FLAG_PALM4), + UVISOR_DEV(ALPHASMART, DANA_SYNC, UVISOR_FLAG_PALM4), UVISOR_DEV(GARMIN, IQUE_3600, UVISOR_FLAG_PALM4), UVISOR_DEV(FOSSIL, WRISTPDA, UVISOR_FLAG_PALM4), UVISOR_DEV(HANDSPRING, VISOR, UVISOR_FLAG_VISOR), Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsThu Mar 11 21:46:33 2010(r205031) +++ head/sys/dev/usb/usbdevsThu Mar 11 21:47:25 2010(r205032) @@ -400,6 +400,7 @@ vendor STSN 0x07ef STSN vendor CENTURY 0x07f7 Century Corp vendor ZOOM0x0803 Zoom Telephonics vendor PCS 0x0810 Personal Communication Systems +vendor ALPHASMART 0x081e AlphaSmart, Inc. vendor BROADLOGIC 0x0827 BroadLogic vendor HANDSPRING 0x082d Handspring vendor PALM0x0830 Palm Computing @@ -885,6 +886,10 @@ product ALTEC ASC495 0xff05 ASC495 Spea /* Allied Telesyn International products */ product ALLIEDTELESYN ATUSB100 0xb100 AT-USB100 +/* AlphaSmart, Inc. products */ +product ALPHASMART DANA_KB 0xdbac AlphaSmart Dana Keyboard +product ALPHASMART DANA_SYNC 0xdf00 AlphaSmart Dana HotSync + /* Amoi products */ product AMOI H01 0x0800 H01 3G modem product AMOI H01A 0x7002 H01A 3G modem ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205033 - head/sys/dev/usb/template
Author: thompsa Date: Thu Mar 11 21:48:10 2010 New Revision: 205033 URL: http://svn.freebsd.org/changeset/base/205033 Log: isochronous endpoint descriptors should have two more bytes which are zero by default. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/template/usb_template.c Modified: head/sys/dev/usb/template/usb_template.c == --- head/sys/dev/usb/template/usb_template.cThu Mar 11 21:47:25 2010 (r205032) +++ head/sys/dev/usb/template/usb_template.cThu Mar 11 21:48:10 2010 (r205033) @@ -162,15 +162,23 @@ usb_make_endpoint_desc(struct usb_temp_s const void **rd; uint16_t old_size; uint16_t mps; - uint8_t ea = 0; /* Endpoint Address */ - uint8_t et = 0; /* Endpiont Type */ + uint8_t ea; /* Endpoint Address */ + uint8_t et; /* Endpiont Type */ /* Reserve memory */ old_size = temp-size; - temp-size += sizeof(*ed); - /* Scan all Raw Descriptors first */ + ea = (ted-bEndpointAddress (UE_ADDR | UE_DIR_IN | UE_DIR_OUT)); + et = (ted-bmAttributes UE_XFERTYPE); + + if (et == UE_ISOCHRONOUS) { + /* account for extra byte fields */ + temp-size += sizeof(*ed) + 2; + } else { + temp-size += sizeof(*ed); + } + /* Scan all Raw Descriptors first */ rd = ted-ppRawDesc; if (rd) { while (*rd) { @@ -192,8 +200,6 @@ usb_make_endpoint_desc(struct usb_temp_s /* escape for Zero Max Packet Size */ mps = 0; } - ea = (ted-bEndpointAddress (UE_ADDR | UE_DIR_IN | UE_DIR_OUT)); - et = (ted-bmAttributes UE_XFERTYPE); /* * Fill out the real USB endpoint descriptor @@ -201,7 +207,10 @@ usb_make_endpoint_desc(struct usb_temp_s */ if (temp-buf) { ed = USB_ADD_BYTES(temp-buf, old_size); - ed-bLength = sizeof(*ed); + if (et == UE_ISOCHRONOUS) + ed-bLength = sizeof(*ed) + 2; + else + ed-bLength = sizeof(*ed); ed-bDescriptorType = UDESC_ENDPOINT; ed-bEndpointAddress = ea; ed-bmAttributes = ted-bmAttributes; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205034 - head/sys/dev/usb/controller
Author: thompsa Date: Thu Mar 11 21:49:00 2010 New Revision: 205034 URL: http://svn.freebsd.org/changeset/base/205034 Log: For USS820 driver we need to manually reset TX FIFO at each SETUP transaction because the chip doesn't do this by itself. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/uss820dci.c == --- head/sys/dev/usb/controller/uss820dci.c Thu Mar 11 21:48:10 2010 (r205033) +++ head/sys/dev/usb/controller/uss820dci.c Thu Mar 11 21:49:00 2010 (r205034) @@ -333,6 +333,14 @@ uss820dci_setup_rx(struct uss820dci_td * } else { sc-sc_dv_addr = 0xFF; } + + /* reset TX FIFO */ + temp = USS820_READ_1(sc, USS820_TXCON); + temp |= USS820_TXCON_TXCLR; + USS820_WRITE_1(sc, USS820_TXCON, temp); + temp = ~USS820_TXCON_TXCLR; + USS820_WRITE_1(sc, USS820_TXCON, temp); + return (0); /* complete */ setup_not_complete: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205035 - head/sys/dev/usb
Author: thompsa Date: Thu Mar 11 21:49:43 2010 New Revision: 205035 URL: http://svn.freebsd.org/changeset/base/205035 Log: Make sure there is a way to reset the endpoint FIFO on transfer errors for ISOCHRONOUS transfers Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_transfer.c == --- head/sys/dev/usb/usb_transfer.c Thu Mar 11 21:49:00 2010 (r205034) +++ head/sys/dev/usb/usb_transfer.c Thu Mar 11 21:49:43 2010 (r205035) @@ -2410,21 +2410,24 @@ usbd_pipe_start(struct usb_xfer_queue *p * Check if we are supposed to stall the endpoint: */ if (xfer-flags.stall_pipe) { + struct usb_device *udev; + struct usb_xfer_root *info; + /* clear stall command */ xfer-flags.stall_pipe = 0; + /* get pointer to USB device */ + info = xfer-xroot; + udev = info-udev; + /* * Only stall BULK and INTERRUPT endpoints. */ type = (ep-edesc-bmAttributes UE_XFERTYPE); if ((type == UE_BULK) || (type == UE_INTERRUPT)) { - struct usb_device *udev; - struct usb_xfer_root *info; uint8_t did_stall; - info = xfer-xroot; - udev = info-udev; did_stall = 1; if (udev-flags.usb_mode == USB_MODE_DEVICE) { @@ -2452,6 +2455,17 @@ usbd_pipe_start(struct usb_xfer_queue *p ep-is_stalled = 1; return; } + } else if (type == UE_ISOCHRONOUS) { + + /* +* Make sure any FIFO overflow or other FIFO +* error conditions go away by resetting the +* endpoint FIFO through the clear stall +* method. +*/ + if (udev-flags.usb_mode == USB_MODE_DEVICE) { + (udev-bus-methods-clear_stall) (udev, ep); + } } } /* Set or clear stall complete - special case */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205036 - head/sys/dev/usb
Author: thompsa Date: Thu Mar 11 21:50:36 2010 New Revision: 205036 URL: http://svn.freebsd.org/changeset/base/205036 Log: Implement USB kernel driver detach from userland. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_generic.c Modified: head/sys/dev/usb/usb_device.c == --- head/sys/dev/usb/usb_device.c Thu Mar 11 21:49:43 2010 (r205035) +++ head/sys/dev/usb/usb_device.c Thu Mar 11 21:50:36 2010 (r205036) @@ -80,7 +80,6 @@ static voidusb_init_endpoint(struct usb_device *, uint8_t, struct usb_endpoint_descriptor *, struct usb_endpoint *); static voidusb_unconfigure(struct usb_device *, uint8_t); -static voidusb_detach_device(struct usb_device *, uint8_t, uint8_t); static voidusb_detach_device_sub(struct usb_device *, device_t *, uint8_t); static uint8_t usb_probe_and_attach_sub(struct usb_device *, Modified: head/sys/dev/usb/usb_device.h == --- head/sys/dev/usb/usb_device.h Thu Mar 11 21:49:43 2010 (r205035) +++ head/sys/dev/usb/usb_device.h Thu Mar 11 21:50:36 2010 (r205036) @@ -196,6 +196,7 @@ struct usb_device *usb_alloc_device(devi enum usb_dev_speed speed, enum usb_hc_mode mode); usb_error_tusb_probe_and_attach(struct usb_device *udev, uint8_t iface_index); +void usb_detach_device(struct usb_device *, uint8_t, uint8_t); usb_error_tusb_reset_iface_endpoints(struct usb_device *udev, uint8_t iface_index); usb_error_tusbd_set_config_index(struct usb_device *udev, uint8_t index); Modified: head/sys/dev/usb/usb_generic.c == --- head/sys/dev/usb/usb_generic.c Thu Mar 11 21:49:43 2010 (r205035) +++ head/sys/dev/usb/usb_generic.c Thu Mar 11 21:50:36 2010 (r205036) @@ -2095,17 +2095,32 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo break; case USB_IFACE_DRIVER_ACTIVE: - /* TODO */ - *u.pint = 0; + + n = *u.pint 0xFF; + + iface = usbd_get_iface(f-udev, n); + + if (iface iface-subdev) + error = 0; + else + error = ENXIO; break; case USB_IFACE_DRIVER_DETACH: - /* TODO */ + error = priv_check(curthread, PRIV_DRIVER); - if (error) { + + if (error) + break; + + n = *u.pint 0xFF; + + if (n == USB_IFACE_INDEX_ANY) { + error = EINVAL; break; } - error = EINVAL; + + usb_detach_device(f-udev, n, 0); break; case USB_SET_POWER_MODE: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205012 - head/sys/kern
thanks. :) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205042 - in head/sys/dev/usb: . wlan
Author: thompsa Date: Thu Mar 11 22:05:12 2010 New Revision: 205042 URL: http://svn.freebsd.org/changeset/base/205042 Log: - Integrate latest driver code from OpenBSD - Drain our tasks from the ieee80211 taskqueue - Add more IDs Submitted by: Akinori Furukoshi Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runreg.h head/sys/dev/usb/wlan/if_runvar.h Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsThu Mar 11 22:01:48 2010(r205041) +++ head/sys/dev/usb/usbdevsThu Mar 11 22:05:12 2010(r205042) @@ -270,6 +270,7 @@ vendor LACIE0x059f LaCie vendor FUJIFILM0x05a2 Fuji Film vendor ARC 0x05a3 ARC vendor ORTEK 0x05a4 Ortek +vendor CISCOLINKSYS3 0x05a6 Cisco-Linksys vendor BOSE0x05a7 Bose vendor OMNIVISION 0x05a9 OmniVision vendor INSYSTEM0x05ab In-System Design @@ -539,6 +540,7 @@ vendor RIM 0x0fca Research In Motion vendor DYNASTREAM 0x0fcf Dynastream Innovations vendor QUALCOMM0x1004 Qualcomm vendor APACER 0x1005 Apacer +vendor MOTOROLA4 0x100d Motorola vendor DESKNOTE0x1019 Desknote vendor GIGABYTE0x1044 GIGABYTE vendor WESTERN 0x1058 Western Digital @@ -635,6 +637,7 @@ vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor WCH20x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor OVISLINK0x1b75 OvisLink vendor TCTMOBILE 0x1bbb TCT Mobile vendor TELIT 0x1bc7 Telit vendor MPMAN 0x1cae MpMan @@ -676,6 +679,7 @@ vendor 3COM20x6891 3Com vendor EDIMAX 0x7392 Edimax vendor INTEL 0x8086 Intel vendor INTEL2 0x8087 Intel +vendor ALLWIN 0x8516 ALLWIN Tech vendor SITECOM20x9016 Sitecom vendor MOSCHIP 0x9710 MosChip Semiconductor vendor MARVELL 0x9e88 Marvell Technology Group Ltd. @@ -755,6 +759,7 @@ product ACCTON RT3070_1 0xa701 RT3070 productACCTON RT3070_2 0xa702 RT3070 product ACCTON RT2870_10xb522 RT2870 productACCTON RT3070_3 0xc522 RT3070 +productACCTON RT3070_5 0xd522 RT3070 product ACCTON ZD1211B 0xe501 ZD1211B /* Aceeca products */ @@ -887,6 +892,15 @@ product ALTEC ASC495 0xff05 ASC495 Spea /* Allied Telesyn International products */ product ALLIEDTELESYN ATUSB100 0xb100 AT-USB100 +/* ALLWIN Tech products */ +product ALLWIN RT2070 0x2070 RT2070 +product ALLWIN RT2770 0x2770 RT2770 +product ALLWIN RT2870 0x2870 RT2870 +product ALLWIN RT3070 0x3070 RT3070 +product ALLWIN RT3071 0x3071 RT3071 +product ALLWIN RT3072 0x3072 RT3072 +product ALLWIN RT3572 0x3572 RT3572 + /* AlphaSmart, Inc. products */ product ALPHASMART DANA_KB 0xdbac AlphaSmart Dana Keyboard product ALPHASMART DANA_SYNC 0xdf00 AlphaSmart Dana HotSync @@ -989,7 +1003,8 @@ product ASUS RT2870_2 0x1732 RT2870 product ASUS RT2870_3 0x1742 RT2870 product ASUS RT2870_4 0x1760 RT2870 product ASUS RT2870_5 0x1761 RT2870 -productASUS RT3070 0x1784 RT3070 +productASUS USBN13 0x1784 USB-N13 +productASUS RT3070_1 0x1790 RT3070 product ASUS P535 0x420f ASUS P535 PDA productASUS GMSC 0x422f ASUS Generic Mass Storage product ASUS RT25700x1706 RT2500USB Wireless Adapter @@ -1147,7 +1162,8 @@ product CISCOLINKSYS HU200TS 0x001a HU20 product CISCOLINKSYS WUSB54GC 0x0020 WUSB54GC product CISCOLINKSYS WUSB54GR 0x0023 WUSB54GR product CISCOLINKSYS WUSBF54G 0x0024 WUSBF54G -productCISCOLINKSYS2 RT3070 0x4001 RT3070 +productCISCOLINKSYS2 RT30700x4001 RT3070 +productCISCOLINKSYS3 RT30700x0101 RT3070 /* CMOTECH products */ product CMOTECH CNU510 0x5141 CDMA Technologies USB modem @@ -1174,6 +1190,8 @@ product CONCEPTRONIC AR5523_2 0x7811 AR5 product CONCEPTRONIC AR5523_2_NF 0x7812 AR5523 (no firmware) product CONCEPTRONIC2 C54RU0x3c02 C54RU WLAN product CONCEPTRONIC2 C54RU2 0x3c22 C54RU +product CONCEPTRONIC2 RT3070_1 0x3c08 RT3070 +product CONCEPTRONIC2 RT3070_2 0x3c11 RT3070 product CONCEPTRONIC2 VIGORN61 0x3c25 VIGORN61 product CONCEPTRONIC2 RT2870_1 0x3c06 RT2870 product CONCEPTRONIC2 RT2870_2 0x3c07 RT2870 @@ -1326,12 +1344,14 @@ product DLINK2 DWA111 0x3c06 DWA-111 product DLINK2 RT2870_10x3c09 RT2870 product DLINK2 DWA110 0x3c07 DWA-110 product DLINK2 RT3072
svn commit: r205043 - head/sys/dev/usb
Author: thompsa Date: Thu Mar 11 22:09:21 2010 New Revision: 205043 URL: http://svn.freebsd.org/changeset/base/205043 Log: Add device ID for the NATURAL4000 keyboard Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsThu Mar 11 22:05:12 2010(r205042) +++ head/sys/dev/usb/usbdevsThu Mar 11 22:09:21 2010(r205043) @@ -2055,6 +2055,7 @@ product MICROSOFT WLNOTEBOOK2 0x00e1 Wir product MICROSOFT WLNOTEBOOK3 0x00d2 Wireless Optical Mouse 3000 (Model 1049) product MICROSOFT WLUSBMOUSE 0x00b9 Wireless USB Mouse product MICROSOFT XBOX360 0x0292 XBOX 360 WLAN +product MICROSOFT NATURAL4000 0x00db Natural Ergonomic Keyboard 4000 /* Microtech products */ product MICROTECH SCSIDB25 0x0004 USB-SCSI-DB25 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205048 - head/sys/mips/cavium
Author: jmallett Date: Thu Mar 11 22:25:53 2010 New Revision: 205048 URL: http://svn.freebsd.org/changeset/base/205048 Log: Don't force single user on Octeon anymore. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Thu Mar 11 22:22:06 2010 (r205047) +++ head/sys/mips/cavium/octeon_machdep.c Thu Mar 11 22:25:53 2010 (r205048) @@ -730,8 +730,6 @@ platform_start(__register_t a0, __regist { uint64_t platform_counter_freq; - boothowto |= RB_SINGLE; - /* Initialize pcpu stuff */ mips_pcpu0_init(); mips_timer_early_init(OCTEON_CLOCK_DEFAULT); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205049 - head/sys/mips/conf
Author: jmallett Date: Thu Mar 11 22:29:45 2010 New Revision: 205049 URL: http://svn.freebsd.org/changeset/base/205049 Log: Add bpf and random to Octeon configurations, since they're needed to run dhclient and ssh respectively. Reviewed by: imp Modified: head/sys/mips/conf/OCTEON1 head/sys/mips/conf/OCTEON1-32 Modified: head/sys/mips/conf/OCTEON1 == --- head/sys/mips/conf/OCTEON1 Thu Mar 11 22:25:53 2010(r205048) +++ head/sys/mips/conf/OCTEON1 Thu Mar 11 22:29:45 2010(r205049) @@ -81,6 +81,8 @@ nodevice uart_ns8250 device rgmii #options VERBOSE_SYSINIT +device bpf +device random # # Use the following for Compact Flash file-system Modified: head/sys/mips/conf/OCTEON1-32 == --- head/sys/mips/conf/OCTEON1-32 Thu Mar 11 22:25:53 2010 (r205048) +++ head/sys/mips/conf/OCTEON1-32 Thu Mar 11 22:29:45 2010 (r205049) @@ -70,6 +70,8 @@ nodevice uart_ns8250 device rgmii #options VERBOSE_SYSINIT +device bpf +device random # # Use the following for Compact Flash file-system ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
A couple of questions: (1) It used to be the case that quite a few interface drivers and types didn't have a notion of link up -- especially older ethernet devices. Do those all have the same problem? It was probably a design oversight that devices don't declare an explicit capability for can report link state. What you raised is definitely a possibility and these fixes take the similar approach. I am going to try and go through each of these drivers in /sys/dev/ and converting them, very soon. (2) While loopback interfaces don't really have a link state, they can be administratively down -- should/do you check that as well as link state? And more generally, even if link is up, administratively down should be obeyed? For loopback interfaces, althgouth administrative these can be taken down, I personally cannot think one practical usage case where ECMP across loopback interfaces would be interesting or usefaul. So I can think of very little reason to be concerned in the loopback case. Finally, it would be neat if there were a way to have information beyond link state influence the choice to balance to a particular route/interface. For example, imagine if I have a router with ECMP, and on the other side on a single ethernet segment, I have two DSL modems. The ethernet link will remain up, but I may (via out-of-band mechanisms, such as SNMP or an active probe) be able to tell that one of the DSL lines is down. Is there a way to push that information into the kernel currently without deleting the routes, and instead say yeah, but for ECMP purposes this is 'down'? The above really falls into policy based routing. And policy based routing infrastrucutre is something I have already been working on but cannot yet push back into -current. In fact Julian and I had a conversation about this topic during the FIBs implementation time in late 2008. This infrastructure enhancement is definitely coming but I cannot yet prvoide a timeline for merge back. It's mostly a time issue. Let me know if I have answered these questions to your satisfaction. -- Qing ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
On Thu, Mar 11, 2010 at 15:30, Qing Li qin...@freebsd.org wrote: A couple of questions: (1) It used to be the case that quite a few interface drivers and types didn't have a notion of link up -- especially older ethernet devices. Do those all have the same problem? It was probably a design oversight that devices don't declare an explicit capability for can report link state. What you raised is definitely a possibility and these fixes take the similar approach. I am going to try and go through each of these drivers in /sys/dev/ and converting them, very soon. Go through drivers in the embedded port directories, too. The Octeon port's Ethernet driver was broken by this, and it looks like the Atheros if_arge is probably broken, too. I would even suggest going back to the old behavior briefly while the port maintainers are given an opportunity to update their drivers. Actually, it looks like only MIPS has Ethernet drivers outside of dev/ at a quick glance, but I'd be surprised if there weren't other broken examples. Juli. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
I guess it's a good time to clean things up. The if_link_state code has been around for quite some time, either it be fully utilized or not be there at all. The inconsistency is the root cause. I will try going through these tonight and hopefully the fix all take a common approach. -- Qing On Thu, Mar 11, 2010 at 3:35 PM, Juli Mallett jmall...@freebsd.org wrote: On Thu, Mar 11, 2010 at 15:30, Qing Li qin...@freebsd.org wrote: A couple of questions: (1) It used to be the case that quite a few interface drivers and types didn't have a notion of link up -- especially older ethernet devices. Do those all have the same problem? It was probably a design oversight that devices don't declare an explicit capability for can report link state. What you raised is definitely a possibility and these fixes take the similar approach. I am going to try and go through each of these drivers in /sys/dev/ and converting them, very soon. Go through drivers in the embedded port directories, too. The Octeon port's Ethernet driver was broken by this, and it looks like the Atheros if_arge is probably broken, too. I would even suggest going back to the old behavior briefly while the port maintainers are given an opportunity to update their drivers. Actually, it looks like only MIPS has Ethernet drivers outside of dev/ at a quick glance, but I'd be surprised if there weren't other broken examples. Juli. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
On Thu, Mar 11, 2010 at 15:39, Qing Li qin...@freebsd.org wrote: I guess it's a good time to clean things up. The if_link_state code has been around for quite some time, either it be fully utilized or not be there at all. The inconsistency is the root cause. Sure. There is an increasing amount of stuff that network drivers are expected to do, but they work without doing them. It's easy to think you have a functioning network driver and that you can get by without adding support for media changes and link status reporting, etc. I will try going through these tonight and hopefully the fix all take a common approach. If you can think of a way to add some invariants (warn the first time a driver receives a packet without having ever set the link state, make sure the media status callback sets the valid flag in the request, etc) that would probably be very helpful for people who are writing network drivers. If I hadn't been following the threads about your changes, I would have had to spend much longer fixing the Octeon port's Ethernet driver, wondering why suddenly it broke and instrumenting the routing code. A printf would go a long way. Juli. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
If you can think of a way to add some invariants (warn the first time a driver receives a packet without having ever set the link state, make sure the media status callback sets the valid flag in the request, etc) that would probably be very helpful for people who are writing network drivers. If I hadn't been following the threads about your changes, I would have had to spend much longer fixing the Octeon port's Ethernet driver, wondering why suddenly it broke and instrumenting the routing code. A printf would go a long way. You definitely have a very good point here. I was a bit surprised during debugging that the link state is not consistently initialized and by far not enforced across all of the drivers. Admittedly I checked the most commonly deployed devices and they are in good state. I certainly appreciate your patience on this one and will try to get it resolved quickly. -- Qing ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205061 - head/sys/mips/cavium/dev/rgmii
Author: jmallett Date: Fri Mar 12 02:56:45 2010 New Revision: 205061 URL: http://svn.freebsd.org/changeset/base/205061 Log: o) Send packets being queued for transmission up to BPF if there's a listener. o) Properly configure the CAM to handle IFF_PROMISC and note where IFF_ALLMULTI handling would go if we didn't already force the NIC to receive all multicast traffic. Reviewed by: imp Sponsored by: Packet Forensics Modified: head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c Modified: head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c == --- head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cFri Mar 12 02:55:10 2010(r205060) +++ head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cFri Mar 12 02:56:45 2010(r205061) @@ -209,6 +209,7 @@ static int octeon_rgmx_intr(void *arg); /* Standard driver entry points. These can be static. */ static void octeon_rgmx_init(void *); //static driver_intr_trgmx_intr; +static void octeon_rgmx_config_cam (struct ifnet *); static int octeon_rgmx_ioctl(struct ifnet *, u_long, caddr_t); static void octeon_rgmx_output_start (struct ifnet *); static void octeon_rgmx_output_start_locked (struct ifnet *); @@ -1225,6 +1226,8 @@ static void octeon_rgmx_output_start_loc for (ii = 0; ii len; ii++) printf( %X, dc[ii]); printf(\n); #endif + ETHER_BPF_MTAP(ifp, m); + IF_ENQUEUE(sc-tx_pending_queue, m); /* @@ -1681,6 +1684,60 @@ static void octeon_rgmx_medstat (struct RGMX_UNLOCK(sc); } +static void octeon_rgmx_config_cam(struct ifnet *ifp) +{ + struct rgmx_softc_dev *sc = ifp-if_softc; + u_int port = sc-port; + int index = INDEX(port); +int iface = INTERFACE(port); + u_int last_enabled; + uint64_t adr_ctl; + + last_enabled = octeon_rgmx_stop_port(port); + + adr_ctl = oct_read64(OCTEON_RGMX_RXX_ADR_CTL(index, iface)); + + /* +* Always accept broadcast traffic. +*/ + if ((adr_ctl OCTEON_RGMX_ADRCTL_ACCEPT_BROADCAST) == 0) + adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_BROADCAST; + + /* +* Accept all multicast in all multicast mode and in +* promiscuous mode. +* +* XXX Since we don't handle programming the CAM for +* multicast filtering, always accept all multicast. +*/ + adr_ctl = ~OCTEON_RGMX_ADRCTL_REJECT_ALL_MULTICAST; + adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_ALL_MULTICAST; + + /* +* In promiscuous mode, the CAM is shut off, so reject everything. +* Otherwise, filter using the CAM. +*/ + if ((ifp-if_flags IFF_PROMISC) != 0) { + adr_ctl = ~OCTEON_RGMX_ADRCTL_CAM_MODE_ACCEPT_DMAC; + adr_ctl |= OCTEON_RGMX_ADRCTL_CAM_MODE_REJECT_DMAC; + } else { + adr_ctl = ~OCTEON_RGMX_ADRCTL_CAM_MODE_REJECT_DMAC; + adr_ctl |= OCTEON_RGMX_ADRCTL_CAM_MODE_ACCEPT_DMAC; + } + + oct_write64(OCTEON_RGMX_RXX_ADR_CTL(index, iface), adr_ctl); + + /* +* If in promiscuous mode, disable the CAM. +*/ + if ((ifp-if_flags IFF_PROMISC) != 0) + oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 0); + else + oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 1); + + if (last_enabled) octeon_rgmx_start_port(port); +} + static int octeon_rgmx_ioctl (struct ifnet * ifp, u_long command, caddr_t data) { struct rgmx_softc_dev *sc = ifp-if_softc; @@ -1699,8 +1756,6 @@ static int octeon_rgmx_ioctl (struct ifn * stopped, reflecting the UP flag. */ if (ifp-if_flags IFF_UP) { - - /* * New state is IFF_UP * Restart or Start now, if driver is not running currently. @@ -1708,6 +1763,7 @@ static int octeon_rgmx_ioctl (struct ifn if ((ifp-if_drv_flags IFF_DRV_RUNNING) == 0) { octeon_rgmx_init(sc); } + octeon_rgmx_config_cam(ifp); } else { /* * New state is IFF_DOWN. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205064 - in head/sys/mips: include mips
Author: neel Date: Fri Mar 12 03:49:17 2010 New Revision: 205064 URL: http://svn.freebsd.org/changeset/base/205064 Log: Make the ddb command show tlb SMP friendly. It now accepts an argument to dump out the tlb of a particular cpu. Modified: head/sys/mips/include/cpuregs.h head/sys/mips/include/pmap.h head/sys/mips/mips/mp_machdep.c head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/cpuregs.h == --- head/sys/mips/include/cpuregs.h Fri Mar 12 03:08:47 2010 (r205063) +++ head/sys/mips/include/cpuregs.h Fri Mar 12 03:49:17 2010 (r205064) @@ -577,6 +577,8 @@ #define MIPS_CONFIG1_TLBSZ_MASK0x7E00 /* bits 30..25 # tlb entries minus one */ #define MIPS_CONFIG1_TLBSZ_SHIFT 25 +#defineMIPS_MAX_TLB_ENTRIES64 + #define MIPS_CONFIG1_IS_MASK 0x01C0 /* bits 24..22 icache sets per way */ #define MIPS_CONFIG1_IS_SHIFT 22 #define MIPS_CONFIG1_IL_MASK 0x0038 /* bits 21..19 icache line size */ Modified: head/sys/mips/include/pmap.h == --- head/sys/mips/include/pmap.hFri Mar 12 03:08:47 2010 (r205063) +++ head/sys/mips/include/pmap.hFri Mar 12 03:49:17 2010 (r205064) @@ -219,6 +219,11 @@ pmap_map_fpage(vm_paddr_t pa, struct fpa boolean_t check_unmaped); void pmap_unmap_fpage(vm_paddr_t pa, struct fpage *fp); +/* + * Function to save TLB contents so that they may be inspected in the debugger. + */ +extern void pmap_save_tlb(void); + #endif /* _KERNEL */ #endif /* !LOCORE */ Modified: head/sys/mips/mips/mp_machdep.c == --- head/sys/mips/mips/mp_machdep.c Fri Mar 12 03:08:47 2010 (r205063) +++ head/sys/mips/mips/mp_machdep.c Fri Mar 12 03:49:17 2010 (r205064) @@ -128,6 +128,7 @@ mips_ipi_handler(void *arg) CTR0(KTR_SMP, IPI_STOP or IPI_STOP_HARD); savectx(stoppcbs[cpu]); + pmap_save_tlb(); /* Indicate we are stopped */ atomic_set_int(stopped_cpus, cpumask); Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Fri Mar 12 03:08:47 2010(r205063) +++ head/sys/mips/mips/pmap.c Fri Mar 12 03:49:17 2010(r205064) @@ -76,6 +76,7 @@ __FBSDID($FreeBSD$); #include sys/msgbuf.h #include sys/vmmeter.h #include sys/mman.h +#include sys/smp.h #include vm/vm.h #include vm/vm_param.h @@ -149,6 +150,8 @@ unsigned pmap_max_asid; /* max ASID sup vm_offset_t kernel_vm_end; +static struct tlb tlbstash[MAXCPU][MIPS_MAX_TLB_ENTRIES]; + static void pmap_asid_alloc(pmap_t pmap); /* @@ -3284,17 +3287,6 @@ db_dump_tlb(int first, int last) } } -#ifdef DDB -#include sys/kernel.h -#include ddb/ddb.h - -DB_SHOW_COMMAND(tlb, ddb_dump_tlb) -{ - db_dump_tlb(0, num_tlbentries - 1); -} - -#endif - /* * Routine:pmap_kextract * Function: @@ -3377,3 +3369,61 @@ pmap_flush_pvcache(vm_page_t m) } } } + +void +pmap_save_tlb(void) +{ + int tlbno, cpu; + + cpu = PCPU_GET(cpuid); + + for (tlbno = 0; tlbno num_tlbentries; ++tlbno) + MachTLBRead(tlbno, tlbstash[cpu][tlbno]); +} + +#ifdef DDB +#include ddb/ddb.h + +DB_SHOW_COMMAND(tlb, ddb_dump_tlb) +{ + int cpu, tlbno; + struct tlb *tlb; + + if (have_addr) + cpu = ((addr 4) % 16) * 10 + (addr % 16); + else + cpu = PCPU_GET(cpuid); + + if (cpu 0 || cpu = mp_ncpus) { + db_printf(Invalid CPU %d\n, cpu); + return; + } else + db_printf(CPU %d:\n, cpu); + + if (cpu == PCPU_GET(cpuid)) + pmap_save_tlb(); + + for (tlbno = 0; tlbno num_tlbentries; ++tlbno) { + tlb = tlbstash[cpu][tlbno]; + if (tlb-tlb_lo0 PTE_V || tlb-tlb_lo1 PTE_V) { + printf(TLB %2d vad 0x%0lx , + tlbno, (long)(tlb-tlb_hi 0xff00)); + } else { + printf(TLB*%2d vad 0x%0lx , + tlbno, (long)(tlb-tlb_hi 0xff00)); + } + printf(0=0x%0lx , pfn_to_vad((long)tlb-tlb_lo0)); + printf(%c, tlb-tlb_lo0 PTE_V ? 'V' : '-'); + printf(%c, tlb-tlb_lo0 PTE_M ? 'M' : '-'); + printf(%c, tlb-tlb_lo0 PTE_G ? 'G' : '-'); + printf( atr %x , (tlb-tlb_lo0 3) 7); + printf(1=0x%0lx , pfn_to_vad((long)tlb-tlb_lo1)); + printf(%c, tlb-tlb_lo1 PTE_V ?
Re: svn commit: r205024 - head/sys/net
On Thu, Mar 11, 2010 at 03:35:13PM -0800, Juli Mallett wrote: On Thu, Mar 11, 2010 at 15:30, Qing Li qin...@freebsd.org wrote: A couple of questions: (1) It used to be the case that quite a few interface drivers and types didn't have a notion of link up -- especially older ethernet devices. ?Do those all have the same problem? ?It was probably a design oversight that ?devices don't declare an explicit capability for can report link state. ?What you raised is definitely a possibility and these fixes take the ?similar approach. I am going to try and go through each of these ?drivers in /sys/dev/ and converting them, very soon. Go through drivers in the embedded port directories, too. The Octeon port's Ethernet driver was broken by this, and it looks like the Atheros if_arge is probably broken, too. I would even suggest going back to the old behavior briefly while the port maintainers are given an opportunity to update their drivers. Actually, it looks like only MIPS has Ethernet drivers outside of dev/ at a quick glance, but I'd be surprised if there weren't other broken examples. There is also if_npe in the arm/xscale/ixp425 directory and probably others in the rest of the arm directories. John -- John Hay -- j...@meraka.csir.co.za / j...@freebsd.org ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205066 - in head/sys: net netinet
Author: kmacy Date: Fri Mar 12 05:03:26 2010 New Revision: 205066 URL: http://svn.freebsd.org/changeset/base/205066 Log: - restructure flowtable to support ipv6 - add a name argument to flowtable_alloc for printing with ddb commands - extend ddb commands to print destination address or 4-tuples - don't parse ports in ulp header if FL_HASH_ALL is not passed - add kern_flowtable_insert to enable more generic use of flowtable (e.g. system calls for adding entries) - don't hash loopback addresses - cleanup whitespace - keep statistics per-cpu for per-cpu flowtables to avoid cache line contention - add sysctls to accumulate stats and report aggregate MFC after:7 days Modified: head/sys/net/flowtable.c head/sys/net/flowtable.h head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c Modified: head/sys/net/flowtable.c == --- head/sys/net/flowtable.cFri Mar 12 04:44:20 2010(r205065) +++ head/sys/net/flowtable.cFri Mar 12 05:03:26 2010(r205066) @@ -1,6 +1,6 @@ /** -Copyright (c) 2008-2009, BitGravity Inc. +Copyright (c) 2008-2010, BitGravity Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE. #include opt_route.h #include opt_mpath.h #include opt_ddb.h +#include opt_inet.h +#include opt_inet6.h #include sys/cdefs.h __FBSDID($FreeBSD$); @@ -45,6 +47,7 @@ __FBSDID($FreeBSD$); #include sys/malloc.h #include sys/mbuf.h #include sys/proc.h +#include sys/sbuf.h #include sys/sched.h #include sys/smp.h #include sys/socket.h @@ -63,6 +66,9 @@ __FBSDID($FreeBSD$); #include netinet/in_var.h #include netinet/if_ether.h #include netinet/ip.h +#ifdef INET6 +#include netinet/ip6.h +#endif #include netinet/tcp.h #include netinet/udp.h #include netinet/sctp.h @@ -140,31 +146,39 @@ union flentryp { struct flentry **pcpu[MAXCPU]; }; +struct flowtable_stats { + uint64_tft_collisions; + uint64_tft_allocated; + uint64_tft_misses; + uint64_tft_max_depth; + uint64_tft_free_checks; + uint64_tft_frees; + uint64_tft_hits; + uint64_tft_lookups; +} __aligned(128); + struct flowtable { + struct flowtable_stats ft_stats[MAXCPU]; int ft_size; int ft_lock_count; uint32_tft_flags; - uint32_tft_collisions; - uint32_tft_allocated; - uint32_tft_misses; - uint64_tft_hits; uint32_tft_udp_idle; uint32_tft_fin_wait_idle; uint32_tft_syn_idle; uint32_tft_tcp_idle; + char*ft_name; fl_lock_t *ft_lock; fl_lock_t *ft_unlock; fl_rtalloc_t*ft_rtalloc; struct mtx *ft_locks; - union flentryp ft_table; bitstr_t*ft_masks[MAXCPU]; bitstr_t*ft_tmpmask; struct flowtable *ft_next; -}; +} __aligned(128); static struct proc *flowcleanerproc; static VNET_DEFINE(struct flowtable *, flow_list_head); @@ -181,12 +195,24 @@ static struct cv flowclean_cv; static struct mtx flowclean_lock; static uint32_tflowclean_cycles; +#ifdef FLOWTABLE_DEBUG +#define FLDPRINTF(ft, flags, fmt, ...) \ +do { \ + if ((ft)-ft_flags (flags)) \ + printf((fmt), __VA_ARGS__); \ +} while (0); \ + +#else +#define FLDPRINTF(ft, flags, fmt, ...) + +#endif + + /* * TODO: * - Make flowtable stats per-cpu, aggregated at sysctl call time, * to avoid extra cache evictions caused by incrementing a shared * counter - * - add IPv6 support to flow lookup * - add sysctls to resize flush flow tables * - Add per flowtable sysctls for statistics and configuring timeouts * - add saturation counter to rtentry to support per-packet load-balancing @@ -200,13 +226,6 @@ static uint32_tflowclean_cycles; */ VNET_DEFINE(int, flowtable_enable) = 1; static VNET_DEFINE(int, flowtable_debug); -static VNET_DEFINE(int, flowtable_hits); -static VNET_DEFINE(int, flowtable_lookups); -static VNET_DEFINE(int, flowtable_misses); -static VNET_DEFINE(int, flowtable_frees); -static VNET_DEFINE(int, flowtable_free_checks); -static VNET_DEFINE(int, flowtable_max_depth); -static VNET_DEFINE(int, flowtable_collisions); static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE; static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE; static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; @@ -216,13 +235,6 @@ static
svn commit: r205071 - head/usr.bin/ncal
Author: edwin Date: Fri Mar 12 06:57:53 2010 New Revision: 205071 URL: http://svn.freebsd.org/changeset/base/205071 Log: - With the introduction of -A, -B and -3, not all combinations of arguments makes sense anymore. For example, what would a combination of -3 (show three months) and -y (show the whole year) do? We will abort on these cases. - Move the debug option -d to -H (from highlight), while -d is now used for setting the day of today so that -y and friends can be tested. Modified: head/usr.bin/ncal/ncal.1 head/usr.bin/ncal/ncal.c Modified: head/usr.bin/ncal/ncal.1 == --- head/usr.bin/ncal/ncal.1Fri Mar 12 06:56:51 2010(r205070) +++ head/usr.bin/ncal/ncal.1Fri Mar 12 06:57:53 2010(r205071) @@ -117,12 +117,6 @@ Britain and her colonies switched to the Print the number of the week below each week column. .It Fl y Display a calendar for the specified year. -.It Fl b -Switch to backwards compatibility mode (for debugging). -.It Fl d Ar -mm-dd -Use -.Ar -mm-dd -as the current date (for debugging of highlighting). .It Fl 3 Display the previous, current and next month surrounding today. .It Fl A Ar number @@ -133,6 +127,16 @@ of months after the current month. Display the .Ar number of months before the current month. +.It Fl b +Switch to backwards compatibility mode (for debugging). +.It Fl d Ar -mm +Use +.Ar -mm +as the current date (for debugging of date selection). +.It Fl H Ar -mm-dd +Use +.Ar -mm-dd +as the current date (for debugging of highlighting). .El .Pp A single parameter specifies the year (1\(en) to be displayed; @@ -148,6 +152,14 @@ year default to those of the current sys will display a calendar for the month of August in the current year). .Pp +Not all options can be used together. For example +.Dq Li -3 -A 2 -B 3 -y -m 7 +would mean: +show me the three months around the seventh month, three before +that, two after that and the whole year. +.Nm ncal +will warn about these combinations. +.Pp A year starts on January 1. .Sh SEE ALSO .Xr calendar 3 , Modified: head/usr.bin/ncal/ncal.c == --- head/usr.bin/ncal/ncal.cFri Mar 12 06:56:51 2010(r205070) +++ head/usr.bin/ncal/ncal.cFri Mar 12 06:57:53 2010(r205071) @@ -163,25 +163,25 @@ int flag_nohighlight; /* user doesn't wa int flag_weeks;/* user wants number of week */ int nswitch; /* user defined switch date */ intnswitchb; /* switch date for backward compatibility */ -inttoday; +inthighlightdate; char *center(char *s, char *t, int w); wchar_t *wcenter(wchar_t *s, wchar_t *t, int w); +intfirstday(int y, int m); +void highlight(char *dst, char *src, int len, int *extraletters); void mkmonthr(int year, int month, int jd_flag, struct monthlines * monthl); void mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl); void mkweekdays(struct weekdays * wds); +void monthranger(int year, int m, int jd_flag, int before, int after); +void monthrangeb(int year, int m, int jd_flag, int before, int after); intparsemonth(const char *s, int *m, int *y); void printcc(void); void printeaster(int year, int julian, int orthodox); -intfirstday(int y, int m); date *sdater(int ndays, struct date * d); date *sdateb(int ndays, struct date * d); intsndaysr(struct date * d); intsndaysb(struct date * d); static voidusage(void); -void monthranger(int year, int jd_flag, int m, int before, int after); -void monthrangeb(int year, int jd_flag, int m, int before, int after); -void highlight(char *dst, char *src, int len, int *extraletters); int main(int argc, char *argv[]) @@ -194,15 +194,21 @@ main(int argc, char *argv[]) int m = 0; /* month */ int y = 0; /* year */ int flag_backward = 0; /* user called cal--backward compat. */ - int flag_hole_year = 0; /* user wants the whole year */ + int flag_wholeyear = 0; /* user wants the whole year */ int flag_julian_cal = 0;/* user wants Julian Calendar */ - int flag_julian_day = 0;/* user wants the Julian day -* numbers */ - int flag_orthodox = 0; /* use wants Orthodox easter */ - int flag_easter = 0;/* use wants easter date */ + int flag_julian_day = 0;/* user wants the Julian day numbers */ + int flag_orthodox = 0; /* user wants Orthodox easter */ + int flag_easter = 0;/* user wants easter date */ + int flag_3months = 0; /* user wants 3 month display (-3) */ + int flag_after = 0; /* user wants to see months after */
svn commit: r205072 - in head/sys/mips: include mips
Author: neel Date: Fri Mar 12 07:08:20 2010 New Revision: 205072 URL: http://svn.freebsd.org/changeset/base/205072 Log: - Enable kernel stack guard page. - Unmap the unused kernel stack page that we cannot use because it is not aligned on a (PAGE_SIZE * 2) boundary. Modified: head/sys/mips/include/param.h head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/param.h == --- head/sys/mips/include/param.h Fri Mar 12 06:57:53 2010 (r205071) +++ head/sys/mips/include/param.h Fri Mar 12 07:08:20 2010 (r205072) @@ -128,14 +128,13 @@ #defineMAXDUMPPGS 1 /* xxx: why is this only one? */ /* - * NOTE: In FreeBSD, Uarea's don't have a fixed address. - * Therefore, any code imported from OpenBSD which depends on - * UADDR, UVPN and KERNELSTACK requires porting. - * XXX: 3 stack pages? Not 4 which would be more efficient from a tlb - * XXX: point of view. + * The kernel stack needs to be aligned on a (PAGE_SIZE * 2) boundary. + * + * Although we allocate 3 pages for the kernel stack we end up using + * only the 2 pages that are aligned on a (PAGE_SIZE * 2) boundary. */ #defineKSTACK_PAGES3 /* kernel stack*/ -#defineKSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */ +#defineKSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */ #defineUPAGES 2 Modified: head/sys/mips/mips/vm_machdep.c == --- head/sys/mips/mips/vm_machdep.c Fri Mar 12 06:57:53 2010 (r205071) +++ head/sys/mips/mips/vm_machdep.c Fri Mar 12 07:08:20 2010 (r205072) @@ -214,6 +214,16 @@ cpu_thread_swapin(struct thread *td) { pt_entry_t *pte; int i; + vm_offset_t unused_kstack_page; + + /* +* Unmap the unused kstack page. +*/ + unused_kstack_page = td-td_kstack; + if (td-td_md.md_realstack == td-td_kstack) + unused_kstack_page += (KSTACK_PAGES - 1) * PAGE_SIZE; + + pmap_kremove(unused_kstack_page); /* * The kstack may be at a different physical address now. @@ -239,13 +249,19 @@ cpu_thread_swapout(struct thread *td) void cpu_thread_alloc(struct thread *td) { + vm_offset_t unused_kstack_page; pt_entry_t *pte; int i; - if(td-td_kstack (1 PAGE_SHIFT)) + if (td-td_kstack (1 PAGE_SHIFT)) { td-td_md.md_realstack = td-td_kstack + PAGE_SIZE; - else + unused_kstack_page = td-td_kstack; + } else { td-td_md.md_realstack = td-td_kstack; + unused_kstack_page = td-td_kstack + + (KSTACK_PAGES - 1) * PAGE_SIZE; + } + pmap_kremove(unused_kstack_page); td-td_pcb = (struct pcb *)(td-td_md.md_realstack + (td-td_kstack_pages - 1) * PAGE_SIZE) - 1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
Juli Mallett wrote: On Thu, Mar 11, 2010 at 15:39, Qing Li qin...@freebsd.org wrote: I guess it's a good time to clean things up. The if_link_state code has been around for quite some time, either it be fully utilized or not be there at all. The inconsistency is the root cause. Sure. There is an increasing amount of stuff that network drivers are expected to do, but they work without doing them. It's easy to think you have a functioning network driver and that you can get by without adding support for media changes and link status reporting, etc. I will try going through these tonight and hopefully the fix all take a common approach. probably should add a flag that means we have media state and if it is not set, assume it is always on. If you can think of a way to add some invariants (warn the first time a driver receives a packet without having ever set the link state, make sure the media status callback sets the valid flag in the request, etc) that would probably be very helpful for people who are writing network drivers. If I hadn't been following the threads about your changes, I would have had to spend much longer fixing the Octeon port's Ethernet driver, wondering why suddenly it broke and instrumenting the routing code. A printf would go a long way. Juli. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205073 - head/share/misc
Author: brooks Date: Fri Mar 12 07:26:37 2010 New Revision: 205073 URL: http://svn.freebsd.org/changeset/base/205073 Log: Regen: * Hart: rev 671 of pcidevs.txt; 22-01-2008 (D-M-Y). * Boemler:vendors.txt (2010-03126) PR: kern/133733 MFC after:1 week Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors == --- head/share/misc/pci_vendors Fri Mar 12 07:08:20 2010(r205072) +++ head/share/misc/pci_vendors Fri Mar 12 07:26:37 2010(r205073) @@ -18,7 +18,7 @@ 4001WinTV PVR-250 (v1) 4009WinTV PVR-250 4801WinTV PVR-250 MCE - 6800Hauppage Nova -TD-500 DVB-T Tuner Device + 6800Hauppage Nova -TD-500 DVB-T Tuner Device ( PCIVEN_1131DEV_7130SUBSYS_4051REV_0143B) 0071 Nebula Electronics Ltd 0100 Ncipher Corp Ltd 0123 General Dynamics @@ -44,6 +44,10 @@ 8519OV519 series 05E3 CyberDoor 0701CBD516 +064E SUYIN Corporation + A101Acer Crystal Eye Webcam (suYin) + A103WebCam (SuYin) + D101Web Cam (SuYin) 066F Sigmatel Inc 3410SMTP3410 3500SMTP3500 @@ -54,6 +58,8 @@ 1704ISDN Adapter (PCI Bus, D, C) 067B Prolific Technology Inc 2303PL-2303 USB-to-Serial Converter + 2305USB-to-Printer Bridge Controller (PL-2305) + 2393prolific (prolific) 3507PL-3507 Hi-Speed USB IEEE 1394 Combo to IDE Bridge Controller 069D Hughes Network Systems (HNS) 0700 Stream Machine @@ -70,7 +76,7 @@ 09C1 Arris 0704CM 200E Cable Modem 0A5C Broadcom Corporation - 0201Broadcom USB iLine10(tm) Network Adapter + 0201Broadcom USB iLine10(tm) Network Adapter (Broadcom NetXtreme BCM5782 Gigabie Ethernet Contro) 2000Broadcom Bluetooth Firmware Upgrade Device 2009Broadcom Bluetooth Controller 200ABroadcom Bluetooth Controller @@ -84,17 +90,17 @@ 2038Broadcom Blutonium Device Firmware Downloader (BCM2038) 2039BROADCOM Bluetooth Device 2045Broadcom Bluetooth Controller - 2046Broadcom USB Bluetooth Device + 2046Broadcom USB Bluetooth Device ( 5738z) 2047Broadcom USB Bluetooth Device 205EBroadcom Bluetooth Firmware Upgrade Device - 2100Broadcom Bluetooth 2.0+eDR USB dongle - 2101Broadcom Bluetooth 2.0+EDR USB dongle - 2102ANYCOM Blue USB-200/250 + 2100Broadcom Bluetooth 2.0+eDR USB dongle (BT 50) + 2101Broadcom Bluetooth 2.0+EDR USB dongle ( 511BBCF3F02) + 2102ANYCOM Blue USB-200/250 ( USBVID_04B4PID_2102538CD4C1606) 2110Broadcom Bluetooth Controller 2111ANYCOM Blue USB-UHE 200/250 2120Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter ( 2045) 2121Broadcom 2045 Bluetooth 2.0 USB Device with trace filter - 2122Broadcom Bluetooth 2.0+EDR USB dongle + 2122Broadcom Bluetooth 2.0+EDR USB dongle ( BCM92045B3) 21242045B3ROM Bluetooth Dongle 2130Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter 2131Broadcom 2045 Bluetooth 2.0 USB Device with trace filter @@ -104,7 +110,7 @@ 21432046 Flash non UHE Class 1 21442046 Flash non UHE module Class 2 2145Broadcom BCM9204MD LENO Module - 2146Broadcom 2046 Bluetooth 2.1 USB UHE Dongle + 2146Broadcom 2045 Bluetooth 2.1 USB UHE Dongle 2147Broadcom 2046 Bluetooth 2.1 USB Dongle 2148Broadcom 2046 Bluetooth 2.1 USB UHE Dongle 2149Broadcom 2046 Bluetooth 2.1 USB Dongle @@ -122,8 +128,9 @@ 2155Broadcom Bluetooth USB Dongle 2157BCM2046 B1 USB 500 2158Broadcom 2046 Bluetooth 2.1 Device - 4502USB Human Interface Device - 4503USB Human Interface Device + 4500Broadcom 2046 Bluetooth 2.1 USB Dongle (BCM2046B1) + 4502Broadcom 2046 Bluetooth 2.1 USB Dongle (BCM2046B1) + 4503Broadcom 2046 Bluetooth 2.1 USB Dongle ( BCM2046B1) 5800Unified Security Hub 6300Pirelli ISB Remote NDIS Device 0A89 BREA Technologies Inc @@ -144,17 +151,22 @@ 0A06RCB672FXX 672-channel modular analog telphony card 0B49 ASCII Corporation 064FTrance Vibrator +0C45 Microdia Ltd. + 602DUSB Webcam (72BE7B8E304) + 6130USB CAMERA (53512B30801) 0E11 Compaq Computer Corp (Now owned by Hewlett-Packard) 0001PCI to EISA Bridge - 0002PCI to ISA Bridge + 0002PCI to ISA Bridge (ISA Bridge) 000FStorageWorks Library Adapter (HVD) (CPQB1A9) 0012686P7 (686P7) - 0046Smart Array 64xx/6i Controller + 0046Smart Array 6400 Controller (N/A) 0049Gigabit
Re: svn commit: r205024 - head/sys/net
That's a good idea. I will take your approach. -- Qing On Thu, Mar 11, 2010 at 11:15 PM, Julian Elischer jul...@elischer.org wrote: Juli Mallett wrote: On Thu, Mar 11, 2010 at 15:39, Qing Li qin...@freebsd.org wrote: I guess it's a good time to clean things up. The if_link_state code has been around for quite some time, either it be fully utilized or not be there at all. The inconsistency is the root cause. Sure. There is an increasing amount of stuff that network drivers are expected to do, but they work without doing them. It's easy to think you have a functioning network driver and that you can get by without adding support for media changes and link status reporting, etc. I will try going through these tonight and hopefully the fix all take a common approach. probably should add a flag that means we have media state and if it is not set, assume it is always on. If you can think of a way to add some invariants (warn the first time a driver receives a packet without having ever set the link state, make sure the media status callback sets the valid flag in the request, etc) that would probably be very helpful for people who are writing network drivers. If I hadn't been following the threads about your changes, I would have had to spend much longer fixing the Octeon port's Ethernet driver, wondering why suddenly it broke and instrumenting the routing code. A printf would go a long way. Juli. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
On Mar 11, 2010, at 11:30 PM, Qing Li wrote: What you raised is definitely a possibility and these fixes take the similar approach. I am going to try and go through each of these drivers in /sys/dev/ and converting them, very soon. Is there any way we can pick up via an assertion that an interface driver has failed to implement this functionality? This has never been a historic requirement, so I suspect there are a lot of drivers floating around that fail to meet the requirement. Also, is this for IFT_ETHER only, or also other link types? Robert___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r205024 - head/sys/net
On Mar 12, 2010, at 12:18 AM, Qing Li wrote: You definitely have a very good point here. I was a bit surprised during debugging that the link state is not consistently initialized and by far not enforced across all of the drivers. Admittedly I checked the most commonly deployed devices and they are in good state. I certainly appreciate your patience on this one and will try to get it resolved quickly. One of the reasons drivers don't do this consistently his that historically, hardware has not consistently supported link state detection. This now does seem to be a standard feature, but I think it would be useful to continue to support some notion of a driver not supporting it, hence my thoughts on a link state capability: only test link state if the driver can implement it. Otherwise, you end up with a link state undefined state, which likely comes to much the same thing, and is presumably what in practice you get today on drivers that don't set it. Robert___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r205074 - head/sys/dev/ata
Author: mav Date: Fri Mar 12 07:49:10 2010 New Revision: 205074 URL: http://svn.freebsd.org/changeset/base/205074 Log: Mask disk_idx to avoid panic because of extra bits set. PR: kern/102211 Submitted by: yoichi Modified: head/sys/dev/ata/ata-raid.c Modified: head/sys/dev/ata/ata-raid.c == --- head/sys/dev/ata/ata-raid.c Fri Mar 12 07:26:37 2010(r205073) +++ head/sys/dev/ata/ata-raid.c Fri Mar 12 07:49:10 2010(r205074) @@ -2544,22 +2544,24 @@ ata_raid_intel_read_meta(device_t dev, s /* clear out any old info */ for (disk = 0; disk raid-total_disks; disk++) { + u_int disk_idx = map-disk_idx[disk] 0x; + raid-disks[disk].dev = NULL; - bcopy(meta-disk[map-disk_idx[disk]].serial, + bcopy(meta-disk[disk_idx].serial, raid-disks[disk].serial, sizeof(raid-disks[disk].serial)); raid-disks[disk].sectors = - meta-disk[map-disk_idx[disk]].sectors; + meta-disk[disk_idx].sectors; raid-disks[disk].flags = 0; - if (meta-disk[map-disk_idx[disk]].flags INTEL_F_ONLINE) + if (meta-disk[disk_idx].flags INTEL_F_ONLINE) raid-disks[disk].flags |= AR_DF_ONLINE; - if (meta-disk[map-disk_idx[disk]].flags INTEL_F_ASSIGNED) + if (meta-disk[disk_idx].flags INTEL_F_ASSIGNED) raid-disks[disk].flags |= AR_DF_ASSIGNED; - if (meta-disk[map-disk_idx[disk]].flags INTEL_F_SPARE) { + if (meta-disk[disk_idx].flags INTEL_F_SPARE) { raid-disks[disk].flags = ~(AR_DF_ONLINE | AR_DF_ASSIGNED); raid-disks[disk].flags |= AR_DF_SPARE; } - if (meta-disk[map-disk_idx[disk]].flags INTEL_F_DOWN) + if (meta-disk[disk_idx].flags INTEL_F_DOWN) raid-disks[disk].flags = ~AR_DF_ONLINE; } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org