Lines Matching full:smp
81 static int reply(struct ib_mad_hdr *smp) in reply() argument
87 smp->method = IB_MGMT_METHOD_GET_RESP; in reply()
88 if (smp->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) in reply()
89 smp->status |= IB_SMP_DIRECTION; in reply()
93 static inline void clear_opa_smp_data(struct opa_smp *smp) in clear_opa_smp_data() argument
95 void *data = opa_get_smp_data(smp); in clear_opa_smp_data()
96 size_t size = opa_get_smp_data_size(smp); in clear_opa_smp_data()
229 struct opa_smp *smp) in subn_handle_opa_trap_repress() argument
236 if (smp->attr_id != IB_SMP_ATTR_NOTICE) in subn_handle_opa_trap_repress()
244 if (trap && trap->tid == smp->tid) { in subn_handle_opa_trap_repress()
317 struct opa_smp *smp; in send_trap() local
352 smp = send_buf->mad; in send_trap()
353 smp->base_version = OPA_MGMT_BASE_VERSION; in send_trap()
354 smp->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED; in send_trap()
355 smp->class_version = OPA_SM_CLASS_VERSION; in send_trap()
356 smp->method = IB_MGMT_METHOD_TRAP; in send_trap()
366 smp->tid = trap->tid; in send_trap()
368 smp->attr_id = IB_SMP_ATTR_NOTICE; in send_trap()
369 /* o14-1: smp->mkey = 0; */ in send_trap()
371 memcpy(smp->route.lid.data, &trap->data, trap->len); in send_trap()
582 static int __subn_get_opa_nodedesc(struct opa_smp *smp, u32 am, in __subn_get_opa_nodedesc() argument
589 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_nodedesc()
590 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodedesc()
600 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodedesc()
603 static int __subn_get_opa_nodeinfo(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_nodeinfo() argument
617 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_nodeinfo()
618 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodeinfo()
640 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodeinfo()
643 static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev, in subn_get_nodeinfo() argument
646 struct ib_node_info *nip = (struct ib_node_info *)&smp->data; in subn_get_nodeinfo()
651 if (smp->attr_mod || pidx >= dd->num_pports || in subn_get_nodeinfo()
654 smp->status |= IB_SMP_INVALID_FIELD; in subn_get_nodeinfo()
655 return reply((struct ib_mad_hdr *)smp); in subn_get_nodeinfo()
674 return reply((struct ib_mad_hdr *)smp); in subn_get_nodeinfo()
796 static int __subn_get_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_portinfo() argument
815 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_portinfo()
816 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_portinfo()
826 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_portinfo()
827 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_portinfo()
833 if (!(smp->method == IB_MGMT_METHOD_GET && in __subn_get_opa_portinfo()
834 ibp->rvp.mkey != smp->mkey && in __subn_get_opa_portinfo()
1003 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_portinfo()
1021 static int __subn_get_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_pkeytable() argument
1038 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
1039 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1047 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
1048 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1054 "avail 0x%x; blk/smp 0x%lx\n", in __subn_get_opa_pkeytable()
1057 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
1058 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1071 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
1073 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1240 static int set_port_states(struct hfi1_pportdata *ppd, struct opa_smp *smp, in set_port_states() argument
1251 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1263 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1288 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1332 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1338 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1346 * @smp: the incoming SM packet
1351 static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_portinfo() argument
1376 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1377 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_portinfo()
1383 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1391 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1418 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1451 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1493 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1510 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1517 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1528 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1529 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_portinfo()
1542 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1575 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1579 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1618 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1637 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_portinfo()
1642 ret = __subn_get_opa_portinfo(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_portinfo()
1660 return __subn_get_opa_portinfo(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_portinfo()
1720 static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_pkeytable() argument
1737 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1738 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1746 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1747 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1752 pr_warn("OPA Set PKey AM Invalid : s 0x%x; req 0x%x; avail 0x%x; blk/smp 0x%lx\n", in __subn_set_opa_pkeytable()
1755 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1756 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1763 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1764 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1767 return __subn_get_opa_pkeytable(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_pkeytable()
1827 static int __subn_get_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sl_to_sc() argument
1837 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sl_to_sc()
1838 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sl_to_sc()
1847 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sl_to_sc()
1850 static int __subn_set_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sl_to_sc() argument
1861 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sl_to_sc()
1862 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sl_to_sc()
1875 return __subn_get_opa_sl_to_sc(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_sl_to_sc()
1879 static int __subn_get_opa_sc_to_sl(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sc_to_sl() argument
1889 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sc_to_sl()
1890 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_sl()
1899 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_sl()
1902 static int __subn_set_opa_sc_to_sl(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sc_to_sl() argument
1912 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_sl()
1913 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_sl()
1919 return __subn_get_opa_sc_to_sl(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_sc_to_sl()
1923 static int __subn_get_opa_sc_to_vlt(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sc_to_vlt() argument
1933 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sc_to_vlt()
1934 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlt()
1942 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlt()
1945 static int __subn_set_opa_sc_to_vlt(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sc_to_vlt() argument
1964 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlt()
1965 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlt()
1977 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlt()
1978 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlt()
1983 return __subn_get_opa_sc_to_vlt(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_sc_to_vlt()
1987 static int __subn_get_opa_sc_to_vlnt(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sc_to_vlnt() argument
1998 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sc_to_vlnt()
1999 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlnt()
2009 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlnt()
2012 static int __subn_set_opa_sc_to_vlnt(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sc_to_vlnt() argument
2024 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlnt()
2025 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlnt()
2032 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlnt()
2033 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlnt()
2040 return __subn_get_opa_sc_to_vlnt(smp, am, data, ibdev, port, in __subn_set_opa_sc_to_vlnt()
2044 static int __subn_get_opa_psi(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_psi() argument
2056 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_psi()
2057 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_psi()
2083 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_psi()
2086 static int __subn_set_opa_psi(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_psi() argument
2100 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_psi()
2101 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_psi()
2119 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_psi()
2125 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_psi()
2130 return __subn_get_opa_psi(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_psi()
2134 static int __subn_get_opa_cable_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_cable_info() argument
2145 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cable_info()
2146 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2159 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cable_info()
2160 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2166 smp->status |= IB_SMP_UNSUP_METH_ATTR; in __subn_get_opa_cable_info()
2167 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2176 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cable_info()
2177 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2183 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2186 static int __subn_get_opa_bct(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_bct() argument
2197 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_bct()
2198 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_bct()
2207 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_bct()
2210 static int __subn_set_opa_bct(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_bct() argument
2220 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_bct()
2221 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_bct()
2226 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_bct()
2227 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_bct()
2230 return __subn_get_opa_bct(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_bct()
2234 static int __subn_get_opa_vl_arb(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_vl_arb() argument
2245 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_vl_arb()
2246 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_vl_arb()
2264 be32_to_cpu(smp->attr_mod)); in __subn_get_opa_vl_arb()
2265 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_vl_arb()
2273 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_vl_arb()
2276 static int __subn_set_opa_vl_arb(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_vl_arb() argument
2287 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_vl_arb()
2288 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_vl_arb()
2304 smp->status |= IB_SMP_UNSUP_METH_ATTR; in __subn_set_opa_vl_arb()
2308 be32_to_cpu(smp->attr_mod)); in __subn_set_opa_vl_arb()
2309 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_vl_arb()
2313 return __subn_get_opa_vl_arb(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_vl_arb()
3704 static int __subn_get_opa_cong_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_cong_info() argument
3714 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cong_info()
3715 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_info()
3725 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_info()
3728 static int __subn_get_opa_cong_setting(struct opa_smp *smp, u32 am, in __subn_get_opa_cong_setting() argument
3741 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cong_setting()
3742 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_setting()
3751 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_setting()
3770 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_setting()
3821 static int __subn_set_opa_cong_setting(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_cong_setting() argument
3833 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_cong_setting()
3834 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_cong_setting()
3857 return __subn_get_opa_cong_setting(smp, am, data, ibdev, port, in __subn_set_opa_cong_setting()
3861 static int __subn_get_opa_hfi1_cong_log(struct opa_smp *smp, u32 am, in __subn_get_opa_hfi1_cong_log() argument
3872 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_hfi1_cong_log()
3873 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_hfi1_cong_log()
3924 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_hfi1_cong_log()
3927 static int __subn_get_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_cc_table() argument
3946 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cc_table()
3947 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cc_table()
3956 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cc_table()
3976 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cc_table()
3979 static int __subn_set_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_cc_table() argument
3997 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_cc_table()
3998 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_cc_table()
4008 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_cc_table()
4009 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_cc_table()
4026 return __subn_get_opa_cc_table(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_cc_table()
4038 static int __subn_get_opa_led_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_led_info() argument
4049 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_led_info()
4050 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_led_info()
4065 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_led_info()
4068 static int __subn_set_opa_led_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_led_info() argument
4078 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_led_info()
4079 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_led_info()
4087 return __subn_get_opa_led_info(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_led_info()
4091 static int subn_get_opa_sma(__be16 attr_id, struct opa_smp *smp, u32 am, in subn_get_opa_sma() argument
4100 ret = __subn_get_opa_nodedesc(smp, am, data, ibdev, port, in subn_get_opa_sma()
4104 ret = __subn_get_opa_nodeinfo(smp, am, data, ibdev, port, in subn_get_opa_sma()
4108 ret = __subn_get_opa_portinfo(smp, am, data, ibdev, port, in subn_get_opa_sma()
4112 ret = __subn_get_opa_pkeytable(smp, am, data, ibdev, port, in subn_get_opa_sma()
4116 ret = __subn_get_opa_sl_to_sc(smp, am, data, ibdev, port, in subn_get_opa_sma()
4120 ret = __subn_get_opa_sc_to_sl(smp, am, data, ibdev, port, in subn_get_opa_sma()
4124 ret = __subn_get_opa_sc_to_vlt(smp, am, data, ibdev, port, in subn_get_opa_sma()
4128 ret = __subn_get_opa_sc_to_vlnt(smp, am, data, ibdev, port, in subn_get_opa_sma()
4132 ret = __subn_get_opa_psi(smp, am, data, ibdev, port, in subn_get_opa_sma()
4136 ret = __subn_get_opa_bct(smp, am, data, ibdev, port, in subn_get_opa_sma()
4140 ret = __subn_get_opa_cable_info(smp, am, data, ibdev, port, in subn_get_opa_sma()
4144 ret = __subn_get_opa_vl_arb(smp, am, data, ibdev, port, in subn_get_opa_sma()
4148 ret = __subn_get_opa_cong_info(smp, am, data, ibdev, port, in subn_get_opa_sma()
4152 ret = __subn_get_opa_cong_setting(smp, am, data, ibdev, in subn_get_opa_sma()
4156 ret = __subn_get_opa_hfi1_cong_log(smp, am, data, ibdev, in subn_get_opa_sma()
4160 ret = __subn_get_opa_cc_table(smp, am, data, ibdev, port, in subn_get_opa_sma()
4164 ret = __subn_get_opa_led_info(smp, am, data, ibdev, port, in subn_get_opa_sma()
4174 smp->status |= IB_SMP_UNSUP_METH_ATTR; in subn_get_opa_sma()
4175 ret = reply((struct ib_mad_hdr *)smp); in subn_get_opa_sma()
4181 static int subn_set_opa_sma(__be16 attr_id, struct opa_smp *smp, u32 am, in subn_set_opa_sma() argument
4190 ret = __subn_set_opa_portinfo(smp, am, data, ibdev, port, in subn_set_opa_sma()
4194 ret = __subn_set_opa_pkeytable(smp, am, data, ibdev, port, in subn_set_opa_sma()
4198 ret = __subn_set_opa_sl_to_sc(smp, am, data, ibdev, port, in subn_set_opa_sma()
4202 ret = __subn_set_opa_sc_to_sl(smp, am, data, ibdev, port, in subn_set_opa_sma()
4206 ret = __subn_set_opa_sc_to_vlt(smp, am, data, ibdev, port, in subn_set_opa_sma()
4210 ret = __subn_set_opa_sc_to_vlnt(smp, am, data, ibdev, port, in subn_set_opa_sma()
4214 ret = __subn_set_opa_psi(smp, am, data, ibdev, port, in subn_set_opa_sma()
4218 ret = __subn_set_opa_bct(smp, am, data, ibdev, port, in subn_set_opa_sma()
4222 ret = __subn_set_opa_vl_arb(smp, am, data, ibdev, port, in subn_set_opa_sma()
4226 ret = __subn_set_opa_cong_setting(smp, am, data, ibdev, in subn_set_opa_sma()
4230 ret = __subn_set_opa_cc_table(smp, am, data, ibdev, port, in subn_set_opa_sma()
4234 ret = __subn_set_opa_led_info(smp, am, data, ibdev, port, in subn_set_opa_sma()
4244 smp->status |= IB_SMP_UNSUP_METH_ATTR; in subn_set_opa_sma()
4245 ret = reply((struct ib_mad_hdr *)smp); in subn_set_opa_sma()
4256 static int subn_get_opa_aggregate(struct opa_smp *smp, in subn_get_opa_aggregate() argument
4261 u32 num_attr = be32_to_cpu(smp->attr_mod) & 0x000000ff; in subn_get_opa_aggregate()
4262 u8 *next_smp = opa_get_smp_data(smp); in subn_get_opa_aggregate()
4265 smp->status |= IB_SMP_INVALID_FIELD; in subn_get_opa_aggregate()
4266 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4282 if (next_smp + agg_size > ((u8 *)smp) + sizeof(*smp)) { in subn_get_opa_aggregate()
4283 smp->status |= IB_SMP_INVALID_FIELD; in subn_get_opa_aggregate()
4284 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4290 (void)subn_get_opa_sma(agg->attr_id, smp, am, agg->data, in subn_get_opa_aggregate()
4293 if (smp->status & IB_SMP_INVALID_FIELD) in subn_get_opa_aggregate()
4295 if (smp->status & ~IB_SMP_DIRECTION) { in subn_get_opa_aggregate()
4297 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4302 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4305 static int subn_set_opa_aggregate(struct opa_smp *smp, in subn_set_opa_aggregate() argument
4310 u32 num_attr = be32_to_cpu(smp->attr_mod) & 0x000000ff; in subn_set_opa_aggregate()
4311 u8 *next_smp = opa_get_smp_data(smp); in subn_set_opa_aggregate()
4314 smp->status |= IB_SMP_INVALID_FIELD; in subn_set_opa_aggregate()
4315 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4331 if (next_smp + agg_size > ((u8 *)smp) + sizeof(*smp)) { in subn_set_opa_aggregate()
4332 smp->status |= IB_SMP_INVALID_FIELD; in subn_set_opa_aggregate()
4333 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4336 (void)subn_set_opa_sma(agg->attr_id, smp, am, agg->data, in subn_set_opa_aggregate()
4340 if (smp->status & IB_SMP_INVALID_FIELD) in subn_set_opa_aggregate()
4342 if (smp->status & ~IB_SMP_DIRECTION) { in subn_set_opa_aggregate()
4344 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4349 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4399 const struct opa_smp *smp = (const struct opa_smp *)mad; in is_local_mad() local
4401 if (smp->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) { in is_local_mad()
4402 return (smp->hop_cnt == 0 && in is_local_mad()
4403 smp->route.dr.dr_slid == OPA_LID_PERMISSIVE && in is_local_mad()
4404 smp->route.dr.dr_dlid == OPA_LID_PERMISSIVE); in is_local_mad()
4412 * is_local_mad() returns true. It applies the SMP checks that are
4414 * opa_local_smp_check() returns 0 if the SMP passes its checks, 1
4516 struct opa_smp *smp = (struct opa_smp *)out_mad; in process_subn_opa() local
4524 data = opa_get_smp_data(smp); in process_subn_opa()
4525 data_size = (u32)opa_get_smp_data_size(smp); in process_subn_opa()
4527 am = be32_to_cpu(smp->attr_mod); in process_subn_opa()
4528 attr_id = smp->attr_id; in process_subn_opa()
4529 if (smp->class_version != OPA_SM_CLASS_VERSION) { in process_subn_opa()
4530 smp->status |= IB_SMP_UNSUP_VERSION; in process_subn_opa()
4531 ret = reply((struct ib_mad_hdr *)smp); in process_subn_opa()
4534 ret = check_mkey(ibp, (struct ib_mad_hdr *)smp, mad_flags, smp->mkey, in process_subn_opa()
4535 smp->route.dr.dr_slid, smp->route.dr.return_path, in process_subn_opa()
4536 smp->hop_cnt); in process_subn_opa()
4538 u32 port_num = be32_to_cpu(smp->attr_mod); in process_subn_opa()
4548 (smp->method == IB_MGMT_METHOD_GET || in process_subn_opa()
4549 smp->method == IB_MGMT_METHOD_SET) && in process_subn_opa()
4553 (struct ib_mad_hdr *)smp, 0, in process_subn_opa()
4554 smp->mkey, smp->route.dr.dr_slid, in process_subn_opa()
4555 smp->route.dr.return_path, in process_subn_opa()
4556 smp->hop_cnt); in process_subn_opa()
4561 *resp_len = opa_get_smp_header_size(smp); in process_subn_opa()
4563 switch (smp->method) { in process_subn_opa()
4567 clear_opa_smp_data(smp); in process_subn_opa()
4568 ret = subn_get_opa_sma(attr_id, smp, am, data, in process_subn_opa()
4573 ret = subn_get_opa_aggregate(smp, ibdev, port, in process_subn_opa()
4581 ret = subn_set_opa_sma(attr_id, smp, am, data, in process_subn_opa()
4586 ret = subn_set_opa_aggregate(smp, ibdev, port, in process_subn_opa()
4603 subn_handle_opa_trap_repress(ibp, smp); in process_subn_opa()
4608 smp->status |= IB_SMP_UNSUP_METHOD; in process_subn_opa()
4609 ret = reply((struct ib_mad_hdr *)smp); in process_subn_opa()
4620 struct ib_smp *smp = (struct ib_smp *)out_mad; in process_subn() local
4625 if (smp->class_version != 1) { in process_subn()
4626 smp->status |= IB_SMP_UNSUP_VERSION; in process_subn()
4627 ret = reply((struct ib_mad_hdr *)smp); in process_subn()
4631 ret = check_mkey(ibp, (struct ib_mad_hdr *)smp, mad_flags, in process_subn()
4632 smp->mkey, (__force __be32)smp->dr_slid, in process_subn()
4633 smp->return_path, smp->hop_cnt); in process_subn()
4635 u32 port_num = be32_to_cpu(smp->attr_mod); in process_subn()
4645 (smp->method == IB_MGMT_METHOD_GET || in process_subn()
4646 smp->method == IB_MGMT_METHOD_SET) && in process_subn()
4650 (struct ib_mad_hdr *)smp, 0, in process_subn()
4651 smp->mkey, in process_subn()
4652 (__force __be32)smp->dr_slid, in process_subn()
4653 smp->return_path, smp->hop_cnt); in process_subn()
4658 switch (smp->method) { in process_subn()
4660 switch (smp->attr_id) { in process_subn()
4662 ret = subn_get_nodeinfo(smp, ibdev, port); in process_subn()
4665 smp->status |= IB_SMP_UNSUP_METH_ATTR; in process_subn()
4666 ret = reply((struct ib_mad_hdr *)smp); in process_subn()