diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2019-02-20 17:15:18 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-02-26 12:25:18 +0100 |
commit | b63aa031b00b7d9db28862d9b24b15a5d4146398 (patch) | |
tree | 77f61ed5d62cbb018f17656bb01b667f96a61a46 /drivers/net/wireless/mediatek/mt76/mt76.h | |
parent | 5c8b0a331212155fb2766a7f5ef627bbf62c3b98 (diff) | |
download | lwn-b63aa031b00b7d9db28862d9b24b15a5d4146398.tar.gz lwn-b63aa031b00b7d9db28862d9b24b15a5d4146398.zip |
mt76usb: allow mt76u_bulk_msg be used for reads
Extend mt76u_bulk_msg() such it can be used for synchronous bulk reads.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index f55dc621e060..6092646014c4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -729,16 +729,20 @@ static inline u8 q2ep(u8 qid) } static inline int -mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int timeout) +mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len, + int timeout) { struct usb_interface *intf = to_usb_interface(dev->dev); struct usb_device *udev = interface_to_usbdev(intf); struct mt76_usb *usb = &dev->usb; unsigned int pipe; - int sent; - pipe = usb_sndbulkpipe(udev, usb->out_ep[MT_EP_OUT_INBAND_CMD]); - return usb_bulk_msg(udev, pipe, data, len, &sent, timeout); + if (actual_len) + pipe = usb_rcvbulkpipe(udev, usb->in_ep[MT_EP_IN_CMD_RESP]); + else + pipe = usb_sndbulkpipe(udev, usb->out_ep[MT_EP_OUT_INBAND_CMD]); + + return usb_bulk_msg(udev, pipe, data, len, actual_len, timeout); } int mt76u_vendor_request(struct mt76_dev *dev, u8 req, |