ixl1394.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 (c) 1999-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _SYS_1394_IXL1394_H
#define _SYS_1394_IXL1394_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Contains all defines and structures necessary for Isochronous Transfer
* Language (IXL) programs. IXL programs are used to specify the transmission
* or receipt of isochronous packets for an isochronous channel.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Error codes for IXL program compilation and dynamic update
* Comments indicate which are source of error
* NOTE: Make sure IXL1394_COMP_ERR_LAST is updated if a new error code is
* added. t1394_errmsg.c uses *FIRST and *LAST as bounds checks.
*/
#define IXL1394_ENO_DMA_RESRCS (-200)
/*
* IXL command opcodes
*
* IXL opcodes contain a unique opcode identifier and various flags to
* speed compilation.
*/
/* 5 flag bits at high end of opcode field. */
#define IXL1394_OPF_MASK 0xF800
/* Useful flag composites. */
/* 2 type bits whose contents are interpreted based on isxr setting */
#define IXL1394_OPTY_MASK 0x0600
/* type bits when isxfer == 0 */
#define IXL1394_OPTY_OTHER 0x0000
/* type bits when isxr == 1 */
/*
* IXL Command Opcodes.
*/
#define IXL1394_OP_RECV_PKT_ST \
#define IXL1394_OP_RECV_BUF \
#define IXL1394_OP_SEND_PKT_ST \
#define IXL1394_OP_SEND_PKT_WHDR_ST \
#define IXL1394_OP_SEND_BUF \
#define IXL1394_OP_SEND_HDR_ONLY \
#define IXL1394_OP_SEND_NO_PKT \
#define IXL1394_OP_STORE_TIMESTAMP \
#define IXL1394_OP_SET_TAGSYNC \
#define IXL1394_OP_SET_SKIPMODE \
#define IXL1394_OP_SET_SYNCWAIT \
/*
* The dynamic UPDATE versions of each updatable command.
*/
#define IXL1394_OP_SEND_PKT_WHDR_ST_U (IXL1394_OP_SEND_PKT_WHDR_ST | \
/* Opaque type for the ixl private data */
typedef struct ixl_priv_handle *ixl1394_priv_t;
/* IXL1394_OP_SET_SKIPMODE values (used only with isoch transmit) */
typedef enum {
IXL1394_SKIP_TO_SELF = 0,
IXL1394_SKIP_TO_NEXT = 1,
IXL1394_SKIP_TO_STOP = 2,
/*
* IXL Program Command Primitives
*/
/* The general command format. The operands vary depending on the opcode */
typedef struct ixl1394_command {
struct ixl1394_command *next_ixlp;
/*
* command structure used for a DDI_DMA bound buffer. For portability,
* set this _dmac_ll to the buffer's allocated and bound
* ddi_dma_cookie_t's _dmac_ll.
*/
typedef union ixl1394_buf_u {
/* shorthand access to IXL command buffers. similar to defs in dditypes.h */
#define ixldmac_laddr _dmac_ll
#ifdef _LONG_LONG_HTOL
#define ixldmac_notused _dmac_la[0]
#else
#define ixldmac_addr _dmac_la[0]
#endif
/*
* ixl1394_xfer_pkt
* Specifies a packet fragment.
* Used with IXL1394_OP_SEND_PKT_ST, IXL1394_OP_SEND_PKT_WHDR_ST,
* IXL1394_OP_SEND_PKT, IXL1394_OP_RECV_PKT_ST and IXL1394_OP_RECV_PKT.
*/
typedef struct ixl1394_xfer_pkt {
/*
* ixl1394_xfer_buf
* Specifies a buffer of multiple packets.
* Used with IXL1394_OP_SEND_BUF and IXL1394_OP_RECV_BUF.
*/
typedef struct ixl1394_xfer_buf {
/*
* ixl1394_xmit_special
* Specifies how many cycles are to be skipped before the next packet
* is sent. Specifies number of header only packets to be sent, next.
* Used with IXL1394_OP_SEND_HDR_ONLY and IXL1394_OP_SEND_NO_PKT.
*/
typedef struct ixl1394_xmit_special {
/*
* ixl1394_callback
* Specifies a callback function and callback data.
* When the callback is invoked, it is passed the addr of this IXL
* command, which it can use to retrieve the arg it has stored in
* this struct. Used with IXL1394_OP_CALLBACK.
*/
typedef struct ixl1394_callback {
/*
* ixl1394_label
* Specifies a label (location) which can be used as the target of a jump.
* Used with IXL1394_OP_LABEL.
*/
typedef struct ixl1394_label {
/*
* ixl1394_jump
* Specifies a label (location) which can then be used as the target of a jump.
* Used with IXL1394_OP_JUMP.
*/
typedef struct ixl1394_jump {
/*
* ixl1394_set_tagsync
* Specifies the tag and sync bits used for the port.
* Used with IXL1394_OP_SET_TAGSYNC.
*/
typedef struct ixl1394_set_tagsync {
/*
* ixl1394_set_skipmode
* Specifies the tag and sync bits used for the port.
* Used with IXL1394_OP_SET_SKIPMODE.
*/
typedef struct ixl1394_set_skipmode {
/*
* ixl1394_set_syncwait
* Specifies that next receive is to wait for sync before accepting input.
* Used with IXL1394_OP_SET_SYNCWAIT.
*/
typedef struct ixl1394_set_syncwait {
/*
* ixl1394_store_timestamp
* Specifies that the timestamp value of the most recently sent
* packet be stored into the timestamp field of this ixl command.
* Used with IXL1394_OP_STORE_TIMESTAMP.
*/
typedef struct ixl1394_store_timestamp {
/*
* Macros for extracting isochronous packet header fields when receiving
* packets via IXL1394_OP_RECV_PKT_ST or IXL1394_OP_RECV_BUF with
* ID1394_RECV_HEADERS mode enabled.
* The argument to each macro is a quadlet of data.
* Prior to using the macro, target drivers first retrieve this quadlet from
* bound memory by using ddi_get32(9F).
*/
/*
* timestamp is the first quadlet in an IXL1394_OP_RECV_PKT_ST packet, and is
* the last quadlet (after the data payload) in an IXL1394_OP_RECV_BUF packet.
*/
/*
* the following macros apply to the second quadlet in an
* IXL1394_OP_RECV_PKT_ST packet, and the first quadlet in an
* IXL1394_OP_RECV_BUF packet.
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_1394_IXL1394_H */