Remove some USB specific code form mt76x0_alloc_device.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
}
EXPORT_SYMBOL_GPL(mt76x0_cleanup);
-struct mt76x0_dev *mt76x0_alloc_device(struct device *pdev)
+struct mt76x0_dev *
+mt76x0_alloc_device(struct device *pdev, const struct mt76_driver_ops *drv_ops)
{
- static const struct mt76_driver_ops drv_ops = {
- .tx_prepare_skb = mt76x0_tx_prepare_skb,
- .tx_complete_skb = mt76x02_tx_complete_skb,
- .tx_status_data = mt76x02_tx_status_data,
- .rx_skb = mt76x0_queue_rx_skb,
- };
struct mt76x0_dev *dev;
struct mt76_dev *mdev;
return NULL;
mdev->dev = pdev;
- mdev->drv = &drv_ops;
+ mdev->drv = drv_ops;
dev = container_of(mdev, struct mt76x0_dev, mt76);
mutex_init(&dev->reg_atomic_mutex);
const u32 *data, int n);
/* Init */
-struct mt76x0_dev *mt76x0_alloc_device(struct device *dev);
+struct mt76x0_dev *
+mt76x0_alloc_device(struct device *pdev, const struct mt76_driver_ops *drv_ops);
int mt76x0_init_hardware(struct mt76x0_dev *dev);
int mt76x0_register_device(struct mt76x0_dev *dev);
void mt76x0_cleanup(struct mt76x0_dev *dev);
if (ret)
return ret;
- dev = mt76x0_alloc_device(&pdev->dev);
+ dev = mt76x0_alloc_device(&pdev->dev, NULL);
if (!dev)
return -ENOMEM;
return mt76x02_set_txinfo(skb, wcid, q2ep(q->hw_idx));
}
+EXPORT_SYMBOL_GPL(mt76x0_tx_prepare_skb);
void mt76x0_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
struct sk_buff *skb)
mt76_rx(&dev->mt76, q, skb);
}
-
+EXPORT_SYMBOL_GPL(mt76x0_queue_rx_skb);
#include "mt76x0.h"
#include "usb.h"
#include "trace.h"
+#include "../mt76x02_util.h"
static struct usb_device_id mt76x0_device_table[] = {
{ USB_DEVICE(0x148F, 0x7610) }, /* MT7610U */
static int mt76x0u_probe(struct usb_interface *usb_intf,
const struct usb_device_id *id)
{
+ static const struct mt76_driver_ops drv_ops = {
+ .tx_prepare_skb = mt76x0_tx_prepare_skb,
+ .tx_complete_skb = mt76x02_tx_complete_skb,
+ .tx_status_data = mt76x02_tx_status_data,
+ .rx_skb = mt76x0_queue_rx_skb,
+ };
struct usb_device *usb_dev = interface_to_usbdev(usb_intf);
struct mt76x0_dev *dev;
u32 asic_rev, mac_rev;
int ret;
- dev = mt76x0_alloc_device(&usb_intf->dev);
+ dev = mt76x0_alloc_device(&usb_intf->dev, &drv_ops);
if (!dev)
return -ENOMEM;