Lines Matching defs:kbdcp
71 #define kbdcp(p) ((atkbdc_softc_t *)(p))
362 prevlock = kbdcp(p)->lock;
363 kbdcp(p)->lock = lock;
372 return (availq(&kbdcp(p)->kbd) || availq(&kbdcp(p)->aux)
373 || (read_status(kbdcp(p)) & KBDS_ANY_BUFFER_FULL));
576 if (!wait_while_controller_busy(kbdcp(p)))
578 write_command(kbdcp(p), c);
586 if (!wait_while_controller_busy(kbdcp(p)))
588 write_data(kbdcp(p), c);
596 if (!wait_while_controller_busy(kbdcp(p)))
598 write_data(kbdcp(p), c);
621 res = wait_for_kbd_ack(kbdcp(p));
647 emptyq(&kbdcp(p)->aux);
648 res = wait_for_aux_ack(kbdcp(p));
665 res = wait_for_kbd_ack(kbdcp(p));
677 res = wait_for_kbd_ack(kbdcp(p));
694 emptyq(&kbdcp(p)->aux);
695 res = wait_for_aux_ack(kbdcp(p));
707 res = wait_for_aux_ack(kbdcp(p));
721 if (availq(&kbdcp(p)->kbd))
722 return removeq(&kbdcp(p)->kbd);
723 if (availq(&kbdcp(p)->aux))
724 return removeq(&kbdcp(p)->aux);
725 if (!wait_for_data(kbdcp(p)))
727 return read_data(kbdcp(p));
743 kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
744 kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
748 if (availq(&kbdcp(p)->kbd))
749 return removeq(&kbdcp(p)->kbd);
750 if (!wait_for_kbd_data(kbdcp(p)))
752 return read_data(kbdcp(p));
768 kbdcp(p)->kbd.call_count, kbdcp(p)->kbd.max_qcount,
769 kbdcp(p)->aux.call_count, kbdcp(p)->aux.max_qcount);
773 if (availq(&kbdcp(p)->kbd))
774 return removeq(&kbdcp(p)->kbd);
775 f = read_status(kbdcp(p)) & KBDS_BUFFER_FULL;
778 addq(&kbdcp(p)->aux, read_data(kbdcp(p)));
779 f = read_status(kbdcp(p)) & KBDS_BUFFER_FULL;
783 return read_data(kbdcp(p));
792 if (availq(&kbdcp(p)->aux))
793 return removeq(&kbdcp(p)->aux);
794 if (!wait_for_aux_data(kbdcp(p)))
796 return read_data(kbdcp(p));
807 if (availq(&kbdcp(p)->aux))
808 return removeq(&kbdcp(p)->aux);
809 f = read_status(kbdcp(p)) & KBDS_BUFFER_FULL;
812 addq(&kbdcp(p)->kbd, read_data(kbdcp(p)));
813 f = read_status(kbdcp(p)) & KBDS_BUFFER_FULL;
817 return read_data(kbdcp(p));
836 if ((f = read_status(kbdcp(p))) & KBDS_ANY_BUFFER_FULL) {
838 b = read_data(kbdcp(p));
840 addq(&kbdcp(p)->aux, b);
858 emptyq(&kbdcp(p)->kbd);
875 if ((f = read_status(kbdcp(p))) & KBDS_ANY_BUFFER_FULL) {
877 b = read_data(kbdcp(p));
879 addq(&kbdcp(p)->kbd, b);
897 emptyq(&kbdcp(p)->aux);
914 if ((f = read_status(kbdcp(p))) & KBDS_ANY_BUFFER_FULL) {
916 (void)read_data(kbdcp(p));
944 emptyq(&kbdcp(p)->kbd);
945 emptyq(&kbdcp(p)->aux);
964 emptyq(&kbdcp(p)->kbd);
1002 emptyq(&kbdcp(p)->aux);
1054 emptyq(&kbdcp(p)->kbd);
1082 emptyq(&kbdcp(p)->kbd);
1108 emptyq(&kbdcp(p)->kbd);
1122 return kbdcp(p)->command_mask;
1128 kbdcp(p)->command_mask =
1135 if (kbdcp(p)->command_byte != -1)
1136 return kbdcp(p)->command_byte;
1139 emptyq(&kbdcp(p)->kbd);
1140 kbdcp(p)->command_byte = read_controller_data(p);
1141 return kbdcp(p)->command_byte;
1150 command = (kbdcp(p)->command_byte & ~mask) | (command & mask);
1159 kbdcp(p)->command_byte = command;