psm.c (54629) | psm.c (56836) |
---|---|
1/*- 2 * Copyright (c) 1992, 1993 Erik Forsberg. 3 * Copyright (c) 1996, 1997 Kazutaka YOKOTA. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 6 unchanged lines hidden (view full) --- 15 * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 16 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 17 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 18 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 19 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 20 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * | 1/*- 2 * Copyright (c) 1992, 1993 Erik Forsberg. 3 * Copyright (c) 1996, 1997 Kazutaka YOKOTA. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 6 unchanged lines hidden (view full) --- 15 * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 16 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 17 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 18 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 19 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 20 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * |
23 * $FreeBSD: head/sys/dev/atkbdc/psm.c 54629 1999-12-15 10:04:05Z yokota $ | 23 * $FreeBSD: head/sys/dev/atkbdc/psm.c 56836 2000-01-29 15:08:56Z peter $ |
24 */ 25 26/* 27 * Ported to 386bsd Oct 17, 1992 28 * Sandi Donno, Computer Science, University of Cape Town, South Africa 29 * Please send bug reports to sandi@cs.uct.ac.za 30 * 31 * Thanks are also due to Rick Macklem, rick@snowhite.cis.uoguelph.ca - --- 24 unchanged lines hidden (view full) --- 56 * - January/February 1997. Tweaked probe logic for 57 * HiNote UltraII/Latitude/Armada laptops. 58 * - 30 July 1997. Added APM support. 59 * - 5 March 1997. Defined driver configuration flags (PSM_CONFIG_XXX). 60 * Improved sync check logic. 61 * Vendor specific support routines. 62 */ 63 | 24 */ 25 26/* 27 * Ported to 386bsd Oct 17, 1992 28 * Sandi Donno, Computer Science, University of Cape Town, South Africa 29 * Please send bug reports to sandi@cs.uct.ac.za 30 * 31 * Thanks are also due to Rick Macklem, rick@snowhite.cis.uoguelph.ca - --- 24 unchanged lines hidden (view full) --- 56 * - January/February 1997. Tweaked probe logic for 57 * HiNote UltraII/Latitude/Armada laptops. 58 * - 30 July 1997. Added APM support. 59 * - 5 March 1997. Defined driver configuration flags (PSM_CONFIG_XXX). 60 * Improved sync check logic. 61 * Vendor specific support routines. 62 */ 63 |
64#include "psm.h" | |
65#include "opt_psm.h" 66 | 64#include "opt_psm.h" 65 |
67#if NPSM > 0 68 | |
69#include <sys/param.h> 70#include <sys/systm.h> 71#include <sys/kernel.h> 72#include <sys/module.h> 73#include <sys/bus.h> 74#include <sys/conf.h> 75#include <sys/poll.h> 76#include <sys/syslog.h> --- 1026 unchanged lines hidden (view full) --- 1103psmopen(dev_t dev, int flag, int fmt, struct proc *p) 1104{ 1105 int unit = PSM_UNIT(dev); 1106 struct psm_softc *sc; 1107 int command_byte; 1108 int err; 1109 int s; 1110 | 66#include <sys/param.h> 67#include <sys/systm.h> 68#include <sys/kernel.h> 69#include <sys/module.h> 70#include <sys/bus.h> 71#include <sys/conf.h> 72#include <sys/poll.h> 73#include <sys/syslog.h> --- 1026 unchanged lines hidden (view full) --- 1100psmopen(dev_t dev, int flag, int fmt, struct proc *p) 1101{ 1102 int unit = PSM_UNIT(dev); 1103 struct psm_softc *sc; 1104 int command_byte; 1105 int err; 1106 int s; 1107 |
1111 /* Validate unit number */ 1112 if (unit >= NPSM) 1113 return (ENXIO); 1114 | |
1115 /* Get device data */ 1116 sc = PSM_SOFTC(unit); 1117 if ((sc == NULL) || (sc->state & PSM_VALID) == 0) 1118 /* the device is no longer valid/functioning */ 1119 return (ENXIO); 1120 1121 /* Disallow multiple opens */ 1122 if (sc->state & PSM_OPEN) --- 1322 unchanged lines hidden (view full) --- 2445 2446 return (err); 2447#else /* !PSM_HOOKRESUME */ 2448 return (0); 2449#endif /* PSM_HOOKRESUME */ 2450} 2451 2452DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass, 0, 0); | 1108 /* Get device data */ 1109 sc = PSM_SOFTC(unit); 1110 if ((sc == NULL) || (sc->state & PSM_VALID) == 0) 1111 /* the device is no longer valid/functioning */ 1112 return (ENXIO); 1113 1114 /* Disallow multiple opens */ 1115 if (sc->state & PSM_OPEN) --- 1322 unchanged lines hidden (view full) --- 2438 2439 return (err); 2440#else /* !PSM_HOOKRESUME */ 2441 return (0); 2442#endif /* PSM_HOOKRESUME */ 2443} 2444 2445DRIVER_MODULE(psm, atkbdc, psm_driver, psm_devclass, 0, 0); |
2453 2454#endif /* NPSM > 0 */ | |