/*
* 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 2013 Nexenta Systems, Inc. All rights reserved.
*/
/*
* This file contains SM-HBA support for MPT SAS driver
*/
#define MPTSAS_DEBUG
#endif
/*
* standard header files
*/
#pragma pack(1)
#pragma pack()
/*
* private header files.
*/
/*
* SM - HBA statics
*/
extern char *mptsas_driver_rev;
uint16_t *);
uint8_t);
static void
void
static void
{
switch (dt) {
case DATA_TYPE_INT32:
}
break;
case DATA_TYPE_STRING:
}
break;
default:
"Unhandled datatype(%d) for (%s). Skipping prop update.",
}
}
void
{
int i;
for (i = 0; i < MPTSAS_MAX_PHYS; i++) {
"phy %d, Owner hdl:0x%x, attached hdl: 0x%x,"
"attached phy identifier %d,Program link rate 0x%x,"
"hw link rate 0x%x, negotiator link rate 0x%x, path %s",
}
}
static void
{
}
static void
{
int rval;
return;
}
phy_nums);
if (rval) {
" nv list array add failed, return value %d.", rval);
goto exit;
}
NV_ENCODE_NATIVE, 0);
exit:
if (packed_data != NULL) {
}
}
void
{
}
void
{
int i, j;
if (phy_nums == 0)
return;
nvlist_free(phy_props[i]);
}
/*
* Called with PHY lock held on phyp
*/
void
{
char *pname;
return;
return;
return;
}
}
}
"%s: Failed to post sysevent", __func__);
return;
}
goto fail;
goto fail;
goto fail;
goto fail;
goto fail;
}
goto fail;
fail:
}
void
{
int ndata;
int i;
for (i = 0; i < mpt->m_num_phys; i++) {
/* We've already created this kstat instance */
continue;
}
ndata = (sizeof (sas_phy_stats_t)/
sizeof (kstat_named_t));
ddi_get_instance(dip), i);
KSTAT_TYPE_NAMED, ndata, 0);
"%s: Failed to create %s kstats", __func__,
ks_name);
continue;
}
"SecondsSinceLastReset", KSTAT_DATA_ULONGLONG);
"TxFrames", KSTAT_DATA_ULONGLONG);
"RxFrames", KSTAT_DATA_ULONGLONG);
"TxWords", KSTAT_DATA_ULONGLONG);
"RxWords", KSTAT_DATA_ULONGLONG);
"InvalidDwordCount", KSTAT_DATA_ULONGLONG);
"RunningDisparityErrorCount", KSTAT_DATA_ULONGLONG);
"LossofDwordSyncCount", KSTAT_DATA_ULONGLONG);
"PhyResetProblemCount", KSTAT_DATA_ULONGLONG);
}
}
}
int
{
/*
* We just want to lock against other invocations of kstat;
* we don't need to pmcs_lock_phy() for this.
*/
if (ret == DDI_FAILURE)
goto fail;
(unsigned long long)pptr->invalid_dword_count;
(unsigned long long)pptr->running_disparity_error_count;
(unsigned long long)pptr->loss_of_dword_sync_count;
(unsigned long long)pptr->phy_reset_problem_count;
ret = DDI_SUCCESS;
fail:
return (ret);
}
void
{
int i = 0;
for (i = 0; i < mpt->m_num_phys; i++) {
continue;
}
}
}
}
int
{
int i = 0;
for (i = 0; i < mpt->m_num_phys; i++) {
if (rval != DDI_SUCCESS) {
"Failed to get sas phy page 0"
" for each phy");
return (DDI_FAILURE);
}
}
return (DDI_SUCCESS);
}
int
{
int protocol = 0;
if (mptsas_smhba_phy_init(mpt)) {
return (DDI_FAILURE);
}
/* SM-HBA support */
&sm_hba);
/* SM-HBA driver version */
/* SM-HBA hardware version */
hw_rev);
/* SM-HBA phy number per HBA */
&(mpt->m_num_phys));
/* SM-HBA protocal support */
/*
* VPD data is not available, we make a serial number for this.
*/
&serial_number[0]);
return (DDI_SUCCESS);
}