Exemplo n.º 1
0
static int wilc_wlan_txq_add_to_head(struct wilc_vif *vif,
				     struct txq_entry_t *tqe)
{
	unsigned long flags;
	struct wilc *wilc = vif->wilc;

	if (wilc_lock_timeout(wilc, &wilc->txq_add_to_head_cs,
				    CFG_PKTS_TIMEOUT))
		return -1;

	spin_lock_irqsave(&wilc->txq_spinlock, flags);

	if (!wilc->txq_head) {
		tqe->next = NULL;
		tqe->prev = NULL;
		wilc->txq_head = tqe;
		wilc->txq_tail = tqe;
	} else {
		tqe->next = wilc->txq_head;
		tqe->prev = NULL;
		wilc->txq_head->prev = tqe;
		wilc->txq_head = tqe;
	}
	wilc->txq_entries += 1;

	spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
	up(&wilc->txq_add_to_head_cs);
	up(&wilc->txq_event);

	return 0;
}
Exemplo n.º 2
0
static int wilc_wlan_txq_add_to_head(struct wilc *wilc, struct txq_entry_t *tqe)
{
	unsigned long flags;
	if (wilc_lock_timeout(wilc, &wilc->txq_add_to_head_cs,
				    CFG_PKTS_TIMEOUT))
		return -1;

	spin_lock_irqsave(&wilc->txq_spinlock, flags);

	if (!wilc->txq_head) {
		tqe->next = NULL;
		tqe->prev = NULL;
		wilc->txq_head = tqe;
		wilc->txq_tail = tqe;
	} else {
		tqe->next = wilc->txq_head;
		tqe->prev = NULL;
		wilc->txq_head->prev = tqe;
		wilc->txq_head = tqe;
	}
	wilc->txq_entries += 1;
	PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", wilc->txq_entries);

	spin_unlock_irqrestore(&wilc->txq_spinlock, flags);
	up(&wilc->txq_add_to_head_cs);
	up(&wilc->txq_event);
	PRINT_D(TX_DBG, "Wake up the txq_handler\n");

	return 0;
}