cfga_usb.h revision d29f5a711240f866521445b1656d114da090335e
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _CFGA_USB_H
#define _CFGA_USB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdlib.h>
#include <strings.h>
#include <fcntl.h>
#include <ctype.h>
#include <unistd.h>
#include <libintl.h>
#include <libdevice.h>
#include <libdevinfo.h>
#include <libdevice.h>
#include <librcm.h>
#include <synch.h>
#include <thread.h>
#include <assert.h>
#define CFGA_PLUGIN_LIB
#include <config_admin.h>
/*
* Debug stuff.
*/
#ifdef DEBUG
#else
#define DPRINTF 0 &&
#endif /* DEBUG */
/* for walking links */
typedef struct walk_link {
char *path;
char len;
char **linkpp;
} walk_link_t;
/*
*/
typedef enum {
UCFGA_TERMINATE = 0,
/* Structures for tree walking code */
typedef struct {
char *phys;
char *log;
int ret;
int match_minor;
int l_errno;
} pathm_t;
#define MATCH_MINOR_NAME 1
/* Location of USB configuration file */
#define USBCONF_FILE "/etc/usb/config_map.conf"
/* Hardware options */
#define OPT_DISABLE_RCM "disable_rcm"
typedef enum {
UCFGA_ERR = -2,
} ucfga_ret_t;
/* Messages */
typedef struct {
int intl; /* Flag: if 1, internationalize */
const char *msgstr;
} msgcvt_t;
#define NO_CVT 0
#define CVT 1
/* Error message ids (and indices into usb_error_msgs) */
typedef enum {
CFGA_USB_OK = 0,
/* RCM Errors */
/*
* Given an error msg index, look up the associated string, and
* convert it to the current locale if required.
*/
/* Misc text strings */
#define CFGA_DEV_DIR "/dev/cfg"
#define DYN_SEP "::"
#define MINOR_SEP ":"
#define PORT "port"
#define PORT_SEPERATOR "."
#define USB "usb"
#define USB_CFGADM_DEFAULT_AP_TYPE "unknown"
/* these set of defines are -lav listing */
#define USB_UNDEF_STR "<undef>"
#define USB_NO_CFG_STR "<no cfg str descr>"
/* -x commands */
/* for confirm operation */
#define USB_CONFIRM_0 "the device: "
#define USB_CONFIRM_1 \
"This operation will suspend activity on the USB device\nContinue"
/* Prototypes */
extern int add_entry(char *, int, int, int, char *, char *, char *,
char **);
void **, size_t *);
#ifdef __cplusplus
}
#endif
#endif /* _CFGA_USB_H */