1283514Sarybchik/*- 2300607Sarybchik * Copyright (c) 2012-2016 Solarflare Communications Inc. 3283514Sarybchik * All rights reserved. 4283514Sarybchik * 5283514Sarybchik * Redistribution and use in source and binary forms, with or without 6283514Sarybchik * modification, are permitted provided that the following conditions are met: 7283514Sarybchik * 8283514Sarybchik * 1. Redistributions of source code must retain the above copyright notice, 9283514Sarybchik * this list of conditions and the following disclaimer. 10283514Sarybchik * 2. Redistributions in binary form must reproduce the above copyright notice, 11283514Sarybchik * this list of conditions and the following disclaimer in the documentation 12283514Sarybchik * and/or other materials provided with the distribution. 13283514Sarybchik * 14283514Sarybchik * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15283514Sarybchik * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16283514Sarybchik * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17283514Sarybchik * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 18283514Sarybchik * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19283514Sarybchik * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20283514Sarybchik * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21283514Sarybchik * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22283514Sarybchik * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23283514Sarybchik * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 24283514Sarybchik * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25283514Sarybchik * 26283514Sarybchik * The views and conclusions contained in the software and documentation are 27283514Sarybchik * those of the authors and should not be interpreted as representing official 28283514Sarybchik * policies, either expressed or implied, of the FreeBSD Project. 29283514Sarybchik * 30283514Sarybchik * $FreeBSD: releng/11.0/sys/dev/sfxge/common/hunt_impl.h 300607 2016-05-24 12:16:57Z arybchik $ 31283514Sarybchik */ 32283514Sarybchik 33283514Sarybchik#ifndef _SYS_HUNT_IMPL_H 34283514Sarybchik#define _SYS_HUNT_IMPL_H 35283514Sarybchik 36283514Sarybchik#include "efx.h" 37283514Sarybchik#include "efx_regs.h" 38283514Sarybchik#include "efx_regs_ef10.h" 39283514Sarybchik#include "efx_mcdi.h" 40283514Sarybchik 41283514Sarybchik#ifdef __cplusplus 42283514Sarybchikextern "C" { 43283514Sarybchik#endif 44283514Sarybchik 45299719Sarybchik/* Missing register definitions */ 46299719Sarybchik#ifndef ER_DZ_TX_PIOBUF_OFST 47299719Sarybchik#define ER_DZ_TX_PIOBUF_OFST 0x00001000 48299719Sarybchik#endif 49299719Sarybchik#ifndef ER_DZ_TX_PIOBUF_STEP 50299719Sarybchik#define ER_DZ_TX_PIOBUF_STEP 8192 51299719Sarybchik#endif 52299719Sarybchik#ifndef ER_DZ_TX_PIOBUF_ROWS 53299719Sarybchik#define ER_DZ_TX_PIOBUF_ROWS 2048 54299719Sarybchik#endif 55299719Sarybchik 56299719Sarybchik#ifndef ER_DZ_TX_PIOBUF_SIZE 57299719Sarybchik#define ER_DZ_TX_PIOBUF_SIZE 2048 58299719Sarybchik#endif 59299719Sarybchik 60299719Sarybchik#define HUNT_PIOBUF_NBUFS (16) 61299719Sarybchik#define HUNT_PIOBUF_SIZE (ER_DZ_TX_PIOBUF_SIZE) 62299719Sarybchik 63299719Sarybchik#define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) 64299719Sarybchik 65299719Sarybchik 66299719Sarybchik/* NIC */ 67299719Sarybchik 68299719Sarybchikextern __checkReturn efx_rc_t 69299719Sarybchikhunt_board_cfg( 70299719Sarybchik __in efx_nic_t *enp); 71299719Sarybchik 72299719Sarybchik 73299719Sarybchik/* PHY */ 74299719Sarybchik 75299719Sarybchik#if EFSYS_OPT_BIST 76299719Sarybchik 77299719Sarybchikextern __checkReturn efx_rc_t 78299719Sarybchikhunt_bist_enable_offline( 79299719Sarybchik __in efx_nic_t *enp); 80299719Sarybchik 81299719Sarybchikextern __checkReturn efx_rc_t 82299719Sarybchikhunt_bist_start( 83299719Sarybchik __in efx_nic_t *enp, 84299719Sarybchik __in efx_bist_type_t type); 85299719Sarybchik 86299719Sarybchikextern __checkReturn efx_rc_t 87299719Sarybchikhunt_bist_poll( 88299719Sarybchik __in efx_nic_t *enp, 89299719Sarybchik __in efx_bist_type_t type, 90299719Sarybchik __out efx_bist_result_t *resultp, 91299719Sarybchik __out_opt __drv_when(count > 0, __notnull) 92299719Sarybchik uint32_t *value_maskp, 93299719Sarybchik __out_ecount_opt(count) __drv_when(count > 0, __notnull) 94299719Sarybchik unsigned long *valuesp, 95299719Sarybchik __in size_t count); 96299719Sarybchik 97299719Sarybchikextern void 98299719Sarybchikhunt_bist_stop( 99299719Sarybchik __in efx_nic_t *enp, 100299719Sarybchik __in efx_bist_type_t type); 101299719Sarybchik 102299719Sarybchik#endif /* EFSYS_OPT_BIST */ 103299719Sarybchik 104299719Sarybchik 105283514Sarybchik#ifdef __cplusplus 106283514Sarybchik} 107283514Sarybchik#endif 108283514Sarybchik 109283514Sarybchik#endif /* _SYS_HUNT_IMPL_H */ 110