| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: spif.c,v 1.18 2008/06/11 21:25:31 drochner Exp $ */ | | 1 | /* $NetBSD: spif.c,v 1.18.6.1 2011/01/07 03:52:34 riz Exp $ */ |
2 | /* $OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $ */ | | 2 | /* $OpenBSD: spif.c,v 1.12 2003/10/03 16:44:51 miod Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net) | | 5 | * Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net) |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -31,27 +31,27 @@ | | | @@ -31,27 +31,27 @@ |
31 | * Materiel Command, USAF, under agreement number F30602-01-2-0537. | | 31 | * Materiel Command, USAF, under agreement number F30602-01-2-0537. |
32 | * | | 32 | * |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | /* | | 35 | /* |
36 | * Driver for the SUNW,spif: 8 serial, 1 parallel sbus board | | 36 | * Driver for the SUNW,spif: 8 serial, 1 parallel sbus board |
37 | * based heavily on Iain Hibbert's driver for the MAGMA cards | | 37 | * based heavily on Iain Hibbert's driver for the MAGMA cards |
38 | */ | | 38 | */ |
39 | | | 39 | |
40 | /* Ported to NetBSD 2.0 by Hauke Fath */ | | 40 | /* Ported to NetBSD 2.0 by Hauke Fath */ |
41 | | | 41 | |
42 | | | 42 | |
43 | #include <sys/cdefs.h> | | 43 | #include <sys/cdefs.h> |
44 | __KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.18 2008/06/11 21:25:31 drochner Exp $"); | | 44 | __KERNEL_RCSID(0, "$NetBSD: spif.c,v 1.18.6.1 2011/01/07 03:52:34 riz Exp $"); |
45 | | | 45 | |
46 | #include "spif.h" | | 46 | #include "spif.h" |
47 | #if NSPIF > 0 | | 47 | #if NSPIF > 0 |
48 | | | 48 | |
49 | #include <sys/param.h> | | 49 | #include <sys/param.h> |
50 | #include <sys/systm.h> | | 50 | #include <sys/systm.h> |
51 | #include <sys/proc.h> | | 51 | #include <sys/proc.h> |
52 | #include <sys/device.h> | | 52 | #include <sys/device.h> |
53 | #include <sys/file.h> | | 53 | #include <sys/file.h> |
54 | #include <sys/ioctl.h> | | 54 | #include <sys/ioctl.h> |
55 | #include <sys/malloc.h> | | 55 | #include <sys/malloc.h> |
56 | #include <sys/tty.h> | | 56 | #include <sys/tty.h> |
57 | #include <sys/time.h> | | 57 | #include <sys/time.h> |
| @@ -100,27 +100,27 @@ const struct cdevsw stty_cdevsw = { | | | @@ -100,27 +100,27 @@ const struct cdevsw stty_cdevsw = { |
100 | stty_open, stty_close, stty_read, stty_write, stty_ioctl, | | 100 | stty_open, stty_close, stty_read, stty_write, stty_ioctl, |
101 | stty_stop, stty_tty, stty_poll, nommap, ttykqfilter, D_TTY | | 101 | stty_stop, stty_tty, stty_poll, nommap, ttykqfilter, D_TTY |
102 | }; | | 102 | }; |
103 | | | 103 | |
104 | dev_type_open(sbpp_open); | | 104 | dev_type_open(sbpp_open); |
105 | dev_type_close(sbpp_close); | | 105 | dev_type_close(sbpp_close); |
106 | dev_type_read(sbpp_read); | | 106 | dev_type_read(sbpp_read); |
107 | dev_type_write(sbpp_write); | | 107 | dev_type_write(sbpp_write); |
108 | dev_type_ioctl(sbpp_ioctl); | | 108 | dev_type_ioctl(sbpp_ioctl); |
109 | dev_type_poll(sbpp_poll); | | 109 | dev_type_poll(sbpp_poll); |
110 | | | 110 | |
111 | const struct cdevsw sbpp_cdevsw = { | | 111 | const struct cdevsw sbpp_cdevsw = { |
112 | sbpp_open, sbpp_close, sbpp_read, sbpp_write, sbpp_ioctl, | | 112 | sbpp_open, sbpp_close, sbpp_read, sbpp_write, sbpp_ioctl, |
113 | nostop, notty, sbpp_poll, nommap, nokqfilter, | | 113 | nostop, notty, sbpp_poll, nommap, nokqfilter, D_OTHER |
114 | }; | | 114 | }; |
115 | | | 115 | |
116 | | | 116 | |
117 | /* normal STC access */ | | 117 | /* normal STC access */ |
118 | #define STC_WRITE(sc,r,v) \ | | 118 | #define STC_WRITE(sc,r,v) \ |
119 | bus_space_write_1((sc)->sc_bustag, (sc)->sc_stch, (r), (v)) | | 119 | bus_space_write_1((sc)->sc_bustag, (sc)->sc_stch, (r), (v)) |
120 | #define STC_READ(sc,r) \ | | 120 | #define STC_READ(sc,r) \ |
121 | bus_space_read_1((sc)->sc_bustag, (sc)->sc_stch, (r)) | | 121 | bus_space_read_1((sc)->sc_bustag, (sc)->sc_stch, (r)) |
122 | | | 122 | |
123 | /* IACK STC access */ | | 123 | /* IACK STC access */ |
124 | #define ISTC_WRITE(sc,r,v) \ | | 124 | #define ISTC_WRITE(sc,r,v) \ |
125 | bus_space_write_1((sc)->sc_bustag, (sc)->sc_istch, (r), (v)) | | 125 | bus_space_write_1((sc)->sc_bustag, (sc)->sc_istch, (r), (v)) |
126 | #define ISTC_READ(sc,r) \ | | 126 | #define ISTC_READ(sc,r) \ |