/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/dditypes.h>
#include <sys/ddi_impldefs.h>
#include <sys/ddipropdefs.h>
#include <sys/sunldi_impl.h>
#include <mdb/mdb_modapi.h>
#include "ldi.h"
/*
* ldi handle walker structure
*/
typedef struct lh_walk {
} lh_walk_t;
/*
* ldi identifier walker structure
*/
typedef struct li_walk {
} li_walk_t;
/*
* Options for ldi_handles dcmd
*/
/*
* LDI walkers
*/
int
{
/* get the address of the hash table */
mdb_warn("couldn't find ldi_handle_hash");
return (WALK_ERR);
}
/* get the address of the first element in the first hash bucket */
return (WALK_ERR);
}
return (WALK_NEXT);
}
int
{
int status;
/* check if we need to go to the next hash bucket */
/* advance to the next bucket */
return (WALK_DONE);
/* get handle address from the hash bucket */
mdb_warn("couldn't read ldi handle hash at %p",
return (WALK_ERR);
}
}
/* invoke the walker callback for this hash element */
return (status);
/* get a pointer to the next hash element */
return (WALK_ERR);
}
return (WALK_NEXT);
}
int
{
/* get the address of the hash table */
mdb_warn("couldn't find ldi_ident_hash");
return (WALK_ERR);
}
/* get the address of the first element in the first hash bucket */
return (WALK_ERR);
}
return (WALK_NEXT);
}
int
{
int status;
/* check if we need to go to the next hash bucket */
/* advance to the next bucket */
return (WALK_DONE);
/* get handle address from the hash bucket */
mdb_warn("couldn't read ldi ident hash at %p",
return (WALK_ERR);
}
}
/* invoke the walker callback for this hash element */
return (status);
/* get a pointer to the next hash element */
return (WALK_ERR);
}
return (WALK_NEXT);
}
/*
* LDI dcmds
*/
static void
{
if (start) {
} else {
}
if (refs)
}
static int
{
/* read the ldi ident */
return (1);
}
/* display the ident address */
/* display the ref count */
if (refs)
/* display the dip (if any) */
} else {
}
/* display the minor node (if any) */
} else {
}
/* display the module info */
return (0);
}
int
{
/* Determine if there is an ldi identifier address */
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("can't walk ldi idents");
return (DCMD_ERR);
}
return (DCMD_OK);
}
/* display the header line */
if (DCMD_HDRSPEC(flags))
/* display the ldi ident */
return (DCMD_ERR);
return (DCMD_OK);
}
static void
if (refs)
if (!ident) {
} else {
ldi_ident_header(0, 0);
}
}
static int
{
const char *name;
/* read in the ldi handle */
return (DCMD_ERR);
}
/* display the handle address */
/* display the ref count */
if (refs)
/* display the vnode */
/* read in the vnode associated with the handle */
return (1);
}
/* display the driver name */
mdb_warn("failed to convert major number to name\n");
return (1);
}
/* display the minor number */
/* display the event pointer (if any) */
} else {
}
if (!ident) {
/* display the ident address */
return (0);
}
/* display the entire ident */
}
int
{
int ident = 0;
return (DCMD_USAGE);
if (ident)
refs = 0;
/* Determine if there is an ldi handle address */
if (!(flags & DCMD_ADDRSPEC)) {
mdb_warn("can't walk ldi handles");
return (DCMD_ERR);
} return (DCMD_OK);
}
/* display the header line */
if (DCMD_HDRSPEC(flags))
ldi_handle_header(refs, ident);
/* display the ldi handle */
return (DCMD_ERR);
return (DCMD_OK);
}
void
ldi_ident_help(void)
{
mdb_printf("Displays an ldi identifier.\n"
"Without the address of an \"ldi_ident_t\", "
"print all identifiers.\n"
"With an address, print the specified identifier.\n");
}
void
ldi_handle_help(void)
{
mdb_printf("Displays an ldi handle.\n"
"Without the address of an \"ldi_handle_t\", "
"print all handles.\n"
"With an address, print the specified handle.\n\n"
"Switches:\n"
" -i print the module identifier information\n");
}