Lines Matching refs:hwdev

40 	struct hinic_hwdev *hwdev = nic_dev->hwdev;  in change_mac()  local
42 struct hinic_hwif *hwif = hwdev->hwif; in change_mac()
57 err = hinic_port_msg_cmd(hwdev, cmd, &port_mac_cmd, in change_mac()
119 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_get_mac() local
121 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_get_mac()
128 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_MAC, in hinic_port_get_mac()
151 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_mtu() local
153 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_mtu()
172 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_CHANGE_MTU, in hinic_port_set_mtu()
193 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_add_vlan() local
196 port_vlan_cmd.func_idx = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_port_add_vlan()
199 return hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_ADD_VLAN, in hinic_port_add_vlan()
213 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_del_vlan() local
216 port_vlan_cmd.func_idx = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_port_del_vlan()
219 return hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_DEL_VLAN, in hinic_port_del_vlan()
233 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_rx_mode() local
236 rx_mode_cmd.func_idx = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_port_set_rx_mode()
239 return hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RX_MODE, in hinic_port_set_rx_mode()
254 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_link_state() local
255 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_link_state()
263 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_LINK_STATE, in hinic_port_link_state()
285 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_state() local
287 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_state()
292 if (HINIC_IS_VF(hwdev->hwif)) in hinic_port_set_state()
297 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_PORT_STATE, in hinic_port_set_state()
320 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_func_state() local
321 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_func_state()
329 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_FUNC_STATE, in hinic_port_set_func_state()
351 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_get_cap() local
352 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_get_cap()
359 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_CAP, in hinic_port_get_cap()
381 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_tso() local
382 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_tso()
391 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_TSO, in hinic_port_set_tso()
407 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_csum_offload() local
413 if (!hwdev) in hinic_set_rx_csum_offload()
416 hwif = hwdev->hwif; in hinic_set_rx_csum_offload()
421 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RX_CSUM, in hinic_set_rx_csum_offload()
436 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_vlan_offload() local
443 if (!hwdev) in hinic_set_rx_vlan_offload()
447 hwif = hwdev->hwif; in hinic_set_rx_vlan_offload()
452 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD, in hinic_set_rx_vlan_offload()
467 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_max_qnum() local
468 struct hinic_hwif *hwif = hwdev->hwif; in hinic_set_max_qnum()
478 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RQ_IQ_MAP, in hinic_set_max_qnum()
494 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_lro() local
496 struct hinic_hwif *hwif = hwdev->hwif; in hinic_set_rx_lro()
506 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_LRO, in hinic_set_rx_lro()
521 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_lro_timer() local
523 struct hinic_hwif *hwif = hwdev->hwif; in hinic_set_rx_lro_timer()
533 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_LRO_TIMER, in hinic_set_rx_lro_timer()
557 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_lro_state() local
562 if (!hwdev) in hinic_set_rx_lro_state()
572 if (HINIC_IS_VF(nic_dev->hwdev->hwif)) in hinic_set_rx_lro_state()
588 struct hinic_hwdev *hwdev; in hinic_rss_set_indir_tbl() local
596 hwdev = nic_dev->hwdev; in hinic_rss_set_indir_tbl()
597 func_to_io = &hwdev->func_to_io; in hinic_rss_set_indir_tbl()
598 hwif = hwdev->hwif; in hinic_rss_set_indir_tbl()
657 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_get_indir_tbl() local
658 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_get_indir_tbl()
666 err = hinic_port_msg_cmd(hwdev, in hinic_rss_get_indir_tbl()
689 struct hinic_hwdev *hwdev; in hinic_set_rss_type() local
696 hwdev = nic_dev->hwdev; in hinic_set_rss_type()
697 func_to_io = &hwdev->func_to_io; in hinic_set_rss_type()
698 hwif = hwdev->hwif; in hinic_set_rss_type()
747 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_rss_type() local
753 if (!hwdev || !rss_type) in hinic_get_rss_type()
756 hwif = hwdev->hwif; in hinic_get_rss_type()
762 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_RSS_CTX_TBL, in hinic_get_rss_type()
787 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_set_template_tbl() local
788 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_set_template_tbl()
798 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RSS_TEMPLATE_TBL, in hinic_rss_set_template_tbl()
815 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_get_template_tbl() local
821 if (!hwdev || !temp) in hinic_rss_get_template_tbl()
824 hwif = hwdev->hwif; in hinic_rss_get_template_tbl()
830 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_RSS_TEMPLATE_TBL, in hinic_rss_get_template_tbl()
848 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_set_hash_engine() local
849 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_set_hash_engine()
858 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RSS_HASH_ENGINE, in hinic_rss_set_hash_engine()
874 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_get_hash_engine() local
880 if (!hwdev || !type) in hinic_rss_get_hash_engine()
883 hwif = hwdev->hwif; in hinic_rss_get_hash_engine()
889 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_RSS_HASH_ENGINE, in hinic_rss_get_hash_engine()
904 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_cfg() local
906 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_cfg()
916 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_RSS_CFG, in hinic_rss_cfg()
932 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_template_alloc() local
933 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_template_alloc()
941 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_RSS_TEMP_MGR, in hinic_rss_template_alloc()
958 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_template_free() local
959 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_template_free()
968 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_RSS_TEMP_MGR, in hinic_rss_template_free()
985 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_vport_stats() local
986 struct hinic_hwif *hwif = hwdev->hwif; in hinic_get_vport_stats()
995 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_VPORT_STAT, in hinic_get_vport_stats()
1013 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_phy_port_stats() local
1014 struct hinic_hwif *hwif = hwdev->hwif; in hinic_get_phy_port_stats()
1027 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_PORT_STATISTICS, in hinic_get_phy_port_stats()
1048 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_mgmt_version() local
1055 if (!hwdev) in hinic_get_mgmt_version()
1058 hwif = hwdev->hwif; in hinic_get_mgmt_version()
1061 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_MGMT_VERSION, in hinic_get_mgmt_version()
1076 int hinic_get_link_mode(struct hinic_hwdev *hwdev, in hinic_get_link_mode() argument
1082 if (!hwdev || !link_mode) in hinic_get_link_mode()
1085 link_mode->func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_get_link_mode()
1088 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_LINK_MODE, in hinic_get_link_mode()
1092 dev_err(&hwdev->hwif->pdev->dev, in hinic_get_link_mode()
1101 int hinic_set_autoneg(struct hinic_hwdev *hwdev, bool enable) in hinic_set_autoneg() argument
1107 if (!hwdev) in hinic_set_autoneg()
1110 autoneg.func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_set_autoneg()
1113 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_AUTONEG, in hinic_set_autoneg()
1117 dev_err(&hwdev->hwif->pdev->dev, "Failed to %s autoneg, err: %d, status: 0x%x, out size: 0x%x\n", in hinic_set_autoneg()
1126 int hinic_set_speed(struct hinic_hwdev *hwdev, enum nic_speed_level speed) in hinic_set_speed() argument
1132 if (!hwdev) in hinic_set_speed()
1135 speed_info.func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_set_speed()
1138 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_SPEED, in hinic_set_speed()
1142 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_speed()
1151 int hinic_set_link_settings(struct hinic_hwdev *hwdev, in hinic_set_link_settings() argument
1157 err = hinic_hilink_msg_cmd(hwdev, HINIC_HILINK_CMD_SET_LINK_SETTINGS, in hinic_set_link_settings()
1161 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_link_settings()
1170 int hinic_get_hw_pause_info(struct hinic_hwdev *hwdev, in hinic_get_hw_pause_info() argument
1176 pause_info->func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_get_hw_pause_info()
1178 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_PAUSE_INFO, in hinic_get_hw_pause_info()
1182 …dev_err(&hwdev->hwif->pdev->dev, "Failed to get pause info, err: %d, status: 0x%x, out size: 0x%x\… in hinic_get_hw_pause_info()
1190 int hinic_set_hw_pause_info(struct hinic_hwdev *hwdev, in hinic_set_hw_pause_info() argument
1196 pause_info->func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_set_hw_pause_info()
1198 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_PAUSE_INFO, in hinic_set_hw_pause_info()
1202 …dev_err(&hwdev->hwif->pdev->dev, "Failed to set pause info, err: %d, status: 0x%x, out size: 0x%x\… in hinic_set_hw_pause_info()
1210 int hinic_dcb_set_pfc(struct hinic_hwdev *hwdev, u8 pfc_en, u8 pfc_bitmap) in hinic_dcb_set_pfc() argument
1212 struct hinic_nic_cfg *nic_cfg = &hwdev->func_to_io.nic_cfg; in hinic_dcb_set_pfc()
1217 if (HINIC_IS_VF(hwdev->hwif)) in hinic_dcb_set_pfc()
1222 pfc.func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_dcb_set_pfc()
1226 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_PFC, in hinic_dcb_set_pfc()
1229 dev_err(&hwdev->hwif->pdev->dev, "Failed to %s pfc, err: %d, status: 0x%x, out size: 0x%x\n", in hinic_dcb_set_pfc()
1245 int hinic_set_loopback_mode(struct hinic_hwdev *hwdev, u32 mode, u32 enable) in hinic_set_loopback_mode() argument
1255 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_loopback_mode()
1260 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_LOOPBACK_MODE, in hinic_set_loopback_mode()
1263 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_loopback_mode()
1272 static int _set_led_status(struct hinic_hwdev *hwdev, u8 port, in _set_led_status() argument
1281 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in _set_led_status()
1294 …dev_err(&hwdev->hwif->pdev->dev, "Failed to set led status, err: %d, status: 0x%x, out size: 0x%x\… in _set_led_status()
1302 int hinic_set_led_status(struct hinic_hwdev *hwdev, u8 port, in hinic_set_led_status() argument
1305 if (!hwdev) in hinic_set_led_status()
1308 return _set_led_status(hwdev, port, type, mode, 0); in hinic_set_led_status()
1311 int hinic_reset_led_status(struct hinic_hwdev *hwdev, u8 port) in hinic_reset_led_status() argument
1315 if (!hwdev) in hinic_reset_led_status()
1318 err = _set_led_status(hwdev, port, HINIC_LED_TYPE_INVALID, in hinic_reset_led_status()
1321 dev_err(&hwdev->hwif->pdev->dev, in hinic_reset_led_status()
1327 static bool hinic_if_sfp_absent(struct hinic_hwdev *hwdev) in hinic_if_sfp_absent() argument
1331 u8 port_id = hwdev->port_id; in hinic_if_sfp_absent()
1335 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_SFP_ABS, in hinic_if_sfp_absent()
1339 dev_err(&hwdev->hwif->pdev->dev, in hinic_if_sfp_absent()
1348 int hinic_get_sfp_eeprom(struct hinic_hwdev *hwdev, u8 *data, u16 *len) in hinic_get_sfp_eeprom() argument
1355 if (!hwdev || !data || !len) in hinic_get_sfp_eeprom()
1358 port_id = hwdev->port_id; in hinic_get_sfp_eeprom()
1360 if (hinic_if_sfp_absent(hwdev)) in hinic_get_sfp_eeprom()
1364 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_STD_SFP_INFO, in hinic_get_sfp_eeprom()
1368 dev_err(&hwdev->hwif->pdev->dev, in hinic_get_sfp_eeprom()
1380 int hinic_get_sfp_type(struct hinic_hwdev *hwdev, u8 *data0, u8 *data1) in hinic_get_sfp_type() argument
1386 if (hinic_if_sfp_absent(hwdev)) in hinic_get_sfp_type()
1389 err = hinic_get_sfp_eeprom(hwdev, sfp_data, &len); in hinic_get_sfp_type()