diff options
Diffstat (limited to 'usr/src/cmd/pcitool/pcitool.c')
| -rw-r--r-- | usr/src/cmd/pcitool/pcitool.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr/src/cmd/pcitool/pcitool.c b/usr/src/cmd/pcitool/pcitool.c index 4f575eae08..951980ef4a 100644 --- a/usr/src/cmd/pcitool/pcitool.c +++ b/usr/src/cmd/pcitool/pcitool.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. */ /* This file is the main module for the pcitool. */ @@ -476,7 +475,7 @@ supports_ari(int fd, uint8_t bus_no) cfg_prg.func_no = func_no; cfg_prg.barnum = 0; cfg_prg.user_version = PCITOOL_VERSION; - cfg_prg.offset = PCI_CONF_COMM; + cfg_prg.offset = 0; cfg_prg.acc_attr = PCITOOL_ACC_ATTR_SIZE_4 + PCITOOL_ACC_ATTR_ENDN_LTL; if (ioctl(fd, PCITOOL_DEVICE_GET_REG, &cfg_prg) != SUCCESS) { @@ -484,7 +483,15 @@ supports_ari(int fd, uint8_t bus_no) } data = (uint32_t)cfg_prg.data; + if (data == (uint32_t)(-1)) + return (FAILURE); + cfg_prg.offset = PCI_CONF_COMM; + if (ioctl(fd, PCITOOL_DEVICE_GET_REG, &cfg_prg) != SUCCESS) { + return (FAILURE); + } + + data = (uint32_t)cfg_prg.data; if (!((data >> 16) & PCI_STAT_CAP)) return (FAILURE); |
