if (hctx == NULL) return;  if (hctx->ccid3hctx_state == TFRC_SSTATE_TERM) { ccid3_pr_debug("%s, sk=%p, received a packet when " "terminating!\n", dccp_role(sk), sk); return; } 
BUG_ON(hctx == NULL || hctx->ccid3hctx_state == TFRC_SSTATE_TERM); 
static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb){	const struct dccp_sock *dp = dccp_sk(sk);	struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);	struct ccid3_options_received *opt_recv;	struct dccp_tx_hist_entry *packet;	struct timeval now;	unsigned long next_tmout; 	u32 t_elapsed;	u32 pinv;	u32 x_recv;	u32 r_sample;	if (hctx == NULL)		return;	if (hctx->ccid3hctx_state == TFRC_SSTATE_TERM) {		ccid3_pr_debug("%s, sk=%p, received a packet when "			       "terminating!\n", dccp_role(sk), sk);		return;	}	/* we are only interested in ACKs */	if (!(DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_ACK ||	      DCCP_SKB_CB(skb)->dccpd_type == DCCP_PKT_DATAACK))		return;	opt_recv = &hctx->ccid3hctx_options_received;	t_elapsed = dp->dccps_options_received.dccpor_elapsed_time * 10;	x_recv = opt_recv->ccid3or_receive_rate;	pinv = opt_recv->ccid3or_loss_event_rate;	switch (hctx->ccid3hctx_state) {	case TFRC_SSTATE_NO_SENT:		/* FIXME: what to do here? */		return;	case TFRC_SSTATE_NO_FBACK:	case TFRC_SSTATE_FBACK:		/* Calculate new round trip sample by		 * R_sample = (now - t_recvdata) - t_delay */		/* get t_recvdata from history */		packet = dccp_tx_hist_find_entry(&hctx->ccid3hctx_hist,						 DCCP_SKB_CB(skb)->dccpd_ack_seq);		if (packet == NULL) {			ccid3_pr_debug("%s, sk=%p, seqno %llu(%s) does't "				       "exist in history!\n",				       dccp_role(sk), sk,				       DCCP_SKB_CB(skb)->dccpd_ack_seq,				       dccp_packet_name(DCCP_SKB_CB(skb)->dccpd_type));			return;		}		/* Update RTT */		dccp_timestamp(sk, &now);		r_sample = timeval_delta(&now, &packet->dccphtx_tstamp);		if (unlikely(r_sample <= t_elapsed))			LIMIT_NETDEBUG(KERN_WARNING				       "%s: r_sample=%uus, t_elapsed=%uus\n",				       __FUNCTION__, r_sample, t_elapsed);		else			r_sample -= t_elapsed;		/* Update RTT estimate by 		 * If (No feedback recv)		 *    R = R_sample;		 * Else		 *    R = q * R + (1 - q) * R_sample;		 *		 * q is a constant, RFC 3448 recomments 0.9		 */		if (hctx->ccid3hctx_state == TFRC_SSTATE_NO_FBACK) {			ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK);			hctx->ccid3hctx_rtt = r_sample;		} else			hctx->ccid3hctx_rtt = (hctx->ccid3hctx_rtt * 9) / 10 +					      r_sample / 10;		ccid3_pr_debug("%s, sk=%p, New RTT estimate=%uus, "			       "r_sample=%us\n", dccp_role(sk), sk,			       hctx->ccid3hctx_rtt, r_sample);		/* Update timeout interval */		hctx->ccid3hctx_t_rto = max_t(u32, 4 * hctx->ccid3hctx_rtt,					      USEC_PER_SEC);		/* Update receive rate */		hctx->ccid3hctx_x_recv = x_recv;/* X_recv in bytes per sec */		/* Update loss event rate */		if (pinv == ~0 || pinv == 0)			hctx->ccid3hctx_p = 0;		else {			hctx->ccid3hctx_p = 1000000 / pinv;			if (hctx->ccid3hctx_p < TFRC_SMALLEST_P) {				hctx->ccid3hctx_p = TFRC_SMALLEST_P;				ccid3_pr_debug("%s, sk=%p, Smallest p used!\n",					       dccp_role(sk), sk);			}		}		/* unschedule no feedback timer */		sk_stop_timer(sk, &hctx->ccid3hctx_no_feedback_timer);		/* Update sending rate */		ccid3_hc_tx_update_x(sk);		/* Update next send time */		timeval_sub_usecs(&hctx->ccid3hctx_t_nom,				  hctx->ccid3hctx_t_ipi);		ccid3_calc_new_t_ipi(hctx);		timeval_add_usecs(&hctx->ccid3hctx_t_nom,				  hctx->ccid3hctx_t_ipi);		ccid3_calc_new_delta(hctx);		/* remove all packets older than the one acked from history */		dccp_tx_hist_purge_older(ccid3_tx_hist,					 &hctx->ccid3hctx_hist, packet);		/*		 * As we have calculated new ipi, delta, t_nom it is possible that		 * we now can send a packet, so wake up dccp_wait_for_ccids.		 */		sk->sk_write_space(sk);		/*		 * Schedule no feedback timer to expire in		 * max(4 * R, 2 * s / X)		 */		next_tmout = max(hctx->ccid3hctx_t_rto,				 2 * usecs_div(hctx->ccid3hctx_s,					       hctx->ccid3hctx_x));					ccid3_pr_debug("%s, sk=%p, Scheduled no feedback timer to "			       "expire in %lu jiffies (%luus)\n",			       dccp_role(sk), sk,			       usecs_to_jiffies(next_tmout), next_tmout); 		sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer, 			       jiffies + max_t(u32, 1, usecs_to_jiffies(next_tmout)));		/* set idle flag */		hctx->ccid3hctx_idle = 1;   		break;	default:		printk(KERN_CRIT "%s: %s, sk=%p, Illegal state (%d)!\n",		       __FUNCTION__, dccp_role(sk), sk, hctx->ccid3hctx_state);		dump_stack();		break;	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/59d203f9e989c81defc2cb1c559d678e16dbe684/ccid3.c/clean/net/dccp/ccids/ccid3.c