1/*- 2 * Copyright (c) 2012-2015 Solarflare Communications Inc. 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 * 2. Redistributions in binary form must reproduce the above copyright notice, 11 * this list of conditions and the following disclaimer in the documentation 12 * and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * 26 * The views and conclusions contained in the software and documentation are 27 * those of the authors and should not be interpreted as representing official 28 * policies, either expressed or implied, of the FreeBSD Project. 29 *
| 1/*- 2 * Copyright (c) 2012-2015 Solarflare Communications Inc. 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 * 2. Redistributions in binary form must reproduce the above copyright notice, 11 * this list of conditions and the following disclaimer in the documentation 12 * and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * 26 * The views and conclusions contained in the software and documentation are 27 * those of the authors and should not be interpreted as representing official 28 * policies, either expressed or implied, of the FreeBSD Project. 29 *
|
30 * $FreeBSD: head/sys/dev/sfxge/common/hunt_impl.h 292008 2015-12-09 06:24:22Z arybchik $
| 30 * $FreeBSD: head/sys/dev/sfxge/common/hunt_impl.h 292055 2015-12-10 07:42:56Z arybchik $
|
31 */ 32 33#ifndef _SYS_HUNT_IMPL_H 34#define _SYS_HUNT_IMPL_H 35 36#include "efx.h" 37#include "efx_regs.h" 38#include "efx_regs_ef10.h" 39#include "efx_mcdi.h" 40 41#ifdef __cplusplus 42extern "C" { 43#endif 44 45#define HUNTINGTON_NVRAM_CHUNK 0x80 46 47/* Alignment requirement for value written to RX WPTR: 48 * the WPTR must be aligned to an 8 descriptor boundary 49 */ 50#define HUNTINGTON_RX_WPTR_ALIGN 8 51 52/* Invalid RSS context handle */ 53#define HUNTINGTON_RSS_CONTEXT_INVALID (0xffffffff) 54 55 56/* EV */ 57 58 __checkReturn efx_rc_t 59hunt_ev_init( 60 __in efx_nic_t *enp); 61 62 void 63hunt_ev_fini( 64 __in efx_nic_t *enp); 65 66 __checkReturn efx_rc_t 67hunt_ev_qcreate( 68 __in efx_nic_t *enp, 69 __in unsigned int index, 70 __in efsys_mem_t *esmp, 71 __in size_t n, 72 __in uint32_t id, 73 __in efx_evq_t *eep); 74 75 void 76hunt_ev_qdestroy( 77 __in efx_evq_t *eep); 78 79 __checkReturn efx_rc_t 80hunt_ev_qprime( 81 __in efx_evq_t *eep, 82 __in unsigned int count); 83 84 void 85hunt_ev_qpost( 86 __in efx_evq_t *eep, 87 __in uint16_t data); 88 89 __checkReturn efx_rc_t 90hunt_ev_qmoderate( 91 __in efx_evq_t *eep, 92 __in unsigned int us); 93 94#if EFSYS_OPT_QSTATS 95 void 96hunt_ev_qstats_update( 97 __in efx_evq_t *eep, 98 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); 99#endif /* EFSYS_OPT_QSTATS */ 100 101 void 102hunt_ev_rxlabel_init( 103 __in efx_evq_t *eep, 104 __in efx_rxq_t *erp, 105 __in unsigned int label); 106 107 void 108hunt_ev_rxlabel_fini( 109 __in efx_evq_t *eep, 110 __in unsigned int label); 111 112/* INTR */ 113 114 __checkReturn efx_rc_t 115hunt_intr_init( 116 __in efx_nic_t *enp, 117 __in efx_intr_type_t type, 118 __in efsys_mem_t *esmp); 119 120 void 121hunt_intr_enable( 122 __in efx_nic_t *enp); 123 124 void 125hunt_intr_disable( 126 __in efx_nic_t *enp); 127 128 void 129hunt_intr_disable_unlocked( 130 __in efx_nic_t *enp); 131 132 __checkReturn efx_rc_t 133hunt_intr_trigger( 134 __in efx_nic_t *enp, 135 __in unsigned int level); 136 137 void 138hunt_intr_fini( 139 __in efx_nic_t *enp); 140 141/* NIC */ 142 143extern __checkReturn efx_rc_t 144hunt_nic_probe( 145 __in efx_nic_t *enp); 146 147extern __checkReturn efx_rc_t 148hunt_nic_set_drv_limits( 149 __inout efx_nic_t *enp, 150 __in efx_drv_limits_t *edlp); 151 152extern __checkReturn efx_rc_t 153hunt_nic_get_vi_pool( 154 __in efx_nic_t *enp, 155 __out uint32_t *vi_countp); 156 157extern __checkReturn efx_rc_t 158hunt_nic_get_bar_region( 159 __in efx_nic_t *enp, 160 __in efx_nic_region_t region, 161 __out uint32_t *offsetp, 162 __out size_t *sizep); 163 164extern __checkReturn efx_rc_t 165hunt_nic_reset( 166 __in efx_nic_t *enp); 167 168extern __checkReturn efx_rc_t 169hunt_nic_init( 170 __in efx_nic_t *enp); 171 172#if EFSYS_OPT_DIAG 173 174extern __checkReturn efx_rc_t 175hunt_nic_register_test( 176 __in efx_nic_t *enp); 177 178#endif /* EFSYS_OPT_DIAG */ 179 180extern void 181hunt_nic_fini( 182 __in efx_nic_t *enp); 183 184extern void 185hunt_nic_unprobe( 186 __in efx_nic_t *enp); 187 188 189/* MAC */ 190 191extern __checkReturn efx_rc_t 192hunt_mac_poll( 193 __in efx_nic_t *enp, 194 __out efx_link_mode_t *link_modep); 195 196extern __checkReturn efx_rc_t 197hunt_mac_up( 198 __in efx_nic_t *enp, 199 __out boolean_t *mac_upp); 200 201extern __checkReturn efx_rc_t 202hunt_mac_addr_set( 203 __in efx_nic_t *enp); 204 205extern __checkReturn efx_rc_t 206hunt_mac_reconfigure( 207 __in efx_nic_t *enp); 208 209extern __checkReturn efx_rc_t 210hunt_mac_multicast_list_set( 211 __in efx_nic_t *enp); 212 213extern __checkReturn efx_rc_t 214hunt_mac_filter_default_rxq_set( 215 __in efx_nic_t *enp, 216 __in efx_rxq_t *erp, 217 __in boolean_t using_rss); 218 219extern void 220hunt_mac_filter_default_rxq_clear( 221 __in efx_nic_t *enp); 222 223#if EFSYS_OPT_LOOPBACK 224 225extern __checkReturn efx_rc_t 226hunt_mac_loopback_set( 227 __in efx_nic_t *enp, 228 __in efx_link_mode_t link_mode, 229 __in efx_loopback_type_t loopback_type); 230 231#endif /* EFSYS_OPT_LOOPBACK */ 232 233#if EFSYS_OPT_MAC_STATS 234 235extern __checkReturn efx_rc_t 236hunt_mac_stats_update( 237 __in efx_nic_t *enp, 238 __in efsys_mem_t *esmp, 239 __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, 240 __inout_opt uint32_t *generationp); 241 242#endif /* EFSYS_OPT_MAC_STATS */ 243 244 245/* MCDI */ 246 247#if EFSYS_OPT_MCDI 248 249extern __checkReturn efx_rc_t 250hunt_mcdi_init( 251 __in efx_nic_t *enp, 252 __in const efx_mcdi_transport_t *mtp); 253 254extern void 255hunt_mcdi_fini( 256 __in efx_nic_t *enp); 257 258extern void 259hunt_mcdi_request_copyin( 260 __in efx_nic_t *enp, 261 __in efx_mcdi_req_t *emrp, 262 __in unsigned int seq, 263 __in boolean_t ev_cpl, 264 __in boolean_t new_epoch); 265 266extern void 267hunt_mcdi_read_response( 268 __in efx_nic_t *enp, 269 __out void *bufferp, 270 __in size_t offset, 271 __in size_t length); 272 273extern __checkReturn boolean_t 274hunt_mcdi_request_poll( 275 __in efx_nic_t *enp); 276 277extern void 278hunt_mcdi_request_copyout( 279 __in efx_nic_t *enp, 280 __in efx_mcdi_req_t *emrp); 281 282extern efx_rc_t 283hunt_mcdi_poll_reboot( 284 __in efx_nic_t *enp); 285 286extern __checkReturn efx_rc_t
| 31 */ 32 33#ifndef _SYS_HUNT_IMPL_H 34#define _SYS_HUNT_IMPL_H 35 36#include "efx.h" 37#include "efx_regs.h" 38#include "efx_regs_ef10.h" 39#include "efx_mcdi.h" 40 41#ifdef __cplusplus 42extern "C" { 43#endif 44 45#define HUNTINGTON_NVRAM_CHUNK 0x80 46 47/* Alignment requirement for value written to RX WPTR: 48 * the WPTR must be aligned to an 8 descriptor boundary 49 */ 50#define HUNTINGTON_RX_WPTR_ALIGN 8 51 52/* Invalid RSS context handle */ 53#define HUNTINGTON_RSS_CONTEXT_INVALID (0xffffffff) 54 55 56/* EV */ 57 58 __checkReturn efx_rc_t 59hunt_ev_init( 60 __in efx_nic_t *enp); 61 62 void 63hunt_ev_fini( 64 __in efx_nic_t *enp); 65 66 __checkReturn efx_rc_t 67hunt_ev_qcreate( 68 __in efx_nic_t *enp, 69 __in unsigned int index, 70 __in efsys_mem_t *esmp, 71 __in size_t n, 72 __in uint32_t id, 73 __in efx_evq_t *eep); 74 75 void 76hunt_ev_qdestroy( 77 __in efx_evq_t *eep); 78 79 __checkReturn efx_rc_t 80hunt_ev_qprime( 81 __in efx_evq_t *eep, 82 __in unsigned int count); 83 84 void 85hunt_ev_qpost( 86 __in efx_evq_t *eep, 87 __in uint16_t data); 88 89 __checkReturn efx_rc_t 90hunt_ev_qmoderate( 91 __in efx_evq_t *eep, 92 __in unsigned int us); 93 94#if EFSYS_OPT_QSTATS 95 void 96hunt_ev_qstats_update( 97 __in efx_evq_t *eep, 98 __inout_ecount(EV_NQSTATS) efsys_stat_t *stat); 99#endif /* EFSYS_OPT_QSTATS */ 100 101 void 102hunt_ev_rxlabel_init( 103 __in efx_evq_t *eep, 104 __in efx_rxq_t *erp, 105 __in unsigned int label); 106 107 void 108hunt_ev_rxlabel_fini( 109 __in efx_evq_t *eep, 110 __in unsigned int label); 111 112/* INTR */ 113 114 __checkReturn efx_rc_t 115hunt_intr_init( 116 __in efx_nic_t *enp, 117 __in efx_intr_type_t type, 118 __in efsys_mem_t *esmp); 119 120 void 121hunt_intr_enable( 122 __in efx_nic_t *enp); 123 124 void 125hunt_intr_disable( 126 __in efx_nic_t *enp); 127 128 void 129hunt_intr_disable_unlocked( 130 __in efx_nic_t *enp); 131 132 __checkReturn efx_rc_t 133hunt_intr_trigger( 134 __in efx_nic_t *enp, 135 __in unsigned int level); 136 137 void 138hunt_intr_fini( 139 __in efx_nic_t *enp); 140 141/* NIC */ 142 143extern __checkReturn efx_rc_t 144hunt_nic_probe( 145 __in efx_nic_t *enp); 146 147extern __checkReturn efx_rc_t 148hunt_nic_set_drv_limits( 149 __inout efx_nic_t *enp, 150 __in efx_drv_limits_t *edlp); 151 152extern __checkReturn efx_rc_t 153hunt_nic_get_vi_pool( 154 __in efx_nic_t *enp, 155 __out uint32_t *vi_countp); 156 157extern __checkReturn efx_rc_t 158hunt_nic_get_bar_region( 159 __in efx_nic_t *enp, 160 __in efx_nic_region_t region, 161 __out uint32_t *offsetp, 162 __out size_t *sizep); 163 164extern __checkReturn efx_rc_t 165hunt_nic_reset( 166 __in efx_nic_t *enp); 167 168extern __checkReturn efx_rc_t 169hunt_nic_init( 170 __in efx_nic_t *enp); 171 172#if EFSYS_OPT_DIAG 173 174extern __checkReturn efx_rc_t 175hunt_nic_register_test( 176 __in efx_nic_t *enp); 177 178#endif /* EFSYS_OPT_DIAG */ 179 180extern void 181hunt_nic_fini( 182 __in efx_nic_t *enp); 183 184extern void 185hunt_nic_unprobe( 186 __in efx_nic_t *enp); 187 188 189/* MAC */ 190 191extern __checkReturn efx_rc_t 192hunt_mac_poll( 193 __in efx_nic_t *enp, 194 __out efx_link_mode_t *link_modep); 195 196extern __checkReturn efx_rc_t 197hunt_mac_up( 198 __in efx_nic_t *enp, 199 __out boolean_t *mac_upp); 200 201extern __checkReturn efx_rc_t 202hunt_mac_addr_set( 203 __in efx_nic_t *enp); 204 205extern __checkReturn efx_rc_t 206hunt_mac_reconfigure( 207 __in efx_nic_t *enp); 208 209extern __checkReturn efx_rc_t 210hunt_mac_multicast_list_set( 211 __in efx_nic_t *enp); 212 213extern __checkReturn efx_rc_t 214hunt_mac_filter_default_rxq_set( 215 __in efx_nic_t *enp, 216 __in efx_rxq_t *erp, 217 __in boolean_t using_rss); 218 219extern void 220hunt_mac_filter_default_rxq_clear( 221 __in efx_nic_t *enp); 222 223#if EFSYS_OPT_LOOPBACK 224 225extern __checkReturn efx_rc_t 226hunt_mac_loopback_set( 227 __in efx_nic_t *enp, 228 __in efx_link_mode_t link_mode, 229 __in efx_loopback_type_t loopback_type); 230 231#endif /* EFSYS_OPT_LOOPBACK */ 232 233#if EFSYS_OPT_MAC_STATS 234 235extern __checkReturn efx_rc_t 236hunt_mac_stats_update( 237 __in efx_nic_t *enp, 238 __in efsys_mem_t *esmp, 239 __inout_ecount(EFX_MAC_NSTATS) efsys_stat_t *stat, 240 __inout_opt uint32_t *generationp); 241 242#endif /* EFSYS_OPT_MAC_STATS */ 243 244 245/* MCDI */ 246 247#if EFSYS_OPT_MCDI 248 249extern __checkReturn efx_rc_t 250hunt_mcdi_init( 251 __in efx_nic_t *enp, 252 __in const efx_mcdi_transport_t *mtp); 253 254extern void 255hunt_mcdi_fini( 256 __in efx_nic_t *enp); 257 258extern void 259hunt_mcdi_request_copyin( 260 __in efx_nic_t *enp, 261 __in efx_mcdi_req_t *emrp, 262 __in unsigned int seq, 263 __in boolean_t ev_cpl, 264 __in boolean_t new_epoch); 265 266extern void 267hunt_mcdi_read_response( 268 __in efx_nic_t *enp, 269 __out void *bufferp, 270 __in size_t offset, 271 __in size_t length); 272 273extern __checkReturn boolean_t 274hunt_mcdi_request_poll( 275 __in efx_nic_t *enp); 276 277extern void 278hunt_mcdi_request_copyout( 279 __in efx_nic_t *enp, 280 __in efx_mcdi_req_t *emrp); 281 282extern efx_rc_t 283hunt_mcdi_poll_reboot( 284 __in efx_nic_t *enp); 285 286extern __checkReturn efx_rc_t
|
287hunt_mcdi_fw_update_supported(
| 287hunt_mcdi_feature_supported(
|
288 __in efx_nic_t *enp,
| 288 __in efx_nic_t *enp,
|
| 289 __in efx_mcdi_feature_id_t id,
|
289 __out boolean_t *supportedp); 290
| 290 __out boolean_t *supportedp); 291
|
291extern __checkReturn efx_rc_t 292hunt_mcdi_macaddr_change_supported( 293 __in efx_nic_t *enp, 294 __out boolean_t *supportedp); 295 296extern __checkReturn efx_rc_t 297hunt_mcdi_link_control_supported( 298 __in efx_nic_t *enp, 299 __out boolean_t *supportedp); 300 301extern __checkReturn efx_rc_t 302hunt_mcdi_mac_spoofing_supported( 303 __in efx_nic_t *enp, 304 __out boolean_t *supportedp); 305 306
| |
307#endif /* EFSYS_OPT_MCDI */ 308 309/* NVRAM */ 310 311#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD 312 313extern __checkReturn efx_rc_t 314hunt_nvram_buf_read_tlv( 315 __in efx_nic_t *enp, 316 __in_bcount(max_seg_size) caddr_t seg_data, 317 __in size_t max_seg_size, 318 __in uint32_t tag, 319 __deref_out_bcount_opt(*sizep) caddr_t *datap, 320 __out size_t *sizep); 321 322extern __checkReturn efx_rc_t 323hunt_nvram_buf_write_tlv( 324 __inout_bcount(partn_size) caddr_t partn_data, 325 __in size_t partn_size, 326 __in uint32_t tag, 327 __in_bcount(tag_size) caddr_t tag_data, 328 __in size_t tag_size, 329 __out size_t *total_lengthp); 330 331extern __checkReturn efx_rc_t 332hunt_nvram_partn_read_tlv( 333 __in efx_nic_t *enp, 334 __in uint32_t partn, 335 __in uint32_t tag, 336 __deref_out_bcount_opt(*sizep) caddr_t *datap, 337 __out size_t *sizep); 338 339extern __checkReturn efx_rc_t 340hunt_nvram_partn_write_tlv( 341 __in efx_nic_t *enp, 342 __in uint32_t partn, 343 __in uint32_t tag, 344 __in_bcount(size) caddr_t data, 345 __in size_t size); 346 347extern __checkReturn efx_rc_t 348hunt_nvram_partn_write_segment_tlv( 349 __in efx_nic_t *enp, 350 __in uint32_t partn, 351 __in uint32_t tag, 352 __in_bcount(size) caddr_t data, 353 __in size_t size, 354 __in boolean_t all_segments); 355 356extern __checkReturn efx_rc_t 357hunt_nvram_partn_size( 358 __in efx_nic_t *enp, 359 __in unsigned int partn, 360 __out size_t *sizep); 361 362extern __checkReturn efx_rc_t 363hunt_nvram_partn_lock( 364 __in efx_nic_t *enp, 365 __in unsigned int partn); 366 367extern __checkReturn efx_rc_t 368hunt_nvram_partn_read( 369 __in efx_nic_t *enp, 370 __in unsigned int partn, 371 __in unsigned int offset, 372 __out_bcount(size) caddr_t data, 373 __in size_t size); 374 375extern __checkReturn efx_rc_t 376hunt_nvram_partn_erase( 377 __in efx_nic_t *enp, 378 __in unsigned int partn, 379 __in unsigned int offset, 380 __in size_t size); 381 382extern __checkReturn efx_rc_t 383hunt_nvram_partn_write( 384 __in efx_nic_t *enp, 385 __in unsigned int partn, 386 __in unsigned int offset, 387 __out_bcount(size) caddr_t data, 388 __in size_t size); 389 390extern void 391hunt_nvram_partn_unlock( 392 __in efx_nic_t *enp, 393 __in unsigned int partn); 394 395#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ 396 397#if EFSYS_OPT_NVRAM 398 399#if EFSYS_OPT_DIAG 400 401extern __checkReturn efx_rc_t 402hunt_nvram_test( 403 __in efx_nic_t *enp); 404 405#endif /* EFSYS_OPT_DIAG */ 406 407extern __checkReturn efx_rc_t 408hunt_nvram_size( 409 __in efx_nic_t *enp, 410 __in efx_nvram_type_t type, 411 __out size_t *sizep); 412 413extern __checkReturn efx_rc_t 414hunt_nvram_get_version( 415 __in efx_nic_t *enp, 416 __in efx_nvram_type_t type, 417 __out uint32_t *subtypep, 418 __out_ecount(4) uint16_t version[4]); 419 420extern __checkReturn efx_rc_t 421hunt_nvram_rw_start( 422 __in efx_nic_t *enp, 423 __in efx_nvram_type_t type, 424 __out size_t *pref_chunkp); 425 426extern __checkReturn efx_rc_t 427hunt_nvram_read_chunk( 428 __in efx_nic_t *enp, 429 __in efx_nvram_type_t type, 430 __in unsigned int offset, 431 __out_bcount(size) caddr_t data, 432 __in size_t size); 433 434extern __checkReturn efx_rc_t 435hunt_nvram_erase( 436 __in efx_nic_t *enp, 437 __in efx_nvram_type_t type); 438 439extern __checkReturn efx_rc_t 440hunt_nvram_write_chunk( 441 __in efx_nic_t *enp, 442 __in efx_nvram_type_t type, 443 __in unsigned int offset, 444 __in_bcount(size) caddr_t data, 445 __in size_t size); 446 447extern void 448hunt_nvram_rw_finish( 449 __in efx_nic_t *enp, 450 __in efx_nvram_type_t type); 451 452extern __checkReturn efx_rc_t 453hunt_nvram_partn_set_version( 454 __in efx_nic_t *enp, 455 __in unsigned int partn, 456 __in_ecount(4) uint16_t version[4]); 457 458extern __checkReturn efx_rc_t 459hunt_nvram_set_version( 460 __in efx_nic_t *enp, 461 __in efx_nvram_type_t type, 462 __in_ecount(4) uint16_t version[4]); 463 464#endif /* EFSYS_OPT_NVRAM */ 465 466 467/* PHY */ 468 469typedef struct hunt_link_state_s { 470 uint32_t hls_adv_cap_mask; 471 uint32_t hls_lp_cap_mask; 472 unsigned int hls_fcntl; 473 efx_link_mode_t hls_link_mode; 474#if EFSYS_OPT_LOOPBACK 475 efx_loopback_type_t hls_loopback; 476#endif 477 boolean_t hls_mac_up; 478} hunt_link_state_t; 479 480extern void 481hunt_phy_link_ev( 482 __in efx_nic_t *enp, 483 __in efx_qword_t *eqp, 484 __out efx_link_mode_t *link_modep); 485 486extern __checkReturn efx_rc_t 487hunt_phy_get_link( 488 __in efx_nic_t *enp, 489 __out hunt_link_state_t *hlsp); 490 491extern __checkReturn efx_rc_t 492hunt_phy_power( 493 __in efx_nic_t *enp, 494 __in boolean_t on); 495 496extern __checkReturn efx_rc_t 497hunt_phy_reconfigure( 498 __in efx_nic_t *enp); 499 500extern __checkReturn efx_rc_t 501hunt_phy_verify( 502 __in efx_nic_t *enp); 503 504extern __checkReturn efx_rc_t 505hunt_phy_oui_get( 506 __in efx_nic_t *enp, 507 __out uint32_t *ouip); 508 509#if EFSYS_OPT_PHY_STATS 510 511extern __checkReturn efx_rc_t 512hunt_phy_stats_update( 513 __in efx_nic_t *enp, 514 __in efsys_mem_t *esmp, 515 __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); 516 517#endif /* EFSYS_OPT_PHY_STATS */ 518 519#if EFSYS_OPT_PHY_PROPS 520 521#if EFSYS_OPT_NAMES 522 523extern const char * 524hunt_phy_prop_name( 525 __in efx_nic_t *enp, 526 __in unsigned int id); 527 528#endif /* EFSYS_OPT_NAMES */ 529 530extern __checkReturn efx_rc_t 531hunt_phy_prop_get( 532 __in efx_nic_t *enp, 533 __in unsigned int id, 534 __in uint32_t flags, 535 __out uint32_t *valp); 536 537extern __checkReturn efx_rc_t 538hunt_phy_prop_set( 539 __in efx_nic_t *enp, 540 __in unsigned int id, 541 __in uint32_t val); 542 543#endif /* EFSYS_OPT_PHY_PROPS */ 544 545#if EFSYS_OPT_BIST 546 547extern __checkReturn efx_rc_t 548hunt_bist_enable_offline( 549 __in efx_nic_t *enp); 550 551extern __checkReturn efx_rc_t 552hunt_bist_start( 553 __in efx_nic_t *enp, 554 __in efx_bist_type_t type); 555 556extern __checkReturn efx_rc_t 557hunt_bist_poll( 558 __in efx_nic_t *enp, 559 __in efx_bist_type_t type, 560 __out efx_bist_result_t *resultp, 561 __out_opt __drv_when(count > 0, __notnull) 562 uint32_t *value_maskp, 563 __out_ecount_opt(count) __drv_when(count > 0, __notnull) 564 unsigned long *valuesp, 565 __in size_t count); 566 567extern void 568hunt_bist_stop( 569 __in efx_nic_t *enp, 570 __in efx_bist_type_t type); 571 572#endif /* EFSYS_OPT_BIST */ 573 574 575/* SRAM */ 576 577#if EFSYS_OPT_DIAG 578 579extern __checkReturn efx_rc_t 580hunt_sram_test( 581 __in efx_nic_t *enp, 582 __in efx_sram_pattern_fn_t func); 583 584#endif /* EFSYS_OPT_DIAG */ 585 586 587/* TX */ 588 589extern __checkReturn efx_rc_t 590hunt_tx_init( 591 __in efx_nic_t *enp); 592 593extern void 594hunt_tx_fini( 595 __in efx_nic_t *enp); 596 597extern __checkReturn efx_rc_t 598hunt_tx_qcreate( 599 __in efx_nic_t *enp, 600 __in unsigned int index, 601 __in unsigned int label, 602 __in efsys_mem_t *esmp, 603 __in size_t n, 604 __in uint32_t id, 605 __in uint16_t flags, 606 __in efx_evq_t *eep, 607 __in efx_txq_t *etp, 608 __out unsigned int *addedp); 609 610extern void 611hunt_tx_qdestroy( 612 __in efx_txq_t *etp); 613 614extern __checkReturn efx_rc_t 615hunt_tx_qpost( 616 __in efx_txq_t *etp, 617 __in_ecount(n) efx_buffer_t *eb, 618 __in unsigned int n, 619 __in unsigned int completed, 620 __inout unsigned int *addedp); 621 622extern void 623hunt_tx_qpush( 624 __in efx_txq_t *etp, 625 __in unsigned int added, 626 __in unsigned int pushed); 627 628extern __checkReturn efx_rc_t 629hunt_tx_qpace( 630 __in efx_txq_t *etp, 631 __in unsigned int ns); 632 633extern __checkReturn efx_rc_t 634hunt_tx_qflush( 635 __in efx_txq_t *etp); 636 637extern void 638hunt_tx_qenable( 639 __in efx_txq_t *etp); 640 641extern __checkReturn efx_rc_t 642hunt_tx_qpio_enable( 643 __in efx_txq_t *etp); 644 645extern void 646hunt_tx_qpio_disable( 647 __in efx_txq_t *etp); 648 649extern __checkReturn efx_rc_t 650hunt_tx_qpio_write( 651 __in efx_txq_t *etp, 652 __in_ecount(buf_length) uint8_t *buffer, 653 __in size_t buf_length, 654 __in size_t pio_buf_offset); 655 656extern __checkReturn efx_rc_t 657hunt_tx_qpio_post( 658 __in efx_txq_t *etp, 659 __in size_t pkt_length, 660 __in unsigned int completed, 661 __inout unsigned int *addedp); 662 663extern __checkReturn efx_rc_t 664hunt_tx_qdesc_post( 665 __in efx_txq_t *etp, 666 __in_ecount(n) efx_desc_t *ed, 667 __in unsigned int n, 668 __in unsigned int completed, 669 __inout unsigned int *addedp); 670 671extern void 672hunt_tx_qdesc_dma_create( 673 __in efx_txq_t *etp, 674 __in efsys_dma_addr_t addr, 675 __in size_t size, 676 __in boolean_t eop, 677 __out efx_desc_t *edp); 678 679extern void 680hunt_tx_qdesc_tso_create( 681 __in efx_txq_t *etp, 682 __in uint16_t ipv4_id, 683 __in uint32_t tcp_seq, 684 __in uint8_t tcp_flags, 685 __out efx_desc_t *edp); 686 687extern void 688hunt_tx_qdesc_vlantci_create( 689 __in efx_txq_t *etp, 690 __in uint16_t vlan_tci, 691 __out efx_desc_t *edp); 692 693 694#if EFSYS_OPT_QSTATS 695 696extern void 697hunt_tx_qstats_update( 698 __in efx_txq_t *etp, 699 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); 700 701#endif /* EFSYS_OPT_QSTATS */ 702 703/* PIO */ 704 705/* Missing register definitions */ 706#ifndef ER_DZ_TX_PIOBUF_OFST 707#define ER_DZ_TX_PIOBUF_OFST 0x00001000 708#endif 709#ifndef ER_DZ_TX_PIOBUF_STEP 710#define ER_DZ_TX_PIOBUF_STEP 8192 711#endif 712#ifndef ER_DZ_TX_PIOBUF_ROWS 713#define ER_DZ_TX_PIOBUF_ROWS 2048 714#endif 715 716#ifndef ER_DZ_TX_PIOBUF_SIZE 717#define ER_DZ_TX_PIOBUF_SIZE 2048 718#endif 719 720#define HUNT_PIOBUF_NBUFS (16) 721#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE) 722 723#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) 724
| 292#endif /* EFSYS_OPT_MCDI */ 293 294/* NVRAM */ 295 296#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD 297 298extern __checkReturn efx_rc_t 299hunt_nvram_buf_read_tlv( 300 __in efx_nic_t *enp, 301 __in_bcount(max_seg_size) caddr_t seg_data, 302 __in size_t max_seg_size, 303 __in uint32_t tag, 304 __deref_out_bcount_opt(*sizep) caddr_t *datap, 305 __out size_t *sizep); 306 307extern __checkReturn efx_rc_t 308hunt_nvram_buf_write_tlv( 309 __inout_bcount(partn_size) caddr_t partn_data, 310 __in size_t partn_size, 311 __in uint32_t tag, 312 __in_bcount(tag_size) caddr_t tag_data, 313 __in size_t tag_size, 314 __out size_t *total_lengthp); 315 316extern __checkReturn efx_rc_t 317hunt_nvram_partn_read_tlv( 318 __in efx_nic_t *enp, 319 __in uint32_t partn, 320 __in uint32_t tag, 321 __deref_out_bcount_opt(*sizep) caddr_t *datap, 322 __out size_t *sizep); 323 324extern __checkReturn efx_rc_t 325hunt_nvram_partn_write_tlv( 326 __in efx_nic_t *enp, 327 __in uint32_t partn, 328 __in uint32_t tag, 329 __in_bcount(size) caddr_t data, 330 __in size_t size); 331 332extern __checkReturn efx_rc_t 333hunt_nvram_partn_write_segment_tlv( 334 __in efx_nic_t *enp, 335 __in uint32_t partn, 336 __in uint32_t tag, 337 __in_bcount(size) caddr_t data, 338 __in size_t size, 339 __in boolean_t all_segments); 340 341extern __checkReturn efx_rc_t 342hunt_nvram_partn_size( 343 __in efx_nic_t *enp, 344 __in unsigned int partn, 345 __out size_t *sizep); 346 347extern __checkReturn efx_rc_t 348hunt_nvram_partn_lock( 349 __in efx_nic_t *enp, 350 __in unsigned int partn); 351 352extern __checkReturn efx_rc_t 353hunt_nvram_partn_read( 354 __in efx_nic_t *enp, 355 __in unsigned int partn, 356 __in unsigned int offset, 357 __out_bcount(size) caddr_t data, 358 __in size_t size); 359 360extern __checkReturn efx_rc_t 361hunt_nvram_partn_erase( 362 __in efx_nic_t *enp, 363 __in unsigned int partn, 364 __in unsigned int offset, 365 __in size_t size); 366 367extern __checkReturn efx_rc_t 368hunt_nvram_partn_write( 369 __in efx_nic_t *enp, 370 __in unsigned int partn, 371 __in unsigned int offset, 372 __out_bcount(size) caddr_t data, 373 __in size_t size); 374 375extern void 376hunt_nvram_partn_unlock( 377 __in efx_nic_t *enp, 378 __in unsigned int partn); 379 380#endif /* EFSYS_OPT_NVRAM || EFSYS_OPT_VPD */ 381 382#if EFSYS_OPT_NVRAM 383 384#if EFSYS_OPT_DIAG 385 386extern __checkReturn efx_rc_t 387hunt_nvram_test( 388 __in efx_nic_t *enp); 389 390#endif /* EFSYS_OPT_DIAG */ 391 392extern __checkReturn efx_rc_t 393hunt_nvram_size( 394 __in efx_nic_t *enp, 395 __in efx_nvram_type_t type, 396 __out size_t *sizep); 397 398extern __checkReturn efx_rc_t 399hunt_nvram_get_version( 400 __in efx_nic_t *enp, 401 __in efx_nvram_type_t type, 402 __out uint32_t *subtypep, 403 __out_ecount(4) uint16_t version[4]); 404 405extern __checkReturn efx_rc_t 406hunt_nvram_rw_start( 407 __in efx_nic_t *enp, 408 __in efx_nvram_type_t type, 409 __out size_t *pref_chunkp); 410 411extern __checkReturn efx_rc_t 412hunt_nvram_read_chunk( 413 __in efx_nic_t *enp, 414 __in efx_nvram_type_t type, 415 __in unsigned int offset, 416 __out_bcount(size) caddr_t data, 417 __in size_t size); 418 419extern __checkReturn efx_rc_t 420hunt_nvram_erase( 421 __in efx_nic_t *enp, 422 __in efx_nvram_type_t type); 423 424extern __checkReturn efx_rc_t 425hunt_nvram_write_chunk( 426 __in efx_nic_t *enp, 427 __in efx_nvram_type_t type, 428 __in unsigned int offset, 429 __in_bcount(size) caddr_t data, 430 __in size_t size); 431 432extern void 433hunt_nvram_rw_finish( 434 __in efx_nic_t *enp, 435 __in efx_nvram_type_t type); 436 437extern __checkReturn efx_rc_t 438hunt_nvram_partn_set_version( 439 __in efx_nic_t *enp, 440 __in unsigned int partn, 441 __in_ecount(4) uint16_t version[4]); 442 443extern __checkReturn efx_rc_t 444hunt_nvram_set_version( 445 __in efx_nic_t *enp, 446 __in efx_nvram_type_t type, 447 __in_ecount(4) uint16_t version[4]); 448 449#endif /* EFSYS_OPT_NVRAM */ 450 451 452/* PHY */ 453 454typedef struct hunt_link_state_s { 455 uint32_t hls_adv_cap_mask; 456 uint32_t hls_lp_cap_mask; 457 unsigned int hls_fcntl; 458 efx_link_mode_t hls_link_mode; 459#if EFSYS_OPT_LOOPBACK 460 efx_loopback_type_t hls_loopback; 461#endif 462 boolean_t hls_mac_up; 463} hunt_link_state_t; 464 465extern void 466hunt_phy_link_ev( 467 __in efx_nic_t *enp, 468 __in efx_qword_t *eqp, 469 __out efx_link_mode_t *link_modep); 470 471extern __checkReturn efx_rc_t 472hunt_phy_get_link( 473 __in efx_nic_t *enp, 474 __out hunt_link_state_t *hlsp); 475 476extern __checkReturn efx_rc_t 477hunt_phy_power( 478 __in efx_nic_t *enp, 479 __in boolean_t on); 480 481extern __checkReturn efx_rc_t 482hunt_phy_reconfigure( 483 __in efx_nic_t *enp); 484 485extern __checkReturn efx_rc_t 486hunt_phy_verify( 487 __in efx_nic_t *enp); 488 489extern __checkReturn efx_rc_t 490hunt_phy_oui_get( 491 __in efx_nic_t *enp, 492 __out uint32_t *ouip); 493 494#if EFSYS_OPT_PHY_STATS 495 496extern __checkReturn efx_rc_t 497hunt_phy_stats_update( 498 __in efx_nic_t *enp, 499 __in efsys_mem_t *esmp, 500 __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); 501 502#endif /* EFSYS_OPT_PHY_STATS */ 503 504#if EFSYS_OPT_PHY_PROPS 505 506#if EFSYS_OPT_NAMES 507 508extern const char * 509hunt_phy_prop_name( 510 __in efx_nic_t *enp, 511 __in unsigned int id); 512 513#endif /* EFSYS_OPT_NAMES */ 514 515extern __checkReturn efx_rc_t 516hunt_phy_prop_get( 517 __in efx_nic_t *enp, 518 __in unsigned int id, 519 __in uint32_t flags, 520 __out uint32_t *valp); 521 522extern __checkReturn efx_rc_t 523hunt_phy_prop_set( 524 __in efx_nic_t *enp, 525 __in unsigned int id, 526 __in uint32_t val); 527 528#endif /* EFSYS_OPT_PHY_PROPS */ 529 530#if EFSYS_OPT_BIST 531 532extern __checkReturn efx_rc_t 533hunt_bist_enable_offline( 534 __in efx_nic_t *enp); 535 536extern __checkReturn efx_rc_t 537hunt_bist_start( 538 __in efx_nic_t *enp, 539 __in efx_bist_type_t type); 540 541extern __checkReturn efx_rc_t 542hunt_bist_poll( 543 __in efx_nic_t *enp, 544 __in efx_bist_type_t type, 545 __out efx_bist_result_t *resultp, 546 __out_opt __drv_when(count > 0, __notnull) 547 uint32_t *value_maskp, 548 __out_ecount_opt(count) __drv_when(count > 0, __notnull) 549 unsigned long *valuesp, 550 __in size_t count); 551 552extern void 553hunt_bist_stop( 554 __in efx_nic_t *enp, 555 __in efx_bist_type_t type); 556 557#endif /* EFSYS_OPT_BIST */ 558 559 560/* SRAM */ 561 562#if EFSYS_OPT_DIAG 563 564extern __checkReturn efx_rc_t 565hunt_sram_test( 566 __in efx_nic_t *enp, 567 __in efx_sram_pattern_fn_t func); 568 569#endif /* EFSYS_OPT_DIAG */ 570 571 572/* TX */ 573 574extern __checkReturn efx_rc_t 575hunt_tx_init( 576 __in efx_nic_t *enp); 577 578extern void 579hunt_tx_fini( 580 __in efx_nic_t *enp); 581 582extern __checkReturn efx_rc_t 583hunt_tx_qcreate( 584 __in efx_nic_t *enp, 585 __in unsigned int index, 586 __in unsigned int label, 587 __in efsys_mem_t *esmp, 588 __in size_t n, 589 __in uint32_t id, 590 __in uint16_t flags, 591 __in efx_evq_t *eep, 592 __in efx_txq_t *etp, 593 __out unsigned int *addedp); 594 595extern void 596hunt_tx_qdestroy( 597 __in efx_txq_t *etp); 598 599extern __checkReturn efx_rc_t 600hunt_tx_qpost( 601 __in efx_txq_t *etp, 602 __in_ecount(n) efx_buffer_t *eb, 603 __in unsigned int n, 604 __in unsigned int completed, 605 __inout unsigned int *addedp); 606 607extern void 608hunt_tx_qpush( 609 __in efx_txq_t *etp, 610 __in unsigned int added, 611 __in unsigned int pushed); 612 613extern __checkReturn efx_rc_t 614hunt_tx_qpace( 615 __in efx_txq_t *etp, 616 __in unsigned int ns); 617 618extern __checkReturn efx_rc_t 619hunt_tx_qflush( 620 __in efx_txq_t *etp); 621 622extern void 623hunt_tx_qenable( 624 __in efx_txq_t *etp); 625 626extern __checkReturn efx_rc_t 627hunt_tx_qpio_enable( 628 __in efx_txq_t *etp); 629 630extern void 631hunt_tx_qpio_disable( 632 __in efx_txq_t *etp); 633 634extern __checkReturn efx_rc_t 635hunt_tx_qpio_write( 636 __in efx_txq_t *etp, 637 __in_ecount(buf_length) uint8_t *buffer, 638 __in size_t buf_length, 639 __in size_t pio_buf_offset); 640 641extern __checkReturn efx_rc_t 642hunt_tx_qpio_post( 643 __in efx_txq_t *etp, 644 __in size_t pkt_length, 645 __in unsigned int completed, 646 __inout unsigned int *addedp); 647 648extern __checkReturn efx_rc_t 649hunt_tx_qdesc_post( 650 __in efx_txq_t *etp, 651 __in_ecount(n) efx_desc_t *ed, 652 __in unsigned int n, 653 __in unsigned int completed, 654 __inout unsigned int *addedp); 655 656extern void 657hunt_tx_qdesc_dma_create( 658 __in efx_txq_t *etp, 659 __in efsys_dma_addr_t addr, 660 __in size_t size, 661 __in boolean_t eop, 662 __out efx_desc_t *edp); 663 664extern void 665hunt_tx_qdesc_tso_create( 666 __in efx_txq_t *etp, 667 __in uint16_t ipv4_id, 668 __in uint32_t tcp_seq, 669 __in uint8_t tcp_flags, 670 __out efx_desc_t *edp); 671 672extern void 673hunt_tx_qdesc_vlantci_create( 674 __in efx_txq_t *etp, 675 __in uint16_t vlan_tci, 676 __out efx_desc_t *edp); 677 678 679#if EFSYS_OPT_QSTATS 680 681extern void 682hunt_tx_qstats_update( 683 __in efx_txq_t *etp, 684 __inout_ecount(TX_NQSTATS) efsys_stat_t *stat); 685 686#endif /* EFSYS_OPT_QSTATS */ 687 688/* PIO */ 689 690/* Missing register definitions */ 691#ifndef ER_DZ_TX_PIOBUF_OFST 692#define ER_DZ_TX_PIOBUF_OFST 0x00001000 693#endif 694#ifndef ER_DZ_TX_PIOBUF_STEP 695#define ER_DZ_TX_PIOBUF_STEP 8192 696#endif 697#ifndef ER_DZ_TX_PIOBUF_ROWS 698#define ER_DZ_TX_PIOBUF_ROWS 2048 699#endif 700 701#ifndef ER_DZ_TX_PIOBUF_SIZE 702#define ER_DZ_TX_PIOBUF_SIZE 2048 703#endif 704 705#define HUNT_PIOBUF_NBUFS (16) 706#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE) 707 708#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) 709
|
725#define HUNT_LEGACY_PF_PRIVILEGE_MASK \
| 710#define HUNT_LEGACY_PF_PRIVILEGE_MASK \
|
726 (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ 727 MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ 728 MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ 729 MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP | \ 730 MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS | \ 731 MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING | \ 732 MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST | \ 733 MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST | \ 734 MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST | \ 735 MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ 736 MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) 737
| 711 (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ 712 MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ 713 MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ 714 MC_CMD_PRIVILEGE_MASK_IN_GRP_PTP | \ 715 MC_CMD_PRIVILEGE_MASK_IN_GRP_INSECURE_FILTERS | \ 716 MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING | \ 717 MC_CMD_PRIVILEGE_MASK_IN_GRP_UNICAST | \ 718 MC_CMD_PRIVILEGE_MASK_IN_GRP_MULTICAST | \ 719 MC_CMD_PRIVILEGE_MASK_IN_GRP_BROADCAST | \ 720 MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ 721 MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) 722
|
738#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0
| 723#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0
|
739 740typedef uint32_t efx_piobuf_handle_t; 741 742#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) 743 744extern __checkReturn efx_rc_t 745hunt_nic_pio_alloc( 746 __inout efx_nic_t *enp, 747 __out uint32_t *bufnump, 748 __out efx_piobuf_handle_t *handlep, 749 __out uint32_t *blknump, 750 __out uint32_t *offsetp, 751 __out size_t *sizep); 752 753extern __checkReturn efx_rc_t 754hunt_nic_pio_free( 755 __inout efx_nic_t *enp, 756 __in uint32_t bufnum, 757 __in uint32_t blknum); 758 759extern __checkReturn efx_rc_t 760hunt_nic_pio_link( 761 __inout efx_nic_t *enp, 762 __in uint32_t vi_index, 763 __in efx_piobuf_handle_t handle); 764 765extern __checkReturn efx_rc_t 766hunt_nic_pio_unlink( 767 __inout efx_nic_t *enp, 768 __in uint32_t vi_index); 769 770 771/* VPD */ 772 773#if EFSYS_OPT_VPD 774 775extern __checkReturn efx_rc_t 776hunt_vpd_init( 777 __in efx_nic_t *enp); 778 779extern __checkReturn efx_rc_t 780hunt_vpd_size( 781 __in efx_nic_t *enp, 782 __out size_t *sizep); 783 784extern __checkReturn efx_rc_t 785hunt_vpd_read( 786 __in efx_nic_t *enp, 787 __out_bcount(size) caddr_t data, 788 __in size_t size); 789 790extern __checkReturn efx_rc_t 791hunt_vpd_verify( 792 __in efx_nic_t *enp, 793 __in_bcount(size) caddr_t data, 794 __in size_t size); 795 796extern __checkReturn efx_rc_t 797hunt_vpd_reinit( 798 __in efx_nic_t *enp, 799 __in_bcount(size) caddr_t data, 800 __in size_t size); 801 802extern __checkReturn efx_rc_t 803hunt_vpd_get( 804 __in efx_nic_t *enp, 805 __in_bcount(size) caddr_t data, 806 __in size_t size, 807 __inout efx_vpd_value_t *evvp); 808 809extern __checkReturn efx_rc_t 810hunt_vpd_set( 811 __in efx_nic_t *enp, 812 __in_bcount(size) caddr_t data, 813 __in size_t size, 814 __in efx_vpd_value_t *evvp); 815 816extern __checkReturn efx_rc_t 817hunt_vpd_next( 818 __in efx_nic_t *enp, 819 __in_bcount(size) caddr_t data, 820 __in size_t size, 821 __out efx_vpd_value_t *evvp, 822 __inout unsigned int *contp); 823 824extern __checkReturn efx_rc_t 825hunt_vpd_write( 826 __in efx_nic_t *enp, 827 __in_bcount(size) caddr_t data, 828 __in size_t size); 829 830extern void 831hunt_vpd_fini( 832 __in efx_nic_t *enp); 833 834#endif /* EFSYS_OPT_VPD */ 835 836 837/* RX */ 838 839extern __checkReturn efx_rc_t 840hunt_rx_init( 841 __in efx_nic_t *enp); 842 843#if EFSYS_OPT_RX_HDR_SPLIT 844extern __checkReturn efx_rc_t 845hunt_rx_hdr_split_enable( 846 __in efx_nic_t *enp, 847 __in unsigned int hdr_buf_size, 848 __in unsigned int pld_buf_size); 849#endif /* EFSYS_OPT_RX_HDR_SPLIT */ 850 851#if EFSYS_OPT_RX_SCATTER 852extern __checkReturn efx_rc_t 853hunt_rx_scatter_enable( 854 __in efx_nic_t *enp, 855 __in unsigned int buf_size); 856#endif /* EFSYS_OPT_RX_SCATTER */ 857 858 859#if EFSYS_OPT_RX_SCALE 860 861extern __checkReturn efx_rc_t 862hunt_rx_scale_mode_set( 863 __in efx_nic_t *enp, 864 __in efx_rx_hash_alg_t alg, 865 __in efx_rx_hash_type_t type, 866 __in boolean_t insert); 867 868extern __checkReturn efx_rc_t 869hunt_rx_scale_key_set( 870 __in efx_nic_t *enp, 871 __in_ecount(n) uint8_t *key, 872 __in size_t n); 873 874extern __checkReturn efx_rc_t 875hunt_rx_scale_tbl_set( 876 __in efx_nic_t *enp, 877 __in_ecount(n) unsigned int *table, 878 __in size_t n); 879 880#endif /* EFSYS_OPT_RX_SCALE */ 881 882extern void 883hunt_rx_qpost( 884 __in efx_rxq_t *erp, 885 __in_ecount(n) efsys_dma_addr_t *addrp, 886 __in size_t size, 887 __in unsigned int n, 888 __in unsigned int completed, 889 __in unsigned int added); 890 891extern void 892hunt_rx_qpush( 893 __in efx_rxq_t *erp, 894 __in unsigned int added, 895 __inout unsigned int *pushedp); 896 897extern __checkReturn efx_rc_t 898hunt_rx_qflush( 899 __in efx_rxq_t *erp); 900 901extern void 902hunt_rx_qenable( 903 __in efx_rxq_t *erp); 904 905extern __checkReturn efx_rc_t 906hunt_rx_qcreate( 907 __in efx_nic_t *enp, 908 __in unsigned int index, 909 __in unsigned int label, 910 __in efx_rxq_type_t type, 911 __in efsys_mem_t *esmp, 912 __in size_t n, 913 __in uint32_t id, 914 __in efx_evq_t *eep, 915 __in efx_rxq_t *erp); 916 917extern void 918hunt_rx_qdestroy( 919 __in efx_rxq_t *erp); 920 921extern void 922hunt_rx_fini( 923 __in efx_nic_t *enp); 924 925#if EFSYS_OPT_FILTER 926 927typedef struct hunt_filter_handle_s { 928 uint32_t hfh_lo; 929 uint32_t hfh_hi; 930} hunt_filter_handle_t; 931 932typedef struct hunt_filter_entry_s { 933 uintptr_t hfe_spec; /* pointer to filter spec plus busy bit */ 934 hunt_filter_handle_t hfe_handle; 935} hunt_filter_entry_t; 936 937/* 938 * BUSY flag indicates that an update is in progress. 939 * AUTO_OLD flag is used to mark and sweep MAC packet filters. 940 */ 941#define EFX_HUNT_FILTER_FLAG_BUSY 1U 942#define EFX_HUNT_FILTER_FLAG_AUTO_OLD 2U 943#define EFX_HUNT_FILTER_FLAGS 3U 944 945#define EFX_HUNT_FILTER_TBL_ROWS 8192 946 947/* Allow for the broadcast address to be added to the multicast list */ 948#define EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) 949 950typedef struct hunt_filter_table_s { 951 hunt_filter_entry_t hft_entry[EFX_HUNT_FILTER_TBL_ROWS]; 952 efx_rxq_t * hft_default_rxq; 953 boolean_t hft_using_rss; 954 uint32_t hft_unicst_filter_index; 955 boolean_t hft_unicst_filter_set; 956 uint32_t hft_mulcst_filter_indexes[ 957 EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX]; 958 uint32_t hft_mulcst_filter_count; 959} hunt_filter_table_t; 960 961 __checkReturn efx_rc_t 962hunt_filter_init( 963 __in efx_nic_t *enp); 964 965 void 966hunt_filter_fini( 967 __in efx_nic_t *enp); 968 969 __checkReturn efx_rc_t 970hunt_filter_restore( 971 __in efx_nic_t *enp); 972 973 __checkReturn efx_rc_t 974hunt_filter_add( 975 __in efx_nic_t *enp, 976 __inout efx_filter_spec_t *spec, 977 __in boolean_t may_replace); 978 979 __checkReturn efx_rc_t 980hunt_filter_delete( 981 __in efx_nic_t *enp, 982 __inout efx_filter_spec_t *spec); 983 984extern __checkReturn efx_rc_t 985hunt_filter_supported_filters( 986 __in efx_nic_t *enp, 987 __out uint32_t *list, 988 __out size_t *length); 989 990extern __checkReturn efx_rc_t 991hunt_filter_reconfigure( 992 __in efx_nic_t *enp, 993 __in_ecount(6) uint8_t const *mac_addr, 994 __in boolean_t all_unicst, 995 __in boolean_t mulcst, 996 __in boolean_t all_mulcst, 997 __in boolean_t brdcst, 998 __in_ecount(6*count) uint8_t const *addrs, 999 __in int count); 1000 1001extern void 1002hunt_filter_get_default_rxq( 1003 __in efx_nic_t *enp, 1004 __out efx_rxq_t **erpp, 1005 __out boolean_t *using_rss); 1006 1007extern void 1008hunt_filter_default_rxq_set( 1009 __in efx_nic_t *enp, 1010 __in efx_rxq_t *erp, 1011 __in boolean_t using_rss); 1012 1013extern void 1014hunt_filter_default_rxq_clear( 1015 __in efx_nic_t *enp); 1016 1017 1018#endif /* EFSYS_OPT_FILTER */ 1019 1020extern __checkReturn efx_rc_t 1021hunt_pktfilter_set( 1022 __in efx_nic_t *enp, 1023 __in boolean_t unicst, 1024 __in boolean_t brdcst); 1025 1026#if EFSYS_OPT_MCAST_FILTER_LIST 1027 1028extern __checkReturn efx_rc_t 1029hunt_pktfilter_mcast_set( 1030 __in efx_nic_t *enp, 1031 __in uint8_t const *addrs, 1032 __in int count); 1033 1034#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ 1035 1036extern __checkReturn efx_rc_t 1037hunt_pktfilter_mcast_all( 1038 __in efx_nic_t *enp); 1039 1040extern __checkReturn efx_rc_t 1041efx_mcdi_get_function_info( 1042 __in efx_nic_t *enp, 1043 __out uint32_t *pfp, 1044 __out_opt uint32_t *vfp); 1045 1046extern __checkReturn efx_rc_t 1047efx_mcdi_privilege_mask( 1048 __in efx_nic_t *enp, 1049 __in uint32_t pf, 1050 __in uint32_t vf, 1051 __out uint32_t *maskp); 1052 1053#ifdef __cplusplus 1054} 1055#endif 1056 1057#endif /* _SYS_HUNT_IMPL_H */
| 724 725typedef uint32_t efx_piobuf_handle_t; 726 727#define EFX_PIOBUF_HANDLE_INVALID ((efx_piobuf_handle_t) -1) 728 729extern __checkReturn efx_rc_t 730hunt_nic_pio_alloc( 731 __inout efx_nic_t *enp, 732 __out uint32_t *bufnump, 733 __out efx_piobuf_handle_t *handlep, 734 __out uint32_t *blknump, 735 __out uint32_t *offsetp, 736 __out size_t *sizep); 737 738extern __checkReturn efx_rc_t 739hunt_nic_pio_free( 740 __inout efx_nic_t *enp, 741 __in uint32_t bufnum, 742 __in uint32_t blknum); 743 744extern __checkReturn efx_rc_t 745hunt_nic_pio_link( 746 __inout efx_nic_t *enp, 747 __in uint32_t vi_index, 748 __in efx_piobuf_handle_t handle); 749 750extern __checkReturn efx_rc_t 751hunt_nic_pio_unlink( 752 __inout efx_nic_t *enp, 753 __in uint32_t vi_index); 754 755 756/* VPD */ 757 758#if EFSYS_OPT_VPD 759 760extern __checkReturn efx_rc_t 761hunt_vpd_init( 762 __in efx_nic_t *enp); 763 764extern __checkReturn efx_rc_t 765hunt_vpd_size( 766 __in efx_nic_t *enp, 767 __out size_t *sizep); 768 769extern __checkReturn efx_rc_t 770hunt_vpd_read( 771 __in efx_nic_t *enp, 772 __out_bcount(size) caddr_t data, 773 __in size_t size); 774 775extern __checkReturn efx_rc_t 776hunt_vpd_verify( 777 __in efx_nic_t *enp, 778 __in_bcount(size) caddr_t data, 779 __in size_t size); 780 781extern __checkReturn efx_rc_t 782hunt_vpd_reinit( 783 __in efx_nic_t *enp, 784 __in_bcount(size) caddr_t data, 785 __in size_t size); 786 787extern __checkReturn efx_rc_t 788hunt_vpd_get( 789 __in efx_nic_t *enp, 790 __in_bcount(size) caddr_t data, 791 __in size_t size, 792 __inout efx_vpd_value_t *evvp); 793 794extern __checkReturn efx_rc_t 795hunt_vpd_set( 796 __in efx_nic_t *enp, 797 __in_bcount(size) caddr_t data, 798 __in size_t size, 799 __in efx_vpd_value_t *evvp); 800 801extern __checkReturn efx_rc_t 802hunt_vpd_next( 803 __in efx_nic_t *enp, 804 __in_bcount(size) caddr_t data, 805 __in size_t size, 806 __out efx_vpd_value_t *evvp, 807 __inout unsigned int *contp); 808 809extern __checkReturn efx_rc_t 810hunt_vpd_write( 811 __in efx_nic_t *enp, 812 __in_bcount(size) caddr_t data, 813 __in size_t size); 814 815extern void 816hunt_vpd_fini( 817 __in efx_nic_t *enp); 818 819#endif /* EFSYS_OPT_VPD */ 820 821 822/* RX */ 823 824extern __checkReturn efx_rc_t 825hunt_rx_init( 826 __in efx_nic_t *enp); 827 828#if EFSYS_OPT_RX_HDR_SPLIT 829extern __checkReturn efx_rc_t 830hunt_rx_hdr_split_enable( 831 __in efx_nic_t *enp, 832 __in unsigned int hdr_buf_size, 833 __in unsigned int pld_buf_size); 834#endif /* EFSYS_OPT_RX_HDR_SPLIT */ 835 836#if EFSYS_OPT_RX_SCATTER 837extern __checkReturn efx_rc_t 838hunt_rx_scatter_enable( 839 __in efx_nic_t *enp, 840 __in unsigned int buf_size); 841#endif /* EFSYS_OPT_RX_SCATTER */ 842 843 844#if EFSYS_OPT_RX_SCALE 845 846extern __checkReturn efx_rc_t 847hunt_rx_scale_mode_set( 848 __in efx_nic_t *enp, 849 __in efx_rx_hash_alg_t alg, 850 __in efx_rx_hash_type_t type, 851 __in boolean_t insert); 852 853extern __checkReturn efx_rc_t 854hunt_rx_scale_key_set( 855 __in efx_nic_t *enp, 856 __in_ecount(n) uint8_t *key, 857 __in size_t n); 858 859extern __checkReturn efx_rc_t 860hunt_rx_scale_tbl_set( 861 __in efx_nic_t *enp, 862 __in_ecount(n) unsigned int *table, 863 __in size_t n); 864 865#endif /* EFSYS_OPT_RX_SCALE */ 866 867extern void 868hunt_rx_qpost( 869 __in efx_rxq_t *erp, 870 __in_ecount(n) efsys_dma_addr_t *addrp, 871 __in size_t size, 872 __in unsigned int n, 873 __in unsigned int completed, 874 __in unsigned int added); 875 876extern void 877hunt_rx_qpush( 878 __in efx_rxq_t *erp, 879 __in unsigned int added, 880 __inout unsigned int *pushedp); 881 882extern __checkReturn efx_rc_t 883hunt_rx_qflush( 884 __in efx_rxq_t *erp); 885 886extern void 887hunt_rx_qenable( 888 __in efx_rxq_t *erp); 889 890extern __checkReturn efx_rc_t 891hunt_rx_qcreate( 892 __in efx_nic_t *enp, 893 __in unsigned int index, 894 __in unsigned int label, 895 __in efx_rxq_type_t type, 896 __in efsys_mem_t *esmp, 897 __in size_t n, 898 __in uint32_t id, 899 __in efx_evq_t *eep, 900 __in efx_rxq_t *erp); 901 902extern void 903hunt_rx_qdestroy( 904 __in efx_rxq_t *erp); 905 906extern void 907hunt_rx_fini( 908 __in efx_nic_t *enp); 909 910#if EFSYS_OPT_FILTER 911 912typedef struct hunt_filter_handle_s { 913 uint32_t hfh_lo; 914 uint32_t hfh_hi; 915} hunt_filter_handle_t; 916 917typedef struct hunt_filter_entry_s { 918 uintptr_t hfe_spec; /* pointer to filter spec plus busy bit */ 919 hunt_filter_handle_t hfe_handle; 920} hunt_filter_entry_t; 921 922/* 923 * BUSY flag indicates that an update is in progress. 924 * AUTO_OLD flag is used to mark and sweep MAC packet filters. 925 */ 926#define EFX_HUNT_FILTER_FLAG_BUSY 1U 927#define EFX_HUNT_FILTER_FLAG_AUTO_OLD 2U 928#define EFX_HUNT_FILTER_FLAGS 3U 929 930#define EFX_HUNT_FILTER_TBL_ROWS 8192 931 932/* Allow for the broadcast address to be added to the multicast list */ 933#define EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) 934 935typedef struct hunt_filter_table_s { 936 hunt_filter_entry_t hft_entry[EFX_HUNT_FILTER_TBL_ROWS]; 937 efx_rxq_t * hft_default_rxq; 938 boolean_t hft_using_rss; 939 uint32_t hft_unicst_filter_index; 940 boolean_t hft_unicst_filter_set; 941 uint32_t hft_mulcst_filter_indexes[ 942 EFX_HUNT_FILTER_MULTICAST_FILTERS_MAX]; 943 uint32_t hft_mulcst_filter_count; 944} hunt_filter_table_t; 945 946 __checkReturn efx_rc_t 947hunt_filter_init( 948 __in efx_nic_t *enp); 949 950 void 951hunt_filter_fini( 952 __in efx_nic_t *enp); 953 954 __checkReturn efx_rc_t 955hunt_filter_restore( 956 __in efx_nic_t *enp); 957 958 __checkReturn efx_rc_t 959hunt_filter_add( 960 __in efx_nic_t *enp, 961 __inout efx_filter_spec_t *spec, 962 __in boolean_t may_replace); 963 964 __checkReturn efx_rc_t 965hunt_filter_delete( 966 __in efx_nic_t *enp, 967 __inout efx_filter_spec_t *spec); 968 969extern __checkReturn efx_rc_t 970hunt_filter_supported_filters( 971 __in efx_nic_t *enp, 972 __out uint32_t *list, 973 __out size_t *length); 974 975extern __checkReturn efx_rc_t 976hunt_filter_reconfigure( 977 __in efx_nic_t *enp, 978 __in_ecount(6) uint8_t const *mac_addr, 979 __in boolean_t all_unicst, 980 __in boolean_t mulcst, 981 __in boolean_t all_mulcst, 982 __in boolean_t brdcst, 983 __in_ecount(6*count) uint8_t const *addrs, 984 __in int count); 985 986extern void 987hunt_filter_get_default_rxq( 988 __in efx_nic_t *enp, 989 __out efx_rxq_t **erpp, 990 __out boolean_t *using_rss); 991 992extern void 993hunt_filter_default_rxq_set( 994 __in efx_nic_t *enp, 995 __in efx_rxq_t *erp, 996 __in boolean_t using_rss); 997 998extern void 999hunt_filter_default_rxq_clear( 1000 __in efx_nic_t *enp); 1001 1002 1003#endif /* EFSYS_OPT_FILTER */ 1004 1005extern __checkReturn efx_rc_t 1006hunt_pktfilter_set( 1007 __in efx_nic_t *enp, 1008 __in boolean_t unicst, 1009 __in boolean_t brdcst); 1010 1011#if EFSYS_OPT_MCAST_FILTER_LIST 1012 1013extern __checkReturn efx_rc_t 1014hunt_pktfilter_mcast_set( 1015 __in efx_nic_t *enp, 1016 __in uint8_t const *addrs, 1017 __in int count); 1018 1019#endif /* EFSYS_OPT_MCAST_FILTER_LIST */ 1020 1021extern __checkReturn efx_rc_t 1022hunt_pktfilter_mcast_all( 1023 __in efx_nic_t *enp); 1024 1025extern __checkReturn efx_rc_t 1026efx_mcdi_get_function_info( 1027 __in efx_nic_t *enp, 1028 __out uint32_t *pfp, 1029 __out_opt uint32_t *vfp); 1030 1031extern __checkReturn efx_rc_t 1032efx_mcdi_privilege_mask( 1033 __in efx_nic_t *enp, 1034 __in uint32_t pf, 1035 __in uint32_t vf, 1036 __out uint32_t *maskp); 1037 1038#ifdef __cplusplus 1039} 1040#endif 1041 1042#endif /* _SYS_HUNT_IMPL_H */
|