c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * This file contains definitions used in OFED defined user/kernel
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * interfaces. These are imported from the OFED header ib_verbs.h. Oracle
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * elects to have and use the contents of ib_verbs.h under and governed
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * by the OpenIB.org BSD license (see below for full license text). However,
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * the following notice accompanied the original version of this file:
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2004 Infinicon Corporation. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2004 Intel Corporation. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2004 Topspin Corporation. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2004 Voltaire Corporation. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Copyright (c) 2005, 2006, 2007 Cisco Systems. All rights reserved.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * This software is available to you under a choice of one of two
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * licenses. You may choose to be licensed under the terms of the GNU
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * General Public License (GPL) Version 2, available from the file
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * COPYING in the main directory of this source tree, or the
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * OpenIB.org BSD license below:
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Redistribution and use in source and binary forms, with or
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * without modification, are permitted provided that the following
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * conditions are met:
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * - Redistributions of source code must retain the above
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * copyright notice, this list of conditions and the following
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * disclaimer.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * - Redistributions in binary form must reproduce the above
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * copyright notice, this list of conditions and the following
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * disclaimer in the documentation and/or other materials
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * provided with the distribution.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#include <sys/ib/clients/of/sol_ofs/sol_ofs_common.h>
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikartypedef struct sol_ofs_client_s *ofs_client_p_t;
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar /* IB values map to NodeInfo:NodeType. */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#define __attribute_const__ __attribute__((__const__))
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikarrdma_node_get_transport(enum rdma_node_type node_type) __attribute_const__;
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12,
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikarstatic inline int ib_width_enum_to_int(enum ib_port_width width)
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar default: return -1;
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * Set value of IB_WC_RECV so consumers can test if a completion is a
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * receive by testing (opcode & IB_WC_RECV).
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar IB_CQ_SOLICITED_MASK = IB_CQ_SOLICITED | IB_CQ_NEXT_COMP,
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar void (*event_handler)(struct ib_event *, void *);
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * IB_QPT_SMI and IB_QPT_GSI have to be the first two entries
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * here (and in that order) since the MAD layer uses them as
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar * indices into a 2-entry table.
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar void (*event_handler)(struct ib_event *, void *);
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar uint8_t port_num; /* special QP types only */
fffafeb2cc01732fd6a28ed530e4424094685eceJohnny Cheung IB_ACCESS_SO = (1<<5) /* MR with Strong Ordering */
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikartypedef void (*ib_comp_handler)(struct ib_cq *cq, void *cq_context);
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar void (*event_handler)(struct ib_event *, void *);
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar void (*event_handler)(struct ib_event *, void *);
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar void (*event_handler)(struct ib_event *, void *);
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otavoid ib_unregister_client(struct ib_client *client);
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otavoid *ib_get_client_data(struct ib_device *device, struct ib_client *client);
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otavoid ib_set_client_data(struct ib_device *device, struct ib_client *client,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_alloc_pd - Allocates an unused protection domain.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @device: The device on which to allocate the protection domain.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * A protection domain object provides an association between QPs, shared
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * receive queues, address handles, memory regions, and memory windows.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otastruct ib_pd *ib_alloc_pd(struct ib_device *device);
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_dealloc_pd - Deallocates a protection domain.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @pd: The protection domain to deallocate.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_create_qp - Creates a QP associated with the specified protection
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @pd: The protection domain associated with the QP.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @qp_init_attr: A list of initial attributes required to create the
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * QP. If QP creation succeeds, then the attributes are updated to
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * the actual capabilities of the created QP.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_modify_qp - Modifies the attributes for the specified QP and then
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * transitions the QP to the given state.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @qp: The QP to modify.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @qp_attr: On input, specifies the QP attributes to modify. On output,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * the current values of selected QP attributes are returned.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @qp_attr_mask: A bit-mask used to specify which attributes of the QP
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * are being modified.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otaint ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_destroy_qp - Destroys the specified QP.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @qp: The QP to destroy.
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * IB_CQ_VECTOR_LEAST_ATTACHED: The constant specifies that
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * the CQ will be attached to the completion vector that has
cadbfdc3bdb156e92d7a88978bc98ea87f6e037fEiji Ota * the least number of CQs already attached to it.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_create_cq - Creates a CQ on the specified device.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @device: The device on which to create the CQ.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @comp_handler: A user-specified callback that is invoked when a
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * completion event occurs on the CQ.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @event_handler: A user-specified callback that is invoked when an
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * asynchronous event not associated with a completion occurs on the CQ.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @cq_context: Context associated with the CQ returned to the user via
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * the associated completion and event handlers.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @cqe: The minimum size of the CQ.
17a2b317610f531d565bf4e940433aab2d9e6985Bill Taylor * @comp_vector - Completion queue sched handle.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Users can examine the cq structure to determine the actual CQ size.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otastruct ib_cq *ib_create_cq(struct ib_device *device,
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_destroy_cq - Destroys the specified CQ.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @cq: The CQ to destroy.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_poll_cq - poll a CQ for completion(s)
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @cq:the CQ being polled
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @num_entries:maximum number of completions to return
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @wc:array of at least @num_entries &struct ib_wc where completions
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * will be returned
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Poll a CQ for (possibly multiple) completions. If the return value
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * is < 0, an error occurred. If the return value is >= 0, it is the
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * number of completions returned. If the return value is
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * non-negative and < num_entries, then the CQ was emptied.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otaint ib_poll_cq(struct ib_cq *cq, int num_entries, struct ib_wc *wc);
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * ib_req_notify_cq - Request completion notification on a CQ.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * @cq: The CQ to generate an event for.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Must contain exactly one of %IB_CQ_SOLICITED or %IB_CQ_NEXT_COMP
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * to request an event on the next solicited event or next work
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * completion at any type, respectively. %IB_CQ_REPORT_MISSED_EVENTS
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * may also be |ed in to request a hint about missed events, as
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * described below.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * Return Value:
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * < 0 means an error occurred while requesting notification
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * == 0 means notification was requested successfully, and if
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * IB_CQ_REPORT_MISSED_EVENTS was passed in, then no events
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * were missed and it is safe to wait for another event. In
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * this case is it guaranteed that any work completions added
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * to the CQ since the last CQ poll will trigger a completion
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * notification event.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * > 0 is only returned if IB_CQ_REPORT_MISSED_EVENTS was passed
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * in. It means that the consumer must poll the CQ again to
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * make sure it is empty to avoid missing an event because of a
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * race between requesting notification and an entry being
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * added to the CQ. This return value means it is possible
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * (but not guaranteed) that a work completion has been added
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * to the CQ since the last poll without triggering a
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Ota * completion notification event.
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otaint ib_req_notify_cq(struct ib_cq *cq, enum ib_cq_notify_flags flags);
c0dd49bdd68c0d758a67d56f07826f3b45cfc664Eiji Otaibt_hca_hdl_t ib_get_ibt_hca_hdl(struct ib_device *device);
c39526b769298791ff5b0b6c5e761f49aabaeb4ePramod Gunjikar#endif /* _SYS_IB_CLIENTS_OF_IB_VERBS_H */