Lines Matching defs:pInfo
65 static int KbdOn(InputInfoPtr pInfo, int what);
66 static Bool OpenKeyboard(InputInfoPtr pInfo);
67 static void CloseKeyboard(InputInfoPtr pInfo);
70 sunKbdSetLeds(InputInfoPtr pInfo, int leds)
75 SYSCALL(i = ioctl(pInfo->fd, KIOCSLED, &setleds));
78 pInfo->name, strerror(errno));
84 sunKbdGetLeds(InputInfoPtr pInfo)
89 SYSCALL(i = ioctl(pInfo->fd, KIOCGLED, &leds));
92 pInfo->name, strerror(errno));
103 KbdInit(InputInfoPtr pInfo, int what)
105 KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
107 pointer options = pInfo->options;
122 i = KbdOn(pInfo, DEVICE_INIT);
127 SYSCALL(i = ioctl(pInfo->fd, KIOCTYPE, &ktype));
130 pInfo->name, strerror(errno));
134 SYSCALL(i = ioctl(pInfo->fd, KIOCLAYOUT, &klayout));
137 pInfo->name, strerror(errno));
155 pInfo->name, ktype_name, ktype);
156 xf86Msg(X_PROBED, "%s: Keyboard layout: %d\n", pInfo->name, klayout);
165 KbdOn(InputInfoPtr pInfo, int what)
167 KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
178 if (pInfo->fd == -1) {
179 if (!OpenKeyboard(pInfo)) {
186 SYSCALL(i = ioctl(pInfo->fd, I_FIND, priv->strmod));
189 SYSCALL(i = ioctl(pInfo->fd, I_PUSH, priv->strmod));
193 pInfo->name, priv->strmod, strerror(errno));
205 SYSCALL(i = ioctl(pInfo->fd, io_get_direct, &kdirect));
209 pInfo->name, strerror(errno));
216 SYSCALL(i = ioctl(pInfo->fd, io_set_direct, &kdirect));
219 pInfo->name, strerror(errno));
225 SYSCALL(i = ioctl(pInfo->fd, KIOCGTRANS, &ktrans));
229 pInfo->name, strerror(errno));
236 SYSCALL(i = ioctl(pInfo->fd, KIOCTRANS, &ktrans));
239 pInfo->name, strerror(errno));
243 priv->oleds = sunKbdGetLeds(pInfo);
254 KbdOff(InputInfoPtr pInfo, int what)
256 KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
271 if (pInfo->fd == -1) {
279 sunKbdSetLeds(pInfo, priv->oleds);
284 SYSCALL(i = ioctl(pInfo->fd, KIOCTRANS, &priv->otranslation));
288 pInfo->name, strerror(errno));
305 SYSCALL(i = ioctl(pInfo->fd, io_set_direct, &kdirect));
309 pInfo->name, strerror(errno));
316 SYSCALL(i = ioctl(pInfo->fd, I_POP, priv->strmod));
320 pInfo->name, priv->strmod, strerror(errno));
324 CloseKeyboard(pInfo);
330 SoundKbdBell(InputInfoPtr pInfo, int loudness, int pitch, int duration)
354 SYSCALL(i = ioctl (pInfo->fd, KIOCMKTONE, mktonevalue));
361 pInfo->name, strerror(errno));
368 SYSCALL(i = ioctl (pInfo->fd, KIOCCMD, &kbdCmd));
371 pInfo->name, strerror(errno));
377 SYSCALL(i = ioctl (pInfo->fd, KIOCCMD, &kbdCmd));
380 pInfo->name, strerror(errno));
386 SetKbdLeds(InputInfoPtr pInfo, int leds)
388 int real_leds = sunKbdGetLeds(pInfo);
397 sunKbdSetLeds(pInfo, real_leds);
401 GetKbdLeds(InputInfoPtr pInfo)
404 int real_leds = sunKbdGetLeds(pInfo);
415 CloseKeyboard(InputInfoPtr pInfo)
417 KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
420 close(pInfo->fd);
421 pInfo->fd = -1;
426 list or changing pInfo->fd while xf86Wakeup is looping through the list
431 InputInfoPtr pInfo = (InputInfoPtr) arg;
433 CloseKeyboard(pInfo);
434 xf86DisableDevice(pInfo->dev, TRUE);
440 ReadInput(InputInfoPtr pInfo)
442 KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
449 nBytes = read(pInfo->fd, (char *)event, sizeof(event));
452 pKbd->PostEvent(pInfo, event[i].id & 0xFF,
467 pInfo->name);
468 xf86RemoveEnabledDevice(pInfo);
470 RemoveKeyboard, pInfo);
476 LogMessageVerbSigSafe(X_NONE, 0, "%s: Read error: %s\n", pInfo->name,
487 OpenKeyboard(InputInfoPtr pInfo)
489 char *kbdPath = xf86SetStrOption(pInfo->options, "Device", "/dev/kbd");
492 pInfo->fd = open(kbdPath, O_RDONLY | O_NONBLOCK);
494 if (pInfo->fd == -1) {
495 xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, kbdPath);
498 xf86MsgVerb(X_INFO, 3, "%s: Opened device \"%s\"\n", pInfo->name,
500 pInfo->read_input = ReadInput;
503 xf86ReplaceStrOption(pInfo->options, "Device", kbdPath);
511 xf86OSKbdPreInit(InputInfoPtr pInfo)
513 KbdDevPtr pKbd = pInfo->private;