Module Name: src Committed By: phx Date: Thu Feb 24 19:32:34 UTC 2011
Modified Files: src/sys/arch/sandpoint/sandpoint: com_eumb.c satmgr.c Log Message: Print "interrupting at". Improved style guide conformance. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/sandpoint/sandpoint/com_eumb.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/sandpoint/satmgr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/sandpoint/sandpoint/com_eumb.c diff -u src/sys/arch/sandpoint/sandpoint/com_eumb.c:1.5 src/sys/arch/sandpoint/sandpoint/com_eumb.c:1.6 --- src/sys/arch/sandpoint/sandpoint/com_eumb.c:1.5 Thu Jul 30 05:57:27 2009 +++ src/sys/arch/sandpoint/sandpoint/com_eumb.c Thu Feb 24 19:32:34 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: com_eumb.c,v 1.5 2009/07/30 05:57:27 nisimura Exp $ */ +/* $NetBSD: com_eumb.c,v 1.6 2011/02/24 19:32:34 phx Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com_eumb.c,v 1.5 2009/07/30 05:57:27 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_eumb.c,v 1.6 2011/02/24 19:32:34 phx Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -56,12 +56,12 @@ static struct com_regs cnregs; /* - * There are two different UART configurations, single 4-wire UART - * and dual 2-wire. DCR register selects one of the two operating - * mode. A certain group of NAS boxes uses the 2nd UART as system - * console while the 1st to communicate power management satellite - * processor. "unit" locator helps to reverse the two. Default is a - * single 4-wire UART as console. + * There are two different UART configurations: single 4-wire UART + * and dual 2-wire. The DCR register selects one of the two operating + * modes. A certain group of NAS boxes uses the 2nd UART as system + * console while using the 1st to communicate with the power management + * satellite processor. The "unit" locator helps to reverse the two. + * Default is a single 4-wire UART as console. */ int com_eumb_match(device_t parent, cfdata_t cf, void *aux) @@ -70,10 +70,10 @@ int unit = eaa->eumb_unit; if (unit == EUMBCF_UNIT_DEFAULT && found == 0) - return (1); + return 1; if (unit == 0 || unit == 1) - return (1); - return (0); + return 1; + return 0; } void @@ -92,8 +92,7 @@ if (com_is_console(eaa->eumb_bt, comaddr, &ioh)) { cnregs.cr_ioh = ioh; sc->sc_regs = cnregs; - } - else { + } else { bus_space_map(eaa->eumb_bt, comaddr, COM_NPORTS, 0, &ioh); COM_INIT_REGS(sc->sc_regs, eaa->eumb_bt, ioh, comaddr); } @@ -101,7 +100,9 @@ epicirq = (eaa->eumb_unit == 1) ? 25 : 24; com_attach_subr(sc); + intr_establish(epicirq + 16, IST_LEVEL, IPL_SERIAL, comintr, sc); + aprint_normal_dev(self, "interrupting at irq %d\n", epicirq + 16); } int Index: src/sys/arch/sandpoint/sandpoint/satmgr.c diff -u src/sys/arch/sandpoint/sandpoint/satmgr.c:1.3 src/sys/arch/sandpoint/sandpoint/satmgr.c:1.4 --- src/sys/arch/sandpoint/sandpoint/satmgr.c:1.3 Thu Feb 10 13:54:45 2011 +++ src/sys/arch/sandpoint/sandpoint/satmgr.c Thu Feb 24 19:32:34 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: satmgr.c,v 1.3 2011/02/10 13:54:45 nisimura Exp $ */ +/* $NetBSD: satmgr.c,v 1.4 2011/02/24 19:32:34 phx Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -71,10 +71,12 @@ uint32_t sc_ierror, sc_overr; kmutex_t sc_lock; kcondvar_t sc_rdcv, sc_wrcv; - char sc_rd_buf[16], *sc_rd_lim, *sc_rd_cur, *sc_rd_ptr; - char sc_wr_buf[16], *sc_wr_lim, *sc_wr_cur, *sc_wr_ptr; - int sc_rd_cnt, sc_wr_cnt; - int sc_btnstate; + char sc_rd_buf[16]; + char *sc_rd_lim, *sc_rd_cur, *sc_rd_ptr; + char sc_wr_buf[16]; + char *sc_wr_lim, *sc_wr_cur, *sc_wr_ptr; + int sc_rd_cnt, sc_wr_cnt; + int sc_btnstate; struct satops *sc_ops; }; @@ -155,10 +157,10 @@ int unit = eaa->eumb_unit; if (unit == EUMBCF_UNIT_DEFAULT && found == 0) - return (1); + return 1; if (unit == 0 || unit == 1) - return (1); - return (0); + return 1; + return 0; } static void @@ -208,6 +210,7 @@ epicirq = (eaa->eumb_unit == 0) ? 24 : 25; intr_establish(epicirq + 16, IST_LEVEL, IPL_SERIAL, hwintr, sc); + aprint_normal_dev(self, "interrupting at irq %d\n", epicirq + 16); sc->sc_si = softint_establish(SOFTINT_SERIAL, swintr, sc); CSR_WRITE(sc, IER, 0x7f); /* all but MSR */ @@ -289,8 +292,7 @@ callout_setfunc(&sc->sc_ch_wdog, wdog_tickle, sc); callout_schedule(&sc->sc_ch_wdog, 90 * hz); send_sat(sc, "JJ"); - } - else { + } else { callout_stop(&sc->sc_ch_wdog); send_sat(sc, "KK"); } @@ -466,8 +468,9 @@ return (kn->kn_data > 0); } -static const struct filterops read_filtops = - { 1, NULL, filt_rdetach, filt_read }; +static const struct filterops read_filtops = { + 1, NULL, filt_rdetach, filt_read +}; static int satkqfilter(dev_t dev, struct knote *kn) @@ -482,7 +485,7 @@ break; default: - return (EINVAL); + return EINVAL; } kn->kn_hook = sc; @@ -491,7 +494,7 @@ SLIST_INSERT_HEAD(klist, kn, kn_selnext); mutex_exit(&sc->sc_lock); - return (0); + return 0; } static int @@ -595,7 +598,7 @@ sc->sc_rd_cnt = 0; sc->sc_rd_ptr = ptr; mutex_spin_exit(&sc->sc_lock); - return; /* drop characters down to floor */ + return; /* drop characters down to the floor */ } cv_signal(&sc->sc_rdcv); selnotify(&sc->sc_rsel, 0, 0);