Lines Matching refs:mbo

264 	int errstatus, mbi, mbo, mbistatus;  in aha1542_interrupt()  local
329 mbo = (scsi2int(mb[mbi].ccbptr) - (unsigned long)aha1542->ccb_handle) / sizeof(struct ccb); in aha1542_interrupt()
335 if (ccb[mbo].tarstat | ccb[mbo].hastat) in aha1542_interrupt()
337 ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); in aha1542_interrupt()
344 shost_printk(KERN_DEBUG, sh, "...done %d %d\n", mbo, mbi); in aha1542_interrupt()
347 tmp_cmd = aha1542->int_cmds[mbo]; in aha1542_interrupt()
352 shost_printk(KERN_WARNING, sh, "tarstat=%x, hastat=%x idlun=%x ccb#=%d\n", ccb[mbo].tarstat, in aha1542_interrupt()
353 ccb[mbo].hastat, ccb[mbo].idlun, mbo); in aha1542_interrupt()
361 if (ccb[mbo].tarstat == 2) in aha1542_interrupt()
362 memcpy(tmp_cmd->sense_buffer, &ccb[mbo].cdb[ccb[mbo].cdblen], in aha1542_interrupt()
371 errstatus = makecode(ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_interrupt()
378 ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_interrupt()
379 if (ccb[mbo].tarstat == 2) in aha1542_interrupt()
380 print_hex_dump_bytes("sense: ", DUMP_PREFIX_NONE, &ccb[mbo].cdb[ccb[mbo].cdblen], 12); in aha1542_interrupt()
385 aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as in aha1542_interrupt()
401 int mbo, sg_count; in aha1542_queuecommand() local
440 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_queuecommand()
441 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
442 mbo = 0; in aha1542_queuecommand()
445 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_queuecommand()
447 mbo++; in aha1542_queuecommand()
448 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
449 mbo = 0; in aha1542_queuecommand()
450 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_queuecommand()
452 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_queuecommand()
455 aha1542->int_cmds[mbo] = cmd; /* This will effectively prevent someone else from in aha1542_queuecommand()
458 aha1542->aha1542_last_mbo_used = mbo; in aha1542_queuecommand()
461 shost_printk(KERN_DEBUG, sh, "Sending command (%d %p)...", mbo, cmd->scsi_done); in aha1542_queuecommand()
465 any2scsi(mb[mbo].ccbptr, aha1542->ccb_handle + mbo * sizeof(*ccb)); in aha1542_queuecommand()
467 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_queuecommand()
469 ccb[mbo].cdblen = cmd->cmd_len; in aha1542_queuecommand()
477 memcpy(ccb[mbo].cdb, cmd->cmnd, ccb[mbo].cdblen); in aha1542_queuecommand()
483 ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ in aha1542_queuecommand()
488 any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); in aha1542_queuecommand()
489 any2scsi(ccb[mbo].dataptr, acmd->chain_handle); in aha1542_queuecommand()
495 ccb[mbo].op = 0; /* SCSI Initiator Command */ in aha1542_queuecommand()
496 any2scsi(ccb[mbo].datalen, 0); in aha1542_queuecommand()
497 any2scsi(ccb[mbo].dataptr, 0); in aha1542_queuecommand()
499 ccb[mbo].idlun = (target & 7) << 5 | direction | (lun & 7); /*SCSI Target Id */ in aha1542_queuecommand()
500 ccb[mbo].rsalen = 16; in aha1542_queuecommand()
501 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_queuecommand()
502 ccb[mbo].commlinkid = 0; in aha1542_queuecommand()
505 print_hex_dump_bytes("sending: ", DUMP_PREFIX_NONE, &ccb[mbo], sizeof(ccb[mbo]) - 10); in aha1542_queuecommand()
508 mb[mbo].status = 1; in aha1542_queuecommand()
860 int mbo; in aha1542_dev_reset() local
864 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_dev_reset()
865 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
866 mbo = 0; in aha1542_dev_reset()
869 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_dev_reset()
871 mbo++; in aha1542_dev_reset()
872 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
873 mbo = 0; in aha1542_dev_reset()
874 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_dev_reset()
876 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_dev_reset()
879 aha1542->int_cmds[mbo] = cmd; /* This will effectively in aha1542_dev_reset()
883 aha1542->aha1542_last_mbo_used = mbo; in aha1542_dev_reset()
886 any2scsi(mb[mbo].ccbptr, aha1542->ccb_handle + mbo * sizeof(*ccb)); in aha1542_dev_reset()
888 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_dev_reset()
890 ccb[mbo].op = 0x81; /* BUS DEVICE RESET */ in aha1542_dev_reset()
892 ccb[mbo].idlun = (target & 7) << 5 | (lun & 7); /*SCSI Target Id */ in aha1542_dev_reset()
894 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_dev_reset()
895 ccb[mbo].commlinkid = 0; in aha1542_dev_reset()