rsi: Changes in USB read and write operations
authorPrameela Rani Garnepudi <prameela.j04cs@gmail.com>
Tue, 16 May 2017 10:01:10 +0000 (15:31 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 May 2017 13:37:49 +0000 (16:37 +0300)
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>
drivers/net/wireless/rsi/rsi_91x_usb.c
drivers/net/wireless/rsi/rsi_91x_usb_ops.c
drivers/net/wireless/rsi/rsi_usb.h

index be8487c569452ceec8e8152a4f6bdc02119148ca..5f6c7000bc51279a1a506585f9856bef082b3b7e 100644 (file)
@@ -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),
index de4900862836a55019a3033ad7045ac2fcc186d6..1c3e65433cebf4c4e0f64c0639e458635c734652 100644 (file)
 static int rsi_copy_to_card(struct rsi_common *common,
                            const u8 *fw,
                            u32 len,
-                           u32 num_blocks)
+                           u16 num_blocks)
 {
        struct rsi_hw *adapter = common->priv;
        struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
        u32 indx, ii;
-       u32 block_size = dev->tx_blk_size;
+       u16 block_size = dev->tx_blk_size;
        u32 lsb_address;
        u32 base_address;
 
@@ -134,9 +134,10 @@ static int rsi_load_ta_instructions(struct rsi_common *common)
        struct rsi_hw *adapter = common->priv;
        struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev;
        const struct firmware *fw_entry = NULL;
-       u32 block_size = dev->tx_blk_size;
+       u16 block_size = dev->tx_blk_size;
        const u8 *fw;
-       u32 num_blocks, len;
+       u16 num_blocks;
+       u32 len;
        int status = 0;
 
        status = request_firmware(&fw_entry, FIRMWARE_RSI9113, adapter->device);
index 48c9211fac09ab59e91953bacd4b36c13d67339e..d1e01bcf772bec137aa7f3d37263e98430a81cdf 100644 (file)
@@ -65,6 +65,6 @@ static inline int rsi_usb_event_timeout(struct rsi_hw *adapter)
 
 int rsi_usb_device_init(struct rsi_common *common);
 int rsi_usb_write_register_multiple(struct rsi_hw *adapter, u32 addr,
-                                   u8 *data, u32 count);
+                                   u8 *data, u16 count);
 void rsi_usb_rx_thread(struct rsi_common *common);
 #endif