Lines Matching defs:pInfo
147 static MouseProtocolID prepnpparse(InputInfoPtr pInfo, char *buf);
150 static MouseProtocolID getPs2ProtocolPnP(InputInfoPtr pInfo);
151 static MouseProtocolID probePs2ProtocolPnP(InputInfoPtr pInfo);
154 MouseGetSerialPnpProtocol(InputInfoPtr pInfo)
162 if ((len = pnpgets(pInfo, buf, &prePNP)) > 0)
165 if (pnpparse(pInfo, &pnpid, buf, len) &&
168 pInfo->name, t->val);
172 return prepnpparse(pInfo,buf);
178 MouseGetPnpProtocol(InputInfoPtr pInfo)
180 MouseDevPtr pMse = pInfo->private;
185 if ((val = MouseGetSerialPnpProtocol(pInfo)) != PROT_UNKNOWN) {
186 if (val == MouseGetSerialPnpProtocol(pInfo))
212 return getPs2ProtocolPnP(pInfo);
214 return probePs2ProtocolPnP(pInfo);
234 pnpgets(InputInfoPtr pInfo, char *buf, Bool *prePNP)
248 if ((i = xf86GetSerialModemState(pInfo->fd)) == -1)
252 if (xf86SetSerialModemState(pInfo->fd, i) == -1)
255 if ((i = xf86GetSerialModemState(pInfo->fd)) == -1 ||
261 xf86SetSerial(pInfo->fd, pnpOpts);
263 xf86SerialModemClearBits(pInfo->fd, i);
266 xf86SerialModemSetBits(pInfo->fd, i);
270 xf86FlushInput(pInfo->fd);
272 xf86SerialModemSetBits(pInfo->fd, i);
275 if (xf86WaitForInput(pInfo->fd, 200000) <= 0) {
279 xf86SerialModemClearBits(pInfo->fd, i);
283 xf86FlushInput(pInfo->fd);
285 xf86SerialModemSetBits(pInfo->fd, i);
288 if (xf86WaitForInput(pInfo->fd, 200000) <= 0)
296 if ((i = xf86GetSerialModemState(pInfo->fd)) == -1)
300 if (xf86SetSerialModemState(pInfo->fd, i) == -1)
305 xf86SetSerial(pInfo->fd, pnpOpts);
308 xf86FlushInput(pInfo->fd);
310 xf86SerialModemSetBits(pInfo->fd, i);
313 if (xf86WaitForInput(pInfo->fd, 200000) <= 0)
322 while (xf86ReadSerial(pInfo->fd, &c, 1) == 1) {
336 if (xf86WaitForInput(pInfo->fd, 200000) <= 0)
348 if (xf86WaitForInput(pInfo->fd, 200000) <= 0)
351 xf86ReadSerial(pInfo->fd, &buf[i], 1);
369 xf86SerialModemSetBits(pInfo->fd, i);
375 pnpparse(InputInfoPtr pInfo, pnpid_t *id, char *buf, int len)
404 xf86MsgVerb(X_INFO, 2, "%s: PnP ID string: `%*.*s'\n", pInfo->name,
411 xf86MsgVerb(X_INFO, 2, "%s: PnP rev %d.%02d\n", pInfo->name,
482 xf86MsgVerb(X_INFO, 4, "%s: PnP checksum: 0x%02X\n", pInfo->name, sum);
501 prepnpparse(InputInfoPtr pInfo, char *buf)
563 readMouse(InputInfoPtr pInfo, unsigned char *u)
566 if (xf86WaitForInput(pInfo->fd, 200000) <= 0)
569 xf86ReadSerial(pInfo->fd, u, 1);
574 ps2DisableWrapMode(InputInfoPtr pInfo)
577 ps2SendPacket(pInfo, reset_wrap_mode, sizeof(reset_wrap_mode));
581 ps2SendPacket(InputInfoPtr pInfo, unsigned char *bytes, int len)
595 xf86WriteSerial(pInfo->fd, bytes + i, 1);
597 if (!readMouse(pInfo,&c)) {
619 ps2DisableWrapMode(pInfo);
631 ps2DisableDataReporting(InputInfoPtr pInfo)
634 return ps2SendPacket(pInfo, packet, sizeof(packet));
638 ps2EnableDataReporting(InputInfoPtr pInfo)
641 return ps2SendPacket(pInfo, packet, sizeof(packet));
645 ps2GetDeviceID(InputInfoPtr pInfo)
651 xf86FlushInput(pInfo->fd);
652 if (!ps2SendPacket(pInfo, packet, sizeof(packet)))
655 if (!readMouse(pInfo,&u))
667 ps2Reset(InputInfoPtr pInfo)
676 if (!ps2SendPacket(pInfo, packet, sizeof(packet)))
679 xf86WaitForInput(pInfo->fd, 500000);
681 if (!readMouse(pInfo,&u)) {
690 xf86FlushInput(pInfo->fd);
695 probePs2ProtocolPnP(InputInfoPtr pInfo)
700 xf86FlushInput(pInfo->fd);
702 ps2DisableDataReporting(pInfo);
704 if (ps2Reset(pInfo)) { /* Reset PS2 device */
707 if (ps2SendPacket(pInfo, seq, sizeof(seq))) {
708 u = ps2GetDeviceID(pInfo);
712 if (ps2SendPacket(pInfo,im_seq,sizeof(im_seq))) {
713 u = ps2GetDeviceID(pInfo);
719 } else if (ps2Reset(pInfo)) /* reset again to find sane state */
724 ps2EnableDataReporting(pInfo);
741 getPs2ProtocolPnP(InputInfoPtr pInfo)
748 xf86FlushInput(pInfo->fd);
751 if (ps2DisableDataReporting(pInfo))
759 if ((Id = ps2GetDeviceID(pInfo)) == -1) {
764 if (-1 == ps2EnableDataReporting(pInfo)) {
781 xf86FlushInput(pInfo->fd);