summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/rsi/rsi_91x_usb.c
diff options
context:
space:
mode:
authorPrameela Rani Garnepudi <prameela.j04cs@gmail.com>2017-05-16 13:01:10 +0300
committerKalle Valo <kvalo@codeaurora.org>2017-05-24 16:37:49 +0300
commit2fbbe5179ebe8d7f307c8f9fc9fbd75254fdf4be (patch)
treedb33837ef89f31eec48d5029dbf63565298018ab /drivers/net/wireless/rsi/rsi_91x_usb.c
parent7bdead7ae944c06ef5916e22254929f583684b4a (diff)
downloadlinux-2fbbe5179ebe8d7f307c8f9fc9fbd75254fdf4be.tar.xz
rsi: Changes in USB read and write operations
USB read and write registers maximum size is limited 2^16. More than this size is not used in the driver. Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com> Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/rsi/rsi_91x_usb.c')
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_usb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index be8487c56945..5f6c7000bc51 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -286,11 +286,11 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter)
int rsi_usb_write_register_multiple(struct rsi_hw *adapter,
u32 addr,
u8 *data,
- u32 count)
+ u16 count)
{
struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
u8 *buf;
- u8 transfer;
+ u16 transfer;
int status = 0;
buf = kzalloc(RSI_USB_BUF_SIZE, GFP_KERNEL);
@@ -298,7 +298,7 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter,
return -ENOMEM;
while (count) {
- transfer = (u8)(min_t(u32, count, RSI_USB_BUF_SIZE));
+ transfer = min_t(u16, count, RSI_USB_BUF_SIZE);
memcpy(buf, data, transfer);
status = usb_control_msg(dev->usbdev,
usb_sndctrlpipe(dev->usbdev, 0),