Lines Matching refs:attr
51 struct attribute attr;
64 struct port_attribute attr;
70 struct attribute *attr, char *buf)
73 container_of(attr, struct port_attribute, attr);
89 struct ib_port_attr attr;
101 ret = ib_query_port(p->ibdev, p->port_num, &attr);
105 return sprintf(buf, "%d: %s\n", attr.state,
106 attr.state >= 0 && attr.state < ARRAY_SIZE(state_name) ?
107 state_name[attr.state] : "UNKNOWN");
113 struct ib_port_attr attr;
116 ret = ib_query_port(p->ibdev, p->port_num, &attr);
120 return sprintf(buf, "0x%x\n", attr.lid);
127 struct ib_port_attr attr;
130 ret = ib_query_port(p->ibdev, p->port_num, &attr);
134 return sprintf(buf, "%d\n", attr.lmc);
140 struct ib_port_attr attr;
143 ret = ib_query_port(p->ibdev, p->port_num, &attr);
147 return sprintf(buf, "0x%x\n", attr.sm_lid);
153 struct ib_port_attr attr;
156 ret = ib_query_port(p->ibdev, p->port_num, &attr);
160 return sprintf(buf, "%d\n", attr.sm_sl);
166 struct ib_port_attr attr;
169 ret = ib_query_port(p->ibdev, p->port_num, &attr);
173 return sprintf(buf, "0x%08x\n", attr.port_cap_flags);
179 struct ib_port_attr attr;
184 ret = ib_query_port(p->ibdev, p->port_num, &attr);
188 switch (attr.active_speed) {
193 rate = 25 * ib_width_enum_to_int(attr.active_width) * attr.active_speed;
199 ib_width_enum_to_int(attr.active_width), speed);
205 struct ib_port_attr attr;
209 ret = ib_query_port(p->ibdev, p->port_num, &attr);
213 switch (attr.phys_state) {
221 default: return sprintf(buf, "%d: <unknown>\n", attr.phys_state);
235 &port_attr_state.attr,
236 &port_attr_lid.attr,
237 &port_attr_lid_mask_count.attr,
238 &port_attr_sm_lid.attr,
239 &port_attr_sm_sl.attr,
240 &port_attr_cap_mask.attr,
241 &port_attr_rate.attr,
242 &port_attr_phys_state.attr,
246 static ssize_t show_port_gid(struct ib_port *p, struct port_attribute *attr,
250 container_of(attr, struct port_table_attribute, attr);
261 static ssize_t show_port_pkey(struct ib_port *p, struct port_attribute *attr,
265 container_of(attr, struct port_table_attribute, attr);
278 .attr = __ATTR(_name, S_IRUGO, show_pma_counter, NULL), \
282 static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr,
286 container_of(attr, struct port_table_attribute, attr);
364 &port_pma_attr_symbol_error.attr.attr,
365 &port_pma_attr_link_error_recovery.attr.attr,
366 &port_pma_attr_link_downed.attr.attr,
367 &port_pma_attr_port_rcv_errors.attr.attr,
368 &port_pma_attr_port_rcv_remote_physical_errors.attr.attr,
369 &port_pma_attr_port_rcv_switch_relay_errors.attr.attr,
370 &port_pma_attr_port_xmit_discards.attr.attr,
371 &port_pma_attr_port_xmit_constraint_errors.attr.attr,
372 &port_pma_attr_port_rcv_constraint_errors.attr.attr,
373 &port_pma_attr_local_link_integrity_errors.attr.attr,
374 &port_pma_attr_excessive_buffer_overrun_errors.attr.attr,
375 &port_pma_attr_VL15_dropped.attr.attr,
376 &port_pma_attr_port_xmit_data.attr.attr,
377 &port_pma_attr_port_rcv_data.attr.attr,
378 &port_pma_attr_port_xmit_packets.attr.attr,
379 &port_pma_attr_port_rcv_packets.attr.attr,
460 element->attr.attr.name = element->name;
461 element->attr.attr.mode = S_IRUGO;
462 element->attr.show = show;
464 sysfs_attr_init(&element->attr.attr);
466 tab_attr[i] = &element->attr.attr;
483 struct ib_port_attr attr;
487 ret = ib_query_port(device, port_num, &attr);
509 p->gid_group.attrs = alloc_group_attrs(show_port_gid, attr.gid_tbl_len);
519 attr.pkey_tbl_len);
542 for (i = 0; i < attr.pkey_tbl_len; ++i)
551 for (i = 0; i < attr.gid_tbl_len; ++i)
566 struct device_attribute *attr, char *buf)
583 struct ib_device_attr attr;
586 ret = ib_query_device(dev, &attr);
591 be16_to_cpu(((__be16 *) &attr.sys_image_guid)[0]),
592 be16_to_cpu(((__be16 *) &attr.sys_image_guid)[1]),
593 be16_to_cpu(((__be16 *) &attr.sys_image_guid)[2]),
594 be16_to_cpu(((__be16 *) &attr.sys_image_guid)[3]));
598 struct device_attribute *attr, char *buf)
610 struct device_attribute *attr, char *buf)
618 struct device_attribute *attr,
656 struct device_attribute *attr, char *buf,
674 struct device_attribute *attr, char *buf) \
676 return show_protocol_stat(device, attr, buf, \
722 &dev_attr_ipInReceives.attr,
723 &dev_attr_ipInHdrErrors.attr,
724 &dev_attr_ipInTooBigErrors.attr,
725 &dev_attr_ipInNoRoutes.attr,
726 &dev_attr_ipInAddrErrors.attr,
727 &dev_attr_ipInUnknownProtos.attr,
728 &dev_attr_ipInTruncatedPkts.attr,
729 &dev_attr_ipInDiscards.attr,
730 &dev_attr_ipInDelivers.attr,
731 &dev_attr_ipOutForwDatagrams.attr,
732 &dev_attr_ipOutRequests.attr,
733 &dev_attr_ipOutDiscards.attr,
734 &dev_attr_ipOutNoRoutes.attr,
735 &dev_attr_ipReasmTimeout.attr,
736 &dev_attr_ipReasmReqds.attr,
737 &dev_attr_ipReasmOKs.attr,
738 &dev_attr_ipReasmFails.attr,
739 &dev_attr_ipFragOKs.attr,
740 &dev_attr_ipFragFails.attr,
741 &dev_attr_ipFragCreates.attr,
742 &dev_attr_ipInMcastPkts.attr,
743 &dev_attr_ipOutMcastPkts.attr,
744 &dev_attr_ipInBcastPkts.attr,
745 &dev_attr_ipOutBcastPkts.attr,
746 &dev_attr_tcpRtoAlgorithm.attr,
747 &dev_attr_tcpRtoMin.attr,
748 &dev_attr_tcpRtoMax.attr,
749 &dev_attr_tcpMaxConn.attr,
750 &dev_attr_tcpActiveOpens.attr,
751 &dev_attr_tcpPassiveOpens.attr,
752 &dev_attr_tcpAttemptFails.attr,
753 &dev_attr_tcpEstabResets.attr,
754 &dev_attr_tcpCurrEstab.attr,
755 &dev_attr_tcpInSegs.attr,
756 &dev_attr_tcpOutSegs.attr,
757 &dev_attr_tcpRetransSegs.attr,
758 &dev_attr_tcpInErrs.attr,
759 &dev_attr_tcpOutRsts.attr,