2 * Copyright (c) 1998 Nicolas Souchu
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * $Id: vpoio.c,v 1.6 1999/01/30 15:35:39 nsouch Exp $
31 #include <sys/param.h>
32 #include <sys/systm.h>
33 #include <sys/malloc.h>
36 #include <machine/clock.h>
41 #include <sys/kernel.h>
46 #include <dev/ppbus/ppbconf.h>
47 #include <dev/ppbus/ppb_msq.h>
48 #include <dev/ppbus/vpoio.h>
51 * The driver pools the drive. We may add a timeout queue to avoid
52 * active polling on nACK. I've tried this but it leads to unreliable
55 #define VP0_SELTMO 5000 /* select timeout */
56 #define VP0_FAST_SPINTMO 500000 /* wait status timeout */
57 #define VP0_LOW_SPINTMO 5000000 /* wait status timeout */
60 * Actually, VP0 timings are more accurate (about few 16MHZ cycles),
61 * but succeeding in respecting such timings leads to architecture
62 * dependent considerations.
66 #define VP0_SECTOR_SIZE 512
67 #define VP0_BUFFER_SIZE 0x12000
69 #define n(flags) (~(flags) & (flags))
74 #define H_AUTO n(AUTOFEED)
75 #define H_nAUTO AUTOFEED
76 #define H_STROBE n(STROBE)
77 #define H_nSTROBE STROBE
78 #define H_BSY n(nBUSY)
81 #define H_nSEL n(SELECT)
83 #define H_nERR n(PERROR)
85 #define H_nACK n(nACK)
87 #define H_nFLT n(nFAULT)
88 #define H_SELIN n(SELECTIN)
89 #define H_nSELIN SELECTIN
91 #define H_nINIT n(nINIT)
94 * Microcode to execute very fast I/O sequences at the lowest bus level.
97 /* call this macro to initialize connect/disconnect microsequences */
98 #define INIT_TRIG_MICROSEQ { \
100 for (i=1; i <= 7; i+=2) { \
101 disconnect_microseq[i].arg[2] = (union ppb_insarg)d_pulse; \
102 connect_epp_microseq[i].arg[2] = \
103 connect_spp_microseq[i].arg[2] = (union ppb_insarg)c_pulse; \
107 #define trig_d_pulse MS_TRIG(MS_REG_CTR,5,MS_UNKNOWN /* d_pulse */)
108 static char d_pulse[] = {
109 H_AUTO | H_nSELIN | H_INIT | H_STROBE, 0,
110 H_nAUTO | H_nSELIN | H_INIT | H_STROBE, VP0_PULSE,
111 H_AUTO | H_nSELIN | H_INIT | H_STROBE, 0,
112 H_AUTO | H_SELIN | H_INIT | H_STROBE, VP0_PULSE,
113 H_AUTO | H_nSELIN | H_INIT | H_STROBE, VP0_PULSE
116 #define trig_c_pulse MS_TRIG(MS_REG_CTR,5,MS_UNKNOWN /* c_pulse */)
117 static char c_pulse[] = {
118 H_AUTO | H_nSELIN | H_INIT | H_STROBE, 0,
119 H_AUTO | H_SELIN | H_INIT | H_STROBE, 0,
120 H_nAUTO | H_SELIN | H_INIT | H_STROBE, VP0_PULSE,
121 H_AUTO | H_SELIN | H_INIT | H_STROBE, 0,
122 H_AUTO | H_nSELIN | H_INIT | H_STROBE, VP0_PULSE
125 static struct ppb_microseq disconnect_microseq[] = {
126 MS_DASS(0x0), trig_d_pulse, MS_DASS(0x3c), trig_d_pulse,
127 MS_DASS(0x20), trig_d_pulse, MS_DASS(0xf), trig_d_pulse, MS_RET(0)
130 static struct ppb_microseq connect_epp_microseq[] = {
131 MS_DASS(0x0), trig_c_pulse, MS_DASS(0x3c), trig_c_pulse,
132 MS_DASS(0x20), trig_c_pulse, MS_DASS(0xcf), trig_c_pulse, MS_RET(0)
135 static struct ppb_microseq connect_spp_microseq[] = {
136 MS_DASS(0x0), trig_c_pulse, MS_DASS(0x3c), trig_c_pulse,
137 MS_DASS(0x20), trig_c_pulse, MS_DASS(0x8f), trig_c_pulse, MS_RET(0)
141 * nibble_inbyte_hook()
143 * Formats high and low nibble into a character
146 nibble_inbyte_hook (void *p, char *ptr)
148 struct vpo_nibble *s = (struct vpo_nibble *)p;
150 /* increment the buffer pointer */
151 *ptr++ = ((s->l >> 4) & 0x0f) + (s->h & 0xf0);
157 * Macro used to initialize each vpoio_data structure during
158 * low level attachment
160 * XXX should be converted to ppb_MS_init_msq()
162 #define INIT_NIBBLE_INBYTE_SUBMICROSEQ(vpo) { \
163 (vpo)->vpo_nibble_inbyte_msq[2].arg[2].p = \
164 (void *)&(vpo)->vpo_nibble.h; \
165 (vpo)->vpo_nibble_inbyte_msq[4].arg[2].p = \
166 (void *)&(vpo)->vpo_nibble.l; \
167 (vpo)->vpo_nibble_inbyte_msq[5].arg[0].f = \
168 nibble_inbyte_hook; \
169 (vpo)->vpo_nibble_inbyte_msq[5].arg[1].p = \
170 (void *)&(vpo)->vpo_nibble; \
174 * This is the sub-microseqence for MS_GET in NIBBLE mode
175 * Retrieve the two nibbles and call the C function to generate the character
176 * and store it in the buffer (see nibble_inbyte_hook())
178 static struct ppb_microseq nibble_inbyte_submicroseq[] = {
181 MS_CASS( H_AUTO | H_SELIN | H_INIT | H_STROBE),
183 MS_RFETCH(MS_REG_STR, MS_FETCH_ALL, MS_UNKNOWN /* high nibble */),
184 MS_CASS(H_nAUTO | H_SELIN | H_INIT | H_STROBE),
185 MS_RFETCH(MS_REG_STR, MS_FETCH_ALL, MS_UNKNOWN /* low nibble */),
187 /* do a C call to format the received nibbles */
188 MS_C_CALL(MS_UNKNOWN /* C hook */, MS_UNKNOWN /* param */),
189 MS_DBRA(-7 /* loop */),
191 MS_CASS(H_AUTO | H_nSELIN | H_INIT | H_STROBE),
196 * This is the sub-microseqence for MS_GET in PS2 mode
198 static struct ppb_microseq ps2_inbyte_submicroseq[] = {
199 MS_CASS(PCD | H_AUTO | H_SELIN | H_INIT | H_nSTROBE),
202 MS_RFETCH_P(1, MS_REG_DTR, MS_FETCH_ALL),
203 MS_CASS(PCD | H_nAUTO | H_SELIN | H_INIT | H_nSTROBE),
204 MS_CASS(PCD | H_AUTO | H_SELIN | H_INIT | H_nSTROBE),
205 MS_DBRA(-4 /* loop */),
207 MS_CASS(H_AUTO | H_nSELIN | H_INIT | H_STROBE),
212 * This is the sub-microsequence for MS_PUT in both NIBBLE and PS2 modes
214 static struct ppb_microseq spp_outbyte_submicroseq[] = {
217 MS_RASSERT_P(1, MS_REG_DTR),
218 MS_CASS(H_nAUTO | H_nSELIN | H_INIT | H_STROBE),
219 MS_CASS( H_AUTO | H_nSELIN | H_INIT | H_STROBE),
221 MS_DBRA(-5 /* loop */),
223 /* return from the put call */
227 /* EPP 1.7 microsequences, ptr and len set at runtime */
228 static struct ppb_microseq epp17_outstr_body[] = {
229 MS_CASS(H_AUTO | H_SELIN | H_INIT | H_STROBE),
232 MS_RASSERT_P(1, MS_REG_EPP_D),
233 MS_BRSET(TIMEOUT, 3 /* error */), /* EPP timeout? */
234 MS_DBRA(-3 /* loop */),
236 MS_CASS(H_AUTO | H_nSELIN | H_INIT | H_STROBE),
239 MS_CASS(H_AUTO | H_nSELIN | H_INIT | H_STROBE),
243 static struct ppb_microseq epp17_instr_body[] = {
244 MS_CASS(PCD | H_AUTO | H_SELIN | H_INIT | H_STROBE),
247 MS_RFETCH_P(1, MS_REG_EPP_D, MS_FETCH_ALL),
248 MS_BRSET(TIMEOUT, 3 /* error */), /* EPP timeout? */
249 MS_DBRA(-3 /* loop */),
251 MS_CASS(PCD | H_AUTO | H_nSELIN | H_INIT | H_STROBE),
254 MS_CASS(PCD | H_AUTO | H_nSELIN | H_INIT | H_STROBE),
258 static struct ppb_microseq in_disk_mode[] = {
259 MS_CASS( H_AUTO | H_nSELIN | H_INIT | H_STROBE),
260 MS_CASS(H_nAUTO | H_nSELIN | H_INIT | H_STROBE),
262 MS_BRCLEAR(H_FLT, 3 /* error */),
263 MS_CASS( H_AUTO | H_nSELIN | H_INIT | H_STROBE),
264 MS_BRSET(H_FLT, 1 /* error */),
272 vpoio_disconnect(struct vpoio_data *vpo)
276 ppb_MS_microseq(&vpo->vpo_dev, disconnect_microseq, &ret);
277 return (ppb_release_bus(&vpo->vpo_dev));
281 * how : PPB_WAIT or PPB_DONTWAIT
284 vpoio_connect(struct vpoio_data *vpo, int how)
289 if ((error = ppb_request_bus(&vpo->vpo_dev, how))) {
292 printf("%s: can't request bus!\n", __FUNCTION__);
297 if (PPB_IN_EPP_MODE(&vpo->vpo_dev))
298 ppb_MS_microseq(&vpo->vpo_dev, connect_epp_microseq, &ret);
300 ppb_MS_microseq(&vpo->vpo_dev, connect_spp_microseq, &ret);
308 * SCSI reset signal, the drive must be in disk mode
311 vpoio_reset (struct vpoio_data *vpo)
315 struct ppb_microseq reset_microseq[] = {
317 #define INITIATOR MS_PARAM(0, 1, MS_TYP_INT)
320 MS_CASS(H_AUTO | H_nSELIN | H_nINIT | H_STROBE),
322 MS_CASS(H_AUTO | H_nSELIN | H_INIT | H_STROBE),
326 ppb_MS_init_msq(reset_microseq, 1, INITIATOR, 1 << VP0_INITIATOR);
327 ppb_MS_microseq(&vpo->vpo_dev, reset_microseq, &ret);
333 * vpoio_in_disk_mode()
336 vpoio_in_disk_mode(struct vpoio_data *vpo)
340 ppb_MS_microseq(&vpo->vpo_dev, in_disk_mode, &ret);
348 * Detect and initialise the VP0 adapter.
351 vpoio_detect(struct vpoio_data *vpo)
355 /* allocate the bus, then apply microsequences */
356 if ((error = ppb_request_bus(&vpo->vpo_dev, PPB_DONTWAIT)))
359 ppb_MS_microseq(&vpo->vpo_dev, disconnect_microseq, &ret);
361 if (PPB_IN_EPP_MODE(&vpo->vpo_dev))
362 ppb_MS_microseq(&vpo->vpo_dev, connect_epp_microseq, &ret);
364 ppb_MS_microseq(&vpo->vpo_dev, connect_spp_microseq, &ret);
366 ppb_MS_microseq(&vpo->vpo_dev, in_disk_mode, &ret);
369 /* try spp mode (maybe twice or because previous mode was PS2)
370 * NIBBLE mode will be restored on next transfers if detection
373 ppb_set_mode(&vpo->vpo_dev, PPB_NIBBLE);
374 ppb_MS_microseq(&vpo->vpo_dev, connect_spp_microseq, &ret);
376 ppb_MS_microseq(&vpo->vpo_dev, in_disk_mode, &ret);
379 printf("vpo%d: can't connect to the drive\n",
382 /* disconnect and release the bus */
383 ppb_MS_microseq(&vpo->vpo_dev, disconnect_microseq,
389 /* send SCSI reset signal */
392 ppb_MS_microseq(&vpo->vpo_dev, disconnect_microseq, &ret);
394 /* ensure we are disconnected or daisy chained peripheral
395 * may cause serious problem to the disk */
397 ppb_MS_microseq(&vpo->vpo_dev, in_disk_mode, &ret);
400 printf("vpo%d: can't disconnect from the drive\n",
405 ppb_release_bus(&vpo->vpo_dev);
409 ppb_release_bus(&vpo->vpo_dev);
410 return (VP0_EINITFAILED);
417 vpoio_outstr(struct vpoio_data *vpo, char *buffer, int size)
422 ppb_MS_exec(&vpo->vpo_dev, MS_OP_PUT, (union ppb_insarg)buffer,
423 (union ppb_insarg)size, (union ppb_insarg)MS_UNKNOWN, &error);
426 /* XXX EPP 1.9 not implemented with microsequences */
429 ppb_reset_epp_timeout(&vpo->vpo_dev);
430 ppb_wctr(&vpo->vpo_dev,
431 H_AUTO | H_SELIN | H_INIT | H_STROBE);
433 if (((long) buffer | size) & 0x03)
434 ppb_outsb_epp(&vpo->vpo_dev,
437 ppb_outsl_epp(&vpo->vpo_dev,
440 if ((ppb_rstr(&vpo->vpo_dev) & TIMEOUT)) {
441 error = VP0_EPPDATA_TIMEOUT;
445 ppb_wctr(&vpo->vpo_dev,
446 H_AUTO | H_nSELIN | H_INIT | H_STROBE);
449 ppb_ecp_sync(&vpo->vpo_dev);
458 vpoio_instr(struct vpoio_data *vpo, char *buffer, int size)
462 ppb_MS_exec(&vpo->vpo_dev, MS_OP_GET, (union ppb_insarg)buffer,
463 (union ppb_insarg)size, (union ppb_insarg)MS_UNKNOWN, &error);
466 /* XXX EPP 1.9 not implemented with microsequences */
469 ppb_reset_epp_timeout(&vpo->vpo_dev);
470 ppb_wctr(&vpo->vpo_dev, PCD |
471 H_AUTO | H_SELIN | H_INIT | H_STROBE);
473 if (((long) buffer | size) & 0x03)
474 ppb_insb_epp(&vpo->vpo_dev,
477 ppb_insl_epp(&vpo->vpo_dev,
480 if ((ppb_rstr(&vpo->vpo_dev) & TIMEOUT)) {
481 error = VP0_EPPDATA_TIMEOUT;
485 ppb_wctr(&vpo->vpo_dev, PCD |
486 H_AUTO | H_nSELIN | H_INIT | H_STROBE);
489 ppb_ecp_sync(&vpo->vpo_dev);
495 vpoio_select(struct vpoio_data *vpo, int initiator, int target)
499 struct ppb_microseq select_microseq[] = {
503 #define SELECT_TARGET MS_PARAM(0, 1, MS_TYP_INT)
504 #define SELECT_INITIATOR MS_PARAM(3, 1, MS_TYP_INT)
506 /* send the select command to the drive */
508 MS_CASS(H_nAUTO | H_nSELIN | H_INIT | H_STROBE),
509 MS_CASS( H_AUTO | H_nSELIN | H_INIT | H_STROBE),
511 MS_CASS( H_AUTO | H_nSELIN | H_nINIT | H_STROBE),
513 /* now, wait until the drive is ready */
515 /* loop: */ MS_BRSET(H_ACK, 2 /* ready */),
516 MS_DBRA(-2 /* loop */),
517 /* error: */ MS_RET(1),
518 /* ready: */ MS_RET(0)
521 /* initialize the select microsequence */
522 ppb_MS_init_msq(select_microseq, 2,
523 SELECT_TARGET, 1 << target,
524 SELECT_INITIATOR, 1 << initiator);
526 ppb_MS_microseq(&vpo->vpo_dev, select_microseq, &ret);
529 return (VP0_ESELECT_TIMEOUT);
537 * H_SELIN must be low.
539 * XXX should be ported to microseq
542 vpoio_wait(struct vpoio_data *vpo, int tmo)
549 if (ppb_poll_device(&vpo->vpo_dev, 150, nBUSY, nBUSY, PPB_INTR))
552 return (ppb_rstr(&vpo->vpo_dev) & 0xf0);
555 /* XXX should be ported to microseq */
557 while (!((r = ppb_rstr(&vpo->vpo_dev)) & nBUSY) && (k++ < tmo))
561 * Return some status information.
562 * Semantics : 0xc0 = ZIP wants more data
563 * 0xd0 = ZIP wants to send more data
564 * 0xe0 = ZIP wants command
565 * 0xf0 = end of transfer, ZIP is sending status
570 return (0); /* command timed out */
576 * Low level probe of vpo device
580 vpoio_probe(struct ppb_data *ppb, struct vpoio_data *vpo)
583 /* ppbus dependent initialisation */
584 vpo->vpo_dev.id_unit = vpo->vpo_unit;
585 vpo->vpo_dev.name = "vpo";
586 vpo->vpo_dev.ppb = ppb;
589 * Initialize microsequence code
593 /* now, try to initialise the drive */
594 if (vpoio_detect(vpo)) {
598 return (&vpo->vpo_dev);
604 * Low level attachment of vpo device
608 vpoio_attach(struct vpoio_data *vpo)
615 printf("vpo%d: <Iomega VPI0 Parallel to SCSI interface> on ppbus %d\n",
616 vpo->vpo_dev.id_unit, vpo->vpo_dev.ppb->ppb_link->adapter_unit);
618 vpo->vpo_nibble_inbyte_msq = (struct ppb_microseq *)malloc(
619 sizeof(nibble_inbyte_submicroseq), M_DEVBUF, M_NOWAIT);
621 if (!vpo->vpo_nibble_inbyte_msq)
624 bcopy((void *)nibble_inbyte_submicroseq,
625 (void *)vpo->vpo_nibble_inbyte_msq,
626 sizeof(nibble_inbyte_submicroseq));
628 INIT_NIBBLE_INBYTE_SUBMICROSEQ(vpo);
631 * Initialize mode dependent in/out microsequences
633 ppb_request_bus(&vpo->vpo_dev, PPB_WAIT);
635 /* enter NIBBLE mode to configure submsq */
636 if (ppb_set_mode(&vpo->vpo_dev, PPB_NIBBLE) != -1) {
638 ppb_MS_GET_init(&vpo->vpo_dev, vpo->vpo_nibble_inbyte_msq);
640 ppb_MS_PUT_init(&vpo->vpo_dev, spp_outbyte_submicroseq);
643 /* enter PS2 mode to configure submsq */
644 if (ppb_set_mode(&vpo->vpo_dev, PPB_PS2) != -1) {
646 ppb_MS_GET_init(&vpo->vpo_dev, ps2_inbyte_submicroseq);
648 ppb_MS_PUT_init(&vpo->vpo_dev, spp_outbyte_submicroseq);
651 epp = ppb_get_epp_protocol(&vpo->vpo_dev);
653 /* enter EPP mode to configure submsq */
654 if (ppb_set_mode(&vpo->vpo_dev, PPB_EPP) != -1) {
658 /* XXX EPP 1.9 support should be improved */
660 ppb_MS_GET_init(&vpo->vpo_dev, epp17_instr_body);
662 ppb_MS_PUT_init(&vpo->vpo_dev, epp17_outstr_body);
665 panic("%s: unknown EPP protocol (0x%x)", __FUNCTION__,
670 /* try to enter EPP or PS/2 mode, NIBBLE otherwise */
671 if (ppb_set_mode(&vpo->vpo_dev, PPB_EPP) != -1) {
674 printf("vpo%d: EPP 1.9 mode\n", vpo->vpo_unit);
677 printf("vpo%d: EPP 1.7 mode\n", vpo->vpo_unit);
680 panic("%s: unknown EPP protocol (0x%x)", __FUNCTION__,
683 } else if (ppb_set_mode(&vpo->vpo_dev, PPB_PS2) != -1)
684 printf("vpo%d: PS2 mode\n", vpo->vpo_unit);
686 else if (ppb_set_mode(&vpo->vpo_dev, PPB_NIBBLE) != -1)
687 printf("vpo%d: NIBBLE mode\n", vpo->vpo_unit);
690 printf("vpo%d: can't enter NIBBLE, PS2 or EPP mode\n",
693 ppb_release_bus(&vpo->vpo_dev);
695 free(vpo->vpo_nibble_inbyte_msq, M_DEVBUF);
699 ppb_release_bus(&vpo->vpo_dev);
709 vpoio_reset_bus(struct vpoio_data *vpo)
711 /* first, connect to the drive */
712 if (vpoio_connect(vpo, PPB_WAIT|PPB_INTR) || !vpoio_in_disk_mode(vpo)) {
715 printf("%s: not in disk mode!\n", __FUNCTION__);
718 vpoio_disconnect(vpo);
722 /* reset the SCSI bus */
725 /* then disconnect */
726 vpoio_disconnect(vpo);
734 * Send an SCSI command
738 vpoio_do_scsi(struct vpoio_data *vpo, int host, int target, char *command,
739 int clen, char *buffer, int blen, int *result, int *count,
749 * enter disk state, allocate the ppbus
752 * Should we allow this call to be interruptible?
753 * The only way to report the interruption is to return
754 * EIO do upper SCSI code :^(
756 if ((error = vpoio_connect(vpo, PPB_WAIT|PPB_INTR)))
759 if (!vpoio_in_disk_mode(vpo)) {
760 *ret = VP0_ECONNECT; goto error;
763 if ((*ret = vpoio_select(vpo,host,target)))
767 * Send the command ...
769 * set H_SELIN low for vpoio_wait().
771 ppb_wctr(&vpo->vpo_dev, H_AUTO | H_nSELIN | H_INIT | H_STROBE);
773 for (k = 0; k < clen; k++) {
774 if (vpoio_wait(vpo, VP0_FAST_SPINTMO) != (char)0xe0) {
775 *ret = VP0_ECMD_TIMEOUT;
778 if (vpoio_outstr(vpo, &command[k], 1)) {
779 *ret = VP0_EPPDATA_TIMEOUT;
791 if (!(r = vpoio_wait(vpo, VP0_LOW_SPINTMO))) {
792 *ret = VP0_ESTATUS_TIMEOUT; goto error;
795 /* stop when the ZIP wants to send status */
799 if (*count >= blen) {
800 *ret = VP0_EDATA_OVERFLOW;
804 /* if in EPP mode or writing bytes, try to transfer a sector
805 * otherwise, just send one byte
807 if (PPB_IN_EPP_MODE(&vpo->vpo_dev) || r == (char)0xc0)
808 len = (((blen - *count) >= VP0_SECTOR_SIZE)) ?
813 /* ZIP wants to send data? */
815 error = vpoio_outstr(vpo, &buffer[*count], len);
817 error = vpoio_instr(vpo, &buffer[*count], len);
827 if (vpoio_instr(vpo, &l, 1)) {
828 *ret = VP0_EOTHER; goto error;
831 /* check if the ZIP wants to send more status */
832 if (vpoio_wait(vpo, VP0_FAST_SPINTMO) == (char)0xf0)
833 if (vpoio_instr(vpo, &h, 1)) {
834 *ret = VP0_EOTHER+2; goto error;
837 *result = ((int) h << 8) | ((int) l & 0xff);
840 /* return to printer state, release the ppbus */
841 vpoio_disconnect(vpo);