memcpy(packet->mad.data, mad_recv_wc->recv_buf.mad, sizeof packet->mad.data); packet->mad.status        = 0; packet->mad.qpn 	  = cpu_to_be32(mad_recv_wc->wc->src_qp); packet->mad.lid 	  = cpu_to_be16(mad_recv_wc->wc->slid); packet->mad.sl  	  = mad_recv_wc->wc->sl; packet->mad.path_bits 	  = mad_recv_wc->wc->dlid_path_bits; packet->mad.grh_present   = !!(mad_recv_wc->wc->wc_flags & IB_WC_GRH); if (packet->mad.grh_present) { 
ib_coalesce_recv_mad(mad_recv_wc, packet->mad.data);  packet->mad.hdr.status    = 0; packet->mad.hdr.length    = length + sizeof (struct ib_user_mad); packet->mad.hdr.qpn 	  = cpu_to_be32(mad_recv_wc->wc->src_qp); packet->mad.hdr.lid 	  = cpu_to_be16(mad_recv_wc->wc->slid); packet->mad.hdr.sl  	  = mad_recv_wc->wc->sl; packet->mad.hdr.path_bits = mad_recv_wc->wc->dlid_path_bits; packet->mad.hdr.grh_present = !!(mad_recv_wc->wc->wc_flags & IB_WC_GRH); if (packet->mad.hdr.grh_present) { 
static void recv_handler(struct ib_mad_agent *agent,			 struct ib_mad_recv_wc *mad_recv_wc){	struct ib_umad_file *file = agent->context;	struct ib_umad_packet *packet;	if (mad_recv_wc->wc->status != IB_WC_SUCCESS)		goto out;	packet = kmalloc(sizeof *packet, GFP_KERNEL);	if (!packet)		goto out;	memset(packet, 0, sizeof *packet);	memcpy(packet->mad.data, mad_recv_wc->recv_buf.mad, sizeof packet->mad.data);	packet->mad.status        = 0;	packet->mad.qpn 	  = cpu_to_be32(mad_recv_wc->wc->src_qp);	packet->mad.lid 	  = cpu_to_be16(mad_recv_wc->wc->slid);	packet->mad.sl  	  = mad_recv_wc->wc->sl;	packet->mad.path_bits 	  = mad_recv_wc->wc->dlid_path_bits;	packet->mad.grh_present   = !!(mad_recv_wc->wc->wc_flags & IB_WC_GRH);	if (packet->mad.grh_present) {		/* XXX parse GRH */		packet->mad.gid_index 	  = 0;		packet->mad.hop_limit 	  = 0;		packet->mad.traffic_class = 0;		memset(packet->mad.gid, 0, 16);		packet->mad.flow_label 	  = 0;	}	if (queue_packet(file, agent, packet))		kfree(packet);out:	ib_free_recv_mad(mad_recv_wc);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/cb183a06b381652b7637fedfa7ef85ec0baf2a1f/user_mad.c/clean/drivers/infiniband/core/user_mad.c