From patchwork Fri Jul 22 05:41:51 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 998132 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6M5hNcr009239 for ; Fri, 22 Jul 2011 05:43:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753353Ab1GVFnS (ORCPT ); Fri, 22 Jul 2011 01:43:18 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:28154 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753052Ab1GVFnQ (ORCPT ); Fri, 22 Jul 2011 01:43:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=kvalo@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1311313396; x=1342849396; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; z=From:=20Kalle=20Valo=20|To:=20|CC:=20,=20Vasanthakumar=20Thiagarajan=0D=0A=09|Subject:=20[PATCH=2018/31]=20ath6kl:=20Mov e=20block_sz=20and=20block_mask=20from=20ath6kl_device=20 to=20htc_target|Date:=20Fri,=2022=20Jul=202011=2008:41:51 =20+0300|Message-ID:=20<1311313324-6766-20-git-send-email -kvalo@qca.qualcomm.com>|In-Reply-To:=20<1311313324-6766- 1-git-send-email-kvalo@qca.qualcomm.com>|References:=20<1 311313324-6766-1-git-send-email-kvalo@qca.qualcomm.com> |MIME-Version:=201.0; bh=NRHFDyf0zo9URLL5+rsyhdJQzvll78YD0u7HN0ekaYE=; b=h/tMCav/uBNl6154OO6l2Xcx773gD8e3q/o5SvNB3DDiyRvRDd8To3cO BGsxF136b0r+fMMqCGLsPje5ViKPKVP6zxhjJ9iecnK53Pnp9aMvbtbwG 32ZmUqDrSz/w+TfkXoUzIlKsdRQpnKezyFajGP804p5DbGmr03X6pOCt4 o=; X-IronPort-AV: E=McAfee;i="5400,1158,6414"; a="105201619" Received: from ironmsg03-l.qualcomm.com ([172.30.48.18]) by wolverine01.qualcomm.com with ESMTP; 21 Jul 2011 22:43:16 -0700 X-IronPort-AV: E=Sophos;i="4.67,244,1309762800"; d="scan'208";a="52132739" Received: from nasanexhub04.qualcomm.com (HELO nasanexhub04.na.qualcomm.com) ([129.46.134.222]) by Ironmsg03-L.qualcomm.com with ESMTP/TLS/RC4-MD5; 21 Jul 2011 22:43:16 -0700 Received: from NASJOEXHC01.na.qualcomm.com (10.234.56.15) by nasanexhub04.na.qualcomm.com (129.46.134.222) with Microsoft SMTP Server (TLS) id 8.3.83.0; Thu, 21 Jul 2011 22:43:15 -0700 Received: from localhost.localdomain (10.234.11.69) by qcamail1.atheros.com (10.234.56.15) with Microsoft SMTP Server (TLS) id 14.1.323.0; Thu, 21 Jul 2011 22:43:11 -0700 From: Kalle Valo To: CC: , Vasanthakumar Thiagarajan Subject: [PATCH 18/31] ath6kl: Move block_sz and block_mask from ath6kl_device to htc_target Date: Fri, 22 Jul 2011 08:41:51 +0300 Message-ID: <1311313324-6766-20-git-send-email-kvalo@qca.qualcomm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1311313324-6766-1-git-send-email-kvalo@qca.qualcomm.com> References: <1311313324-6766-1-git-send-email-kvalo@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.234.11.69] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 22 Jul 2011 05:43:23 +0000 (UTC) From: Vasanthakumar Thiagarajan Signed-off-by: Vasanthakumar Thiagarajan Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath6kl/htc.c | 14 +++++++------- drivers/net/wireless/ath/ath6kl/htc.h | 3 +++ drivers/net/wireless/ath/ath6kl/htc_hif.c | 8 ++++---- drivers/net/wireless/ath/ath6kl/htc_hif.h | 2 -- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c index 1964059..ce5c082 100644 --- a/drivers/net/wireless/ath/ath6kl/htc.c +++ b/drivers/net/wireless/ath/ath6kl/htc.c @@ -181,7 +181,7 @@ static int htc_issue_send(struct htc_target *target, struct htc_packet *packet) ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "%s: transmit len : %d (%s)\n", __func__, send_len, sync ? "sync" : "async"); - padded_len = CALC_TXRX_PADDED_LEN(target->dev, send_len); + padded_len = CALC_TXRX_PADDED_LEN(target, send_len); ath6kl_dbg(ATH6KL_DBG_HTC_SEND, "DevSendPacket, padded len: %d mbox:0x%X (mode:%s)\n", @@ -287,7 +287,7 @@ static void htc_tx_pkts_get(struct htc_target *target, "got head pkt:0x%p , queue depth: %d\n", packet, get_queue_depth(&endpoint->txq)); - len = CALC_TXRX_PADDED_LEN(target->dev, + len = CALC_TXRX_PADDED_LEN(target, packet->act_len + HTC_HDR_LENGTH); if (htc_check_credits(target, endpoint, &flags, @@ -365,7 +365,7 @@ static int htc_setup_send_scat_list(struct htc_target *target, break; packet = list_first_entry(queue, struct htc_packet, list); - len = CALC_TXRX_PADDED_LEN(target->dev, + len = CALC_TXRX_PADDED_LEN(target, packet->act_len + HTC_HDR_LENGTH); cred_pad = htc_get_credit_padding(target->tgt_cred_sz, @@ -904,7 +904,7 @@ static int dev_rx_pkt(struct htc_target *target, struct htc_packet *packet, u32 padded_len; int status; - padded_len = CALC_TXRX_PADDED_LEN(dev, rx_len); + padded_len = CALC_TXRX_PADDED_LEN(target, rx_len); if (padded_len > packet->buf_len) { ath6kl_err("not enough receive space for packet - padlen:%d recvlen:%d bufferlen:%d\n", @@ -972,7 +972,7 @@ static int htc_setup_rxpkts(struct htc_target *target, struct htc_endpoint *ep, int status = 0, j, full_len; bool no_recycle; - full_len = CALC_TXRX_PADDED_LEN(target->dev, + full_len = CALC_TXRX_PADDED_LEN(target, le16_to_cpu(htc_hdr->payld_len) + sizeof(*htc_hdr)); @@ -1571,7 +1571,7 @@ static int htc_issue_rxpkt_bundle(struct htc_target *target, packet = list_first_entry(rxq, struct htc_packet, list); list_del(&packet->list); - pad_len = CALC_TXRX_PADDED_LEN(target->dev, + pad_len = CALC_TXRX_PADDED_LEN(target, packet->act_len); if ((rem_space - pad_len) < 0) { @@ -2202,7 +2202,7 @@ static void htc_setup_msg_bndl(struct htc_target *target) if (target->max_rx_bndl_sz) target->rx_bndl_enable = true; - if ((target->tgt_cred_sz % target->dev->block_sz) != 0) { + if ((target->tgt_cred_sz % target->block_sz) != 0) { ath6kl_warn("credit size: %d is not block aligned! Disabling send bundling\n", target->tgt_cred_sz); diff --git a/drivers/net/wireless/ath/ath6kl/htc.h b/drivers/net/wireless/ath/ath6kl/htc.h index a8a76a9..26e6b93 100644 --- a/drivers/net/wireless/ath/ath6kl/htc.h +++ b/drivers/net/wireless/ath/ath6kl/htc.h @@ -530,6 +530,9 @@ struct htc_target { int rx_bndl_enable; int max_rx_bndl_sz; int max_tx_bndl_sz; + + u32 block_sz; + u32 block_mask; }; void *htc_create(struct ath6kl *ar); diff --git a/drivers/net/wireless/ath/ath6kl/htc_hif.c b/drivers/net/wireless/ath/ath6kl/htc_hif.c index 386bc28..9904bee 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_hif.c +++ b/drivers/net/wireless/ath/ath6kl/htc_hif.c @@ -615,19 +615,19 @@ int ath6kldev_setup(struct ath6kl_device *dev) * for SDIO the block size on mailbox 0 is artificially set to 1. * So we use the block size that is set for the other 3 mailboxes. */ - dev->block_sz = dev->ar->mbox_info.block_size; + dev->htc_cnxt->block_sz = dev->ar->mbox_info.block_size; /* must be a power of 2 */ - if ((dev->block_sz & (dev->block_sz - 1)) != 0) { + if ((dev->htc_cnxt->block_sz & (dev->htc_cnxt->block_sz - 1)) != 0) { WARN_ON(1); goto fail_setup; } /* assemble mask, used for padding to a block */ - dev->block_mask = dev->block_sz - 1; + dev->htc_cnxt->block_mask = dev->htc_cnxt->block_sz - 1; ath6kl_dbg(ATH6KL_DBG_TRC, "block size: %d, mbox addr:0x%X\n", - dev->block_sz, dev->ar->mbox_info.htc_addr); + dev->htc_cnxt->block_sz, dev->ar->mbox_info.htc_addr); ath6kl_dbg(ATH6KL_DBG_TRC, "hif interrupt processing is sync only\n"); diff --git a/drivers/net/wireless/ath/ath6kl/htc_hif.h b/drivers/net/wireless/ath/ath6kl/htc_hif.h index 024f2b6..cf5bee0 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_hif.h +++ b/drivers/net/wireless/ath/ath6kl/htc_hif.h @@ -79,8 +79,6 @@ struct ath6kl_device { u8 pad2[A_CACHE_LINE_PAD]; struct ath6kl_irq_enable_reg irq_en_reg; u8 pad3[A_CACHE_LINE_PAD]; - u32 block_sz; - u32 block_mask; struct htc_target *htc_cnxt; struct hif_dev_scat_sup_info hif_scat_info; int chk_irq_status_cnt;