timeval_sub(tstamp,tail->dccphrx_tstamp,&tmp_tv); rtt = (tmp_tv.tv_sec * USEC_PER_SEC + tmp_tv.tv_usec) * 4 / interval; 
rtt = timeval_delta(&tstamp, &tail->dccphrx_tstamp) * 4 / interval; 
static u32 ccid3_hc_rx_calc_first_li(struct sock *sk){	struct dccp_sock *dp = dccp_sk(sk);	struct ccid3_hc_rx_sock *hcrx = dp->dccps_hc_rx_ccid_private;	struct dccp_rx_hist_entry *entry, *next, *tail = NULL;	u32 rtt, delta, x_recv, fval, p, tmp2;	struct timeval tstamp = { 0 }, tmp_tv;	int interval = 0;	int win_count = 0;	int step = 0;	u64 tmp1;	list_for_each_entry_safe(entry, next, &hcrx->ccid3hcrx_hist,				 dccphrx_node) {		if (dccp_rx_hist_entry_data_packet(entry)) {			tail = entry;			switch (step) {			case 0:				tstamp	  = entry->dccphrx_tstamp;				win_count = entry->dccphrx_ccval;				step = 1;				break;			case 1:				interval = win_count - entry->dccphrx_ccval;				if (interval < 0)					interval += TFRC_WIN_COUNT_LIMIT;				if (interval > 4)					goto found;				break;			}		}	}	if (step == 0) {		printk(KERN_CRIT "%s: %s, sk=%p, packet history contains no "				 "data packets!\n",		       __FUNCTION__, dccp_role(sk), sk);		return ~0;	}	if (interval == 0) {		ccid3_pr_debug("%s, sk=%p, Could not find a win_count "			       "interval > 0. Defaulting to 1\n",			       dccp_role(sk), sk);		interval = 1;	}found:	timeval_sub(tstamp,tail->dccphrx_tstamp,&tmp_tv);	rtt = (tmp_tv.tv_sec * USEC_PER_SEC + tmp_tv.tv_usec) * 4 / interval;	ccid3_pr_debug("%s, sk=%p, approximated RTT to %uus\n",		       dccp_role(sk), sk, rtt);	if (rtt == 0)		rtt = 1;	delta = now_delta(hcrx->ccid3hcrx_tstamp_last_feedback);	if (delta == 0)		delta = 1;	x_recv = (hcrx->ccid3hcrx_bytes_recv * USEC_PER_SEC) / delta;	tmp1 = (u64)x_recv * (u64)rtt;	do_div(tmp1,10000000);	tmp2 = (u32)tmp1;	fval = (hcrx->ccid3hcrx_s * 100000) / tmp2;	/* do not alter order above or you will get overflow on 32 bit */	p = calcx_reverse_lookup(fval);	ccid3_pr_debug("%s, sk=%p, receive rate=%u bytes/s, implied "		       "loss rate=%u\n", dccp_role(sk), sk, x_recv, p);	if (p == 0)		return ~0;	else		return 1000000 / p; }
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b6ee3d4ada4e85d9b9b9164c1327ef0850c79d5e/ccid3.c/clean/net/dccp/ccids/ccid3.c