Lines Matching defs:chan

308 int iop_listen(uint iop_num, uint chan,
313 if (chan >= NUM_IOP_CHAN) return -EINVAL;
314 if (iop_listeners[iop_num][chan].handler && handler) return -EINVAL;
315 iop_listeners[iop_num][chan].devname = devname;
316 iop_listeners[iop_num][chan].handler = handler;
329 int chan = msg->channel;
332 iop_pr_debug("iop_num %d chan %d reply %*ph\n",
342 IOP_ADDR_RECV_STATE + chan, IOP_MSG_COMPLETE);
357 iop_pr_debug("iop_num %d chan %d message %*ph\n",
376 static void iop_handle_send(uint iop_num, uint chan)
382 iop_writeb(iop, IOP_ADDR_SEND_STATE + chan, IOP_MSG_IDLE);
384 if (!(msg = iop_send_queue[iop_num][chan])) return;
387 offset = IOP_ADDR_SEND_MSG + (chan * IOP_MSG_LEN);
391 iop_pr_debug("iop_num %d chan %d reply %*ph\n",
392 iop_num, chan, IOP_MSG_LEN, msg->reply);
397 iop_send_queue[iop_num][chan] = msg;
398 if (msg && iop_readb(iop, IOP_ADDR_SEND_STATE + chan) == IOP_MSG_IDLE)
407 static void iop_handle_recv(uint iop_num, uint chan)
415 msg->channel = chan;
417 msg->handler = iop_listeners[iop_num][chan].handler;
419 offset = IOP_ADDR_RECV_MSG + (chan * IOP_MSG_LEN);
424 iop_pr_debug("iop_num %d chan %d message %*ph\n",
425 iop_num, chan, IOP_MSG_LEN, msg->message);
427 iop_writeb(iop, IOP_ADDR_RECV_STATE + chan, IOP_MSG_RCVD);
448 int iop_send_message(uint iop_num, uint chan, void *privdata,
455 if (chan >= NUM_IOP_CHAN) return -EINVAL;
464 msg->channel = chan;
469 if (!(q = iop_send_queue[iop_num][chan])) {
470 iop_send_queue[iop_num][chan] = msg;
557 iop_pr_debug("chan %d send state %02X\n",
570 iop_pr_debug("chan %d recv state %02X\n",