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$");
31
32 #ifndef _BNXT_HWRM_H
33 #define _BNXT_HWRM_H
34
35 #define BNXT_PAUSE_TX (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_TX)
36 #define BNXT_PAUSE_RX (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX)
37 #define BNXT_AUTO_PAUSE_AUTONEG_PAUSE \
38 (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE)
39 #define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input)
40 #define BNXT_BACKING_STORE_CFG_LEGACY_LEN 256
41
42 /* HWRM Function Prototypes */
43 int bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc);
44 void bnxt_free_hwrm_dma_mem(struct bnxt_softc *softc);
45 int bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type,
46 struct bnxt_ring *ring);
47 int bnxt_hwrm_ring_free(struct bnxt_softc *softc, uint32_t type,
48 struct bnxt_ring *ring, int cmpl_ring_id);
49 int bnxt_hwrm_ver_get(struct bnxt_softc *softc);
50 int bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc);
51 int bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc);
52 int bnxt_hwrm_func_drv_unrgtr(struct bnxt_softc *softc, bool shutdown);
53 int bnxt_hwrm_func_qcaps(struct bnxt_softc *softc);
54 int bnxt_hwrm_func_qcfg(struct bnxt_softc *softc);
55 int bnxt_hwrm_func_reset(struct bnxt_softc *softc);
56 int bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause,
57 bool set_eee, bool set_link);
58 int bnxt_hwrm_set_pause(struct bnxt_softc *softc);
59 int bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, uint16_t *ctx_id);
60 int bnxt_hwrm_vnic_ctx_free(struct bnxt_softc *softc, uint16_t ctx_id);
61 int bnxt_hwrm_vnic_set_hds(struct bnxt_softc *sc, struct bnxt_vnic_info *vnic);
62 int bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
63 int bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
64 int bnxt_hwrm_vnic_free(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic);
65 int bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr,
66 uint64_t paddr);
67 int bnxt_hwrm_stat_ctx_free(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr);
68 int bnxt_hwrm_port_qstats(struct bnxt_softc *softc);
69 int bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc,
70 struct bnxt_grp_info *grp);
71 int bnxt_hwrm_ring_grp_free(struct bnxt_softc *softc, struct bnxt_grp_info *gr);
72 int bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc,
73 struct bnxt_vnic_info *vnic);
74 int bnxt_hwrm_set_filter(struct bnxt_softc *softc);
75 int bnxt_hwrm_free_filter(struct bnxt_softc *softc);
76 int bnxt_hwrm_l2_filter_alloc(struct bnxt_softc *softc, uint16_t vlan_tag,
77 uint64_t *filter_id);
78 int bnxt_hwrm_l2_filter_free(struct bnxt_softc *softc, uint64_t filter_id);
79 int bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic,
80 uint32_t hash_type);
81 int bnxt_cfg_async_cr(struct bnxt_softc *softc);
82 int bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc);
83 void bnxt_validate_hw_lro_settings(struct bnxt_softc *softc);
84 int bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type,
85 uint16_t *ordinal, uint16_t ext, uint16_t *index, bool use_index,
86 uint8_t search_opt, uint32_t *data_length, uint32_t *item_length,
87 uint32_t *fw_ver);
88 int bnxt_hwrm_nvm_read(struct bnxt_softc *softc, uint16_t index,
89 uint32_t offset, uint32_t length, struct iflib_dma_info *data);
90 int bnxt_hwrm_nvm_modify(struct bnxt_softc *softc, uint16_t index,
91 uint32_t offset, void *data, bool cpyin, uint32_t length);
92 int bnxt_hwrm_fw_reset(struct bnxt_softc *softc, uint8_t processor,
93 uint8_t *selfreset);
94 int bnxt_hwrm_fw_qstatus(struct bnxt_softc *softc, uint8_t type,
95 uint8_t *selfreset);
96 int bnxt_hwrm_nvm_write(struct bnxt_softc *softc, void *data, bool cpyin,
97 uint16_t type, uint16_t ordinal, uint16_t ext, uint16_t attr,
98 uint16_t option, uint32_t data_length, bool keep, uint32_t *item_length,
99 uint16_t *index);
100 int bnxt_hwrm_nvm_erase_dir_entry(struct bnxt_softc *softc, uint16_t index);
101 int bnxt_hwrm_nvm_get_dir_info(struct bnxt_softc *softc, uint32_t *entries,
102 uint32_t *entry_length);
103 int bnxt_hwrm_nvm_get_dir_entries(struct bnxt_softc *softc,
104 uint32_t *entries, uint32_t *entry_length, struct iflib_dma_info *dma_data);
105 int bnxt_hwrm_nvm_get_dev_info(struct bnxt_softc *softc, uint16_t *mfg_id,
106 uint16_t *device_id, uint32_t *sector_size, uint32_t *nvram_size,
107 uint32_t *reserved_size, uint32_t *available_size);
108 int bnxt_hwrm_nvm_install_update(struct bnxt_softc *softc,
109 uint32_t install_type, uint64_t *installed_items, uint8_t *result,
110 uint8_t *problem_item, uint8_t *reset_required);
111 int bnxt_hwrm_nvm_verify_update(struct bnxt_softc *softc, uint16_t type,
112 uint16_t ordinal, uint16_t ext);
113 int bnxt_hwrm_fw_get_time(struct bnxt_softc *softc, uint16_t *year,
114 uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *minute,
115 uint8_t *second, uint16_t *millisecond, uint16_t *zone);
116 int bnxt_hwrm_fw_set_time(struct bnxt_softc *softc, uint16_t year,
117 uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second,
118 uint16_t millisecond, uint16_t zone);
119 int bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc);
120 uint16_t bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle);
121 int bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc);
122 int bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc);
123 int bnxt_hwrm_set_coal(struct bnxt_softc *softc);
124 int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap,
125 int bmap_size);
126 int bnxt_hwrm_func_backing_store_qcaps(struct bnxt_softc *softc);
127 int bnxt_hwrm_func_backing_store_cfg(struct bnxt_softc *softc, uint32_t);
128 int bnxt_hwrm_func_resc_qcaps(struct bnxt_softc *softc, bool all);
129 int bnxt_hwrm_reserve_pf_rings (struct bnxt_softc *softc);
130 void bnxt_hwrm_ring_info_get(struct bnxt_softc *softc, uint8_t ring_type,
131 uint32_t ring_id, uint32_t *prod, uint32_t *);
132 int bnxt_hwrm_passthrough(struct bnxt_softc *softc, void *req, uint32_t req_len,
133 void *resp, uint32_t resp_len, uint32_t timeout);
134 #endif
Cache object: 34fd2e15c9bf3fb78c8cd35560496cd2
|