| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ts.c,v 1.34 2022/01/01 10:32:29 msaitoh Exp $ */ | | 1 | /* $NetBSD: ts.c,v 1.35 2022/02/12 02:40:20 riastradh Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1991 The Regents of the University of California. | | 4 | * Copyright (c) 1991 The Regents of the University of California. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -56,27 +56,27 @@ | | | @@ -56,27 +56,27 @@ |
56 | * derivative copyright rights, appropriate copyright * | | 56 | * derivative copyright rights, appropriate copyright * |
57 | * legends may be placed on the derivative work in addition * | | 57 | * legends may be placed on the derivative work in addition * |
58 | * to that set forth above. * | | 58 | * to that set forth above. * |
59 | * * | | 59 | * * |
60 | ************************************************************************/ | | 60 | ************************************************************************/ |
61 | | | 61 | |
62 | /* | | 62 | /* |
63 | * TSV05/TS05 device driver, written by Bertram Barth. | | 63 | * TSV05/TS05 device driver, written by Bertram Barth. |
64 | * | | 64 | * |
65 | * should be TS11 compatible (untested) | | 65 | * should be TS11 compatible (untested) |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #include <sys/cdefs.h> | | 68 | #include <sys/cdefs.h> |
69 | __KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.34 2022/01/01 10:32:29 msaitoh Exp $"); | | 69 | __KERNEL_RCSID(0, "$NetBSD: ts.c,v 1.35 2022/02/12 02:40:20 riastradh Exp $"); |
70 | | | 70 | |
71 | #undef TSDEBUG | | 71 | #undef TSDEBUG |
72 | | | 72 | |
73 | /* | | 73 | /* |
74 | * TODO: | | 74 | * TODO: |
75 | * | | 75 | * |
76 | * Keep track of tape position so that lseek et al works. | | 76 | * Keep track of tape position so that lseek et al works. |
77 | * Use tprintf to inform the user, not the system console. | | 77 | * Use tprintf to inform the user, not the system console. |
78 | */ | | 78 | */ |
79 | | | 79 | |
80 | | | 80 | |
81 | #include <sys/param.h> | | 81 | #include <sys/param.h> |
82 | #include <sys/systm.h> | | 82 | #include <sys/systm.h> |
| @@ -205,38 +205,35 @@ const struct cdevsw ts_cdevsw = { | | | @@ -205,38 +205,35 @@ const struct cdevsw ts_cdevsw = { |
205 | /* Bits in minor device */ | | 205 | /* Bits in minor device */ |
206 | #define TS_UNIT(dev) (minor(dev)&03) | | 206 | #define TS_UNIT(dev) (minor(dev)&03) |
207 | #define TS_HIDENSITY 010 | | 207 | #define TS_HIDENSITY 010 |
208 | | | 208 | |
209 | #define TS_PRI LOG_INFO | | 209 | #define TS_PRI LOG_INFO |
210 | | | 210 | |
211 | | | 211 | |
212 | /* | | 212 | /* |
213 | * Probe for device. If found, try to raise an interrupt. | | 213 | * Probe for device. If found, try to raise an interrupt. |
214 | */ | | 214 | */ |
215 | int | | 215 | int |
216 | tsmatch(device_t parent, cfdata_t match, void *aux) | | 216 | tsmatch(device_t parent, cfdata_t match, void *aux) |
217 | { | | 217 | { |
218 | struct device tsdev; | | | |
219 | struct ts_softc ssc; | | 218 | struct ts_softc ssc; |
220 | struct ts_softc *sc = &ssc; | | 219 | struct ts_softc *sc = &ssc; |
221 | struct uba_attach_args *ua = aux; | | 220 | struct uba_attach_args *ua = aux; |
222 | int i; | | 221 | int i; |
223 | | | 222 | |
224 | sc->sc_iot = ua->ua_iot; | | 223 | sc->sc_iot = ua->ua_iot; |
225 | sc->sc_ioh = ua->ua_ioh; | | 224 | sc->sc_ioh = ua->ua_ioh; |
226 | sc->sc_mapped = 0; | | 225 | sc->sc_mapped = 0; |
227 | sc->sc_dev = &tsdev; | | | |
228 | sc->sc_uh = device_private(parent); | | 226 | sc->sc_uh = device_private(parent); |
229 | strcpy(sc->sc_dev->dv_xname, "ts"); | | | |
230 | | | 227 | |
231 | /* Try to reset the device */ | | 228 | /* Try to reset the device */ |
232 | for (i = 0; i < 3; i++) { | | 229 | for (i = 0; i < 3; i++) { |
233 | if (tsreset(sc)) | | 230 | if (tsreset(sc)) |
234 | break; | | 231 | break; |
235 | } | | 232 | } |
236 | | | 233 | |
237 | if (i == 3) | | 234 | if (i == 3) |
238 | return 0; | | 235 | return 0; |
239 | | | 236 | |
240 | tsinit(sc); | | 237 | tsinit(sc); |
241 | tswchar(sc); /* write charact. to enable interrupts */ | | 238 | tswchar(sc); /* write charact. to enable interrupts */ |
242 | /* completion of this will raise the intr. */ | | 239 | /* completion of this will raise the intr. */ |