Date: Fri, 19 Jan 2007 12:03:09 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 113156 for review Message-ID: <200701191203.l0JC39ce052382@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113156 Change 113156 by rdivacky@rdivacky_witten on 2007/01/19 12:02:23 IFC Affected files ... .. //depot/projects/linuxolator/src/sys/arm/at91/uart_dev_at91usart.c#3 integrate .. //depot/projects/linuxolator/src/sys/arm/sa11x0/uart_dev_sa1110.c#2 integrate .. //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#13 integrate .. //depot/projects/linuxolator/src/sys/conf/options#14 integrate .. //depot/projects/linuxolator/src/sys/dev/cardbus/cardbus.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/dpt/dpt.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/dpt/dpt_eisa.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/dpt/dpt_scsi.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/fb/fbreg.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/si/si.c#3 integrate .. //depot/projects/linuxolator/src/sys/dev/sound/sbus/cs4231.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/uart/uart_cpu.h#2 integrate .. //depot/projects/linuxolator/src/sys/dev/uart/uart_dev_ns8250.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/uart/uart_dev_sab82532.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/uart/uart_dev_z8530.c#2 integrate .. //depot/projects/linuxolator/src/sys/dev/uart/uart_kbd_sun.c#5 integrate .. //depot/projects/linuxolator/src/sys/netgraph/ng_ppp.c#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_asconf.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_asconf.h#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_auth.c#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_bsd_addr.c#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_bsd_addr.h#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_constants.h#5 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_crc32.h#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_indata.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_indata.h#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_input.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_input.h#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_os.h#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_os_bsd.h#5 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_output.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_output.h#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_pcb.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_pcb.h#5 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_peeloff.c#3 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_peeloff.h#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_structs.h#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_timer.c#4 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_timer.h#2 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_usrreq.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctp_var.h#4 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctputil.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet/sctputil.h#5 integrate .. //depot/projects/linuxolator/src/sys/netinet6/sctp6_usrreq.c#6 integrate .. //depot/projects/linuxolator/src/sys/netinet6/sctp6_var.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/include/bus.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/include/cache.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/include/frame.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/include/fsr.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/include/intr_machdep.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/include/pcb.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/include/tsb.h#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/isa/isa.c#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/pci/ofw_pci_if.m#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/pci/psycho.c#3 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/bus_machdep.c#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/exception.S#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/genassym.c#7 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/interrupt.S#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/mp_exception.S#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/mp_locore.S#2 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/ofw_machdep.c#3 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/support.S#3 integrate .. //depot/projects/linuxolator/src/sys/sparc64/sparc64/swtch.S#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/bus.h#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/frame.h#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/fsr.h#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/intr_machdep.h#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/pcb.h#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/include/utrap.h#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/bus_machdep.c#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/exception.S#7 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/hv_pci.c#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/interrupt.S#7 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/mp_locore.S#3 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/support.S#5 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/swtch.S#2 integrate .. //depot/projects/linuxolator/src/sys/sun4v/sun4v/wbuf.S#4 integrate Differences ... ==== //depot/projects/linuxolator/src/sys/arm/at91/uart_dev_at91usart.c#3 (text) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.10 2006/12/07 00:24:15 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/at91/uart_dev_at91usart.c,v 1.11 2007/01/18 22:01:19 marius Exp $"); #include "opt_comconsole.h" @@ -94,7 +94,7 @@ static void at91_usart_init(struct uart_bas *bas, int, int, int, int); static void at91_usart_term(struct uart_bas *bas); static void at91_usart_putc(struct uart_bas *bas, int); -static int at91_usart_poll(struct uart_bas *bas); +static int at91_usart_rxready(struct uart_bas *bas); static int at91_usart_getc(struct uart_bas *bas, struct mtx *mtx); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -201,7 +201,7 @@ .init = at91_usart_init, .term = at91_usart_term, .putc = at91_usart_putc, - .poll = at91_usart_poll, + .rxready = at91_usart_rxready, .getc = at91_usart_getc, }; @@ -252,15 +252,13 @@ } /* - * Poll for a character available + * Check for a character available. */ static int -at91_usart_poll(struct uart_bas *bas) +at91_usart_rxready(struct uart_bas *bas) { - if (!(RD4(bas, USART_CSR) & USART_CSR_RXRDY)) - return (-1); - return (RD4(bas, USART_RHR) & 0xff); + return ((RD4(bas, USART_CSR) & USART_CSR_RXRDY) != 0 ? 1 : 0); } /* ==== //depot/projects/linuxolator/src/sys/arm/sa11x0/uart_dev_sa1110.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_dev_sa1110.c,v 1.6 2006/06/07 11:28:17 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/uart_dev_sa1110.c,v 1.7 2007/01/18 22:01:19 marius Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -52,7 +52,7 @@ static void sa1110_init(struct uart_bas *bas, int, int, int, int); static void sa1110_term(struct uart_bas *bas); static void sa1110_putc(struct uart_bas *bas, int); -static int sa1110_poll(struct uart_bas *bas); +static int sa1110_rxready(struct uart_bas *bas); static int sa1110_getc(struct uart_bas *bas, struct mtx *mtx); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -62,7 +62,7 @@ .init = sa1110_init, .term = sa1110_term, .putc = sa1110_putc, - .poll = sa1110_poll, + .rxready = sa1110_rxready, .getc = sa1110_getc, }; @@ -102,11 +102,10 @@ } static int -sa1110_poll(struct uart_bas *bas) +sa1110_rxready(struct uart_bas *bas) { - if (!(uart_getreg(bas, SACOM_SR1) & SR1_RNE)) - return (-1); - return (uart_getreg(bas, SACOM_DR) & 0xff); + + return ((uart_getreg(bas, SACOM_SR1) & SR1_RNE) != 0 ? 1 : 0); } static int ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#13 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.100 2007/01/18 09:32:08 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/linux/linux_file.c,v 1.101 2007/01/18 10:42:10 kib Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/linuxolator/src/sys/conf/options#14 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options,v 1.572 2007/01/10 18:45:17 marius Exp $ +# $FreeBSD: src/sys/conf/options,v 1.573 2007/01/18 13:33:36 marius Exp $ # # On the handling of kernel options # @@ -662,6 +662,8 @@ DEV_CARP opt_carp.h DEV_SPLASH opt_splash.h +# EISA support +DEV_EISA opt_eisa.h EISA_SLOTS opt_eisa.h # ed driver ==== //depot/projects/linuxolator/src/sys/dev/cardbus/cardbus.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.62 2006/06/12 03:17:24 imp Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cardbus/cardbus.c,v 1.63 2007/01/19 08:49:28 imp Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -217,7 +217,8 @@ int tmp; int err = 0; - device_get_children(cbdev, &devlist, &numdevs); + if (device_get_children(cbdev, &devlist, &numdevs) != 0) + return (ENOENT); if (numdevs == 0) { free(devlist, M_TEMP); @@ -251,7 +252,9 @@ struct cardbus_devinfo *dinfo; DEVICE_IDENTIFY(driver, cbdev); - device_get_children(cbdev, &devlist, &numdevs); + if (device_get_children(cbdev, &devlist, &numdevs) != 0) + return; + /* * If there are no drivers attached, but there are children, * then power the card up. ==== //depot/projects/linuxolator/src/sys/dev/dpt/dpt.h#2 (text+ko) ==== @@ -40,7 +40,7 @@ */ -#ident "$FreeBSD: src/sys/dev/dpt/dpt.h,v 1.16 2005/01/06 01:42:35 imp Exp $" +#ident "$FreeBSD: src/sys/dev/dpt/dpt.h,v 1.17 2007/01/18 13:33:36 marius Exp $" #ifndef _DPT_H #define _DPT_H @@ -1292,7 +1292,9 @@ int dpt_attach(dpt_softc_t * dpt); void dpt_intr(void *arg); +#ifdef DEV_EISA dpt_conf_t * dpt_pio_get_conf(u_int32_t); +#endif #if 0 extern void hex_dump(u_char * data, int length, ==== //depot/projects/linuxolator/src/sys/dev/dpt/dpt_eisa.c#3 (text+ko) ==== @@ -26,7 +26,9 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_eisa.c,v 1.21 2006/12/11 18:28:30 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_eisa.c,v 1.22 2007/01/18 13:33:36 marius Exp $"); + +#include "opt_eisa.h" #include <sys/param.h> #include <sys/systm.h> ==== //depot/projects/linuxolator/src/sys/dev/dpt/dpt_scsi.c#3 (text+ko) ==== @@ -27,9 +27,9 @@ * SUCH DAMAGE. */ -#ident "$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.54 2006/11/02 00:54:36 mjacob Exp $" +#ident "$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.55 2007/01/18 13:33:36 marius Exp $" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.54 2006/11/02 00:54:36 mjacob Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/dpt/dpt_scsi.c,v 1.55 2007/01/18 13:33:36 marius Exp $"); /* * dpt_scsi.c: SCSI dependant code for the DPT driver @@ -50,6 +50,8 @@ #define _DPT_C_ #include "opt_dpt.h" +#include "opt_eisa.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/eventhandler.h> @@ -106,7 +108,9 @@ /* ================= Private Inline Function declarations ===================*/ static __inline int dpt_just_reset(dpt_softc_t * dpt); static __inline int dpt_raid_busy(dpt_softc_t * dpt); +#ifdef DEV_EISA static __inline int dpt_pio_wait (u_int32_t, u_int, u_int, u_int); +#endif static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state); static __inline struct dpt_ccb* dptgetccb(struct dpt_softc *dpt); @@ -181,6 +185,7 @@ return (0); } +#ifdef DEV_EISA static __inline int dpt_pio_wait (u_int32_t base, u_int reg, u_int bits, u_int state) { @@ -196,6 +201,7 @@ } return (-1); } +#endif static __inline int dpt_wait(dpt_softc_t *dpt, u_int bits, u_int state) @@ -386,6 +392,7 @@ return (i); } +#ifdef DEV_EISA dpt_conf_t * dpt_pio_get_conf (u_int32_t base) { @@ -478,6 +485,7 @@ } return (NULL); } +#endif /* * Read a configuration page into the supplied dpt_cont_t buffer. ==== //depot/projects/linuxolator/src/sys/dev/fb/fbreg.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/fb/fbreg.h,v 1.20 2005/12/06 11:19:36 ru Exp $ + * $FreeBSD: src/sys/dev/fb/fbreg.h,v 1.21 2007/01/18 13:08:08 marius Exp $ */ #ifndef _DEV_FB_FBREG_H_ @@ -50,7 +50,8 @@ #define bzero_io(d, c) bzero((void *)(d), (c)) #define fill_io(p, d, c) fill((p), (void *)(d), (c)) #define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) -#elif defined(__ia64__) +#elif defined(__ia64__) || defined(__sparc64__) +#if defined(__ia64__) #include <machine/bus.h> #define bcopy_fromio(s, d, c) \ bus_space_read_region_1(IA64_BUS_SPACE_MEM, s, 0, (void*)(d), c) @@ -69,6 +70,7 @@ #define writeb(a, v) bus_space_write_1(IA64_BUS_SPACE_MEM, a, 0, v) #define writew(a, v) bus_space_write_2(IA64_BUS_SPACE_MEM, a, 0, v) #define writel(a, v) bus_space_write_4(IA64_BUS_SPACE_MEM, a, 0, v) +#endif /* __ia64__ */ static __inline void fillw(int val, uint16_t *buf, size_t size) { @@ -91,7 +93,7 @@ u_int16_t ofwfb_readw(u_int16_t *addr); void ofwfb_writew(u_int16_t *addr, u_int16_t val); -#else /* !__i386__ && !__ia64__ && !__amd64__ && !__powerpc__ */ +#else /* !__i386__ && !__amd64__ && !__ia64__ && !__sparc64__ && !__powerpc__ */ #define bcopy_io(s, d, c) memcpy_io((d), (s), (c)) #define bcopy_toio(s, d, c) memcpy_toio((d), (void *)(s), (c)) #define bcopy_fromio(s, d, c) memcpy_fromio((void *)(d), (s), (c)) ==== //depot/projects/linuxolator/src/sys/dev/si/si.c#3 (text+ko) ==== @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/si/si.c,v 1.138 2006/11/06 13:41:55 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/si/si.c,v 1.139 2007/01/18 13:33:36 marius Exp $"); #ifndef lint static const char si_copyright1[] = "@(#) Copyright (C) Specialix International, 1990,1992,1998", @@ -43,6 +43,7 @@ #include "opt_compat.h" #include "opt_debug_si.h" +#include "opt_eisa.h" #include "opt_tty.h" #include <sys/param.h> @@ -277,8 +278,10 @@ /* Stop the CPU first so it won't stomp around while we load */ switch (sc->sc_type) { +#ifdef DEV_EISA case SIEISA: outb(sc->sc_iobase + 2, sc->sc_irq << 4); +#endif break; case SIPCI: *(maddr+SIPCIRESET) = 0; @@ -321,12 +324,14 @@ /* Now start the CPU */ switch (sc->sc_type) { +#ifdef DEV_EISA case SIEISA: /* modify the download code to tell it that it's on an EISA */ *(maddr + 0x42) = 1; outb(sc->sc_iobase + 2, (sc->sc_irq << 4) | 4); (void)inb(sc->sc_iobase + 3); /* reset interrupt */ break; +#endif case SIPCI: /* modify the download code to tell it that it's on a PCI */ *(maddr+0x42) = 1; @@ -1132,11 +1137,13 @@ ((volatile struct si_reg *)maddr)->int_pending = 0; *(maddr+SIJETINTCL) = 0x0; break; +#ifdef DEV_EISA case SIEISA: maddr = sc->sc_maddr; ((volatile struct si_reg *)maddr)->int_pending = 0; (void)inb(sc->sc_iobase + 3); break; +#endif case SIEMPTY: default: continue; @@ -1622,7 +1629,9 @@ { switch (host_type) { /* Z280 based cards */ +#ifdef DEV_EISA case SIEISA: +#endif case SIHOST2: case SIHOST: case SIPCI: ==== //depot/projects/linuxolator/src/sys/dev/sound/sbus/cs4231.c#2 (text+ko) ==== @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/sound/sbus/cs4231.c,v 1.4 2005/05/19 18:13:49 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sound/sbus/cs4231.c,v 1.5 2007/01/18 19:19:19 marius Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -306,10 +306,12 @@ static int cs4231_bus_probe(device_t dev) { - const char *name; + const char *compat, *name; + compat = ofw_bus_get_compat(dev); name = ofw_bus_get_name(dev); - if (strcmp("SUNW,CS4231", name) == 0) { + if (strcmp("SUNW,CS4231", name) == 0 || + (compat != NULL && strcmp("SUNW,CS4231", compat) == 0)) { device_set_desc(dev, "Sun Audiocs"); return (BUS_PROBE_DEFAULT); } @@ -319,11 +321,9 @@ static int cs4231_sbus_attach(device_t dev) { - struct snddev_info *d; struct cs4231_softc *sc; int burst; - d = device_get_softc(dev); sc = malloc(sizeof(struct cs4231_softc), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc == NULL) { device_printf(dev, "cannot allocate softc\n"); @@ -352,10 +352,8 @@ static int cs4231_ebus_attach(device_t dev) { - struct snddev_info *d; struct cs4231_softc *sc; - d = device_get_softc(dev); sc = malloc(sizeof(struct cs4231_softc), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc == NULL) { device_printf(dev, "cannot allocate softc\n"); ==== //depot/projects/linuxolator/src/sys/dev/uart/uart_cpu.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/uart/uart_cpu.h,v 1.10 2006/04/01 19:04:54 marcel Exp $ + * $FreeBSD: src/sys/dev/uart/uart_cpu.h,v 1.11 2007/01/18 22:01:19 marius Exp $ */ #ifndef _DEV_UART_CPU_H_ @@ -41,7 +41,7 @@ void (*init)(struct uart_bas *, int, int, int, int); void (*term)(struct uart_bas *); void (*putc)(struct uart_bas *, int); - int (*poll)(struct uart_bas *); + int (*rxready)(struct uart_bas *); int (*getc)(struct uart_bas *, struct mtx *); }; @@ -137,12 +137,26 @@ } static __inline int +uart_rxready(struct uart_devinfo *di) +{ + int res; + + uart_lock(di->hwmtx); + res = di->ops.rxready(&di->bas); + uart_unlock(di->hwmtx); + return (res); +} + +static __inline int uart_poll(struct uart_devinfo *di) { int res; uart_lock(di->hwmtx); - res = di->ops.poll(&di->bas); + if (di->ops.rxready(&di->bas)) + res = di->ops.getc(&di->bas, NULL); + else + res = -1; uart_unlock(di->hwmtx); return (res); } ==== //depot/projects/linuxolator/src/sys/dev/uart/uart_dev_ns8250.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.23 2006/05/23 06:04:45 benno Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.24 2007/01/18 22:01:19 marius Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -217,7 +217,7 @@ static void ns8250_init(struct uart_bas *bas, int, int, int, int); static void ns8250_term(struct uart_bas *bas); static void ns8250_putc(struct uart_bas *bas, int); -static int ns8250_poll(struct uart_bas *bas); +static int ns8250_rxready(struct uart_bas *bas); static int ns8250_getc(struct uart_bas *bas, struct mtx *); struct uart_ops uart_ns8250_ops = { @@ -225,7 +225,7 @@ .init = ns8250_init, .term = ns8250_term, .putc = ns8250_putc, - .poll = ns8250_poll, + .rxready = ns8250_rxready, .getc = ns8250_getc, }; @@ -299,12 +299,10 @@ } static int -ns8250_poll(struct uart_bas *bas) +ns8250_rxready(struct uart_bas *bas) { - if (uart_getreg(bas, REG_LSR) & LSR_RXRDY) - return (uart_getreg(bas, REG_DATA)); - return (-1); + return ((uart_getreg(bas, REG_LSR) & LSR_RXRDY) != 0 ? 1 : 0); } static int ==== //depot/projects/linuxolator/src/sys/dev/uart/uart_dev_sab82532.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_sab82532.c,v 1.14 2006/04/01 19:04:54 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_sab82532.c,v 1.15 2007/01/18 22:01:19 marius Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -173,7 +173,7 @@ static void sab82532_init(struct uart_bas *bas, int, int, int, int); static void sab82532_term(struct uart_bas *bas); static void sab82532_putc(struct uart_bas *bas, int); -static int sab82532_poll(struct uart_bas *bas); +static int sab82532_rxready(struct uart_bas *bas); static int sab82532_getc(struct uart_bas *bas, struct mtx *); struct uart_ops uart_sab82532_ops = { @@ -181,7 +181,7 @@ .init = sab82532_init, .term = sab82532_term, .putc = sab82532_putc, - .poll = sab82532_poll, + .rxready = sab82532_rxready, .getc = sab82532_getc, }; @@ -303,12 +303,10 @@ } static int -sab82532_poll(struct uart_bas *bas) +sab82532_rxready(struct uart_bas *bas) { - if (uart_getreg(bas, SAB_STAR) & SAB_STAR_RFNE) - return (sab82532_getc(bas, NULL)); - return (-1); + return ((uart_getreg(bas, SAB_STAR) & SAB_STAR_RFNE) != 0 ? 1 : 0); } static int ==== //depot/projects/linuxolator/src/sys/dev/uart/uart_dev_z8530.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.20 2006/07/26 17:29:37 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_z8530.c,v 1.21 2007/01/18 22:01:19 marius Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -192,7 +192,7 @@ static void z8530_init(struct uart_bas *bas, int, int, int, int); static void z8530_term(struct uart_bas *bas); static void z8530_putc(struct uart_bas *bas, int); -static int z8530_poll(struct uart_bas *bas); +static int z8530_rxready(struct uart_bas *bas); static int z8530_getc(struct uart_bas *bas, struct mtx *); struct uart_ops uart_z8530_ops = { @@ -200,7 +200,7 @@ .init = z8530_init, .term = z8530_term, .putc = z8530_putc, - .poll = z8530_poll, + .rxready = z8530_rxready, .getc = z8530_getc, }; @@ -235,12 +235,10 @@ } static int -z8530_poll(struct uart_bas *bas) +z8530_rxready(struct uart_bas *bas) { - if (!(uart_getreg(bas, REG_CTRL) & BES_RXA)) - return (-1); - return (uart_getreg(bas, REG_DATA)); + return ((uart_getreg(bas, REG_CTRL) & BES_RXA) != 0 ? 1 : 0); } static int ==== //depot/projects/linuxolator/src/sys/dev/uart/uart_kbd_sun.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_kbd_sun.c,v 1.10 2006/11/02 00:01:15 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_kbd_sun.c,v 1.11 2007/01/18 22:01:19 marius Exp $"); #include "opt_compat.h" #include "opt_kbd.h" @@ -72,8 +72,6 @@ struct uart_softc *sc_uart; struct uart_devinfo *sc_sysdev; - int sc_checked_key; - struct callout sc_repeat_callout; int sc_repeat_key; @@ -403,7 +401,7 @@ return (TRUE); if (sc->sc_polling != 0 && sc->sc_sysdev != NULL && - (sc->sc_checked_key = uart_poll(sc->sc_sysdev)) != -1) + uart_rxready(sc->sc_sysdev)) return (TRUE); return (FALSE); @@ -441,12 +439,6 @@ goto process_code; } - if (sc->sc_checked_key != -1) { - suncode = sc->sc_checked_key; - sc->sc_checked_key = -1; - goto process_code; - } - for (;;) { next_code: if (!(sc->sc_flags & KPCOMPOSE) && (sc->sc_composed_char > 0)) { @@ -472,7 +464,6 @@ case SKBD_RSP_IDLE: break; default: - process_code: ++kbd->kb_count; key = SKBD_KEY_CHAR(suncode); @@ -565,10 +556,12 @@ if (key == 0x13) { /* left alt (KP compose key) */ #endif if (release != 0) { - if (sc->sc_flags & KPCOMPOSE) { - sc->sc_flags &= ~KPCOMPOSE; - if (sc->sc_composed_char > UCHAR_MAX) - sc->sc_composed_char = 0; + if (sc->sc_flags & KPCOMPOSE) { + sc->sc_flags &= ~KPCOMPOSE; + if (sc->sc_composed_char > + UCHAR_MAX) + sc->sc_composed_char = + 0; } } else { if (!(sc->sc_flags & KPCOMPOSE)) { @@ -768,7 +761,6 @@ struct sunkbd_softc *sc; sc = (struct sunkbd_softc *)kbd; - sc->sc_checked_key = -1; sc->sc_repeat_key = -1; sc->sc_accents = 0; sc->sc_composed_char = 0; ==== //depot/projects/linuxolator/src/sys/netgraph/ng_ppp.c#3 (text+ko) ==== @@ -1,11 +1,7 @@ -/* - * ng_ppp.c - */ - /*- * Copyright (c) 1996-2000 Whistle Communications, Inc. * All rights reserved. - * + * * Subject to the following obligations and disclaimer of warranty, use and * redistribution of this software, in source or object code forms, with or * without modifications are expressly permitted by Whistle Communications; @@ -16,7 +12,7 @@ * Communications, Inc. trademarks, including the mark "WHISTLE * COMMUNICATIONS" on advertising, endorsements, or otherwise except as * such appears in the above copyright notice or in the software. - * + * * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND * TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, @@ -35,14 +31,63 @@ * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * - * Author: Archie Cobbs <archie@freebsd.org> + * Copyright (c) 2007 Alexander Motin <mav@alkar.net> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Authors: Archie Cobbs <archie@freebsd.org>, Alexander Motin <mav@alkar.net> * - * $FreeBSD: src/sys/netgraph/ng_ppp.c,v 1.58 2006/12/28 13:21:54 glebius Exp $ + * $FreeBSD: src/sys/netgraph/ng_ppp.c,v 1.61 2007/01/18 19:41:39 mjacob Exp $ * $Whistle: ng_ppp.c,v 1.24 1999/11/01 09:24:52 julian Exp $ */ /* - * PPP node type. + * PPP node type data-flow. + * + * hook xmit layer recv hook + * ------------------------------------ + * inet -> -> inet + * ipv6 -> -> ipv6 + * ipx -> proto -> ipx + * atalk -> -> atalk + * bypass -> -> bypass + * -hcomp_xmit()----------proto_recv()- + * vjc_ip <- <- vjc_ip + * vjc_comp -> header compression -> vjc_comp + * vjc_uncomp -> -> vjc_uncomp + * vjc_vjip -> -> vjc_vjip + * -comp_xmit()-----------hcomp_recv()- + * compress <- compression <- decompress + * compress -> -> decompress + * -crypt_xmit()-----------comp_recv()- + * encrypt <- encryption <- decrypt + * encrypt -> -> decrypt + * -ml_xmit()-------------crypt_recv()- + * multilink + * -link_xmit()--------------ml_recv()- + * linkX <- link <- linkX + * */ #include <sys/param.h> @@ -71,7 +116,7 @@ #define PROT_COMPRESSABLE(p) (((p) & 0xff00) == 0x0000) /* Some PPP protocol numbers we're interested in */ -#define PROT_APPLETALK 0x0029 +#define PROT_ATALK 0x0029 #define PROT_COMPD 0x00fd #define PROT_CRYPTD 0x0053 #define PROT_IP 0x0021 @@ -123,8 +168,8 @@ MP_SHORT_EXTEND((seq) + 1) : \ MP_LONG_EXTEND((seq) + 1)) -/* Don't fragment transmitted packets smaller than this */ -#define MP_MIN_FRAG_LEN 6 +/* Don't fragment transmitted packets to parts smaller than this */ +#define MP_MIN_FRAG_LEN 32 /* Maximum fragment reasssembly queue length */ #define MP_MAX_QUEUE_LEN 128 @@ -132,64 +177,28 @@ /* Fragment queue scanner period */ #define MP_FRAGTIMER_INTERVAL (hz/2) +/* Keep this equal to ng_ppp_hook_names lower! */ +#define HOOK_INDEX_MAX 13 + /* We store incoming fragments this way */ struct ng_ppp_frag { int seq; /* fragment seq# */ - u_char first; /* First in packet? */ - u_char last; /* Last in packet? */ + uint8_t first; /* First in packet? */ + uint8_t last; /* Last in packet? */ struct timeval timestamp; /* time of reception */ struct mbuf *data; /* Fragment data */ TAILQ_ENTRY(ng_ppp_frag) f_qent; /* Fragment queue */ }; -/* We use integer indicies to refer to the non-link hooks */ -static const char *const ng_ppp_hook_names[] = { - NG_PPP_HOOK_ATALK, -#define HOOK_INDEX_ATALK 0 - NG_PPP_HOOK_BYPASS, -#define HOOK_INDEX_BYPASS 1 - NG_PPP_HOOK_COMPRESS, -#define HOOK_INDEX_COMPRESS 2 - NG_PPP_HOOK_ENCRYPT, -#define HOOK_INDEX_ENCRYPT 3 - NG_PPP_HOOK_DECOMPRESS, -#define HOOK_INDEX_DECOMPRESS 4 - NG_PPP_HOOK_DECRYPT, -#define HOOK_INDEX_DECRYPT 5 - NG_PPP_HOOK_INET, -#define HOOK_INDEX_INET 6 - NG_PPP_HOOK_IPX, -#define HOOK_INDEX_IPX 7 - NG_PPP_HOOK_VJC_COMP, -#define HOOK_INDEX_VJC_COMP 8 - NG_PPP_HOOK_VJC_IP, -#define HOOK_INDEX_VJC_IP 9 - NG_PPP_HOOK_VJC_UNCOMP, -#define HOOK_INDEX_VJC_UNCOMP 10 - NG_PPP_HOOK_VJC_VJIP, -#define HOOK_INDEX_VJC_VJIP 11 - NG_PPP_HOOK_IPV6, -#define HOOK_INDEX_IPV6 12 - NULL -#define HOOK_INDEX_MAX 13 -}; - -/* We store index numbers in the hook private pointer. The HOOK_INDEX() - for a hook is either the index (above) for normal hooks, or the ones - complement of the link number for link hooks. -XXX Not any more.. (what a hack) -#define HOOK_INDEX(hook) (*((int16_t *) &(hook)->private)) -*/ - /* Per-link private information */ struct ng_ppp_link { struct ng_ppp_link_conf conf; /* link configuration */ + struct ng_ppp_link_stat stats; /* link stats */ hook_p hook; /* connection to link data */ int32_t seq; /* highest rec'd seq# - MSEQ */ - u_int32_t latency; /* calculated link latency */ - struct timeval lastWrite; /* time of last write */ - int bytesInQueue; /* bytes in the output queue */ - struct ng_ppp_link_stat stats; /* Link stats */ + uint32_t latency; /* calculated link latency */ + struct timeval lastWrite; /* time of last write for MP */ + int bytesInQueue; /* bytes in the output queue for MP */ }; /* Total per-node private information */ @@ -199,11 +208,11 @@ struct ng_ppp_link links[NG_PPP_MAX_LINKS];/* per-link info */ int32_t xseq; /* next out MP seq # */ int32_t mseq; /* min links[i].seq */ - u_char vjCompHooked; /* VJ comp hooked up? */ - u_char allLinksEqual; /* all xmit the same? */ - u_int numActiveLinks; /* how many links up */ - int activeLinks[NG_PPP_MAX_LINKS]; /* indicies */ - u_int lastLink; /* for round robin */ + uint16_t activeLinks[NG_PPP_MAX_LINKS]; /* indicies */ + uint16_t numActiveLinks; /* how many links up */ + uint16_t lastLink; /* for round robin */ + uint8_t vjCompHooked; /* VJ comp hooked up? */ + uint8_t allLinksEqual; /* all xmit the same? */ hook_p hooks[HOOK_INDEX_MAX]; /* non-link hooks */ TAILQ_HEAD(ng_ppp_fraglist, ng_ppp_frag) /* fragment queue */ frags; @@ -220,27 +229,90 @@ static ng_rcvdata_t ng_ppp_rcvdata; static ng_disconnect_t ng_ppp_disconnect; +static ng_rcvdata_t ng_ppp_rcvdata_inet; +static ng_rcvdata_t ng_ppp_rcvdata_ipv6; +static ng_rcvdata_t ng_ppp_rcvdata_ipx; +static ng_rcvdata_t ng_ppp_rcvdata_atalk; +static ng_rcvdata_t ng_ppp_rcvdata_bypass; + +static ng_rcvdata_t ng_ppp_rcvdata_vjc_ip; +static ng_rcvdata_t ng_ppp_rcvdata_vjc_comp; +static ng_rcvdata_t ng_ppp_rcvdata_vjc_uncomp; +static ng_rcvdata_t ng_ppp_rcvdata_vjc_vjip; + +static ng_rcvdata_t ng_ppp_rcvdata_compress; +static ng_rcvdata_t ng_ppp_rcvdata_decompress; + +static ng_rcvdata_t ng_ppp_rcvdata_encrypt; +static ng_rcvdata_t ng_ppp_rcvdata_decrypt; + +/* We use integer indicies to refer to the non-link hooks. */ +static const struct { + char *const name; + ng_rcvdata_t *fn; +} ng_ppp_hook_names[] = { +#define HOOK_INDEX_ATALK 0 + { NG_PPP_HOOK_ATALK, ng_ppp_rcvdata_atalk }, +#define HOOK_INDEX_BYPASS 1 + { NG_PPP_HOOK_BYPASS, ng_ppp_rcvdata_bypass }, +#define HOOK_INDEX_COMPRESS 2 + { NG_PPP_HOOK_COMPRESS, ng_ppp_rcvdata_compress }, +#define HOOK_INDEX_ENCRYPT 3 >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701191203.l0JC39ce052382>