mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: Introduce mt76_mcu data structure
Introduce mt76_mcu data structure to contain common fields between mt76u_mcu and mt76e_mcu. Initialize mcu common fields in mt76_alloc_device(). Rely on mt76_mcu in mt76_mcu_rx_event and in mt76_mcu_get_response in order to reuse them in usb code Signed-off-by: Lorenzo Bianconi <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
2bbffd2cb3
commit
f408a2b756
@@ -24,7 +24,6 @@ mt76_mcu_msg_alloc(const void *data, int head_len,
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mcu_msg_alloc);
|
||||
|
||||
/* mmio */
|
||||
struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
|
||||
unsigned long expires)
|
||||
{
|
||||
@@ -34,17 +33,17 @@ struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
|
||||
return NULL;
|
||||
|
||||
timeout = expires - jiffies;
|
||||
wait_event_timeout(dev->mmio.mcu.wait,
|
||||
(!skb_queue_empty(&dev->mmio.mcu.res_q) ||
|
||||
wait_event_timeout(dev->mcu.wait,
|
||||
(!skb_queue_empty(&dev->mcu.res_q) ||
|
||||
test_bit(MT76_MCU_RESET, &dev->phy.state)),
|
||||
timeout);
|
||||
return skb_dequeue(&dev->mmio.mcu.res_q);
|
||||
return skb_dequeue(&dev->mcu.res_q);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mcu_get_response);
|
||||
|
||||
void mt76_mcu_rx_event(struct mt76_dev *dev, struct sk_buff *skb)
|
||||
{
|
||||
skb_queue_tail(&dev->mmio.mcu.res_q, skb);
|
||||
wake_up(&dev->mmio.mcu.wait);
|
||||
skb_queue_tail(&dev->mcu.res_q, skb);
|
||||
wake_up(&dev->mcu.wait);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_mcu_rx_event);
|
||||
|
||||
Reference in New Issue
Block a user