Commit 0fc0d43b authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by John W. Linville

mwifiex: do port calculations separately

This patch rearranges the code for better readability
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarYogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e6a52030
...@@ -539,7 +539,7 @@ static int mwifiex_get_rd_port(struct mwifiex_adapter *adapter, u8 *port) ...@@ -539,7 +539,7 @@ static int mwifiex_get_rd_port(struct mwifiex_adapter *adapter, u8 *port)
* increased (provided it does not reach the maximum limit, in which * increased (provided it does not reach the maximum limit, in which
* case it is reset to 1) * case it is reset to 1)
*/ */
static int mwifiex_get_wr_port_data(struct mwifiex_adapter *adapter, u8 *port) static int mwifiex_get_wr_port_data(struct mwifiex_adapter *adapter, u32 *port)
{ {
struct sdio_mmc_card *card = adapter->card; struct sdio_mmc_card *card = adapter->card;
u32 wr_bitmap = card->mp_wr_bitmap; u32 wr_bitmap = card->mp_wr_bitmap;
...@@ -1027,7 +1027,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter, ...@@ -1027,7 +1027,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
s32 f_aggr_cur = 0; s32 f_aggr_cur = 0;
struct sk_buff *skb_deaggr; struct sk_buff *skb_deaggr;
u32 pind; u32 pind;
u32 pkt_len, pkt_type = 0; u32 pkt_len, pkt_type, mport;
u8 *curr_ptr; u8 *curr_ptr;
u32 rx_len = skb->len; u32 rx_len = skb->len;
...@@ -1100,11 +1100,11 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter, ...@@ -1100,11 +1100,11 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
dev_dbg(adapter->dev, "info: do_rx_aggr: num of packets: %d\n", dev_dbg(adapter->dev, "info: do_rx_aggr: num of packets: %d\n",
card->mpa_rx.pkt_cnt); card->mpa_rx.pkt_cnt);
mport = (adapter->ioport | 0x1000 |
(card->mpa_rx.ports << 4)) + card->mpa_rx.start_port;
if (mwifiex_read_data_sync(adapter, card->mpa_rx.buf, if (mwifiex_read_data_sync(adapter, card->mpa_rx.buf,
card->mpa_rx.buf_len, card->mpa_rx.buf_len, mport, 1))
(adapter->ioport | 0x1000 |
(card->mpa_rx.ports << 4)) +
card->mpa_rx.start_port, 1))
goto error; goto error;
curr_ptr = card->mpa_rx.buf; curr_ptr = card->mpa_rx.buf;
...@@ -1333,7 +1333,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter) ...@@ -1333,7 +1333,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
* and return. * and return.
*/ */
static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter, static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
u8 *payload, u32 pkt_len, u8 port, u8 *payload, u32 pkt_len, u32 port,
u32 next_pkt_len) u32 next_pkt_len)
{ {
struct sdio_mmc_card *card = adapter->card; struct sdio_mmc_card *card = adapter->card;
...@@ -1342,6 +1342,7 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter, ...@@ -1342,6 +1342,7 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
s32 f_send_cur_buf = 0; s32 f_send_cur_buf = 0;
s32 f_precopy_cur_buf = 0; s32 f_precopy_cur_buf = 0;
s32 f_postcopy_cur_buf = 0; s32 f_postcopy_cur_buf = 0;
u32 mport;
if ((!card->mpa_tx.enabled) || (port == CTRL_PORT)) { if ((!card->mpa_tx.enabled) || (port == CTRL_PORT)) {
dev_dbg(adapter->dev, "info: %s: tx aggregation disabled\n", dev_dbg(adapter->dev, "info: %s: tx aggregation disabled\n",
...@@ -1418,11 +1419,10 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter, ...@@ -1418,11 +1419,10 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
dev_dbg(adapter->dev, "data: %s: send aggr buffer: %d %d\n", dev_dbg(adapter->dev, "data: %s: send aggr buffer: %d %d\n",
__func__, __func__,
card->mpa_tx.start_port, card->mpa_tx.ports); card->mpa_tx.start_port, card->mpa_tx.ports);
mport = (adapter->ioport | 0x1000 |
(card->mpa_tx.ports << 4)) + card->mpa_tx.start_port;
ret = mwifiex_write_data_to_card(adapter, card->mpa_tx.buf, ret = mwifiex_write_data_to_card(adapter, card->mpa_tx.buf,
card->mpa_tx.buf_len, card->mpa_tx.buf_len, mport);
(adapter->ioport | 0x1000 |
(card->mpa_tx.ports << 4)) +
card->mpa_tx.start_port);
MP_TX_AGGR_BUF_RESET(card); MP_TX_AGGR_BUF_RESET(card);
} }
...@@ -1462,7 +1462,7 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter, ...@@ -1462,7 +1462,7 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
int ret; int ret;
u32 buf_block_len; u32 buf_block_len;
u32 blk_size; u32 blk_size;
u8 port = CTRL_PORT; u32 port = CTRL_PORT;
u8 *payload = (u8 *)skb->data; u8 *payload = (u8 *)skb->data;
u32 pkt_len = skb->len; u32 pkt_len = skb->len;
......
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