/* Free an allocated Tx Buffer. ptr must be correct position.  */
static void wl3501_free_tx_buffer(struct wl3501_card *this, u16 ptr)
/* Free an allocated Tx Buffer. ptr must be correct position.  */
static void wl3501_free_tx_buffer(struct wl3501_card *this, u16 ptr)
{
	if (!this->tx_buffer_head)
		this->tx_buffer_head = ptr;
	else
		wl3501_set_to_wla(this, this->tx_buffer_tail,
				  &ptr, sizeof(ptr));
	while (ptr) {
		u16 next;
		this->tx_buffer_cnt++;
		wl3501_get_from_wla(this, ptr, &next, sizeof(next));
		this->tx_buffer_tail = ptr;
		ptr = next;
	}
}