mse.c (9540) | mse.c (10624) |
---|---|
1/* 2 * Copyright 1992 by the University of Guelph 3 * 4 * Permission to use, copy and modify this 5 * software and its documentation for any purpose and without 6 * fee is hereby granted, provided that the above copyright 7 * notice appear in all copies and that both that copyright 8 * notice and this permission notice appear in supporting 9 * documentation. 10 * University of Guelph makes no representations about the suitability of 11 * this software for any purpose. It is provided "as is" 12 * without express or implied warranty. 13 * | 1/* 2 * Copyright 1992 by the University of Guelph 3 * 4 * Permission to use, copy and modify this 5 * software and its documentation for any purpose and without 6 * fee is hereby granted, provided that the above copyright 7 * notice appear in all copies and that both that copyright 8 * notice and this permission notice appear in supporting 9 * documentation. 10 * University of Guelph makes no representations about the suitability of 11 * this software for any purpose. It is provided "as is" 12 * without express or implied warranty. 13 * |
14 * $Id: mse.c,v 1.12 1995/05/30 08:02:47 rgrimes Exp $ | 14 * $Id: mse.c,v 1.13 1995/07/16 10:12:06 bde Exp $ |
15 */ 16/* 17 * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and 18 * the X386 port, courtesy of 19 * Rick Macklem, rick@snowhite.cis.uoguelph.ca 20 * Caveats: The driver currently uses spltty(), but doesn't use any 21 * generic tty code. It could use splmse() (that only masks off the 22 * bus mouse interrupt, but that would require hacking in i386/isa/icu.s. --- 213 unchanged lines hidden (view full) --- 236 kdc_mse[idp->id_unit].kdc_state = DC_IDLE; 237 return (1); 238} 239 240/* 241 * Exclusive open the mouse, initialize it and enable interrupts. 242 */ 243int | 15 */ 16/* 17 * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and 18 * the X386 port, courtesy of 19 * Rick Macklem, rick@snowhite.cis.uoguelph.ca 20 * Caveats: The driver currently uses spltty(), but doesn't use any 21 * generic tty code. It could use splmse() (that only masks off the 22 * bus mouse interrupt, but that would require hacking in i386/isa/icu.s. --- 213 unchanged lines hidden (view full) --- 236 kdc_mse[idp->id_unit].kdc_state = DC_IDLE; 237 return (1); 238} 239 240/* 241 * Exclusive open the mouse, initialize it and enable interrupts. 242 */ 243int |
244mseopen(dev, flag) | 244mseopen(dev, flags, fmt, p) |
245 dev_t dev; | 245 dev_t dev; |
246 int flag; | 246 int flags; 247 int fmt; 248 struct proc *p; |
247{ 248 register struct mse_softc *sc; 249 int s; 250 251 if (MSE_UNIT(dev) >= NMSE) 252 return (ENXIO); 253 sc = &mse_sc[MSE_UNIT(dev)]; 254 if (sc->sc_flags & MSESC_OPEN) --- 12 unchanged lines hidden (view full) --- 267 splx(s); 268 return (0); 269} 270 271/* 272 * mseclose: just turn off mouse innterrupts. 273 */ 274int | 249{ 250 register struct mse_softc *sc; 251 int s; 252 253 if (MSE_UNIT(dev) >= NMSE) 254 return (ENXIO); 255 sc = &mse_sc[MSE_UNIT(dev)]; 256 if (sc->sc_flags & MSESC_OPEN) --- 12 unchanged lines hidden (view full) --- 269 splx(s); 270 return (0); 271} 272 273/* 274 * mseclose: just turn off mouse innterrupts. 275 */ 276int |
275mseclose(dev, flag) | 277mseclose(dev, flags, fmt, p) |
276 dev_t dev; | 278 dev_t dev; |
277 int flag; | 279 int flags; 280 int fmt; 281 struct proc *p; |
278{ 279 struct mse_softc *sc = &mse_sc[MSE_UNIT(dev)]; 280 int s; 281 282 s = spltty(); 283 (*sc->sc_disablemouse)(sc->sc_port); 284 sc->sc_flags &= ~MSESC_OPEN; 285 kdc_mse[MSE_UNIT(dev)].kdc_state = DC_IDLE; 286 splx(s); 287 return(0); 288} 289 290/* 291 * mseread: return mouse info using the MSC serial protocol, but without 292 * using bytes 4 and 5. 293 * (Yes this is cheesy, but it makes the X386 server happy, so...) 294 */ 295int | 282{ 283 struct mse_softc *sc = &mse_sc[MSE_UNIT(dev)]; 284 int s; 285 286 s = spltty(); 287 (*sc->sc_disablemouse)(sc->sc_port); 288 sc->sc_flags &= ~MSESC_OPEN; 289 kdc_mse[MSE_UNIT(dev)].kdc_state = DC_IDLE; 290 splx(s); 291 return(0); 292} 293 294/* 295 * mseread: return mouse info using the MSC serial protocol, but without 296 * using bytes 4 and 5. 297 * (Yes this is cheesy, but it makes the X386 server happy, so...) 298 */ 299int |
296mseread(dev, uio) | 300mseread(dev, uio, ioflag) |
297 dev_t dev; 298 struct uio *uio; | 301 dev_t dev; 302 struct uio *uio; |
303 int ioflag; |
|
299{ 300 register struct mse_softc *sc = &mse_sc[MSE_UNIT(dev)]; 301 int xfer, s, error; 302 303 /* 304 * If there are no protocol bytes to be read, set up a new protocol 305 * packet. 306 */ --- 258 unchanged lines hidden --- | 304{ 305 register struct mse_softc *sc = &mse_sc[MSE_UNIT(dev)]; 306 int xfer, s, error; 307 308 /* 309 * If there are no protocol bytes to be read, set up a new protocol 310 * packet. 311 */ --- 258 unchanged lines hidden --- |