diff options
author | marius <marius@FreeBSD.org> | 2010-05-03 18:39:40 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2010-05-03 18:39:40 +0000 |
commit | 801d761a223441f19bbdaabe1c327b4c37b619be (patch) | |
tree | ce7d587bddfd2812e1bbcb5a80331948cbc6521c /sys/dev/isp | |
parent | ba89ec54691d267a0696f1b817ec27de69cd28ef (diff) | |
download | FreeBSD-src-801d761a223441f19bbdaabe1c327b4c37b619be.zip FreeBSD-src-801d761a223441f19bbdaabe1c327b4c37b619be.tar.gz |
On sparc64 obtain the initiator ID from the Open Firmware device tree
in order to match what the PROM built-in driver uses.
Approved by: mjacob
Diffstat (limited to 'sys/dev/isp')
-rw-r--r-- | sys/dev/isp/isp_pci.c | 9 | ||||
-rw-r--r-- | sys/dev/isp/isp_sbus.c | 8 |
2 files changed, 12 insertions, 5 deletions
diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c index 8410ea6..e152e99 100644 --- a/sys/dev/isp/isp_pci.c +++ b/sys/dev/isp/isp_pci.c @@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$"); #include <sys/malloc.h> #include <sys/uio.h> +#ifdef __sparc64__ +#include <dev/ofw/openfirm.h> +#include <machine/ofw_machdep.h> +#endif + #include <dev/isp/isp_freebsd.h> static uint32_t isp_pci_rd_reg(ispsoftc_t *, int); @@ -517,7 +522,11 @@ isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp) if (IS_FC(isp)) { ISP_FC_PC(isp, chan)->default_id = 109 - chan; } else { +#ifdef __sparc64__ + ISP_SPI_PC(isp, chan)->iid = OF_getscsinitid(dev); +#else ISP_SPI_PC(isp, chan)->iid = 7; +#endif } } else { if (IS_FC(isp)) { diff --git a/sys/dev/isp/isp_sbus.c b/sys/dev/isp/isp_sbus.c index 895645a..34dcc09 100644 --- a/sys/dev/isp/isp_sbus.c +++ b/sys/dev/isp/isp_sbus.c @@ -41,8 +41,10 @@ __FBSDID("$FreeBSD$"); #include <sys/resource.h> #include <dev/ofw/ofw_bus.h> +#include <dev/ofw/openfirm.h> #include <machine/bus.h> +#include <machine/ofw_machdep.h> #include <machine/resource.h> #include <sys/rman.h> #include <sparc64/sbus/sbusvar.h> @@ -264,11 +266,7 @@ isp_sbus_attach(device_t dev) isp->isp_confopts |= ISP_CFG_OWNLOOPID; } if (default_id == -1) { - /* - * XXX: should be a way to get properties w/o having - * XXX: to call OF_xxx functions - */ - default_id = 7; + default_id = OF_getscsinitid(dev); } ISP_SPI_PC(isp, 0)->iid = default_id; |