40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi/*
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * CDDL HEADER START
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi *
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * The contents of this file are subject to the terms of the
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Common Development and Distribution License (the "License").
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * You may not use this file except in compliance with the License.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi *
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * or http://www.opensolaris.org/os/licensing.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * See the License for the specific language governing permissions
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * and limitations under the License.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi *
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * When distributing Covered Code, include this CDDL HEADER in each
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * If applicable, add the following below this CDDL HEADER, with the
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * fields enclosed by brackets "[]" replaced with your own identifying
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * information: Portions Copyright [yyyy] [name of copyright owner]
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi *
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * CDDL HEADER END
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi */
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi/*
2c2c41837e330b002c4220a39638150db504fe0evi * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Use is subject to license terms.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi */
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#ifndef _SYS_BLK_COMMON_H
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#define _SYS_BLK_COMMON_H
2c2c41837e330b002c4220a39638150db504fe0evi
2c2c41837e330b002c4220a39638150db504fe0evi
2c2c41837e330b002c4220a39638150db504fe0evi#ifdef __cplusplus
2c2c41837e330b002c4220a39638150db504fe0eviextern "C" {
2c2c41837e330b002c4220a39638150db504fe0evi#endif
2c2c41837e330b002c4220a39638150db504fe0evi
2c2c41837e330b002c4220a39638150db504fe0evi#include <sys/types.h>
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#include <sys/xendev.h>
2c2c41837e330b002c4220a39638150db504fe0evi
2c2c41837e330b002c4220a39638150db504fe0evi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vitypedef uint_t (*blk_intr_t)(caddr_t arg);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vitypedef void (*blk_ring_cb_t)(caddr_t arg);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vitypedef struct blk_ringinit_args_s {
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi dev_info_t *ar_dip;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi /* callbacks */
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi blk_intr_t ar_intr;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi caddr_t ar_intr_arg;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi blk_ring_cb_t ar_ringup;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi caddr_t ar_ringup_arg;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi blk_ring_cb_t ar_ringdown;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi caddr_t ar_ringdown_arg;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi} blk_ringinit_args_t;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vitypedef struct blk_ring_s *blk_ring_t;
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viint blk_ring_init(blk_ringinit_args_t *args, blk_ring_t *ring);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vivoid blk_ring_fini(blk_ring_t *ring);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viboolean_t blk_ring_request_get(blk_ring_t ring, blkif_request_t *req);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vivoid blk_ring_request_requeue(blk_ring_t ring);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vivoid blk_ring_request_dump(blkif_request_t *req);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vivoid blk_ring_response_put(blk_ring_t ring, blkif_response_t *resp);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vivoid blk_ring_response_dump(blkif_response_t *req);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#ifdef __cplusplus
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi}
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#endif
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#endif /* _SYS_BLK_COMMON_H */
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi