xref: /freebsd/sys/dev/ice/irdma_if.m (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1# SPDX-License-Identifier: BSD-3-Clause
2#  Copyright (c) 2022, Intel Corporation
3#  All rights reserved.
4#
5#  Redistribution and use in source and binary forms, with or without
6#  modification, are permitted provided that the following conditions are met:
7#
8#   1. Redistributions of source code must retain the above copyright notice,
9#      this list of conditions and the following disclaimer.
10#
11#   2. Redistributions in binary form must reproduce the above copyright
12#      notice, this list of conditions and the following disclaimer in the
13#      documentation and/or other materials provided with the distribution.
14#
15#   3. Neither the name of the Intel Corporation nor the names of its
16#      contributors may be used to endorse or promote products derived from
17#      this software without specific prior written permission.
18#
19#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29#  POSSIBILITY OF SUCH DAMAGE.
30# $FreeBSD$
31
32/**
33 * @file irdma_if.m
34 * @brief RDMA client kobject interface
35 *
36 * KOBject methods implemented by the RDMA client driver. These functions will
37 * be called from the ice driver to notify the RDMA client driver of device
38 * driver events.
39 */
40#include "ice_rdma.h"
41
42INTERFACE irdma;
43
44/**
45 * probe - Notify the RDMA client driver that a peer device has been created
46 * @peer: the RDMA peer structure
47 *
48 * Called by the ice driver during attach to notify the RDMA client driver
49 * that a new PF has been initialized.
50 */
51METHOD int probe {
52	struct ice_rdma_peer *peer;
53};
54
55/**
56 * open - Notify the RDMA client driver that a peer device has been opened
57 * @peer: the RDMA peer structure
58 *
59 * Called by the ice driver during the if_init routine to notify the RDMA
60 * client driver that a PF has been activated.
61 */
62METHOD int open {
63	struct ice_rdma_peer *peer;
64};
65
66/**
67 * close - Notify the RDMA client driver that a peer device has closed
68 * @peer: the RDMA peer structure
69 *
70 * Called by the ice driver during the if_stop routine to notify the RDMA
71 * client driver that a PF has been deactivated.
72 */
73METHOD int close {
74	struct ice_rdma_peer *peer;
75};
76
77/**
78 * remove - Notify the RDMA client driver that a peer device has been removed
79 * @peer: the RDMA peer structure
80 *
81 * Called by the ice driver during detach to notify the RDMA client driver
82 * that a PF has been removed.
83 */
84METHOD int remove {
85	struct ice_rdma_peer *peer;
86}
87
88/**
89 * link_change - Notify the RDMA client driver that link status has changed
90 * @peer: the RDMA peer structure
91 * @linkstate: link status
92 * @baudrate: link rate in bits per second
93 *
94 * Called by the ice driver when link status changes to notify the RDMA client
95 * driver of the new status.
96 */
97METHOD void link_change {
98	struct ice_rdma_peer *peer;
99	int linkstate;
100	uint64_t baudrate;
101}
102
103METHOD void event_handler {
104	struct ice_rdma_peer *peer;
105	struct ice_rdma_event *event;
106}
107