Lines Matching refs:hwfn
670 struct qed_hwfn *hwfn = &cdev->hwfns[index % cdev->num_hwfns]; in qed_simd_handler_config() local
673 hwfn->simd_proto_handler[relative_idx].func = handler; in qed_simd_handler_config()
674 hwfn->simd_proto_handler[relative_idx].token = token; in qed_simd_handler_config()
679 struct qed_hwfn *hwfn = &cdev->hwfns[index % cdev->num_hwfns]; in qed_simd_handler_clean() local
682 memset(&hwfn->simd_proto_handler[relative_idx], 0, in qed_simd_handler_clean()
695 struct qed_hwfn *hwfn; in qed_single_int() local
706 hwfn = &cdev->hwfns[i]; in qed_single_int()
710 tasklet_schedule(&hwfn->sp_dpc); in qed_single_int()
719 &hwfn->simd_proto_handler[j]; in qed_single_int()
724 DP_NOTICE(hwfn, in qed_single_int()
734 DP_VERBOSE(hwfn, NETIF_MSG_INTR, in qed_single_int()
742 int qed_slowpath_irq_req(struct qed_hwfn *hwfn) in qed_slowpath_irq_req() argument
744 struct qed_dev *cdev = hwfn->cdev; in qed_slowpath_irq_req()
751 id = hwfn->my_id; in qed_slowpath_irq_req()
752 snprintf(hwfn->name, NAME_SIZE, "sp-%d-%02x:%02x.%02x", in qed_slowpath_irq_req()
754 PCI_SLOT(cdev->pdev->devfn), hwfn->abs_pf_id); in qed_slowpath_irq_req()
756 qed_msix_sp_int, 0, hwfn->name, &hwfn->sp_dpc); in qed_slowpath_irq_req()
774 DP_VERBOSE(hwfn, (NETIF_MSG_INTR | QED_MSG_SP), in qed_slowpath_irq_req()
1120 static int qed_slowpath_delayed_work(struct qed_hwfn *hwfn, in qed_slowpath_delayed_work() argument
1124 if (!hwfn->slowpath_wq_active) in qed_slowpath_delayed_work()
1129 set_bit(wq_flag, &hwfn->slowpath_task_flags); in qed_slowpath_delayed_work()
1132 queue_delayed_work(hwfn->slowpath_wq, &hwfn->slowpath_task, delay); in qed_slowpath_delayed_work()
1172 struct qed_hwfn *hwfn = container_of(work, struct qed_hwfn, in qed_slowpath_task() local
1174 struct qed_ptt *ptt = qed_ptt_acquire(hwfn); in qed_slowpath_task()
1177 if (hwfn->slowpath_wq_active) in qed_slowpath_task()
1178 queue_delayed_work(hwfn->slowpath_wq, in qed_slowpath_task()
1179 &hwfn->slowpath_task, 0); in qed_slowpath_task()
1185 &hwfn->slowpath_task_flags)) in qed_slowpath_task()
1186 qed_mfw_process_tlv_req(hwfn, ptt); in qed_slowpath_task()
1189 &hwfn->slowpath_task_flags)) { in qed_slowpath_task()
1191 if (hwfn->cdev->recov_in_prog || !hwfn->slowpath_wq_active) in qed_slowpath_task()
1194 qed_db_rec_handler(hwfn, ptt); in qed_slowpath_task()
1195 if (hwfn->periodic_db_rec_count--) in qed_slowpath_task()
1196 qed_slowpath_delayed_work(hwfn, in qed_slowpath_task()
1202 qed_ptt_release(hwfn, ptt); in qed_slowpath_task()
1207 struct qed_hwfn *hwfn; in qed_slowpath_wq_start() local
1214 hwfn = &cdev->hwfns[i]; in qed_slowpath_wq_start()
1216 hwfn->slowpath_wq = alloc_workqueue("slowpath-%02x:%02x.%02x", in qed_slowpath_wq_start()
1219 hwfn->abs_pf_id); in qed_slowpath_wq_start()
1221 if (!hwfn->slowpath_wq) { in qed_slowpath_wq_start()
1222 DP_NOTICE(hwfn, "Cannot create slowpath workqueue\n"); in qed_slowpath_wq_start()
1226 INIT_DELAYED_WORK(&hwfn->slowpath_task, qed_slowpath_task); in qed_slowpath_wq_start()
1227 hwfn->slowpath_wq_active = true; in qed_slowpath_wq_start()
1241 struct qed_hwfn *hwfn; in qed_slowpath_start() local
1346 hwfn = QED_LEADING_HWFN(cdev); in qed_slowpath_start()
1353 rc = qed_mcp_send_drv_version(hwfn, hwfn->p_main_ptt, in qed_slowpath_start()
1655 struct qed_hwfn *hwfn; in qed_set_link() local
1664 hwfn = &cdev->hwfns[0]; in qed_set_link()
1671 qed_schedule_iov(hwfn, QED_IOV_WQ_VF_FORCE_LINK_QUERY_FLAG); in qed_set_link()
1675 ptt = qed_ptt_acquire(hwfn); in qed_set_link()
1679 link_params = qed_mcp_get_link_params(hwfn); in qed_set_link()
1702 if (qed_mcp_is_ext_speed_supported(hwfn)) in qed_set_link()
1766 rc = qed_mcp_set_link(hwfn, ptt, params->link_up); in qed_set_link()
1768 qed_ptt_release(hwfn, ptt); in qed_set_link()
1802 static int qed_get_link_data(struct qed_hwfn *hwfn, in qed_get_link_data() argument
1809 if (!IS_PF(hwfn->cdev)) { in qed_get_link_data()
1810 qed_vf_get_link_params(hwfn, params); in qed_get_link_data()
1811 qed_vf_get_link_state(hwfn, link); in qed_get_link_data()
1812 qed_vf_get_link_caps(hwfn, link_caps); in qed_get_link_data()
1817 p = qed_mcp_get_link_params(hwfn); in qed_get_link_data()
1822 p = qed_mcp_get_link_state(hwfn); in qed_get_link_data()
1827 p = qed_mcp_get_link_capabilities(hwfn); in qed_get_link_data()
1835 static void qed_fill_link_capability(struct qed_hwfn *hwfn, in qed_fill_link_capability() argument
1842 if (qed_mcp_get_media_type(hwfn, ptt, &media_type)) in qed_fill_link_capability()
1845 if (qed_mcp_get_transceiver_data(hwfn, ptt, &tcvr_state, &tcvr_type)) in qed_fill_link_capability()
1848 if (qed_mcp_trans_speed_mask(hwfn, ptt, &speed_mask)) in qed_fill_link_capability()
1851 if (qed_mcp_get_board_config(hwfn, ptt, &board_cfg)) in qed_fill_link_capability()
1854 DP_VERBOSE(hwfn->cdev, NETIF_MSG_DRV, in qed_fill_link_capability()
2042 DP_VERBOSE(hwfn->cdev, QED_MSG_DEBUG, in qed_fill_link_capability()
2069 static void qed_fill_link(struct qed_hwfn *hwfn, in qed_fill_link() argument
2081 if (qed_get_link_data(hwfn, ¶ms, &link, &link_caps)) { in qed_fill_link()
2082 dev_warn(&hwfn->cdev->pdev->dev, "no link data available\n"); in qed_fill_link()
2090 if (IS_PF(hwfn->cdev) && qed_mcp_is_ext_speed_supported(hwfn)) { in qed_fill_link()
2101 qed_fill_link_capability(hwfn, ptt, in qed_fill_link()
2127 qed_fill_link_capability(hwfn, ptt, params.speed.advertised_speeds, in qed_fill_link()
2131 qed_fill_link_capability(hwfn, ptt, link_caps.speed_capabilities, in qed_fill_link()
2136 qed_fill_link_capability(hwfn, ptt, speed_mask, if_link->lp_caps); in qed_fill_link()
2143 qed_mcp_get_media_type(hwfn, ptt, &media_type); in qed_fill_link()
2182 struct qed_hwfn *hwfn; in qed_get_current_link() local
2186 hwfn = &cdev->hwfns[0]; in qed_get_current_link()
2188 ptt = qed_ptt_acquire(hwfn); in qed_get_current_link()
2190 qed_fill_link(hwfn, ptt, if_link); in qed_get_current_link()
2191 qed_ptt_release(hwfn, ptt); in qed_get_current_link()
2193 DP_NOTICE(hwfn, "Failed to fill link; No PTT\n"); in qed_get_current_link()
2196 qed_fill_link(hwfn, NULL, if_link); in qed_get_current_link()
2203 void qed_link_update(struct qed_hwfn *hwfn, struct qed_ptt *ptt) in qed_link_update() argument
2205 void *cookie = hwfn->cdev->ops_cookie; in qed_link_update()
2206 struct qed_common_cb_ops *op = hwfn->cdev->protocol_ops.common; in qed_link_update()
2209 qed_fill_link(hwfn, ptt, &if_link); in qed_link_update()
2210 qed_inform_vf_link_state(hwfn); in qed_link_update()
2212 if (IS_LEAD_HWFN(hwfn) && cookie) in qed_link_update()
2216 void qed_bw_update(struct qed_hwfn *hwfn, struct qed_ptt *ptt) in qed_bw_update() argument
2218 void *cookie = hwfn->cdev->ops_cookie; in qed_bw_update()
2219 struct qed_common_cb_ops *op = hwfn->cdev->protocol_ops.common; in qed_bw_update()
2221 if (IS_LEAD_HWFN(hwfn) && cookie && op && op->bw_update) in qed_bw_update()
2227 struct qed_hwfn *hwfn; in qed_drain() local
2235 hwfn = &cdev->hwfns[i]; in qed_drain()
2236 ptt = qed_ptt_acquire(hwfn); in qed_drain()
2238 DP_NOTICE(hwfn, "Failed to drain NIG; No PTT\n"); in qed_drain()
2241 rc = qed_mcp_drain(hwfn, ptt); in qed_drain()
2242 qed_ptt_release(hwfn, ptt); in qed_drain()
2526 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_nvm_flash_cfg_write() local
2534 ptt = qed_ptt_acquire(hwfn); in qed_nvm_flash_cfg_write()
2577 rc = qed_mcp_nvm_set_cfg(hwfn, ptt, cfg_id, entity_id, flags, in qed_nvm_flash_cfg_write()
2585 qed_ptt_release(hwfn, ptt); in qed_nvm_flash_cfg_write()
2593 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_nvm_flash_cfg_len() local
2599 ptt = qed_ptt_acquire(hwfn); in qed_nvm_flash_cfg_len()
2603 rc = qed_mcp_nvm_get_cfg(hwfn, ptt, cmd, 0, QED_NVM_CFG_GET_FLAGS, buf, in qed_nvm_flash_cfg_len()
2610 qed_ptt_release(hwfn, ptt); in qed_nvm_flash_cfg_len()
2618 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_nvm_flash_cfg_read() local
2623 ptt = qed_ptt_acquire(hwfn); in qed_nvm_flash_cfg_read()
2630 rc = qed_mcp_nvm_get_cfg(hwfn, ptt, cmd, entity_id, flags, *data, &len); in qed_nvm_flash_cfg_read()
2634 qed_ptt_release(hwfn, ptt); in qed_nvm_flash_cfg_read()
2728 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_nvm_get_image() local
2730 return qed_mcp_get_nvm_image(hwfn, type, buf, len); in qed_nvm_get_image()
2783 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_set_led() local
2787 ptt = qed_ptt_acquire(hwfn); in qed_set_led()
2791 status = qed_mcp_set_led(hwfn, ptt, mode); in qed_set_led()
2793 qed_ptt_release(hwfn, ptt); in qed_set_led()
2817 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_update_wol() local
2824 ptt = qed_ptt_acquire(hwfn); in qed_update_wol()
2828 rc = qed_mcp_ov_update_wol(hwfn, ptt, enabled ? QED_OV_WOL_ENABLED in qed_update_wol()
2832 rc = qed_mcp_ov_update_current_config(hwfn, ptt, QED_OV_CLIENT_DRV); in qed_update_wol()
2835 qed_ptt_release(hwfn, ptt); in qed_update_wol()
2841 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_update_drv_state() local
2848 ptt = qed_ptt_acquire(hwfn); in qed_update_drv_state()
2852 status = qed_mcp_ov_update_driver_state(hwfn, ptt, active ? in qed_update_drv_state()
2856 qed_ptt_release(hwfn, ptt); in qed_update_drv_state()
2863 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_update_mac() local
2870 ptt = qed_ptt_acquire(hwfn); in qed_update_mac()
2874 status = qed_mcp_ov_update_mac(hwfn, ptt, mac); in qed_update_mac()
2878 status = qed_mcp_ov_update_current_config(hwfn, ptt, QED_OV_CLIENT_DRV); in qed_update_mac()
2881 qed_ptt_release(hwfn, ptt); in qed_update_mac()
2887 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_update_mtu() local
2894 ptt = qed_ptt_acquire(hwfn); in qed_update_mtu()
2898 status = qed_mcp_ov_update_mtu(hwfn, ptt, mtu); in qed_update_mtu()
2902 status = qed_mcp_ov_update_current_config(hwfn, ptt, QED_OV_CLIENT_DRV); in qed_update_mtu()
2905 qed_ptt_release(hwfn, ptt); in qed_update_mtu()
2913 struct qed_hwfn *hwfn = &cdev->hwfns[qid % cdev->num_hwfns]; in qed_get_sb_info() local
2920 ptt = qed_ptt_acquire(hwfn); in qed_get_sb_info()
2922 DP_NOTICE(hwfn, "Can't acquire PTT\n"); in qed_get_sb_info()
2927 rc = qed_int_get_sb_dbg(hwfn, ptt, sb, sb_dbg); in qed_get_sb_info()
2929 qed_ptt_release(hwfn, ptt); in qed_get_sb_info()
2936 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_read_module_eeprom() local
2943 ptt = qed_ptt_acquire(hwfn); in qed_read_module_eeprom()
2947 rc = qed_mcp_phy_sfp_read(hwfn, ptt, MFW_PORT(hwfn), dev_addr, in qed_read_module_eeprom()
2950 qed_ptt_release(hwfn, ptt); in qed_read_module_eeprom()
2957 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_set_grc_config() local
2964 ptt = qed_ptt_acquire(hwfn); in qed_set_grc_config()
2968 rc = qed_dbg_grc_config(hwfn, cfg_id, val); in qed_set_grc_config()
2970 qed_ptt_release(hwfn, ptt); in qed_set_grc_config()
3003 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev); in qed_get_esl_status() local
3012 ptt = qed_ptt_acquire(hwfn); in qed_get_esl_status()
3016 rc = qed_mcp_get_esl_status(hwfn, ptt, esl_active); in qed_get_esl_status()
3018 qed_ptt_release(hwfn, ptt); in qed_get_esl_status()
3113 int qed_mfw_tlv_req(struct qed_hwfn *hwfn) in qed_mfw_tlv_req() argument
3115 DP_VERBOSE(hwfn->cdev, NETIF_MSG_DRV, in qed_mfw_tlv_req()
3120 set_bit(QED_SLOWPATH_MFW_TLV_REQ, &hwfn->slowpath_task_flags); in qed_mfw_tlv_req()
3123 queue_delayed_work(hwfn->slowpath_wq, &hwfn->slowpath_task, 0); in qed_mfw_tlv_req()
3169 int qed_mfw_fill_tlv_data(struct qed_hwfn *hwfn, enum qed_mfw_tlv_type type, in qed_mfw_fill_tlv_data() argument
3172 struct qed_dev *cdev = hwfn->cdev; in qed_mfw_fill_tlv_data()
3177 DP_NOTICE(hwfn, "Can't collect TLV management info\n"); in qed_mfw_fill_tlv_data()
3183 qed_fill_generic_tlv_data(hwfn->cdev, &tlv_buf->generic); in qed_mfw_fill_tlv_data()