mad               221 drivers/ata/sata_inic162x.c 	__le32		mad;		/* Physical Memory Address */
mad               471 drivers/ata/sata_inic162x.c 		prd->mad = cpu_to_le32(sg_dma_address(sg));
mad               527 drivers/ata/sata_inic162x.c 		prd->mad = cpu_to_le32(pp->pkt_dma +
mad               122 drivers/infiniband/core/agent.c 	memcpy(send_buf->mad, mad_hdr, resp_mad_len);
mad              1462 drivers/infiniband/core/cm.c 	req_msg = (struct cm_req_msg *) cm_id_priv->msg->mad;
mad              1503 drivers/infiniband/core/cm.c 	rcv_msg = (struct cm_rej_msg *) mad_recv_wc->recv_buf.mad;
mad              1504 drivers/infiniband/core/cm.c 	rej_msg = (struct cm_rej_msg *) msg->mad;
mad              1684 drivers/infiniband/core/cm.c 	req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
mad              1817 drivers/infiniband/core/cm.c 		cm_format_mra((struct cm_mra_msg *) msg->mad, cm_id_priv,
mad              1823 drivers/infiniband/core/cm.c 		cm_format_rej((struct cm_rej_msg *) msg->mad, cm_id_priv,
mad              1848 drivers/infiniband/core/cm.c 	req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
mad              1940 drivers/infiniband/core/cm.c 	req_msg = (struct cm_req_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2117 drivers/infiniband/core/cm.c 	rep_msg = (struct cm_rep_msg *) msg->mad;
mad              2185 drivers/infiniband/core/cm.c 	cm_format_rtu((struct cm_rtu_msg *) msg->mad, cm_id_priv,
mad              2212 drivers/infiniband/core/cm.c 	rep_msg = (struct cm_rep_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2235 drivers/infiniband/core/cm.c 	rep_msg = (struct cm_rep_msg *) work->mad_recv_wc->recv_buf.mad;
mad              2249 drivers/infiniband/core/cm.c 		cm_format_rtu((struct cm_rtu_msg *) msg->mad, cm_id_priv,
mad              2253 drivers/infiniband/core/cm.c 		cm_format_mra((struct cm_mra_msg *) msg->mad, cm_id_priv,
mad              2280 drivers/infiniband/core/cm.c 	rep_msg = (struct cm_rep_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2421 drivers/infiniband/core/cm.c 	rtu_msg = (struct cm_rtu_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2501 drivers/infiniband/core/cm.c 	cm_format_dreq((struct cm_dreq_msg *) msg->mad, cm_id_priv,
mad              2568 drivers/infiniband/core/cm.c 	cm_format_drep((struct cm_drep_msg *) msg->mad, cm_id_priv,
mad              2595 drivers/infiniband/core/cm.c 	dreq_msg = (struct cm_dreq_msg *) mad_recv_wc->recv_buf.mad;
mad              2596 drivers/infiniband/core/cm.c 	drep_msg = (struct cm_drep_msg *) msg->mad;
mad              2616 drivers/infiniband/core/cm.c 	dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2654 drivers/infiniband/core/cm.c 		cm_format_drep((struct cm_drep_msg *) msg->mad, cm_id_priv,
mad              2697 drivers/infiniband/core/cm.c 	drep_msg = (struct cm_drep_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2757 drivers/infiniband/core/cm.c 			cm_format_rej((struct cm_rej_msg *) msg->mad,
mad              2767 drivers/infiniband/core/cm.c 			cm_format_rej((struct cm_rej_msg *) msg->mad,
mad              2797 drivers/infiniband/core/cm.c 	rej_msg = (struct cm_rej_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2844 drivers/infiniband/core/cm.c 	rej_msg = (struct cm_rej_msg *)work->mad_recv_wc->recv_buf.mad;
mad              2963 drivers/infiniband/core/cm.c 		cm_format_mra((struct cm_mra_msg *) msg->mad, cm_id_priv,
mad              3009 drivers/infiniband/core/cm.c 	mra_msg = (struct cm_mra_msg *)work->mad_recv_wc->recv_buf.mad;
mad              3157 drivers/infiniband/core/cm.c 	cm_format_lap((struct cm_lap_msg *) msg->mad, cm_id_priv,
mad              3232 drivers/infiniband/core/cm.c 	lap_msg = (struct cm_lap_msg *)work->mad_recv_wc->recv_buf.mad;
mad              3263 drivers/infiniband/core/cm.c 		cm_format_mra((struct cm_mra_msg *) msg->mad, cm_id_priv,
mad              3362 drivers/infiniband/core/cm.c 	cm_format_apr((struct cm_apr_msg *) msg->mad, cm_id_priv, status,
mad              3390 drivers/infiniband/core/cm.c 	apr_msg = (struct cm_apr_msg *)work->mad_recv_wc->recv_buf.mad;
mad              3507 drivers/infiniband/core/cm.c 	cm_format_sidr_req((struct cm_sidr_req_msg *) msg->mad, cm_id_priv,
mad              3539 drivers/infiniband/core/cm.c 				work->mad_recv_wc->recv_buf.mad;
mad              3565 drivers/infiniband/core/cm.c 				work->mad_recv_wc->recv_buf.mad;
mad              3657 drivers/infiniband/core/cm.c 	cm_format_sidr_rep((struct cm_sidr_rep_msg *) msg->mad, cm_id_priv,
mad              3688 drivers/infiniband/core/cm.c 				work->mad_recv_wc->recv_buf.mad;
mad              3705 drivers/infiniband/core/cm.c 				work->mad_recv_wc->recv_buf.mad;
mad              3791 drivers/infiniband/core/cm.c 				  msg->mad)->attr_id) - CM_ATTR_ID_OFFSET;
mad              4001 drivers/infiniband/core/cm.c 	switch (mad_recv_wc->recv_buf.mad->mad_hdr.attr_id) {
mad              4004 drivers/infiniband/core/cm.c 						mad_recv_wc->recv_buf.mad);
mad              4044 drivers/infiniband/core/cm.c 	attr_id = be16_to_cpu(mad_recv_wc->recv_buf.mad->mad_hdr.attr_id);
mad               102 drivers/infiniband/core/mad.c 					const struct ib_mad_hdr *mad);
mad               104 drivers/infiniband/core/mad.c 				    struct ib_mad_private *mad);
mad               812 drivers/infiniband/core/mad.c 	struct ib_smp *smp = mad_send_wr->send_buf.mad;
mad               917 drivers/infiniband/core/mad.c 				      (struct ib_mad_hdr *)mad_priv->mad,
mad               922 drivers/infiniband/core/mad.c 		if (ib_response_mad((const struct ib_mad_hdr *)mad_priv->mad) &&
mad               942 drivers/infiniband/core/mad.c 			memcpy(mad_priv->mad, smp, mad_priv->mad_size);
mad               944 drivers/infiniband/core/mad.c 						        (const struct ib_mad_hdr *)mad_priv->mad);
mad              1008 drivers/infiniband/core/mad.c 	struct ib_rmpp_mad *rmpp_mad = send_buf->mad;
mad              1090 drivers/infiniband/core/mad.c 	mad_send_wr->send_buf.mad = buf;
mad              1190 drivers/infiniband/core/mad.c 		return mad_send_wr->send_buf.mad +
mad              1205 drivers/infiniband/core/mad.c 	kfree(send_buf->mad);
mad              1228 drivers/infiniband/core/mad.c 					mad_send_wr->send_buf.mad,
mad              1307 drivers/infiniband/core/mad.c 		if (!ib_is_mad_class_rmpp(((struct ib_mad_hdr *) send_buf->mad)->mgmt_class)) {
mad              1322 drivers/infiniband/core/mad.c 		if (((struct ib_mad_hdr *) send_buf->mad)->mgmt_class ==
mad              1332 drivers/infiniband/core/mad.c 		mad_send_wr->tid = ((struct ib_mad_hdr *) send_buf->mad)->tid;
mad              1904 drivers/infiniband/core/mad.c 	return ((struct ib_mad_hdr *)(wr->send_buf.mad))->mgmt_class ==
mad              1905 drivers/infiniband/core/mad.c 		rwc->recv_buf.mad->mad_hdr.mgmt_class;
mad              1920 drivers/infiniband/core/mad.c 	send_resp = ib_response_mad((struct ib_mad_hdr *)wr->send_buf.mad);
mad              1921 drivers/infiniband/core/mad.c 	rcv_resp = ib_response_mad(&rwc->recv_buf.mad->mad_hdr);
mad              1976 drivers/infiniband/core/mad.c 	mad_hdr = &wc->recv_buf.mad->mad_hdr;
mad              1995 drivers/infiniband/core/mad.c 		if (is_rmpp_data_mad(mad_agent_priv, wr->send_buf.mad) &&
mad              2047 drivers/infiniband/core/mad.c 	if (ib_response_mad(&mad_recv_wc->recv_buf.mad->mad_hdr)) {
mad              2053 drivers/infiniband/core/mad.c 			   && ib_is_mad_class_rmpp(mad_recv_wc->recv_buf.mad->mad_hdr.mgmt_class)
mad              2054 drivers/infiniband/core/mad.c 			   && (ib_get_rmpp_flags(&((struct ib_rmpp_mad *)mad_recv_wc->recv_buf.mad)->rmpp_hdr)
mad              2103 drivers/infiniband/core/mad.c 	struct ib_smp *smp = (struct ib_smp *)recv->mad;
mad              2130 drivers/infiniband/core/mad.c 		response->header.recv_wc.recv_buf.mad = (struct ib_mad *)response->mad;
mad              2133 drivers/infiniband/core/mad.c 		agent_send_response((const struct ib_mad_hdr *)response->mad,
mad              2150 drivers/infiniband/core/mad.c 	const struct ib_mad_hdr *recv_hdr = (const struct ib_mad_hdr *)recv->mad;
mad              2151 drivers/infiniband/core/mad.c 	struct ib_mad_hdr *resp_hdr = (struct ib_mad_hdr *)response->mad;
mad              2157 drivers/infiniband/core/mad.c 		response->header.recv_wc.recv_buf.mad = (struct ib_mad *)response->mad;
mad              2170 drivers/infiniband/core/mad.c 							(struct opa_smp *)recv->mad);
mad              2190 drivers/infiniband/core/mad.c 	struct opa_smp *smp = (struct opa_smp *)recv->mad;
mad              2220 drivers/infiniband/core/mad.c 				(struct opa_mad *)response->mad;
mad              2223 drivers/infiniband/core/mad.c 		agent_send_response((const struct ib_mad_hdr *)response->mad,
mad              2246 drivers/infiniband/core/mad.c 	struct ib_mad_hdr *mad_hdr = (struct ib_mad_hdr *)recv->mad;
mad              2300 drivers/infiniband/core/mad.c 	if (opa && ((struct ib_mad_hdr *)(recv->mad))->base_version == OPA_MGMT_BASE_VERSION) {
mad              2308 drivers/infiniband/core/mad.c 	recv->header.recv_wc.recv_buf.mad = (struct ib_mad *)recv->mad;
mad              2315 drivers/infiniband/core/mad.c 	if (!validate_mad((const struct ib_mad_hdr *)recv->mad, qp_info, opa))
mad              2319 drivers/infiniband/core/mad.c 				       (struct ib_mad_hdr *)recv->mad);
mad              2331 drivers/infiniband/core/mad.c 	if (((struct ib_mad_hdr *)recv->mad)->mgmt_class ==
mad              2343 drivers/infiniband/core/mad.c 			&recv->grh, (const struct ib_mad_hdr *)recv->mad,
mad              2344 drivers/infiniband/core/mad.c 			recv->mad_size, (struct ib_mad_hdr *)response->mad,
mad              2354 drivers/infiniband/core/mad.c 				agent_send_response((const struct ib_mad_hdr *)response->mad,
mad              2365 drivers/infiniband/core/mad.c 	mad_agent = find_mad_agent(port_priv, (const struct ib_mad_hdr *)recv->mad);
mad              2376 drivers/infiniband/core/mad.c 		agent_send_response((const struct ib_mad_hdr *)response->mad, &recv->grh, wc,
mad              2694 drivers/infiniband/core/mad.c 				     mad_send_wr->send_buf.mad) &&
mad              2789 drivers/infiniband/core/mad.c 			base_version = ((struct ib_mad_hdr *)(local->mad_priv->mad))->base_version;
mad              2802 drivers/infiniband/core/mad.c 			local->mad_priv->header.recv_wc.recv_buf.mad =
mad              2803 drivers/infiniband/core/mad.c 						(struct ib_mad *)local->mad_priv->mad;
mad              2926 drivers/infiniband/core/mad.c 				    struct ib_mad_private *mad)
mad              2945 drivers/infiniband/core/mad.c 		if (mad) {
mad              2946 drivers/infiniband/core/mad.c 			mad_priv = mad;
mad              2947 drivers/infiniband/core/mad.c 			mad = NULL;
mad                82 drivers/infiniband/core/mad_priv.h 	u8 mad[0];
mad               119 drivers/infiniband/core/mad_rmpp.c 	struct ib_rmpp_mad *ack = msg->mad;
mad               141 drivers/infiniband/core/mad_rmpp.c 	hdr_len = ib_get_mad_data_offset(recv_wc->recv_buf.mad->mad_hdr.mgmt_class);
mad               149 drivers/infiniband/core/mad_rmpp.c 	format_ack(msg, (struct ib_rmpp_mad *) recv_wc->recv_buf.mad, rmpp_recv);
mad               168 drivers/infiniband/core/mad_rmpp.c 	hdr_len = ib_get_mad_data_offset(recv_wc->recv_buf.mad->mad_hdr.mgmt_class);
mad               194 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = msg->mad;
mad               195 drivers/infiniband/core/mad_rmpp.c 	memcpy(rmpp_mad, recv_wc->recv_buf.mad, msg->hdr_len);
mad               228 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = msg->mad;
mad               229 drivers/infiniband/core/mad_rmpp.c 	memcpy(rmpp_mad, recv_wc->recv_buf.mad, msg->hdr_len);
mad               317 drivers/infiniband/core/mad_rmpp.c 	mad_hdr = &mad_recv_wc->recv_buf.mad->mad_hdr;
mad               336 drivers/infiniband/core/mad_rmpp.c 	struct ib_mad_hdr *mad_hdr = &mad_recv_wc->recv_buf.mad->mad_hdr;
mad               382 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = (struct ib_rmpp_mad *) seg->mad;
mad               390 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = (struct ib_rmpp_mad *) seg->mad;
mad               443 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = (struct ib_rmpp_mad *)rmpp_recv->cur_seg_buf->mad;
mad               582 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = mad_send_wr->send_buf.mad;
mad               665 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = (struct ib_rmpp_mad *)mad_recv_wc->recv_buf.mad;
mad               758 drivers/infiniband/core/mad_rmpp.c 	rmpp_hdr = &((struct ib_rmpp_mad *)mad_recv_wc->recv_buf.mad)->rmpp_hdr;
mad               789 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = (struct ib_rmpp_mad *)mad_recv_wc->recv_buf.mad;
mad               803 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = (struct ib_rmpp_mad *)mad_recv_wc->recv_buf.mad;
mad               819 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = (struct ib_rmpp_mad *)mad_recv_wc->recv_buf.mad;
mad               854 drivers/infiniband/core/mad_rmpp.c 	struct ib_mad_hdr *mad_hdr = mad_send_wr->send_buf.mad;
mad               889 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = mad_send_wr->send_buf.mad;
mad               915 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = mad_send_wr->send_buf.mad;
mad               953 drivers/infiniband/core/mad_rmpp.c 	rmpp_mad = mad_send_wr->send_buf.mad;
mad               753 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad = query->mad_buf->mad;
mad               754 drivers/infiniband/core/sa_query.c 	ib_sa_comp_mask comp_mask = mad->sa_hdr.comp_mask;
mad               837 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad;
mad               840 drivers/infiniband/core/sa_query.c 	mad = query->mad_buf->mad;
mad               841 drivers/infiniband/core/sa_query.c 	len = ib_nl_get_path_rec_attrs_len(mad->sa_hdr.comp_mask);
mad               927 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad = NULL;
mad               957 drivers/infiniband/core/sa_query.c 					mad = query->mad_buf->mad;
mad               958 drivers/infiniband/core/sa_query.c 					mad->mad_hdr.method |=
mad               960 drivers/infiniband/core/sa_query.c 					memcpy(mad->data, rec->path_rec,
mad               967 drivers/infiniband/core/sa_query.c 		query->callback(query, status, mad);
mad              1343 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad = query->mad_buf->mad;
mad              1346 drivers/infiniband/core/sa_query.c 	memset(mad, 0, sizeof *mad);
mad              1349 drivers/infiniband/core/sa_query.c 		mad->mad_hdr.base_version  = OPA_MGMT_BASE_VERSION;
mad              1350 drivers/infiniband/core/sa_query.c 		mad->mad_hdr.class_version = OPA_SA_CLASS_VERSION;
mad              1352 drivers/infiniband/core/sa_query.c 		mad->mad_hdr.base_version  = IB_MGMT_BASE_VERSION;
mad              1353 drivers/infiniband/core/sa_query.c 		mad->mad_hdr.class_version = IB_SA_CLASS_VERSION;
mad              1355 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.mgmt_class    = IB_MGMT_CLASS_SUBN_ADM;
mad              1357 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.tid           =
mad              1473 drivers/infiniband/core/sa_query.c 				    struct ib_sa_mad *mad)
mad              1478 drivers/infiniband/core/sa_query.c 	if (mad) {
mad              1484 drivers/infiniband/core/sa_query.c 				  mad->data, &rec);
mad              1490 drivers/infiniband/core/sa_query.c 				  mad->data, &rec);
mad              1557 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad;
mad              1602 drivers/infiniband/core/sa_query.c 	mad = query->sa_query.mad_buf->mad;
mad              1607 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.method	 = IB_MGMT_METHOD_GET;
mad              1608 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.attr_id	 = cpu_to_be16(IB_SA_ATTR_PATH_REC);
mad              1609 drivers/infiniband/core/sa_query.c 	mad->sa_hdr.comp_mask	 = comp_mask;
mad              1613 drivers/infiniband/core/sa_query.c 			rec, mad->data);
mad              1617 drivers/infiniband/core/sa_query.c 			query->conv_pr, mad->data);
mad              1620 drivers/infiniband/core/sa_query.c 			rec, mad->data);
mad              1649 drivers/infiniband/core/sa_query.c 				    struct ib_sa_mad *mad)
mad              1654 drivers/infiniband/core/sa_query.c 	if (mad) {
mad              1658 drivers/infiniband/core/sa_query.c 			  mad->data, &rec);
mad              1711 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad;
mad              1739 drivers/infiniband/core/sa_query.c 	mad = query->sa_query.mad_buf->mad;
mad              1744 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.method	 = method;
mad              1745 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.attr_id	 = cpu_to_be16(IB_SA_ATTR_SERVICE_REC);
mad              1746 drivers/infiniband/core/sa_query.c 	mad->sa_hdr.comp_mask	 = comp_mask;
mad              1749 drivers/infiniband/core/sa_query.c 		rec, mad->data);
mad              1772 drivers/infiniband/core/sa_query.c 					struct ib_sa_mad *mad)
mad              1777 drivers/infiniband/core/sa_query.c 	if (mad) {
mad              1781 drivers/infiniband/core/sa_query.c 			  mad->data, &rec);
mad              1808 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad;
mad              1831 drivers/infiniband/core/sa_query.c 	mad = query->sa_query.mad_buf->mad;
mad              1836 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.method	 = method;
mad              1837 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.attr_id	 = cpu_to_be16(IB_SA_ATTR_MC_MEMBER_REC);
mad              1838 drivers/infiniband/core/sa_query.c 	mad->sa_hdr.comp_mask	 = comp_mask;
mad              1841 drivers/infiniband/core/sa_query.c 		rec, mad->data);
mad              1864 drivers/infiniband/core/sa_query.c 					struct ib_sa_mad *mad)
mad              1869 drivers/infiniband/core/sa_query.c 	if (mad) {
mad              1873 drivers/infiniband/core/sa_query.c 			  mad->data, &rec);
mad              1899 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad;
mad              1928 drivers/infiniband/core/sa_query.c 	mad = query->sa_query.mad_buf->mad;
mad              1934 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.method	 = method;
mad              1935 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.attr_id	 = cpu_to_be16(IB_SA_ATTR_GUID_INFO_REC);
mad              1936 drivers/infiniband/core/sa_query.c 	mad->sa_hdr.comp_mask	 = comp_mask;
mad              1939 drivers/infiniband/core/sa_query.c 		mad->data);
mad              1998 drivers/infiniband/core/sa_query.c 					      struct ib_sa_mad *mad)
mad              2005 drivers/infiniband/core/sa_query.c 	if (mad) {
mad              2011 drivers/infiniband/core/sa_query.c 				  mad->data, &rec);
mad              2030 drivers/infiniband/core/sa_query.c 				  mad->data, &rec);
mad              2062 drivers/infiniband/core/sa_query.c 	struct ib_sa_mad *mad;
mad              2083 drivers/infiniband/core/sa_query.c 	mad = query->sa_query.mad_buf->mad;
mad              2088 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.method	 = IB_MGMT_METHOD_GET;
mad              2089 drivers/infiniband/core/sa_query.c 	mad->mad_hdr.attr_id	 = cpu_to_be16(IB_SA_ATTR_CLASS_PORTINFO);
mad              2090 drivers/infiniband/core/sa_query.c 	mad->sa_hdr.comp_mask	 = 0;
mad              2206 drivers/infiniband/core/sa_query.c 					mad_recv_wc->recv_buf.mad->mad_hdr.status ?
mad              2208 drivers/infiniband/core/sa_query.c 					(struct ib_sa_mad *) mad_recv_wc->recv_buf.mad);
mad               131 drivers/infiniband/core/user_mad.c 	struct ib_user_mad mad;
mad               186 drivers/infiniband/core/user_mad.c 	for (packet->mad.hdr.id = 0;
mad               187 drivers/infiniband/core/user_mad.c 	     packet->mad.hdr.id < IB_UMAD_MAX_AGENTS;
mad               188 drivers/infiniband/core/user_mad.c 	     packet->mad.hdr.id++)
mad               189 drivers/infiniband/core/user_mad.c 		if (agent == __get_agent(file, packet->mad.hdr.id)) {
mad               221 drivers/infiniband/core/user_mad.c 		packet->mad.hdr.status = ETIMEDOUT;
mad               245 drivers/infiniband/core/user_mad.c 	packet->mad.hdr.status	   = 0;
mad               246 drivers/infiniband/core/user_mad.c 	packet->mad.hdr.length	   = hdr_size(file) + mad_recv_wc->mad_len;
mad               247 drivers/infiniband/core/user_mad.c 	packet->mad.hdr.qpn	   = cpu_to_be32(mad_recv_wc->wc->src_qp);
mad               253 drivers/infiniband/core/user_mad.c 		packet->mad.hdr.lid = ib_lid_be16(0xFFFF &
mad               256 drivers/infiniband/core/user_mad.c 		packet->mad.hdr.lid = ib_lid_be16(mad_recv_wc->wc->slid);
mad               257 drivers/infiniband/core/user_mad.c 	packet->mad.hdr.sl	   = mad_recv_wc->wc->sl;
mad               258 drivers/infiniband/core/user_mad.c 	packet->mad.hdr.path_bits  = mad_recv_wc->wc->dlid_path_bits;
mad               259 drivers/infiniband/core/user_mad.c 	packet->mad.hdr.pkey_index = mad_recv_wc->wc->pkey_index;
mad               260 drivers/infiniband/core/user_mad.c 	packet->mad.hdr.grh_present = !!(mad_recv_wc->wc->wc_flags & IB_WC_GRH);
mad               261 drivers/infiniband/core/user_mad.c 	if (packet->mad.hdr.grh_present) {
mad               274 drivers/infiniband/core/user_mad.c 		packet->mad.hdr.gid_index = grh->sgid_index;
mad               275 drivers/infiniband/core/user_mad.c 		packet->mad.hdr.hop_limit = grh->hop_limit;
mad               276 drivers/infiniband/core/user_mad.c 		packet->mad.hdr.traffic_class = grh->traffic_class;
mad               277 drivers/infiniband/core/user_mad.c 		memcpy(packet->mad.hdr.gid, &grh->dgid, 16);
mad               278 drivers/infiniband/core/user_mad.c 		packet->mad.hdr.flow_label = cpu_to_be32(grh->flow_label);
mad               309 drivers/infiniband/core/user_mad.c 	if (copy_to_user(buf, &packet->mad, hdr_size(file)))
mad               314 drivers/infiniband/core/user_mad.c 	if (copy_to_user(buf, recv_buf->mad, seg_payload))
mad               329 drivers/infiniband/core/user_mad.c 		offset = ib_get_mad_data_offset(recv_buf->mad->mad_hdr.mgmt_class);
mad               337 drivers/infiniband/core/user_mad.c 			if (copy_to_user(buf, ((void *) recv_buf->mad) + offset,
mad               343 drivers/infiniband/core/user_mad.c 	trace_ib_umad_read_recv(file, &packet->mad.hdr, &recv_buf->mad->mad_hdr);
mad               356 drivers/infiniband/core/user_mad.c 	if (copy_to_user(buf, &packet->mad, hdr_size(file)))
mad               361 drivers/infiniband/core/user_mad.c 	if (copy_to_user(buf, packet->mad.data, packet->length))
mad               364 drivers/infiniband/core/user_mad.c 	trace_ib_umad_read_send(file, &packet->mad.hdr,
mad               365 drivers/infiniband/core/user_mad.c 				(struct ib_mad_hdr *)&packet->mad.data);
mad               424 drivers/infiniband/core/user_mad.c 	    copy_from_user(msg->mad + IB_MGMT_RMPP_HDR, buf + IB_MGMT_RMPP_HDR,
mad               456 drivers/infiniband/core/user_mad.c 	hdr = (struct ib_mad_hdr *) packet->mad.data;
mad               458 drivers/infiniband/core/user_mad.c 		sent_hdr = (struct ib_mad_hdr *) sent_packet->mad.data;
mad               476 drivers/infiniband/core/user_mad.c 		if (same_destination(&packet->mad.hdr, &sent_packet->mad.hdr))
mad               503 drivers/infiniband/core/user_mad.c 	if (copy_from_user(&packet->mad, buf, hdr_size(file))) {
mad               508 drivers/infiniband/core/user_mad.c 	if (packet->mad.hdr.id >= IB_UMAD_MAX_AGENTS) {
mad               515 drivers/infiniband/core/user_mad.c 	if (copy_from_user(packet->mad.data, buf, IB_MGMT_RMPP_HDR)) {
mad               522 drivers/infiniband/core/user_mad.c 	trace_ib_umad_write(file, &packet->mad.hdr,
mad               523 drivers/infiniband/core/user_mad.c 			    (struct ib_mad_hdr *)&packet->mad.data);
mad               525 drivers/infiniband/core/user_mad.c 	agent = __get_agent(file, packet->mad.hdr.id);
mad               534 drivers/infiniband/core/user_mad.c 	rdma_ah_set_dlid(&ah_attr, be16_to_cpu(packet->mad.hdr.lid));
mad               535 drivers/infiniband/core/user_mad.c 	rdma_ah_set_sl(&ah_attr, packet->mad.hdr.sl);
mad               536 drivers/infiniband/core/user_mad.c 	rdma_ah_set_path_bits(&ah_attr, packet->mad.hdr.path_bits);
mad               538 drivers/infiniband/core/user_mad.c 	if (packet->mad.hdr.grh_present) {
mad               540 drivers/infiniband/core/user_mad.c 				be32_to_cpu(packet->mad.hdr.flow_label),
mad               541 drivers/infiniband/core/user_mad.c 				packet->mad.hdr.gid_index,
mad               542 drivers/infiniband/core/user_mad.c 				packet->mad.hdr.hop_limit,
mad               543 drivers/infiniband/core/user_mad.c 				packet->mad.hdr.traffic_class);
mad               544 drivers/infiniband/core/user_mad.c 		rdma_ah_set_dgid_raw(&ah_attr, packet->mad.hdr.gid);
mad               553 drivers/infiniband/core/user_mad.c 	rmpp_mad = (struct ib_rmpp_mad *) packet->mad.data;
mad               566 drivers/infiniband/core/user_mad.c 	base_version = ((struct ib_mad_hdr *)&packet->mad.data)->base_version;
mad               569 drivers/infiniband/core/user_mad.c 					 be32_to_cpu(packet->mad.hdr.qpn),
mad               570 drivers/infiniband/core/user_mad.c 					 packet->mad.hdr.pkey_index, rmpp_active,
mad               579 drivers/infiniband/core/user_mad.c 	packet->msg->timeout_ms = packet->mad.hdr.timeout_ms;
mad               580 drivers/infiniband/core/user_mad.c 	packet->msg->retries	= packet->mad.hdr.retries;
mad               584 drivers/infiniband/core/user_mad.c 	memcpy(packet->msg->mad, packet->mad.data, IB_MGMT_MAD_HDR);
mad               587 drivers/infiniband/core/user_mad.c 		if (copy_from_user(packet->msg->mad + copy_offset,
mad               604 drivers/infiniband/core/user_mad.c 	if (!ib_response_mad(packet->msg->mad)) {
mad               605 drivers/infiniband/core/user_mad.c 		tid = &((struct ib_mad_hdr *) packet->msg->mad)->tid;
mad               352 drivers/infiniband/hw/hfi1/mad.c 	smp = send_buf->mad;
mad               480 drivers/infiniband/hw/hfi1/mad.c static void bad_mkey(struct hfi1_ibport *ibp, struct ib_mad_hdr *mad,
mad               493 drivers/infiniband/hw/hfi1/mad.c 	trap->data.ntc_256.method = mad->method;
mad               494 drivers/infiniband/hw/hfi1/mad.c 	trap->data.ntc_256.attr_id = mad->attr_id;
mad               495 drivers/infiniband/hw/hfi1/mad.c 	trap->data.ntc_256.attr_mod = mad->attr_mod;
mad               497 drivers/infiniband/hw/hfi1/mad.c 	if (mad->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
mad               692 drivers/infiniband/hw/hfi1/mad.c static int check_mkey(struct hfi1_ibport *ibp, struct ib_mad_hdr *mad,
mad               713 drivers/infiniband/hw/hfi1/mad.c 	    (mad->method == IB_MGMT_METHOD_GET ||
mad               714 drivers/infiniband/hw/hfi1/mad.c 	     mad->method == IB_MGMT_METHOD_SET ||
mad               715 drivers/infiniband/hw/hfi1/mad.c 	     mad->method == IB_MGMT_METHOD_TRAP_REPRESS))
mad               719 drivers/infiniband/hw/hfi1/mad.c 		switch (mad->method) {
mad               734 drivers/infiniband/hw/hfi1/mad.c 			bad_mkey(ibp, mad, mkey, dr_slid, return_path,
mad              4396 drivers/infiniband/hw/hfi1/mad.c static int is_local_mad(struct hfi1_ibport *ibp, const struct opa_mad *mad,
mad              4400 drivers/infiniband/hw/hfi1/mad.c 	const struct opa_smp *smp = (const struct opa_smp *)mad;
mad                75 drivers/infiniband/hw/mlx4/cm.c static void set_local_comm_id(struct ib_mad *mad, u32 cm_id)
mad                77 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_SIDR_REQ_ATTR_ID) {
mad                79 drivers/infiniband/hw/mlx4/cm.c 			(struct cm_sidr_generic_msg *)mad;
mad                81 drivers/infiniband/hw/mlx4/cm.c 	} else if (mad->mad_hdr.attr_id == CM_SIDR_REP_ATTR_ID) {
mad                85 drivers/infiniband/hw/mlx4/cm.c 		struct cm_generic_msg *msg = (struct cm_generic_msg *)mad;
mad                90 drivers/infiniband/hw/mlx4/cm.c static u32 get_local_comm_id(struct ib_mad *mad)
mad                92 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_SIDR_REQ_ATTR_ID) {
mad                94 drivers/infiniband/hw/mlx4/cm.c 			(struct cm_sidr_generic_msg *)mad;
mad                96 drivers/infiniband/hw/mlx4/cm.c 	} else if (mad->mad_hdr.attr_id == CM_SIDR_REP_ATTR_ID) {
mad               100 drivers/infiniband/hw/mlx4/cm.c 		struct cm_generic_msg *msg = (struct cm_generic_msg *)mad;
mad               105 drivers/infiniband/hw/mlx4/cm.c static void set_remote_comm_id(struct ib_mad *mad, u32 cm_id)
mad               107 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_SIDR_REP_ATTR_ID) {
mad               109 drivers/infiniband/hw/mlx4/cm.c 			(struct cm_sidr_generic_msg *)mad;
mad               111 drivers/infiniband/hw/mlx4/cm.c 	} else if (mad->mad_hdr.attr_id == CM_SIDR_REQ_ATTR_ID) {
mad               115 drivers/infiniband/hw/mlx4/cm.c 		struct cm_generic_msg *msg = (struct cm_generic_msg *)mad;
mad               120 drivers/infiniband/hw/mlx4/cm.c static u32 get_remote_comm_id(struct ib_mad *mad)
mad               122 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_SIDR_REP_ATTR_ID) {
mad               124 drivers/infiniband/hw/mlx4/cm.c 			(struct cm_sidr_generic_msg *)mad;
mad               126 drivers/infiniband/hw/mlx4/cm.c 	} else if (mad->mad_hdr.attr_id == CM_SIDR_REQ_ATTR_ID) {
mad               130 drivers/infiniband/hw/mlx4/cm.c 		struct cm_generic_msg *msg = (struct cm_generic_msg *)mad;
mad               135 drivers/infiniband/hw/mlx4/cm.c static union ib_gid gid_from_req_msg(struct ib_device *ibdev, struct ib_mad *mad)
mad               137 drivers/infiniband/hw/mlx4/cm.c 	struct cm_req_msg *msg = (struct cm_req_msg *)mad;
mad               289 drivers/infiniband/hw/mlx4/cm.c 		struct ib_mad *mad)
mad               295 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_REQ_ATTR_ID ||
mad               296 drivers/infiniband/hw/mlx4/cm.c 			mad->mad_hdr.attr_id == CM_REP_ATTR_ID ||
mad               297 drivers/infiniband/hw/mlx4/cm.c 			mad->mad_hdr.attr_id == CM_SIDR_REQ_ATTR_ID) {
mad               298 drivers/infiniband/hw/mlx4/cm.c 		sl_cm_id = get_local_comm_id(mad);
mad               308 drivers/infiniband/hw/mlx4/cm.c 	} else if (mad->mad_hdr.attr_id == CM_REJ_ATTR_ID ||
mad               309 drivers/infiniband/hw/mlx4/cm.c 		   mad->mad_hdr.attr_id == CM_SIDR_REP_ATTR_ID) {
mad               312 drivers/infiniband/hw/mlx4/cm.c 		sl_cm_id = get_local_comm_id(mad);
mad               323 drivers/infiniband/hw/mlx4/cm.c 	set_local_comm_id(mad, id->pv_cm_id);
mad               325 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_DREQ_ATTR_ID)
mad               331 drivers/infiniband/hw/mlx4/cm.c 			     struct ib_mad *mad)
mad               336 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_REQ_ATTR_ID ||
mad               337 drivers/infiniband/hw/mlx4/cm.c 	    mad->mad_hdr.attr_id == CM_SIDR_REQ_ATTR_ID) {
mad               343 drivers/infiniband/hw/mlx4/cm.c 		gid = gid_from_req_msg(ibdev, mad);
mad               353 drivers/infiniband/hw/mlx4/cm.c 	pv_cm_id = get_remote_comm_id(mad);
mad               363 drivers/infiniband/hw/mlx4/cm.c 	set_remote_comm_id(mad, id->sl_cm_id);
mad               365 drivers/infiniband/hw/mlx4/cm.c 	if (mad->mad_hdr.attr_id == CM_DREQ_ATTR_ID ||
mad               366 drivers/infiniband/hw/mlx4/cm.c 	    mad->mad_hdr.attr_id == CM_REJ_ATTR_ID)
mad                82 drivers/infiniband/hw/mlx4/mad.c 	struct ib_mad mad;
mad                88 drivers/infiniband/hw/mlx4/mad.c 	struct ib_mad mad;
mad               220 drivers/infiniband/hw/mlx4/mad.c static void smp_snoop(struct ib_device *ibdev, u8 port_num, const struct ib_mad *mad,
mad               231 drivers/infiniband/hw/mlx4/mad.c 	if ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
mad               232 drivers/infiniband/hw/mlx4/mad.c 	     mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
mad               233 drivers/infiniband/hw/mlx4/mad.c 	    mad->mad_hdr.method == IB_MGMT_METHOD_SET)
mad               234 drivers/infiniband/hw/mlx4/mad.c 		switch (mad->mad_hdr.attr_id) {
mad               238 drivers/infiniband/hw/mlx4/mad.c 			pinfo = (struct ib_port_info *) ((struct ib_smp *) mad)->data;
mad               264 drivers/infiniband/hw/mlx4/mad.c 			bn  = be32_to_cpu(((struct ib_smp *)mad)->attr_mod) & 0xFFFF;
mad               265 drivers/infiniband/hw/mlx4/mad.c 			base = (__be16 *) &(((struct ib_smp *)mad)->data[0]);
mad               300 drivers/infiniband/hw/mlx4/mad.c 				bn = be32_to_cpu(((struct ib_smp *)mad)->attr_mod);
mad               302 drivers/infiniband/hw/mlx4/mad.c 								    (u8 *)(&((struct ib_smp *)mad)->data));
mad               304 drivers/infiniband/hw/mlx4/mad.c 								     (u8 *)(&((struct ib_smp *)mad)->data));
mad               320 drivers/infiniband/hw/mlx4/mad.c 					sl2vl64.sl8[jj] = ((struct ib_smp *)mad)->data[jj];
mad               368 drivers/infiniband/hw/mlx4/mad.c 			       struct ib_mad *mad)
mad               372 drivers/infiniband/hw/mlx4/mad.c 	if ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
mad               373 drivers/infiniband/hw/mlx4/mad.c 	     mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
mad               374 drivers/infiniband/hw/mlx4/mad.c 	    mad->mad_hdr.method == IB_MGMT_METHOD_GET_RESP &&
mad               375 drivers/infiniband/hw/mlx4/mad.c 	    mad->mad_hdr.attr_id == IB_SMP_ATTR_NODE_DESC) {
mad               377 drivers/infiniband/hw/mlx4/mad.c 		memcpy(((struct ib_smp *) mad)->data, dev->node_desc,
mad               383 drivers/infiniband/hw/mlx4/mad.c static void forward_trap(struct mlx4_ib_dev *dev, u8 port_num, const struct ib_mad *mad)
mad               385 drivers/infiniband/hw/mlx4/mad.c 	int qpn = mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_LID_ROUTED;
mad               404 drivers/infiniband/hw/mlx4/mad.c 		memcpy(send_buf->mad, mad, sizeof *mad);
mad               505 drivers/infiniband/hw/mlx4/mad.c 			  struct ib_grh *grh, struct ib_mad *mad)
mad               597 drivers/infiniband/hw/mlx4/mad.c 	memcpy(&tun_mad->mad, mad, sizeof *mad);
mad               666 drivers/infiniband/hw/mlx4/mad.c 			struct ib_mad *mad)
mad               689 drivers/infiniband/hw/mlx4/mad.c 		if (mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_CM) {
mad               713 drivers/infiniband/hw/mlx4/mad.c 		if (mlx4_ib_demux_cm_handler(ibdev, port, NULL, mad))
mad               716 drivers/infiniband/hw/mlx4/mad.c 		err = mlx4_ib_send_to_slave(dev, slave, port, wc->qp->qp_type, wc, grh, mad);
mad               727 drivers/infiniband/hw/mlx4/mad.c 	if (mad->mad_hdr.method & 0x80) {
mad               728 drivers/infiniband/hw/mlx4/mad.c 		slave_id = (u8 *) &mad->mad_hdr.tid;
mad               751 drivers/infiniband/hw/mlx4/mad.c 	switch (mad->mad_hdr.mgmt_class) {
mad               759 drivers/infiniband/hw/mlx4/mad.c 			if (!(mad->mad_hdr.method & IB_MGMT_METHOD_RESP)) {
mad               761 drivers/infiniband/hw/mlx4/mad.c 					     slave, mad->mad_hdr.mgmt_class,
mad               762 drivers/infiniband/hw/mlx4/mad.c 					     mad->mad_hdr.method);
mad               769 drivers/infiniband/hw/mlx4/mad.c 					     (struct ib_sa_mad *) mad))
mad               773 drivers/infiniband/hw/mlx4/mad.c 		if (mlx4_ib_demux_cm_handler(ibdev, port, &slave, mad))
mad               777 drivers/infiniband/hw/mlx4/mad.c 		if (mad->mad_hdr.method != IB_MGMT_METHOD_GET_RESP)
mad               784 drivers/infiniband/hw/mlx4/mad.c 				 "for slave:%d\n", mad->mad_hdr.mgmt_class, slave);
mad               795 drivers/infiniband/hw/mlx4/mad.c 	err = mlx4_ib_send_to_slave(dev, slave, port, wc->qp->qp_type, wc, grh, mad);
mad              1363 drivers/infiniband/hw/mlx4/mad.c 			 u8 *s_mac, u16 vlan_id, struct ib_mad *mad)
mad              1428 drivers/infiniband/hw/mlx4/mad.c 	memcpy(&sqp_mad->payload, mad, sizeof *mad);
mad              1515 drivers/infiniband/hw/mlx4/mad.c 	switch (tunnel->mad.mad_hdr.method) {
mad              1523 drivers/infiniband/hw/mlx4/mad.c 		slave_id = (u8 *) &tunnel->mad.mad_hdr.tid;
mad              1527 drivers/infiniband/hw/mlx4/mad.c 				     tunnel->mad.mad_hdr.mgmt_class, slave);
mad              1536 drivers/infiniband/hw/mlx4/mad.c 	switch (tunnel->mad.mad_hdr.mgmt_class) {
mad              1545 drivers/infiniband/hw/mlx4/mad.c 			      (struct ib_sa_mad *) &tunnel->mad))
mad              1550 drivers/infiniband/hw/mlx4/mad.c 			      (struct ib_mad *) &tunnel->mad))
mad              1554 drivers/infiniband/hw/mlx4/mad.c 		if (tunnel->mad.mad_hdr.method != IB_MGMT_METHOD_GET &&
mad              1555 drivers/infiniband/hw/mlx4/mad.c 		    tunnel->mad.mad_hdr.method != IB_MGMT_METHOD_SET)
mad              1562 drivers/infiniband/hw/mlx4/mad.c 				     "for slave:%d\n", tunnel->mad.mad_hdr.mgmt_class, slave);
mad              1597 drivers/infiniband/hw/mlx4/mad.c 			     &ah_attr, wc->smac, vlan_id, &tunnel->mad);
mad              1902 drivers/infiniband/hw/mlx4/mad.c 	struct ib_mad *mad;
mad              1921 drivers/infiniband/hw/mlx4/mad.c 				mad = (struct ib_mad *) &(((struct mlx4_mad_rcv_buf *)
mad              1927 drivers/infiniband/hw/mlx4/mad.c 				mlx4_ib_demux_mad(ctx->ib_dev, ctx->port, &wc, grh, mad);
mad                88 drivers/infiniband/hw/mlx4/main.c static void init_query_mad(struct ib_smp *mad)
mad                90 drivers/infiniband/hw/mlx4/main.c 	mad->base_version  = 1;
mad                91 drivers/infiniband/hw/mlx4/main.c 	mad->mgmt_class    = IB_MGMT_CLASS_SUBN_LID_ROUTED;
mad                92 drivers/infiniband/hw/mlx4/main.c 	mad->class_version = 1;
mad                93 drivers/infiniband/hw/mlx4/main.c 	mad->method	   = IB_MGMT_METHOD_GET;
mad               209 drivers/infiniband/hw/mlx4/mcg.c static int send_mad_to_wire(struct mlx4_ib_demux_ctx *ctx, struct ib_mad *mad)
mad               225 drivers/infiniband/hw/mlx4/mcg.c 				    &ah_attr, NULL, 0xffff, mad);
mad               229 drivers/infiniband/hw/mlx4/mcg.c 			     struct ib_mad *mad)
mad               249 drivers/infiniband/hw/mlx4/mcg.c 	return mlx4_ib_send_to_slave(dev, slave, ctx->port, IB_QPT_GSI, &wc, NULL, mad);
mad               254 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mad mad;
mad               255 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mcmember_data *sa_mad_data = (struct ib_sa_mcmember_data *)&mad.data;
mad               259 drivers/infiniband/hw/mlx4/mcg.c 	memcpy(&mad, sa_mad, sizeof mad);
mad               265 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.tid = mlx4_ib_get_new_demux_tid(group->demux);
mad               266 drivers/infiniband/hw/mlx4/mcg.c 	group->last_req_tid = mad.mad_hdr.tid; /* keep it for later validation */
mad               268 drivers/infiniband/hw/mlx4/mcg.c 	ret = send_mad_to_wire(group->demux, (struct ib_mad *)&mad);
mad               281 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mad mad;
mad               282 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)&mad.data;
mad               285 drivers/infiniband/hw/mlx4/mcg.c 	memset(&mad, 0, sizeof mad);
mad               286 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.base_version = 1;
mad               287 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM;
mad               288 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.class_version = 2;
mad               289 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.method = IB_SA_METHOD_DELETE;
mad               290 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.status = cpu_to_be16(0);
mad               291 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.class_specific = cpu_to_be16(0);
mad               292 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.tid = mlx4_ib_get_new_demux_tid(group->demux);
mad               293 drivers/infiniband/hw/mlx4/mcg.c 	group->last_req_tid = mad.mad_hdr.tid; /* keep it for later validation */
mad               294 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.attr_id = cpu_to_be16(IB_SA_ATTR_MC_MEMBER_REC);
mad               295 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.attr_mod = cpu_to_be32(0);
mad               296 drivers/infiniband/hw/mlx4/mcg.c 	mad.sa_hdr.sm_key = 0x0;
mad               297 drivers/infiniband/hw/mlx4/mcg.c 	mad.sa_hdr.attr_offset = cpu_to_be16(7);
mad               298 drivers/infiniband/hw/mlx4/mcg.c 	mad.sa_hdr.comp_mask = IB_SA_MCMEMBER_REC_MGID |
mad               304 drivers/infiniband/hw/mlx4/mcg.c 	ret = send_mad_to_wire(group->demux, (struct ib_mad *)&mad);
mad               321 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mad mad;
mad               322 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mcmember_data *sa_data = (struct ib_sa_mcmember_data *)&mad.data;
mad               326 drivers/infiniband/hw/mlx4/mcg.c 	memset(&mad, 0, sizeof mad);
mad               327 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.base_version = 1;
mad               328 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.mgmt_class = IB_MGMT_CLASS_SUBN_ADM;
mad               329 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.class_version = 2;
mad               330 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.method = IB_MGMT_METHOD_GET_RESP;
mad               331 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.status = cpu_to_be16(status);
mad               332 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.class_specific = cpu_to_be16(0);
mad               333 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.tid = req_sa_mad->mad_hdr.tid;
mad               334 drivers/infiniband/hw/mlx4/mcg.c 	*(u8 *)&mad.mad_hdr.tid = 0; /* resetting tid to 0 */
mad               335 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.attr_id = cpu_to_be16(IB_SA_ATTR_MC_MEMBER_REC);
mad               336 drivers/infiniband/hw/mlx4/mcg.c 	mad.mad_hdr.attr_mod = cpu_to_be32(0);
mad               337 drivers/infiniband/hw/mlx4/mcg.c 	mad.sa_hdr.sm_key = req_sa_mad->sa_hdr.sm_key;
mad               338 drivers/infiniband/hw/mlx4/mcg.c 	mad.sa_hdr.attr_offset = cpu_to_be16(7);
mad               339 drivers/infiniband/hw/mlx4/mcg.c 	mad.sa_hdr.comp_mask = 0; /* ignored on responses, see IBTA spec */
mad               348 drivers/infiniband/hw/mlx4/mcg.c 	ret = send_mad_to_slave(slave, group->demux, (struct ib_mad *)&mad);
mad               883 drivers/infiniband/hw/mlx4/mcg.c 			      struct ib_sa_mad *mad)
mad               886 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mcmember_data *rec = (struct ib_sa_mcmember_data *)mad->data;
mad               890 drivers/infiniband/hw/mlx4/mcg.c 	switch (mad->mad_hdr.method) {
mad               897 drivers/infiniband/hw/mlx4/mcg.c 			if (mad->mad_hdr.method == IB_MGMT_METHOD_GET_RESP) {
mad               898 drivers/infiniband/hw/mlx4/mcg.c 				__be64 tid = mad->mad_hdr.tid;
mad               909 drivers/infiniband/hw/mlx4/mcg.c 		group->response_sa_mad = *mad;
mad               926 drivers/infiniband/hw/mlx4/mcg.c 			port, mad->mad_hdr.method);
mad              1157 drivers/infiniband/hw/mlx4/mcg.c 	struct ib_sa_mad *mad = &req->sa_mad;
mad              1159 drivers/infiniband/hw/mlx4/mcg.c 	mad->mad_hdr.method = IB_SA_METHOD_DELETE;
mad               832 drivers/infiniband/hw/mlx4/mlx4_ib.h 			      struct ib_sa_mad *mad);
mad               844 drivers/infiniband/hw/mlx4/mlx4_ib.h 			  struct ib_grh *grh, struct ib_mad *mad);
mad               849 drivers/infiniband/hw/mlx4/mlx4_ib.h 			 u16 vlan_id, struct ib_mad *mad);
mad               854 drivers/infiniband/hw/mlx4/mlx4_ib.h 		struct ib_mad *mad);
mad               857 drivers/infiniband/hw/mlx4/mlx4_ib.h 		struct ib_mad *mad);
mad               369 drivers/infiniband/hw/mlx5/cmd.c 	data = MLX5_ADDR_OF(mad_ifc_in, in, mad);
mad               370 drivers/infiniband/hw/mlx5/cmd.c 	memcpy(data, inb, MLX5_FLD_SZ_BYTES(mad_ifc_in, mad));
mad              1374 drivers/infiniband/hw/mlx5/mlx5_ib.h static inline void init_query_mad(struct ib_smp *mad)
mad              1376 drivers/infiniband/hw/mlx5/mlx5_ib.h 	mad->base_version  = 1;
mad              1377 drivers/infiniband/hw/mlx5/mlx5_ib.h 	mad->mgmt_class    = IB_MGMT_CLASS_SUBN_LID_ROUTED;
mad              1378 drivers/infiniband/hw/mlx5/mlx5_ib.h 	mad->class_version = 1;
mad              1379 drivers/infiniband/hw/mlx5/mlx5_ib.h 	mad->method	   = IB_MGMT_METHOD_GET;
mad               109 drivers/infiniband/hw/mthca/mthca_mad.c 		      const struct ib_mad *mad,
mad               114 drivers/infiniband/hw/mthca/mthca_mad.c 	if ((mad->mad_hdr.mgmt_class  == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
mad               115 drivers/infiniband/hw/mthca/mthca_mad.c 	     mad->mad_hdr.mgmt_class  == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
mad               116 drivers/infiniband/hw/mthca/mthca_mad.c 	    mad->mad_hdr.method     == IB_MGMT_METHOD_SET) {
mad               117 drivers/infiniband/hw/mthca/mthca_mad.c 		if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO) {
mad               119 drivers/infiniband/hw/mthca/mthca_mad.c 				(struct ib_port_info *) ((struct ib_smp *) mad)->data;
mad               141 drivers/infiniband/hw/mthca/mthca_mad.c 		if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PKEY_TABLE) {
mad               151 drivers/infiniband/hw/mthca/mthca_mad.c 			       struct ib_mad *mad)
mad               153 drivers/infiniband/hw/mthca/mthca_mad.c 	if ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
mad               154 drivers/infiniband/hw/mthca/mthca_mad.c 	     mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
mad               155 drivers/infiniband/hw/mthca/mthca_mad.c 	    mad->mad_hdr.method == IB_MGMT_METHOD_GET_RESP &&
mad               156 drivers/infiniband/hw/mthca/mthca_mad.c 	    mad->mad_hdr.attr_id == IB_SMP_ATTR_NODE_DESC) {
mad               158 drivers/infiniband/hw/mthca/mthca_mad.c 		memcpy(((struct ib_smp *) mad)->data, dev->node_desc,
mad               166 drivers/infiniband/hw/mthca/mthca_mad.c 			 const struct ib_mad *mad)
mad               168 drivers/infiniband/hw/mthca/mthca_mad.c 	int qpn = mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_LID_ROUTED;
mad               187 drivers/infiniband/hw/mthca/mthca_mad.c 		memcpy(send_buf->mad, mad, sizeof *mad);
mad                53 drivers/infiniband/hw/mthca/mthca_provider.c static void init_query_mad(struct ib_smp *mad)
mad                55 drivers/infiniband/hw/mthca/mthca_provider.c 	mad->base_version  = 1;
mad                56 drivers/infiniband/hw/mthca/mthca_provider.c 	mad->mgmt_class    = IB_MGMT_CLASS_SUBN_LID_ROUTED;
mad                57 drivers/infiniband/hw/mthca/mthca_provider.c 	mad->class_version = 1;
mad                58 drivers/infiniband/hw/mthca/mthca_provider.c 	mad->method    	   = IB_MGMT_METHOD_GET;
mad              5466 drivers/infiniband/hw/qib/qib_iba7322.c 	smp = send_buf->mad;
mad                92 drivers/infiniband/hw/qib/qib_mad.c 	smp = send_buf->mad;
mad               632 drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c 	if (!mad_wc || !mad_wc->recv_buf.mad)
mad               649 drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c 	vema_mad = rsp->mad;
mad               650 drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c 	memcpy(vema_mad, mad_wc->recv_buf.mad, IB_MGMT_VENDOR_HDR);
mad               657 drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c 	switch (mad_wc->recv_buf.mad->mad_hdr.method) {
mad               659 drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c 		vema_get(port, (struct opa_vnic_vema_mad *)mad_wc->recv_buf.mad,
mad               663 drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c 		vema_set(port, (struct opa_vnic_vema_mad *)mad_wc->recv_buf.mad,
mad               809 drivers/infiniband/ulp/opa_vnic/opa_vnic_vema.c 	trap_mad = send_buf->mad;
mad               272 drivers/infiniband/ulp/srpt/ib_srpt.c static void srpt_get_class_port_info(struct ib_dm_mad *mad)
mad               276 drivers/infiniband/ulp/srpt/ib_srpt.c 	cif = (struct ib_class_port_info *)mad->data;
mad               282 drivers/infiniband/ulp/srpt/ib_srpt.c 	mad->mad_hdr.status = 0;
mad               292 drivers/infiniband/ulp/srpt/ib_srpt.c static void srpt_get_iou(struct ib_dm_mad *mad)
mad               298 drivers/infiniband/ulp/srpt/ib_srpt.c 	ioui = (struct ib_dm_iou_info *)mad->data;
mad               307 drivers/infiniband/ulp/srpt/ib_srpt.c 	mad->mad_hdr.status = 0;
mad               321 drivers/infiniband/ulp/srpt/ib_srpt.c 			 struct ib_dm_mad *mad)
mad               327 drivers/infiniband/ulp/srpt/ib_srpt.c 	iocp = (struct ib_dm_ioc_profile *)mad->data;
mad               330 drivers/infiniband/ulp/srpt/ib_srpt.c 		mad->mad_hdr.status
mad               336 drivers/infiniband/ulp/srpt/ib_srpt.c 		mad->mad_hdr.status
mad               368 drivers/infiniband/ulp/srpt/ib_srpt.c 	mad->mad_hdr.status = 0;
mad               383 drivers/infiniband/ulp/srpt/ib_srpt.c 				 u16 slot, u8 hi, u8 lo, struct ib_dm_mad *mad)
mad               390 drivers/infiniband/ulp/srpt/ib_srpt.c 		mad->mad_hdr.status
mad               396 drivers/infiniband/ulp/srpt/ib_srpt.c 		mad->mad_hdr.status
mad               401 drivers/infiniband/ulp/srpt/ib_srpt.c 	svc_entries = (struct ib_dm_svc_entries *)mad->data;
mad               410 drivers/infiniband/ulp/srpt/ib_srpt.c 	mad->mad_hdr.status = 0;
mad               480 drivers/infiniband/ulp/srpt/ib_srpt.c 	if (!mad_wc || !mad_wc->recv_buf.mad)
mad               500 drivers/infiniband/ulp/srpt/ib_srpt.c 	dm_mad = rsp->mad;
mad               501 drivers/infiniband/ulp/srpt/ib_srpt.c 	memcpy(dm_mad, mad_wc->recv_buf.mad, sizeof(*dm_mad));
mad               505 drivers/infiniband/ulp/srpt/ib_srpt.c 	switch (mad_wc->recv_buf.mad->mad_hdr.method) {
mad               507 drivers/infiniband/ulp/srpt/ib_srpt.c 		srpt_mgmt_method_get(sport, mad_wc->recv_buf.mad, dm_mad);
mad               149 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_mad_common *mad = &evt->iu.mad_common;
mad               167 drivers/scsi/ibmvscsi/ibmvfc.c 		entry->op_code = be32_to_cpu(mad->opcode);
mad               183 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_mad_common *mad = &evt->xfer_iu->mad_common;
mad               204 drivers/scsi/ibmvscsi/ibmvfc.c 		entry->op_code = be32_to_cpu(mad->opcode);
mad               205 drivers/scsi/ibmvscsi/ibmvfc.c 		entry->u.end.status = be16_to_cpu(mad->status);
mad              1813 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_passthru_mad *mad;
mad              1892 drivers/scsi/ibmvscsi/ibmvfc.c 	mad = &evt->iu.passthru;
mad              1894 drivers/scsi/ibmvscsi/ibmvfc.c 	memset(mad, 0, sizeof(*mad));
mad              1895 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.version = cpu_to_be32(1);
mad              1896 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
mad              1897 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
mad              1899 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->cmd_ioba.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) +
mad              1901 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
mad              1903 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cmd_len = cpu_to_be32(job->request_payload.payload_len);
mad              1904 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.rsp_len = cpu_to_be32(job->reply_payload.payload_len);
mad              1905 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.flags = cpu_to_be32(fc_flags);
mad              1906 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cancel_key = cpu_to_be32(IBMVFC_PASSTHRU_CANCEL_KEY);
mad              1908 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cmd.va = cpu_to_be64(sg_dma_address(job->request_payload.sg_list));
mad              1909 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cmd.len = cpu_to_be32(sg_dma_len(job->request_payload.sg_list));
mad              1910 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.rsp.va = cpu_to_be64(sg_dma_address(job->reply_payload.sg_list));
mad              1911 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.rsp.len = cpu_to_be32(sg_dma_len(job->reply_payload.sg_list));
mad              1912 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.scsi_id = cpu_to_be64(port_id);
mad              1913 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.tag = cpu_to_be64((u64)evt);
mad              1914 drivers/scsi/ibmvscsi/ibmvfc.c 	rsp_len = be32_to_cpu(mad->iu.rsp.len);
mad              3534 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_implicit_logout *mad;
mad              3546 drivers/scsi/ibmvscsi/ibmvfc.c 	mad = &evt->iu.implicit_logout;
mad              3547 drivers/scsi/ibmvscsi/ibmvfc.c 	memset(mad, 0, sizeof(*mad));
mad              3548 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.version = cpu_to_be32(1);
mad              3549 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.opcode = cpu_to_be32(IBMVFC_IMPLICIT_LOGOUT);
mad              3550 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.length = cpu_to_be16(sizeof(*mad));
mad              3551 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->old_scsi_id = cpu_to_be64(tgt->scsi_id);
mad              3570 drivers/scsi/ibmvscsi/ibmvfc.c static int ibmvfc_adisc_needs_plogi(struct ibmvfc_passthru_mad *mad,
mad              3573 drivers/scsi/ibmvscsi/ibmvfc.c 	if (wwn_to_u64((u8 *)&mad->fc_iu.response[2]) != tgt->ids.port_name)
mad              3575 drivers/scsi/ibmvscsi/ibmvfc.c 	if (wwn_to_u64((u8 *)&mad->fc_iu.response[4]) != tgt->ids.node_name)
mad              3577 drivers/scsi/ibmvscsi/ibmvfc.c 	if (be32_to_cpu(mad->fc_iu.response[6]) != tgt->scsi_id)
mad              3591 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_passthru_mad *mad = &evt->xfer_iu->passthru;
mad              3592 drivers/scsi/ibmvscsi/ibmvfc.c 	u32 status = be16_to_cpu(mad->common.status);
mad              3602 drivers/scsi/ibmvscsi/ibmvfc.c 		if (ibmvfc_adisc_needs_plogi(mad, tgt))
mad              3610 drivers/scsi/ibmvscsi/ibmvfc.c 		fc_reason = (be32_to_cpu(mad->fc_iu.response[1]) & 0x00ff0000) >> 16;
mad              3611 drivers/scsi/ibmvscsi/ibmvfc.c 		fc_explain = (be32_to_cpu(mad->fc_iu.response[1]) & 0x0000ff00) >> 8;
mad              3613 drivers/scsi/ibmvscsi/ibmvfc.c 			 ibmvfc_get_cmd_error(be16_to_cpu(mad->iu.status), be16_to_cpu(mad->iu.error)),
mad              3614 drivers/scsi/ibmvscsi/ibmvfc.c 			 be16_to_cpu(mad->iu.status), be16_to_cpu(mad->iu.error),
mad              3632 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_passthru_mad *mad = &evt->iu.passthru;
mad              3634 drivers/scsi/ibmvscsi/ibmvfc.c 	memset(mad, 0, sizeof(*mad));
mad              3635 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.version = cpu_to_be32(1);
mad              3636 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.opcode = cpu_to_be32(IBMVFC_PASSTHRU);
mad              3637 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.length = cpu_to_be16(sizeof(*mad) - sizeof(mad->fc_iu) - sizeof(mad->iu));
mad              3638 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->cmd_ioba.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
mad              3640 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->cmd_ioba.len = cpu_to_be32(sizeof(mad->iu));
mad              3641 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cmd_len = cpu_to_be32(sizeof(mad->fc_iu.payload));
mad              3642 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.rsp_len = cpu_to_be32(sizeof(mad->fc_iu.response));
mad              3643 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cmd.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
mad              3646 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cmd.len = cpu_to_be32(sizeof(mad->fc_iu.payload));
mad              3647 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.rsp.va = cpu_to_be64((u64)be64_to_cpu(evt->crq.ioba) +
mad              3650 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.rsp.len = cpu_to_be32(sizeof(mad->fc_iu.response));
mad              3741 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_passthru_mad *mad;
mad              3755 drivers/scsi/ibmvscsi/ibmvfc.c 	mad = &evt->iu.passthru;
mad              3756 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.flags = cpu_to_be32(IBMVFC_FC_ELS);
mad              3757 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.scsi_id = cpu_to_be64(tgt->scsi_id);
mad              3758 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->iu.cancel_key = cpu_to_be32(tgt->cancel_key);
mad              3760 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->fc_iu.payload[0] = cpu_to_be32(IBMVFC_ADISC);
mad              3761 drivers/scsi/ibmvscsi/ibmvfc.c 	memcpy(&mad->fc_iu.payload[2], &vhost->login_buf->resp.port_name,
mad              3763 drivers/scsi/ibmvscsi/ibmvfc.c 	memcpy(&mad->fc_iu.payload[4], &vhost->login_buf->resp.node_name,
mad              3765 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->fc_iu.payload[6] = cpu_to_be32(be64_to_cpu(vhost->login_buf->resp.scsi_id) & 0x00ffffff);
mad              3976 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_discover_targets *mad;
mad              3980 drivers/scsi/ibmvscsi/ibmvfc.c 	mad = &evt->iu.discover_targets;
mad              3981 drivers/scsi/ibmvscsi/ibmvfc.c 	memset(mad, 0, sizeof(*mad));
mad              3982 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.version = cpu_to_be32(1);
mad              3983 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.opcode = cpu_to_be32(IBMVFC_DISC_TARGETS);
mad              3984 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.length = cpu_to_be16(sizeof(*mad));
mad              3985 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->bufflen = cpu_to_be32(vhost->disc_buf_sz);
mad              3986 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->buffer.va = cpu_to_be64(vhost->disc_buf_dma);
mad              3987 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->buffer.len = cpu_to_be32(vhost->disc_buf_sz);
mad              4088 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_npiv_login_mad *mad;
mad              4096 drivers/scsi/ibmvscsi/ibmvfc.c 	mad = &evt->iu.npiv_login;
mad              4097 drivers/scsi/ibmvscsi/ibmvfc.c 	memset(mad, 0, sizeof(struct ibmvfc_npiv_login_mad));
mad              4098 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.version = cpu_to_be32(1);
mad              4099 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGIN);
mad              4100 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_login_mad));
mad              4101 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->buffer.va = cpu_to_be64(vhost->login_buf_dma);
mad              4102 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->buffer.len = cpu_to_be32(sizeof(*vhost->login_buf));
mad              4151 drivers/scsi/ibmvscsi/ibmvfc.c 	struct ibmvfc_npiv_logout_mad *mad;
mad              4157 drivers/scsi/ibmvscsi/ibmvfc.c 	mad = &evt->iu.npiv_logout;
mad              4158 drivers/scsi/ibmvscsi/ibmvfc.c 	memset(mad, 0, sizeof(*mad));
mad              4159 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.version = cpu_to_be32(1);
mad              4160 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.opcode = cpu_to_be32(IBMVFC_NPIV_LOGOUT);
mad              4161 drivers/scsi/ibmvscsi/ibmvfc.c 	mad->common.length = cpu_to_be16(sizeof(struct ibmvfc_npiv_logout_mad));
mad              1219 drivers/scsi/ibmvscsi/ibmvscsi.c 	if (evt_struct->xfer_iu->mad.capabilities.common.status) {
mad              1221 drivers/scsi/ibmvscsi/ibmvscsi.c 			evt_struct->xfer_iu->mad.capabilities.common.status);
mad              1258 drivers/scsi/ibmvscsi/ibmvscsi.c 	req = &evt_struct->iu.mad.capabilities;
mad              1314 drivers/scsi/ibmvscsi/ibmvscsi.c 	u16 status = be16_to_cpu(evt_struct->xfer_iu->mad.fast_fail.common.status);
mad              1349 drivers/scsi/ibmvscsi/ibmvscsi.c 	fast_fail_mad = &evt_struct->iu.mad.fast_fail;
mad              1371 drivers/scsi/ibmvscsi/ibmvscsi.c 	if (evt_struct->xfer_iu->mad.adapter_info.common.status) {
mad              1373 drivers/scsi/ibmvscsi/ibmvscsi.c 			evt_struct->xfer_iu->mad.adapter_info.common.status);
mad              1428 drivers/scsi/ibmvscsi/ibmvscsi.c 	req = &evt_struct->iu.mad.adapter_info;
mad              1503 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	struct viosrp_adapter_info *mad = &vio_iu(iue)->mad.adapter_info;
mad              1509 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	mad->common.status = cpu_to_be16(VIOSRP_MAD_SUCCESS);
mad              1511 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	if (be16_to_cpu(mad->common.length) > sizeof(*info)) {
mad              1512 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad->common.status = cpu_to_be16(VIOSRP_MAD_FAILED);
mad              1521 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad->common.status = cpu_to_be16(VIOSRP_MAD_FAILED);
mad              1526 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	rc = h_copy_rdma(be16_to_cpu(mad->common.length),
mad              1528 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 			 be64_to_cpu(mad->buffer),
mad              1539 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 			be64_to_cpu(mad->buffer), vscsi->flags, flag_bits);
mad              1574 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 			 be64_to_cpu(mad->buffer));
mad              1614 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	struct viosrp_capabilities *mad = &vio_iu(iue)->mad.capabilities;
mad              1623 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	olen = be16_to_cpu(mad->common.length);
mad              1631 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad->common.status = cpu_to_be16(VIOSRP_MAD_FAILED);
mad              1640 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad->common.status = cpu_to_be16(VIOSRP_MAD_FAILED);
mad              1644 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 			 be64_to_cpu(mad->buffer),
mad              1686 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad->common.status = cpu_to_be16(status);
mad              1691 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 				 be64_to_cpu(mad->buffer));
mad              1728 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	struct mad_common *mad = (struct mad_common *)&vio_iu(iue)->mad;
mad              1732 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	switch (be32_to_cpu(mad->type)) {
mad              1734 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		empty = &vio_iu(iue)->mad.empty_iu;
mad              1737 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad->status = cpu_to_be16(VIOSRP_MAD_SUCCESS);
mad              1748 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 			mad->status = cpu_to_be16(VIOSRP_MAD_SUCCESS);
mad              1751 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 			mad->status = cpu_to_be16(VIOSRP_MAD_FAILED);
mad              1755 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad->status = cpu_to_be16(VIOSRP_MAD_NOT_SUPPORTED);
mad              1989 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	struct mad_common *mad = (struct mad_common *)&vio_iu(iue)->mad;
mad              2001 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		cmd->rsp.tag = mad->tag;
mad              2032 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 	struct mad_common *mad;
mad              2076 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		mad = (struct mad_common *)&vio_iu(iue)->mad;
mad              2078 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 		dev_dbg(&vscsi->dev, "mad: type %d\n", be32_to_cpu(mad->type));
mad              2083 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c 			be16_to_cpu(mad->status), rc);
mad              6327 include/linux/mlx5/mlx5_ifc.h 	u8         mad[256][0x8];
mad               121 include/net/mrp.h 	struct rb_root		mad;
mad               491 include/rdma/ib_mad.h 	void			*mad;
mad               651 include/rdma/ib_mad.h 		struct ib_mad	*mad;
mad               197 include/scsi/viosrp.h 	union mad_iu mad;
mad                68 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->base_version;
mad                70 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->mgmt_class;
mad                72 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->class_version;
mad                74 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->method;
mad                76 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->status;
mad                78 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->class_specific;
mad                79 include/trace/events/ib_mad.h 		__entry->tid = ((struct ib_mad_hdr *)wr->send_buf.mad)->tid;
mad                81 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->attr_id;
mad                83 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->attr_mod;
mad               155 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->base_version;
mad               157 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->mgmt_class;
mad               159 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->class_version;
mad               161 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->method;
mad               163 include/trace/events/ib_mad.h 			((struct ib_mad_hdr *)wr->send_buf.mad)->status;
mad               239 net/802/mrp.c  	struct rb_node *parent = app->mad.rb_node;
mad               259 net/802/mrp.c  	struct rb_node *parent = NULL, **p = &app->mad.rb_node;
mad               285 net/802/mrp.c  	rb_insert_color(&attr->node, &app->mad);
mad               291 net/802/mrp.c  	rb_erase(&attr->node, &app->mad);
mad               570 net/802/mrp.c  	for (node = rb_first(&app->mad);
mad               861 net/802/mrp.c  	app->mad = RB_ROOT;