release/src/linux/linux/drivers/net/wan/wanpipe_multppp.c
/*============================================================================
 * Update communications error and general packet statistics.
 */
Update communications error and general packet statistics.
Update communications error and general packet statistics .
static int update_comms_stats(sdla_t* card,
	chdlc_private_area_t* chdlc_priv_area)
{
        CHDLC_MAILBOX_STRUCT* mb = card->mbox;
  	COMMS_ERROR_STATS_STRUCT* err_stats;
        CHDLC_OPERATIONAL_STATS_STRUCT *op_stats;
	if(chdlc_priv_area->update_comms_stats == 2) {
		if(chdlc_read_comm_err_stats(card))
			return 1;
		err_stats = (COMMS_ERROR_STATS_STRUCT *)mb->data;
		card->wandev.stats.rx_over_errors = 
				err_stats->Rx_overrun_err_count;
		card->wandev.stats.rx_crc_errors = 
				err_stats->CRC_err_count;
		card->wandev.stats.rx_frame_errors = 
				err_stats->Rx_abort_count;
		card->wandev.stats.rx_fifo_errors = 
				err_stats->Rx_dis_pri_bfrs_full_count; 
		card->wandev.stats.rx_missed_errors =
				card->wandev.stats.rx_fifo_errors;
		card->wandev.stats.tx_aborted_errors =
				err_stats->sec_Tx_abort_count;
	}
	else {
        	if(chdlc_read_op_stats(card))
                	return 1;
		op_stats = (CHDLC_OPERATIONAL_STATS_STRUCT *)mb->data;
		card->wandev.stats.rx_length_errors =
			(op_stats->Rx_Data_discard_short_count +
			op_stats->Rx_Data_discard_long_count);
	}
	return 0;
}
static int update_comms_stats ( sdla_t * card , chdlc_private_area_t * chdlc_priv_area ) { CHDLC_MAILBOX_STRUCT * mb = card -> mbox ; COMMS_ERROR_STATS_STRUCT * err_stats ; CHDLC_OPERATIONAL_STATS_STRUCT * op_stats ; if ( chdlc_priv_area -> update_comms_stats == 2 ) { if ( chdlc_read_comm_err_stats ( card ) ) return 1 ; err_stats = ( COMMS_ERROR_STATS_STRUCT * ) mb -> data ; card -> wandev . stats . rx_over_errors = err_stats -> Rx_overrun_err_count ; card -> wandev . stats . rx_crc_errors = err_stats -> CRC_err_count ; card -> wandev . stats . rx_frame_errors = err_stats -> Rx_abort_count ; card -> wandev . stats . rx_fifo_errors = err_stats -> Rx_dis_pri_bfrs_full_count ; card -> wandev . stats . rx_missed_errors = card -> wandev . stats . rx_fifo_errors ; card -> wandev . stats . tx_aborted_errors = err_stats -> sec_Tx_abort_count ; } else { if ( chdlc_read_op_stats ( card ) ) return 1 ; op_stats = ( CHDLC_OPERATIONAL_STATS_STRUCT * ) mb -> data ; card -> wandev . stats . rx_length_errors = ( op_stats -> Rx_Data_discard_short_count + op_stats -> Rx_Data_discard_long_count ) ; } return 0 ; }
Update communications error and general packet statistics.
Update communications error and general packet statistics .
/* on the first timer interrupt, read the comms error statistics */ /* on the second timer interrupt, read the operational statistics */