Commit fc994dbb authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Felix Fietkau

mt76usb: remove usb_mcu.c

Don't need separate file just for kmalloc/kfree.
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent a18a494f
...@@ -7,7 +7,7 @@ mt76-y := \ ...@@ -7,7 +7,7 @@ mt76-y := \
mmio.o util.o trace.o dma.o mac80211.o debugfs.o eeprom.o \ mmio.o util.o trace.o dma.o mac80211.o debugfs.o eeprom.o \
tx.o agg-rx.o mcu.o tx.o agg-rx.o mcu.o
mt76-usb-y := usb.o usb_trace.o usb_mcu.o mt76-usb-y := usb.o usb_trace.o
CFLAGS_trace.o := -I$(src) CFLAGS_trace.o := -I$(src)
CFLAGS_usb_trace.o := -I$(src) CFLAGS_usb_trace.o := -I$(src)
......
...@@ -771,7 +771,5 @@ struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev, ...@@ -771,7 +771,5 @@ struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
unsigned long expires); unsigned long expires);
void mt76u_mcu_complete_urb(struct urb *urb); void mt76u_mcu_complete_urb(struct urb *urb);
int mt76u_mcu_init_rx(struct mt76_dev *dev);
void mt76u_mcu_deinit(struct mt76_dev *dev);
#endif #endif
...@@ -79,7 +79,6 @@ static void mt76x0u_cleanup(struct mt76x02_dev *dev) ...@@ -79,7 +79,6 @@ static void mt76x0u_cleanup(struct mt76x02_dev *dev)
clear_bit(MT76_STATE_INITIALIZED, &dev->mt76.state); clear_bit(MT76_STATE_INITIALIZED, &dev->mt76.state);
mt76x0_chip_onoff(dev, false, false); mt76x0_chip_onoff(dev, false, false);
mt76u_queues_deinit(&dev->mt76); mt76u_queues_deinit(&dev->mt76);
mt76u_mcu_deinit(&dev->mt76);
} }
static void mt76x0u_mac_stop(struct mt76x02_dev *dev) static void mt76x0u_mac_stop(struct mt76x02_dev *dev)
...@@ -193,10 +192,6 @@ static int mt76x0u_register_device(struct mt76x02_dev *dev) ...@@ -193,10 +192,6 @@ static int mt76x0u_register_device(struct mt76x02_dev *dev)
if (err < 0) if (err < 0)
goto out_err; goto out_err;
err = mt76u_mcu_init_rx(&dev->mt76);
if (err < 0)
goto out_err;
err = mt76x0u_init_hardware(dev); err = mt76x0u_init_hardware(dev);
if (err < 0) if (err < 0)
goto out_err; goto out_err;
......
...@@ -214,10 +214,6 @@ int mt76x2u_register_device(struct mt76x02_dev *dev) ...@@ -214,10 +214,6 @@ int mt76x2u_register_device(struct mt76x02_dev *dev)
if (err < 0) if (err < 0)
goto fail; goto fail;
err = mt76u_mcu_init_rx(&dev->mt76);
if (err < 0)
goto fail;
err = mt76x2u_init_hardware(dev); err = mt76x2u_init_hardware(dev);
if (err < 0) if (err < 0)
goto fail; goto fail;
...@@ -259,5 +255,4 @@ void mt76x2u_cleanup(struct mt76x02_dev *dev) ...@@ -259,5 +255,4 @@ void mt76x2u_cleanup(struct mt76x02_dev *dev)
mt76x02_mcu_set_radio_state(dev, false); mt76x02_mcu_set_radio_state(dev, false);
mt76x2u_stop_hw(dev); mt76x2u_stop_hw(dev);
mt76u_queues_deinit(&dev->mt76); mt76u_queues_deinit(&dev->mt76);
mt76u_mcu_deinit(&dev->mt76);
} }
...@@ -577,9 +577,14 @@ EXPORT_SYMBOL_GPL(mt76u_submit_rx_buffers); ...@@ -577,9 +577,14 @@ EXPORT_SYMBOL_GPL(mt76u_submit_rx_buffers);
static int mt76u_alloc_rx(struct mt76_dev *dev) static int mt76u_alloc_rx(struct mt76_dev *dev)
{ {
struct mt76_usb *usb = &dev->usb;
struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN]; struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN];
int i, err; int i, err;
usb->mcu.data = devm_kmalloc(dev->dev, MCU_RESP_URB_SIZE, GFP_KERNEL);
if (!usb->mcu.data)
return -ENOMEM;
spin_lock_init(&q->rx_page_lock); spin_lock_init(&q->rx_page_lock);
spin_lock_init(&q->lock); spin_lock_init(&q->lock);
q->entry = devm_kcalloc(dev->dev, q->entry = devm_kcalloc(dev->dev,
......
/*
* Copyright (C) 2018 Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "mt76.h"
int mt76u_mcu_init_rx(struct mt76_dev *dev)
{
struct mt76_usb *usb = &dev->usb;
usb->mcu.data = kmalloc(MCU_RESP_URB_SIZE, GFP_KERNEL);
return usb->mcu.data ? 0 : -ENOMEM;
}
EXPORT_SYMBOL_GPL(mt76u_mcu_init_rx);
void mt76u_mcu_deinit(struct mt76_dev *dev)
{
struct mt76_usb *usb = &dev->usb;
kfree(usb->mcu.data);
}
EXPORT_SYMBOL_GPL(mt76u_mcu_deinit);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment