Add a mpt_is_raid_volume function which will tell you whether

the passed target id is one of the RAID VolumeID. This result
is used to decide whether to try and do actual SPI negotiations
on the real side of the raid/passthru bus pair. The reason we
check this is that we can have both RAID volumes and real devices
on the same bus.
This commit is contained in:
Matt Jacob 2006-05-29 20:20:45 +00:00
parent ac219b98bd
commit a0e4c26aae
2 changed files with 20 additions and 2 deletions

View File

@ -226,7 +226,7 @@ mpt_raid_async(void *callback_arg, u_int32_t code,
break;
}
mpt_lprt(mpt, MPT_PRT_DEBUG, " Callback for %d\n",
mpt_lprt(mpt, MPT_PRT_DEBUG, "Callback for %d\n",
cgd->ccb_h.target_id);
RAID_VOL_FOREACH(mpt, mpt_vol) {
@ -779,11 +779,28 @@ mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, u_int *tgt)
*tgt = mpt_disk->config_page.PhysDiskID;
return (0);
}
mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_map_physdisk(%d) - Not Active\n",
mpt_lprt(mpt, MPT_PRT_DEBUG1, "mpt_map_physdisk(%d) - Not Active\n",
ccb->ccb_h.target_id);
return (-1);
}
/* XXX Ignores that there may be multiple busses/IOCs involved. */
int
mpt_is_raid_volume(struct mpt_softc *mpt, int tgt)
{
CONFIG_PAGE_IOC_2_RAID_VOL *ioc_vol;
CONFIG_PAGE_IOC_2_RAID_VOL *ioc_last_vol;
ioc_vol = mpt->ioc_page2->RaidVolume;
ioc_last_vol = ioc_vol + mpt->ioc_page2->NumActiveVolumes;
for (;ioc_vol != ioc_last_vol; ioc_vol++) {
if (ioc_vol->VolumeID == tgt) {
return (1);
}
}
return (0);
}
#if 0
static void
mpt_enable_vol(struct mpt_softc *mpt, struct mpt_raid_volume *mpt_vol,

View File

@ -60,6 +60,7 @@ mpt_issue_raid_req(struct mpt_softc *, struct mpt_raid_volume *,
cam_status
mpt_map_physdisk(struct mpt_softc *, union ccb *, target_id_t *);
int mpt_is_raid_volume(struct mpt_softc *, int);
cam_status
mpt_raid_quiesce_disk(struct mpt_softc *, struct mpt_raid_disk *, request_t *);