iPXE
mlx_port.h
Go to the documentation of this file.
00001 #ifndef NODNIC_PORT_H_
00002 #define NODNIC_PORT_H_
00003 
00004 /*
00005  * Copyright (C) 2015 Mellanox Technologies Ltd.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301, USA.
00021  */
00022 
00023 FILE_LICENCE ( GPL2_OR_LATER );
00024 
00025 #include "mlx_nodnic_data_structures.h"
00026 
00027 #define NODNIC_PORT_MAC_FILTERS_OFFSET 0x10
00028 
00029 typedef enum {
00030         nodnic_port_option_link_type = 0,
00031         nodnic_port_option_mac_low,
00032         nodnic_port_option_mac_high,
00033         nodnic_port_option_log_cq_size,
00034         nodnic_port_option_reset_needed,
00035         nodnic_port_option_mac_filters_en,
00036         nodnic_port_option_port_state,
00037         nodnic_port_option_network_en,
00038         nodnic_port_option_dma_en,
00039         nodnic_port_option_eq_addr_low,
00040         nodnic_port_option_eq_addr_high,
00041         nodnic_port_option_cq_addr_low,
00042         nodnic_port_option_cq_addr_high,
00043         nodnic_port_option_port_management_change_event,
00044         nodnic_port_option_port_promisc_en,
00045         nodnic_port_option_arm_cq,
00046         nodnic_port_option_port_promisc_multicast_en,
00047 #ifdef DEVICE_CX3
00048         nodnic_port_option_crspace_en,
00049 #endif
00050         nodnic_port_option_send_ring0_uar_index,
00051         nodnic_port_option_send_ring1_uar_index,
00052         nodnic_port_option_cq_n_index,
00053 }nodnic_port_option;
00054 
00055 struct nodnic_port_data_entry{
00056         nodnic_port_option      option;
00057         mlx_uint32                      offset;
00058         mlx_uint8                       align;
00059         mlx_uint32                      mask;
00060 };
00061 
00062 struct nodnic_qp_data_entry{
00063         nodnic_queue_pair_type  type;
00064         mlx_uint32                      send_offset;
00065         mlx_uint32                      recv_offset;
00066 };
00067 
00068 
00069 typedef enum {
00070         nodnic_port_state_down = 0,
00071         nodnic_port_state_initialize,
00072         nodnic_port_state_armed,
00073         nodnic_port_state_active,
00074 }nodnic_port_state;
00075 
00076 mlx_status
00077 nodnic_port_get_state(
00078                                         IN  nodnic_port_priv    *port_priv,
00079                                         OUT nodnic_port_state                   *state
00080                                         );
00081 
00082 mlx_status
00083 nodnic_port_get_type(
00084                                         IN  nodnic_port_priv    *port_priv,
00085                                         OUT nodnic_port_type    *type
00086                                         );
00087 
00088 mlx_status
00089 nodnic_port_query(
00090                                         IN  nodnic_port_priv    *port_priv,
00091                                         IN  nodnic_port_option          option,
00092                                         OUT     mlx_uint32                              *out
00093                                         );
00094 
00095 mlx_status
00096 nodnic_port_set(
00097                                         IN  nodnic_port_priv    *port_priv,
00098                                         IN  nodnic_port_option          option,
00099                                         IN      mlx_uint32                              in
00100                                         );
00101 
00102 mlx_status
00103 nodnic_port_create_cq(
00104                                         IN nodnic_port_priv     *port_priv,
00105                                         IN mlx_size     cq_size,
00106                                         OUT nodnic_cq   **cq
00107                                         );
00108 
00109 mlx_status
00110 nodnic_port_destroy_cq(
00111                                         IN nodnic_port_priv     *port_priv,
00112                                         IN nodnic_cq    *cq
00113                                         );
00114 
00115 mlx_status
00116 nodnic_port_create_qp(
00117                                         IN nodnic_port_priv     *port_priv,
00118                                         IN nodnic_queue_pair_type       type,
00119                                         IN mlx_size     send_wq_size,
00120                                         IN mlx_uint32 send_wqe_num,
00121                                         IN mlx_size     receive_wq_size,
00122                                         IN mlx_uint32 recv_wqe_num,
00123                                         OUT nodnic_qp   **qp
00124                                         );
00125 
00126 mlx_status
00127 nodnic_port_destroy_qp(
00128                                         IN nodnic_port_priv     *port_priv,
00129                                         IN nodnic_queue_pair_type       type,
00130                                         IN nodnic_qp    *qp
00131                                         );
00132 mlx_status
00133 nodnic_port_get_qpn(
00134                         IN nodnic_port_priv     *port_priv,
00135                         IN struct nodnic_ring *ring,
00136                         OUT mlx_uint32 *qpn
00137                         );
00138 mlx_status
00139 nodnic_port_update_ring_doorbell(
00140                                         IN nodnic_port_priv     *port_priv,
00141                                         IN struct nodnic_ring *ring,
00142                                         IN mlx_uint16 index
00143                                         );
00144 mlx_status
00145 nodnic_port_get_cq_size(
00146                 IN nodnic_port_priv     *port_priv,
00147                 OUT mlx_uint64 *cq_size
00148                 );
00149 
00150 mlx_status
00151 nodnic_port_allocate_eq(
00152                                         IN  nodnic_port_priv    *port_priv,
00153                                         IN  mlx_uint8                   log_eq_size
00154                                         );
00155 mlx_status
00156 nodnic_port_free_eq(
00157                                         IN  nodnic_port_priv    *port_priv
00158                                         );
00159 
00160 mlx_status
00161 nodnic_port_add_mac_filter(
00162                                         IN  nodnic_port_priv    *port_priv,
00163                                         IN  mlx_mac_address     mac
00164                                         );
00165 
00166 mlx_status
00167 nodnic_port_remove_mac_filter(
00168                                         IN  nodnic_port_priv    *port_priv,
00169                                         IN  mlx_mac_address     mac
00170                                         );
00171 mlx_status
00172 nodnic_port_add_mgid_filter(
00173                                         IN  nodnic_port_priv    *port_priv,
00174                                         IN  mlx_mac_address     mac
00175                                         );
00176 
00177 mlx_status
00178 nodnic_port_remove_mgid_filter(
00179                                         IN  nodnic_port_priv    *port_priv,
00180                                         IN  mlx_mac_address     mac
00181                                         );
00182 mlx_status
00183 nodnic_port_thin_init(
00184                 IN nodnic_device_priv   *device_priv,
00185                 IN nodnic_port_priv             *port_priv,
00186                 IN mlx_uint8                    port_index
00187                 );
00188 
00189 mlx_status
00190 nodnic_port_set_promisc(
00191                 IN nodnic_port_priv             *port_priv,
00192                 IN mlx_boolean                  value
00193                 );
00194 
00195 mlx_status
00196 nodnic_port_set_promisc_multicast(
00197                 IN nodnic_port_priv             *port_priv,
00198                 IN mlx_boolean                  value
00199                 );
00200 
00201 mlx_status
00202 nodnic_port_init(
00203                 IN nodnic_port_priv             *port_priv
00204                 );
00205 
00206 mlx_status
00207 nodnic_port_close(
00208                 IN nodnic_port_priv             *port_priv
00209                 );
00210 
00211 mlx_status
00212 nodnic_port_enable_dma(
00213                 IN nodnic_port_priv             *port_priv
00214                 );
00215 
00216 mlx_status
00217 nodnic_port_disable_dma(
00218                 IN nodnic_port_priv             *port_priv
00219                 );
00220 
00221 mlx_status
00222 nodnic_port_read_reset_needed(
00223                                                 IN nodnic_port_priv             *port_priv,
00224                                                 OUT mlx_boolean                 *reset_needed
00225                                                 );
00226 
00227 mlx_status
00228 nodnic_port_read_port_management_change_event(
00229                                                 IN nodnic_port_priv             *port_priv,
00230                                                 OUT mlx_boolean                 *change_event
00231                                                 );
00232 mlx_status
00233 nodnic_port_set_send_uar_offset(
00234                 IN  nodnic_port_priv    *port_priv
00235                 );
00236 
00237 mlx_status
00238 nodnic_port_update_tx_db_func(
00239                 IN nodnic_device_priv   *device_priv,
00240                 IN nodnic_port_priv             *port_priv
00241                 );
00242 #endif /* STUB_NODNIC_PORT_H_ */