mptsas_init.c revision ed7418ae3db79aed594bc486a3b52fc971f4ea4f
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* 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) 2000 to 2009, LSI Corporation.
* All rights reserved.
*
* Redistribution and use in source and binary forms of all code within
* this file that is exclusively owned by LSI, with or without
* modification, is permitted provided that, in addition to the CDDL 1.0
* License requirements, the following conditions are met:
*
* Neither the name of the author nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
/*
* mptsas_init - This file contains all the functions used to initialize
* MPT2.0 based hardware.
*/
#define MPTSAS_DEBUG
#endif
/*
* standard header files
*/
#pragma pack(1)
#pragma pack()
/*
* private header files.
*/
static const char *
{
return ("SAS2008");
return ("SAS2004");
return ("SAS2108");
return ("SAS2116");
return ("SAS2208");
return ("SAS2308");
return ("SAS3004");
return ("SAS3008");
return ("SAS3108");
default:
return ("?");
}
}
int
{
/*
* Send get facts messages
*/
return (DDI_FAILURE);
}
/*
* Get facts reply messages
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
/*
* Post message via handshake
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
char buf[32];
int simple_sge_main;
int simple_sge_next;
factsreply = (void *)memp;
numbytes = sizeof (*factsreply);
/*
* get ioc facts reply message
*/
return (DDI_FAILURE);
}
"IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
return (DDI_FAILURE);
}
/*
* store key values from reply to mpt structure
*/
"firmware-version", buf);
/*
* Set up request info.
*/
/*
* Size of reply free queue should be the number of requests
* plus some additional for events (32). Make sure number of
* reply frames is not a multiple of 16 so that the queue sizes
* are calculated correctly later to be a multiple of 16.
*/
if (!(numReplyFrames % 16)) {
}
/*
* Size of reply descriptor post queue should be the number of
* request frames + the number of reply frames + 1 and needs to
* be a multiple of 16. This size can be no larger than
* MaxReplyDescriptorPostQueueDepth from IOCFacts. If the
* calculated queue size is larger than allowed, subtract a
* multiple of 16 from m_max_requests, m_max_replies, and
* m_reply_free_depth.
*/
if (queueSize % 16) {
}
if (queueDiff % 16) {
}
}
/*
* Set up max chain depth.
*/
/*
* Set flag to check for SAS3 support.
*/
if (msgversion == MPI2_VERSION_02_05) {
mpt->m_instance);
} else {
}
/*
* Calculate max frames per request based on DMA S/G length.
*/
if (((MPTSAS_MAX_DMA_SEGS - simple_sge_main) %
simple_sge_next) > 1) {
}
/*
* Check if controller supports FW diag buffers and set flag to enable
* each type.
*/
TRUE;
}
}
}
/*
* Check if controller supports replaying events when issuing Message
* Unit Reset and set flag to enable MUR.
*/
}
/*
* Check if controller supports IR.
*/
}
return (DDI_SUCCESS);
}
int
{
/*
* Send get port facts message
*/
return (DDI_FAILURE);
}
/*
* Get port facts reply message
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
int numbytes;
/*
* Send port facts message via handshake
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
factsreply = (void *)memp;
numbytes = sizeof (*factsreply);
/*
* Get port facts reply message via handshake
*/
return (DDI_FAILURE);
}
"IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
int
{
/*
* Send enable port message
*/
return (DDI_FAILURE);
}
/*
* Get enable port reply message
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
/*
* Send message via handshake
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
numbytes = sizeof (MPI2_PORT_ENABLE_REPLY);
/*
* Get message via handshake
*/
return (DDI_FAILURE);
}
"IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
int
{
/*
* Send enable event notification message
*/
return (DDI_FAILURE);
}
/*
* Get enable event reply message
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
/*
* Send message via handshake
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
numbytes = sizeof (MPI2_EVENT_NOTIFICATION_REPLY);
eventsreply = (void *)memp;
/*
* Get message via handshake
*/
return (DDI_FAILURE);
}
"mptsas_ioc_do_enable_event_notification_reply: "
"IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
int
{
/*
* Send ioc init message
*/
return (DDI_FAILURE);
}
/*
* Get ioc init reply message
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
/*
* These addresses are set using the DMA cookie addresses from when the
* memory was allocated. Sense buffer hi address should be 0.
*/
/*
* Fill in the timestamp with the number of milliseconds since midnight
* of January 1, 1970 UT (Greenwich Mean Time). Time is returned in
* seconds and nanoseconds. Translate both to milliseconds and add
* them together to get total milliseconds.
*/
gethrestime(&time);
/*
* Post message via handshake
*/
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
#ifndef __lock_lint
#endif
int numbytes;
numbytes = sizeof (MPI2_IOC_INIT_REPLY);
/*
* Get reply message via handshake
*/
return (DDI_FAILURE);
}
"IOCStatus=0x%x, IOCLogInfo=0x%x", iocstatus,
return (DDI_FAILURE);
}
} else {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}