1308696Sshurd/*- 2308696Sshurd * Broadcom NetXtreme-C/E network driver. 3308696Sshurd * 4308696Sshurd * Copyright (c) 2016 Broadcom, All Rights Reserved. 5308696Sshurd * The term Broadcom refers to Broadcom Limited and/or its subsidiaries 6308696Sshurd * 7308696Sshurd * Redistribution and use in source and binary forms, with or without 8308696Sshurd * modification, are permitted provided that the following conditions 9308696Sshurd * are met: 10308696Sshurd * 1. Redistributions of source code must retain the above copyright 11308696Sshurd * notice, this list of conditions and the following disclaimer. 12308696Sshurd * 2. Redistributions in binary form must reproduce the above copyright 13308696Sshurd * notice, this list of conditions and the following disclaimer in the 14308696Sshurd * documentation and/or other materials provided with the distribution. 15308696Sshurd * 16308696Sshurd * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' 17308696Sshurd * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18308696Sshurd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19308696Sshurd * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20308696Sshurd * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21308696Sshurd * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22308696Sshurd * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23308696Sshurd * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24308696Sshurd * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25308696Sshurd * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 26308696Sshurd * THE POSSIBILITY OF SUCH DAMAGE. 27308696Sshurd */ 28308696Sshurd 29308696Sshurd#include <sys/cdefs.h> 30308696Sshurd__FBSDID("$FreeBSD: stable/11/sys/dev/bnxt/bnxt_hwrm.h 333364 2018-05-08 15:51:40Z shurd $"); 31308696Sshurd 32308696Sshurd#ifndef _BNXT_HWRM_H 33308696Sshurd#define _BNXT_HWRM_H 34308696Sshurd 35333364Sshurd#define BNXT_PAUSE_TX (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX) 36333364Sshurd#define BNXT_PAUSE_RX (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX) 37333364Sshurd#define BNXT_AUTO_PAUSE_AUTONEG_PAUSE \ 38333364Sshurd (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE) 39333364Sshurd#define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input) 40333364Sshurd 41308696Sshurd/* HWRM Function Prototypes */ 42308696Sshurdint bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc); 43308696Sshurdvoid bnxt_free_hwrm_dma_mem(struct bnxt_softc *softc); 44308696Sshurdint bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type, 45308696Sshurd struct bnxt_ring *ring, uint16_t cmpl_ring_id, uint32_t stat_ctx_id, 46308696Sshurd bool irq); 47308696Sshurdint bnxt_hwrm_ver_get(struct bnxt_softc *softc); 48308696Sshurdint bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc); 49308696Sshurdint bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc); 50308696Sshurdint bnxt_hwrm_func_drv_unrgtr(struct bnxt_softc *softc, bool shutdown); 51308696Sshurdint bnxt_hwrm_func_qcaps(struct bnxt_softc *softc); 52333364Sshurdint bnxt_hwrm_func_qcfg(struct bnxt_softc *softc); 53308696Sshurdint bnxt_hwrm_func_reset(struct bnxt_softc *softc); 54333364Sshurdint bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause, 55333364Sshurd bool set_eee, bool set_link); 56308696Sshurdint bnxt_hwrm_set_pause(struct bnxt_softc *softc); 57308696Sshurdint bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, uint16_t *ctx_id); 58308696Sshurdint bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); 59308696Sshurdint bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr, 60308696Sshurd uint64_t paddr); 61333364Sshurdint bnxt_hwrm_port_qstats(struct bnxt_softc *softc); 62308696Sshurdint bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, 63308696Sshurd struct bnxt_grp_info *grp); 64308696Sshurdint bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); 65308696Sshurdint bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc, 66308696Sshurd struct bnxt_vnic_info *vnic); 67308696Sshurdint bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic); 68308696Sshurdint bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic, 69308696Sshurd uint32_t hash_type); 70333364Sshurdint bnxt_cfg_async_cr(struct bnxt_softc *softc); 71333364Sshurdint bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc); 72333364Sshurdvoid bnxt_validate_hw_lro_settings(struct bnxt_softc *softc); 73308696Sshurdint bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type, 74308696Sshurd uint16_t *ordinal, uint16_t ext, uint16_t *index, bool use_index, 75308696Sshurd uint8_t search_opt, uint32_t *data_length, uint32_t *item_length, 76308696Sshurd uint32_t *fw_ver); 77308696Sshurdint bnxt_hwrm_nvm_read(struct bnxt_softc *softc, uint16_t index, 78308696Sshurd uint32_t offset, uint32_t length, struct iflib_dma_info *data); 79308696Sshurdint bnxt_hwrm_nvm_modify(struct bnxt_softc *softc, uint16_t index, 80308696Sshurd uint32_t offset, void *data, bool cpyin, uint32_t length); 81308696Sshurdint bnxt_hwrm_fw_reset(struct bnxt_softc *softc, uint8_t processor, 82308696Sshurd uint8_t *selfreset); 83308696Sshurdint bnxt_hwrm_fw_qstatus(struct bnxt_softc *softc, uint8_t type, 84308696Sshurd uint8_t *selfreset); 85308696Sshurdint bnxt_hwrm_nvm_write(struct bnxt_softc *softc, void *data, bool cpyin, 86308696Sshurd uint16_t type, uint16_t ordinal, uint16_t ext, uint16_t attr, 87308696Sshurd uint16_t option, uint32_t data_length, bool keep, uint32_t *item_length, 88308696Sshurd uint16_t *index); 89308696Sshurdint bnxt_hwrm_nvm_erase_dir_entry(struct bnxt_softc *softc, uint16_t index); 90308696Sshurdint bnxt_hwrm_nvm_get_dir_info(struct bnxt_softc *softc, uint32_t *entries, 91308696Sshurd uint32_t *entry_length); 92308696Sshurdint bnxt_hwrm_nvm_get_dir_entries(struct bnxt_softc *softc, 93308696Sshurd uint32_t *entries, uint32_t *entry_length, struct iflib_dma_info *dma_data); 94308696Sshurdint bnxt_hwrm_nvm_get_dev_info(struct bnxt_softc *softc, uint16_t *mfg_id, 95308696Sshurd uint16_t *device_id, uint32_t *sector_size, uint32_t *nvram_size, 96308696Sshurd uint32_t *reserved_size, uint32_t *available_size); 97308696Sshurdint bnxt_hwrm_nvm_install_update(struct bnxt_softc *softc, 98308696Sshurd uint32_t install_type, uint64_t *installed_items, uint8_t *result, 99308696Sshurd uint8_t *problem_item, uint8_t *reset_required); 100308696Sshurdint bnxt_hwrm_nvm_verify_update(struct bnxt_softc *softc, uint16_t type, 101308696Sshurd uint16_t ordinal, uint16_t ext); 102308696Sshurdint bnxt_hwrm_fw_get_time(struct bnxt_softc *softc, uint16_t *year, 103308696Sshurd uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *minute, 104308696Sshurd uint8_t *second, uint16_t *millisecond, uint16_t *zone); 105308696Sshurdint bnxt_hwrm_fw_set_time(struct bnxt_softc *softc, uint16_t year, 106308696Sshurd uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, 107308696Sshurd uint16_t millisecond, uint16_t zone); 108308696Sshurdint bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc); 109333364Sshurduint16_t bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle); 110333364Sshurdint bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc); 111333364Sshurdint bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc); 112333364Sshurdint bnxt_hwrm_set_coal(struct bnxt_softc *softc); 113333364Sshurdint bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap, 114333364Sshurd int bmap_size); 115308696Sshurd#endif 116