Commit a69de507 authored by Eric Moore's avatar Eric Moore Committed by James Bottomley

[SCSI] mpt fusion: rename vdev to vdevice

common naming of vdevice through out driver
Signed-off-by: default avatarEric Moore <Eric.Moore@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8d6d83e9
...@@ -1175,7 +1175,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) ...@@ -1175,7 +1175,7 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
int cim_rev; int cim_rev;
u8 revision; u8 revision;
struct scsi_device *sdev; struct scsi_device *sdev;
VirtDevice *vdev; VirtDevice *vdevice;
/* Add of PCI INFO results in unaligned access for /* Add of PCI INFO results in unaligned access for
* IA64 and Sparc. Reset long to int. Return no PCI * IA64 and Sparc. Reset long to int. Return no PCI
...@@ -1270,8 +1270,8 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) ...@@ -1270,8 +1270,8 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
karg->numDevices = 0; karg->numDevices = 0;
if (ioc->sh) { if (ioc->sh) {
shost_for_each_device(sdev, ioc->sh) { shost_for_each_device(sdev, ioc->sh) {
vdev = sdev->hostdata; vdevice = sdev->hostdata;
if (vdev->vtarget->tflags & if (vdevice->vtarget->tflags &
MPT_TARGET_FLAGS_RAID_COMPONENT) MPT_TARGET_FLAGS_RAID_COMPONENT)
continue; continue;
karg->numDevices++; karg->numDevices++;
...@@ -1322,7 +1322,7 @@ mptctl_gettargetinfo (unsigned long arg) ...@@ -1322,7 +1322,7 @@ mptctl_gettargetinfo (unsigned long arg)
struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg; struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg;
struct mpt_ioctl_targetinfo karg; struct mpt_ioctl_targetinfo karg;
MPT_ADAPTER *ioc; MPT_ADAPTER *ioc;
VirtDevice *vdev; VirtDevice *vdevice;
char *pmem; char *pmem;
int *pdata; int *pdata;
int iocnum; int iocnum;
...@@ -1391,13 +1391,13 @@ mptctl_gettargetinfo (unsigned long arg) ...@@ -1391,13 +1391,13 @@ mptctl_gettargetinfo (unsigned long arg)
shost_for_each_device(sdev, ioc->sh) { shost_for_each_device(sdev, ioc->sh) {
if (!maxWordsLeft) if (!maxWordsLeft)
continue; continue;
vdev = sdev->hostdata; vdevice = sdev->hostdata;
if (vdev->vtarget->tflags & if (vdevice->vtarget->tflags &
MPT_TARGET_FLAGS_RAID_COMPONENT) MPT_TARGET_FLAGS_RAID_COMPONENT)
continue; continue;
lun = (vdev->vtarget->raidVolume) ? 0x80 : vdev->lun; lun = (vdevice->vtarget->raidVolume) ? 0x80 : vdevice->lun;
*pdata = (((u8)lun << 16) + (vdev->vtarget->channel << 8) + *pdata = (((u8)lun << 16) + (vdevice->vtarget->channel << 8) +
(vdev->vtarget->id )); (vdevice->vtarget->id ));
pdata++; pdata++;
numDevices++; numDevices++;
--maxWordsLeft; --maxWordsLeft;
......
...@@ -213,7 +213,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, ...@@ -213,7 +213,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) { if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) {
dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT
"%s.%d: %d:%d, failing recovery, " "%s.%d: %d:%d, failing recovery, "
"port state %d, vdev %p.\n", caller, "port state %d, vdevice %p.\n", caller,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
SCpnt->device->id, SCpnt->device->lun, ready, SCpnt->device->id, SCpnt->device->lun, ready,
...@@ -470,7 +470,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) ...@@ -470,7 +470,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
/* /*
* if already mapped, remap here. If not mapped, * if already mapped, remap here. If not mapped,
* target_alloc will allocate vtarget and map, * target_alloc will allocate vtarget and map,
* slave_alloc will fill in vdev from vtarget. * slave_alloc will fill in vdevice from vtarget.
*/ */
if (ri->starget) { if (ri->starget) {
vtarget = ri->starget->hostdata; vtarget = ri->starget->hostdata;
...@@ -602,7 +602,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) ...@@ -602,7 +602,7 @@ mptfc_slave_alloc(struct scsi_device *sdev)
{ {
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
VirtTarget *vtarget; VirtTarget *vtarget;
VirtDevice *vdev; VirtDevice *vdevice;
struct scsi_target *starget; struct scsi_target *starget;
struct fc_rport *rport; struct fc_rport *rport;
...@@ -615,15 +615,15 @@ mptfc_slave_alloc(struct scsi_device *sdev) ...@@ -615,15 +615,15 @@ mptfc_slave_alloc(struct scsi_device *sdev)
hd = (MPT_SCSI_HOST *)sdev->host->hostdata; hd = (MPT_SCSI_HOST *)sdev->host->hostdata;
vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
if (!vdev) { if (!vdevice) {
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
hd->ioc->name, sizeof(VirtDevice)); hd->ioc->name, sizeof(VirtDevice));
return -ENOMEM; return -ENOMEM;
} }
sdev->hostdata = vdev; sdev->hostdata = vdevice;
vtarget = starget->hostdata; vtarget = starget->hostdata;
if (vtarget->num_luns == 0) { if (vtarget->num_luns == 0) {
...@@ -631,8 +631,8 @@ mptfc_slave_alloc(struct scsi_device *sdev) ...@@ -631,8 +631,8 @@ mptfc_slave_alloc(struct scsi_device *sdev)
vtarget->tflags = MPT_TARGET_FLAGS_Q_YES; vtarget->tflags = MPT_TARGET_FLAGS_Q_YES;
} }
vdev->vtarget = vtarget; vdevice->vtarget = vtarget;
vdev->lun = sdev->lun; vdevice->lun = sdev->lun;
vtarget->num_luns++; vtarget->num_luns++;
...@@ -648,9 +648,9 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) ...@@ -648,9 +648,9 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
struct mptfc_rport_info *ri; struct mptfc_rport_info *ri;
struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
int err; int err;
VirtDevice *vdev = SCpnt->device->hostdata; VirtDevice *vdevice = SCpnt->device->hostdata;
if (!vdev || !vdev->vtarget) { if (!vdevice || !vdevice->vtarget) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); done(SCpnt);
return 0; return 0;
......
...@@ -506,15 +506,15 @@ static VirtTarget * ...@@ -506,15 +506,15 @@ static VirtTarget *
mptsas_find_vtarget(MPT_ADAPTER *ioc, u8 channel, u8 id) mptsas_find_vtarget(MPT_ADAPTER *ioc, u8 channel, u8 id)
{ {
struct scsi_device *sdev; struct scsi_device *sdev;
VirtDevice *vdev; VirtDevice *vdevice;
VirtTarget *vtarget = NULL; VirtTarget *vtarget = NULL;
shost_for_each_device(sdev, ioc->sh) { shost_for_each_device(sdev, ioc->sh) {
if ((vdev = sdev->hostdata) == NULL) if ((vdevice = sdev->hostdata) == NULL)
continue; continue;
if (vdev->vtarget->id == id && if (vdevice->vtarget->id == id &&
vdev->vtarget->channel == channel) vdevice->vtarget->channel == channel)
vtarget = vdev->vtarget; vtarget = vdevice->vtarget;
} }
return vtarget; return vtarget;
} }
...@@ -943,18 +943,18 @@ mptsas_slave_alloc(struct scsi_device *sdev) ...@@ -943,18 +943,18 @@ mptsas_slave_alloc(struct scsi_device *sdev)
MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
struct sas_rphy *rphy; struct sas_rphy *rphy;
struct mptsas_portinfo *p; struct mptsas_portinfo *p;
VirtDevice *vdev; VirtDevice *vdevice;
struct scsi_target *starget; struct scsi_target *starget;
int i; int i;
vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
if (!vdev) { if (!vdevice) {
printk(MYIOC_s_ERR_FMT "slave_alloc kzalloc(%zd) FAILED!\n", printk(MYIOC_s_ERR_FMT "slave_alloc kzalloc(%zd) FAILED!\n",
hd->ioc->name, sizeof(VirtDevice)); hd->ioc->name, sizeof(VirtDevice));
return -ENOMEM; return -ENOMEM;
} }
starget = scsi_target(sdev); starget = scsi_target(sdev);
vdev->vtarget = starget->hostdata; vdevice->vtarget = starget->hostdata;
if (sdev->channel == MPTSAS_RAID_CHANNEL) if (sdev->channel == MPTSAS_RAID_CHANNEL)
goto out; goto out;
...@@ -966,7 +966,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) ...@@ -966,7 +966,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
if (p->phy_info[i].attached.sas_address != if (p->phy_info[i].attached.sas_address !=
rphy->identify.sas_address) rphy->identify.sas_address)
continue; continue;
vdev->lun = sdev->lun; vdevice->lun = sdev->lun;
/* /*
* Exposing hidden raid components * Exposing hidden raid components
*/ */
...@@ -980,21 +980,21 @@ mptsas_slave_alloc(struct scsi_device *sdev) ...@@ -980,21 +980,21 @@ mptsas_slave_alloc(struct scsi_device *sdev)
} }
mutex_unlock(&hd->ioc->sas_topology_mutex); mutex_unlock(&hd->ioc->sas_topology_mutex);
kfree(vdev); kfree(vdevice);
return -ENXIO; return -ENXIO;
out: out:
vdev->vtarget->num_luns++; vdevice->vtarget->num_luns++;
sdev->hostdata = vdev; sdev->hostdata = vdevice;
return 0; return 0;
} }
static int static int
mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) mptsas_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{ {
VirtDevice *vdev = SCpnt->device->hostdata; VirtDevice *vdevice = SCpnt->device->hostdata;
if (!vdev || !vdev->vtarget || vdev->vtarget->deleted) { if (!vdevice || !vdevice->vtarget || vdevice->vtarget->deleted) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); done(SCpnt);
return 0; return 0;
......
...@@ -644,7 +644,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -644,7 +644,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
SCSIIORequest_t *pScsiReq; SCSIIORequest_t *pScsiReq;
SCSIIOReply_t *pScsiReply; SCSIIOReply_t *pScsiReply;
u16 req_idx, req_idx_MR; u16 req_idx, req_idx_MR;
VirtDevice *vdev; VirtDevice *vdevice;
VirtTarget *vtarget; VirtTarget *vtarget;
hd = (MPT_SCSI_HOST *) ioc->sh->hostdata; hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
...@@ -770,10 +770,10 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) ...@@ -770,10 +770,10 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF) if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF)
hd->sel_timeout[pScsiReq->TargetID]++; hd->sel_timeout[pScsiReq->TargetID]++;
vdev = sc->device->hostdata; vdevice = sc->device->hostdata;
if (!vdev) if (!vdevice)
break; break;
vtarget = vdev->vtarget; vtarget = vdevice->vtarget;
if (vtarget->tflags & MPT_TARGET_FLAGS_LED_ON) { if (vtarget->tflags & MPT_TARGET_FLAGS_LED_ON) {
mptscsih_issue_sep_command(ioc, vtarget, mptscsih_issue_sep_command(ioc, vtarget,
MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED); MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED);
...@@ -1359,7 +1359,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) ...@@ -1359,7 +1359,7 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
MPT_FRAME_HDR *mf; MPT_FRAME_HDR *mf;
SCSIIORequest_t *pScsiReq; SCSIIORequest_t *pScsiReq;
VirtDevice *vdev = SCpnt->device->hostdata; VirtDevice *vdevice = SCpnt->device->hostdata;
int lun; int lun;
u32 datalen; u32 datalen;
u32 scsictl; u32 scsictl;
...@@ -1416,8 +1416,8 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) ...@@ -1416,8 +1416,8 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
/* Default to untagged. Once a target structure has been allocated, /* Default to untagged. Once a target structure has been allocated,
* use the Inquiry data to determine if device supports tagged. * use the Inquiry data to determine if device supports tagged.
*/ */
if (vdev if (vdevice
&& (vdev->vtarget->tflags & MPT_TARGET_FLAGS_Q_YES) && (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_Q_YES)
&& (SCpnt->device->tagged_supported)) { && (SCpnt->device->tagged_supported)) {
scsictl = scsidir | MPI_SCSIIO_CONTROL_SIMPLEQ; scsictl = scsidir | MPI_SCSIIO_CONTROL_SIMPLEQ;
} else { } else {
...@@ -1426,10 +1426,10 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) ...@@ -1426,10 +1426,10 @@ mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
/* Use the above information to set up the message frame /* Use the above information to set up the message frame
*/ */
pScsiReq->TargetID = (u8) vdev->vtarget->id; pScsiReq->TargetID = (u8) vdevice->vtarget->id;
pScsiReq->Bus = vdev->vtarget->channel; pScsiReq->Bus = vdevice->vtarget->channel;
pScsiReq->ChainOffset = 0; pScsiReq->ChainOffset = 0;
if (vdev->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT)
pScsiReq->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH; pScsiReq->Function = MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH;
else else
pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST; pScsiReq->Function = MPI_FUNCTION_SCSI_IO_REQUEST;
...@@ -1968,7 +1968,7 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) ...@@ -1968,7 +1968,7 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
{ {
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
int retval; int retval;
VirtDevice *vdev; VirtDevice *vdevice;
MPT_ADAPTER *ioc; MPT_ADAPTER *ioc;
/* If we can't locate our host adapter structure, return FAILED status. /* If we can't locate our host adapter structure, return FAILED status.
...@@ -1987,9 +1987,9 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt) ...@@ -1987,9 +1987,9 @@ mptscsih_bus_reset(struct scsi_cmnd * SCpnt)
if (hd->timeouts < -1) if (hd->timeouts < -1)
hd->timeouts++; hd->timeouts++;
vdev = SCpnt->device->hostdata; vdevice = SCpnt->device->hostdata;
retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS, retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS,
vdev->vtarget->channel, 0, 0, 0, mptscsih_get_tm_timeout(ioc)); vdevice->vtarget->channel, 0, 0, 0, mptscsih_get_tm_timeout(ioc));
printk(MYIOC_s_INFO_FMT "bus reset: %s (sc=%p)\n", printk(MYIOC_s_INFO_FMT "bus reset: %s (sc=%p)\n",
ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt);
...@@ -2503,14 +2503,14 @@ slave_configure_exit: ...@@ -2503,14 +2503,14 @@ slave_configure_exit:
static void static void
mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply) mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply)
{ {
VirtDevice *vdev; VirtDevice *vdevice;
SCSIIORequest_t *pReq; SCSIIORequest_t *pReq;
u32 sense_count = le32_to_cpu(pScsiReply->SenseCount); u32 sense_count = le32_to_cpu(pScsiReply->SenseCount);
/* Get target structure /* Get target structure
*/ */
pReq = (SCSIIORequest_t *) mf; pReq = (SCSIIORequest_t *) mf;
vdev = sc->device->hostdata; vdevice = sc->device->hostdata;
if (sense_count) { if (sense_count) {
u8 *sense_data; u8 *sense_data;
...@@ -2524,7 +2524,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR ...@@ -2524,7 +2524,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
/* Log SMART data (asc = 0x5D, non-IM case only) if required. /* Log SMART data (asc = 0x5D, non-IM case only) if required.
*/ */
if ((hd->ioc->events) && (hd->ioc->eventTypes & (1 << MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE))) { if ((hd->ioc->events) && (hd->ioc->eventTypes & (1 << MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE))) {
if ((sense_data[12] == 0x5D) && (vdev->vtarget->raidVolume == 0)) { if ((sense_data[12] == 0x5D) && (vdevice->vtarget->raidVolume == 0)) {
int idx; int idx;
MPT_ADAPTER *ioc = hd->ioc; MPT_ADAPTER *ioc = hd->ioc;
...@@ -2542,8 +2542,8 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR ...@@ -2542,8 +2542,8 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
if (hd->ioc->pcidev->vendor == if (hd->ioc->pcidev->vendor ==
PCI_VENDOR_ID_IBM) { PCI_VENDOR_ID_IBM) {
mptscsih_issue_sep_command(hd->ioc, mptscsih_issue_sep_command(hd->ioc,
vdev->vtarget, MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT); vdevice->vtarget, MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT);
vdev->vtarget->tflags |= vdevice->vtarget->tflags |=
MPT_TARGET_FLAGS_LED_ON; MPT_TARGET_FLAGS_LED_ON;
} }
} }
......
...@@ -698,26 +698,26 @@ static int mptspi_slave_alloc(struct scsi_device *sdev) ...@@ -698,26 +698,26 @@ static int mptspi_slave_alloc(struct scsi_device *sdev)
{ {
MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)sdev->host->hostdata; MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)sdev->host->hostdata;
VirtTarget *vtarget; VirtTarget *vtarget;
VirtDevice *vdev; VirtDevice *vdevice;
struct scsi_target *starget; struct scsi_target *starget;
if (sdev->channel == 1 && if (sdev->channel == 1 &&
mptscsih_is_phys_disk(hd->ioc, 0, sdev->id) == 0) mptscsih_is_phys_disk(hd->ioc, 0, sdev->id) == 0)
return -ENXIO; return -ENXIO;
vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
if (!vdev) { if (!vdevice) {
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
hd->ioc->name, sizeof(VirtDevice)); hd->ioc->name, sizeof(VirtDevice));
return -ENOMEM; return -ENOMEM;
} }
vdev->lun = sdev->lun; vdevice->lun = sdev->lun;
sdev->hostdata = vdev; sdev->hostdata = vdevice;
starget = scsi_target(sdev); starget = scsi_target(sdev);
vtarget = starget->hostdata; vtarget = starget->hostdata;
vdev->vtarget = vtarget; vdevice->vtarget = vtarget;
vtarget->num_luns++; vtarget->num_luns++;
if (sdev->channel == 1) if (sdev->channel == 1)
...@@ -758,9 +758,9 @@ static int ...@@ -758,9 +758,9 @@ static int
mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
{ {
struct _MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata; struct _MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata;
VirtDevice *vdev = SCpnt->device->hostdata; VirtDevice *vdevice = SCpnt->device->hostdata;
if (!vdev || !vdev->vtarget) { if (!vdevice || !vdevice->vtarget) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); done(SCpnt);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment