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
228 ret = ib_query_port(ibdev, port_num, &attr); in state_show()
239 static ssize_t lid_show(struct ib_device *ibdev, u32 port_num, in lid_show() argument
245 ret = ib_query_port(ibdev, port_num, &attr); in lid_show()
252 static ssize_t lid_mask_count_show(struct ib_device *ibdev, u32 port_num, in lid_mask_count_show() argument
258 ret = ib_query_port(ibdev, port_num, &attr); in lid_mask_count_show()
265 static ssize_t sm_lid_show(struct ib_device *ibdev, u32 port_num, in sm_lid_show() argument
271 ret = ib_query_port(ibdev, port_num, &attr); in sm_lid_show()
278 static ssize_t sm_sl_show(struct ib_device *ibdev, u32 port_num, in sm_sl_show() argument
284 ret = ib_query_port(ibdev, port_num, &attr); in sm_sl_show()
291 static ssize_t cap_mask_show(struct ib_device *ibdev, u32 port_num, in cap_mask_show() argument
297 ret = ib_query_port(ibdev, port_num, &attr); in cap_mask_show()
304 static ssize_t rate_show(struct ib_device *ibdev, u32 port_num, in rate_show() argument
312 ret = ib_query_port(ibdev, port_num, &attr); in rate_show()
379 static ssize_t phys_state_show(struct ib_device *ibdev, u32 port_num, in phys_state_show() argument
386 ret = ib_query_port(ibdev, port_num, &attr); in phys_state_show()
394 static ssize_t link_layer_show(struct ib_device *ibdev, u32 port_num, in link_layer_show() argument
399 switch (rdma_port_get_link_layer(ibdev, port_num)) { in link_layer_show()
457 struct ib_device *ibdev, u32 port_num, struct ib_port_attribute *attr, in _show_port_gid_attr() argument
466 gid_attr = rdma_get_gid_attr(ibdev, port_num, tab_attr->index); in _show_port_gid_attr()
476 static ssize_t show_port_gid(struct ib_device *ibdev, u32 port_num, in show_port_gid() argument
484 gid_attr = rdma_get_gid_attr(ibdev, port_num, tab_attr->index); in show_port_gid()
505 static ssize_t show_port_gid_attr_ndev(struct ib_device *ibdev, u32 port_num, 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()
512 static ssize_t show_port_gid_attr_gid_type(struct ib_device *ibdev, 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()
520 static ssize_t show_port_pkey(struct ib_device *ibdev, u32 port_num, in show_port_pkey() argument
528 ret = ib_query_pkey(ibdev, port_num, tab_attr->index, &pkey); in show_port_pkey()
597 static ssize_t show_pma_counter(struct ib_device *ibdev, u32 port_num, in show_pma_counter() argument
608 ret = get_perf_mad(ibdev, port_num, tab_attr->attr_id, &data, in show_pma_counter()
833 static ssize_t show_hw_stats(struct ib_device *ibdev, in show_hw_stats() argument
840 ret = update_hw_stats(ibdev, stats, port_num, index); in show_hw_stats()
843 ret = print_hw_stat(ibdev, port_num, stats, index, buf); in show_hw_stats()
850 static ssize_t show_stats_lifespan(struct ib_device *ibdev, in show_stats_lifespan() argument
864 static ssize_t set_stats_lifespan(struct ib_device *ibdev, in set_stats_lifespan() argument
888 alloc_hw_stats_device(struct ib_device *ibdev) in alloc_hw_stats_device() argument
893 if (!ibdev->ops.alloc_hw_device_stats) in alloc_hw_stats_device()
895 stats = ibdev->ops.alloc_hw_device_stats(ibdev); in alloc_hw_stats_device()
932 int ib_setup_device_attrs(struct ib_device *ibdev) in ib_setup_device_attrs() argument
939 data = alloc_hw_stats_device(ibdev); in ib_setup_device_attrs()
945 ibdev->hw_stats_data = data; in ib_setup_device_attrs()
947 ret = ibdev->ops.get_hw_stats(ibdev, data->stats, 0, in ib_setup_device_attrs()
983 for (i = 0; i != ARRAY_SIZE(ibdev->groups); i++) in ib_setup_device_attrs()
984 if (!ibdev->groups[i]) { in ib_setup_device_attrs()
985 ibdev->groups[i] = &data->group; in ib_setup_device_attrs()
995 struct ib_device *ibdev = port->ibdev; in alloc_hw_stats_port() local
999 if (!ibdev->ops.alloc_hw_port_stats) in alloc_hw_stats_port()
1001 stats = ibdev->ops.alloc_hw_port_stats(port->ibdev, port->port_num); in alloc_hw_stats_port()
1043 ret = port->ibdev->ops.get_hw_stats(port->ibdev, data->stats, in setup_hw_port_stats()
1085 struct rdma_hw_stats *ib_get_hw_stats_port(struct ib_device *ibdev, in ib_get_hw_stats_port() argument
1088 if (!ibdev->port_data || !rdma_is_port_valid(ibdev, port_num) || in ib_get_hw_stats_port()
1089 !ibdev->port_data[port_num].sysfs->hw_stats_data) in ib_get_hw_stats_port()
1091 return ibdev->port_data[port_num].sysfs->hw_stats_data->stats; in ib_get_hw_stats_port()
1097 ssize_t (*show)(struct ib_device *ibdev, u32 port_num, in alloc_port_table_group() argument
1211 p->ibdev = device; in setup_port()
1276 bool is_full_dev = &port->ibdev->coredev == coredev; in destroy_port()
1278 if (port->ibdev->port_data && in destroy_port()
1279 port->ibdev->port_data[port->port_num].sysfs == port) in destroy_port()
1280 port->ibdev->port_data[port->port_num].sysfs = NULL; in destroy_port()
1283 sysfs_remove_groups(&port->kobj, port->ibdev->ops.port_groups); in destroy_port()
1460 int ib_port_register_client_groups(struct ib_device *ibdev, u32 port_num, in ib_port_register_client_groups() argument
1463 return sysfs_create_groups(&ibdev->port_data[port_num].sysfs->kobj, in ib_port_register_client_groups()
1468 void ib_port_unregister_client_groups(struct ib_device *ibdev, u32 port_num, in ib_port_unregister_client_groups() argument
1471 return sysfs_remove_groups(&ibdev->port_data[port_num].sysfs->kobj, in ib_port_unregister_client_groups()