162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * This software is available to you under a choice of one of two
562306a36Sopenharmony_ci * licenses.  You may choose to be licensed under the terms of the GNU
662306a36Sopenharmony_ci * General Public License (GPL) Version 2, available from the file
762306a36Sopenharmony_ci * COPYING in the main directory of this source tree, or the
862306a36Sopenharmony_ci * BSD license below:
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci *     Redistribution and use in source and binary forms, with or
1162306a36Sopenharmony_ci *     without modification, are permitted provided that the following
1262306a36Sopenharmony_ci *     conditions are met:
1362306a36Sopenharmony_ci *
1462306a36Sopenharmony_ci *      - Redistributions of source code must retain the above
1562306a36Sopenharmony_ci *        copyright notice, this list of conditions and the following
1662306a36Sopenharmony_ci *        disclaimer.
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci *      - Redistributions in binary form must reproduce the above
1962306a36Sopenharmony_ci *        copyright notice, this list of conditions and the following
2062306a36Sopenharmony_ci *        disclaimer in the documentation and/or other materials
2162306a36Sopenharmony_ci *        provided with the distribution.
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2462306a36Sopenharmony_ci * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2562306a36Sopenharmony_ci * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2662306a36Sopenharmony_ci * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
2762306a36Sopenharmony_ci * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
2862306a36Sopenharmony_ci * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2962306a36Sopenharmony_ci * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3062306a36Sopenharmony_ci * SOFTWARE.
3162306a36Sopenharmony_ci *
3262306a36Sopenharmony_ci */
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#ifndef USNIC_IB_VERBS_H_
3562306a36Sopenharmony_ci#define USNIC_IB_VERBS_H_
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#include "usnic_ib.h"
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_cienum rdma_link_layer usnic_ib_port_link_layer(struct ib_device *device,
4062306a36Sopenharmony_ci					      u32 port_num);
4162306a36Sopenharmony_ciint usnic_ib_query_device(struct ib_device *ibdev,
4262306a36Sopenharmony_ci				struct ib_device_attr *props,
4362306a36Sopenharmony_ci			  struct ib_udata *uhw);
4462306a36Sopenharmony_ciint usnic_ib_query_port(struct ib_device *ibdev, u32 port,
4562306a36Sopenharmony_ci				struct ib_port_attr *props);
4662306a36Sopenharmony_ciint usnic_ib_query_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr,
4762306a36Sopenharmony_ci				int qp_attr_mask,
4862306a36Sopenharmony_ci				struct ib_qp_init_attr *qp_init_attr);
4962306a36Sopenharmony_ciint usnic_ib_query_gid(struct ib_device *ibdev, u32 port, int index,
5062306a36Sopenharmony_ci				union ib_gid *gid);
5162306a36Sopenharmony_ciint usnic_ib_alloc_pd(struct ib_pd *ibpd, struct ib_udata *udata);
5262306a36Sopenharmony_ciint usnic_ib_dealloc_pd(struct ib_pd *pd, struct ib_udata *udata);
5362306a36Sopenharmony_ciint usnic_ib_create_qp(struct ib_qp *qp, struct ib_qp_init_attr *init_attr,
5462306a36Sopenharmony_ci		       struct ib_udata *udata);
5562306a36Sopenharmony_ciint usnic_ib_destroy_qp(struct ib_qp *qp, struct ib_udata *udata);
5662306a36Sopenharmony_ciint usnic_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
5762306a36Sopenharmony_ci				int attr_mask, struct ib_udata *udata);
5862306a36Sopenharmony_ciint usnic_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
5962306a36Sopenharmony_ci		       struct ib_udata *udata);
6062306a36Sopenharmony_ciint usnic_ib_destroy_cq(struct ib_cq *cq, struct ib_udata *udata);
6162306a36Sopenharmony_cistruct ib_mr *usnic_ib_reg_mr(struct ib_pd *pd, u64 start, u64 length,
6262306a36Sopenharmony_ci				u64 virt_addr, int access_flags,
6362306a36Sopenharmony_ci				struct ib_udata *udata);
6462306a36Sopenharmony_ciint usnic_ib_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata);
6562306a36Sopenharmony_ciint usnic_ib_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata);
6662306a36Sopenharmony_civoid usnic_ib_dealloc_ucontext(struct ib_ucontext *ibcontext);
6762306a36Sopenharmony_ciint usnic_ib_mmap(struct ib_ucontext *context,
6862306a36Sopenharmony_ci			struct vm_area_struct *vma);
6962306a36Sopenharmony_ci#endif /* !USNIC_IB_VERBS_H */
70