2 # Copyright (c) 2016 Alexander Motin <mav@FreeBSD.org>
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
14 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 #include <machine/bus.h>
55 typedef void (*ntb_db_callback)(void *data, uint32_t vector);
56 typedef void (*ntb_event_callback)(void *data);
58 ntb_event_callback link_event;
59 ntb_db_callback db_event;
63 METHOD bool link_is_up {
65 enum ntb_speed *speed;
66 enum ntb_width *width;
69 METHOD int link_enable {
75 METHOD int link_disable {
79 METHOD bool link_enabled {
86 const struct ntb_ctx_ops *ctx_ops;
89 METHOD void * get_ctx {
91 const struct ntb_ctx_ops **ctx_ops;
94 METHOD void clear_ctx {
98 METHOD uint8_t mw_count {
102 METHOD int mw_get_range {
113 METHOD int mw_set_trans {
120 METHOD int mw_clear_trans {
125 METHOD int mw_get_wc {
131 METHOD int mw_set_wc {
137 METHOD uint8_t spad_count {
141 METHOD void spad_clear {
145 METHOD int spad_write {
151 METHOD int spad_read {
157 METHOD int peer_spad_write {
163 METHOD int peer_spad_read {
169 METHOD uint64_t db_valid_mask {
173 METHOD int db_vector_count {
177 METHOD uint64_t db_vector_mask {
182 METHOD int peer_db_addr {
188 METHOD void db_clear {
193 METHOD void db_clear_mask {
198 METHOD uint64_t db_read {
202 METHOD void db_set_mask {
207 METHOD void peer_db_set {