/* To cut down on reading costs we update only the octet counters at each tick and do a full update at major ticks, which can be every 30 minutes or more.  */
static const struct cmac_statistics* mac_update_statistics(struct cmac *mac, int flag)
/* To cut down on reading costs we update only the octet counters at each tick and do a full update at major ticks, which can be every 30 minutes or more.  */
static const struct cmac_statistics* mac_update_statistics(struct cmac *mac, int flag)
{
	if (flag == MAC_STATS_UPDATE_FULL ||
	    mac->instance->ticks >= MAJOR_UPDATE_TICKS) {
		port_stats_update(mac);
		mac->instance->ticks = 0;
	} else {
		int port = mac->instance->index;
		rmon_update(mac, REG_RX_OK_BYTES(port),
			    &mac->stats.RxOctetsOK);
		rmon_update(mac, REG_RX_BAD_BYTES(port),
			    &mac->stats.RxOctetsBad);
		rmon_update(mac, REG_TX_OK_BYTES(port),
			    &mac->stats.TxOctetsOK);
		mac->instance->ticks++;
	}
	return &mac->stats;
}