summaryrefslogtreecommitdiffstats
path: root/sys/dev/isp/isp_pci.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2012-06-24 17:30:54 +0000
committermjacob <mjacob@FreeBSD.org>2012-06-24 17:30:54 +0000
commit68a46062835d8cff534b97849a134394a6df542a (patch)
tree9b2d12d0e861dfab4afb3ba4106f5c26ac04c40e /sys/dev/isp/isp_pci.c
parent422f597a3781b5c11964434772a491493b9ea5a8 (diff)
downloadFreeBSD-src-68a46062835d8cff534b97849a134394a6df542a.zip
FreeBSD-src-68a46062835d8cff534b97849a134394a6df542a.tar.gz
Clean up multi-id mode so it's driven by the f/w loaded,
not by some hint setting. Do more preparations for FC-Tape. Clean up resource counting for 24XX or later chipsets so we find out after EXEC_FIRMWARE what is actually supported. Set target mode exchange count based upon whether or not we are supporting simultaneous target/initiator mode. Clean up some old (pre-24XX) xfwoption and zfwoption issues. Sponsored by: Spectralogic MFC after: 3 days
Diffstat (limited to 'sys/dev/isp/isp_pci.c')
-rw-r--r--sys/dev/isp/isp_pci.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sys/dev/isp/isp_pci.c b/sys/dev/isp/isp_pci.c
index 1dc12ee..7a852cb 100644
--- a/sys/dev/isp/isp_pci.c
+++ b/sys/dev/isp/isp_pci.c
@@ -374,6 +374,7 @@ static devclass_t isp_devclass;
DRIVER_MODULE(isp, pci, isp_pci_driver, isp_devclass, 0, 0);
MODULE_DEPEND(isp, cam, 1, 1, 1);
MODULE_DEPEND(isp, firmware, 1, 1, 1);
+static int isp_nvports = 0;
static int
isp_pci_probe(device_t dev)
@@ -451,7 +452,7 @@ isp_pci_probe(device_t dev)
}
static void
-isp_get_generic_options(device_t dev, ispsoftc_t *isp, int *nvp)
+isp_get_generic_options(device_t dev, ispsoftc_t *isp)
{
int tval;
@@ -483,12 +484,10 @@ isp_get_generic_options(device_t dev, ispsoftc_t *isp, int *nvp)
if (bootverbose) {
isp->isp_dblev |= ISP_LOGCONFIG|ISP_LOGINFO;
}
- tval = 0;
+ tval = -1;
(void) resource_int_value(device_get_name(dev), device_get_unit(dev), "vports", &tval);
if (tval > 0 && tval < 127) {
- *nvp = tval;
- } else {
- *nvp = 0;
+ isp_nvports = tval;
}
tval = 1;
(void) resource_int_value(device_get_name(dev), device_get_unit(dev), "autoconfig", &tval);
@@ -527,7 +526,7 @@ static void
isp_get_specific_options(device_t dev, int chan, ispsoftc_t *isp)
{
const char *sptr;
- int tval;
+ int tval = 0;
if (resource_int_value(device_get_name(dev), device_get_unit(dev), "iid", &tval)) {
if (IS_FC(isp)) {
@@ -648,7 +647,6 @@ static int
isp_pci_attach(device_t dev)
{
int i, m1, m2, locksetup = 0;
- int isp_nvports = 0;
uint32_t data, cmd, linesz, did;
struct isp_pcisoftc *pcs;
ispsoftc_t *isp;
@@ -670,7 +668,8 @@ isp_pci_attach(device_t dev)
/*
* Get Generic Options
*/
- isp_get_generic_options(dev, isp, &isp_nvports);
+ isp_nvports = 0;
+ isp_get_generic_options(dev, isp);
/*
* Check to see if options have us disabled
@@ -876,21 +875,16 @@ isp_pci_attach(device_t dev)
/*
* Make sure that SERR, PERR, WRITE INVALIDATE and BUSMASTER are set.
*/
- cmd |= PCIM_CMD_SEREN | PCIM_CMD_PERRESPEN |
- PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN;
-
+ cmd |= PCIM_CMD_SEREN | PCIM_CMD_PERRESPEN | PCIM_CMD_BUSMASTEREN | PCIM_CMD_INVEN;
if (IS_2300(isp)) { /* per QLogic errata */
cmd &= ~PCIM_CMD_INVEN;
}
-
if (IS_2322(isp) || pci_get_devid(dev) == PCI_QLOGIC_ISP6312) {
cmd &= ~PCIM_CMD_INTX_DISABLE;
}
-
if (IS_24XX(isp)) {
cmd &= ~PCIM_CMD_INTX_DISABLE;
}
-
pci_write_config(dev, PCIR_COMMAND, cmd, 2);
/*
OpenPOWER on IntegriCloud