| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: spkr.c,v 1.17.14.1 2021/03/21 21:09:09 thorpej Exp $ */ | | 1 | /* $NetBSD: spkr.c,v 1.17.14.2 2021/03/28 19:50:05 thorpej Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1990 Eric S. Raymond (esr@snark.thyrsus.com) | | 4 | * Copyright (c) 1990 Eric S. Raymond (esr@snark.thyrsus.com) |
5 | * Copyright (c) 1990 Andrew A. Chernov (ache@astral.msk.su) | | 5 | * Copyright (c) 1990 Andrew A. Chernov (ache@astral.msk.su) |
6 | * Copyright (c) 1990 Lennart Augustsson (lennart@augustsson.net) | | 6 | * Copyright (c) 1990 Lennart Augustsson (lennart@augustsson.net) |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -33,27 +33,27 @@ | | | @@ -33,27 +33,27 @@ |
33 | * POSSIBILITY OF SUCH DAMAGE. | | 33 | * POSSIBILITY OF SUCH DAMAGE. |
34 | */ | | 34 | */ |
35 | | | 35 | |
36 | /* | | 36 | /* |
37 | * spkr.c -- device driver for console speaker on 80386 | | 37 | * spkr.c -- device driver for console speaker on 80386 |
38 | * | | 38 | * |
39 | * v1.1 by Eric S. Raymond (esr@snark.thyrsus.com) Feb 1990 | | 39 | * v1.1 by Eric S. Raymond (esr@snark.thyrsus.com) Feb 1990 |
40 | * modified for 386bsd by Andrew A. Chernov <ache@astral.msk.su> | | 40 | * modified for 386bsd by Andrew A. Chernov <ache@astral.msk.su> |
41 | * 386bsd only clean version, all SYSV stuff removed | | 41 | * 386bsd only clean version, all SYSV stuff removed |
42 | * use hz value from param.c | | 42 | * use hz value from param.c |
43 | */ | | 43 | */ |
44 | | | 44 | |
45 | #include <sys/cdefs.h> | | 45 | #include <sys/cdefs.h> |
46 | __KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.17.14.1 2021/03/21 21:09:09 thorpej Exp $"); | | 46 | __KERNEL_RCSID(0, "$NetBSD: spkr.c,v 1.17.14.2 2021/03/28 19:50:05 thorpej Exp $"); |
47 | | | 47 | |
48 | #if defined(_KERNEL_OPT) | | 48 | #if defined(_KERNEL_OPT) |
49 | #include "wsmux.h" | | 49 | #include "wsmux.h" |
50 | #endif | | 50 | #endif |
51 | | | 51 | |
52 | #include <sys/param.h> | | 52 | #include <sys/param.h> |
53 | #include <sys/systm.h> | | 53 | #include <sys/systm.h> |
54 | #include <sys/kernel.h> | | 54 | #include <sys/kernel.h> |
55 | #include <sys/errno.h> | | 55 | #include <sys/errno.h> |
56 | #include <sys/device.h> | | 56 | #include <sys/device.h> |
57 | #include <sys/malloc.h> | | 57 | #include <sys/malloc.h> |
58 | #include <sys/module.h> | | 58 | #include <sys/module.h> |
59 | #include <sys/uio.h> | | 59 | #include <sys/uio.h> |
| @@ -365,27 +365,27 @@ spkr_attach(device_t self, void (*tone)( | | | @@ -365,27 +365,27 @@ spkr_attach(device_t self, void (*tone)( |
365 | void (*rest)(device_t, int)) | | 365 | void (*rest)(device_t, int)) |
366 | { | | 366 | { |
367 | struct spkr_softc *sc = device_private(self); | | 367 | struct spkr_softc *sc = device_private(self); |
368 | | | 368 | |
369 | #ifdef SPKRDEBUG | | 369 | #ifdef SPKRDEBUG |
370 | aprint_debug("%s: entering for unit %d\n", __func__, self->dv_unit); | | 370 | aprint_debug("%s: entering for unit %d\n", __func__, self->dv_unit); |
371 | #endif /* SPKRDEBUG */ | | 371 | #endif /* SPKRDEBUG */ |
372 | sc->sc_dev = self; | | 372 | sc->sc_dev = self; |
373 | sc->sc_tone = tone; | | 373 | sc->sc_tone = tone; |
374 | sc->sc_rest = rest; | | 374 | sc->sc_rest = rest; |
375 | sc->sc_inbuf = NULL; | | 375 | sc->sc_inbuf = NULL; |
376 | sc->sc_wsbelldev = NULL; | | 376 | sc->sc_wsbelldev = NULL; |
377 | | | 377 | |
378 | spkr_rescan(self, "", NULL); | | 378 | spkr_rescan(self, NULL, NULL); |
379 | } | | 379 | } |
380 | | | 380 | |
381 | int | | 381 | int |
382 | spkr_detach(device_t self, int flags) | | 382 | spkr_detach(device_t self, int flags) |
383 | { | | 383 | { |
384 | struct spkr_softc *sc = device_private(self); | | 384 | struct spkr_softc *sc = device_private(self); |
385 | int rc; | | 385 | int rc; |
386 | | | 386 | |
387 | #ifdef SPKRDEBUG | | 387 | #ifdef SPKRDEBUG |
388 | aprint_debug("%s: entering for unit %d\n", __func__, self->dv_unit); | | 388 | aprint_debug("%s: entering for unit %d\n", __func__, self->dv_unit); |
389 | #endif /* SPKRDEBUG */ | | 389 | #endif /* SPKRDEBUG */ |
390 | if (sc == NULL) | | 390 | if (sc == NULL) |
391 | return ENXIO; | | 391 | return ENXIO; |