Commit 3bcd979c authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: mt76u: add endpoint to mt76u_bulk_msg signature

This is a preliminary patch to support mt7663u usb dongles
Co-developed-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 9803b7b1
...@@ -866,7 +866,7 @@ static inline u8 q2ep(u8 qid) ...@@ -866,7 +866,7 @@ static inline u8 q2ep(u8 qid)
static inline int static inline int
mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len, mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len,
int timeout) int timeout, int ep)
{ {
struct usb_interface *uintf = to_usb_interface(dev->dev); struct usb_interface *uintf = to_usb_interface(dev->dev);
struct usb_device *udev = interface_to_usbdev(uintf); struct usb_device *udev = interface_to_usbdev(uintf);
...@@ -874,9 +874,9 @@ mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len, ...@@ -874,9 +874,9 @@ mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len,
unsigned int pipe; unsigned int pipe;
if (actual_len) if (actual_len)
pipe = usb_rcvbulkpipe(udev, usb->in_ep[MT_EP_IN_CMD_RESP]); pipe = usb_rcvbulkpipe(udev, usb->in_ep[ep]);
else else
pipe = usb_sndbulkpipe(udev, usb->out_ep[MT_EP_OUT_INBAND_CMD]); pipe = usb_sndbulkpipe(udev, usb->out_ep[ep]);
return usb_bulk_msg(udev, pipe, data, len, actual_len, timeout); return usb_bulk_msg(udev, pipe, data, len, actual_len, timeout);
} }
......
...@@ -55,7 +55,8 @@ static int mt76x02u_mcu_wait_resp(struct mt76_dev *dev, u8 seq) ...@@ -55,7 +55,8 @@ static int mt76x02u_mcu_wait_resp(struct mt76_dev *dev, u8 seq)
u32 rxfce; u32 rxfce;
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
ret = mt76u_bulk_msg(dev, data, MCU_RESP_URB_SIZE, &len, 300); ret = mt76u_bulk_msg(dev, data, MCU_RESP_URB_SIZE, &len,
300, MT_EP_IN_CMD_RESP);
if (ret == -ETIMEDOUT) if (ret == -ETIMEDOUT)
continue; continue;
if (ret) if (ret)
...@@ -103,7 +104,8 @@ __mt76x02u_mcu_send_msg(struct mt76_dev *dev, struct sk_buff *skb, ...@@ -103,7 +104,8 @@ __mt76x02u_mcu_send_msg(struct mt76_dev *dev, struct sk_buff *skb,
if (ret) if (ret)
return ret; return ret;
ret = mt76u_bulk_msg(dev, skb->data, skb->len, NULL, 500); ret = mt76u_bulk_msg(dev, skb->data, skb->len, NULL, 500,
MT_EP_OUT_INBAND_CMD);
if (ret) if (ret)
return ret; return ret;
...@@ -248,7 +250,8 @@ __mt76x02u_mcu_fw_send_data(struct mt76x02_dev *dev, u8 *data, ...@@ -248,7 +250,8 @@ __mt76x02u_mcu_fw_send_data(struct mt76x02_dev *dev, u8 *data,
data_len = MT_CMD_HDR_LEN + len + sizeof(info); data_len = MT_CMD_HDR_LEN + len + sizeof(info);
err = mt76u_bulk_msg(&dev->mt76, data, data_len, NULL, 1000); err = mt76u_bulk_msg(&dev->mt76, data, data_len, NULL, 1000,
MT_EP_OUT_INBAND_CMD);
if (err) { if (err) {
dev_err(dev->mt76.dev, "firmware upload failed: %d\n", err); dev_err(dev->mt76.dev, "firmware upload failed: %d\n", err);
return err; return err;
......
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