diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-07-25 00:59:54 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-07-25 00:59:54 +0000 |
commit | dd7156e6854b14431bf8613e75c524688d25e058 (patch) | |
tree | 24a0b7419686392b7d5cb4ac839ffbd3d743e506 /sys/dev | |
parent | 35c8368f4e46783fcce1459c7ddd38addbb600f2 (diff) | |
download | FreeBSD-src-dd7156e6854b14431bf8613e75c524688d25e058.zip FreeBSD-src-dd7156e6854b14431bf8613e75c524688d25e058.tar.gz |
When probing to attach the CAM functionality, check against
desired role configuration instead of existing role. This gets
us out of the mess where we configured a role of NONE (or were
LAN only, for example), but didn't continue to attach the CAM
module (because we had neither initiator nor target role
set). Unfortunately, the code that rewrites NVRAM to match
actual to desired role only works if the CAM module attaches.
MFC after: 2 weeks
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/mpt/mpt_cam.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index 4762edb..c460b28 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -181,13 +181,20 @@ DECLARE_MPT_PERSONALITY(mpt_cam, SI_ORDER_SECOND); int mpt_cam_probe(struct mpt_softc *mpt) { + int role; + /* - * Only attach to nodes that support the initiator or target - * role or have RAID physical devices that need CAM pass-thru support. + * Only attach to nodes that support the initiator or target role + * (or want to) or have RAID physical devices that need CAM pass-thru + * support. */ - if ((mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_INITIATOR) != 0 - || (mpt->mpt_proto_flags & MPI_PORTFACTS_PROTOCOL_TARGET) != 0 - || (mpt->ioc_page2 != NULL && mpt->ioc_page2->MaxPhysDisks != 0)) { + if (mpt->do_cfg_role) { + role = mpt->cfg_role; + } else { + role = mpt->role; + } + if ((role & (MPT_ROLE_TARGET|MPT_ROLE_INITIATOR)) != 0 || + (mpt->ioc_page2 != NULL && mpt->ioc_page2->MaxPhysDisks != 0)) { return (0); } return (ENODEV); @@ -355,6 +362,7 @@ mpt_cam_attach(struct mpt_softc *mpt) goto cleanup; } CAMLOCK_2_MPTLOCK(mpt); + mpt_lprt(mpt, MPT_PRT_DEBUG, "attached cam\n"); return (0); cleanup: |