static void adb_iop_start(void) { unsigned long flags; struct adb_request *req; struct adb_iopmsg amsg; #ifdef DEBUG_ADB_IOP int i; #endif /* get the packet to send */ req = current_req; if (!req) return; local_irq_save(flags); #ifdef DEBUG_ADB_IOP printk("adb_iop_start %p: sending packet, %d bytes:", req, req->nbytes); for (i = 0 ; i < req->nbytes ; i++) printk(" %02X", (uint) req->data[i]); printk("\n"); #endif /* The IOP takes MacII-style packets, so */ /* strip the initial ADB_PACKET byte. */ amsg.flags = ADB_IOP_EXPLICIT; amsg.count = req->nbytes - 2; /* amsg.data immediately follows amsg.cmd, effectively making */ /* amsg.cmd a pointer to the beginning of a full ADB packet. */ memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1); req->sent = 1; adb_iop_state = sending; local_irq_restore(flags); /* Now send it. The IOP manager will call adb_iop_complete */ /* when the packet has been sent. */ iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *) &amsg, adb_iop_complete); }
static void adb_iop_start(void) { unsigned long flags; struct adb_request *req; struct adb_iopmsg amsg; #ifdef DEBUG_ADB_IOP int i; #endif req = current_req; if (!req) return; local_irq_save(flags); #ifdef DEBUG_ADB_IOP printk("adb_iop_start %p: sending packet, %d bytes:", req, req->nbytes); for (i = 0 ; i < req->nbytes ; i++) printk(" %02X", (uint) req->data[i]); printk("\n"); #endif amsg.flags = ADB_IOP_EXPLICIT; amsg.count = req->nbytes - 2; memcpy(&amsg.cmd, req->data + 1, req->nbytes - 1); req->sent = 1; adb_iop_state = sending; local_irq_restore(flags); iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *) &amsg, adb_iop_complete); }