Files
@ bd21c8aa7237
Branch filter:
Location: vmkdrivers/vmkdrivers/src_9/drivers/scsi/qla4xxx/ql4_inline.h - annotation
bd21c8aa7237
4.3 KiB
text/x-chdr
ESXi-6.0.0b
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 763922b5834e 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 0d186246d211 91e0d39c9812 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd 95e39e5412bd | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2006 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#if defined(__VMKLNX__)
#include <vmklinux_9/vmklinux_scsi.h>
#endif
static inline struct ddb_entry *
qla4xxx_lookup_ddb_by_os_index(struct scsi_qla_host *ha, int os_idx)
{
struct ddb_entry *ddb_entry = NULL;
struct ddb_entry *detemp;
int found = 0;
list_for_each_entry_safe(ddb_entry, detemp, &ha->ddb_list, list) {
if (ddb_entry->os_target_id == os_idx) {
found = 1;
break;
}
}
if (!found)
ddb_entry = NULL;
DEBUG3(printk("scsi%d: %s: ddb[%d], ddb_entry = %p\n",
ha->host_no, __func__, fw_ddb_index, ddb_entry));
return ddb_entry;
}
/**
* qla4xxx_queue_aen_log - queue AENs to be reported to application layer
* @ha: Pointer to host adapter structure.
* @mbox_sts: Pointer to mailbox status structure.
*
* Store AENs to be reported to the application layer when requested
**/
static inline void
qla4xxx_queue_aen_log(struct scsi_qla_host *ha, uint32_t *mbox_sts)
{
int i;
if (ha->aen_log.count < MAX_AEN_ENTRIES) {
for (i = 0; i < MBOX_AEN_REG_COUNT; i++)
ha->aen_log.entry[ha->aen_log.count].mbox_sts[i] =
mbox_sts[i];
ha->aen_log.count++;
}
}
static inline void qla4xxx_queue_lun_change_aen(struct scsi_qla_host *ha,
uint32_t index)
{
uint32_t mbox_sts[MBOX_REG_COUNT];
memset(mbox_sts, 0, sizeof(mbox_sts));
mbox_sts[0] = MBOX_DRVR_ASTS_LUN_STATUS_CHANGE;
mbox_sts[1] = index;
qla4xxx_queue_aen_log(ha, &mbox_sts[0]);
DEBUG4(printk("scsi%d: %s: AEN 0x7003 index[%d]\n",
ha->host_no, __func__, index));
}
/*
*
* qla4xxx_lookup_ddb_by_fw_index
* This routine locates a device handle given the firmware device
* database index. If device doesn't exist, returns NULL.
*
* Input:
* ha - Pointer to host adapter structure.
* fw_ddb_index - Firmware's device database index
*
* Returns:
* Pointer to the corresponding internal device database structure
*/
static inline struct ddb_entry *
qla4xxx_lookup_ddb_by_fw_index(struct scsi_qla_host *ha, uint32_t fw_ddb_index)
{
struct ddb_entry *ddb_entry = NULL;
if ((fw_ddb_index < MAX_DDB_ENTRIES) &&
(ha->fw_ddb_index_map[fw_ddb_index] != NULL)) {
ddb_entry = ha->fw_ddb_index_map[fw_ddb_index];
}
DEBUG3(printk("scsi%d: %s: index [%d], ddb_entry = %p\n",
ha->host_no, __func__, fw_ddb_index, ddb_entry));
return ddb_entry;
}
static inline void
__qla4xxx_enable_intrs(struct scsi_qla_host *ha)
{
if (is_qla4022(ha) | is_qla4032(ha)) {
writel(set_rmask(IMR_SCSI_INTR_ENABLE),
&ha->reg->u1.isp4022.intr_mask);
readl(&ha->reg->u1.isp4022.intr_mask);
} else {
writel(set_rmask(CSR_SCSI_INTR_ENABLE), &ha->reg->ctrl_status);
readl(&ha->reg->ctrl_status);
}
set_bit(AF_INTERRUPTS_ON, &ha->flags);
}
static inline void
__qla4xxx_disable_intrs(struct scsi_qla_host *ha)
{
if (is_qla4022(ha) | is_qla4032(ha)) {
writel(clr_rmask(IMR_SCSI_INTR_ENABLE),
&ha->reg->u1.isp4022.intr_mask);
readl(&ha->reg->u1.isp4022.intr_mask);
} else {
writel(clr_rmask(CSR_SCSI_INTR_ENABLE), &ha->reg->ctrl_status);
readl(&ha->reg->ctrl_status);
}
clear_bit(AF_INTERRUPTS_ON, &ha->flags);
}
static inline void
qla4xxx_enable_intrs(struct scsi_qla_host *ha)
{
unsigned long flags;
spin_lock_irqsave(&ha->hardware_lock, flags);
__qla4xxx_enable_intrs(ha);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
static inline void
qla4xxx_disable_intrs(struct scsi_qla_host *ha)
{
unsigned long flags;
spin_lock_irqsave(&ha->hardware_lock, flags);
__qla4xxx_disable_intrs(ha);
spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
#if defined(__VMKLNX__)
static inline void
qla4xxx_int_to_scsilun_with_sec_lun_id(uint16_t lun, struct scsi_lun *scsi_lun, uint64_t sllid)
{
if (sllid != VMKLNX_SCSI_INVALID_SECONDLEVEL_ID) {
memset(scsi_lun, 0, 8);
scsi_lun->scsi_lun[0] = (lun >> 8) & 0xFF;
scsi_lun->scsi_lun[1] = lun & 0xFF;
scsi_lun->scsi_lun[2] = (vmk_uint8)((sllid >> 56) & 0xFF); /* sllid msb */
scsi_lun->scsi_lun[3] = (vmk_uint8)((sllid >> 48) & 0xFF);
scsi_lun->scsi_lun[4] = (vmk_uint8)((sllid >> 40) & 0xFF);
scsi_lun->scsi_lun[5] = (vmk_uint8)((sllid >> 32) & 0xFF);
scsi_lun->scsi_lun[6] = (vmk_uint8)((sllid >> 24) & 0xFF);
scsi_lun->scsi_lun[7] = (vmk_uint8)((sllid >> 16) & 0xFF); /* sllid lsb */
} else {
int_to_scsilun(lun, scsi_lun);
}
}
#endif
|