Lines Matching refs:mbo
404 int errstatus, mbi, mbo, mbistatus; in aha1542_intr_handle() local
480 mbo = (scsi2int(mb[mbi].ccbptr) - (SCSI_BUF_PA(&ccb[0]))) / sizeof(struct ccb); in aha1542_intr_handle()
488 if (ccb[mbo].tarstat | ccb[mbo].hastat) in aha1542_intr_handle()
490 ccb[mbo].tarstat + ((int) ccb[mbo].hastat << 16), mb[mbi].status); in aha1542_intr_handle()
498 printk(KERN_DEBUG "...done %d %d\n", mbo, mbi); in aha1542_intr_handle()
501 SCtmp = HOSTDATA(shost)->SCint[mbo]; in aha1542_intr_handle()
505 printk(KERN_WARNING "tarstat=%x, hastat=%x idlun=%x ccb#=%d \n", ccb[mbo].tarstat, in aha1542_intr_handle()
506 ccb[mbo].hastat, ccb[mbo].idlun, mbo); in aha1542_intr_handle()
515 if (ccb[mbo].tarstat == 2) in aha1542_intr_handle()
516 memcpy(SCtmp->sense_buffer, &ccb[mbo].cdb[ccb[mbo].cdblen], in aha1542_intr_handle()
525 errstatus = makecode(ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_intr_handle()
532 ccb[mbo].hastat, ccb[mbo].tarstat); in aha1542_intr_handle()
535 if (ccb[mbo].tarstat == 2) { in aha1542_intr_handle()
542 printk("%02x ", ccb[mbo].cdb[ccb[mbo].cdblen + i]); in aha1542_intr_handle()
554 HOSTDATA(shost)->SCint[mbo] = NULL; /* This effectively frees up the mailbox slot, as in aha1542_intr_handle()
570 int mbo; in aha1542_queuecommand_lck() local
621 mbo = HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used + 1; in aha1542_queuecommand_lck()
622 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand_lck()
623 mbo = 0; in aha1542_queuecommand_lck()
626 if (mb[mbo].status == 0 && HOSTDATA(SCpnt->device->host)->SCint[mbo] == NULL) in aha1542_queuecommand_lck()
628 mbo++; in aha1542_queuecommand_lck()
629 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand_lck()
630 mbo = 0; in aha1542_queuecommand_lck()
631 } while (mbo != HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used); in aha1542_queuecommand_lck()
633 if (mb[mbo].status || HOSTDATA(SCpnt->device->host)->SCint[mbo]) in aha1542_queuecommand_lck()
636 …HOSTDATA(SCpnt->device->host)->SCint[mbo] = SCpnt; /* This will effectively prevent someone else f… in aha1542_queuecommand_lck()
639 HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo; in aha1542_queuecommand_lck()
643 printk(KERN_DEBUG "Sending command (%d %x)...", mbo, done); in aha1542_queuecommand_lck()
646 any2scsi(mb[mbo].ccbptr, SCSI_BUF_PA(&ccb[mbo])); /* This gets trashed for some reason */ in aha1542_queuecommand_lck()
648 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_queuecommand_lck()
650 ccb[mbo].cdblen = SCpnt->cmd_len; in aha1542_queuecommand_lck()
658 memcpy(ccb[mbo].cdb, cmd, ccb[mbo].cdblen); in aha1542_queuecommand_lck()
667 ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ in aha1542_queuecommand_lck()
673 HOSTDATA(SCpnt->device->host)->SCint[mbo] = NULL; in aha1542_queuecommand_lck()
680 any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); in aha1542_queuecommand_lck()
681 any2scsi(ccb[mbo].dataptr, SCSI_BUF_PA(cptr)); in aha1542_queuecommand_lck()
689 ccb[mbo].op = 0; /* SCSI Initiator Command */ in aha1542_queuecommand_lck()
691 any2scsi(ccb[mbo].datalen, 0); in aha1542_queuecommand_lck()
692 any2scsi(ccb[mbo].dataptr, 0); in aha1542_queuecommand_lck()
694 ccb[mbo].idlun = (target & 7) << 5 | direction | (lun & 7); /*SCSI Target Id */ in aha1542_queuecommand_lck()
695 ccb[mbo].rsalen = 16; in aha1542_queuecommand_lck()
696 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_queuecommand_lck()
697 ccb[mbo].commlinkid = 0; in aha1542_queuecommand_lck()
703 for (i = 0; i < sizeof(ccb[mbo]) - 10; i++) in aha1542_queuecommand_lck()
704 printk("%02x ", ((unchar *) & ccb[mbo])[i]); in aha1542_queuecommand_lck()
712 mb[mbo].status = 1; in aha1542_queuecommand_lck()
1295 int mbo; in aha1542_dev_reset() local
1303 mbo = HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used + 1; in aha1542_dev_reset()
1304 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
1305 mbo = 0; in aha1542_dev_reset()
1308 if (mb[mbo].status == 0 && HOSTDATA(SCpnt->device->host)->SCint[mbo] == NULL) in aha1542_dev_reset()
1310 mbo++; in aha1542_dev_reset()
1311 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
1312 mbo = 0; in aha1542_dev_reset()
1313 } while (mbo != HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used); in aha1542_dev_reset()
1315 if (mb[mbo].status || HOSTDATA(SCpnt->device->host)->SCint[mbo]) in aha1542_dev_reset()
1318 HOSTDATA(SCpnt->device->host)->SCint[mbo] = SCpnt; /* This will effectively in aha1542_dev_reset()
1322 HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo; in aha1542_dev_reset()
1325 any2scsi(mb[mbo].ccbptr, SCSI_BUF_PA(&ccb[mbo])); /* This gets trashed for some reason */ in aha1542_dev_reset()
1327 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_dev_reset()
1329 ccb[mbo].op = 0x81; /* BUS DEVICE RESET */ in aha1542_dev_reset()
1331 ccb[mbo].idlun = (target & 7) << 5 | (lun & 7); /*SCSI Target Id */ in aha1542_dev_reset()
1333 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_dev_reset()
1334 ccb[mbo].commlinkid = 0; in aha1542_dev_reset()
1524 int mbi, mbo, i;
1576 for (mbo = 0; mbo < AHA1542_MAILBOXES; mbo++) {
1577 if (SCpnt == HOSTDATA(SCpnt->host)->SCint[mbo]) {
1578 mb[mbo].status = 2; /* Abort command */
1584 if (AHA1542_MAILBOXES == mbo)