iec61883.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 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_AV_IEC61883_H
#define _SYS_AV_IEC61883_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* IEC 61883 interfaces
*/
#ifdef __cplusplus
extern "C" {
#endif
/* current interface version */
/*
* asyncronous request (ARQ)
*/
typedef struct iec61883_arq {
int arq_type; /* type */
int arq_len; /* length */
union {
} arq_data; /* data */
/* ARQ types (arq_type) */
enum {
};
/*
* IEC61883_ISOCH_INIT argument
*/
typedef struct iec61883_isoch_init {
int ii_version; /* interface version */
int ii_pkt_size; /* packet size */
int ii_frame_size; /* packets/frame */
int ii_frame_cnt; /* # of frames */
int ii_direction; /* xfer direction */
int ii_bus_speed; /* bus speed */
int ii_dbs; /* DBS */
int ii_fn; /* FN */
int ii_rate_n; /* rate numerator */
int ii_rate_d; /* rate denominator */
int ii_ts_mode; /* timestamp mode */
int ii_flags; /* flags */
int ii_handle; /* isoch handle */
int ii_frame_rcnt; /* # of frames */
int ii_rchannel; /* channel */
int ii_error; /* error code */
/* xfer directions (ii_direction) */
enum {
};
/* bus speeds (ii_bus_speed) */
enum {
};
/* special rate coefficients (ii_rate_n, ii_rate_d) */
#define IEC61883_RATE_N_DV_NTSC 1
#define IEC61883_RATE_D_DV_NTSC 0
#define IEC61883_RATE_N_DV_PAL 2
#define IEC61883_RATE_D_DV_PAL 0
/* timestamp modes (ii_ts_mode) */
enum {
IEC61883_TS_NONE = 0,
IEC61883_TS_SYT = 0x0206
};
/* error codes (ii_error) */
enum {
IEC61883_ERR_NOMEM = 1,
};
/*
* data transfer strusture
*/
typedef struct iec61883_xfer {
int xf_empty_idx; /* first empty frame */
int xf_empty_cnt; /* empty frame count */
int xf_full_idx; /* first full frame */
int xf_full_cnt; /* full frame count */
int xf_error; /* error */
/*
* IEC61883_RECV argument
*/
typedef struct iec61883_recv {
int rx_handle; /* isoch handle */
int rx_flags; /* flags */
/*
* IEC61883_XMIT argument
*/
typedef struct iec61883_xmit {
int tx_handle; /* isoch handle */
int tx_flags; /* flags */
int tx_miss_cnt; /* missed cycles */
/*
* IEC61883_PLUG_INIT argument
*/
typedef struct iec61883_plug_init {
int pi_ver; /* interface version */
int pi_loc; /* plug location */
int pi_type; /* plug type */
int pi_num; /* plug number */
int pi_flags; /* flags */
int pi_handle; /* plug handle */
int pi_rnum; /* plug number */
/* plug locations (pi_loc) */
enum {
};
/* plug types (pi_type) */
enum {
};
/* special plug number (pi_num) */
enum {
IEC61883_PLUG_ANY = -1
};
/*
* IEC61883_PLUG_REG_READ argument
*/
typedef struct iec61883_plug_reg_val {
int pr_handle; /* plug handle */
/*
* IEC61883_PLUG_REG_CAS argument
*/
typedef struct iec61883_plug_reg_lock {
int pl_handle; /* plug handle */
/*
* IEC61883_NODE_GET_TEXT_LEAF argument
*/
typedef struct iec61883_node_text_leaf {
int tl_parent; /* ROM parent */
int tl_num; /* leaf number */
int tl_len; /* buffer length */
int tl_cnt; /* leaf count */
int tl_rlen; /* real length */
/* ROM parent types (tl_parent) */
enum {
IEC61883_ROM_ROOT, /* leaf in the root directory */
IEC61883_ROM_UNIT /* leaf in the unit directory */
};
/* ioctl codes */
#define IEC61883_IMPL_MKIOC(c) (c | IEC61883_IMPL_IOC)
/* 32-bit structures for the drivers */
#ifdef _KERNEL
typedef struct iec61883_isoch_init32 {
int ii_version; /* interface version */
int ii_pkt_size; /* packet size */
int ii_frame_size; /* packets/frame */
int ii_frame_cnt; /* # of frames */
int ii_direction; /* xfer direction */
int ii_bus_speed; /* bus speed */
int ii_dbs; /* DBS */
int ii_fn; /* FN */
int ii_rate_n; /* rate numerator */
int ii_rate_d; /* rate denominator */
int ii_ts_mode; /* timestamp mode */
int ii_flags; /* flags */
int ii_handle; /* isoch handle */
int ii_frame_rcnt; /* # of frames */
int ii_rchannel; /* channel */
int ii_error; /* error code */
typedef struct iec61883_node_text_leaf32 {
int tl_parent; /* ROM parent */
int tl_num; /* leaf number */
int tl_len; /* buffer length */
int tl_cnt; /* leaf count */
int tl_rlen; /* real length */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_AV_IEC61883_H */