/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Function declarations for front-end functions for hci1394 isochronous
* support. Also all isochronous related soft_state structures and defs.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* handle passed back from init() and used for rest of functions */
/*
* Isochronous structures and defs used in the hci1394 soft state.
* (see hci1394_state.h).
*/
/*
* control structure for allocated isochronous dma descriptor memory.
* when attempting to bind memory, if ddi_addr_bind_handle indicates multiple
* cookies, each cookie will be tracked within a separate copy of this
* structure. Only the last cookie's idma_desc_mem structure will contain
* a valid mem_handle and mem, to be used when freeing all the memory.
*
* 'used' specifies the number of bytes used for descriptors in this cookie.
* 'offset' is this cookie's offset relative to the beginning of the buffer.
*/
typedef struct hci1394_idma_desc_mem_s {
/* structure to track one isochronous context */
/* XXX if IR Multichan mode support is added, this must be modified */
typedef struct hci1394_iso_ctxt_s {
/* recovery required (16 => 2ms) */
/* block advances (8) */
/* dma advances (i.e. no status set) */
/* target callback if dma stops */
/*
* defs for hci1394_iso_ctxt_t.ctxt_io_mode.
* overall io characteristics of the contexts, initialized during isoch init
* and never changed.
*/
/*
* defs for hci1394_iso_ctxt_t.ctxt_flags
* These flags are protected by the context list mutex in the isoch handle
* (see hci1394_isoch.c for mutex definition)
*/
/*
* defs for hci1394_iso_ctxt_t.intr_flags
* These flags are protected by the per-context mutex "intrprocmutex"
*/
/*
* structure used to do accounting for interrupt usage. Specifically,
* used to determine when CYCLE_LOST or CYCLE_INCONSISTENT storms
* should cause us to disable those interrupts.
*/
typedef struct hci1394_intr_thresh_s {
int delta_t_counter;
int counter_thresh;
/* defs for the hci1394_intr_thresh_t struct */
/*
* Structure used for tracking all transmit and receive isochronous contexts
* Also contains the information necessary for tracking CYCLE_LOST and
* CYCLE_INCONSISTENT interrupt usage.
* The ctxt_list mutex protects the in-use status of the contexts while
* searching for a free isoch context to use in hci1394_alloc_isoch_dma(),
* during interrupt processing, and during free_isoch_dma processing.
* An openHCI 1.0 hardware implementation may support up to 32 separate DMA
* engines each for transmit and receive, referred to as "contexts".
* The number of supported contexts is determined during ohci board
* initialization, and can be different for transmit vs. receive.
*/
typedef struct hci1394_isoch_s {
int isoch_dma_alloc_cnt;
int unused;
int ctxt_xmit_count;
int ctxt_recv_count;
void **hal_idma_handle, int *resultp);
int *resultp);
int *resultp);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_1394_ADAPTERS_HCI1394_ISOCH_H */