Linux wireless drivers development
 help / color / mirror / Atom feed
From: Bing Zhao <bzhao@marvell.com>
To: <linux-wireless@vger.kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Daniel Drake <dsd@laptop.org>, Paul Fox <pgf@laptop.org>,
	Tim Shepard <shep@laptop.org>, Jason Abele <jabele@chromium.org>,
	John Rhodes <jrhodes@marvell.com>,
	Amitkumar Karwar <akarwar@marvell.com>,
	Avinash Patil <patila@marvell.com>,
	Yogesh Ashok Powar <yogeshp@marvell.com>,
	Nishant Sarmukadam <nishants@marvell.com>,
	Frank Huang <frankh@marvell.com>, Bing Zhao <bzhao@marvell.com>
Subject: [PATCH 13/17] mwifiex: do port calculations separately
Date: Mon, 13 May 2013 18:14:57 -0700	[thread overview]
Message-ID: <1368494101-23651-14-git-send-email-bzhao@marvell.com> (raw)
In-Reply-To: <1368494101-23651-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

This patch rearranges the code for better readability

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/sdio.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index a18a5b4..d4c04c1 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -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
  * 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;
 	u32 wr_bitmap = card->mp_wr_bitmap;
@@ -1027,7 +1027,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
 	s32 f_aggr_cur = 0;
 	struct sk_buff *skb_deaggr;
 	u32 pind;
-	u32 pkt_len, pkt_type = 0;
+	u32 pkt_len, pkt_type, tport;
 	u8 *curr_ptr;
 	u32 rx_len = skb->len;
 
@@ -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",
 			card->mpa_rx.pkt_cnt);
 
+		tport = (adapter->ioport | 0x1000 |
+			 (card->mpa_rx.ports << 4)) + card->mpa_rx.start_port;
+
 		if (mwifiex_read_data_sync(adapter, card->mpa_rx.buf,
-					   card->mpa_rx.buf_len,
-					   (adapter->ioport | 0x1000 |
-					    (card->mpa_rx.ports << 4)) +
-					   card->mpa_rx.start_port, 1))
+					   card->mpa_rx.buf_len, tport, 1))
 			goto error;
 
 		curr_ptr = card->mpa_rx.buf;
@@ -1333,7 +1333,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
  * and return.
  */
 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)
 {
 	struct sdio_mmc_card *card = adapter->card;
@@ -1418,11 +1418,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",
 			__func__,
 				card->mpa_tx.start_port, card->mpa_tx.ports);
+		port = (adapter->ioport | 0x1000 |
+			(card->mpa_tx.ports << 4)) + card->mpa_tx.start_port;
 		ret = mwifiex_write_data_to_card(adapter, card->mpa_tx.buf,
-						 card->mpa_tx.buf_len,
-						 (adapter->ioport | 0x1000 |
-						 (card->mpa_tx.ports << 4)) +
-						  card->mpa_tx.start_port);
+						 card->mpa_tx.buf_len, port);
 
 		MP_TX_AGGR_BUF_RESET(card);
 	}
@@ -1462,7 +1461,7 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
 	int ret;
 	u32 buf_block_len;
 	u32 blk_size;
-	u8 port = CTRL_PORT;
+	u32 port = CTRL_PORT;
 	u8 *payload = (u8 *)skb->data;
 	u32 pkt_len = skb->len;
 
-- 
1.8.2.3


  parent reply	other threads:[~2013-05-14  1:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14  1:14 [PATCH 00/17] mwifiex updates for 3.11 Bing Zhao
2013-05-14  1:14 ` [PATCH 01/17] mwifiex: rename mwifiex_free_adapter() routine in init.c Bing Zhao
2013-05-14  1:14 ` [PATCH 02/17] mwifiex: scan delay timer cleanup in unload path Bing Zhao
2013-05-14  1:14 ` [PATCH 03/17] mwifiex: remove global user_scan_cfg variable Bing Zhao
2013-05-14  1:14 ` [PATCH 04/17] mwifiex: abort remaining scan commands when association started Bing Zhao
2013-05-14  1:14 ` [PATCH 05/17] mwifiex: avoid deleting all stations during mwifiex_del_sta_entry() Bing Zhao
2013-05-14  1:14 ` [PATCH 06/17] mwifiex: add del_station handler Bing Zhao
2013-05-14  1:14 ` [PATCH 07/17] mwifiex: replace spin_lock_irqsave with spin_lock and fix warn_on Bing Zhao
2013-05-14  1:14 ` [PATCH 08/17] mwifiex: add calibration data download feature Bing Zhao
2013-05-14  1:14 ` [PATCH 09/17] mwifiex: use u32 variables for SDIO read/write port bitmap Bing Zhao
2013-05-14  1:14 ` [PATCH 10/17] mwifiex: store SDIO chip specific information in separate structure Bing Zhao
2013-05-14  1:14 ` [PATCH 11/17] mwifiex: replace unnecessary u32 variables with u8 in sdio.c Bing Zhao
2013-05-14  1:14 ` [PATCH 12/17] mwifiex: code rearrangement in mwifiex_get_rd_port() Bing Zhao
2013-05-14  1:14 ` Bing Zhao [this message]
2013-05-14  1:14 ` [PATCH 14/17] mwifiex: define a macro for MPA base address Bing Zhao
2013-05-14  1:14 ` [PATCH 15/17] mwifiex: remove unnecessary macros in sdio.h Bing Zhao
2013-05-14  1:15 ` [PATCH 16/17] mwifiex: code rearrangement in multiport aggregation path Bing Zhao
2013-05-14  1:15 ` [PATCH 17/17] mwifiex: add support for Marvell SD8897 chipset Bing Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368494101-23651-14-git-send-email-bzhao@marvell.com \
    --to=bzhao@marvell.com \
    --cc=akarwar@marvell.com \
    --cc=dsd@laptop.org \
    --cc=frankh@marvell.com \
    --cc=jabele@chromium.org \
    --cc=jrhodes@marvell.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=nishants@marvell.com \
    --cc=patila@marvell.com \
    --cc=pgf@laptop.org \
    --cc=shep@laptop.org \
    --cc=yogeshp@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox