/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_1394_CMD1394_H
#define _SYS_1394_CMD1394_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Contains the enums, command structures, and error codes used with
* the 1394 Framework's t1394_read(), t1394_write(), and t1394_lock()
* interfaces.
* For outgoing (Asynchronous Transmit - AT) commands, target drivers
* allocate a command using t1394_alloc_cmd(), fill it in with the
* transmit info, and send it using one of t1394_read(), t1394_write(),
* of t1394_lock().
* The target driver can choose whether to get a callback when the
* command completes, block until it completes, or poll on the return
* status in the command.
* For incoming (Asynchronous Receive - AR) requests, the same command
* structure is used and most of the information has the same or a
* similar meaning to what it does on the AT side. The major differences
* are that nodeID indicates the node from which the command was sent
* and broadcast informs a target driver whether the incoming request
* was broadcast to everyone.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* cmd1394_cmd.cmd_type
*/
typedef enum {
/*
* cmd1394_cmd.flags
* Used to select the request's behavior, including
* how the destination address is determined, how
* a large request will be broken into smaller requests,
* whether the command should be resent after a
* bus reset has happened, etc.
*/
typedef enum {
/*
* cmd1394_cmd.arg.l.lock_type
* in the request. Some are supported by the 1394 spec
* others (0x10000+) are supported locally in software.
*/
typedef enum {
/* Reserved = 0x0000 */
/* Vendor-Defined = 0x0007 */
/* Reserved = 0x0008 - 0xFFFF */
/* Asynchronous Command (Data Quadlet) */
typedef struct cmd1394_quadlet {
/* Asynchronous Command (Data Block) */
typedef struct cmd1394_block {
/* Asynchronous Command (Lock Cmd - 32 bit) */
typedef struct cmd1394_lock32 {
/* Asynchronous Command (Lock Cmd - 64 bit) */
typedef struct cmd1394_lock64 {
/* cmd1394_cmd: cmd1394 - common command type */
typedef struct cmd1394_cmd
{
int cmd_version;
volatile int cmd_result;
union {
} cmd_u;
/*
* NOTE: Make sure CMD1394_ERR_LAST is updated if a new error code is
* added. t1394_errmsg.c uses *FIRST and *LAST as bounds checks.
*/
/* cmd1394_cmd.result - Immediate failures (with DDI_FAILURE) */
/* cmd1394_cmd.result - Returned with completion_callback */
#define CMD1394_CMDSUCCESS (0)
/* Warlock directives for cmd1394 */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_1394_CMD1394_H */