/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_USBVC_VAR_H
#define _SYS_USB_USBVC_VAR_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/sysmacros.h>
#include <sys/videodev2.h>
/*
* Power Management support
*/
typedef struct usbvc_power {
int usbvc_pm_busy;
/* Wakeup and power transistion capabilites of an interface */
/* flag to indicate if driver is about to raise power level */
/* Raw data buf from the USB cam */
typedef struct usbvc_buf
{
/* cookie used for memory mapping */
} usbvc_buf_t;
/* Group data buf related lists and other elements */
typedef struct usbvc_buf_grp
{
/*
* UVC Spec: one format descriptor may be followed by sererval frame
* descriptors, one still image descriptor and one color matching descriptor.
* It is called a format group. There might be several format groups follow
*/
typedef struct usbvc_format_group {
/* bytes per pix, used to calculate bytesperline */
/* A stream interface may have several format groups */
typedef struct usbvc_stream_if {
/* The actual format groups we parsed for the stream interface */
/* The max payload that the isoc data EPs can support */
/*
* To flag if VIDIOC_STREAMON is executed, only used by STREAM mode
* device's isoc polling operation after resume.
*/
/* video interface collection */
typedef struct usbvc_vic {
/* bFirstInterface, the video control infterface num of this VIC */
/*
* bInterfaceCount -1, the total number of stream interfaces
* belong to this VIC
*/
} usbvc_vic_t;
/* Macros */
/* For serialization. */
/*
* Masks for debug printing
*/
/* According to UVC specs, the frame interval is in 100ns unit */
/* Only D3...D0 are writable, Table 4-6, UVC Spec */
enum usbvc_buf_status {
/*
* buf is filled with a full frame without any errors,
* it will be moved to full list.
*/
/*
* buf is filled to full but no EOF bit is found at the end
* of video data
*/
};
/*
* This structure is used to map v4l2 controls to uvc controls. The structure
* array is addressed by (V4L2_CID_BASE - V4L2_CID_*)
*/
typedef struct usbvc_v4l2_ctrl_map {
/* The xth bit in bmControls bitmap of processing unit descriptor */
typedef struct usbvc_v4l2_ctrl {
/*
* State structure
*/
struct usbvc_state {
/* Video ctrl interface header descriptor */
/* current I/O type: read or mmap. */
};
/*
* Used in ioctl entry to copy an argument from kernel space (arg_name)
* to USER space (arg)
*/
break; \
}
/*
* Used in ioctl entry to copy an argument from USER space (arg) to
* KERNEL space (arg_name)
*/
break; \
}
/* Turn a little endian byte array to a uint32_t */
}
/* Turn a uint32_t to a little endian byte array */
}
/* Turn a little endian byte array to a uint16_t */
/* Turn a uint16_t to alittle endian byte array */
}
#define NELEM(a) (sizeof (a) / sizeof (*(a)))
/* Minimum length of class specific descriptors */
/* Length of the Frame descriptor which has continuous frame intervals */
/*
* According to usb2.0 spec (table 9-13), for all ep, bits 10..0 specify the
* max pkt size; for high speed ep, bits 12..11 specify the number of
* additional transaction opportunities per microframe.
*/
/*
* warlock directives
* _NOTE is an advice for locklint. Locklint checks lock use for deadlocks.
*/
}))
/* Functions specific for V4L2 API */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_USBVC_VAR_H */