Lines Matching +full:pd +full:- +full:revision
2 ** SPDX-License-Identifier: BSD-4-Clause
129 int revision; /* PnP revision, 100 for 1.00 */ member
340 (CS8 | CREAD | HUPCL ), /* GTCO Digi-Pad */
374 .level = -1,
378 .mfd = -1,
379 .ufd = -1,
380 .mremsfd = -1,
381 .mremcfd = -1,
430 while ((c = getopt(argc, argv, "DF:I:PRS:cdfhi:l:p:r:st:")) != -1) in main()
478 else if (strcmp(optarg, "medium-high") == 0) in main()
480 else if (strcmp(optarg, "medium-low") == 0) in main()
536 rodent.level = -1; in main()
585 if (rodent.mfd == -1) in main()
590 rodent.mfd = -1; in main()
614 if (rodent.mfd == -1) { in main()
629 if (rodent.mfd != -1) in main()
631 if (rodent.ufd != -1) in main()
633 rodent.mfd = rodent.ufd = -1; in main()
652 if ((rodent.ufd = r_uinput_register()) == -1) in msconvd()
701 if (read(rodent.mfd, &b, 1) == -1) { in msconvd()
714 if (r_uinput_report(rodent.ufd, &action) == -1) { in msconvd()
752 "usage: msconvd [-DPRcdfs] [-I file] [-F rate] [-r resolution] [-S baudrate]", in usage()
753 " [-t <mousetype>] [-l level] -p <port>", in usage()
754 " msconvd [-Pd] -i <port|if|type|model|all> -p <port>"); in usage()
760 * `errnum' is non-zero, append its string form to the message.
795 return (-1); in r_uinput_register()
830 return (-1); in r_uinput_register()
854 if ((act->dx != 0 && uinput_event(fd, EV_REL, REL_X, act->dx) < 0) || in r_uinput_report()
855 (act->dy != 0 && uinput_event(fd, EV_REL, REL_Y, act->dy) < 0) || in r_uinput_report()
856 (act->dz != 0 && uinput_event(fd, EV_REL, REL_WHEEL, -act->dz) < 0)) in r_uinput_report()
857 return (-1); in r_uinput_report()
861 if ((act->button & mask) == (act->obutton & mask)) in r_uinput_report()
864 (act->button & mask) != 0) < 0) in r_uinput_report()
865 return (-1); in r_uinput_report()
869 return (-1); in r_uinput_report()
977 rodent.mode.rate = -1; in r_identify()
1019 rodent.mode.protocol = t->val; in r_identify()
1020 rodent.hw.model = t->val2; in r_identify()
1103 ** NOTE: - all commands to (at least the European) MouseMan have to in r_init()
1105 ** - each command starts with a '*'. in r_init()
1106 ** - whenever the MouseMan receives a '*', it will switch back in r_init()
1111 ** - 5 byte packed binary protocol, as with the Mouse Systems in r_init()
1113 ** - 2 button 3 byte MicroSoft compatible protocol. Selected in r_init()
1115 ** - 3 button 3+1 byte MicroSoft compatible protocol (default). in r_init()
1119 ** - 1200 Baud (default). Selected by sequence "*n". in r_init()
1120 ** - 9600 Baud. Selected by sequence "*q". in r_init()
1164 * Initialize Hitachi PUMA Plus - Model 1212E to desired settings. in r_init()
1167 * of the tablet. We only use this tablet for it's 4-button puck in r_init()
1293 /* MOUSE_MSS_BUTTON?DOWN -> MOUSE_BUTTON?DOWN */ in r_protocol()
1308 /* MOUSE_INTELLI_BUTTON?DOWN -> MOUSE_BUTTON?DOWN */ in r_protocol()
1316 /* MOUSE_MSC_BUTTON?UP -> MOUSE_BUTTON?DOWN */ in r_protocol()
1328 /* MOUSE_PS2_BUTTON?DOWN -> MOUSE_BUTTON?DOWN */ in r_protocol()
1386 * a) illegal (detected by wrong data-package header) in r_protocol()
1387 * b) invalid (0x80 == -128 and that might be wrong for MouseSystems) in r_protocol()
1388 * c) bad header-package in r_protocol()
1390 * NOTE: b) is a voilation of the MouseSystems-Protocol, since values of in r_protocol()
1391 * -128 are allowed, but since they are very seldom we can easily in r_protocol()
1392 * use them as package-header with no button pressed. in r_protocol()
1419 * Hack for Logitech MouseMan Mouse - Middle button in r_protocol()
1435 * [JCH-96/01/21] in r_protocol()
1440 * half of the reverse-map may remain unchanged. in r_protocol()
1444 * [KY-97/08/03] in r_protocol()
1463 * so-called `ten key' mode and 0x30 though 0x3f in the in r_protocol()
1468 act->dx = act->dy = act->dz = 0; in r_protocol()
1469 act->obutton = act->button; in r_protocol()
1471 act->button = (1 << (rBuf - 13)) in r_protocol()
1472 | (act->obutton & (MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN)); in r_protocol()
1492 act->dx = act->dy = 0; in r_protocol()
1493 act->dz = (rBuf & 0x08) ? (rBuf & 0x0f) - 16 : (rBuf & 0x0f); in r_protocol()
1494 if ((act->dz >= 7) || (act->dz <= -7)) in r_protocol()
1495 act->dz = 0; in r_protocol()
1496 act->obutton = act->button; in r_protocol()
1497 act->button = butmapintelli[(rBuf & MOUSE_MSS_BUTTONS) >> 4] in r_protocol()
1498 | (act->obutton & (MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN)); in r_protocol()
1502 act->dx = act->dy = act->dz = 0; in r_protocol()
1503 act->obutton = act->button; in r_protocol()
1504 act->button = butmapmss2[(rBuf & MOUSE_MSS_BUTTONS) >> 4] in r_protocol()
1505 | (act->obutton & (MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN)); in r_protocol()
1509 act->flags = ((act->dx || act->dy || act->dz) ? MOUSE_POSCHANGED : 0) in r_protocol()
1510 | (act->obutton ^ act->button); in r_protocol()
1512 return (act->flags); in r_protocol()
1530 act->dz = 0; in r_protocol()
1531 act->obutton = act->button; in r_protocol()
1537 act->button = act->obutton & MOUSE_BUTTON4DOWN; in r_protocol()
1539 act->button |= ((pBuf[0] & MOUSE_MSS_BUTTONS) == MOUSE_MSS_BUTTONS) in r_protocol()
1543 act->button |= (act->obutton & MOUSE_BUTTON2DOWN) in r_protocol()
1546 /* Send X10 btn events to remote client (ensure -128-+127 range) */ in r_protocol()
1557 act->dx = (signed char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); in r_protocol()
1558 act->dy = (signed char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); in r_protocol()
1565 act->button = (act->obutton & (MOUSE_BUTTON2DOWN | MOUSE_BUTTON4DOWN)) in r_protocol()
1567 act->dx = (signed char)(((pBuf[0] & 0x03) << 6) | (pBuf[1] & 0x3F)); in r_protocol()
1568 act->dy = (signed char)(((pBuf[0] & 0x0C) << 4) | (pBuf[2] & 0x3F)); in r_protocol()
1575 act->button = butmapmsc[(~pBuf[0]) & MOUSE_MSC_BUTTONS]; in r_protocol()
1576 act->dx = (signed char)(pBuf[1]) + (signed char)(pBuf[3]); in r_protocol()
1577 act->dy = - ((signed char)(pBuf[2]) + (signed char)(pBuf[4])); in r_protocol()
1582 act->dz = -1; in r_protocol()
1584 act->dz = 1; in r_protocol()
1586 act->button = MOUSE_BUTTON1DOWN; in r_protocol()
1588 act->button = 0; in r_protocol()
1592 act->button = butmaphit[pBuf[0] & 0x07]; in r_protocol()
1593 act->dx = (pBuf[0] & MOUSE_MM_XPOSITIVE) ? pBuf[1] : - pBuf[1]; in r_protocol()
1594 act->dy = (pBuf[0] & MOUSE_MM_YPOSITIVE) ? - pBuf[2] : pBuf[2]; in r_protocol()
1599 act->button = butmapmsc[pBuf[0] & MOUSE_MSC_BUTTONS]; in r_protocol()
1600 act->dx = (pBuf[0] & MOUSE_MM_XPOSITIVE) ? pBuf[1] : - pBuf[1]; in r_protocol()
1601 act->dy = (pBuf[0] & MOUSE_MM_YPOSITIVE) ? - pBuf[2] : pBuf[2]; in r_protocol()
1605 act->button = butmapversa[(pBuf[0] & MOUSE_VERSA_BUTTONS) >> 3]; in r_protocol()
1606 act->button |= (pBuf[0] & MOUSE_VERSA_TAP) ? MOUSE_BUTTON4DOWN : 0; in r_protocol()
1607 act->dx = act->dy = 0; in r_protocol()
1614 x -= 0x1000; in r_protocol()
1617 y -= 0x1000; in r_protocol()
1619 act->dx = prev_x - x; in r_protocol()
1620 act->dy = prev_y - y; in r_protocol()
1629 act->button = butmapps2[pBuf[0] & MOUSE_PS2_BUTTONS]; in r_protocol()
1630 act->dx = (pBuf[0] & MOUSE_PS2_XNEG) ? pBuf[1] - 256 : pBuf[1]; in r_protocol()
1631 act->dy = (pBuf[0] & MOUSE_PS2_YNEG) ? -(pBuf[2] - 256) : -pBuf[2]; in r_protocol()
1637 * actions are encoded in model-dependent formats. At the level 0 in r_protocol()
1638 * the following code is no-op because the psm driver says the model in r_protocol()
1644 act->dz = (pBuf[3] & MOUSE_EXPLORER_ZNEG) in r_protocol()
1645 ? (pBuf[3] & 0x0f) - 16 : (pBuf[3] & 0x0f); in r_protocol()
1646 act->button |= (pBuf[3] & MOUSE_EXPLORER_BUTTON4DOWN) in r_protocol()
1648 act->button |= (pBuf[3] & MOUSE_EXPLORER_BUTTON5DOWN) in r_protocol()
1654 act->dz = (signed char)pBuf[3]; in r_protocol()
1655 if ((act->dz >= 7) || (act->dz <= -7)) in r_protocol()
1656 act->dz = 0; in r_protocol()
1658 act->button |= (pBuf[0] & MOUSE_PS2INTELLI_BUTTON4DOWN) in r_protocol()
1660 act->button |= (pBuf[0] & MOUSE_PS2INTELLI_BUTTON5DOWN) in r_protocol()
1665 && (abs(act->dx) > 191) in r_protocol()
1671 act->dx = act->dy = 0; in r_protocol()
1673 /* horizontal roller count - ignore it XXX*/ in r_protocol()
1676 act->dz = (pBuf[2] & MOUSE_PS2PLUS_ZNEG) in r_protocol()
1677 ? (pBuf[2] & 0x0f) - 16 : (pBuf[2] & 0x0f); in r_protocol()
1679 act->button |= (pBuf[2] & MOUSE_PS2PLUS_BUTTON4DOWN) in r_protocol()
1681 act->button |= (pBuf[2] & MOUSE_PS2PLUS_BUTTON5DOWN) in r_protocol()
1690 act->dx = act->dy = 0; in r_protocol()
1693 act->dz = (pBuf[2] & MOUSE_SPOINT_WNEG) ? -2 : 2; in r_protocol()
1696 act->dz = (pBuf[2] & MOUSE_SPOINT_ZNEG) ? -1 : 1; in r_protocol()
1699 act->dz = (pBuf[2] & MOUSE_SPOINT_ZNEG) in r_protocol()
1700 ? ((pBuf[2] >> 4) & 0x0f) - 16 in r_protocol()
1703 act->dw = (pBuf[2] & MOUSE_SPOINT_WNEG) in r_protocol()
1704 ? (pBuf[2] & 0x0f) - 16 : (pBuf[2] & 0x0f); in r_protocol()
1708 /* device type packet - shouldn't happen */ in r_protocol()
1711 act->dx = act->dy = 0; in r_protocol()
1712 act->button = act->obutton; in r_protocol()
1720 act->button |= act->obutton & MOUSE_EXTBUTTONS; in r_protocol()
1725 act->button |= ((pBuf[0] & MOUSE_PS2_TAP)) ? 0 : MOUSE_BUTTON4DOWN; in r_protocol()
1729 act->button |= (pBuf[3] & MOUSE_PS2_BUTTON3DOWN) in r_protocol()
1731 act->button |= (pBuf[3] & MOUSE_PS2_BUTTON1DOWN) in r_protocol()
1733 act->dz = (pBuf[3] & MOUSE_PS2_XNEG) ? pBuf[4] - 256 : pBuf[4]; in r_protocol()
1737 act->button |= (pBuf[0] & MOUSE_PS2_TAP) ? MOUSE_BUTTON4DOWN : 0; in r_protocol()
1740 act->button = butmapversaps2[pBuf[0] & MOUSE_PS2VERSA_BUTTONS]; in r_protocol()
1741 act->button |= in r_protocol()
1743 act->dx = act->dy = 0; in r_protocol()
1750 x -= 0x1000; in r_protocol()
1753 y -= 0x1000; in r_protocol()
1755 act->dx = prev_x - x; in r_protocol()
1756 act->dy = prev_y - y; in r_protocol()
1764 act->dx = (pBuf[1] & 0x80) ? pBuf[1] - 256 : pBuf[1]; in r_protocol()
1765 act->dy = (pBuf[2] & 0x80) ? -(pBuf[2] - 256) : -pBuf[2]; in r_protocol()
1768 act->dz = 1; in r_protocol()
1771 act->dz = -1; in r_protocol()
1774 act->dz = 2; in r_protocol()
1777 act->dz = -2; in r_protocol()
1782 if ((act->dx < 16 - 256) && (act->dy > 256 - 16)) { in r_protocol()
1783 act->dx = act->dy = 0; in r_protocol()
1785 act->button |= MOUSE_BUTTON4DOWN; in r_protocol()
1786 act->dz = (pBuf[2] & MOUSE_4DPLUS_ZNEG) in r_protocol()
1787 ? ((pBuf[2] & 0x07) - 8) : (pBuf[2] & 0x07); in r_protocol()
1790 act->button |= act->obutton & MOUSE_EXTBUTTONS; in r_protocol()
1800 act->button = butmapmsc[(~pBuf[0]) & MOUSE_SYS_STDBUTTONS]; in r_protocol()
1801 act->dx = (signed char)(pBuf[1]) + (signed char)(pBuf[3]); in r_protocol()
1802 act->dy = - ((signed char)(pBuf[2]) + (signed char)(pBuf[4])); in r_protocol()
1804 act->dz = ((signed char)(pBuf[5] << 1) + (signed char)(pBuf[6] << 1)) >> 1; in r_protocol()
1805 act->button |= ((~pBuf[7] & MOUSE_SYS_EXTBUTTONS) << 3); in r_protocol()
1818 act->flags = ((act->dx || act->dy || act->dz) ? MOUSE_POSCHANGED : 0) in r_protocol()
1819 | (act->obutton ^ act->button); in r_protocol()
1821 return (act->flags); in r_protocol()
1825 /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/shared/posix_tty.c,v 3.4 1995/01/28 17:05:03…
1938 * It's a simplistic implementation, but it works :-)
2100 begin = -1; in pnpgets()
2107 debug("begin-id %02x", c); in pnpgets()
2108 begin = i - 1; in pnpgets()
2136 i -= begin; in pnpgets()
2140 debug("len:%d, '%-*.*s'", i, i, i, buf); in pnpgets()
2142 if (buf[i - 1] == c) in pnpgets()
2164 id->revision = 0; in pnpparse()
2165 id->eisaid = NULL; in pnpparse()
2166 id->serial = NULL; in pnpparse()
2167 id->class = NULL; in pnpparse()
2168 id->compat = NULL; in pnpparse()
2169 id->description = NULL; in pnpparse()
2170 id->neisaid = 0; in pnpparse()
2171 id->nserial = 0; in pnpparse()
2172 id->nclass = 0; in pnpparse()
2173 id->ncompat = 0; in pnpparse()
2174 id->ndescription = 0; in pnpparse()
2177 /* non-PnP mice */ in pnpparse()
2182 id->eisaid = "PNP0F01"; in pnpparse()
2185 id->eisaid = "PNP0F04"; in pnpparse()
2188 id->neisaid = strlen(id->eisaid); in pnpparse()
2189 id->class = "MOUSE"; in pnpparse()
2190 id->nclass = strlen(id->class); in pnpparse()
2191 debug("non-PnP mouse '%c'", buf[0]); in pnpparse()
2196 offset = 0x28 - buf[0]; in pnpparse()
2199 for (i = 0; i < len - 3; ++i) { in pnpparse()
2203 sum += buf[len - 1]; in pnpparse()
2208 /* revision */ in pnpparse()
2209 buf[1] -= offset; in pnpparse()
2210 buf[2] -= offset; in pnpparse()
2211 id->revision = ((buf[1] & 0x3f) << 6) | (buf[2] & 0x3f); in pnpparse()
2212 debug("PnP rev %d.%02d", id->revision / 100, id->revision % 100); in pnpparse()
2215 id->eisaid = &buf[3]; in pnpparse()
2216 id->neisaid = 7; in pnpparse()
2227 i -= 3; in pnpparse()
2228 if (i - j == 8) { in pnpparse()
2229 id->serial = &buf[j]; in pnpparse()
2230 id->nserial = 8; in pnpparse()
2240 i -= 3; in pnpparse()
2242 id->class = &buf[j]; in pnpparse()
2243 id->nclass = i - j; in pnpparse()
2259 i -= 3; in pnpparse()
2261 id->compat = &buf[j]; in pnpparse()
2262 id->ncompat = i - j; in pnpparse()
2272 i -= 3; in pnpparse()
2274 id->description = &buf[j]; in pnpparse()
2275 id->ndescription = i - j; in pnpparse()
2280 if ((id->nserial > 0) || (id->nclass > 0) in pnpparse()
2281 || (id->ncompat > 0) || (id->ndescription > 0)) { in pnpparse()
2284 if (strncmp(s, &buf[len - 3], 2) != 0) { in pnpparse()
2305 if (id->nclass > 0) in pnpproto()
2306 if (strncmp(id->class, "MOUSE", id->nclass) != 0 && in pnpproto()
2307 strncmp(id->class, "TABLET", id->nclass) != 0) in pnpproto()
2311 if (id->neisaid > 0) { in pnpproto()
2312 t = gettoken(pnpprod, id->eisaid, id->neisaid); in pnpproto()
2313 if (t->val != MOUSE_PROTO_UNKNOWN) in pnpproto()
2321 if (id->ncompat <= 0) in pnpproto()
2323 for (i = 0; i < id->ncompat; ++i) { in pnpproto()
2324 for (j = i; id->compat[i] != ','; ++i) in pnpproto()
2325 if (i >= id->ncompat) in pnpproto()
2328 t = gettoken(pnpprod, id->compat + j, i - j); in pnpproto()
2329 if (t->val != MOUSE_PROTO_UNKNOWN) in pnpproto()
2380 The tablet responds to the COM PnP protocol 1.0 with EISA-ID KYE0005,
2381 and to pre-pnp probes (RTS toggle) with 'T' (tablet ?)
2407 static int buflen = 0, b_prev = 0 , x_prev = -1, y_prev = -1; in kidspad()
2427 x = buf[1]+128*(buf[2] - 7); in kidspad()
2429 y = 28*128 - (buf[3] + 128* (buf[4] - 7)); in kidspad()
2435 act->flags = 0; in kidspad()
2436 act->obutton = act->button; in kidspad()
2437 act->dx = act->dy = act->dz = 0; in kidspad()
2442 act->flags |= MOUSE_POSCHANGED; /* force update */ in kidspad()
2447 act->dx = x - x_prev; in kidspad()
2448 act->dy = y - y_prev; in kidspad()
2449 if (act->dx || act->dy) in kidspad()
2450 act->flags |= MOUSE_POSCHANGED; in kidspad()
2454 act->button = 0; in kidspad()
2456 act->button |= MOUSE_BUTTON1DOWN; in kidspad()
2458 act->button |= MOUSE_BUTTON2DOWN; in kidspad()
2459 act->flags |= MOUSE_BUTTONSCHANGED; in kidspad()
2462 return (act->flags); in kidspad()
2469 static int buflen = 0, b_prev = 0 , x_prev = -1, y_prev = -1; in gtco_digipad()
2495 y = 4768 - ((buf[4] & ~GTCO_START) << 6 | (buf[3] & ~GTCO_START)); in gtco_digipad()
2500 act->flags = 0; in gtco_digipad()
2501 act->obutton = act->button; in gtco_digipad()
2502 act->dx = act->dy = act->dz = 0; in gtco_digipad()
2507 act->flags |= MOUSE_POSCHANGED; /* force update */ in gtco_digipad()
2513 act->dx = x - x_prev; in gtco_digipad()
2514 act->dy = y - y_prev; in gtco_digipad()
2515 if (act->dx || act->dy) in gtco_digipad()
2516 act->flags |= MOUSE_POSCHANGED; in gtco_digipad()
2522 act->button = 0; in gtco_digipad()
2525 act->button |= MOUSE_BUTTON1DOWN; in gtco_digipad()
2529 act->button |= MOUSE_BUTTON2DOWN; in gtco_digipad()
2533 act->button |= MOUSE_BUTTON3DOWN; in gtco_digipad()
2537 act->button |= MOUSE_BUTTON4DOWN; in gtco_digipad()
2539 act->flags |= MOUSE_BUTTONSCHANGED; in gtco_digipad()
2542 return (act->flags); in gtco_digipad()
2562 #define SUN_LEN(unp) (((char *)(unp)->sun_path - (char *)(unp)) + \ in mremote_serversetup()
2563 strlen((unp)->path)) in mremote_serversetup()
2601 rodent.mremcfd = -1; in mremote_clientchg()