Lines Matching refs:attr

50 	struct ib_port_attribute attr;  member
77 struct device_attribute attr; member
86 struct ib_port_attribute attr; member
106 struct attribute *attr, char *buf) in port_attr_show() argument
109 container_of(attr, struct ib_port_attribute, attr); in port_attr_show()
119 struct attribute *attr, in port_attr_store() argument
123 container_of(attr, struct ib_port_attribute, attr); in port_attr_store()
147 struct device_attribute *attr, char *buf) in hw_stat_device_show() argument
150 container_of(attr, struct hw_stats_device_attribute, attr); in hw_stat_device_show()
158 struct device_attribute *attr, in hw_stat_device_store() argument
162 container_of(attr, struct hw_stats_device_attribute, attr); in hw_stat_device_store()
171 struct ib_port_attribute *attr, char *buf) in hw_stat_port_show() argument
174 container_of(attr, struct hw_stats_port_attribute, attr); in hw_stat_port_show()
183 struct ib_port_attribute *attr, in hw_stat_port_store() argument
187 container_of(attr, struct hw_stats_port_attribute, attr); in hw_stat_port_store()
196 struct attribute *attr, char *buf) in gid_attr_show() argument
199 container_of(attr, struct ib_port_attribute, attr); in gid_attr_show()
216 struct ib_port_attr attr; in state_show() local
228 ret = ib_query_port(ibdev, port_num, &attr); in state_show()
232 return sysfs_emit(buf, "%d: %s\n", attr.state, in state_show()
233 attr.state >= 0 && in state_show()
234 attr.state < ARRAY_SIZE(state_name) ? in state_show()
235 state_name[attr.state] : in state_show()
242 struct ib_port_attr attr; in lid_show() local
245 ret = ib_query_port(ibdev, port_num, &attr); in lid_show()
249 return sysfs_emit(buf, "0x%x\n", attr.lid); in lid_show()
255 struct ib_port_attr attr; in lid_mask_count_show() local
258 ret = ib_query_port(ibdev, port_num, &attr); in lid_mask_count_show()
262 return sysfs_emit(buf, "%u\n", attr.lmc); in lid_mask_count_show()
268 struct ib_port_attr attr; in sm_lid_show() local
271 ret = ib_query_port(ibdev, port_num, &attr); in sm_lid_show()
275 return sysfs_emit(buf, "0x%x\n", attr.sm_lid); in sm_lid_show()
281 struct ib_port_attr attr; in sm_sl_show() local
284 ret = ib_query_port(ibdev, port_num, &attr); in sm_sl_show()
288 return sysfs_emit(buf, "%u\n", attr.sm_sl); in sm_sl_show()
294 struct ib_port_attr attr; in cap_mask_show() local
297 ret = ib_query_port(ibdev, port_num, &attr); in cap_mask_show()
301 return sysfs_emit(buf, "0x%08x\n", attr.port_cap_flags); in cap_mask_show()
307 struct ib_port_attr attr; in rate_show() local
312 ret = ib_query_port(ibdev, port_num, &attr); in rate_show()
316 switch (attr.active_speed) { in rate_show()
356 rate *= ib_width_enum_to_int(attr.active_width); in rate_show()
362 ib_width_enum_to_int(attr.active_width), speed); in rate_show()
386 struct ib_port_attr attr; in phys_state_show() local
390 ret = ib_query_port(ibdev, port_num, &attr); in phys_state_show()
394 return sysfs_emit(buf, "%u: %s\n", attr.phys_state, in phys_state_show()
395 phys_state_to_str(attr.phys_state)); in phys_state_show()
429 &ib_port_attr_state.attr,
430 &ib_port_attr_lid.attr,
431 &ib_port_attr_lid_mask_count.attr,
432 &ib_port_attr_sm_lid.attr,
433 &ib_port_attr_sm_sl.attr,
434 &ib_port_attr_cap_mask.attr,
435 &ib_port_attr_rate.attr,
436 &ib_port_attr_phys_state.attr,
437 &ib_port_attr_link_layer.attr,
462 struct ib_device *ibdev, u32 port_num, struct ib_port_attribute *attr, in _show_port_gid_attr() argument
467 container_of(attr, struct port_table_attribute, attr); in _show_port_gid_attr()
482 struct ib_port_attribute *attr, char *buf) in show_port_gid() argument
485 container_of(attr, struct port_table_attribute, attr); in show_port_gid()
511 struct ib_port_attribute *attr, in show_port_gid_attr_ndev() argument
514 return _show_port_gid_attr(ibdev, port_num, attr, buf, print_ndev); in show_port_gid_attr_ndev()
519 struct ib_port_attribute *attr, in show_port_gid_attr_gid_type() argument
522 return _show_port_gid_attr(ibdev, port_num, attr, buf, print_gid_type); in show_port_gid_attr_gid_type()
526 struct ib_port_attribute *attr, char *buf) in show_port_pkey() argument
529 container_of(attr, struct port_table_attribute, attr); in show_port_pkey()
542 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
549 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
558 static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr, in get_perf_mad() argument
581 in_mad->mad_hdr.attr_id = attr; in get_perf_mad()
583 if (attr != IB_PMA_CLASS_PORT_INFO) in get_perf_mad()
603 struct ib_port_attribute *attr, char *buf) in show_pma_counter() argument
606 container_of(attr, struct port_table_attribute, attr); in show_pma_counter()
674 &port_pma_attr_symbol_error.attr.attr,
675 &port_pma_attr_link_error_recovery.attr.attr,
676 &port_pma_attr_link_downed.attr.attr,
677 &port_pma_attr_port_rcv_errors.attr.attr,
678 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
679 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
680 &port_pma_attr_port_xmit_discards.attr.attr,
681 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
682 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
683 &port_pma_attr_local_link_integrity_errors.attr.attr,
684 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
685 &port_pma_attr_VL15_dropped.attr.attr,
686 &port_pma_attr_port_xmit_data.attr.attr,
687 &port_pma_attr_port_rcv_data.attr.attr,
688 &port_pma_attr_port_xmit_packets.attr.attr,
689 &port_pma_attr_port_rcv_packets.attr.attr,
690 &port_pma_attr_port_xmit_wait.attr.attr,
695 &port_pma_attr_symbol_error.attr.attr,
696 &port_pma_attr_link_error_recovery.attr.attr,
697 &port_pma_attr_link_downed.attr.attr,
698 &port_pma_attr_port_rcv_errors.attr.attr,
699 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
700 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
701 &port_pma_attr_port_xmit_discards.attr.attr,
702 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
703 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
704 &port_pma_attr_local_link_integrity_errors.attr.attr,
705 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
706 &port_pma_attr_VL15_dropped.attr.attr,
707 &port_pma_attr_ext_port_xmit_data.attr.attr,
708 &port_pma_attr_ext_port_rcv_data.attr.attr,
709 &port_pma_attr_ext_port_xmit_packets.attr.attr,
710 &port_pma_attr_port_xmit_wait.attr.attr,
711 &port_pma_attr_ext_port_rcv_packets.attr.attr,
712 &port_pma_attr_ext_unicast_rcv_packets.attr.attr,
713 &port_pma_attr_ext_unicast_xmit_packets.attr.attr,
714 &port_pma_attr_ext_multicast_rcv_packets.attr.attr,
715 &port_pma_attr_ext_multicast_xmit_packets.attr.attr,
720 &port_pma_attr_symbol_error.attr.attr,
721 &port_pma_attr_link_error_recovery.attr.attr,
722 &port_pma_attr_link_downed.attr.attr,
723 &port_pma_attr_port_rcv_errors.attr.attr,
724 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
725 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
726 &port_pma_attr_port_xmit_discards.attr.attr,
727 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
728 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
729 &port_pma_attr_local_link_integrity_errors.attr.attr,
730 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
731 &port_pma_attr_VL15_dropped.attr.attr,
732 &port_pma_attr_ext_port_xmit_data.attr.attr,
733 &port_pma_attr_ext_port_rcv_data.attr.attr,
734 &port_pma_attr_ext_port_xmit_packets.attr.attr,
735 &port_pma_attr_ext_port_rcv_packets.attr.attr,
736 &port_pma_attr_port_xmit_wait.attr.attr,
939 struct hw_stats_device_attribute *attr; in ib_setup_device_attrs() local
969 attr = &data->attrs[pos]; in ib_setup_device_attrs()
970 sysfs_attr_init(&attr->attr.attr); in ib_setup_device_attrs()
971 attr->attr.attr.name = data->stats->descs[i].name; in ib_setup_device_attrs()
972 attr->attr.attr.mode = 0444; in ib_setup_device_attrs()
973 attr->attr.show = hw_stat_device_show; in ib_setup_device_attrs()
974 attr->show = show_hw_stats; in ib_setup_device_attrs()
975 data->group.attrs[pos] = &attr->attr.attr; in ib_setup_device_attrs()
979 attr = &data->attrs[pos]; in ib_setup_device_attrs()
980 sysfs_attr_init(&attr->attr.attr); in ib_setup_device_attrs()
981 attr->attr.attr.name = "lifespan"; in ib_setup_device_attrs()
982 attr->attr.attr.mode = 0644; in ib_setup_device_attrs()
983 attr->attr.show = hw_stat_device_show; in ib_setup_device_attrs()
984 attr->show = show_stats_lifespan; in ib_setup_device_attrs()
985 attr->attr.store = hw_stat_device_store; in ib_setup_device_attrs()
986 attr->store = set_stats_lifespan; in ib_setup_device_attrs()
987 data->group.attrs[pos] = &attr->attr.attr; in ib_setup_device_attrs()
1039 struct hw_stats_port_attribute *attr; in setup_hw_port_stats() local
1066 attr = &data->attrs[pos]; in setup_hw_port_stats()
1067 sysfs_attr_init(&attr->attr.attr); in setup_hw_port_stats()
1068 attr->attr.attr.name = data->stats->descs[i].name; in setup_hw_port_stats()
1069 attr->attr.attr.mode = 0444; in setup_hw_port_stats()
1070 attr->attr.show = hw_stat_port_show; in setup_hw_port_stats()
1071 attr->show = show_hw_stats; in setup_hw_port_stats()
1072 group->attrs[pos] = &attr->attr.attr; in setup_hw_port_stats()
1076 attr = &data->attrs[pos]; in setup_hw_port_stats()
1077 sysfs_attr_init(&attr->attr.attr); in setup_hw_port_stats()
1078 attr->attr.attr.name = "lifespan"; in setup_hw_port_stats()
1079 attr->attr.attr.mode = 0644; in setup_hw_port_stats()
1080 attr->attr.show = hw_stat_port_show; in setup_hw_port_stats()
1081 attr->show = show_stats_lifespan; in setup_hw_port_stats()
1082 attr->attr.store = hw_stat_port_store; in setup_hw_port_stats()
1083 attr->store = set_stats_lifespan; in setup_hw_port_stats()
1084 group->attrs[pos] = &attr->attr.attr; in setup_hw_port_stats()
1119 sysfs_attr_init(&element->attr.attr); in alloc_port_table_group()
1120 element->attr.attr.name = element->name; in alloc_port_table_group()
1121 element->attr.attr.mode = 0444; in alloc_port_table_group()
1122 element->attr.show = show; in alloc_port_table_group()
1125 attr_list[i] = &element->attr.attr; in alloc_port_table_group()
1141 const struct ib_port_attr *attr) in setup_gid_attrs() argument
1147 size_mul(attr->gid_tbl_len, 2)), in setup_gid_attrs()
1156 attr->gid_tbl_len, in setup_gid_attrs()
1164 gid_attr_group->attrs_list + attr->gid_tbl_len, in setup_gid_attrs()
1165 attr->gid_tbl_len, show_port_gid_attr_gid_type); in setup_gid_attrs()
1203 const struct ib_port_attr *attr) in setup_port() argument
1212 size_add(attr->gid_tbl_len, attr->pkey_tbl_len)), in setup_port()
1225 attr->gid_tbl_len, show_port_gid); in setup_port()
1230 if (attr->pkey_tbl_len) { in setup_port()
1232 p->attrs_list + attr->gid_tbl_len, in setup_port()
1233 attr->pkey_tbl_len, show_port_pkey); in setup_port()
1321 struct device_attribute *attr, char *buf) in node_type_show() argument
1345 struct device_attribute *attr, char *buf) in node_guid_show() argument
1359 struct device_attribute *attr, char *buf) in node_desc_show() argument
1367 struct device_attribute *attr, in node_desc_store() argument
1386 static ssize_t fw_ver_show(struct device *device, struct device_attribute *attr, in fw_ver_show() argument
1399 &dev_attr_node_type.attr,
1400 &dev_attr_node_guid.attr,
1401 &dev_attr_sys_image_guid.attr,
1402 &dev_attr_fw_ver.attr,
1403 &dev_attr_node_desc.attr,
1437 struct ib_port_attr attr; in ib_setup_port_attrs() local
1440 ret = ib_query_port(device, port_num, &attr); in ib_setup_port_attrs()
1444 port = setup_port(coredev, port_num, &attr); in ib_setup_port_attrs()
1450 ret = setup_gid_attrs(port, &attr); in ib_setup_port_attrs()