diff options
| author | Robert Mustacchi <rm@joyent.com> | 2017-08-29 22:21:05 +0000 |
|---|---|---|
| committer | Robert Mustacchi <rm@joyent.com> | 2017-08-30 23:53:30 +0000 |
| commit | 630e04903d53ad768c332359548d2fa6d50bf572 (patch) | |
| tree | 561d7f6b5e4356045aebff12dc47df04a025b154 | |
| parent | 126e622822aadc11640fdd5b79bf407b3d72f132 (diff) | |
| download | illumos-joyent-630e04903d53ad768c332359548d2fa6d50bf572.tar.gz | |
OS-6316 Record AHCI controller enclosure properties
| -rw-r--r-- | usr/src/uts/common/io/sata/adapters/ahci/ahci.c | 11 | ||||
| -rw-r--r-- | usr/src/uts/common/sys/sata/adapters/ahci/ahcivar.h | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/usr/src/uts/common/io/sata/adapters/ahci/ahci.c b/usr/src/uts/common/io/sata/adapters/ahci/ahci.c index d9e083a10b..b741a5f632 100644 --- a/usr/src/uts/common/io/sata/adapters/ahci/ahci.c +++ b/usr/src/uts/common/io/sata/adapters/ahci/ahci.c @@ -22,6 +22,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2017, Joyent, Inc. */ /* @@ -714,6 +715,16 @@ ahci_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) "hba capabilities extended = 0x%x", cap2_status); } + if (cap_status & AHCI_HBA_CAP_EMS) { + ahci_ctlp->ahcictl_cap |= AHCI_CAP_EMS; + ahci_ctlp->ahcictl_em_loc = + ddi_get32(ahci_ctlp->ahcictl_ahci_acc_handle, + (uint32_t *)AHCI_GLOBAL_EM_LOC(ahci_ctlp)); + ahci_ctlp->ahcictl_em_ctl = + ddi_get32(ahci_ctlp->ahcictl_ahci_acc_handle, + (uint32_t *)AHCI_GLOBAL_EM_CTL(ahci_ctlp)); + } + #if AHCI_DEBUG /* Get the interface speed supported by the HBA */ speed = (cap_status & AHCI_HBA_CAP_ISS) >> AHCI_HBA_CAP_ISS_SHIFT; diff --git a/usr/src/uts/common/sys/sata/adapters/ahci/ahcivar.h b/usr/src/uts/common/sys/sata/adapters/ahci/ahcivar.h index 4e55863414..542b061fe2 100644 --- a/usr/src/uts/common/sys/sata/adapters/ahci/ahcivar.h +++ b/usr/src/uts/common/sys/sata/adapters/ahci/ahcivar.h @@ -22,6 +22,7 @@ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2017, Joyent, Inc. */ @@ -440,6 +441,12 @@ typedef struct ahci_ctl { /* FMA capabilities */ int ahcictl_fm_cap; + + /* + * Enclosure information + */ + uint32_t ahcictl_em_loc; + uint32_t ahcictl_em_ctl; } ahci_ctl_t; /* Warlock annotation */ @@ -492,6 +499,8 @@ _NOTE(MUTEX_PROTECTS_DATA(ahci_ctl_t::ahcictl_mutex, #define AHCI_CAP_PMULT_FBSS 0x400 /* Software Reset FIS cannot set pmport with 0xf for direct access device */ #define AHCI_CAP_SRST_NO_HOSTPORT 0x800 +/* Enclosure Management Services available */ +#define AHCI_CAP_EMS 0x1000 /* Flags controlling the restart port behavior */ #define AHCI_PORT_RESET 0x0001 /* Reset the port */ |
