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()
352 rate *= ib_width_enum_to_int(attr.active_width); in rate_show()
358 ib_width_enum_to_int(attr.active_width), speed); in rate_show()
382 struct ib_port_attr attr; in phys_state_show() local
386 ret = ib_query_port(ibdev, port_num, &attr); in phys_state_show()
390 return sysfs_emit(buf, "%u: %s\n", attr.phys_state, in phys_state_show()
391 phys_state_to_str(attr.phys_state)); in phys_state_show()
425 &ib_port_attr_state.attr,
426 &ib_port_attr_lid.attr,
427 &ib_port_attr_lid_mask_count.attr,
428 &ib_port_attr_sm_lid.attr,
429 &ib_port_attr_sm_sl.attr,
430 &ib_port_attr_cap_mask.attr,
431 &ib_port_attr_rate.attr,
432 &ib_port_attr_phys_state.attr,
433 &ib_port_attr_link_layer.attr,
457 struct ib_device *ibdev, u32 port_num, struct ib_port_attribute *attr, in _show_port_gid_attr() argument
462 container_of(attr, struct port_table_attribute, attr); in _show_port_gid_attr()
477 struct ib_port_attribute *attr, char *buf) in show_port_gid() argument
480 container_of(attr, struct port_table_attribute, attr); in show_port_gid()
506 struct ib_port_attribute *attr, in show_port_gid_attr_ndev() argument
509 return _show_port_gid_attr(ibdev, port_num, attr, buf, print_ndev); in show_port_gid_attr_ndev()
514 struct ib_port_attribute *attr, in show_port_gid_attr_gid_type() argument
517 return _show_port_gid_attr(ibdev, port_num, attr, buf, print_gid_type); in show_port_gid_attr_gid_type()
521 struct ib_port_attribute *attr, char *buf) in show_port_pkey() argument
524 container_of(attr, struct port_table_attribute, attr); in show_port_pkey()
537 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
544 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
553 static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr, in get_perf_mad() argument
576 in_mad->mad_hdr.attr_id = attr; in get_perf_mad()
578 if (attr != IB_PMA_CLASS_PORT_INFO) in get_perf_mad()
598 struct ib_port_attribute *attr, char *buf) in show_pma_counter() argument
601 container_of(attr, struct port_table_attribute, attr); in show_pma_counter()
669 &port_pma_attr_symbol_error.attr.attr,
670 &port_pma_attr_link_error_recovery.attr.attr,
671 &port_pma_attr_link_downed.attr.attr,
672 &port_pma_attr_port_rcv_errors.attr.attr,
673 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
674 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
675 &port_pma_attr_port_xmit_discards.attr.attr,
676 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
677 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
678 &port_pma_attr_local_link_integrity_errors.attr.attr,
679 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
680 &port_pma_attr_VL15_dropped.attr.attr,
681 &port_pma_attr_port_xmit_data.attr.attr,
682 &port_pma_attr_port_rcv_data.attr.attr,
683 &port_pma_attr_port_xmit_packets.attr.attr,
684 &port_pma_attr_port_rcv_packets.attr.attr,
685 &port_pma_attr_port_xmit_wait.attr.attr,
690 &port_pma_attr_symbol_error.attr.attr,
691 &port_pma_attr_link_error_recovery.attr.attr,
692 &port_pma_attr_link_downed.attr.attr,
693 &port_pma_attr_port_rcv_errors.attr.attr,
694 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
695 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
696 &port_pma_attr_port_xmit_discards.attr.attr,
697 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
698 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
699 &port_pma_attr_local_link_integrity_errors.attr.attr,
700 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
701 &port_pma_attr_VL15_dropped.attr.attr,
702 &port_pma_attr_ext_port_xmit_data.attr.attr,
703 &port_pma_attr_ext_port_rcv_data.attr.attr,
704 &port_pma_attr_ext_port_xmit_packets.attr.attr,
705 &port_pma_attr_port_xmit_wait.attr.attr,
706 &port_pma_attr_ext_port_rcv_packets.attr.attr,
707 &port_pma_attr_ext_unicast_rcv_packets.attr.attr,
708 &port_pma_attr_ext_unicast_xmit_packets.attr.attr,
709 &port_pma_attr_ext_multicast_rcv_packets.attr.attr,
710 &port_pma_attr_ext_multicast_xmit_packets.attr.attr,
715 &port_pma_attr_symbol_error.attr.attr,
716 &port_pma_attr_link_error_recovery.attr.attr,
717 &port_pma_attr_link_downed.attr.attr,
718 &port_pma_attr_port_rcv_errors.attr.attr,
719 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
720 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
721 &port_pma_attr_port_xmit_discards.attr.attr,
722 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
723 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
724 &port_pma_attr_local_link_integrity_errors.attr.attr,
725 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
726 &port_pma_attr_VL15_dropped.attr.attr,
727 &port_pma_attr_ext_port_xmit_data.attr.attr,
728 &port_pma_attr_ext_port_rcv_data.attr.attr,
729 &port_pma_attr_ext_port_xmit_packets.attr.attr,
730 &port_pma_attr_ext_port_rcv_packets.attr.attr,
731 &port_pma_attr_port_xmit_wait.attr.attr,
935 struct hw_stats_device_attribute *attr; in ib_setup_device_attrs() local
958 attr = &data->attrs[i]; in ib_setup_device_attrs()
959 sysfs_attr_init(&attr->attr.attr); in ib_setup_device_attrs()
960 attr->attr.attr.name = data->stats->names[i]; in ib_setup_device_attrs()
961 attr->attr.attr.mode = 0444; in ib_setup_device_attrs()
962 attr->attr.show = hw_stat_device_show; in ib_setup_device_attrs()
963 attr->show = show_hw_stats; in ib_setup_device_attrs()
964 data->group.attrs[i] = &attr->attr.attr; in ib_setup_device_attrs()
967 attr = &data->attrs[i]; in ib_setup_device_attrs()
968 sysfs_attr_init(&attr->attr.attr); in ib_setup_device_attrs()
969 attr->attr.attr.name = "lifespan"; in ib_setup_device_attrs()
970 attr->attr.attr.mode = 0644; in ib_setup_device_attrs()
971 attr->attr.show = hw_stat_device_show; in ib_setup_device_attrs()
972 attr->show = show_stats_lifespan; in ib_setup_device_attrs()
973 attr->attr.store = hw_stat_device_store; in ib_setup_device_attrs()
974 attr->store = set_stats_lifespan; in ib_setup_device_attrs()
975 data->group.attrs[i] = &attr->attr.attr; in ib_setup_device_attrs()
1028 struct hw_stats_port_attribute *attr; in setup_hw_port_stats() local
1048 attr = &data->attrs[i]; in setup_hw_port_stats()
1049 sysfs_attr_init(&attr->attr.attr); in setup_hw_port_stats()
1050 attr->attr.attr.name = data->stats->names[i]; in setup_hw_port_stats()
1051 attr->attr.attr.mode = 0444; in setup_hw_port_stats()
1052 attr->attr.show = hw_stat_port_show; in setup_hw_port_stats()
1053 attr->show = show_hw_stats; in setup_hw_port_stats()
1054 group->attrs[i] = &attr->attr.attr; in setup_hw_port_stats()
1057 attr = &data->attrs[i]; in setup_hw_port_stats()
1058 sysfs_attr_init(&attr->attr.attr); in setup_hw_port_stats()
1059 attr->attr.attr.name = "lifespan"; in setup_hw_port_stats()
1060 attr->attr.attr.mode = 0644; in setup_hw_port_stats()
1061 attr->attr.show = hw_stat_port_show; in setup_hw_port_stats()
1062 attr->show = show_stats_lifespan; in setup_hw_port_stats()
1063 attr->attr.store = hw_stat_port_store; in setup_hw_port_stats()
1064 attr->store = set_stats_lifespan; in setup_hw_port_stats()
1065 group->attrs[i] = &attr->attr.attr; in setup_hw_port_stats()
1100 sysfs_attr_init(&element->attr.attr); in alloc_port_table_group()
1101 element->attr.attr.name = element->name; in alloc_port_table_group()
1102 element->attr.attr.mode = 0444; in alloc_port_table_group()
1103 element->attr.show = show; in alloc_port_table_group()
1106 attr_list[i] = &element->attr.attr; in alloc_port_table_group()
1122 const struct ib_port_attr *attr) in setup_gid_attrs() argument
1128 size_mul(attr->gid_tbl_len, 2)), in setup_gid_attrs()
1137 attr->gid_tbl_len, in setup_gid_attrs()
1145 gid_attr_group->attrs_list + attr->gid_tbl_len, in setup_gid_attrs()
1146 attr->gid_tbl_len, show_port_gid_attr_gid_type); in setup_gid_attrs()
1184 const struct ib_port_attr *attr) in setup_port() argument
1193 size_add(attr->gid_tbl_len, attr->pkey_tbl_len)), in setup_port()
1206 attr->gid_tbl_len, show_port_gid); in setup_port()
1211 if (attr->pkey_tbl_len) { in setup_port()
1213 p->attrs_list + attr->gid_tbl_len, in setup_port()
1214 attr->pkey_tbl_len, show_port_pkey); in setup_port()
1302 struct device_attribute *attr, char *buf) in node_type_show() argument
1326 struct device_attribute *attr, char *buf) in node_guid_show() argument
1340 struct device_attribute *attr, char *buf) in node_desc_show() argument
1348 struct device_attribute *attr, in node_desc_store() argument
1367 static ssize_t fw_ver_show(struct device *device, struct device_attribute *attr, in fw_ver_show() argument
1380 &dev_attr_node_type.attr,
1381 &dev_attr_node_guid.attr,
1382 &dev_attr_sys_image_guid.attr,
1383 &dev_attr_fw_ver.attr,
1384 &dev_attr_node_desc.attr,
1418 struct ib_port_attr attr; in ib_setup_port_attrs() local
1421 ret = ib_query_port(device, port_num, &attr); in ib_setup_port_attrs()
1425 port = setup_port(coredev, port_num, &attr); in ib_setup_port_attrs()
1431 ret = setup_gid_attrs(port, &attr); in ib_setup_port_attrs()