Lines Matching refs:hwdev

37 	struct hinic_hwdev *hwdev = nic_dev->hwdev;  in change_mac()  local
39 struct hinic_hwif *hwif = hwdev->hwif; in change_mac()
54 err = hinic_port_msg_cmd(hwdev, cmd, &port_mac_cmd, in change_mac()
116 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_get_mac() local
118 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_get_mac()
125 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_MAC, in hinic_port_get_mac()
147 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_mtu() local
149 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_mtu()
157 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_CHANGE_MTU, in hinic_port_set_mtu()
178 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_add_vlan() local
181 port_vlan_cmd.func_idx = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_port_add_vlan()
184 return hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_ADD_VLAN, in hinic_port_add_vlan()
198 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_del_vlan() local
201 port_vlan_cmd.func_idx = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_port_del_vlan()
204 return hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_DEL_VLAN, in hinic_port_del_vlan()
218 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_rx_mode() local
221 rx_mode_cmd.func_idx = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_port_set_rx_mode()
224 return hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RX_MODE, in hinic_port_set_rx_mode()
239 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_link_state() local
240 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_link_state()
248 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_LINK_STATE, in hinic_port_link_state()
270 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_state() local
272 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_state()
277 if (HINIC_IS_VF(hwdev->hwif)) in hinic_port_set_state()
282 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_PORT_STATE, in hinic_port_set_state()
305 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_func_state() local
306 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_func_state()
314 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_FUNC_STATE, in hinic_port_set_func_state()
336 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_get_cap() local
337 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_get_cap()
344 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_CAP, in hinic_port_get_cap()
366 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_port_set_tso() local
367 struct hinic_hwif *hwif = hwdev->hwif; in hinic_port_set_tso()
376 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_TSO, in hinic_port_set_tso()
392 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_csum_offload() local
398 if (!hwdev) in hinic_set_rx_csum_offload()
401 hwif = hwdev->hwif; in hinic_set_rx_csum_offload()
406 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RX_CSUM, in hinic_set_rx_csum_offload()
421 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_vlan_offload() local
428 if (!hwdev) in hinic_set_rx_vlan_offload()
432 hwif = hwdev->hwif; in hinic_set_rx_vlan_offload()
437 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RX_VLAN_OFFLOAD, in hinic_set_rx_vlan_offload()
452 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_vlan_fliter() local
453 struct hinic_hwif *hwif = hwdev->hwif; in hinic_set_vlan_fliter()
462 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_VLAN_FILTER, in hinic_set_vlan_fliter()
482 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_max_qnum() local
483 struct hinic_hwif *hwif = hwdev->hwif; in hinic_set_max_qnum()
493 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RQ_IQ_MAP, in hinic_set_max_qnum()
509 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_lro() local
511 struct hinic_hwif *hwif = hwdev->hwif; in hinic_set_rx_lro()
521 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_LRO, in hinic_set_rx_lro()
536 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_lro_timer() local
538 struct hinic_hwif *hwif = hwdev->hwif; in hinic_set_rx_lro_timer()
548 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_LRO_TIMER, in hinic_set_rx_lro_timer()
572 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_set_rx_lro_state() local
577 if (!hwdev) in hinic_set_rx_lro_state()
587 if (HINIC_IS_VF(nic_dev->hwdev->hwif)) in hinic_set_rx_lro_state()
603 struct hinic_hwdev *hwdev; in hinic_rss_set_indir_tbl() local
611 hwdev = nic_dev->hwdev; in hinic_rss_set_indir_tbl()
612 func_to_io = &hwdev->func_to_io; in hinic_rss_set_indir_tbl()
613 hwif = hwdev->hwif; in hinic_rss_set_indir_tbl()
672 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_get_indir_tbl() local
673 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_get_indir_tbl()
681 err = hinic_port_msg_cmd(hwdev, in hinic_rss_get_indir_tbl()
704 struct hinic_hwdev *hwdev; in hinic_set_rss_type() local
711 hwdev = nic_dev->hwdev; in hinic_set_rss_type()
712 func_to_io = &hwdev->func_to_io; in hinic_set_rss_type()
713 hwif = hwdev->hwif; in hinic_set_rss_type()
762 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_rss_type() local
768 if (!hwdev || !rss_type) in hinic_get_rss_type()
771 hwif = hwdev->hwif; in hinic_get_rss_type()
777 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_RSS_CTX_TBL, in hinic_get_rss_type()
802 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_set_template_tbl() local
803 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_set_template_tbl()
813 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RSS_TEMPLATE_TBL, in hinic_rss_set_template_tbl()
830 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_get_template_tbl() local
836 if (!hwdev || !temp) in hinic_rss_get_template_tbl()
839 hwif = hwdev->hwif; in hinic_rss_get_template_tbl()
845 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_RSS_TEMPLATE_TBL, in hinic_rss_get_template_tbl()
863 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_set_hash_engine() local
864 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_set_hash_engine()
873 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_RSS_HASH_ENGINE, in hinic_rss_set_hash_engine()
889 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_get_hash_engine() local
895 if (!hwdev || !type) in hinic_rss_get_hash_engine()
898 hwif = hwdev->hwif; in hinic_rss_get_hash_engine()
904 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_RSS_HASH_ENGINE, in hinic_rss_get_hash_engine()
919 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_cfg() local
921 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_cfg()
931 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_RSS_CFG, in hinic_rss_cfg()
947 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_template_alloc() local
948 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_template_alloc()
956 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_RSS_TEMP_MGR, in hinic_rss_template_alloc()
973 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_rss_template_free() local
974 struct hinic_hwif *hwif = hwdev->hwif; in hinic_rss_template_free()
983 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_RSS_TEMP_MGR, in hinic_rss_template_free()
1000 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_vport_stats() local
1001 struct hinic_hwif *hwif = hwdev->hwif; in hinic_get_vport_stats()
1010 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_VPORT_STAT, in hinic_get_vport_stats()
1028 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_phy_port_stats() local
1029 struct hinic_hwif *hwif = hwdev->hwif; in hinic_get_phy_port_stats()
1042 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_PORT_STATISTICS, in hinic_get_phy_port_stats()
1063 struct hinic_hwdev *hwdev = nic_dev->hwdev; in hinic_get_mgmt_version() local
1070 if (!hwdev) in hinic_get_mgmt_version()
1073 hwif = hwdev->hwif; in hinic_get_mgmt_version()
1076 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_MGMT_VERSION, in hinic_get_mgmt_version()
1091 int hinic_get_link_mode(struct hinic_hwdev *hwdev, in hinic_get_link_mode() argument
1097 if (!hwdev || !link_mode) in hinic_get_link_mode()
1100 link_mode->func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_get_link_mode()
1103 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_LINK_MODE, in hinic_get_link_mode()
1107 dev_err(&hwdev->hwif->pdev->dev, in hinic_get_link_mode()
1116 int hinic_set_autoneg(struct hinic_hwdev *hwdev, bool enable) in hinic_set_autoneg() argument
1122 if (!hwdev) in hinic_set_autoneg()
1125 autoneg.func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_set_autoneg()
1128 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_AUTONEG, in hinic_set_autoneg()
1132 dev_err(&hwdev->hwif->pdev->dev, "Failed to %s autoneg, err: %d, status: 0x%x, out size: 0x%x\n", in hinic_set_autoneg()
1141 int hinic_set_speed(struct hinic_hwdev *hwdev, enum nic_speed_level speed) in hinic_set_speed() argument
1147 if (!hwdev) in hinic_set_speed()
1150 speed_info.func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_set_speed()
1153 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_SPEED, in hinic_set_speed()
1157 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_speed()
1166 int hinic_set_link_settings(struct hinic_hwdev *hwdev, in hinic_set_link_settings() argument
1172 err = hinic_hilink_msg_cmd(hwdev, HINIC_HILINK_CMD_SET_LINK_SETTINGS, in hinic_set_link_settings()
1176 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_link_settings()
1185 int hinic_get_hw_pause_info(struct hinic_hwdev *hwdev, in hinic_get_hw_pause_info() argument
1191 pause_info->func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_get_hw_pause_info()
1193 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_PAUSE_INFO, in hinic_get_hw_pause_info()
1197 …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()
1205 int hinic_set_hw_pause_info(struct hinic_hwdev *hwdev, in hinic_set_hw_pause_info() argument
1211 pause_info->func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_set_hw_pause_info()
1213 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_PAUSE_INFO, in hinic_set_hw_pause_info()
1217 …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()
1225 int hinic_dcb_set_pfc(struct hinic_hwdev *hwdev, u8 pfc_en, u8 pfc_bitmap) in hinic_dcb_set_pfc() argument
1227 struct hinic_nic_cfg *nic_cfg = &hwdev->func_to_io.nic_cfg; in hinic_dcb_set_pfc()
1232 if (HINIC_IS_VF(hwdev->hwif)) in hinic_dcb_set_pfc()
1237 pfc.func_id = HINIC_HWIF_FUNC_IDX(hwdev->hwif); in hinic_dcb_set_pfc()
1241 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_PFC, in hinic_dcb_set_pfc()
1244 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()
1260 int hinic_set_loopback_mode(struct hinic_hwdev *hwdev, u32 mode, u32 enable) in hinic_set_loopback_mode() argument
1270 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_loopback_mode()
1275 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_LOOPBACK_MODE, in hinic_set_loopback_mode()
1278 dev_err(&hwdev->hwif->pdev->dev, in hinic_set_loopback_mode()
1287 static int _set_led_status(struct hinic_hwdev *hwdev, u8 port, in _set_led_status() argument
1296 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in _set_led_status()
1309 …dev_err(&hwdev->hwif->pdev->dev, "Failed to set led status, err: %d, status: 0x%x, out size: 0x%x\… in _set_led_status()
1317 int hinic_set_led_status(struct hinic_hwdev *hwdev, u8 port, in hinic_set_led_status() argument
1320 if (!hwdev) in hinic_set_led_status()
1323 return _set_led_status(hwdev, port, type, mode, 0); in hinic_set_led_status()
1326 int hinic_reset_led_status(struct hinic_hwdev *hwdev, u8 port) in hinic_reset_led_status() argument
1330 if (!hwdev) in hinic_reset_led_status()
1333 err = _set_led_status(hwdev, port, HINIC_LED_TYPE_INVALID, in hinic_reset_led_status()
1336 dev_err(&hwdev->hwif->pdev->dev, in hinic_reset_led_status()
1342 static bool hinic_if_sfp_absent(struct hinic_hwdev *hwdev) in hinic_if_sfp_absent() argument
1346 u8 port_id = hwdev->port_id; in hinic_if_sfp_absent()
1350 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_SFP_ABS, in hinic_if_sfp_absent()
1354 dev_err(&hwdev->hwif->pdev->dev, in hinic_if_sfp_absent()
1363 int hinic_get_sfp_eeprom(struct hinic_hwdev *hwdev, u8 *data, u16 *len) in hinic_get_sfp_eeprom() argument
1370 if (!hwdev || !data || !len) in hinic_get_sfp_eeprom()
1373 port_id = hwdev->port_id; in hinic_get_sfp_eeprom()
1375 if (hinic_if_sfp_absent(hwdev)) in hinic_get_sfp_eeprom()
1379 err = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_GET_STD_SFP_INFO, in hinic_get_sfp_eeprom()
1383 dev_err(&hwdev->hwif->pdev->dev, in hinic_get_sfp_eeprom()
1395 int hinic_get_sfp_type(struct hinic_hwdev *hwdev, u8 *data0, u8 *data1) in hinic_get_sfp_type() argument
1401 if (hinic_if_sfp_absent(hwdev)) in hinic_get_sfp_type()
1404 err = hinic_get_sfp_eeprom(hwdev, sfp_data, &len); in hinic_get_sfp_type()