/* Will print the current MAX and THRESHOLD values for the basic flow control. In addition it will report how many times the TX queue needed to be restarted since the last time this query was made.  */
static ssize_t wlp_tx_inflight_show(struct i1480u_tx_inflight *inflight, char *buf)
/* Will print the current MAX and THRESHOLD values for the basic flow control. In addition it will report how many times the TX queue needed to be restarted since the last time this query was made.  */
static ssize_t wlp_tx_inflight_show(struct i1480u_tx_inflight *inflight, char *buf)
{
	ssize_t result;
	unsigned long sec_elapsed = (jiffies - inflight->restart_ts)/HZ;
	unsigned long restart_count = atomic_read(&inflight->restart_count);
	result = scnprintf(buf, PAGE_SIZE, "%lu %lu %d %lu %lu %lu\n"
			   "#read: threshold max inflight_count restarts "
			   "seconds restarts/sec\n"
			   "#write: threshold max\n",
			   inflight->threshold, inflight->max,
			   atomic_read(&inflight->count),
			   restart_count, sec_elapsed,
			   sec_elapsed == 0 ? 0 : restart_count/sec_elapsed);
	inflight->restart_ts = jiffies;
	atomic_set(&inflight->restart_count, 0);
	return result;
}