Commit ebf084ea authored by Karun Eagalapati's avatar Karun Eagalapati Committed by Kalle Valo

rsi: SDIO Rx packet processing enhancement

Newer firmware sends information about number of blocks through
interrupt only. We don't need to read extra register for this.
This patch adds needed driver changes for this enhancment. The
change here is backward compatible
Signed-off-by: default avatarKarun Eagalapati <karun256@gmail.com>
Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: default avatarPrameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 72bccf51
...@@ -69,20 +69,37 @@ int rsi_sdio_master_access_msword(struct rsi_hw *adapter, u16 ms_word) ...@@ -69,20 +69,37 @@ int rsi_sdio_master_access_msword(struct rsi_hw *adapter, u16 ms_word)
static int rsi_process_pkt(struct rsi_common *common) static int rsi_process_pkt(struct rsi_common *common)
{ {
struct rsi_hw *adapter = common->priv; struct rsi_hw *adapter = common->priv;
struct rsi_91x_sdiodev *dev =
(struct rsi_91x_sdiodev *)adapter->rsi_dev;
u8 num_blks = 0; u8 num_blks = 0;
u32 rcv_pkt_len = 0; u32 rcv_pkt_len = 0;
int status = 0; int status = 0;
u8 value = 0;
status = rsi_sdio_read_register(adapter, num_blks = ((adapter->interrupt_status & 1) |
SDIO_RX_NUM_BLOCKS_REG, ((adapter->interrupt_status >> RECV_NUM_BLOCKS) << 1));
&num_blks);
if (status) { if (!num_blks) {
rsi_dbg(ERR_ZONE, status = rsi_sdio_read_register(adapter,
"%s: Failed to read pkt length from the card:\n", SDIO_RX_NUM_BLOCKS_REG,
__func__); &value);
return status; if (status) {
rsi_dbg(ERR_ZONE,
"%s: Failed to read pkt length from the card:\n",
__func__);
return status;
}
num_blks = value & 0x1f;
} }
if (dev->write_fail == 2)
rsi_sdio_ack_intr(common->priv, (1 << MSDU_PKT_PENDING));
if (unlikely(!num_blks)) {
dev->write_fail = 2;
return -1;
}
rcv_pkt_len = (num_blks * 256); rcv_pkt_len = (num_blks * 256);
common->rx_data_pkt = kmalloc(rcv_pkt_len, GFP_KERNEL); common->rx_data_pkt = kmalloc(rcv_pkt_len, GFP_KERNEL);
...@@ -224,6 +241,7 @@ void rsi_interrupt_handler(struct rsi_hw *adapter) ...@@ -224,6 +241,7 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
mutex_unlock(&common->tx_rxlock); mutex_unlock(&common->tx_rxlock);
return; return;
} }
adapter->interrupt_status = isr_status;
if (isr_status == 0) { if (isr_status == 0) {
rsi_set_event(&common->tx_thread.event); rsi_set_event(&common->tx_thread.event);
......
...@@ -275,6 +275,7 @@ struct rsi_hw { ...@@ -275,6 +275,7 @@ struct rsi_hw {
bool blcmd_timer_expired; bool blcmd_timer_expired;
u32 flash_capacity; u32 flash_capacity;
struct eepromrw_info eeprom; struct eepromrw_info eeprom;
u32 interrupt_status;
u8 dfs_region; u8 dfs_region;
void *rsi_dev; void *rsi_dev;
struct rsi_host_intf_ops *host_intf_ops; struct rsi_host_intf_ops *host_intf_ops;
......
...@@ -41,6 +41,7 @@ enum sdio_interrupt_type { ...@@ -41,6 +41,7 @@ enum sdio_interrupt_type {
#define PKT_BUFF_FULL 1 #define PKT_BUFF_FULL 1
#define PKT_MGMT_BUFF_FULL 2 #define PKT_MGMT_BUFF_FULL 2
#define MSDU_PKT_PENDING 3 #define MSDU_PKT_PENDING 3
#define RECV_NUM_BLOCKS 4
/* Interrupt Bit Related Macros */ /* Interrupt Bit Related Macros */
#define PKT_BUFF_AVAILABLE 1 #define PKT_BUFF_AVAILABLE 1
#define FW_ASSERT_IND 2 #define FW_ASSERT_IND 2
......
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