usbprn.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_USBPRN_H
#define _SYS_USB_USBPRN_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* This header file contains internal driver structures info
*
* Write timeout values for 1K of data transfer
*/
/* ps_flags values */
/* Maximum transfer size */
/*
* Per pipe state information
*/
typedef struct usbprn_ps {
int ps_flags; /* state flags */
int ps_cr; /* save last cr */
} usbprn_ps_t;
/*
* PM support
*/
typedef struct usbprn_power {
/* device busy accounting */
int usbprn_pm_busy;
/* this is the bit mask of the power states that device has */
/* wakeup and power transistion capabilites of an interface */
/*
* State structure
*/
typedef struct usbprn_state {
int usbprn_dev_state; /* USB device state */
int usbprn_instance; /* instance number */
int usbprn_flags;
char *usbprn_device_id; /* Device id string */
int usbprn_device_id_len; /* Device id length */
/* serialize access */
/* mblk_t that contains the data to be sent */
char usbprn_last_status; /* last port status */
/* warlock directives, stable data */
/* Values for usbprn_flags */
/* Macros */
/*
* Check if it the device is not being closed
* or not being disconnected or not being suspended
*/
#define USBPRN_DEVICE_ACCESS_OK(s) \
(((s)->usbprn_flags & USBPRN_OPEN) && \
(((s)->usbprn_dev_state == USB_DEV_ONLINE)))
/* Check if the pipes are idle or closed */
#define USBPRN_PIPES_BUSY(s) \
/*
* Debug message Masks
*/
#define PRINT_MASK_OPEN 0x00000002
#define PRINT_MASK_CLOSE 0x00000004
#define PRINT_MASK_EVENTS 0x00000008
#define PRINT_MASK_PM 0x00000010
#define PRINT_MASK_CPR 0x00000020
#define PRINT_MASK_ALL 0xFFFFFFFF
/* log message breakup */
#define USBPRN_PRINT_MAXLINE 80
/* max device id length */
#define USBPRN_MAX_DEVICE_ID_LENGTH 1024
/* ugen support */
#define USBPRN_MINOR_UGEN_BITS_MASK 0xff
#define USBPRN_MINOR_INSTANCE_SHIFT 8
#define USBPRN_MINOR_TO_INSTANCE(minor) \
(((minor) & USBPRN_MINOR_INSTANCE_MASK) >> \
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_USBPRN_H */