now_usecs = now.tv_sec * USEC_PER_SEC + now.tv_usec; hcrx->ccid3hcrx_rtt = now_usecs - 
hcrx->ccid3hcrx_rtt = timeval_usecs(&now) - 
static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb){	struct dccp_sock *dp = dccp_sk(sk);	struct ccid3_hc_rx_sock *hcrx = dp->dccps_hc_rx_ccid_private;	const struct dccp_options_received *opt_recv;	struct dccp_rx_hist_entry *packet;	struct timeval now;	u32 now_usecs;	u8 win_count;	u32 p_prev;	int ins;	if (hcrx == NULL)		return;	BUG_ON(!(hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA ||		 hcrx->ccid3hcrx_state == TFRC_RSTATE_DATA));	opt_recv = &dp->dccps_options_received;	switch (DCCP_SKB_CB(skb)->dccpd_type) {	case DCCP_PKT_ACK:		if (hcrx->ccid3hcrx_state == TFRC_RSTATE_NO_DATA)			return;	case DCCP_PKT_DATAACK:		if (opt_recv->dccpor_timestamp_echo == 0)			break;		p_prev = hcrx->ccid3hcrx_rtt;		do_gettimeofday(&now);		now_usecs = now.tv_sec * USEC_PER_SEC + now.tv_usec;		hcrx->ccid3hcrx_rtt = now_usecs -				     (opt_recv->dccpor_timestamp_echo -				      opt_recv->dccpor_elapsed_time) * 10;		if (p_prev != hcrx->ccid3hcrx_rtt)			ccid3_pr_debug("%s, New RTT=%luus, elapsed time=%u\n",				       dccp_role(sk), hcrx->ccid3hcrx_rtt,				       opt_recv->dccpor_elapsed_time);		break;	case DCCP_PKT_DATA:		break;	default:		ccid3_pr_debug("%s, sk=%p, not DATA/DATAACK/ACK packet(%s)\n",			       dccp_role(sk), sk,			       dccp_packet_name(DCCP_SKB_CB(skb)->dccpd_type));		return;	}	packet = dccp_rx_hist_entry_new(ccid3_rx_hist, opt_recv->dccpor_ndp,					skb, SLAB_ATOMIC);	if (packet == NULL) {		ccid3_pr_debug("%s, sk=%p, Not enough mem to add rx packet "			       "to history (consider it lost)!",			       dccp_role(sk), sk);		return;	}	win_count = packet->dccphrx_ccval;	ins = ccid3_hc_rx_add_hist(sk, packet);	if (DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_ACK)		return;	switch (hcrx->ccid3hcrx_state) {	case TFRC_RSTATE_NO_DATA:		ccid3_pr_debug("%s, sk=%p(%s), skb=%p, sending initial "			       "feedback\n",			       dccp_role(sk), sk,			       dccp_state_name(sk->sk_state), skb);		ccid3_hc_rx_send_feedback(sk);		ccid3_hc_rx_set_state(sk, TFRC_RSTATE_DATA);		return;	case TFRC_RSTATE_DATA:		hcrx->ccid3hcrx_bytes_recv += skb->len -					      dccp_hdr(skb)->dccph_doff * 4;		if (ins == 0) {			if (now_delta(hcrx->ccid3hcrx_tstamp_last_ack) >=			    hcrx->ccid3hcrx_rtt) {				do_gettimeofday(&hcrx->ccid3hcrx_tstamp_last_ack);				ccid3_hc_rx_send_feedback(sk);			}			return;		}		break;	default:		printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",		       __FUNCTION__, dccp_role(sk), sk, hcrx->ccid3hcrx_state);		dump_stack();		return;	}	/* Dealing with packet loss */	ccid3_pr_debug("%s, sk=%p(%s), data loss! Reacting...\n",		       dccp_role(sk), sk, dccp_state_name(sk->sk_state));	ccid3_hc_rx_detect_loss(sk);	p_prev = hcrx->ccid3hcrx_p;		/* Calculate loss event rate */	if (!list_empty(&hcrx->ccid3hcrx_loss_interval_hist))		/* Scaling up by 1000000 as fixed decimal */		hcrx->ccid3hcrx_p = 1000000 / ccid3_hc_rx_calc_i_mean(sk);	if (hcrx->ccid3hcrx_p > p_prev) {		ccid3_hc_rx_send_feedback(sk);		return;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b6ee3d4ada4e85d9b9b9164c1327ef0850c79d5e/ccid3.c/clean/net/dccp/ccids/ccid3.c