示例#1
0
/**
 * qla2x00_marker() - Send a marker IOCB to the firmware.
 * @ha: HA context
 * @loop_id: loop ID
 * @lun: LUN
 * @type: marker modifier
 *
 * Can be called from both normal and interrupt context.
 *
 * Returns non-zero if a failure occured, else zero.
 */
int
__qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
    uint8_t type)
{
	mrk_entry_t	*pkt;

	pkt = (mrk_entry_t *)qla2x00_req_pkt(ha);
	if (pkt == NULL) {
		DEBUG2_3(printk("%s(): **** FAILED ****\n", __func__));

		return (QLA_FUNCTION_FAILED);
	}

	pkt->entry_type = MARKER_TYPE;
	pkt->modifier = type;

	if (type != MK_SYNC_ALL) {
		pkt->lun = cpu_to_le16(lun);
		SET_TARGET_ID(ha, pkt->target, loop_id);
	}

	/* Issue command to ISP */
	qla2x00_isp_cmd(ha);

	return (QLA_SUCCESS);
}
示例#2
0
/**
 * qla2x00_marker() - Send a marker IOCB to the firmware.
 * @ha: HA context
 * @loop_id: loop ID
 * @lun: LUN
 * @type: marker modifier
 *
 * Can be called from both normal and interrupt context.
 *
 * Returns non-zero if a failure occured, else zero.
 */
int
__qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
                 uint8_t type)
{
    mrk_entry_t *mrk;
    struct mrk_entry_24xx *mrk24;

    mrk24 = NULL;
    mrk = (mrk_entry_t *)qla2x00_req_pkt(ha);
    if (mrk == NULL) {
        DEBUG2_3(printk("%s(%ld): failed to allocate Marker IOCB.\n",
                        __func__, ha->host_no));

        return (QLA_FUNCTION_FAILED);
    }

    mrk->entry_type = MARKER_TYPE;
    mrk->modifier = type;
    if (type != MK_SYNC_ALL) {
        if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
            mrk24 = (struct mrk_entry_24xx *) mrk;
            mrk24->nport_handle = cpu_to_le16(loop_id);
            mrk24->lun[1] = LSB(lun);
            mrk24->lun[2] = MSB(lun);
        } else {
            SET_TARGET_ID(ha, mrk->target, loop_id);
            mrk->lun = cpu_to_le16(lun);
        }
    }
    wmb();

    qla2x00_isp_cmd(ha);

    return (QLA_SUCCESS);
}