Lines Matching refs:mbo
282 int errstatus, mbi, mbo, mbistatus; in aha1542_interrupt() local
349 mbo = (scsi2int(mb[mbi].ccbptr) - (unsigned long)aha1542->ccb_handle) / sizeof(struct ccb); in aha1542_interrupt()
355 if (ccb[mbo].tarstat | ccb[mbo].hastat) in aha1542_interrupt()
357 ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); in aha1542_interrupt()
364 shost_printk(KERN_DEBUG, sh, "...done %d %d\n", mbo, mbi); in aha1542_interrupt()
367 tmp_cmd = aha1542->int_cmds[mbo]; in aha1542_interrupt()
372 shost_printk(KERN_WARNING, sh, "tarstat=%x, hastat=%x idlun=%x ccb#=%d\n", ccb[mbo].tarstat, in aha1542_interrupt()
373 ccb[mbo].hastat, ccb[mbo].idlun, mbo); in aha1542_interrupt()
382 if (ccb[mbo].tarstat == 2) in aha1542_interrupt()
383 memcpy(tmp_cmd->sense_buffer, &ccb[mbo].cdb[ccb[mbo].cdblen], in aha1542_interrupt()
392 errstatus = makecode(ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_interrupt()
399 ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_interrupt()
400 if (ccb[mbo].tarstat == 2) in aha1542_interrupt()
401 print_hex_dump_bytes("sense: ", DUMP_PREFIX_NONE, &ccb[mbo].cdb[ccb[mbo].cdblen], 12); in aha1542_interrupt()
406 aha1542->int_cmds[mbo] = NULL; /* This effectively frees up the mailbox slot, as in aha1542_interrupt()
423 int mbo; in aha1542_queuecommand() local
464 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_queuecommand()
465 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
466 mbo = 0; in aha1542_queuecommand()
469 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_queuecommand()
471 mbo++; in aha1542_queuecommand()
472 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
473 mbo = 0; in aha1542_queuecommand()
474 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_queuecommand()
476 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_queuecommand()
479 aha1542->int_cmds[mbo] = cmd; /* This will effectively prevent someone else from in aha1542_queuecommand()
483 aha1542->aha1542_last_mbo_used = mbo; in aha1542_queuecommand()
486 shost_printk(KERN_DEBUG, sh, "Sending command (%d)...", mbo); in aha1542_queuecommand()
490 any2scsi(mb[mbo].ccbptr, aha1542->ccb_handle + mbo * sizeof(*ccb)); in aha1542_queuecommand()
492 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_queuecommand()
494 ccb[mbo].cdblen = cmd->cmd_len; in aha1542_queuecommand()
502 memcpy(ccb[mbo].cdb, cmd->cmnd, ccb[mbo].cdblen); in aha1542_queuecommand()
503 ccb[mbo].op = 0; /* SCSI Initiator Command */ in aha1542_queuecommand()
504 any2scsi(ccb[mbo].datalen, bufflen); in aha1542_queuecommand()
506 any2scsi(ccb[mbo].dataptr, acmd->data_buffer_handle); in aha1542_queuecommand()
508 any2scsi(ccb[mbo].dataptr, 0); in aha1542_queuecommand()
509 ccb[mbo].idlun = (target & 7) << 5 | direction | (lun & 7); /*SCSI Target Id */ in aha1542_queuecommand()
510 ccb[mbo].rsalen = 16; in aha1542_queuecommand()
511 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_queuecommand()
512 ccb[mbo].commlinkid = 0; in aha1542_queuecommand()
515 print_hex_dump_bytes("sending: ", DUMP_PREFIX_NONE, &ccb[mbo], sizeof(ccb[mbo]) - 10); in aha1542_queuecommand()
518 mb[mbo].status = 1; in aha1542_queuecommand()
871 int mbo; in aha1542_dev_reset() local
875 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_dev_reset()
876 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
877 mbo = 0; in aha1542_dev_reset()
880 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_dev_reset()
882 mbo++; in aha1542_dev_reset()
883 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
884 mbo = 0; in aha1542_dev_reset()
885 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_dev_reset()
887 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_dev_reset()
890 aha1542->int_cmds[mbo] = cmd; /* This will effectively in aha1542_dev_reset()
895 aha1542->aha1542_last_mbo_used = mbo; in aha1542_dev_reset()
898 any2scsi(mb[mbo].ccbptr, aha1542->ccb_handle + mbo * sizeof(*ccb)); in aha1542_dev_reset()
900 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_dev_reset()
902 ccb[mbo].op = 0x81; /* BUS DEVICE RESET */ in aha1542_dev_reset()
904 ccb[mbo].idlun = (target & 7) << 5 | (lun & 7); /*SCSI Target Id */ in aha1542_dev_reset()
906 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_dev_reset()
907 ccb[mbo].commlinkid = 0; in aha1542_dev_reset()