diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-07-16 06:05:44 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-07-16 06:05:44 +0000 |
commit | 7841889a36f38eb91594ec6be24d7575d57b69e8 (patch) | |
tree | 0b36f99a66286a2bfa41e5e1ce04de3b6d601343 /sys/dev | |
parent | cada3266ec712ab3cbcbace9df32a3924b21c31f (diff) | |
download | FreeBSD-src-7841889a36f38eb91594ec6be24d7575d57b69e8.zip FreeBSD-src-7841889a36f38eb91594ec6be24d7575d57b69e8.tar.gz |
Add sysctl information about things like WWNN/WWPN.
MFC after: 2 weeks
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/mpt/mpt.h | 14 | ||||
-rw-r--r-- | sys/dev/mpt/mpt_cam.c | 26 |
2 files changed, 40 insertions, 0 deletions
diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h index 910305b..48fa2a8 100644 --- a/sys/dev/mpt/mpt.h +++ b/sys/dev/mpt/mpt.h @@ -560,6 +560,20 @@ struct mpt_softc { #define mpt_fcport_speed cfg.fc._port_speed } fc; } cfg; +#if __FreeBSD_version >= 500000 + /* + * Device config information stored up for sysctl to access + */ + union { + struct { + unsigned int initiator_id; + } spi; + struct { + char wwnn[19]; + char wwpn[19]; + } fc; + } scinfo; +#endif /* Controller Info for RAID information */ CONFIG_PAGE_IOC_2 * ioc_page2; diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index f7f6c8d..4762edb 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -105,6 +105,8 @@ __FBSDID("$FreeBSD$"); #include "dev/mpt/mpilib/mpi_targ.h" #include "dev/mpt/mpilib/mpi_fc.h" +#include <sys/sysctl.h> + #include <sys/callout.h> #include <sys/kthread.h> @@ -424,7 +426,31 @@ mpt_read_config_info_fc(struct mpt_softc *mpt) mpt->mpt_fcport_page0.WWPN.High, mpt->mpt_fcport_page0.WWPN.Low, mpt->mpt_fcport_speed); +#if __FreeBSD_version >= 500000 + { + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev); + struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev); + + snprintf(mpt->scinfo.fc.wwnn, + sizeof (mpt->scinfo.fc.wwnn), "0x%08x%08x", + mpt->mpt_fcport_page0.WWNN.High, + mpt->mpt_fcport_page0.WWNN.Low); + + snprintf(mpt->scinfo.fc.wwpn, + sizeof (mpt->scinfo.fc.wwpn), "0x%08x%08x", + mpt->mpt_fcport_page0.WWPN.High, + mpt->mpt_fcport_page0.WWPN.Low); + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwnn", CTLFLAG_RD, mpt->scinfo.fc.wwnn, 0, + "World Wide Node Name"); + + SYSCTL_ADD_STRING(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "wwpn", CTLFLAG_RD, mpt->scinfo.fc.wwpn, 0, + "World Wide Port Name"); + + } +#endif return (0); } |