Lines Matching refs:sa_dev
1175 struct ib_sa_device *sa_dev; in get_src_path_mask() local
1180 sa_dev = ib_get_client_data(device, &sa_client); in get_src_path_mask()
1181 if (!sa_dev) in get_src_path_mask()
1184 port = &sa_dev->port[port_num - sa_dev->start_port]; in get_src_path_mask()
1394 struct ib_sa_device *sa_dev, in ib_sa_opa_pathrecord_support() argument
1401 port = &sa_dev->port[port_num - sa_dev->start_port]; in ib_sa_opa_pathrecord_support()
1429 struct ib_sa_device *sa_dev, in opa_pr_query_possible() argument
1437 if (ib_sa_opa_pathrecord_support(client, sa_dev, port_num)) in opa_pr_query_possible()
1528 struct ib_sa_device *sa_dev = ib_get_client_data(device, &sa_client); in ib_sa_path_rec_get() local
1535 if (!sa_dev) in ib_sa_path_rec_get()
1542 port = &sa_dev->port[port_num - sa_dev->start_port]; in ib_sa_path_rec_get()
1551 status = opa_pr_query_possible(client, sa_dev, device, port_num); in ib_sa_path_rec_get()
1655 struct ib_sa_device *sa_dev = ib_get_client_data(device, &sa_client); in ib_sa_mcmember_rec_query() local
1661 if (!sa_dev) in ib_sa_mcmember_rec_query()
1664 port = &sa_dev->port[port_num - sa_dev->start_port]; in ib_sa_mcmember_rec_query()
1745 struct ib_sa_device *sa_dev = ib_get_client_data(device, &sa_client); in ib_sa_guid_info_rec_query() local
1751 if (!sa_dev) in ib_sa_guid_info_rec_query()
1760 port = &sa_dev->port[port_num - sa_dev->start_port]; in ib_sa_guid_info_rec_query()
2120 struct ib_sa_device *sa_dev = in ib_sa_event() local
2121 container_of(handler, typeof(*sa_dev), event_handler); in ib_sa_event()
2122 u32 port_num = event->element.port_num - sa_dev->start_port; in ib_sa_event()
2123 struct ib_sa_port *port = &sa_dev->port[port_num]; in ib_sa_event()
2148 queue_work(ib_wq, &sa_dev->port[port_num].update_task); in ib_sa_event()
2154 struct ib_sa_device *sa_dev; in ib_sa_add_one() local
2162 sa_dev = kzalloc(struct_size(sa_dev, port, in ib_sa_add_one()
2165 if (!sa_dev) in ib_sa_add_one()
2168 sa_dev->start_port = s; in ib_sa_add_one()
2169 sa_dev->end_port = e; in ib_sa_add_one()
2172 spin_lock_init(&sa_dev->port[i].ah_lock); in ib_sa_add_one()
2176 sa_dev->port[i].sm_ah = NULL; in ib_sa_add_one()
2177 sa_dev->port[i].port_num = i + s; in ib_sa_add_one()
2179 spin_lock_init(&sa_dev->port[i].classport_lock); in ib_sa_add_one()
2180 sa_dev->port[i].classport_info.valid = false; in ib_sa_add_one()
2182 sa_dev->port[i].agent = in ib_sa_add_one()
2185 recv_handler, sa_dev, 0); in ib_sa_add_one()
2186 if (IS_ERR(sa_dev->port[i].agent)) { in ib_sa_add_one()
2187 ret = PTR_ERR(sa_dev->port[i].agent); in ib_sa_add_one()
2191 INIT_WORK(&sa_dev->port[i].update_task, update_sm_ah); in ib_sa_add_one()
2192 INIT_DELAYED_WORK(&sa_dev->port[i].ib_cpi_work, in ib_sa_add_one()
2203 ib_set_client_data(device, &sa_client, sa_dev); in ib_sa_add_one()
2212 INIT_IB_EVENT_HANDLER(&sa_dev->event_handler, device, ib_sa_event); in ib_sa_add_one()
2213 ib_register_event_handler(&sa_dev->event_handler); in ib_sa_add_one()
2217 update_sm_ah(&sa_dev->port[i].update_task); in ib_sa_add_one()
2225 ib_unregister_mad_agent(sa_dev->port[i].agent); in ib_sa_add_one()
2228 kfree(sa_dev); in ib_sa_add_one()
2234 struct ib_sa_device *sa_dev = client_data; in ib_sa_remove_one() local
2237 ib_unregister_event_handler(&sa_dev->event_handler); in ib_sa_remove_one()
2240 for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) { in ib_sa_remove_one()
2242 cancel_delayed_work_sync(&sa_dev->port[i].ib_cpi_work); in ib_sa_remove_one()
2243 ib_unregister_mad_agent(sa_dev->port[i].agent); in ib_sa_remove_one()
2244 if (sa_dev->port[i].sm_ah) in ib_sa_remove_one()
2245 kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah); in ib_sa_remove_one()
2250 kfree(sa_dev); in ib_sa_remove_one()