/* qm_read_drop_stat This function is used to read the drop statistics from the TMU hw drop counter. Since the hw counter is always cleared afer reading, this function maintains the previous drop count, and adds the new value to it. That value can be retrieved by passing a pointer to it with the total_drops arg. */
u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset)
/* qm_read_drop_stat This function is used to read the drop statistics from the TMU hw drop counter. Since the hw counter is always cleared afer reading, this function maintains the previous drop count, and adds the new value to it. That value can be retrieved by passing a pointer to it with the total_drops arg. */
u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset)
{
	static u32 qtotal[TMU_MAX_ID + 1][NUM_QUEUES];
	u32 val;
	writel((tmu << 8) | queue, TMU_TEQ_CTRL);
	writel((tmu << 8) | queue, TMU_LLM_CTRL);
	val = readl(TMU_TEQ_DROP_STAT);
	qtotal[tmu][queue] += val;
	if (total_drops)
		*total_drops = qtotal[tmu][queue];
	if (do_reset)
		qtotal[tmu][queue] = 0;
	return val;
}