Lines Matching refs:msg
209 struct dt_msg *msg; in dt_attach() local
218 msg = kmem_alloc(sizeof(*msg) * DT_BUF_CNT, KM_SLEEP); in dt_attach()
222 kmem_free(msg, sizeof(*msg) * DT_BUF_CNT); in dt_attach()
228 for (i = 0; i < DT_BUF_CNT; i++, msg++) in dt_attach()
229 SLIST_INSERT_HEAD(&sc->sc_free, msg, chain.slist); in dt_attach()
271 struct dt_msg *msg, *pend; in dt_intr() local
299 if ((msg = SLIST_FIRST(&sc->sc_free)) == NULL) { in dt_intr()
304 memcpy(msg, &sc->sc_msg, sizeof(*msg)); in dt_intr()
307 SIMPLEQ_INSERT_TAIL(&sc->sc_queue, msg, chain.simpleq); in dt_intr()
318 struct dt_msg *msg; in dt_dispatch() local
323 msg = NULL; in dt_dispatch()
327 if (msg != NULL) in dt_dispatch()
328 SLIST_INSERT_HEAD(&sc->sc_free, msg, chain.slist); in dt_dispatch()
329 msg = SIMPLEQ_FIRST(&sc->sc_queue); in dt_dispatch()
330 if (msg != NULL) in dt_dispatch()
333 if (msg == NULL) in dt_dispatch()
336 if (msg->src != DT_ADDR_MOUSE && msg->src != DT_ADDR_KBD) { in dt_dispatch()
339 dt_msg_dump(msg); in dt_dispatch()
342 if (DT_CTL_P(msg->ctl) != 0) { in dt_dispatch()
345 dt_msg_dump(msg); in dt_dispatch()
358 if (DT_CTL_LEN(msg->ctl) >= 6 && in dt_dispatch()
359 msg->body[0] == 0 && msg->src != dt_ms_addr) { in dt_dispatch()
361 dt_ms_addr = msg->src; in dt_dispatch()
362 } else if (DT_CTL_LEN(msg->ctl) < 6 && msg->body[0] != 0 && in dt_dispatch()
363 msg->src != dt_kbd_addr) { in dt_dispatch()
365 dt_kbd_addr = msg->src; in dt_dispatch()
368 if (msg->src == dt_kbd_addr) in dt_dispatch()
374 (*dtdv->dtdv_handler)(dtdv->dtdv_arg, msg); in dt_dispatch()
379 dt_msg_get(struct dt_msg *msg, int intr) in dt_msg_get() argument
439 msg->src = c; in dt_msg_get()
442 msg->ctl = c; in dt_msg_get()
444 dt_state.ds_len = DT_CTL_LEN(msg->ctl) + 1; in dt_msg_get()
445 if (dt_state.ds_len > sizeof(msg->body)) in dt_msg_get()
449 if (dt_state.ds_ptr < sizeof(msg->body)) in dt_msg_get()
450 msg->body[dt_state.ds_ptr++] = c; in dt_msg_get()
456 msg->dst = DT_ADDR_HOST; in dt_msg_get()
462 dt_msg_dump(struct dt_msg *msg) in dt_msg_dump() argument
466 l = DT_CTL_LEN(msg->ctl); in dt_msg_dump()
469 msg->dst, msg->src, DT_CTL_P(msg->ctl), DT_CTL_SUBADDR(msg->ctl), in dt_msg_dump()
474 printf("%02x ", msg->body[i]); in dt_msg_dump()
478 printf("%02x ", msg->body[i]); in dt_msg_dump()