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
@@ -1167,14 +1167,13 @@ int mt76u_init(struct mt76_dev *dev,
|
||||
usb->data_len = usb_maxpacket(udev, usb_sndctrlpipe(udev, 0), 1);
|
||||
if (usb->data_len < 32)
|
||||
usb->data_len = 32;
|
||||
|
||||
usb->data = devm_kmalloc(dev->dev, usb->data_len, GFP_KERNEL);
|
||||
if (!usb->data) {
|
||||
mt76u_deinit(dev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
mutex_init(&usb->mcu.mutex);
|
||||
|
||||
mutex_init(&usb->usb_ctrl_mtx);
|
||||
dev->bus = &mt76u_ops;
|
||||
dev->queue_ops = &usb_queue_ops;
|
||||
|
||||
Reference in New Issue
Block a user