pmcs_scsa.c revision c3bc407cfbd238a18e4728ad5f36f39cecdb062f
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A smp_device_t *);
2N/A smp_device_t *);
static pmcs_xscsi_t *
int flags;
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
int rval;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
goto tgt_init_fail;
int target;
goto tgt_init_fail;
goto tgt_init_fail;
return (DDI_SUCCESS);
if (got_scratch) {
if (lun) {
if (phyp) {
if (pwp) {
if (tgt_port) {
return (DDI_FAILURE);
char *unit_address;
if (phyp) {
return (TRAN_BADPKT);
return (TRAN_FATAL_ERROR);
goto dead_target;
goto dead_target;
if (blocked) {
return (TRAN_ACCEPT);
"%s: draining/resetting/recovering (cnt %u)",
return (TRAN_ACCEPT);
return (TRAN_ACCEPT);
return (TRAN_ACCEPT);
lun = 0;
NULL)) {
if (pwrk) {
if (sp) {
int rval;
switch (level) {
case RESET_ALL:
rval = 0;
case RESET_LUN:
case RESET_TARGET:
(void *)xp);
rval = 0;
rval = 0;
return (rval);
switch (cidx) {
case SCSI_CAP_DMA_MAX:
case SCSI_CAP_INITIATOR_ID:
if (set == 0) {
case SCSI_CAP_DISCONNECT:
case SCSI_CAP_SYNCHRONOUS:
case SCSI_CAP_WIDE_XFER:
case SCSI_CAP_PARITY:
case SCSI_CAP_ARQ:
case SCSI_CAP_UNTAGGED_QING:
if (set == 0) {
case SCSI_CAP_TAGGED_QING:
case SCSI_CAP_MSG_OUT:
case SCSI_CAP_QFULL_RETRIES:
case SCSI_CAP_SCSI_VERSION:
if (set == 0) {
if (set) {
case SCSI_CAP_CDB_LEN:
if (set == 0) {
case SCSI_CAP_LUN_RESET:
if (set) {
rval = 0;
return (rval);
static pmcs_xscsi_t *
return (NULL);
return (NULL);
if (lp) {
return (xp);
return (EINVAL);
switch (ckey) {
case SAS_CAP_SMP_CRC:
ret = 0;
return (ret);
int result;
if (pptr) {
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
if (result) {
return (DDI_FAILURE);
} else if (status ==
goto out;
(void *)xp);
out:
return (result);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_FAILURE);
return (DDI_FAILURE);
int target;
goto smp_init_fail;
goto smp_init_fail;
return (DDI_SUCCESS);
return (DDI_FAILURE);
char *tgt_port;
while (totactive) {
totactive = 0;
if (totactive) {
if (totactive == 0) {
int rval;
if (blocked) {
return (B_TRUE);
return (B_TRUE);
return (B_TRUE);
(void *)xp);
return (B_TRUE);
return (B_FALSE);
return (B_TRUE);
return (B_FALSE);
return (B_TRUE);
if (run_one) {
goto wq_out;
return (B_TRUE);
target = 0;
target = 0;
if (rval) {
niodone = 0;
while (ioccb) {
niodone++;
while (sp) {
thread_exit();
return (PMCS_WQ_RUN_FAIL_OTHER);
return (PMCS_WQ_RUN_FAIL_OTHER);
return (PMCS_WQ_RUN_FAIL_RES);
ptr[0] =
return (PMCS_WQ_RUN_FAIL_RES);
#ifdef DEBUG
case FLAG_HTAG:
case FLAG_OTAG:
case FLAG_STAG:
#ifdef DEBUG
return (PMCS_WQ_RUN_SUCCESS);
int dead;
if (msg) {
sts = 0;
if (dead != 0) {
goto out;
goto out;
#ifdef DEBUG
if (msg) {
if (!msg) {
goto out;
switch (sts) {
case PMCOUT_STATUS_UNDERFLOW:
case PMCOUT_STATUS_OK:
const int lim =
msg);
goto out;
goto out;
goto out;
out:
(void *)xp);
if (dead == 0) {
#ifdef DEBUG
if (aborted) {
if (do_ds_recovery) {
cmd_next);
if (!dead) {
return (PMCS_WQ_RUN_SUCCESS);
return (PMCS_WQ_RUN_FAIL_OTHER);
return (PMCS_WQ_RUN_FAIL_OTHER);
if (asc) {
return (PMCS_WQ_RUN_SUCCESS);
if (amt == 0) {
return (PMCS_WQ_RUN_SUCCESS);
return (PMCS_WQ_RUN_FAIL_RES);
return (PMCS_WQ_RUN_FAIL_OTHER);
ptr[0] =
int op;
#ifdef DEBUG
return (PMCS_WQ_RUN_FAIL_RES);
#ifdef DEBUG
return (PMCS_WQ_RUN_SUCCESS);
int dead;
if (msg) {
sts = 0;
if (dead != 0) {
goto out;
goto out;
#ifdef DEBUG
if (msg) {
if (!msg) {
goto out;
PMCS_PHYOP_LINK_RESET) != 0) {
out:
(void *)xp);
if (dead == 0) {
#ifdef DEBUG
if (aborted) {
static uint8_t
switch (cdb[0]) {
case SCMD_READ_G5:
case SCMD_WRITE_G5:
*xfr =
*lba =
case SCMD_READ_G4:
case SCMD_WRITE_G4:
*xfr =
*lba =
case SCMD_READ_G1:
case SCMD_WRITE_G1:
*lba =
case SCMD_READ:
case SCMD_WRITE:
if (*xfr == 0) {
*lba =
if (asc == 0) {
return (asc);
const char *msg;
(unsigned long long)gethrtime());
switch (status) {
case PMCOUT_STATUS_OK:
if (t == SATA) {
case PMCOUT_STATUS_ABORTED:
case PMCOUT_STATUS_UNDERFLOW:
case PMCOUT_STATUS_NO_DEVICE:
case PMCOUT_STATUS_PROG_ERROR:
static const char c1[] =
static const char c2[] =
sizeof (struct scsi_extended_sense);
} else if (status) {
return (amt);
return (NULL);
if (tgt) {
return (tgt);
return (NULL);
DDI_SUCCESS) {
return (NULL);
return (tgt);
return (NULL);
return (tgt);