Lines Matching defs:chan

326 int iop_listen(uint iop_num, uint chan,
331 if (chan >= NUM_IOP_CHAN) return -EINVAL;
332 if (iop_listeners[iop_num][chan].handler && handler) return -EINVAL;
333 iop_listeners[iop_num][chan].devname = devname;
334 iop_listeners[iop_num][chan].handler = handler;
347 int chan = msg->channel;
350 iop_pr_debug("iop_num %d chan %d reply %*ph\n",
360 IOP_ADDR_RECV_STATE + chan, IOP_MSG_COMPLETE);
375 iop_pr_debug("iop_num %d chan %d message %*ph\n",
394 static void iop_handle_send(uint iop_num, uint chan)
400 iop_writeb(iop, IOP_ADDR_SEND_STATE + chan, IOP_MSG_IDLE);
402 if (!(msg = iop_send_queue[iop_num][chan])) return;
405 offset = IOP_ADDR_SEND_MSG + (chan * IOP_MSG_LEN);
409 iop_pr_debug("iop_num %d chan %d reply %*ph\n",
410 iop_num, chan, IOP_MSG_LEN, msg->reply);
415 iop_send_queue[iop_num][chan] = msg;
416 if (msg && iop_readb(iop, IOP_ADDR_SEND_STATE + chan) == IOP_MSG_IDLE)
425 static void iop_handle_recv(uint iop_num, uint chan)
433 msg->channel = chan;
435 msg->handler = iop_listeners[iop_num][chan].handler;
437 offset = IOP_ADDR_RECV_MSG + (chan * IOP_MSG_LEN);
442 iop_pr_debug("iop_num %d chan %d message %*ph\n",
443 iop_num, chan, IOP_MSG_LEN, msg->message);
445 iop_writeb(iop, IOP_ADDR_RECV_STATE + chan, IOP_MSG_RCVD);
466 int iop_send_message(uint iop_num, uint chan, void *privdata,
473 if (chan >= NUM_IOP_CHAN) return -EINVAL;
482 msg->channel = chan;
487 if (!(q = iop_send_queue[iop_num][chan])) {
488 iop_send_queue[iop_num][chan] = msg;
575 iop_pr_debug("chan %d send state %02X\n",
588 iop_pr_debug("chan %d recv state %02X\n",