oj6sh.c revision 1.1.10.3 1 1.1.10.2 tls /* $NetBSD: oj6sh.c,v 1.1.10.3 2017/12/03 11:37:32 jdolecek Exp $ */
2 1.1.10.2 tls
3 1.1.10.2 tls /*
4 1.1.10.2 tls * Copyright (c) 2014 Genetec Corporation. All rights reserved.
5 1.1.10.2 tls * Written by Hashimoto Kenichi for Genetec Corporation.
6 1.1.10.2 tls *
7 1.1.10.2 tls * Redistribution and use in source and binary forms, with or without
8 1.1.10.2 tls * modification, are permitted provided that the following conditions
9 1.1.10.2 tls * are met:
10 1.1.10.2 tls * 1. Redistributions of source code must retain the above copyright
11 1.1.10.2 tls * notice, this list of conditions and the following disclaimer.
12 1.1.10.2 tls * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.10.2 tls * notice, this list of conditions and the following disclaimer in the
14 1.1.10.2 tls * documentation and/or other materials provided with the distribution.
15 1.1.10.2 tls *
16 1.1.10.2 tls * THIS SOFTWARE IS PROVIDED BY GENETEC CORPORATION ``AS IS'' AND
17 1.1.10.2 tls * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 1.1.10.2 tls * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 1.1.10.2 tls * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GENETEC CORPORATION
20 1.1.10.2 tls * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 1.1.10.2 tls * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 1.1.10.2 tls * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 1.1.10.2 tls * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 1.1.10.2 tls * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 1.1.10.2 tls * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.1.10.2 tls * POSSIBILITY OF SUCH DAMAGE.
27 1.1.10.2 tls */
28 1.1.10.2 tls
29 1.1.10.2 tls /*
30 1.1.10.2 tls * Sharp NetWalker's Optical Joystick
31 1.1.10.2 tls */
32 1.1.10.2 tls
33 1.1.10.2 tls #include <sys/cdefs.h>
34 1.1.10.2 tls __KERNEL_RCSID(0, "$NetBSD: oj6sh.c,v 1.1.10.3 2017/12/03 11:37:32 jdolecek Exp $");
35 1.1.10.2 tls
36 1.1.10.2 tls #include "opt_oj6sh.h"
37 1.1.10.2 tls
38 1.1.10.2 tls #include <sys/param.h>
39 1.1.10.2 tls #include <sys/systm.h>
40 1.1.10.2 tls #include <sys/kernel.h>
41 1.1.10.2 tls #include <sys/device.h>
42 1.1.10.2 tls #include <sys/lock.h>
43 1.1.10.2 tls #include <sys/callout.h>
44 1.1.10.2 tls #include <sys/bus.h>
45 1.1.10.2 tls #include <sys/mutex.h>
46 1.1.10.3 jdolecek #include <sys/workqueue.h>
47 1.1.10.2 tls
48 1.1.10.2 tls #include <dev/wscons/wsconsio.h>
49 1.1.10.2 tls #include <dev/wscons/wsmousevar.h>
50 1.1.10.2 tls #include <dev/wscons/wsdisplayvar.h>
51 1.1.10.2 tls
52 1.1.10.2 tls #include <dev/hpc/hpcfbio.h>
53 1.1.10.2 tls #include <dev/hpc/hpctpanelvar.h>
54 1.1.10.2 tls
55 1.1.10.2 tls #include <dev/spi/spivar.h>
56 1.1.10.2 tls
57 1.1.10.2 tls #ifdef OJ6SH_DEBUG
58 1.1.10.2 tls int oj6sh_debug = OJ6SH_DEBUG;
59 1.1.10.2 tls #define DPRINTF(n,x) if (oj6sh_debug>(n)) printf x;
60 1.1.10.2 tls #else
61 1.1.10.2 tls #define DPRINTF(n,x)
62 1.1.10.2 tls #endif
63 1.1.10.2 tls
64 1.1.10.2 tls #define POLLRATE (hz/30)
65 1.1.10.2 tls
66 1.1.10.2 tls /* register address */
67 1.1.10.2 tls #define OJ6SH_PRODUCT 0x00
68 1.1.10.2 tls #define OJ6SH_REVISION 0x01
69 1.1.10.2 tls #define OJ6SH_MOTION 0x02
70 1.1.10.2 tls #define OJ6SH_DELTA_X 0x03
71 1.1.10.2 tls #define OJ6SH_DELTA_Y 0x04
72 1.1.10.2 tls #define OJ6SH_SQUAL 0x05
73 1.1.10.2 tls #define OJ6SH_SHUTTER 0x06
74 1.1.10.2 tls #define OJ6SH_CONFIG 0x11
75 1.1.10.2 tls #define OJ6SH_RESET 0x3a
76 1.1.10.2 tls #define POWERON_RESET 0x5a
77 1.1.10.2 tls #define OJ6SH_N_REVISION 0x3e
78 1.1.10.2 tls #define OJ6SH_N_PRODUCT 0x3f
79 1.1.10.2 tls
80 1.1.10.2 tls struct oj6sh_softc {
81 1.1.10.2 tls device_t sc_dev;
82 1.1.10.2 tls
83 1.1.10.2 tls struct spi_handle *sc_sh;
84 1.1.10.2 tls struct callout sc_c;
85 1.1.10.2 tls
86 1.1.10.2 tls kmutex_t sc_lock;
87 1.1.10.3 jdolecek struct workqueue *sc_wq;
88 1.1.10.3 jdolecek struct work sc_wk;
89 1.1.10.3 jdolecek
90 1.1.10.2 tls int sc_enabled;
91 1.1.10.2 tls
92 1.1.10.2 tls device_t sc_wsmousedev;
93 1.1.10.2 tls };
94 1.1.10.2 tls
95 1.1.10.2 tls struct oj6sh_delta {
96 1.1.10.2 tls int x;
97 1.1.10.2 tls int y;
98 1.1.10.2 tls };
99 1.1.10.2 tls
100 1.1.10.2 tls static uint8_t oj6sh_read(struct spi_handle *, uint8_t);
101 1.1.10.2 tls static void oj6sh_write(struct spi_handle *, uint8_t, uint8_t);
102 1.1.10.2 tls
103 1.1.10.2 tls static int oj6sh_match(device_t , cfdata_t , void *);
104 1.1.10.2 tls static void oj6sh_attach(device_t , device_t , void *);
105 1.1.10.2 tls
106 1.1.10.2 tls CFATTACH_DECL_NEW(oj6sh, sizeof(struct oj6sh_softc),
107 1.1.10.2 tls oj6sh_match, oj6sh_attach, NULL, NULL);
108 1.1.10.2 tls
109 1.1.10.2 tls static bool oj6sh_motion(struct spi_handle *);
110 1.1.10.2 tls static bool oj6sh_squal(struct spi_handle *);
111 1.1.10.2 tls static bool oj6sh_shuttrer(struct spi_handle *);
112 1.1.10.2 tls static int oj6sh_readdelta(struct spi_handle *, struct oj6sh_delta *);
113 1.1.10.2 tls
114 1.1.10.2 tls static void oj6sh_poll(void *);
115 1.1.10.3 jdolecek static void oj6sh_cb(struct work *, void *);
116 1.1.10.3 jdolecek static int oj6sh_enable(void *);
117 1.1.10.3 jdolecek static void oj6sh_disable(void *);
118 1.1.10.2 tls static int oj6sh_ioctl(void *, u_long, void *, int, struct lwp *);
119 1.1.10.2 tls
120 1.1.10.2 tls static bool oj6sh_resume(device_t, const pmf_qual_t *);
121 1.1.10.2 tls static bool oj6sh_suspend(device_t, const pmf_qual_t *);
122 1.1.10.2 tls
123 1.1.10.2 tls static const struct wsmouse_accessops oj6sh_accessops = {
124 1.1.10.2 tls .enable = oj6sh_enable,
125 1.1.10.2 tls .ioctl = oj6sh_ioctl,
126 1.1.10.2 tls .disable = oj6sh_disable
127 1.1.10.2 tls };
128 1.1.10.2 tls
129 1.1.10.2 tls static int
130 1.1.10.2 tls oj6sh_match(device_t parent, cfdata_t match, void *aux)
131 1.1.10.2 tls {
132 1.1.10.2 tls struct spi_attach_args *sa = aux;
133 1.1.10.2 tls
134 1.1.10.2 tls if (strcmp(match->cf_name, "oj6sh"))
135 1.1.10.2 tls return 0;
136 1.1.10.2 tls if (spi_configure(sa->sa_handle, SPI_MODE_0, 2500000))
137 1.1.10.2 tls return 0;
138 1.1.10.2 tls
139 1.1.10.2 tls return 2;
140 1.1.10.2 tls }
141 1.1.10.2 tls
142 1.1.10.2 tls static void
143 1.1.10.2 tls oj6sh_doattach(device_t self)
144 1.1.10.2 tls {
145 1.1.10.2 tls struct oj6sh_softc *sc = device_private(self);
146 1.1.10.2 tls uint8_t product;
147 1.1.10.2 tls uint8_t rev;
148 1.1.10.2 tls uint8_t product_inv;
149 1.1.10.2 tls uint8_t rev_inv;
150 1.1.10.2 tls
151 1.1.10.2 tls /* reset */
152 1.1.10.2 tls oj6sh_write(sc->sc_sh, OJ6SH_RESET, POWERON_RESET);
153 1.1.10.2 tls delay(10000);
154 1.1.10.2 tls
155 1.1.10.2 tls /* resolution */
156 1.1.10.2 tls oj6sh_write(sc->sc_sh, OJ6SH_CONFIG, 0x80);
157 1.1.10.2 tls
158 1.1.10.2 tls product = oj6sh_read(sc->sc_sh, OJ6SH_PRODUCT);
159 1.1.10.2 tls rev = oj6sh_read(sc->sc_sh, OJ6SH_REVISION);
160 1.1.10.2 tls product_inv = oj6sh_read(sc->sc_sh, OJ6SH_N_PRODUCT);
161 1.1.10.2 tls rev_inv = oj6sh_read(sc->sc_sh, OJ6SH_N_REVISION);
162 1.1.10.2 tls
163 1.1.10.2 tls if (((product | product_inv) != 0xff) || ((rev | rev_inv) != 0xff)) {
164 1.1.10.2 tls aprint_error_dev(self,
165 1.1.10.2 tls "mismatch product (%02x:%02x), rev (%02x:%02x)\n",
166 1.1.10.2 tls product, product_inv, rev, rev_inv);
167 1.1.10.2 tls return;
168 1.1.10.2 tls }
169 1.1.10.2 tls
170 1.1.10.2 tls aprint_normal("%s: id 0x%02x, revision 0x%02x\n",
171 1.1.10.2 tls device_xname(sc->sc_dev), product, rev);
172 1.1.10.2 tls
173 1.1.10.2 tls return;
174 1.1.10.2 tls }
175 1.1.10.2 tls
176 1.1.10.2 tls static void
177 1.1.10.2 tls oj6sh_attach(device_t parent, device_t self, void *aux)
178 1.1.10.2 tls {
179 1.1.10.2 tls struct oj6sh_softc *sc = device_private(self);
180 1.1.10.2 tls struct spi_attach_args *sa = aux;
181 1.1.10.2 tls struct wsmousedev_attach_args a;
182 1.1.10.2 tls
183 1.1.10.2 tls aprint_normal(": OJ6SH-T25 Optical Joystick\n");
184 1.1.10.2 tls
185 1.1.10.2 tls mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
186 1.1.10.2 tls
187 1.1.10.2 tls sc->sc_dev = self;
188 1.1.10.2 tls sc->sc_enabled = 0;
189 1.1.10.2 tls
190 1.1.10.2 tls callout_init(&sc->sc_c, 0);
191 1.1.10.3 jdolecek workqueue_create(&sc->sc_wq, "oj6sh",
192 1.1.10.3 jdolecek oj6sh_cb, sc, PRI_NONE, IPL_BIO, 0);
193 1.1.10.2 tls
194 1.1.10.2 tls sc->sc_sh = sa->sa_handle;
195 1.1.10.2 tls
196 1.1.10.2 tls a.accessops = &oj6sh_accessops;
197 1.1.10.2 tls a.accesscookie = sc;
198 1.1.10.2 tls
199 1.1.10.2 tls sc->sc_wsmousedev = config_found(self, &a, wsmousedevprint);
200 1.1.10.2 tls
201 1.1.10.2 tls config_interrupts(self, oj6sh_doattach);
202 1.1.10.2 tls }
203 1.1.10.2 tls
204 1.1.10.2 tls static void
205 1.1.10.2 tls oj6sh_poll(void *arg)
206 1.1.10.2 tls {
207 1.1.10.2 tls struct oj6sh_softc *sc = (struct oj6sh_softc *)arg;
208 1.1.10.3 jdolecek
209 1.1.10.3 jdolecek workqueue_enqueue(sc->sc_wq, &sc->sc_wk, NULL);
210 1.1.10.3 jdolecek
211 1.1.10.3 jdolecek if (sc->sc_enabled)
212 1.1.10.3 jdolecek callout_reset(&sc->sc_c, POLLRATE, oj6sh_poll, sc);
213 1.1.10.3 jdolecek
214 1.1.10.3 jdolecek return;
215 1.1.10.3 jdolecek }
216 1.1.10.3 jdolecek
217 1.1.10.3 jdolecek static void
218 1.1.10.3 jdolecek oj6sh_cb(struct work *wk, void *arg)
219 1.1.10.3 jdolecek {
220 1.1.10.3 jdolecek struct oj6sh_softc *sc = (struct oj6sh_softc *)arg;
221 1.1.10.2 tls struct oj6sh_delta delta = {0, 0};
222 1.1.10.2 tls uint32_t buttons = 0;
223 1.1.10.2 tls int s;
224 1.1.10.2 tls int x, y;
225 1.1.10.2 tls
226 1.1.10.2 tls mutex_enter(&sc->sc_lock);
227 1.1.10.2 tls
228 1.1.10.2 tls if (oj6sh_motion(sc->sc_sh) == false)
229 1.1.10.2 tls goto out;
230 1.1.10.2 tls else if ((oj6sh_squal(sc->sc_sh) == true) &&
231 1.1.10.2 tls (oj6sh_shuttrer(sc->sc_sh) == true))
232 1.1.10.2 tls goto out;
233 1.1.10.2 tls
234 1.1.10.2 tls oj6sh_readdelta(sc->sc_sh, &delta);
235 1.1.10.2 tls DPRINTF(3,("%s: x = %d, y = %d\n", device_xname(sc->sc_dev),
236 1.1.10.2 tls delta.x, delta.y));
237 1.1.10.2 tls
238 1.1.10.2 tls #if defined(J6SH_DOWN_Y_LEFT_X)
239 1.1.10.2 tls y = -delta.y;
240 1.1.10.2 tls x = -delta.x;
241 1.1.10.2 tls #elif defined(OJ6SH_UP_X_LEFT_Y)
242 1.1.10.2 tls y = delta.x;
243 1.1.10.2 tls x = -delta.y;
244 1.1.10.2 tls #elif defined(OJ6SH_DOWN_X_RIGHT_Y)
245 1.1.10.2 tls y = -delta.x;
246 1.1.10.2 tls x = delta.y;
247 1.1.10.2 tls #else /* OJ6SH_UP_Y_RIGHT_X */
248 1.1.10.2 tls y = delta.y;
249 1.1.10.2 tls x = delta.x;
250 1.1.10.2 tls #endif
251 1.1.10.2 tls s = spltty();
252 1.1.10.2 tls wsmouse_input(sc->sc_wsmousedev, buttons, x, y, 0, 0,
253 1.1.10.2 tls WSMOUSE_INPUT_DELTA);
254 1.1.10.2 tls splx(s);
255 1.1.10.2 tls out:
256 1.1.10.2 tls mutex_exit(&sc->sc_lock);
257 1.1.10.2 tls }
258 1.1.10.2 tls
259 1.1.10.2 tls static uint8_t
260 1.1.10.2 tls oj6sh_read(struct spi_handle *spi, uint8_t reg)
261 1.1.10.2 tls {
262 1.1.10.2 tls uint8_t ret = 0;
263 1.1.10.2 tls
264 1.1.10.2 tls spi_send_recv(spi, 1, ®, 1, &ret);
265 1.1.10.2 tls DPRINTF(4,("%s: 0x%02x = 0x%02x\n", __func__, reg, ret));
266 1.1.10.2 tls return ret;
267 1.1.10.2 tls }
268 1.1.10.2 tls
269 1.1.10.2 tls static void
270 1.1.10.2 tls oj6sh_write(struct spi_handle *spi, uint8_t reg, uint8_t val)
271 1.1.10.2 tls {
272 1.1.10.2 tls uint8_t tmp[2] = {reg | 0x80, val};
273 1.1.10.2 tls
274 1.1.10.2 tls spi_send(spi, 2, tmp);
275 1.1.10.2 tls DPRINTF(4,("%s: 0x%02x = 0x%02x\n", __func__, reg, val));
276 1.1.10.2 tls return;
277 1.1.10.2 tls }
278 1.1.10.2 tls
279 1.1.10.2 tls static bool
280 1.1.10.2 tls oj6sh_motion(struct spi_handle *spi)
281 1.1.10.2 tls {
282 1.1.10.2 tls uint16_t motion;
283 1.1.10.2 tls motion = oj6sh_read(spi, OJ6SH_MOTION);
284 1.1.10.2 tls return (motion & __BIT(7) ? true : false);
285 1.1.10.2 tls }
286 1.1.10.2 tls
287 1.1.10.2 tls static bool
288 1.1.10.2 tls oj6sh_squal(struct spi_handle *spi)
289 1.1.10.2 tls {
290 1.1.10.2 tls uint16_t squal;
291 1.1.10.2 tls squal = oj6sh_read(spi, OJ6SH_SQUAL);
292 1.1.10.2 tls return (squal < 25 ? true : false);
293 1.1.10.2 tls }
294 1.1.10.2 tls
295 1.1.10.2 tls static bool
296 1.1.10.2 tls oj6sh_shuttrer(struct spi_handle *spi)
297 1.1.10.2 tls {
298 1.1.10.2 tls uint16_t shutter;
299 1.1.10.2 tls shutter = oj6sh_read(spi, OJ6SH_SHUTTER) << 8;
300 1.1.10.2 tls shutter |= oj6sh_read(spi, OJ6SH_SHUTTER + 1);
301 1.1.10.2 tls return (shutter > 600 ? true : false);
302 1.1.10.2 tls }
303 1.1.10.2 tls
304 1.1.10.2 tls static int
305 1.1.10.2 tls oj6sh_readdelta(struct spi_handle *spi, struct oj6sh_delta *delta)
306 1.1.10.2 tls {
307 1.1.10.2 tls delta->x = (int8_t)oj6sh_read(spi, OJ6SH_DELTA_X);
308 1.1.10.2 tls delta->y = (int8_t)oj6sh_read(spi, OJ6SH_DELTA_Y);
309 1.1.10.2 tls return 0;
310 1.1.10.2 tls }
311 1.1.10.2 tls
312 1.1.10.2 tls int
313 1.1.10.2 tls oj6sh_ioctl(void *v, u_long cmd, void *data, int flag, struct lwp *l)
314 1.1.10.2 tls {
315 1.1.10.2 tls struct wsmouse_id *id;
316 1.1.10.2 tls
317 1.1.10.2 tls switch (cmd) {
318 1.1.10.2 tls case WSMOUSEIO_GTYPE:
319 1.1.10.2 tls *(u_int *)data = WSMOUSE_TYPE_PS2;
320 1.1.10.2 tls return 0;
321 1.1.10.2 tls case WSMOUSEIO_GETID:
322 1.1.10.2 tls id = (struct wsmouse_id *)data;
323 1.1.10.2 tls if (id->type != WSMOUSE_ID_TYPE_UIDSTR)
324 1.1.10.2 tls return EINVAL;
325 1.1.10.2 tls strlcpy(id->data, "OJ6SH-T25", WSMOUSE_ID_MAXLEN);
326 1.1.10.2 tls id->length = strlen(id->data);
327 1.1.10.2 tls return 0;
328 1.1.10.2 tls }
329 1.1.10.2 tls
330 1.1.10.2 tls return EPASSTHROUGH;
331 1.1.10.2 tls }
332 1.1.10.2 tls
333 1.1.10.2 tls int
334 1.1.10.2 tls oj6sh_enable(void *v)
335 1.1.10.2 tls {
336 1.1.10.2 tls struct oj6sh_softc *sc = (struct oj6sh_softc *)v;
337 1.1.10.2 tls
338 1.1.10.2 tls DPRINTF(3,("%s: oj6sh_enable()\n", device_xname(sc->sc_dev)));
339 1.1.10.2 tls if (sc->sc_enabled) {
340 1.1.10.2 tls DPRINTF(3,("%s: already enabled\n", device_xname(sc->sc_dev)));
341 1.1.10.2 tls return EBUSY;
342 1.1.10.2 tls }
343 1.1.10.2 tls
344 1.1.10.2 tls if (!pmf_device_register(sc->sc_dev, oj6sh_suspend, oj6sh_resume))
345 1.1.10.2 tls aprint_error_dev(sc->sc_dev, "couldn't establish power handler\n");
346 1.1.10.2 tls
347 1.1.10.2 tls sc->sc_enabled = 1;
348 1.1.10.2 tls callout_reset(&sc->sc_c, POLLRATE, oj6sh_poll, sc);
349 1.1.10.2 tls
350 1.1.10.2 tls return 0;
351 1.1.10.2 tls }
352 1.1.10.2 tls
353 1.1.10.2 tls void
354 1.1.10.2 tls oj6sh_disable(void *v)
355 1.1.10.2 tls {
356 1.1.10.2 tls struct oj6sh_softc *sc = (struct oj6sh_softc *)v;
357 1.1.10.2 tls
358 1.1.10.2 tls DPRINTF(3,("%s: oj6sh_disable()\n", device_xname(sc->sc_dev)));
359 1.1.10.2 tls if (!sc->sc_enabled) {
360 1.1.10.2 tls DPRINTF(3,("%s: already disabled()\n", device_xname(sc->sc_dev)));
361 1.1.10.2 tls return;
362 1.1.10.2 tls }
363 1.1.10.2 tls
364 1.1.10.2 tls pmf_device_deregister(sc->sc_dev);
365 1.1.10.2 tls
366 1.1.10.2 tls sc->sc_enabled = 0;
367 1.1.10.2 tls
368 1.1.10.2 tls return;
369 1.1.10.2 tls }
370 1.1.10.2 tls
371 1.1.10.2 tls static bool
372 1.1.10.2 tls oj6sh_suspend(device_t dv, const pmf_qual_t *qual)
373 1.1.10.2 tls {
374 1.1.10.2 tls struct oj6sh_softc *sc = device_private(dv);
375 1.1.10.2 tls
376 1.1.10.2 tls DPRINTF(3,("%s: oj6sh_suspend()\n", device_xname(sc->sc_dev)));
377 1.1.10.2 tls callout_stop(&sc->sc_c);
378 1.1.10.2 tls sc->sc_enabled = 0;
379 1.1.10.2 tls
380 1.1.10.2 tls return true;
381 1.1.10.2 tls }
382 1.1.10.2 tls
383 1.1.10.2 tls static bool
384 1.1.10.2 tls oj6sh_resume(device_t dv, const pmf_qual_t *qual)
385 1.1.10.2 tls {
386 1.1.10.2 tls struct oj6sh_softc *sc = device_private(dv);
387 1.1.10.2 tls
388 1.1.10.2 tls DPRINTF(3,("%s: oj6sh_resume()\n", device_xname(sc->sc_dev)));
389 1.1.10.2 tls sc->sc_enabled = 1;
390 1.1.10.2 tls callout_reset(&sc->sc_c, POLLRATE, oj6sh_poll, sc);
391 1.1.10.2 tls
392 1.1.10.2 tls return true;
393 1.1.10.2 tls }
394 1.1.10.2 tls
395