rsi: Changes to sdio reads and writes
authorPrameela Rani Garnepudi <prameela.j04cs@gmail.com>
Tue, 16 May 2017 10:01:08 +0000 (15:31 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 May 2017 13:37:48 +0000 (16:37 +0300)
SDIO read or write maximum size is limited to 2^16. This is done to make
the host interface operations common for SDIO and USB.

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_sdio.c
drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
drivers/net/wireless/rsi/rsi_sdio.h

index 8428858204a6763a6d4ccfbeb6c2c81a12e7a33f..39d94b38f0a04e1b70f4b56a76b1fea066fe5527 100644 (file)
@@ -487,8 +487,8 @@ void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit)
  */
 static int rsi_sdio_read_register_multiple(struct rsi_hw *adapter,
                                           u32 addr,
-                                          u32 count,
-                                          u8 *data)
+                                          u8 *data,
+                                          u16 count)
 {
        struct rsi_91x_sdiodev *dev =
                (struct rsi_91x_sdiodev *)adapter->rsi_dev;
@@ -518,7 +518,7 @@ static int rsi_sdio_read_register_multiple(struct rsi_hw *adapter,
 int rsi_sdio_write_register_multiple(struct rsi_hw *adapter,
                                     u32 addr,
                                     u8 *data,
-                                    u32 count)
+                                    u16 count)
 {
        struct rsi_91x_sdiodev *dev =
                (struct rsi_91x_sdiodev *)adapter->rsi_dev;
@@ -614,8 +614,8 @@ int rsi_sdio_host_intf_read_pkt(struct rsi_hw *adapter,
 
        status = rsi_sdio_read_register_multiple(adapter,
                                                 length,
-                                                length, /*num of bytes*/
-                                                (u8 *)pkt);
+                                                (u8 *)pkt,
+                                                length); /*num of bytes*/
 
        if (status)
                rsi_dbg(ERR_ZONE, "%s: Failed to read frame: %d\n", __func__,
index 40d72312f3df21dd6e4e12019febd6363a6f7912..7c9cf016188cfac156d3f29a2b826153de0b9c0e 100644 (file)
@@ -75,13 +75,13 @@ static int rsi_sdio_master_access_msword(struct rsi_hw *adapter,
 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_sdiodev *dev =
                (struct rsi_91x_sdiodev *)adapter->rsi_dev;
        u32 indx, ii;
-       u32 block_size = dev->tx_blk_size;
+       u16 block_size = dev->tx_blk_size;
        u32 lsb_address;
        __le32 data[] = { TA_HOLD_THREAD_VALUE, TA_SOFT_RST_CLR,
                          TA_PC_ZERO, TA_RELEASE_THREAD_VALUE };
@@ -171,10 +171,10 @@ static int rsi_load_ta_instructions(struct rsi_common *common)
        struct rsi_91x_sdiodev *dev =
                (struct rsi_91x_sdiodev *)adapter->rsi_dev;
        u32 len;
-       u32 num_blocks;
+       u16 num_blocks;
        const u8 *fw;
        const struct firmware *fw_entry = NULL;
-       u32 block_size = dev->tx_blk_size;
+       u16 block_size = dev->tx_blk_size;
        int status = 0;
        u32 base_address;
        u16 msb_address;
index c7e8f2be790184399f6aa3f102d054f58852d423..a82bc4c73f6621eb3f88abdcb1b380818a56326f 100644 (file)
@@ -110,7 +110,7 @@ struct rsi_91x_sdiodev {
        u8 sdio_clock_speed;
        u32 cardcapability;
        u8 prev_desc[16];
-       u32 tx_blk_size;
+       u16 tx_blk_size;
        u8 write_fail;
 };
 
@@ -122,7 +122,7 @@ int rsi_sdio_host_intf_read_pkt(struct rsi_hw *adapter, u8 *pkt, u32 length);
 int rsi_sdio_write_register(struct rsi_hw *adapter, u8 function,
                            u32 addr, u8 *data);
 int rsi_sdio_write_register_multiple(struct rsi_hw *adapter, u32 addr,
-                                    u8 *data, u32 count);
+                                    u8 *data, u16 count);
 void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit);
 int rsi_sdio_determine_event_timeout(struct rsi_hw *adapter);
 int rsi_sdio_read_buffer_status_register(struct rsi_hw *adapter, u8 q_num);