Lines Matching refs:smp
39 static int reply(struct ib_mad_hdr *smp) in reply() argument
45 smp->method = IB_MGMT_METHOD_GET_RESP; in reply()
46 if (smp->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) in reply()
47 smp->status |= IB_SMP_DIRECTION; in reply()
51 static inline void clear_opa_smp_data(struct opa_smp *smp) in clear_opa_smp_data() argument
53 void *data = opa_get_smp_data(smp); in clear_opa_smp_data()
54 size_t size = opa_get_smp_data_size(smp); in clear_opa_smp_data()
187 struct opa_smp *smp) in subn_handle_opa_trap_repress() argument
194 if (smp->attr_id != IB_SMP_ATTR_NOTICE) in subn_handle_opa_trap_repress()
202 if (trap && trap->tid == smp->tid) { in subn_handle_opa_trap_repress()
275 struct opa_smp *smp; in send_trap() local
310 smp = send_buf->mad; in send_trap()
311 smp->base_version = OPA_MGMT_BASE_VERSION; in send_trap()
312 smp->mgmt_class = IB_MGMT_CLASS_SUBN_LID_ROUTED; in send_trap()
313 smp->class_version = OPA_SM_CLASS_VERSION; in send_trap()
314 smp->method = IB_MGMT_METHOD_TRAP; in send_trap()
324 smp->tid = trap->tid; in send_trap()
326 smp->attr_id = IB_SMP_ATTR_NOTICE; in send_trap()
329 memcpy(smp->route.lid.data, &trap->data, trap->len); in send_trap()
540 static int __subn_get_opa_nodedesc(struct opa_smp *smp, u32 am, in __subn_get_opa_nodedesc() argument
547 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_nodedesc()
548 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodedesc()
558 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodedesc()
561 static int __subn_get_opa_nodeinfo(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_nodeinfo() argument
575 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_nodeinfo()
576 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodeinfo()
598 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_nodeinfo()
601 static int subn_get_nodeinfo(struct ib_smp *smp, struct ib_device *ibdev, in subn_get_nodeinfo() argument
604 struct ib_node_info *nip = (struct ib_node_info *)&smp->data; in subn_get_nodeinfo()
609 if (smp->attr_mod || pidx >= dd->num_pports || in subn_get_nodeinfo()
612 smp->status |= IB_SMP_INVALID_FIELD; in subn_get_nodeinfo()
613 return reply((struct ib_mad_hdr *)smp); in subn_get_nodeinfo()
632 return reply((struct ib_mad_hdr *)smp); in subn_get_nodeinfo()
754 static int __subn_get_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_portinfo() argument
773 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_portinfo()
774 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_portinfo()
784 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_portinfo()
785 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_portinfo()
791 if (!(smp->method == IB_MGMT_METHOD_GET && in __subn_get_opa_portinfo()
792 ibp->rvp.mkey != smp->mkey && in __subn_get_opa_portinfo()
961 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_portinfo()
979 static int __subn_get_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_pkeytable() argument
996 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
997 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1005 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
1006 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1015 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
1016 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1029 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_pkeytable()
1031 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_pkeytable()
1198 static int set_port_states(struct hfi1_pportdata *ppd, struct opa_smp *smp, in set_port_states() argument
1209 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1221 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1246 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1290 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1296 smp->status |= IB_SMP_INVALID_FIELD; in set_port_states()
1309 static int __subn_set_opa_portinfo(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_portinfo() argument
1334 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1335 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_portinfo()
1341 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1349 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1376 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1409 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1451 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1468 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1475 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1486 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1487 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_portinfo()
1500 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1533 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1537 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1576 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_portinfo()
1595 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_portinfo()
1600 ret = __subn_get_opa_portinfo(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_portinfo()
1618 return __subn_get_opa_portinfo(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_portinfo()
1678 static int __subn_set_opa_pkeytable(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_pkeytable() argument
1695 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1696 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1704 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1705 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1713 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1714 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1721 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_pkeytable()
1722 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_pkeytable()
1725 return __subn_get_opa_pkeytable(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_pkeytable()
1785 static int __subn_get_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sl_to_sc() argument
1795 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sl_to_sc()
1796 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sl_to_sc()
1805 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sl_to_sc()
1808 static int __subn_set_opa_sl_to_sc(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sl_to_sc() argument
1819 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sl_to_sc()
1820 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sl_to_sc()
1833 return __subn_get_opa_sl_to_sc(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_sl_to_sc()
1837 static int __subn_get_opa_sc_to_sl(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sc_to_sl() argument
1847 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sc_to_sl()
1848 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_sl()
1857 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_sl()
1860 static int __subn_set_opa_sc_to_sl(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sc_to_sl() argument
1870 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_sl()
1871 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_sl()
1877 return __subn_get_opa_sc_to_sl(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_sc_to_sl()
1881 static int __subn_get_opa_sc_to_vlt(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sc_to_vlt() argument
1891 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sc_to_vlt()
1892 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlt()
1900 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlt()
1903 static int __subn_set_opa_sc_to_vlt(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sc_to_vlt() argument
1922 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlt()
1923 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlt()
1935 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlt()
1936 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlt()
1941 return __subn_get_opa_sc_to_vlt(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_sc_to_vlt()
1945 static int __subn_get_opa_sc_to_vlnt(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_sc_to_vlnt() argument
1956 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_sc_to_vlnt()
1957 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlnt()
1967 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_sc_to_vlnt()
1970 static int __subn_set_opa_sc_to_vlnt(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_sc_to_vlnt() argument
1982 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlnt()
1983 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlnt()
1990 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_sc_to_vlnt()
1991 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_sc_to_vlnt()
1998 return __subn_get_opa_sc_to_vlnt(smp, am, data, ibdev, port, in __subn_set_opa_sc_to_vlnt()
2002 static int __subn_get_opa_psi(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_psi() argument
2014 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_psi()
2015 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_psi()
2041 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_psi()
2044 static int __subn_set_opa_psi(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_psi() argument
2058 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_psi()
2059 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_psi()
2077 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_psi()
2083 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_psi()
2088 return __subn_get_opa_psi(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_psi()
2092 static int __subn_get_opa_cable_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_cable_info() argument
2103 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cable_info()
2104 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2117 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cable_info()
2118 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2124 smp->status |= IB_SMP_UNSUP_METH_ATTR; in __subn_get_opa_cable_info()
2125 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2134 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cable_info()
2135 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2141 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cable_info()
2144 static int __subn_get_opa_bct(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_bct() argument
2155 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_bct()
2156 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_bct()
2165 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_bct()
2168 static int __subn_set_opa_bct(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_bct() argument
2178 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_bct()
2179 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_bct()
2184 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_bct()
2185 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_bct()
2188 return __subn_get_opa_bct(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_bct()
2192 static int __subn_get_opa_vl_arb(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_vl_arb() argument
2203 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_vl_arb()
2204 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_vl_arb()
2222 be32_to_cpu(smp->attr_mod)); in __subn_get_opa_vl_arb()
2223 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_vl_arb()
2231 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_vl_arb()
2234 static int __subn_set_opa_vl_arb(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_vl_arb() argument
2245 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_vl_arb()
2246 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_vl_arb()
2262 smp->status |= IB_SMP_UNSUP_METH_ATTR; in __subn_set_opa_vl_arb()
2266 be32_to_cpu(smp->attr_mod)); in __subn_set_opa_vl_arb()
2267 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_vl_arb()
2271 return __subn_get_opa_vl_arb(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_vl_arb()
3662 static int __subn_get_opa_cong_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_cong_info() argument
3672 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cong_info()
3673 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_info()
3683 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_info()
3686 static int __subn_get_opa_cong_setting(struct opa_smp *smp, u32 am, in __subn_get_opa_cong_setting() argument
3699 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cong_setting()
3700 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_setting()
3709 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_setting()
3728 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cong_setting()
3779 static int __subn_set_opa_cong_setting(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_cong_setting() argument
3791 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_cong_setting()
3792 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_cong_setting()
3815 return __subn_get_opa_cong_setting(smp, am, data, ibdev, port, in __subn_set_opa_cong_setting()
3819 static int __subn_get_opa_hfi1_cong_log(struct opa_smp *smp, u32 am, in __subn_get_opa_hfi1_cong_log() argument
3830 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_hfi1_cong_log()
3831 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_hfi1_cong_log()
3882 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_hfi1_cong_log()
3885 static int __subn_get_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_cc_table() argument
3904 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_cc_table()
3905 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cc_table()
3914 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cc_table()
3934 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_cc_table()
3937 static int __subn_set_opa_cc_table(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_cc_table() argument
3955 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_cc_table()
3956 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_cc_table()
3966 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_cc_table()
3967 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_cc_table()
3984 return __subn_get_opa_cc_table(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_cc_table()
3996 static int __subn_get_opa_led_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_get_opa_led_info() argument
4007 smp->status |= IB_SMP_INVALID_FIELD; in __subn_get_opa_led_info()
4008 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_led_info()
4023 return reply((struct ib_mad_hdr *)smp); in __subn_get_opa_led_info()
4026 static int __subn_set_opa_led_info(struct opa_smp *smp, u32 am, u8 *data, in __subn_set_opa_led_info() argument
4036 smp->status |= IB_SMP_INVALID_FIELD; in __subn_set_opa_led_info()
4037 return reply((struct ib_mad_hdr *)smp); in __subn_set_opa_led_info()
4045 return __subn_get_opa_led_info(smp, am, data, ibdev, port, resp_len, in __subn_set_opa_led_info()
4049 static int subn_get_opa_sma(__be16 attr_id, struct opa_smp *smp, u32 am, in subn_get_opa_sma() argument
4058 ret = __subn_get_opa_nodedesc(smp, am, data, ibdev, port, in subn_get_opa_sma()
4062 ret = __subn_get_opa_nodeinfo(smp, am, data, ibdev, port, in subn_get_opa_sma()
4066 ret = __subn_get_opa_portinfo(smp, am, data, ibdev, port, in subn_get_opa_sma()
4070 ret = __subn_get_opa_pkeytable(smp, am, data, ibdev, port, in subn_get_opa_sma()
4074 ret = __subn_get_opa_sl_to_sc(smp, am, data, ibdev, port, in subn_get_opa_sma()
4078 ret = __subn_get_opa_sc_to_sl(smp, am, data, ibdev, port, in subn_get_opa_sma()
4082 ret = __subn_get_opa_sc_to_vlt(smp, am, data, ibdev, port, in subn_get_opa_sma()
4086 ret = __subn_get_opa_sc_to_vlnt(smp, am, data, ibdev, port, in subn_get_opa_sma()
4090 ret = __subn_get_opa_psi(smp, am, data, ibdev, port, in subn_get_opa_sma()
4094 ret = __subn_get_opa_bct(smp, am, data, ibdev, port, in subn_get_opa_sma()
4098 ret = __subn_get_opa_cable_info(smp, am, data, ibdev, port, in subn_get_opa_sma()
4102 ret = __subn_get_opa_vl_arb(smp, am, data, ibdev, port, in subn_get_opa_sma()
4106 ret = __subn_get_opa_cong_info(smp, am, data, ibdev, port, in subn_get_opa_sma()
4110 ret = __subn_get_opa_cong_setting(smp, am, data, ibdev, in subn_get_opa_sma()
4114 ret = __subn_get_opa_hfi1_cong_log(smp, am, data, ibdev, in subn_get_opa_sma()
4118 ret = __subn_get_opa_cc_table(smp, am, data, ibdev, port, in subn_get_opa_sma()
4122 ret = __subn_get_opa_led_info(smp, am, data, ibdev, port, in subn_get_opa_sma()
4132 smp->status |= IB_SMP_UNSUP_METH_ATTR; in subn_get_opa_sma()
4133 ret = reply((struct ib_mad_hdr *)smp); in subn_get_opa_sma()
4139 static int subn_set_opa_sma(__be16 attr_id, struct opa_smp *smp, u32 am, in subn_set_opa_sma() argument
4148 ret = __subn_set_opa_portinfo(smp, am, data, ibdev, port, in subn_set_opa_sma()
4152 ret = __subn_set_opa_pkeytable(smp, am, data, ibdev, port, in subn_set_opa_sma()
4156 ret = __subn_set_opa_sl_to_sc(smp, am, data, ibdev, port, in subn_set_opa_sma()
4160 ret = __subn_set_opa_sc_to_sl(smp, am, data, ibdev, port, in subn_set_opa_sma()
4164 ret = __subn_set_opa_sc_to_vlt(smp, am, data, ibdev, port, in subn_set_opa_sma()
4168 ret = __subn_set_opa_sc_to_vlnt(smp, am, data, ibdev, port, in subn_set_opa_sma()
4172 ret = __subn_set_opa_psi(smp, am, data, ibdev, port, in subn_set_opa_sma()
4176 ret = __subn_set_opa_bct(smp, am, data, ibdev, port, in subn_set_opa_sma()
4180 ret = __subn_set_opa_vl_arb(smp, am, data, ibdev, port, in subn_set_opa_sma()
4184 ret = __subn_set_opa_cong_setting(smp, am, data, ibdev, in subn_set_opa_sma()
4188 ret = __subn_set_opa_cc_table(smp, am, data, ibdev, port, in subn_set_opa_sma()
4192 ret = __subn_set_opa_led_info(smp, am, data, ibdev, port, in subn_set_opa_sma()
4202 smp->status |= IB_SMP_UNSUP_METH_ATTR; in subn_set_opa_sma()
4203 ret = reply((struct ib_mad_hdr *)smp); in subn_set_opa_sma()
4214 static int subn_get_opa_aggregate(struct opa_smp *smp, in subn_get_opa_aggregate() argument
4219 u32 num_attr = be32_to_cpu(smp->attr_mod) & 0x000000ff; in subn_get_opa_aggregate()
4220 u8 *next_smp = opa_get_smp_data(smp); in subn_get_opa_aggregate()
4223 smp->status |= IB_SMP_INVALID_FIELD; in subn_get_opa_aggregate()
4224 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4240 if (next_smp + agg_size > ((u8 *)smp) + sizeof(*smp)) { in subn_get_opa_aggregate()
4241 smp->status |= IB_SMP_INVALID_FIELD; in subn_get_opa_aggregate()
4242 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4248 (void)subn_get_opa_sma(agg->attr_id, smp, am, agg->data, in subn_get_opa_aggregate()
4251 if (smp->status & IB_SMP_INVALID_FIELD) in subn_get_opa_aggregate()
4253 if (smp->status & ~IB_SMP_DIRECTION) { in subn_get_opa_aggregate()
4255 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4260 return reply((struct ib_mad_hdr *)smp); in subn_get_opa_aggregate()
4263 static int subn_set_opa_aggregate(struct opa_smp *smp, in subn_set_opa_aggregate() argument
4268 u32 num_attr = be32_to_cpu(smp->attr_mod) & 0x000000ff; in subn_set_opa_aggregate()
4269 u8 *next_smp = opa_get_smp_data(smp); in subn_set_opa_aggregate()
4272 smp->status |= IB_SMP_INVALID_FIELD; in subn_set_opa_aggregate()
4273 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4289 if (next_smp + agg_size > ((u8 *)smp) + sizeof(*smp)) { in subn_set_opa_aggregate()
4290 smp->status |= IB_SMP_INVALID_FIELD; in subn_set_opa_aggregate()
4291 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4294 (void)subn_set_opa_sma(agg->attr_id, smp, am, agg->data, in subn_set_opa_aggregate()
4298 if (smp->status & IB_SMP_INVALID_FIELD) in subn_set_opa_aggregate()
4300 if (smp->status & ~IB_SMP_DIRECTION) { in subn_set_opa_aggregate()
4302 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4307 return reply((struct ib_mad_hdr *)smp); in subn_set_opa_aggregate()
4357 const struct opa_smp *smp = (const struct opa_smp *)mad; in is_local_mad() local
4359 if (smp->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) { in is_local_mad()
4360 return (smp->hop_cnt == 0 && in is_local_mad()
4361 smp->route.dr.dr_slid == OPA_LID_PERMISSIVE && in is_local_mad()
4362 smp->route.dr.dr_dlid == OPA_LID_PERMISSIVE); in is_local_mad()
4474 struct opa_smp *smp = (struct opa_smp *)out_mad; in process_subn_opa() local
4482 data = opa_get_smp_data(smp); in process_subn_opa()
4483 data_size = (u32)opa_get_smp_data_size(smp); in process_subn_opa()
4485 am = be32_to_cpu(smp->attr_mod); in process_subn_opa()
4486 attr_id = smp->attr_id; in process_subn_opa()
4487 if (smp->class_version != OPA_SM_CLASS_VERSION) { in process_subn_opa()
4488 smp->status |= IB_SMP_UNSUP_VERSION; in process_subn_opa()
4489 ret = reply((struct ib_mad_hdr *)smp); in process_subn_opa()
4492 ret = check_mkey(ibp, (struct ib_mad_hdr *)smp, mad_flags, smp->mkey, in process_subn_opa()
4493 smp->route.dr.dr_slid, smp->route.dr.return_path, in process_subn_opa()
4494 smp->hop_cnt); in process_subn_opa()
4496 u32 port_num = be32_to_cpu(smp->attr_mod); in process_subn_opa()
4506 (smp->method == IB_MGMT_METHOD_GET || in process_subn_opa()
4507 smp->method == IB_MGMT_METHOD_SET) && in process_subn_opa()
4511 (struct ib_mad_hdr *)smp, 0, in process_subn_opa()
4512 smp->mkey, smp->route.dr.dr_slid, in process_subn_opa()
4513 smp->route.dr.return_path, in process_subn_opa()
4514 smp->hop_cnt); in process_subn_opa()
4519 *resp_len = opa_get_smp_header_size(smp); in process_subn_opa()
4521 switch (smp->method) { in process_subn_opa()
4525 clear_opa_smp_data(smp); in process_subn_opa()
4526 ret = subn_get_opa_sma(attr_id, smp, am, data, in process_subn_opa()
4531 ret = subn_get_opa_aggregate(smp, ibdev, port, in process_subn_opa()
4539 ret = subn_set_opa_sma(attr_id, smp, am, data, in process_subn_opa()
4544 ret = subn_set_opa_aggregate(smp, ibdev, port, in process_subn_opa()
4561 subn_handle_opa_trap_repress(ibp, smp); in process_subn_opa()
4566 smp->status |= IB_SMP_UNSUP_METHOD; in process_subn_opa()
4567 ret = reply((struct ib_mad_hdr *)smp); in process_subn_opa()
4578 struct ib_smp *smp = (struct ib_smp *)out_mad; in process_subn() local
4583 if (smp->class_version != 1) { in process_subn()
4584 smp->status |= IB_SMP_UNSUP_VERSION; in process_subn()
4585 ret = reply((struct ib_mad_hdr *)smp); in process_subn()
4589 ret = check_mkey(ibp, (struct ib_mad_hdr *)smp, mad_flags, in process_subn()
4590 smp->mkey, (__force __be32)smp->dr_slid, in process_subn()
4591 smp->return_path, smp->hop_cnt); in process_subn()
4593 u32 port_num = be32_to_cpu(smp->attr_mod); in process_subn()
4603 (smp->method == IB_MGMT_METHOD_GET || in process_subn()
4604 smp->method == IB_MGMT_METHOD_SET) && in process_subn()
4608 (struct ib_mad_hdr *)smp, 0, in process_subn()
4609 smp->mkey, in process_subn()
4610 (__force __be32)smp->dr_slid, in process_subn()
4611 smp->return_path, smp->hop_cnt); in process_subn()
4616 switch (smp->method) { in process_subn()
4618 switch (smp->attr_id) { in process_subn()
4620 ret = subn_get_nodeinfo(smp, ibdev, port); in process_subn()
4623 smp->status |= IB_SMP_UNSUP_METH_ATTR; in process_subn()
4624 ret = reply((struct ib_mad_hdr *)smp); in process_subn()