Lines Matching refs:attr
68 struct attribute attr; member
81 struct port_attribute attr; member
88 struct attribute attr; member
90 struct attribute *attr, char *buf);
92 struct attribute *attr,
100 struct attribute *attr, char *buf) in port_attr_show() argument
103 container_of(attr, struct port_attribute, attr); in port_attr_show()
113 struct attribute *attr, in port_attr_store() argument
117 container_of(attr, struct port_attribute, attr); in port_attr_store()
131 struct attribute *attr, char *buf) in gid_attr_show() argument
134 container_of(attr, struct port_attribute, attr); in gid_attr_show()
151 struct ib_port_attr attr; in state_show() local
163 ret = ib_query_port(p->ibdev, p->port_num, &attr); in state_show()
167 return sprintf(buf, "%d: %s\n", attr.state, in state_show()
168 attr.state >= 0 && attr.state < ARRAY_SIZE(state_name) ? in state_show()
169 state_name[attr.state] : "UNKNOWN"); in state_show()
175 struct ib_port_attr attr; in lid_show() local
178 ret = ib_query_port(p->ibdev, p->port_num, &attr); in lid_show()
182 return sprintf(buf, "0x%x\n", attr.lid); in lid_show()
189 struct ib_port_attr attr; in lid_mask_count_show() local
192 ret = ib_query_port(p->ibdev, p->port_num, &attr); in lid_mask_count_show()
196 return sprintf(buf, "%d\n", attr.lmc); in lid_mask_count_show()
202 struct ib_port_attr attr; in sm_lid_show() local
205 ret = ib_query_port(p->ibdev, p->port_num, &attr); in sm_lid_show()
209 return sprintf(buf, "0x%x\n", attr.sm_lid); in sm_lid_show()
215 struct ib_port_attr attr; in sm_sl_show() local
218 ret = ib_query_port(p->ibdev, p->port_num, &attr); in sm_sl_show()
222 return sprintf(buf, "%d\n", attr.sm_sl); in sm_sl_show()
228 struct ib_port_attr attr; in cap_mask_show() local
231 ret = ib_query_port(p->ibdev, p->port_num, &attr); in cap_mask_show()
235 return sprintf(buf, "0x%08x\n", attr.port_cap_flags); in cap_mask_show()
241 struct ib_port_attr attr; in rate_show() local
246 ret = ib_query_port(p->ibdev, p->port_num, &attr); in rate_show()
250 switch (attr.active_speed) { in rate_show()
282 rate *= ib_width_enum_to_int(attr.active_width); in rate_show()
288 ib_width_enum_to_int(attr.active_width), speed); in rate_show()
294 struct ib_port_attr attr; in phys_state_show() local
298 ret = ib_query_port(p->ibdev, p->port_num, &attr); in phys_state_show()
302 switch (attr.phys_state) { in phys_state_show()
310 default: return sprintf(buf, "%d: <unknown>\n", attr.phys_state); in phys_state_show()
338 &port_attr_state.attr,
339 &port_attr_lid.attr,
340 &port_attr_lid_mask_count.attr,
341 &port_attr_sm_lid.attr,
342 &port_attr_sm_sl.attr,
343 &port_attr_cap_mask.attr,
344 &port_attr_rate.attr,
345 &port_attr_phys_state.attr,
346 &port_attr_link_layer.attr,
364 struct ib_port *p, struct port_attribute *attr, char *buf, in _show_port_gid_attr() argument
368 container_of(attr, struct port_table_attribute, attr); in _show_port_gid_attr()
381 static ssize_t show_port_gid(struct ib_port *p, struct port_attribute *attr, in show_port_gid() argument
385 container_of(attr, struct port_table_attribute, attr); in show_port_gid()
411 struct port_attribute *attr, char *buf) in show_port_gid_attr_ndev() argument
413 return _show_port_gid_attr(p, attr, buf, print_ndev); in show_port_gid_attr_ndev()
417 struct port_attribute *attr, in show_port_gid_attr_gid_type() argument
420 return _show_port_gid_attr(p, attr, buf, print_gid_type); in show_port_gid_attr_gid_type()
423 static ssize_t show_port_pkey(struct ib_port *p, struct port_attribute *attr, in show_port_pkey() argument
427 container_of(attr, struct port_table_attribute, attr); in show_port_pkey()
440 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
447 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
456 static int get_perf_mad(struct ib_device *dev, int port_num, __be16 attr, in get_perf_mad() argument
479 in_mad->mad_hdr.attr_id = attr; in get_perf_mad()
481 if (attr != IB_PMA_CLASS_PORT_INFO) in get_perf_mad()
502 static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr, in show_pma_counter() argument
506 container_of(attr, struct port_table_attribute, attr); in show_pma_counter()
576 &port_pma_attr_symbol_error.attr.attr,
577 &port_pma_attr_link_error_recovery.attr.attr,
578 &port_pma_attr_link_downed.attr.attr,
579 &port_pma_attr_port_rcv_errors.attr.attr,
580 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
581 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
582 &port_pma_attr_port_xmit_discards.attr.attr,
583 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
584 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
585 &port_pma_attr_local_link_integrity_errors.attr.attr,
586 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
587 &port_pma_attr_VL15_dropped.attr.attr,
588 &port_pma_attr_port_xmit_data.attr.attr,
589 &port_pma_attr_port_rcv_data.attr.attr,
590 &port_pma_attr_port_xmit_packets.attr.attr,
591 &port_pma_attr_port_rcv_packets.attr.attr,
592 &port_pma_attr_port_xmit_wait.attr.attr,
597 &port_pma_attr_symbol_error.attr.attr,
598 &port_pma_attr_link_error_recovery.attr.attr,
599 &port_pma_attr_link_downed.attr.attr,
600 &port_pma_attr_port_rcv_errors.attr.attr,
601 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
602 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
603 &port_pma_attr_port_xmit_discards.attr.attr,
604 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
605 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
606 &port_pma_attr_local_link_integrity_errors.attr.attr,
607 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
608 &port_pma_attr_VL15_dropped.attr.attr,
609 &port_pma_attr_ext_port_xmit_data.attr.attr,
610 &port_pma_attr_ext_port_rcv_data.attr.attr,
611 &port_pma_attr_ext_port_xmit_packets.attr.attr,
612 &port_pma_attr_port_xmit_wait.attr.attr,
613 &port_pma_attr_ext_port_rcv_packets.attr.attr,
614 &port_pma_attr_ext_unicast_rcv_packets.attr.attr,
615 &port_pma_attr_ext_unicast_xmit_packets.attr.attr,
616 &port_pma_attr_ext_multicast_rcv_packets.attr.attr,
617 &port_pma_attr_ext_multicast_xmit_packets.attr.attr,
622 &port_pma_attr_symbol_error.attr.attr,
623 &port_pma_attr_link_error_recovery.attr.attr,
624 &port_pma_attr_link_downed.attr.attr,
625 &port_pma_attr_port_rcv_errors.attr.attr,
626 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
627 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
628 &port_pma_attr_port_xmit_discards.attr.attr,
629 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
630 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
631 &port_pma_attr_local_link_integrity_errors.attr.attr,
632 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
633 &port_pma_attr_VL15_dropped.attr.attr,
634 &port_pma_attr_ext_port_xmit_data.attr.attr,
635 &port_pma_attr_ext_port_rcv_data.attr.attr,
636 &port_pma_attr_ext_port_xmit_packets.attr.attr,
637 &port_pma_attr_ext_port_rcv_packets.attr.attr,
638 &port_pma_attr_port_xmit_wait.attr.attr,
740 element->attr.attr.name = element->name; in alloc_group_attrs()
741 element->attr.attr.mode = S_IRUGO; in alloc_group_attrs()
742 element->attr.show = show; in alloc_group_attrs()
744 sysfs_attr_init(&element->attr.attr); in alloc_group_attrs()
746 tab_attr[i] = &element->attr.attr; in alloc_group_attrs()
803 static ssize_t show_hw_stats(struct kobject *kobj, struct attribute *attr, in show_hw_stats() argument
812 hsa = container_of(attr, struct hw_stats_attribute, attr); in show_hw_stats()
834 struct attribute *attr, in show_stats_lifespan() argument
841 hsa = container_of(attr, struct hw_stats_attribute, attr); in show_stats_lifespan()
861 struct attribute *attr, in set_stats_lifespan() argument
876 hsa = container_of(attr, struct hw_stats_attribute, attr); in set_stats_lifespan()
897 struct attribute **attr; in free_hsag() local
901 for (attr = attr_group->attrs; *attr; attr++) in free_hsag()
902 kfree(*attr); in free_hsag()
914 hsa->attr.name = (char *)name; in alloc_hsa()
915 hsa->attr.mode = S_IRUGO; in alloc_hsa()
921 return &hsa->attr; in alloc_hsa()
932 hsa->attr.name = name; in alloc_hsa_lifespan()
933 hsa->attr.mode = S_IWUSR | S_IRUGO; in alloc_hsa_lifespan()
939 return &hsa->attr; in alloc_hsa_lifespan()
1023 struct ib_port_attr attr; in add_port() local
1027 ret = ib_query_port(device, port_num, &attr); in add_port()
1066 p->gid_group.attrs = alloc_group_attrs(show_port_gid, attr.gid_tbl_len); in add_port()
1078 attr.gid_tbl_len); in add_port()
1091 attr.gid_tbl_len); in add_port()
1104 attr.pkey_tbl_len); in add_port()
1137 for (i = 0; i < attr.pkey_tbl_len; ++i) in add_port()
1148 for (i = 0; i < attr.gid_tbl_len; ++i) in add_port()
1159 for (i = 0; i < attr.gid_tbl_len; ++i) in add_port()
1169 for (i = 0; i < attr.gid_tbl_len; ++i) in add_port()
1187 struct device_attribute *attr, char *buf) in show_node_type() argument
1215 struct device_attribute *attr, char *buf) in show_node_guid() argument
1227 struct device_attribute *attr, char *buf) in show_node_desc() argument
1235 struct device_attribute *attr, in set_node_desc() argument
1253 static ssize_t show_fw_ver(struct device *device, struct device_attribute *attr, in show_fw_ver() argument