Lines Matching refs:mbo

241 	int errstatus, mbi, mbo, mbistatus;  in aha1542_interrupt()  local
306 mbo = (scsi2int(mb[mbi].ccbptr) - (isa_virt_to_bus(&ccb[0]))) / sizeof(struct ccb); in aha1542_interrupt()
312 if (ccb[mbo].tarstat | ccb[mbo].hastat) in aha1542_interrupt()
314 ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); in aha1542_interrupt()
321 shost_printk(KERN_DEBUG, sh, "...done %d %d\n", mbo, mbi); in aha1542_interrupt()
324 tmp_cmd = aha1542->int_cmds[mbo]; in aha1542_interrupt()
329 shost_printk(KERN_WARNING, sh, "tarstat=%x, hastat=%x idlun=%x ccb#=%d\n", ccb[mbo].tarstat, in aha1542_interrupt()
330 ccb[mbo].hastat, ccb[mbo].idlun, mbo); in aha1542_interrupt()
339 if (ccb[mbo].tarstat == 2) in aha1542_interrupt()
340 memcpy(tmp_cmd->sense_buffer, &ccb[mbo].cdb[ccb[mbo].cdblen], in aha1542_interrupt()
349 errstatus = makecode(ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_interrupt()
356 ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_interrupt()
357 if (ccb[mbo].tarstat == 2) in aha1542_interrupt()
358 print_hex_dump_bytes("sense: ", DUMP_PREFIX_NONE, &ccb[mbo].cdb[ccb[mbo].cdblen], 12); in aha1542_interrupt()
363 aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as in aha1542_interrupt()
378 int mbo, sg_count; in aha1542_queuecommand() local
416 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_queuecommand()
417 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
418 mbo = 0; in aha1542_queuecommand()
421 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_queuecommand()
423 mbo++; in aha1542_queuecommand()
424 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
425 mbo = 0; in aha1542_queuecommand()
426 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_queuecommand()
428 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_queuecommand()
431 aha1542->int_cmds[mbo] = cmd; /* This will effectively prevent someone else from in aha1542_queuecommand()
434 aha1542->aha1542_last_mbo_used = mbo; in aha1542_queuecommand()
437 shost_printk(KERN_DEBUG, sh, "Sending command (%d %p)...", mbo, cmd->scsi_done); in aha1542_queuecommand()
440 any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ in aha1542_queuecommand()
442 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_queuecommand()
444 ccb[mbo].cdblen = cmd->cmd_len; in aha1542_queuecommand()
452 memcpy(ccb[mbo].cdb, cmd->cmnd, ccb[mbo].cdblen); in aha1542_queuecommand()
458 ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ in aha1542_queuecommand()
465 any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); in aha1542_queuecommand()
466 any2scsi(ccb[mbo].dataptr, isa_virt_to_bus(cptr)); in aha1542_queuecommand()
472 ccb[mbo].op = 0; /* SCSI Initiator Command */ in aha1542_queuecommand()
474 any2scsi(ccb[mbo].datalen, 0); in aha1542_queuecommand()
475 any2scsi(ccb[mbo].dataptr, 0); in aha1542_queuecommand()
477 ccb[mbo].idlun = (target & 7) << 5 | direction | (lun & 7); /*SCSI Target Id */ in aha1542_queuecommand()
478 ccb[mbo].rsalen = 16; in aha1542_queuecommand()
479 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_queuecommand()
480 ccb[mbo].commlinkid = 0; in aha1542_queuecommand()
483 print_hex_dump_bytes("sending: ", DUMP_PREFIX_NONE, &ccb[mbo], sizeof(ccb[mbo]) - 10); in aha1542_queuecommand()
486 mb[mbo].status = 1; in aha1542_queuecommand()
804 int mbo; in aha1542_dev_reset() local
808 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_dev_reset()
809 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
810 mbo = 0; in aha1542_dev_reset()
813 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_dev_reset()
815 mbo++; in aha1542_dev_reset()
816 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
817 mbo = 0; in aha1542_dev_reset()
818 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_dev_reset()
820 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_dev_reset()
823 aha1542->int_cmds[mbo] = cmd; /* This will effectively in aha1542_dev_reset()
827 aha1542->aha1542_last_mbo_used = mbo; in aha1542_dev_reset()
829 any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ in aha1542_dev_reset()
831 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_dev_reset()
833 ccb[mbo].op = 0x81; /* BUS DEVICE RESET */ in aha1542_dev_reset()
835 ccb[mbo].idlun = (target & 7) << 5 | (lun & 7); /*SCSI Target Id */ in aha1542_dev_reset()
837 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_dev_reset()
838 ccb[mbo].commlinkid = 0; in aha1542_dev_reset()