Path: blob/master/drivers/infiniband/hw/ehca/hcp_if.h
15112 views
/*1* IBM eServer eHCA Infiniband device driver for Linux on POWER2*3* Firmware Infiniband Interface code for POWER4*5* Authors: Christoph Raisch <[email protected]>6* Hoang-Nam Nguyen <[email protected]>7* Gerd Bayer <[email protected]>8* Waleri Fomin <[email protected]>9*10* Copyright (c) 2005 IBM Corporation11*12* All rights reserved.13*14* This source code is distributed under a dual license of GPL v2.0 and OpenIB15* BSD.16*17* OpenIB BSD License18*19* Redistribution and use in source and binary forms, with or without20* modification, are permitted provided that the following conditions are met:21*22* Redistributions of source code must retain the above copyright notice, this23* list of conditions and the following disclaimer.24*25* Redistributions in binary form must reproduce the above copyright notice,26* this list of conditions and the following disclaimer in the documentation27* and/or other materials28* provided with the distribution.29*30* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"31* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE32* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE33* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE34* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR35* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF36* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR37* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER38* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)39* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE40* POSSIBILITY OF SUCH DAMAGE.41*/4243#ifndef __HCP_IF_H__44#define __HCP_IF_H__4546#include "ehca_classes.h"47#include "ehca_tools.h"48#include "hipz_hw.h"4950/*51* hipz_h_alloc_resource_eq allocates EQ resources in HW and FW, initialize52* resources, create the empty EQPT (ring).53*/54u64 hipz_h_alloc_resource_eq(const struct ipz_adapter_handle adapter_handle,55struct ehca_pfeq *pfeq,56const u32 neq_control,57const u32 number_of_entries,58struct ipz_eq_handle *eq_handle,59u32 * act_nr_of_entries,60u32 * act_pages,61u32 * eq_ist);6263u64 hipz_h_reset_event(const struct ipz_adapter_handle adapter_handle,64struct ipz_eq_handle eq_handle,65const u64 event_mask);66/*67* hipz_h_allocate_resource_cq allocates CQ resources in HW and FW, initialize68* resources, create the empty CQPT (ring).69*/70u64 hipz_h_alloc_resource_cq(const struct ipz_adapter_handle adapter_handle,71struct ehca_cq *cq,72struct ehca_alloc_cq_parms *param);737475/*76* hipz_h_alloc_resource_qp allocates QP resources in HW and FW,77* initialize resources, create empty QPPTs (2 rings).78*/79u64 hipz_h_alloc_resource_qp(const struct ipz_adapter_handle adapter_handle,80struct ehca_alloc_qp_parms *parms, int is_user);8182u64 hipz_h_query_port(const struct ipz_adapter_handle adapter_handle,83const u8 port_id,84struct hipz_query_port *query_port_response_block);8586u64 hipz_h_modify_port(const struct ipz_adapter_handle adapter_handle,87const u8 port_id, const u32 port_cap,88const u8 init_type, const int modify_mask);8990u64 hipz_h_query_hca(const struct ipz_adapter_handle adapter_handle,91struct hipz_query_hca *query_hca_rblock);9293/*94* hipz_h_register_rpage internal function in hcp_if.h for all95* hcp_H_REGISTER_RPAGE calls.96*/97u64 hipz_h_register_rpage(const struct ipz_adapter_handle adapter_handle,98const u8 pagesize,99const u8 queue_type,100const u64 resource_handle,101const u64 logical_address_of_page,102u64 count);103104u64 hipz_h_register_rpage_eq(const struct ipz_adapter_handle adapter_handle,105const struct ipz_eq_handle eq_handle,106struct ehca_pfeq *pfeq,107const u8 pagesize,108const u8 queue_type,109const u64 logical_address_of_page,110const u64 count);111112u64 hipz_h_query_int_state(const struct ipz_adapter_handle113hcp_adapter_handle,114u32 ist);115116u64 hipz_h_register_rpage_cq(const struct ipz_adapter_handle adapter_handle,117const struct ipz_cq_handle cq_handle,118struct ehca_pfcq *pfcq,119const u8 pagesize,120const u8 queue_type,121const u64 logical_address_of_page,122const u64 count,123const struct h_galpa gal);124125u64 hipz_h_register_rpage_qp(const struct ipz_adapter_handle adapter_handle,126const struct ipz_qp_handle qp_handle,127struct ehca_pfqp *pfqp,128const u8 pagesize,129const u8 queue_type,130const u64 logical_address_of_page,131const u64 count,132const struct h_galpa galpa);133134u64 hipz_h_disable_and_get_wqe(const struct ipz_adapter_handle adapter_handle,135const struct ipz_qp_handle qp_handle,136struct ehca_pfqp *pfqp,137void **log_addr_next_sq_wqe_tb_processed,138void **log_addr_next_rq_wqe_tb_processed,139int dis_and_get_function_code);140enum hcall_sigt {141HCALL_SIGT_NO_CQE = 0,142HCALL_SIGT_BY_WQE = 1,143HCALL_SIGT_EVERY = 2144};145146u64 hipz_h_modify_qp(const struct ipz_adapter_handle adapter_handle,147const struct ipz_qp_handle qp_handle,148struct ehca_pfqp *pfqp,149const u64 update_mask,150struct hcp_modify_qp_control_block *mqpcb,151struct h_galpa gal);152153u64 hipz_h_query_qp(const struct ipz_adapter_handle adapter_handle,154const struct ipz_qp_handle qp_handle,155struct ehca_pfqp *pfqp,156struct hcp_modify_qp_control_block *qqpcb,157struct h_galpa gal);158159u64 hipz_h_destroy_qp(const struct ipz_adapter_handle adapter_handle,160struct ehca_qp *qp);161162u64 hipz_h_define_aqp0(const struct ipz_adapter_handle adapter_handle,163const struct ipz_qp_handle qp_handle,164struct h_galpa gal,165u32 port);166167u64 hipz_h_define_aqp1(const struct ipz_adapter_handle adapter_handle,168const struct ipz_qp_handle qp_handle,169struct h_galpa gal,170u32 port, u32 * pma_qp_nr,171u32 * bma_qp_nr);172173u64 hipz_h_attach_mcqp(const struct ipz_adapter_handle adapter_handle,174const struct ipz_qp_handle qp_handle,175struct h_galpa gal,176u16 mcg_dlid,177u64 subnet_prefix, u64 interface_id);178179u64 hipz_h_detach_mcqp(const struct ipz_adapter_handle adapter_handle,180const struct ipz_qp_handle qp_handle,181struct h_galpa gal,182u16 mcg_dlid,183u64 subnet_prefix, u64 interface_id);184185u64 hipz_h_destroy_cq(const struct ipz_adapter_handle adapter_handle,186struct ehca_cq *cq,187u8 force_flag);188189u64 hipz_h_destroy_eq(const struct ipz_adapter_handle adapter_handle,190struct ehca_eq *eq);191192/*193* hipz_h_alloc_resource_mr allocates MR resources in HW and FW, initialize194* resources.195*/196u64 hipz_h_alloc_resource_mr(const struct ipz_adapter_handle adapter_handle,197const struct ehca_mr *mr,198const u64 vaddr,199const u64 length,200const u32 access_ctrl,201const struct ipz_pd pd,202struct ehca_mr_hipzout_parms *outparms);203204/* hipz_h_register_rpage_mr registers MR resource pages in HW and FW */205u64 hipz_h_register_rpage_mr(const struct ipz_adapter_handle adapter_handle,206const struct ehca_mr *mr,207const u8 pagesize,208const u8 queue_type,209const u64 logical_address_of_page,210const u64 count);211212/* hipz_h_query_mr queries MR in HW and FW */213u64 hipz_h_query_mr(const struct ipz_adapter_handle adapter_handle,214const struct ehca_mr *mr,215struct ehca_mr_hipzout_parms *outparms);216217/* hipz_h_free_resource_mr frees MR resources in HW and FW */218u64 hipz_h_free_resource_mr(const struct ipz_adapter_handle adapter_handle,219const struct ehca_mr *mr);220221/* hipz_h_reregister_pmr reregisters MR in HW and FW */222u64 hipz_h_reregister_pmr(const struct ipz_adapter_handle adapter_handle,223const struct ehca_mr *mr,224const u64 vaddr_in,225const u64 length,226const u32 access_ctrl,227const struct ipz_pd pd,228const u64 mr_addr_cb,229struct ehca_mr_hipzout_parms *outparms);230231/* hipz_h_register_smr register shared MR in HW and FW */232u64 hipz_h_register_smr(const struct ipz_adapter_handle adapter_handle,233const struct ehca_mr *mr,234const struct ehca_mr *orig_mr,235const u64 vaddr_in,236const u32 access_ctrl,237const struct ipz_pd pd,238struct ehca_mr_hipzout_parms *outparms);239240/*241* hipz_h_alloc_resource_mw allocates MW resources in HW and FW, initialize242* resources.243*/244u64 hipz_h_alloc_resource_mw(const struct ipz_adapter_handle adapter_handle,245const struct ehca_mw *mw,246const struct ipz_pd pd,247struct ehca_mw_hipzout_parms *outparms);248249/* hipz_h_query_mw queries MW in HW and FW */250u64 hipz_h_query_mw(const struct ipz_adapter_handle adapter_handle,251const struct ehca_mw *mw,252struct ehca_mw_hipzout_parms *outparms);253254/* hipz_h_free_resource_mw frees MW resources in HW and FW */255u64 hipz_h_free_resource_mw(const struct ipz_adapter_handle adapter_handle,256const struct ehca_mw *mw);257258u64 hipz_h_error_data(const struct ipz_adapter_handle adapter_handle,259const u64 ressource_handle,260void *rblock,261unsigned long *byte_count);262u64 hipz_h_eoi(int irq);263264#endif /* __HCP_IF_H__ */265266267