/*
* 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.
*/
#include <sys/mc_intel.h>
#include "nhm_log.h"
#include "intel_nhm.h"
int nhm_allow_detach = 0;
extern int nhm_patrol_scrub;
extern int nhm_demand_scrub;
extern int nhm_no_smbios;
extern int nhm_smbios_serial;
extern int nhm_smbios_manufacturer;
extern int nhm_smbios_part_number;
extern int nhm_smbios_version;
extern int nhm_smbios_label;
extern void inhm_create_nvl(int);
extern char *inhm_mc_name(void);
extern void init_dimms(void);
extern void nhm_smbios();
static void
{
int i;
for (i = 0; i < MAX_CPU_NODES; i++) {
if (inhm_mc_snapshot[i] == NULL)
continue;
inhm_mc_snapshot[i] = NULL;
inhm_mc_snapshotsz[i] = 0;
}
}
static int
{
int i;
int rt = 0;
for (i = 0; i < MAX_CPU_NODES; i++) {
if (inhm_mc_snapshot[i] != NULL)
continue;
rt = -1;
}
return (rt);
}
/*ARGSUSED*/
static int
int *rvalp)
{
int rc = 0;
int chip;
return (EINVAL);
if (!rw_tryupgrade(&inhm_mc_lock)) {
return (EAGAIN);
}
if (inhm_mc_nvl[chip])
(void) inhm_mc_snapshot_update();
}
switch (cmd) {
case MC_IOC_SNAPSHOT_INFO:
mode) < 0)
break;
case MC_IOC_SNAPSHOT:
break;
}
return (rc);
}
/*ARGSUSED*/
static int
void **result)
{
if ((infocmd != DDI_INFO_DEVT2DEVINFO &&
return (DDI_FAILURE);
}
if (infocmd == DDI_INFO_DEVT2DEVINFO)
else
return (0);
}
static int
{
int i;
if (cmd == DDI_RESUME) {
nhm_smbios();
return (DDI_SUCCESS);
}
if (cmd != DDI_ATTACH)
return (DDI_FAILURE);
inhm_mc_name());
if (nhm_dev_init()) {
return (DDI_FAILURE);
}
for (i = 0; i < MAX_CPU_NODES; i++) {
i, "ddi_mem_ctrl", 0) != DDI_SUCCESS) {
" for memory controller %d\n", i);
}
}
DDI_PROP_DONTPASS, "patrol-scrub", 0);
DDI_PROP_DONTPASS, "demand-scrub", 0);
DDI_PROP_DONTPASS, "no-smbios", 0);
nhm_smbios();
}
return (DDI_SUCCESS);
}
/*ARGSUSED*/
static int
{
return (DDI_SUCCESS);
return (DDI_SUCCESS);
} else {
return (DDI_FAILURE);
}
}
/*ARGSUSED*/
static int
{
return (EINVAL);
return (EINVAL);
}
return (0);
}
/*ARGSUSED*/
static int
{
return (0);
}
nodev, /* not a block driver */
nodev, /* no print routine */
nodev, /* no dump routine */
nodev, /* no read routine */
nodev, /* no write routine */
nodev, /* no devmap routine */
nodev, /* no mmap routine */
nodev, /* no segmap routine */
nochpoll, /* no chpoll routine */
0, /* not a STREAMS driver */
};
DEVO_REV, /* devo_rev */
0, /* devo_refcnt */
inhm_mc_getinfo, /* devo_getinfo */
nulldev, /* devo_identify */
nulldev, /* devo_probe */
inhm_mc_attach, /* devo_attach */
inhm_mc_detach, /* devo_detach */
nodev, /* devo_reset */
&inhm_mc_cb_ops, /* devo_cb_ops */
NULL, /* devo_bus_ops */
NULL, /* devo_power */
ddi_quiesce_not_needed, /* devo_quiesce */
};
"Intel QuickPath Memory Controller Hub Module",
};
(void *)&modldrv,
};
int
_init(void)
{
int err;
init_dimms();
}
return (err);
}
int
{
}
int
_fini(void)
{
int err;
nhm_unload();
}
return (err);
}