d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * CDDL HEADER START
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * The contents of this file are subject to the terms of the
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * Common Development and Distribution License (the "License").
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * You may not use this file except in compliance with the License.
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * See the License for the specific language governing permissions
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * and limitations under the License.
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * When distributing Covered Code, include this CDDL HEADER in each
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * If applicable, add the following below this CDDL HEADER, with the
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * fields enclosed by brackets "[]" replaced with your own identifying
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * information: Portions Copyright [yyyy] [name of copyright owner]
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * CDDL HEADER END
5cd376e8b7030707d78315f63adb4bb2b4d9963eJimmy Vetayases * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * This defines the interface between the pcitool_ui.c module which parses the
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * commandline options, and the other pcitool modules which process them.
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define SUCCESS 0 /* This does not conflict with errno values. */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * Flags which get set in the flags field of pcitool_uiargs_t. There is a flag
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * for each option specified on the commandline.
09b1eac246a4e627fcbd1ce5bf8005746cbe45eaEvan Yan#define INTR_FLAG 0x4 /* Either -i or -m specified */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define PROBEDEV_FLAG 0x8 /* Probe a specific device */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define PROBETREE_FLAG 0x10 /* Probe all devs on a tree */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define PROBEALL_FLAG 0x20 /* Probe devs on all trees */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define PROBERNG_FLAG 0x40 /* Probe devs within bus ranges */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur /* - mod to PROBEALL and PROBETREE */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define PROBE_FLAGS (PROBEDEV_FLAG | PROBETREE_FLAG | PROBEALL_FLAG | \
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define ALL_COMMANDS (NEXUS_FLAG | LEAF_FLAG | INTR_FLAG | PROBE_FLAGS)
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur/* Values specified by suboption parser. */
09b1eac246a4e627fcbd1ce5bf8005746cbe45eaEvan Yan#define CPU_SPEC_FLAG (0x200000ULL << 32) /* -w <cpu#> */
09b1eac246a4e627fcbd1ce5bf8005746cbe45eaEvan Yan#define INO_ALL_FLAG (0x400000ULL << 32) /* -i all */
09b1eac246a4e627fcbd1ce5bf8005746cbe45eaEvan Yan#define INO_SPEC_FLAG (0x800000ULL << 32) /* -i <#ino> */
09b1eac246a4e627fcbd1ce5bf8005746cbe45eaEvan Yan#define MSI_ALL_FLAG (0x1000000ULL << 32) /* -m all */
09b1eac246a4e627fcbd1ce5bf8005746cbe45eaEvan Yan#define MSI_SPEC_FLAG (0x2000000ULL << 32) /* -m <#msi> */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur/* Macros for a few heavily-used flags. */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#define IS_VERBOSE(flags) (flags & VERBOSE_FLAG)
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur * This is the structure of flags and parsed values returned from pcitool_ui.c
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur/* Exported functions. */
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaurint get_commandline_args(int argc, char *argv[], pcitool_uiargs_t *parsed_args);
d5ace9454616652a717c9831d949dffa319381f9Erwin T Tsaur#endif /* _PCITOOL_UI_H */