Lines Matching refs:ccp
2091 static int cc_get_classportinfo(struct ib_cc_mad *ccp, in cc_get_classportinfo() argument
2095 (struct ib_cc_classportinfo_attr *)ccp->mgmt_data; in cc_get_classportinfo()
2097 memset(ccp->mgmt_data, 0, sizeof(ccp->mgmt_data)); in cc_get_classportinfo()
2108 return reply((struct ib_smp *) ccp); in cc_get_classportinfo()
2111 static int cc_get_congestion_info(struct ib_cc_mad *ccp, in cc_get_congestion_info() argument
2115 (struct ib_cc_info_attr *)ccp->mgmt_data; in cc_get_congestion_info()
2119 memset(ccp->mgmt_data, 0, sizeof(ccp->mgmt_data)); in cc_get_congestion_info()
2124 return reply((struct ib_smp *) ccp); in cc_get_congestion_info()
2127 static int cc_get_congestion_setting(struct ib_cc_mad *ccp, in cc_get_congestion_setting() argument
2132 (struct ib_cc_congestion_setting_attr *)ccp->mgmt_data; in cc_get_congestion_setting()
2137 memset(ccp->mgmt_data, 0, sizeof(ccp->mgmt_data)); in cc_get_congestion_setting()
2155 return reply((struct ib_smp *) ccp); in cc_get_congestion_setting()
2158 static int cc_get_congestion_control_table(struct ib_cc_mad *ccp, in cc_get_congestion_control_table() argument
2162 (struct ib_cc_table_attr *)ccp->mgmt_data; in cc_get_congestion_control_table()
2165 u32 cct_block_index = be32_to_cpu(ccp->attr_mod); in cc_get_congestion_control_table()
2175 memset(ccp->mgmt_data, 0, sizeof(ccp->mgmt_data)); in cc_get_congestion_control_table()
2188 ccp->attr_mod = cpu_to_be32(cct_block_index); in cc_get_congestion_control_table()
2205 return reply((struct ib_smp *) ccp); in cc_get_congestion_control_table()
2208 return reply_failure((struct ib_smp *) ccp); in cc_get_congestion_control_table()
2211 static int cc_set_congestion_setting(struct ib_cc_mad *ccp, in cc_set_congestion_setting() argument
2215 (struct ib_cc_congestion_setting_attr *)ccp->mgmt_data; in cc_set_congestion_setting()
2236 return reply((struct ib_smp *) ccp); in cc_set_congestion_setting()
2239 static int cc_set_congestion_control_table(struct ib_cc_mad *ccp, in cc_set_congestion_control_table() argument
2243 (struct ib_cc_table_attr *)ccp->mgmt_data; in cc_set_congestion_control_table()
2246 u32 cct_block_index = be32_to_cpu(ccp->attr_mod); in cc_set_congestion_control_table()
2289 return reply((struct ib_smp *) ccp); in cc_set_congestion_control_table()
2292 return reply_failure((struct ib_smp *) ccp); in cc_set_congestion_control_table()
2296 struct ib_cc_mad *ccp, int mad_flags) in check_cc_key() argument
2305 struct ib_cc_mad *ccp = (struct ib_cc_mad *)out_mad; in process_cc() local
2311 if (ccp->class_version != 2) { in process_cc()
2312 ccp->status |= IB_SMP_UNSUP_VERSION; in process_cc()
2313 ret = reply((struct ib_smp *)ccp); in process_cc()
2317 ret = check_cc_key(ibp, ccp, mad_flags); in process_cc()
2321 switch (ccp->method) { in process_cc()
2323 switch (ccp->attr_id) { in process_cc()
2325 ret = cc_get_classportinfo(ccp, ibdev); in process_cc()
2329 ret = cc_get_congestion_info(ccp, ibdev, port); in process_cc()
2333 ret = cc_get_congestion_setting(ccp, ibdev, port); in process_cc()
2337 ret = cc_get_congestion_control_table(ccp, ibdev, port); in process_cc()
2342 ccp->status |= IB_SMP_UNSUP_METH_ATTR; in process_cc()
2343 ret = reply((struct ib_smp *) ccp); in process_cc()
2348 switch (ccp->attr_id) { in process_cc()
2350 ret = cc_set_congestion_setting(ccp, ibdev, port); in process_cc()
2354 ret = cc_set_congestion_control_table(ccp, ibdev, port); in process_cc()
2359 ccp->status |= IB_SMP_UNSUP_METH_ATTR; in process_cc()
2360 ret = reply((struct ib_smp *) ccp); in process_cc()
2375 ccp->status |= IB_SMP_UNSUP_METHOD; in process_cc()
2376 ret = reply((struct ib_smp *) ccp); in process_cc()