Lines Matching refs:ibdev
66 struct ib_device *ibdev; member
78 ssize_t (*show)(struct ib_device *ibdev, struct rdma_hw_stats *stats,
80 ssize_t (*store)(struct ib_device *ibdev, struct rdma_hw_stats *stats,
87 ssize_t (*show)(struct ib_device *ibdev, struct rdma_hw_stats *stats,
89 ssize_t (*store)(struct ib_device *ibdev, struct rdma_hw_stats *stats,
115 return port_attr->show(p->ibdev, p->port_num, port_attr, buf); in port_attr_show()
128 return port_attr->store(p->ibdev, p->port_num, port_attr, buf, count); in port_attr_store()
137 return port->ibdev; in ib_port_sysfs_get_ibdev_kobj()
151 struct ib_device *ibdev = container_of(dev, struct ib_device, dev); in hw_stat_device_show() local
153 return stat_attr->show(ibdev, ibdev->hw_stats_data->stats, in hw_stat_device_show()
154 stat_attr - ibdev->hw_stats_data->attrs, 0, buf); in hw_stat_device_show()
163 struct ib_device *ibdev = container_of(dev, struct ib_device, dev); in hw_stat_device_store() local
165 return stat_attr->store(ibdev, ibdev->hw_stats_data->stats, in hw_stat_device_store()
166 stat_attr - ibdev->hw_stats_data->attrs, 0, buf, in hw_stat_device_store()
170 static ssize_t hw_stat_port_show(struct ib_device *ibdev, u32 port_num, in hw_stat_port_show() argument
175 struct ib_port *port = ibdev->port_data[port_num].sysfs; in hw_stat_port_show()
177 return stat_attr->show(ibdev, port->hw_stats_data->stats, in hw_stat_port_show()
182 static ssize_t hw_stat_port_store(struct ib_device *ibdev, u32 port_num, in hw_stat_port_store() argument
188 struct ib_port *port = ibdev->port_data[port_num].sysfs; in hw_stat_port_store()
190 return stat_attr->store(ibdev, port->hw_stats_data->stats, in hw_stat_port_store()
206 return port_attr->show(p->ibdev, p->port_num, port_attr, buf); in gid_attr_show()
213 static ssize_t state_show(struct ib_device *ibdev, u32 port_num, in state_show() argument
219 ret = ib_query_port(ibdev, port_num, &attr); in state_show()
227 static ssize_t lid_show(struct ib_device *ibdev, u32 port_num, in lid_show() argument
233 ret = ib_query_port(ibdev, port_num, &attr); in lid_show()
240 static ssize_t lid_mask_count_show(struct ib_device *ibdev, u32 port_num, in lid_mask_count_show() argument
246 ret = ib_query_port(ibdev, port_num, &attr); in lid_mask_count_show()
253 static ssize_t sm_lid_show(struct ib_device *ibdev, u32 port_num, in sm_lid_show() argument
259 ret = ib_query_port(ibdev, port_num, &attr); in sm_lid_show()
266 static ssize_t sm_sl_show(struct ib_device *ibdev, u32 port_num, in sm_sl_show() argument
272 ret = ib_query_port(ibdev, port_num, &attr); in sm_sl_show()
279 static ssize_t cap_mask_show(struct ib_device *ibdev, u32 port_num, in cap_mask_show() argument
285 ret = ib_query_port(ibdev, port_num, &attr); in cap_mask_show()
292 static ssize_t rate_show(struct ib_device *ibdev, u32 port_num, in rate_show() argument
300 ret = ib_query_port(ibdev, port_num, &attr); in rate_show()
371 static ssize_t phys_state_show(struct ib_device *ibdev, u32 port_num, in phys_state_show() argument
378 ret = ib_query_port(ibdev, port_num, &attr); in phys_state_show()
386 static ssize_t link_layer_show(struct ib_device *ibdev, u32 port_num, in link_layer_show() argument
391 switch (rdma_port_get_link_layer(ibdev, port_num)) { in link_layer_show()
450 struct ib_device *ibdev, u32 port_num, struct ib_port_attribute *attr, in _show_port_gid_attr() argument
459 gid_attr = rdma_get_gid_attr(ibdev, port_num, tab_attr->index); in _show_port_gid_attr()
469 static ssize_t show_port_gid(struct ib_device *ibdev, u32 port_num, in show_port_gid() argument
477 gid_attr = rdma_get_gid_attr(ibdev, port_num, tab_attr->index); in show_port_gid()
498 static ssize_t show_port_gid_attr_ndev(struct ib_device *ibdev, u32 port_num, in show_port_gid_attr_ndev() argument
502 return _show_port_gid_attr(ibdev, port_num, attr, buf, print_ndev); in show_port_gid_attr_ndev()
505 static ssize_t show_port_gid_attr_gid_type(struct ib_device *ibdev, in show_port_gid_attr_gid_type() argument
510 return _show_port_gid_attr(ibdev, port_num, attr, buf, print_gid_type); in show_port_gid_attr_gid_type()
513 static ssize_t show_port_pkey(struct ib_device *ibdev, u32 port_num, in show_port_pkey() argument
521 ret = ib_query_pkey(ibdev, port_num, tab_attr->index, &pkey); in show_port_pkey()
590 static ssize_t show_pma_counter(struct ib_device *ibdev, u32 port_num, in show_pma_counter() argument
601 ret = get_perf_mad(ibdev, port_num, tab_attr->attr_id, &data, in show_pma_counter()
826 static ssize_t show_hw_stats(struct ib_device *ibdev, in show_hw_stats() argument
833 ret = update_hw_stats(ibdev, stats, port_num, index); in show_hw_stats()
836 ret = print_hw_stat(ibdev, port_num, stats, index, buf); in show_hw_stats()
843 static ssize_t show_stats_lifespan(struct ib_device *ibdev, in show_stats_lifespan() argument
857 static ssize_t set_stats_lifespan(struct ib_device *ibdev, in set_stats_lifespan() argument
881 alloc_hw_stats_device(struct ib_device *ibdev) in alloc_hw_stats_device() argument
886 if (!ibdev->ops.alloc_hw_device_stats) in alloc_hw_stats_device()
888 stats = ibdev->ops.alloc_hw_device_stats(ibdev); in alloc_hw_stats_device()
925 int ib_setup_device_attrs(struct ib_device *ibdev) in ib_setup_device_attrs() argument
932 data = alloc_hw_stats_device(ibdev); in ib_setup_device_attrs()
938 ibdev->hw_stats_data = data; in ib_setup_device_attrs()
940 ret = ibdev->ops.get_hw_stats(ibdev, data->stats, 0, in ib_setup_device_attrs()
976 for (i = 0; i != ARRAY_SIZE(ibdev->groups); i++) in ib_setup_device_attrs()
977 if (!ibdev->groups[i]) { in ib_setup_device_attrs()
978 ibdev->groups[i] = &data->group; in ib_setup_device_attrs()
979 ibdev->hw_stats_attr_index = i; in ib_setup_device_attrs()
989 struct ib_device *ibdev = port->ibdev; in alloc_hw_stats_port() local
993 if (!ibdev->ops.alloc_hw_port_stats) in alloc_hw_stats_port()
995 stats = ibdev->ops.alloc_hw_port_stats(port->ibdev, port->port_num); in alloc_hw_stats_port()
1037 ret = port->ibdev->ops.get_hw_stats(port->ibdev, data->stats, in setup_hw_port_stats()
1079 struct rdma_hw_stats *ib_get_hw_stats_port(struct ib_device *ibdev, in ib_get_hw_stats_port() argument
1082 if (!ibdev->port_data || !rdma_is_port_valid(ibdev, port_num) || in ib_get_hw_stats_port()
1083 !ibdev->port_data[port_num].sysfs->hw_stats_data) in ib_get_hw_stats_port()
1085 return ibdev->port_data[port_num].sysfs->hw_stats_data->stats; in ib_get_hw_stats_port()
1091 ssize_t (*show)(struct ib_device *ibdev, u32 port_num, in alloc_port_table_group() argument
1205 p->ibdev = device; in setup_port()
1272 bool is_full_dev = &port->ibdev->coredev == coredev; in destroy_port()
1276 sysfs_remove_groups(&port->kobj, port->ibdev->ops.port_groups); in destroy_port()
1281 if (port->ibdev->port_data && in destroy_port()
1282 port->ibdev->port_data[port->port_num].sysfs == port) in destroy_port()
1283 port->ibdev->port_data[port->port_num].sysfs = NULL; in destroy_port()
1459 int ib_port_register_client_groups(struct ib_device *ibdev, u32 port_num, in ib_port_register_client_groups() argument
1462 return sysfs_create_groups(&ibdev->port_data[port_num].sysfs->kobj, in ib_port_register_client_groups()
1467 void ib_port_unregister_client_groups(struct ib_device *ibdev, u32 port_num, in ib_port_unregister_client_groups() argument
1470 return sysfs_remove_groups(&ibdev->port_data[port_num].sysfs->kobj, in ib_port_unregister_client_groups()