Lines Matching refs:method
91 static int method_in_use(struct ib_mad_mgmt_method_table **method,
187 struct ib_mad_mgmt_method_table *method; in is_vendor_method_in_use() local
192 method = vendor_class->method_table[i]; in is_vendor_method_in_use()
193 if (method) { in is_vendor_method_in_use()
194 if (method_in_use(&method, mad_reg_req)) in is_vendor_method_in_use()
206 return ((hdr->method & IB_MGMT_METHOD_RESP) || in ib_response_mad()
207 (hdr->method == IB_MGMT_METHOD_TRAP_REPRESS) || in ib_response_mad()
235 struct ib_mad_mgmt_method_table *method; in ib_register_mad_agent() local
431 method = class->method_table[mgmt_class]; in ib_register_mad_agent()
432 if (method) { in ib_register_mad_agent()
433 if (method_in_use(&method, in ib_register_mad_agent()
1183 static int method_in_use(struct ib_mad_mgmt_method_table **method, in method_in_use() argument
1189 if ((*method)->agent[i]) { in method_in_use()
1197 static int allocate_method_table(struct ib_mad_mgmt_method_table **method) in allocate_method_table() argument
1200 *method = kzalloc(sizeof **method, GFP_ATOMIC); in allocate_method_table()
1201 return (*method) ? 0 : (-ENOMEM); in allocate_method_table()
1207 static int check_method_table(struct ib_mad_mgmt_method_table *method) in check_method_table() argument
1212 if (method->agent[i]) in check_method_table()
1264 static void remove_methods_mad_agent(struct ib_mad_mgmt_method_table *method, in remove_methods_mad_agent() argument
1271 if (method->agent[i] == agent) in remove_methods_mad_agent()
1272 method->agent[i] = NULL; in remove_methods_mad_agent()
1281 struct ib_mad_mgmt_method_table **method; in add_nonoui_reg_req() local
1295 method = &(*class)->method_table[mgmt_class]; in add_nonoui_reg_req()
1296 if ((ret = allocate_method_table(method))) in add_nonoui_reg_req()
1299 method = &(*class)->method_table[mgmt_class]; in add_nonoui_reg_req()
1300 if (!*method) { in add_nonoui_reg_req()
1302 if ((ret = allocate_method_table(method))) in add_nonoui_reg_req()
1308 if (method_in_use(method, mad_reg_req)) in add_nonoui_reg_req()
1313 (*method)->agent[i] = agent_priv; in add_nonoui_reg_req()
1319 remove_methods_mad_agent(*method, agent_priv); in add_nonoui_reg_req()
1321 if (!check_method_table(*method)) { in add_nonoui_reg_req()
1323 kfree(*method); in add_nonoui_reg_req()
1324 *method = NULL; in add_nonoui_reg_req()
1342 struct ib_mad_mgmt_method_table **method; in add_oui_reg_req() local
1371 method = &(*vendor_table)->vendor_class[ in add_oui_reg_req()
1373 if (!*method) in add_oui_reg_req()
1382 method = &(*vendor_table)->vendor_class[ in add_oui_reg_req()
1385 if (!*method) { in add_oui_reg_req()
1386 ret = allocate_method_table(method); in add_oui_reg_req()
1400 if (method_in_use(method, mad_reg_req)) in add_oui_reg_req()
1405 (*method)->agent[i] = agent_priv; in add_oui_reg_req()
1411 remove_methods_mad_agent(*method, agent_priv); in add_oui_reg_req()
1413 if (!check_method_table(*method)) { in add_oui_reg_req()
1415 kfree(*method); in add_oui_reg_req()
1416 *method = NULL; in add_oui_reg_req()
1437 struct ib_mad_mgmt_method_table *method; in remove_mad_reg_req() local
1457 method = class->method_table[mgmt_class]; in remove_mad_reg_req()
1458 if (method) { in remove_mad_reg_req()
1460 remove_methods_mad_agent(method, agent_priv); in remove_mad_reg_req()
1462 if (!check_method_table(method)) { in remove_mad_reg_req()
1464 kfree(method); in remove_mad_reg_req()
1494 method = vendor_class->method_table[index]; in remove_mad_reg_req()
1495 if (method) { in remove_mad_reg_req()
1497 remove_methods_mad_agent(method, agent_priv); in remove_mad_reg_req()
1502 if (!check_method_table(method)) { in remove_mad_reg_req()
1504 kfree(method); in remove_mad_reg_req()
1551 struct ib_mad_mgmt_method_table *method; in find_mad_agent() local
1572 method = class->method_table[convert_mgmt_class( in find_mad_agent()
1574 if (method) in find_mad_agent()
1575 mad_agent = method->agent[mad_hdr->method & in find_mad_agent()
1591 method = vendor_class->method_table[index]; in find_mad_agent()
1592 if (method) { in find_mad_agent()
1593 mad_agent = method->agent[mad_hdr->method & in find_mad_agent()
1638 (mad_hdr->method != IB_MGMT_METHOD_SEND)) in validate_mad()
1914 if (recv_hdr->method == IB_MGMT_METHOD_GET || in generate_unmatched_resp()
1915 recv_hdr->method == IB_MGMT_METHOD_SET) { in generate_unmatched_resp()
1920 resp_hdr->method = IB_MGMT_METHOD_GET_RESP; in generate_unmatched_resp()