Lines Matching refs:msg

222 static void iop_free_msg(struct iop_msg *msg)  in iop_free_msg()  argument
224 msg->status = IOP_MSGSTATUS_UNUSED; in iop_free_msg()
346 void iop_complete_message(struct iop_msg *msg) in iop_complete_message() argument
348 int iop_num = msg->iop_num; in iop_complete_message()
349 int chan = msg->channel; in iop_complete_message()
353 printk("iop_complete(%p): iop %d chan %d\n", msg, msg->iop_num, msg->channel); in iop_complete_message()
356 offset = IOP_ADDR_RECV_MSG + (msg->channel * IOP_MSG_LEN); in iop_complete_message()
359 iop_writeb(iop_base[iop_num], offset, msg->reply[i]); in iop_complete_message()
364 iop_interrupt(iop_base[msg->iop_num]); in iop_complete_message()
366 iop_free_msg(msg); in iop_complete_message()
373 static void iop_do_send(struct iop_msg *msg) in iop_do_send() argument
375 volatile struct mac_iop *iop = iop_base[msg->iop_num]; in iop_do_send()
378 offset = IOP_ADDR_SEND_MSG + (msg->channel * IOP_MSG_LEN); in iop_do_send()
381 iop_writeb(iop, offset, msg->message[i]); in iop_do_send()
384 iop_writeb(iop, IOP_ADDR_SEND_STATE + msg->channel, IOP_MSG_NEW); in iop_do_send()
397 struct iop_msg *msg,*msg2; in iop_handle_send() local
406 if (!(msg = iop_send_queue[iop_num][chan])) return; in iop_handle_send()
408 msg->status = IOP_MSGSTATUS_COMPLETE; in iop_handle_send()
411 msg->reply[i] = iop_readb(iop, offset); in iop_handle_send()
413 if (msg->handler) (*msg->handler)(msg); in iop_handle_send()
414 msg2 = msg; in iop_handle_send()
415 msg = msg->next; in iop_handle_send()
418 iop_send_queue[iop_num][chan] = msg; in iop_handle_send()
419 if (msg) iop_do_send(msg); in iop_handle_send()
431 struct iop_msg *msg; in iop_handle_recv() local
437 msg = iop_alloc_msg(); in iop_handle_recv()
438 msg->iop_num = iop_num; in iop_handle_recv()
439 msg->channel = chan; in iop_handle_recv()
440 msg->status = IOP_MSGSTATUS_UNSOL; in iop_handle_recv()
441 msg->handler = iop_listeners[iop_num][chan].handler; in iop_handle_recv()
446 msg->message[i] = iop_readb(iop, offset); in iop_handle_recv()
454 if (msg->handler) { in iop_handle_recv()
455 (*msg->handler)(msg); in iop_handle_recv()
461 printk(" %02X", (uint) msg->message[i]); in iop_handle_recv()
465 iop_complete_message(msg); in iop_handle_recv()
481 struct iop_msg *msg, *q; in iop_send_message() local
487 msg = iop_alloc_msg(); in iop_send_message()
488 if (!msg) return -ENOMEM; in iop_send_message()
490 msg->next = NULL; in iop_send_message()
491 msg->status = IOP_MSGSTATUS_WAITING; in iop_send_message()
492 msg->iop_num = iop_num; in iop_send_message()
493 msg->channel = chan; in iop_send_message()
494 msg->caller_priv = privdata; in iop_send_message()
495 memcpy(msg->message, msg_data, msg_len); in iop_send_message()
496 msg->handler = handler; in iop_send_message()
499 iop_send_queue[iop_num][chan] = msg; in iop_send_message()
502 q->next = msg; in iop_send_message()
507 iop_do_send(msg); in iop_send_message()