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
412 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_queuecommand()
413 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
414 mbo = 0; in aha1542_queuecommand()
417 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_queuecommand()
419 mbo++; in aha1542_queuecommand()
420 if (mbo >= AHA1542_MAILBOXES) in aha1542_queuecommand()
421 mbo = 0; in aha1542_queuecommand()
422 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_queuecommand()
424 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_queuecommand()
427 aha1542->int_cmds[mbo] = cmd; /* This will effectively prevent someone else from in aha1542_queuecommand()
430 aha1542->aha1542_last_mbo_used = mbo; in aha1542_queuecommand()
433 shost_printk(KERN_DEBUG, sh, "Sending command (%d %p)...", mbo, cmd->scsi_done); in aha1542_queuecommand()
436 any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ in aha1542_queuecommand()
438 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_queuecommand()
440 ccb[mbo].cdblen = cmd->cmd_len; in aha1542_queuecommand()
448 memcpy(ccb[mbo].cdb, cmd->cmnd, ccb[mbo].cdblen); in aha1542_queuecommand()
454 ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ in aha1542_queuecommand()
461 any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); in aha1542_queuecommand()
462 any2scsi(ccb[mbo].dataptr, isa_virt_to_bus(cptr)); in aha1542_queuecommand()
468 ccb[mbo].op = 0; /* SCSI Initiator Command */ in aha1542_queuecommand()
470 any2scsi(ccb[mbo].datalen, 0); in aha1542_queuecommand()
471 any2scsi(ccb[mbo].dataptr, 0); in aha1542_queuecommand()
473 ccb[mbo].idlun = (target & 7) << 5 | direction | (lun & 7); /*SCSI Target Id */ in aha1542_queuecommand()
474 ccb[mbo].rsalen = 16; in aha1542_queuecommand()
475 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_queuecommand()
476 ccb[mbo].commlinkid = 0; in aha1542_queuecommand()
479 print_hex_dump_bytes("sending: ", DUMP_PREFIX_NONE, &ccb[mbo], sizeof(ccb[mbo]) - 10); in aha1542_queuecommand()
482 mb[mbo].status = 1; in aha1542_queuecommand()
800 int mbo; in aha1542_dev_reset() local
804 mbo = aha1542->aha1542_last_mbo_used + 1; in aha1542_dev_reset()
805 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
806 mbo = 0; in aha1542_dev_reset()
809 if (mb[mbo].status == 0 && aha1542->int_cmds[mbo] == NULL) in aha1542_dev_reset()
811 mbo++; in aha1542_dev_reset()
812 if (mbo >= AHA1542_MAILBOXES) in aha1542_dev_reset()
813 mbo = 0; in aha1542_dev_reset()
814 } while (mbo != aha1542->aha1542_last_mbo_used); in aha1542_dev_reset()
816 if (mb[mbo].status || aha1542->int_cmds[mbo]) in aha1542_dev_reset()
819 aha1542->int_cmds[mbo] = cmd; /* This will effectively in aha1542_dev_reset()
823 aha1542->aha1542_last_mbo_used = mbo; in aha1542_dev_reset()
825 any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ in aha1542_dev_reset()
827 memset(&ccb[mbo], 0, sizeof(struct ccb)); in aha1542_dev_reset()
829 ccb[mbo].op = 0x81; /* BUS DEVICE RESET */ in aha1542_dev_reset()
831 ccb[mbo].idlun = (target & 7) << 5 | (lun & 7); /*SCSI Target Id */ in aha1542_dev_reset()
833 ccb[mbo].linkptr[0] = ccb[mbo].linkptr[1] = ccb[mbo].linkptr[2] = 0; in aha1542_dev_reset()
834 ccb[mbo].commlinkid = 0; in aha1542_dev_reset()