/*
* 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 (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _BUSSTAT_H
#define _BUSSTAT_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* exported by drivers on the system.
*
* busstat parses the command line it is given and builds up a
* pair of linked list's to represent the various options specified.
* An example command line is given below..
*
* -w ac2,pic0=wio_pkts,pic1=rbio_pkts -w ac2,pic0=rto_pkts,pic1=rto_pkts -r ac5
* =============================================================================
*
* ______
* | |
* | ac2|->wio_pkts->rto_pkts
* |pic0| | |
* | | -------<------
* ------
* |
* |
* ______
* | |
* | ac2|->rbio_pkts->rto_pkts
* |pic1| | |
* | | --------<-----
* ------
* |
* |
* ______
* | |
* | ac5|->evt
* |pic0|
* | |
* ------
* |
* |
* ______
* | |
* | ac5|->evt
* |pic1|
* | |
* ------
*
* The above diagram shows the lists created after the initial parsing.
*
* that is at least one event node.
*
* Event nodes come in two different types. Nodes that are the result of a -r
* operation will have the r_w field in their parent dev_node set to EVT_READ,
* and most of their other fields set to zero or NULL. An event node that was
* created because of a -w operation (r_w = EVT_WRITE) will have all it's fields
* filled in. When a device node is created, an event node is automatically
* created and marked as EVT_READ. If the device node was created as the result
* of a -r operation, nothing more happens. But if it was a -w operation, then
* the event node is modified (r_w changed to EVT_WRITE, event pcr mask and
* event name written if known).
*
* Setting events : work along the list of dev_nodes, for each device node check
* the event node pointed to by evt_node, if it is marked as EVT_WRITE in the
* corresponding r_w array, if so set the event stored in the node.
*
* Reading events : work along the list of dev_nodes, for each device node check
* the event node pointed to by evt_node, if it is marked EVT_WRITE, just read
* the event count from the appropiate PIC and store it in the node. If the node
* is EVT_READ however, read the PCR, determine the event name, store it in the
* node along with the event count.
*
* Multiplexing is handled by cycling through the event nodes. The event nodes
* are on a circular list, which allows each pic to be multiplexing between
* different numbers of events.
*/
#define FALSE 0
#define WRITE_EVT 0
typedef struct evt_node {
} evt_node_t;
typedef struct dev_node {
} dev_node_t;
#endif /* _BUSSTAT_H */