/* iwl_rx_queue_alloc() Allocates rx_free iwl_rx_replenish() Replenishes rx_free list from rx_used, and calls iwl_rx_queue_restock iwl_rx_queue_restock() Moves available buffers from rx_free into Rx queue, updates firmware pointers, and updates the WRITE index. If insufficient rx_free buffers are available, schedules iwl_rx_replenish */
int iwl_rx_queue_space(const struct iwl_rx_queue *q)
/* iwl_rx_queue_alloc() Allocates rx_free iwl_rx_replenish() Replenishes rx_free list from rx_used, and calls iwl_rx_queue_restock iwl_rx_queue_restock() Moves available buffers from rx_free into Rx queue, updates firmware pointers, and updates the WRITE index. If insufficient rx_free buffers are available, schedules iwl_rx_replenish */
int iwl_rx_queue_space(const struct iwl_rx_queue *q)
{
	int s = q->read - q->write;
	if (s <= 0)
		s += RX_QUEUE_SIZE;
	s -= 2;
	if (s < 0)
		s = 0;
	return s;
}