SC
if ((opcode & OPCODE) == SC) {
{"svc", SC(17,0,0), SC_MASK, POWER, PPCVLE, {SVC_LEV, FL1, FL2}},
{"svcl", SC(17,0,1), SC_MASK, POWER, PPCVLE, {SVC_LEV, FL1, FL2}},
{"sc", SC(17,1,0), SC_MASK, PPC, PPCVLE, {LEV}},
{"svca", SC(17,1,0), SC_MASK, PWRCOM, PPCVLE, {SV}},
{"svcla", SC(17,1,1), SC_MASK, POWER, PPCVLE, {SV}},
reg = read_kctxt_csr(dd, sc->hw_context, SC(STATUS));
if (reg & SC(STATUS_CTXT_HALTED_SMASK))
sc_ctrl = read_kctxt_csr(dd, sc->hw_context, SC(CTRL));
if ((sc_ctrl & SC(CTRL_CTXT_ENABLE_SMASK)))
reg = read_kctxt_csr(dd, sc->hw_context, SC(ERR_STATUS));
write_kctxt_csr(dd, sc->hw_context, SC(ERR_CLEAR), reg);
sc_ctrl |= SC(CTRL_CTXT_ENABLE_SMASK);
write_kctxt_csr(dd, sc->hw_context, SC(CTRL), sc_ctrl);
read_kctxt_csr(dd, sc->hw_context, SC(CTRL));
write_kctxt_csr(sc->dd, sc->hw_context, SC(CREDIT_FORCE),
SC(CREDIT_FORCE_FORCE_RETURN_SMASK));
read_kctxt_csr(sc->dd, sc->hw_context, SC(CREDIT_FORCE));
write_kctxt_csr(sc->dd, sc->hw_context, SC(CREDIT_FORCE), 0);
sc->credit_ctrl |= SC(CREDIT_CTRL_CREDIT_INTR_SMASK);
SC(CREDIT_CTRL), sc->credit_ctrl);
sc->credit_ctrl &= ~SC(CREDIT_CTRL_CREDIT_INTR_SMASK);
SC(CREDIT_CTRL), sc->credit_ctrl);
write_kctxt_csr(dd, ctxt, SC(CHECK_VL), mask);
write_kctxt_csr(dd, ctxt, SC(CHECK_VL), mask);
write_kctxt_csr(dd, ctxt, SC(CHECK_VL), mask);
reg = read_kctxt_csr(sc->dd, sc->hw_context, SC(CREDIT_STATUS));
(reg >> SC(CREDIT_STATUS_CURRENT_FREE_COUNTER_SHIFT)) &
SC(CREDIT_STATUS_CURRENT_FREE_COUNTER_MASK),
reg & SC(CREDIT_STATUS_LAST_RETURNED_COUNTER_SMASK));
SC(CREDIT_CTRL_THRESHOLD_SHIFT))
& SC(CREDIT_CTRL_THRESHOLD_MASK);
& ~SC(CREDIT_CTRL_THRESHOLD_SMASK))
& SC(CREDIT_CTRL_THRESHOLD_MASK))
<< SC(CREDIT_CTRL_THRESHOLD_SHIFT));
SC(CREDIT_CTRL), sc->credit_ctrl);
SC(CHECK_ENABLE),
reg = ((sci->credits & SC(CTRL_CTXT_DEPTH_MASK))
<< SC(CTRL_CTXT_DEPTH_SHIFT))
| ((sci->base & SC(CTRL_CTXT_BASE_MASK))
<< SC(CTRL_CTXT_BASE_SHIFT));
write_kctxt_csr(dd, hw_context, SC(CTRL), reg);
write_kctxt_csr(dd, hw_context, SC(ERR_MASK), (u64)-1);
write_kctxt_csr(dd, hw_context, SC(CHECK_PARTITION_KEY),
(SC(CHECK_PARTITION_KEY_VALUE_MASK) &
SC(CHECK_PARTITION_KEY_VALUE_SHIFT));
write_kctxt_csr(dd, hw_context, SC(CHECK_OPCODE),
((u64)opmask << SC(CHECK_OPCODE_MASK_SHIFT)) |
((u64)opval << SC(CHECK_OPCODE_VALUE_SHIFT)));
reg = dma & SC(CREDIT_RETURN_ADDR_ADDRESS_SMASK);
write_kctxt_csr(dd, hw_context, SC(CREDIT_RETURN_ADDR), reg);
reg = thresh << SC(CREDIT_CTRL_THRESHOLD_SHIFT);
reg |= SC(CREDIT_CTRL_EARLY_RETURN_SMASK);
reg |= SC(CREDIT_CTRL_EARLY_RETURN_SMASK);
write_kctxt_csr(dd, hw_context, SC(CREDIT_CTRL), reg);
write_kctxt_csr(dd, hw_context, SC(CHECK_VL), reg);
write_kctxt_csr(dd, hw_context, SC(CTRL), 0);
write_kctxt_csr(dd, hw_context, SC(CHECK_ENABLE), 0);
write_kctxt_csr(dd, hw_context, SC(ERR_MASK), 0);
write_kctxt_csr(dd, hw_context, SC(CHECK_PARTITION_KEY), 0);
write_kctxt_csr(dd, hw_context, SC(CHECK_OPCODE), 0);
write_kctxt_csr(dd, hw_context, SC(CREDIT_RETURN_ADDR), 0);
write_kctxt_csr(dd, hw_context, SC(CREDIT_CTRL), 0);
reg = read_kctxt_csr(sc->dd, sc->hw_context, SC(CTRL));
reg &= ~SC(CTRL_CTXT_ENABLE_SMASK);
write_kctxt_csr(sc->dd, sc->hw_context, SC(CTRL), reg);
return !!(read_kctxt_csr(dd, hw_context, SC(STATUS)) &
SC(STATUS_CTXT_HALTED_SMASK));
fw = SC(sd->gspca_dev.pixfmt.width) / max_width;
fh = SC(sd->gspca_dev.pixfmt.height) / max_height;
cw = (fw >= fh) ? max_width : SC(sd->gspca_dev.pixfmt.width) / fh;
ch = (fw >= fh) ? SC(sd->gspca_dev.pixfmt.height) / fw : max_height;
static inline void append_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
if (!*SC)
*SC = new_SC;
for (end = *SC; SCNEXT(end); end = SCNEXT(end))
static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd ** SC)
ptr = *SC;
*SC = SCNEXT(*SC);
static inline struct scsi_cmnd *remove_lun_SC(struct scsi_cmnd ** SC,
for (ptr = *SC, prev = NULL;
*SC = SCNEXT(ptr);
static inline struct scsi_cmnd *remove_SC(struct scsi_cmnd **SC,
for (ptr = *SC, prev = NULL;
*SC = SCNEXT(ptr);
spin_lock_irq(SC->device->host->host_lock);
rc = __ips_eh_reset(SC);
spin_unlock_irq(SC->device->host->host_lock);
static enum scsi_qc_status ips_queue_lck(struct scsi_cmnd *SC)
ha = (ips_ha_t *) SC->device->host->hostdata;
if (ips_is_passthru(SC)) {
SC->result = DID_BUS_BUSY << 16;
done(SC);
SC->result = DID_BUS_BUSY << 16;
done(SC);
SC->cmnd[0],
SC->device->channel, SC->device->id, SC->device->lun);
if ((scmd_channel(SC) > 0)
&& (scmd_id(SC) == ha->ha_id[scmd_channel(SC)])) {
SC->result = DID_NO_CONNECT << 16;
done(SC);
if (ips_is_passthru(SC)) {
pt = (ips_passthru_t *) scsi_sglist(SC);
SC->result = DID_BUS_BUSY << 16;
done(SC);
__ips_eh_reset(SC);
SC->result = DID_OK << 16;
scsi_done(SC);
SC->result = DID_ERROR << 16;
done(SC);
scratch->scsi_cmd = SC;
ips_putq_wait_tail(&ha->scb_waitlist, SC);
SC->result = DID_ERROR << 16;
done(SC);
static int ips_is_passthru(struct scsi_cmnd *SC)
if (!SC)
if ((SC->cmnd[0] == IPS_IOCTL_COMMAND) &&
(SC->device->channel == 0) &&
(SC->device->id == IPS_ADAPTER_ID) &&
(SC->device->lun == 0) && scsi_sglist(SC)) {
struct scatterlist *sg = scsi_sglist(SC);
ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr)
struct scatterlist *sg = scsi_sglist(SC);
scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
ips_scmd_buf_read(SC, pt, sizeof (ips_passthru_t));
ips_scmd_buf_write(SC, pt, sizeof (ips_passthru_t));
ips_scmd_buf_read(SC, ha->ioctl_data, ha->ioctl_datasize);
ips_scmd_buf_write(SC, ha->ioctl_data,
SC->result = DID_OK << 16;
if (SC->cmnd[0] == IPS_IOCTL_COMMAND) {
ips_scmd_buf_write(SC, ha->ioctl_data,
struct scsi_cmnd *SC;
SC = ips_removeq_wait(&ha->scb_waitlist, q);
SC->result = DID_OK;
SC->host_scribble = NULL;
scb->target_id = SC->device->id;
scb->lun = SC->device->lun;
scb->bus = SC->device->channel;
scb->scsi_cmd = SC;
memcpy(scb->cdb, SC->cmnd, SC->cmd_len);
scb->sg_count = scsi_dma_map(SC);
scsi_for_each_sg(SC, sg, scb->sg_count, i) {
int ips_eh_abort(struct scsi_cmnd *SC)
if (!SC)
host = SC->device->host;
ha = (ips_ha_t *) SC->device->host->hostdata;
while ((item) && (item->scsi_cmd != SC))
} else if (ips_removeq_wait(&ha->scb_waitlist, SC)) {
static int __ips_eh_reset(struct scsi_cmnd *SC)
if (!SC) {
ha = (ips_ha_t *) SC->device->host->hostdata;
static int ips_eh_reset(struct scsi_cmnd *SC)