summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2017-07-31 15:30:14 +0000
committerRobert Mustacchi <rm@joyent.com>2017-09-13 21:25:21 +0000
commit9094e8556e7c00d1961a4dbff4777f615669fba8 (patch)
tree4259b41c87a69c3b0a54e186e4bdf7577345af0d
parent16ee9a3d03358376b04be02470c63268cabf6bab (diff)
downloadillumos-joyent-9094e8556e7c00d1961a4dbff4777f615669fba8.tar.gz
OS-6324 Need support for LSI 9305-24i
Reviewed by: Dan McDonald <danmcd@joyent.com> Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com> Approved by: Joshua M. Clulow <jmc@joyent.com>
-rw-r--r--usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c15
-rw-r--r--usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c19
-rw-r--r--usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h8
3 files changed, 26 insertions, 16 deletions
diff --git a/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c b/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c
index ddb6e169b6..e10b1bf6c5 100644
--- a/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c
+++ b/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_impl.c
@@ -24,7 +24,7 @@
* Copyright 2012 Nexenta Systems, Inc. All rights reserved.
* Copyright 2014 OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
- * Copyright 2016 Joyent, Inc.
+ * Copyright (c) 2017, Joyent, Inc.
*/
/*
@@ -1944,12 +1944,23 @@ mptsas_get_sas_io_unit_page_hndshk(mptsas_t *mpt)
uint32_t readpage1 = 0, retrypage0 = 0;
uint16_t iocstatus;
uint8_t port_flags, page_number, action;
- uint32_t reply_size = 256; /* Big enough for any page */
+ uint32_t reply_size;
uint_t state;
int rval = DDI_FAILURE;
boolean_t free_recv = B_FALSE, free_page = B_FALSE;
/*
+ * We want to find a reply_size that's large enough for the page0 and
+ * page1 sizes and resistant to increase in the number of phys.
+ */
+ reply_size = MAX(page0_size, page1_size);
+ if (P2ROUNDUP(reply_size, 256) <= reply_size) {
+ mptsas_log(mpt, CE_WARN, "mptsas_get_sas_io_unit_page_hndsk: "
+ "cannot size reply size");
+ goto cleanup;
+ }
+
+ /*
* Initialize our "state machine". This is a bit convoluted,
* but it keeps us from having to do the ddi allocations numerous
* times.
diff --git a/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c b/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c
index 380a0c10a6..aaf5092322 100644
--- a/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c
+++ b/usr/src/uts/common/io/scsi/adapters/mpt_sas/mptsas_init.c
@@ -23,6 +23,7 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
+ * Copyright (c) 2017, Joyent, Inc.
*/
/*
@@ -165,7 +166,7 @@ mptsas_ioc_get_facts(mptsas_t *mpt)
static int
mptsas_ioc_do_get_facts(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
#ifndef __lock_lint
_NOTE(ARGUNUSED(var))
@@ -190,7 +191,7 @@ mptsas_ioc_do_get_facts(mptsas_t *mpt, caddr_t memp, int var,
static int
mptsas_ioc_do_get_facts_reply(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
#ifndef __lock_lint
_NOTE(ARGUNUSED(var))
@@ -306,7 +307,7 @@ mptsas_ioc_do_get_facts_reply(mptsas_t *mpt, caddr_t memp, int var,
* Set flag to check for SAS3 support.
*/
msgversion = ddi_get16(accessp, &factsreply->MsgVersion);
- if (msgversion == MPI2_VERSION_02_05) {
+ if (msgversion >= MPI2_VERSION_02_05) {
mptsas_log(mpt, CE_NOTE, "?mpt_sas%d SAS 3 Supported\n",
mpt->m_instance);
mpt->m_MPI25 = TRUE;
@@ -388,7 +389,7 @@ mptsas_ioc_get_port_facts(mptsas_t *mpt, int port)
static int
mptsas_ioc_do_get_port_facts(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
pMpi2PortFactsRequest_t facts;
int numbytes;
@@ -411,7 +412,7 @@ mptsas_ioc_do_get_port_facts(mptsas_t *mpt, caddr_t memp, int var,
static int
mptsas_ioc_do_get_port_facts_reply(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
#ifndef __lock_lint
_NOTE(ARGUNUSED(var))
@@ -465,7 +466,7 @@ mptsas_ioc_enable_port(mptsas_t *mpt)
static int
mptsas_ioc_do_enable_port(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
#ifndef __lock_lint
_NOTE(ARGUNUSED(var))
@@ -490,7 +491,7 @@ mptsas_ioc_do_enable_port(mptsas_t *mpt, caddr_t memp, int var,
static int
mptsas_ioc_do_enable_port_reply(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
#ifndef __lock_lint
_NOTE(ARGUNUSED(var))
@@ -547,7 +548,7 @@ mptsas_ioc_enable_event_notification(mptsas_t *mpt)
static int
mptsas_ioc_do_enable_event_notification(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
#ifndef __lock_lint
_NOTE(ARGUNUSED(var))
@@ -699,7 +700,7 @@ mptsas_do_ioc_init(mptsas_t *mpt, caddr_t memp, int var,
static int
mptsas_do_ioc_init_reply(mptsas_t *mpt, caddr_t memp, int var,
- ddi_acc_handle_t accessp)
+ ddi_acc_handle_t accessp)
{
#ifndef __lock_lint
_NOTE(ARGUNUSED(var))
diff --git a/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h b/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h
index bd77c1b8fa..d3d1785d2d 100644
--- a/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h
+++ b/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mptsas_var.h
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- * Copyright 2016 Joyent, Inc.
+ * Copyright (c) 2017, Joyent, Inc.
* Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
*/
@@ -79,15 +79,13 @@ extern "C" {
#define MPTSAS_INITIAL_SOFT_SPACE 4
-#define MAX_MPI_PORTS 16
-
/*
* Note below macro definition and data type definition
* are used for phy mask handling, it should be changed
* simultaneously.
*/
-#define MPTSAS_MAX_PHYS 16
-typedef uint16_t mptsas_phymask_t;
+#define MPTSAS_MAX_PHYS 24
+typedef uint32_t mptsas_phymask_t;
#define MPTSAS_INVALID_DEVHDL 0xffff
#define MPTSAS_SATA_GUID "sata-guid"