Lines Matching refs:k

244 static void e5_wait_for_cts(struct e5_struct *k)  in e5_wait_for_cts()  argument
254 static void e5_send_byte(u8 byte, struct e5_struct *k) in e5_send_byte() argument
272 static int e5_send_packet(u8 *packet, int count, struct e5_struct *k) in e5_send_packet() argument
278 if (k->cached_mcr & MCR_RTS) { in e5_send_packet()
284 k->cached_mcr |= MCR_RTS; in e5_send_packet()
285 ctrl_outb(k->cached_mcr, EC3104_SER4_MCR); in e5_send_packet()
287 e5_wait_for_cts(k); in e5_send_packet()
292 e5_send_byte(packet[i], k); in e5_send_packet()
294 e5_send_byte(e5_checksum(packet, count), k); in e5_send_packet()
300 k->cached_mcr &= ~MCR_RTS; in e5_send_packet()
301 ctrl_outb(k->cached_mcr, EC3104_SER4_MCR); in e5_send_packet()
323 static void e5_receive(struct e5_struct *k) in e5_receive() argument
325 k->packet[k->pos++] = ctrl_inb(EC3104_SER4_DATA); in e5_receive()
327 if (k->pos == 1) { in e5_receive()
328 switch(k->packet[0]) { in e5_receive()
330 k->length = 3; in e5_receive()
334 k->length = 6; in e5_receive()
338 k->length = 3; in e5_receive()
342 k->length = 1; in e5_receive()
344 k->packet[0]); in e5_receive()
348 if (k->pos == k->length) { in e5_receive()
351 if (e5_checksum(k->packet, k->length) != 0) in e5_receive()
356 for(i=0; i<k->length; i++) { in e5_receive()
357 printk("%02x ", k->packet[i]); in e5_receive()
360 printk("(%02x)]\n", e5_checksum(k->packet, k->length-1)); in e5_receive()
363 switch(k->packet[0]) { in e5_receive()
366 handle_keyboard_event(k->packet[1]); in e5_receive()
370 k->pos = k->length = 0; in e5_receive()
376 struct e5_struct *k = &ec3104_keyb; in ec3104_keyb_interrupt() local
383 if ((msr & MSR_CTS) && !(k->last_msr & MSR_CTS)) { in ec3104_keyb_interrupt()
384 if (k->cached_mcr & MCR_RTS) in ec3104_keyb_interrupt()
387 k->cached_mcr |= MCR_RTS; in ec3104_keyb_interrupt()
389 ctrl_outb(k->cached_mcr, EC3104_SER4_MCR); in ec3104_keyb_interrupt()
390 } else if ((!(msr & MSR_CTS)) && (k->last_msr & MSR_CTS)) { in ec3104_keyb_interrupt()
392 if (!(k->cached_mcr & MCR_RTS)) in ec3104_keyb_interrupt()
395 k->cached_mcr &= ~MCR_RTS; in ec3104_keyb_interrupt()
397 ctrl_outb(k->cached_mcr, EC3104_SER4_MCR); in ec3104_keyb_interrupt()
400 k->last_msr = msr; in ec3104_keyb_interrupt()
405 e5_receive(k); in ec3104_keyb_interrupt()
410 struct e5_struct *k = &ec3104_keyb; in ec3104_keyb_clear_state() local
414 k->last_msr = 0; in ec3104_keyb_clear_state()
424 e5_receive(k); in ec3104_keyb_clear_state()
428 if ((msr & MSR_CTS) && !(k->last_msr & MSR_CTS)) { in ec3104_keyb_clear_state()
429 if (k->cached_mcr & MCR_RTS) in ec3104_keyb_clear_state()
432 k->cached_mcr |= MCR_RTS; in ec3104_keyb_clear_state()
434 ctrl_outb(k->cached_mcr, EC3104_SER4_MCR); in ec3104_keyb_clear_state()
435 } else if ((!(msr & MSR_CTS)) && (k->last_msr & MSR_CTS)) { in ec3104_keyb_clear_state()
437 if (!(k->cached_mcr & MCR_RTS)) in ec3104_keyb_clear_state()
440 k->cached_mcr &= ~MCR_RTS; in ec3104_keyb_clear_state()
442 ctrl_outb(k->cached_mcr, EC3104_SER4_MCR); in ec3104_keyb_clear_state()
446 k->last_msr = msr; in ec3104_keyb_clear_state()