bnxt_hwrm.h revision 308696
1/*-
2 * Broadcom NetXtreme-C/E network driver.
3 *
4 * Copyright (c) 2016 Broadcom, All Rights Reserved.
5 * The term Broadcom refers to Broadcom Limited and/or its subsidiaries
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26 * THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/bnxt/bnxt_hwrm.h 308696 2016-11-15 20:35:29Z shurd $");
31
32#ifndef _BNXT_HWRM_H
33#define _BNXT_HWRM_H
34
35/* HWRM Function Prototypes */
36int bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc);
37void bnxt_free_hwrm_dma_mem(struct bnxt_softc *softc);
38int bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type,
39    struct bnxt_ring *ring, uint16_t cmpl_ring_id, uint32_t stat_ctx_id,
40    bool irq);
41int bnxt_hwrm_ver_get(struct bnxt_softc *softc);
42int bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc);
43int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc);
44int bnxt_hwrm_func_drv_unrgtr(struct bnxt_softc *softc, bool shutdown);
45int bnxt_hwrm_func_qcaps(struct bnxt_softc *softc);
46int bnxt_hwrm_func_reset(struct bnxt_softc *softc);
47int bnxt_hwrm_set_link_setting(struct bnxt_softc *, bool set_pause,
48    bool set_eee);
49int bnxt_hwrm_set_pause(struct bnxt_softc *softc);
50int bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, uint16_t *ctx_id);
51int bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
52int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr,
53    uint64_t paddr);
54int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc,
55    struct bnxt_grp_info *grp);
56int bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
57int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc,
58    struct bnxt_vnic_info *vnic);
59int bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
60int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic,
61    uint32_t hash_type);
62int bnxt_hwrm_func_cfg(struct bnxt_softc *softc);
63int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc,
64    struct bnxt_vnic_info *vnic, uint32_t flags);
65int bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type,
66    uint16_t *ordinal, uint16_t ext, uint16_t *index, bool use_index,
67    uint8_t search_opt, uint32_t *data_length, uint32_t *item_length,
68    uint32_t *fw_ver);
69int bnxt_hwrm_nvm_read(struct bnxt_softc *softc, uint16_t index,
70    uint32_t offset, uint32_t length, struct iflib_dma_info *data);
71int bnxt_hwrm_nvm_modify(struct bnxt_softc *softc, uint16_t index,
72    uint32_t offset, void *data, bool cpyin, uint32_t length);
73int bnxt_hwrm_fw_reset(struct bnxt_softc *softc, uint8_t processor,
74    uint8_t *selfreset);
75int bnxt_hwrm_fw_qstatus(struct bnxt_softc *softc, uint8_t type,
76    uint8_t *selfreset);
77int bnxt_hwrm_nvm_write(struct bnxt_softc *softc, void *data, bool cpyin,
78    uint16_t type, uint16_t ordinal, uint16_t ext, uint16_t attr,
79    uint16_t option, uint32_t data_length, bool keep, uint32_t *item_length,
80    uint16_t *index);
81int bnxt_hwrm_nvm_erase_dir_entry(struct bnxt_softc *softc, uint16_t index);
82int bnxt_hwrm_nvm_get_dir_info(struct bnxt_softc *softc, uint32_t *entries,
83    uint32_t *entry_length);
84int bnxt_hwrm_nvm_get_dir_entries(struct bnxt_softc *softc,
85    uint32_t *entries, uint32_t *entry_length, struct iflib_dma_info *dma_data);
86int bnxt_hwrm_nvm_get_dev_info(struct bnxt_softc *softc, uint16_t *mfg_id,
87    uint16_t *device_id, uint32_t *sector_size, uint32_t *nvram_size,
88    uint32_t *reserved_size, uint32_t *available_size);
89int bnxt_hwrm_nvm_install_update(struct bnxt_softc *softc,
90    uint32_t install_type, uint64_t *installed_items, uint8_t *result,
91    uint8_t *problem_item, uint8_t *reset_required);
92int bnxt_hwrm_nvm_verify_update(struct bnxt_softc *softc, uint16_t type,
93    uint16_t ordinal, uint16_t ext);
94int bnxt_hwrm_fw_get_time(struct bnxt_softc *softc, uint16_t *year,
95    uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *minute,
96    uint8_t *second, uint16_t *millisecond, uint16_t *zone);
97int bnxt_hwrm_fw_set_time(struct bnxt_softc *softc, uint16_t year,
98    uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second,
99    uint16_t millisecond, uint16_t zone);
100int bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc);
101
102#endif
103