• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/bnxt/

Lines Matching refs:softc

42 static void	bnxt_hwrm_set_link_common(struct bnxt_softc *softc,
44 static void bnxt_hwrm_set_pause_common(struct bnxt_softc *softc,
46 static void bnxt_hwrm_set_eee(struct bnxt_softc *softc,
85 bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc)
89 rc = iflib_dma_alloc(softc->ctx, PAGE_SIZE, &softc->hwrm_cmd_resp,
95 bnxt_free_hwrm_dma_mem(struct bnxt_softc *softc)
97 if (softc->hwrm_cmd_resp.idi_vaddr)
98 iflib_dma_free(&softc->hwrm_cmd_resp);
99 softc->hwrm_cmd_resp.idi_vaddr = NULL;
104 bnxt_hwrm_cmd_hdr_init(struct bnxt_softc *softc, void *request,
112 req->resp_addr = htole64(softc->hwrm_cmd_resp.idi_paddr);
116 _hwrm_send_message(struct bnxt_softc *softc, void *msg, uint32_t msg_len)
119 struct hwrm_err_output *resp = (void *)softc->hwrm_cmd_resp.idi_vaddr;
129 req->seq_id = htole16(softc->hwrm_cmd_seq++);
133 if (softc->flags & BNXT_FLAG_SHORT_CMD) {
134 void *short_cmd_req = softc->hwrm_short_cmd_req_addr.idi_vaddr;
137 memset((uint8_t *) short_cmd_req + msg_len, 0, softc->hwrm_max_req_len-
145 htole64(softc->hwrm_short_cmd_req_addr.idi_paddr);
158 bus_space_write_4(softc->hwrm_bar.tag,
159 softc->hwrm_bar.handle,
166 bus_space_write_4(softc->hwrm_bar.tag, softc->hwrm_bar.handle,
170 bus_space_write_4(softc->hwrm_bar.tag,
171 softc->hwrm_bar.handle,
175 for (i = 0; i < softc->hwrm_cmd_timeo; i++) {
180 if (i >= softc->hwrm_cmd_timeo) {
181 device_printf(softc->dev,
183 GET_HWRM_REQ_TYPE(req->req_type), softc->hwrm_cmd_timeo,
189 for (i = 0; i < softc->hwrm_cmd_timeo; i++) {
194 if (i >= softc->hwrm_cmd_timeo) {
195 device_printf(softc->dev, "Timeout sending %s: "
198 softc->hwrm_cmd_timeo, le16toh(req->req_type),
208 device_printf(softc->dev,
220 hwrm_send_message(struct bnxt_softc *softc, void *msg, uint32_t msg_len)
224 BNXT_HWRM_LOCK(softc);
225 rc = _hwrm_send_message(softc, msg, msg_len);
226 BNXT_HWRM_UNLOCK(softc);
231 bnxt_hwrm_queue_qportcfg(struct bnxt_softc *softc)
235 (void *)softc->hwrm_cmd_resp.idi_vaddr;
240 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_QUEUE_QPORTCFG);
242 BNXT_HWRM_LOCK(softc);
243 rc = _hwrm_send_message(softc, &req, sizeof(req));
251 softc->max_tc = resp->max_configurable_queues;
252 if (softc->max_tc > BNXT_MAX_QUEUE)
253 softc->max_tc = BNXT_MAX_QUEUE;
256 for (int i = 0; i < softc->max_tc; i++) {
257 softc->q_info[i].id = *qptr++;
258 softc->q_info[i].profile = *qptr++;
262 BNXT_HWRM_UNLOCK(softc);
267 bnxt_hwrm_ver_get(struct bnxt_softc *softc)
271 (void *)softc->hwrm_cmd_resp.idi_vaddr;
277 softc->hwrm_max_req_len = HWRM_MAX_REQ_LEN;
278 softc->hwrm_cmd_timeo = 1000;
279 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VER_GET);
285 BNXT_HWRM_LOCK(softc);
286 rc = _hwrm_send_message(softc, &req, sizeof(req));
290 snprintf(softc->ver_info->hwrm_if_ver, BNXT_VERSTR_SIZE, "%d.%d.%d",
292 softc->ver_info->hwrm_if_major = resp->hwrm_intf_maj;
293 softc->ver_info->hwrm_if_minor = resp->hwrm_intf_min;
294 softc->ver_info->hwrm_if_update = resp->hwrm_intf_upd;
295 snprintf(softc->ver_info->hwrm_fw_ver, BNXT_VERSTR_SIZE, "%d.%d.%d",
297 strlcpy(softc->ver_info->driver_hwrm_if_ver, HWRM_VERSION_STR,
299 strlcpy(softc->ver_info->hwrm_fw_name, resp->hwrm_fw_name,
304 strlcpy(softc->ver_info->mgmt_fw_ver, naver, BNXT_VERSTR_SIZE);
305 strlcpy(softc->ver_info->mgmt_fw_name, nastr, BNXT_NAME_SIZE);
308 snprintf(softc->ver_info->mgmt_fw_ver, BNXT_VERSTR_SIZE,
311 strlcpy(softc->ver_info->mgmt_fw_name, resp->mgmt_fw_name,
316 strlcpy(softc->ver_info->netctrl_fw_ver, naver,
318 strlcpy(softc->ver_info->netctrl_fw_name, nastr,
322 snprintf(softc->ver_info->netctrl_fw_ver, BNXT_VERSTR_SIZE,
325 strlcpy(softc->ver_info->netctrl_fw_name, resp->netctrl_fw_name,
330 strlcpy(softc->ver_info->roce_fw_ver, naver, BNXT_VERSTR_SIZE);
331 strlcpy(softc->ver_info->roce_fw_name, nastr, BNXT_NAME_SIZE);
334 snprintf(softc->ver_info->roce_fw_ver, BNXT_VERSTR_SIZE,
337 strlcpy(softc->ver_info->roce_fw_name, resp->roce_fw_name,
340 softc->ver_info->chip_num = le16toh(resp->chip_num);
341 softc->ver_info->chip_rev = resp->chip_rev;
342 softc->ver_info->chip_metal = resp->chip_metal;
343 softc->ver_info->chip_bond_id = resp->chip_bond_id;
344 softc->ver_info->chip_type = resp->chip_platform_type;
347 softc->hwrm_max_req_len = le16toh(resp->max_req_win_len);
349 softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout);
354 softc->flags |= BNXT_FLAG_SHORT_CMD;
357 BNXT_HWRM_UNLOCK(softc);
362 bnxt_hwrm_func_drv_rgtr(struct bnxt_softc *softc)
366 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR);
376 return hwrm_send_message(softc, &req, sizeof(req));
380 bnxt_hwrm_func_drv_unrgtr(struct bnxt_softc *softc, bool shutdown)
384 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_UNRGTR);
388 return hwrm_send_message(softc, &req, sizeof(req));
414 bnxt_hwrm_func_qcaps(struct bnxt_softc *softc)
419 (void *)softc->hwrm_cmd_resp.idi_vaddr;
420 struct bnxt_func_info *func = &softc->func;
422 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_QCAPS);
425 BNXT_HWRM_LOCK(softc);
426 rc = _hwrm_send_message(softc, &req, sizeof(req));
432 softc->flags |= BNXT_FLAG_WOL_CAP;
446 if (BNXT_PF(softc)) {
447 struct bnxt_pf_info *pf = &softc->pf;
460 device_printf(softc->dev, "Invalid ethernet address, generating random locally administered address\n");
465 BNXT_HWRM_UNLOCK(softc);
470 bnxt_hwrm_func_qcfg(struct bnxt_softc *softc)
474 (void *)softc->hwrm_cmd_resp.idi_vaddr;
475 struct bnxt_func_qcfg *fn_qcfg = &softc->fn_qcfg;
478 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_QCFG);
480 BNXT_HWRM_LOCK(softc);
481 rc = _hwrm_send_message(softc, &req, sizeof(req));
490 BNXT_HWRM_UNLOCK(softc);
495 bnxt_hwrm_func_reset(struct bnxt_softc *softc)
499 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_RESET);
502 return hwrm_send_message(softc, &req, sizeof(req));
506 bnxt_hwrm_set_link_common(struct bnxt_softc *softc,
509 uint8_t autoneg = softc->link_info.autoneg;
510 uint16_t fw_link_speed = softc->link_info.req_link_speed;
530 bnxt_hwrm_set_pause_common(struct bnxt_softc *softc,
533 struct bnxt_link_info *link_info = &softc->link_info;
560 bnxt_hwrm_set_eee(struct bnxt_softc *softc, struct hwrm_port_phy_cfg_input *req)
562 /* struct ethtool_eee *eee = &softc->eee; */
585 bnxt_hwrm_set_link_setting(struct bnxt_softc *softc, bool set_pause,
591 if (softc->flags & BNXT_FLAG_NPAR)
594 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_PHY_CFG);
597 bnxt_hwrm_set_pause_common(softc, &req);
599 if (softc->link_info.flow_ctrl.autoneg)
604 bnxt_hwrm_set_link_common(softc, &req);
607 bnxt_hwrm_set_eee(softc, &req);
609 BNXT_HWRM_LOCK(softc);
610 rc = _hwrm_send_message(softc, &req, sizeof(req));
618 if (!softc->link_info.flow_ctrl.autoneg)
619 bnxt_report_link(softc);
622 BNXT_HWRM_UNLOCK(softc);
627 bnxt_hwrm_vnic_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic)
631 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_CFG);
649 return hwrm_send_message(softc, &req, sizeof(req));
653 bnxt_hwrm_vnic_alloc(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic)
657 (void *)softc->hwrm_cmd_resp.idi_vaddr;
661 device_printf(softc->dev,
666 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_ALLOC);
671 BNXT_HWRM_LOCK(softc);
672 rc = _hwrm_send_message(softc, &req, sizeof(req));
679 BNXT_HWRM_UNLOCK(softc);
684 bnxt_hwrm_vnic_ctx_alloc(struct bnxt_softc *softc, uint16_t *ctx_id)
688 (void *)softc->hwrm_cmd_resp.idi_vaddr;
692 device_printf(softc->dev,
697 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_COS_LB_CTX_ALLOC);
699 BNXT_HWRM_LOCK(softc);
700 rc = _hwrm_send_message(softc, &req, sizeof(req));
707 BNXT_HWRM_UNLOCK(softc);
712 bnxt_hwrm_ring_grp_alloc(struct bnxt_softc *softc, struct bnxt_grp_info *grp)
719 device_printf(softc->dev,
724 resp = (void *)softc->hwrm_cmd_resp.idi_vaddr;
725 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_RING_GRP_ALLOC);
731 BNXT_HWRM_LOCK(softc);
732 rc = _hwrm_send_message(softc, &req, sizeof(req));
739 BNXT_HWRM_UNLOCK(softc);
747 bnxt_hwrm_ring_alloc(struct bnxt_softc *softc, uint8_t type,
756 device_printf(softc->dev,
761 resp = (void *)softc->hwrm_cmd_resp.idi_vaddr;
762 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_RING_ALLOC);
776 req.queue_id = htole16(softc->q_info[0].id);
786 BNXT_HWRM_LOCK(softc);
787 rc = _hwrm_send_message(softc, &req, sizeof(req));
794 BNXT_HWRM_UNLOCK(softc);
799 bnxt_hwrm_stat_ctx_alloc(struct bnxt_softc *softc, struct bnxt_cp_ring *cpr,
807 device_printf(softc->dev,
813 resp = (void *)softc->hwrm_cmd_resp.idi_vaddr;
814 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_STAT_CTX_ALLOC);
819 BNXT_HWRM_LOCK(softc);
820 rc = _hwrm_send_message(softc, &req, sizeof(req));
827 BNXT_HWRM_UNLOCK(softc);
833 bnxt_hwrm_port_qstats(struct bnxt_softc *softc)
838 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_QSTATS);
840 req.port_id = htole16(softc->pf.port_id);
841 req.rx_stat_host_addr = htole64(softc->hw_rx_port_stats.idi_paddr);
842 req.tx_stat_host_addr = htole64(softc->hw_tx_port_stats.idi_paddr);
844 BNXT_HWRM_LOCK(softc);
845 rc = _hwrm_send_message(softc, &req, sizeof(req));
846 BNXT_HWRM_UNLOCK(softc);
852 bnxt_hwrm_cfa_l2_set_rx_mask(struct bnxt_softc *softc,
879 rc = iflib_dma_alloc(softc->ctx, 4 * num_vlan_tags,
891 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_CFA_L2_SET_RX_MASK);
899 return hwrm_send_message(softc, &req, sizeof(req));
903 bnxt_hwrm_set_filter(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic)
911 device_printf(softc->dev,
916 resp = (void *)softc->hwrm_cmd_resp.idi_vaddr;
917 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_CFA_L2_FILTER_ALLOC);
925 memcpy(req.l2_addr, if_getlladdr(iflib_get_ifp(softc->ctx)),
929 BNXT_HWRM_LOCK(softc);
930 rc = _hwrm_send_message(softc, &req, sizeof(req));
938 BNXT_HWRM_UNLOCK(softc);
943 bnxt_hwrm_rss_cfg(struct bnxt_softc *softc, struct bnxt_vnic_info *vnic,
948 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_RSS_CFG);
955 return hwrm_send_message(softc, &req, sizeof(req));
959 bnxt_cfg_async_cr(struct bnxt_softc *softc)
963 if (BNXT_PF(softc)) {
966 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG);
970 req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id);
972 rc = hwrm_send_message(softc, &req, sizeof(req));
977 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_VF_CFG);
980 req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id);
982 rc = hwrm_send_message(softc, &req, sizeof(req));
988 bnxt_validate_hw_lro_settings(struct bnxt_softc *softc)
990 softc->hw_lro.enable = min(softc->hw_lro.enable, 1);
992 softc->hw_lro.is_mode_gro = min(softc->hw_lro.is_mode_gro, 1);
994 softc->hw_lro.max_agg_segs = min(softc->hw_lro.max_agg_segs,
997 softc->hw_lro.max_aggs = min(softc->hw_lro.max_aggs,
1000 softc->hw_lro.min_agg_len = min(softc->hw_lro.min_agg_len, BNXT_MAX_MTU);
1004 bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc)
1009 if (softc->vnic_info.id == (uint16_t) HWRM_NA_SIGNATURE) {
1013 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_VNIC_TPA_CFG);
1015 if (softc->hw_lro.enable) {
1021 if (softc->hw_lro.is_mode_gro)
1032 req.max_agg_segs = htole16(softc->hw_lro.max_agg_segs);
1033 req.max_aggs = htole16(softc->hw_lro.max_aggs);
1034 req.min_agg_len = htole32(softc->hw_lro.min_agg_len);
1037 req.vnic_id = htole16(softc->vnic_info.id);
1039 return hwrm_send_message(softc, &req, sizeof(req));
1043 bnxt_hwrm_nvm_find_dir_entry(struct bnxt_softc *softc, uint16_t type,
1050 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1056 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_FIND_DIR_ENTRY);
1067 BNXT_HWRM_LOCK(softc);
1068 old_timeo = softc->hwrm_cmd_timeo;
1069 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1070 rc = _hwrm_send_message(softc, &req, sizeof(req));
1071 softc->hwrm_cmd_timeo = old_timeo;
1086 BNXT_HWRM_UNLOCK(softc);
1091 bnxt_hwrm_nvm_read(struct bnxt_softc *softc, uint16_t index, uint32_t offset,
1102 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_READ);
1107 BNXT_HWRM_LOCK(softc);
1108 old_timeo = softc->hwrm_cmd_timeo;
1109 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1110 rc = _hwrm_send_message(softc, &req, sizeof(req));
1111 softc->hwrm_cmd_timeo = old_timeo;
1112 BNXT_HWRM_UNLOCK(softc);
1124 bnxt_hwrm_nvm_modify(struct bnxt_softc *softc, uint16_t index, uint32_t offset,
1134 rc = iflib_dma_alloc(softc->ctx, length, &dma_data,
1148 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_MODIFY);
1153 BNXT_HWRM_LOCK(softc);
1154 old_timeo = softc->hwrm_cmd_timeo;
1155 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1156 rc = _hwrm_send_message(softc, &req, sizeof(req));
1157 softc->hwrm_cmd_timeo = old_timeo;
1158 BNXT_HWRM_UNLOCK(softc);
1166 bnxt_hwrm_fw_reset(struct bnxt_softc *softc, uint8_t processor,
1171 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1176 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FW_RESET);
1180 BNXT_HWRM_LOCK(softc);
1181 rc = _hwrm_send_message(softc, &req, sizeof(req));
1187 BNXT_HWRM_UNLOCK(softc);
1192 bnxt_hwrm_fw_qstatus(struct bnxt_softc *softc, uint8_t type, uint8_t *selfreset)
1196 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1201 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FW_QSTATUS);
1204 BNXT_HWRM_LOCK(softc);
1205 rc = _hwrm_send_message(softc, &req, sizeof(req));
1211 BNXT_HWRM_UNLOCK(softc);
1216 bnxt_hwrm_nvm_write(struct bnxt_softc *softc, void *data, bool cpyin,
1223 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1229 rc = iflib_dma_alloc(softc->ctx, data_length, &dma_data,
1246 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_WRITE);
1262 BNXT_HWRM_LOCK(softc);
1263 old_timeo = softc->hwrm_cmd_timeo;
1264 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1265 rc = _hwrm_send_message(softc, &req, sizeof(req));
1266 softc->hwrm_cmd_timeo = old_timeo;
1275 BNXT_HWRM_UNLOCK(softc);
1283 bnxt_hwrm_nvm_erase_dir_entry(struct bnxt_softc *softc, uint16_t index)
1289 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_ERASE_DIR_ENTRY);
1291 BNXT_HWRM_LOCK(softc);
1292 old_timeo = softc->hwrm_cmd_timeo;
1293 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1294 rc = _hwrm_send_message(softc, &req, sizeof(req));
1295 softc->hwrm_cmd_timeo = old_timeo;
1296 BNXT_HWRM_UNLOCK(softc);
1301 bnxt_hwrm_nvm_get_dir_info(struct bnxt_softc *softc, uint32_t *entries,
1306 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1310 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_GET_DIR_INFO);
1312 BNXT_HWRM_LOCK(softc);
1313 old_timeo = softc->hwrm_cmd_timeo;
1314 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1315 rc = _hwrm_send_message(softc, &req, sizeof(req));
1316 softc->hwrm_cmd_timeo = old_timeo;
1326 BNXT_HWRM_UNLOCK(softc);
1331 bnxt_hwrm_nvm_get_dir_entries(struct bnxt_softc *softc, uint32_t *entries,
1345 rc = bnxt_hwrm_nvm_get_dir_info(softc, entries, entry_length);
1358 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_GET_DIR_ENTRIES);
1360 BNXT_HWRM_LOCK(softc);
1361 old_timeo = softc->hwrm_cmd_timeo;
1362 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1363 rc = _hwrm_send_message(softc, &req, sizeof(req));
1364 softc->hwrm_cmd_timeo = old_timeo;
1365 BNXT_HWRM_UNLOCK(softc);
1376 bnxt_hwrm_nvm_get_dev_info(struct bnxt_softc *softc, uint16_t *mfg_id,
1382 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1386 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_GET_DEV_INFO);
1388 BNXT_HWRM_LOCK(softc);
1389 old_timeo = softc->hwrm_cmd_timeo;
1390 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1391 rc = _hwrm_send_message(softc, &req, sizeof(req));
1392 softc->hwrm_cmd_timeo = old_timeo;
1410 BNXT_HWRM_UNLOCK(softc);
1415 bnxt_hwrm_nvm_install_update(struct bnxt_softc *softc,
1421 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1425 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_INSTALL_UPDATE);
1428 BNXT_HWRM_LOCK(softc);
1429 old_timeo = softc->hwrm_cmd_timeo;
1430 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1431 rc = _hwrm_send_message(softc, &req, sizeof(req));
1432 softc->hwrm_cmd_timeo = old_timeo;
1446 BNXT_HWRM_UNLOCK(softc);
1451 bnxt_hwrm_nvm_verify_update(struct bnxt_softc *softc, uint16_t type,
1458 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_NVM_VERIFY_UPDATE);
1464 BNXT_HWRM_LOCK(softc);
1465 old_timeo = softc->hwrm_cmd_timeo;
1466 softc->hwrm_cmd_timeo = BNXT_NVM_TIMEO;
1467 rc = _hwrm_send_message(softc, &req, sizeof(req));
1468 softc->hwrm_cmd_timeo = old_timeo;
1469 BNXT_HWRM_UNLOCK(softc);
1474 bnxt_hwrm_fw_get_time(struct bnxt_softc *softc, uint16_t *year, uint8_t *month,
1480 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1483 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FW_GET_TIME);
1485 BNXT_HWRM_LOCK(softc);
1486 rc = _hwrm_send_message(softc, &req, sizeof(req));
1508 BNXT_HWRM_UNLOCK(softc);
1513 bnxt_hwrm_fw_set_time(struct bnxt_softc *softc, uint16_t year, uint8_t month,
1519 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FW_SET_TIME);
1529 return hwrm_send_message(softc, &req, sizeof(req));
1533 bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc)
1535 struct bnxt_link_info *link_info = &softc->link_info;
1538 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1541 BNXT_HWRM_LOCK(softc);
1542 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_PORT_PHY_QCFG);
1544 rc = _hwrm_send_message(softc, &req, sizeof(req));
1600 snprintf(softc->ver_info->phy_ver, sizeof(softc->ver_info->phy_ver),
1603 strlcpy(softc->ver_info->phy_vendor, resp->phy_vendor_name,
1605 strlcpy(softc->ver_info->phy_partnumber, resp->phy_vendor_partnumber,
1614 BNXT_HWRM_UNLOCK(softc);
1619 bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle)
1623 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1627 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_WOL_FILTER_QCFG);
1628 req.port_id = htole16(softc->pf.port_id);
1630 rc = hwrm_send_message(softc, &req, sizeof(req));
1636 softc->wol = 1;
1637 softc->wol_filter_id = resp->wol_filter_id;
1645 bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc)
1649 (void *)softc->hwrm_cmd_resp.idi_vaddr;
1652 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_WOL_FILTER_ALLOC);
1653 req.port_id = htole16(softc->pf.port_id);
1657 memcpy(req.mac_address, softc->func.mac_addr, ETHER_ADDR_LEN);
1658 rc = hwrm_send_message(softc, &req, sizeof(req));
1660 softc->wol_filter_id = resp->wol_filter_id;
1666 bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc)
1670 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_WOL_FILTER_FREE);
1671 req.port_id = htole16(softc->pf.port_id);
1674 req.wol_filter_id = softc->wol_filter_id;
1675 return hwrm_send_message(softc, &req, sizeof(req));
1678 static void bnxt_hwrm_set_coal_params(struct bnxt_softc *softc, uint32_t max_frames,
1693 int bnxt_hwrm_set_coal(struct bnxt_softc *softc)
1702 bnxt_hwrm_cmd_hdr_init(softc, &req_rx,
1704 bnxt_hwrm_cmd_hdr_init(softc, &req_tx,
1710 max_buf = min_t(uint16_t, softc->rx_coal_frames / 4, 2);
1713 max_buf_irq = clamp_t(uint16_t, softc->rx_coal_frames_irq, 1, 63);
1714 buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs);
1717 buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs_irq);
1725 if (softc->rx_coal_usecs < 25)
1728 bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf,
1732 max_buf = clamp_t(uint16_t, softc->tx_coal_frames, 1, 63);
1733 max_buf_irq = clamp_t(uint16_t, softc->tx_coal_frames_irq, 1, 63);
1734 buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs);
1737 buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs_irq);
1740 bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf,
1743 for (i = 0; i < softc->nrxqsets; i++) {
1753 req->ring_id = htole16(softc->grp_info[i].cp_ring_id);
1755 rc = hwrm_send_message(softc, req, sizeof(*req));
1762 int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap,
1773 bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR);
1800 return hwrm_send_message(softc, &req, sizeof(req));