ath6kl: Move block_sz and block_mask from ath6kl_device to htc_target
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Mon, 18 Jul 2011 08:53:28 +0000 (14:23 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 9 Aug 2011 16:45:21 +0000 (19:45 +0300)
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/htc.c
drivers/net/wireless/ath/ath6kl/htc.h
drivers/net/wireless/ath/ath6kl/htc_hif.c
drivers/net/wireless/ath/ath6kl/htc_hif.h

index 1964059c1492a5dfac89a76133fae332cff145b7..ce5c0829c957f0a426a67c9e32ec151dc1df719a 100644 (file)
@@ -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);
 
index a8a76a926dc35a776efc5ed3f63ed03520285d66..26e6b93aa532ad54736ec07b3979873c9d97f3b9 100644 (file)
@@ -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);
index 386bc2874bb558aa1a844b0a2f198c9f56b47282..9904beee55c15dd6d9f38ed688b3e7df5ff38bc4 100644 (file)
@@ -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");
index 024f2b69082888765d9c236eaa3be38bcd60eae1..cf5bee0ff7879fa83817ae902a4e889ab5cd0c06 100644 (file)
@@ -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;