mad_send_wr->retries = mad_send_wr->send_wr.wr.ud.retries; 
mad_send_wr->retries = mad_send_wr->send_buf.retries; 
static void process_rmpp_ack(struct ib_mad_agent_private *agent,			     struct ib_mad_recv_wc *mad_recv_wc){	struct ib_mad_send_wr_private *mad_send_wr;	struct ib_rmpp_mad *rmpp_mad;	unsigned long flags;	int seg_num, newwin, ret;	rmpp_mad = (struct ib_rmpp_mad *)mad_recv_wc->recv_buf.mad;	if (rmpp_mad->rmpp_hdr.rmpp_status) {		abort_send(agent, rmpp_mad->mad_hdr.tid,			   IB_MGMT_RMPP_STATUS_BAD_STATUS);		nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_BAD_STATUS);		return;	}	seg_num = be32_to_cpu(rmpp_mad->rmpp_hdr.seg_num);	newwin = be32_to_cpu(rmpp_mad->rmpp_hdr.paylen_newwin);	if (newwin < seg_num) {		abort_send(agent, rmpp_mad->mad_hdr.tid,			   IB_MGMT_RMPP_STATUS_W2S);		nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_W2S);		return;	}	spin_lock_irqsave(&agent->lock, flags);	mad_send_wr = ib_find_send_mad(agent, rmpp_mad->mad_hdr.tid);	if (!mad_send_wr)		goto out;	/* Unmatched ACK */	if ((mad_send_wr->last_ack == mad_send_wr->total_seg) ||	    (!mad_send_wr->timeout) || (mad_send_wr->status != IB_WC_SUCCESS))		goto out;	/* Send is already done */	if (seg_num > mad_send_wr->total_seg || seg_num > mad_send_wr->newwin) {		spin_unlock_irqrestore(&agent->lock, flags);		abort_send(agent, rmpp_mad->mad_hdr.tid,			   IB_MGMT_RMPP_STATUS_S2B);		nack_recv(agent, mad_recv_wc, IB_MGMT_RMPP_STATUS_S2B);		return;	}	if (newwin < mad_send_wr->newwin || seg_num < mad_send_wr->last_ack)		goto out;	/* Old ACK */	if (seg_num > mad_send_wr->last_ack) {		mad_send_wr->last_ack = seg_num;		mad_send_wr->retries = mad_send_wr->send_wr.wr.ud.retries;	}	mad_send_wr->newwin = newwin;	if (mad_send_wr->last_ack == mad_send_wr->total_seg) {		/* If no response is expected, the ACK completes the send */		if (!mad_send_wr->send_wr.wr.ud.timeout_ms) {			struct ib_mad_send_wc wc;			ib_mark_mad_done(mad_send_wr);			spin_unlock_irqrestore(&agent->lock, flags);			wc.status = IB_WC_SUCCESS;			wc.vendor_err = 0;			wc.wr_id = mad_send_wr->wr_id;			ib_mad_complete_send_wr(mad_send_wr, &wc);			return;		}		if (mad_send_wr->refcount == 1)			ib_reset_mad_timeout(mad_send_wr, mad_send_wr->					     send_wr.wr.ud.timeout_ms);	} else if (mad_send_wr->refcount == 1 &&		   mad_send_wr->seg_num < mad_send_wr->newwin &&		   mad_send_wr->seg_num <= mad_send_wr->total_seg) {		/* Send failure will just result in a timeout/retry */		ret = send_next_seg(mad_send_wr);		if (ret)			goto out;		mad_send_wr->refcount++;		list_del(&mad_send_wr->agent_list);		list_add_tail(&mad_send_wr->agent_list,			      &mad_send_wr->mad_agent_priv->send_list);	}out:	spin_unlock_irqrestore(&agent->lock, flags);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/34816ad98efe4d47ffd858a0345321f9d85d9420/mad_rmpp.c/clean/drivers/infiniband/core/mad_rmpp.c