Lines Matching +refs:port +refs:id +refs:attrs
455 struct hccs_port_attr *attrs, u16 size) in hccs_get_all_port_attr() argument
467 buf = (u8 *)attrs; in hccs_get_all_port_attr()
504 struct hccs_port_attr *attrs; in hccs_get_all_port_info_on_die() local
505 struct hccs_port_info *port; in hccs_get_all_port_info_on_die() local
509 attrs = kcalloc(die->port_num, sizeof(struct hccs_port_attr), in hccs_get_all_port_info_on_die()
511 if (!attrs) in hccs_get_all_port_info_on_die()
514 ret = hccs_get_all_port_attr(hdev, die, attrs, die->port_num); in hccs_get_all_port_info_on_die()
519 port = &die->ports[i]; in hccs_get_all_port_info_on_die()
520 port->port_id = attrs[i].port_id; in hccs_get_all_port_info_on_die()
521 port->port_type = attrs[i].port_type; in hccs_get_all_port_info_on_die()
522 port->lane_mode = attrs[i].lane_mode; in hccs_get_all_port_info_on_die()
523 port->enable = attrs[i].enable; in hccs_get_all_port_info_on_die()
524 port->die = die; in hccs_get_all_port_info_on_die()
528 kfree(attrs); in hccs_get_all_port_info_on_die()
598 const struct hccs_port_info *port, in hccs_query_port_link_status() argument
601 const struct hccs_die_info *die = port->die; in hccs_query_port_link_status()
611 req_param->port_id = port->port_id; in hccs_query_port_link_status()
625 const struct hccs_port_info *port, in hccs_query_port_crc_err_cnt() argument
628 const struct hccs_die_info *die = port->die; in hccs_query_port_crc_err_cnt()
638 req_param->port_id = port->port_id; in hccs_query_port_crc_err_cnt()
755 const struct hccs_port_info *port = kobj_to_port_info(kobj); in type_show() local
757 return sysfs_emit(buf, "HCCS-v%u\n", port->port_type); in type_show()
764 const struct hccs_port_info *port = kobj_to_port_info(kobj); in lane_mode_show() local
766 return sysfs_emit(buf, "x%u\n", port->lane_mode); in lane_mode_show()
773 const struct hccs_port_info *port = kobj_to_port_info(kobj); in enable_show() local
775 return sysfs_emit(buf, "%u\n", port->enable); in enable_show()
782 const struct hccs_port_info *port = kobj_to_port_info(kobj); in cur_lane_num_show() local
783 struct hccs_dev *hdev = port->die->chip->hdev; in cur_lane_num_show()
788 ret = hccs_query_port_link_status(hdev, port, &link_status); in cur_lane_num_show()
800 const struct hccs_port_info *port = kobj_to_port_info(kobj); in link_fsm_show() local
801 struct hccs_dev *hdev = port->die->chip->hdev; in link_fsm_show()
817 ret = hccs_query_port_link_status(hdev, port, &link_status); in link_fsm_show()
836 const struct hccs_port_info *port = kobj_to_port_info(kobj); in lane_mask_show() local
837 struct hccs_dev *hdev = port->die->chip->hdev; in lane_mask_show()
842 ret = hccs_query_port_link_status(hdev, port, &link_status); in lane_mask_show()
854 const struct hccs_port_info *port = kobj_to_port_info(kobj); in crc_err_cnt_show() local
855 struct hccs_dev *hdev = port->die->chip->hdev; in crc_err_cnt_show()
860 ret = hccs_query_port_crc_err_cnt(hdev, port, &crc_err_cnt); in crc_err_cnt_show()
1063 struct hccs_port_info *port; in hccs_remove_die_dir() local
1067 port = &die->ports[i]; in hccs_remove_die_dir()
1068 if (port->dir_created) in hccs_remove_die_dir()
1069 kobject_put(&port->kobj); in hccs_remove_die_dir()
1099 struct hccs_port_info *port) in hccs_create_hccs_dir() argument
1103 ret = kobject_init_and_add(&port->kobj, &hccs_port_type, in hccs_create_hccs_dir()
1104 &die->kobj, "hccs%d", port->port_id); in hccs_create_hccs_dir()
1106 kobject_put(&port->kobj); in hccs_create_hccs_dir()
1117 struct hccs_port_info *port; in hccs_create_die_dir() local
1129 port = &die->ports[i]; in hccs_create_die_dir()
1130 ret = hccs_create_hccs_dir(hdev, die, port); in hccs_create_die_dir()
1133 port->port_id); in hccs_create_die_dir()
1136 port->dir_created = true; in hccs_create_die_dir()
1151 u16 id; in hccs_create_chip_dir() local
1160 for (id = 0; id < chip->die_num; id++) { in hccs_create_chip_dir()
1161 die = &chip->dies[id]; in hccs_create_chip_dir()
1178 u8 id, k; in hccs_create_topo_dirs() local
1181 for (id = 0; id < hdev->chip_num; id++) { in hccs_create_topo_dirs()
1182 chip = &hdev->chips[id]; in hccs_create_topo_dirs()
1185 dev_err(hdev->dev, "init chip%d dir failed!\n", id); in hccs_create_topo_dirs()
1192 for (k = 0; k < id; k++) in hccs_create_topo_dirs()