]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ath10k: remove ar_pci->ce_count
authorMichal Kazior <michal.kazior@tieto.com>
Fri, 8 Nov 2013 07:01:23 +0000 (08:01 +0100)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 12 Nov 2013 18:06:44 +0000 (20:06 +0200)
It wasn't really useful to have it to begin with.
This makes it a little simpler to re-arrange PCI
init code as some function depended on
ar_pci->ce_count being set.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/ce.c
drivers/net/wireless/ath/ath10k/pci.c
drivers/net/wireless/ath/ath10k/pci.h

index d243f287fae7cfe4edccdec285eab3c25c5d7df8..2b99bd41dde3a8d09b865cf9dfed52af474ca551 100644 (file)
@@ -731,7 +731,6 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id)
 
 void ath10k_ce_per_engine_service_any(struct ath10k *ar)
 {
-       struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
        int ce_id, ret;
        u32 intr_summary;
 
@@ -741,7 +740,7 @@ void ath10k_ce_per_engine_service_any(struct ath10k *ar)
 
        intr_summary = CE_INTERRUPT_SUMMARY(ar);
 
-       for (ce_id = 0; intr_summary && (ce_id < ar_pci->ce_count); ce_id++) {
+       for (ce_id = 0; intr_summary && (ce_id < CE_COUNT); ce_id++) {
                if (intr_summary & (1 << ce_id))
                        intr_summary &= ~(1 << ce_id);
                else
@@ -785,16 +784,14 @@ static void ath10k_ce_per_engine_handler_adjust(struct ath10k_ce_pipe *ce_state,
 
 void ath10k_ce_disable_interrupts(struct ath10k *ar)
 {
-       struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
        int ce_id, ret;
 
        ret = ath10k_pci_wake(ar);
        if (ret)
                return;
 
-       for (ce_id = 0; ce_id < ar_pci->ce_count; ce_id++) {
-               struct ath10k_ce_pipe *ce_state = &ar_pci->ce_states[ce_id];
-               u32 ctrl_addr = ce_state->ctrl_addr;
+       for (ce_id = 0; ce_id < CE_COUNT; ce_id++) {
+               u32 ctrl_addr = ath10k_ce_base_address(ce_id);
 
                ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr);
        }
index 25ed07b96a1e3a682babc8914cf888b99a03df2f..f054d4c302453ab6c3c0c5d98c539ef3e5ce197d 100644 (file)
@@ -831,7 +831,7 @@ static int ath10k_pci_start_ce(struct ath10k *ar)
        spin_lock_init(&ar_pci->compl_lock);
        INIT_LIST_HEAD(&ar_pci->compl_process);
 
-       for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+       for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
                pipe_info = &ar_pci->pipe_info[pipe_num];
 
                spin_lock_init(&pipe_info->pipe_lock);
@@ -924,7 +924,7 @@ static void ath10k_pci_cleanup_ce(struct ath10k *ar)
        spin_unlock_bh(&ar_pci->compl_lock);
 
        /* Free unused completions for each pipe. */
-       for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+       for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
                pipe_info = &ar_pci->pipe_info[pipe_num];
 
                spin_lock_bh(&pipe_info->pipe_lock);
@@ -1166,7 +1166,7 @@ static int ath10k_pci_post_rx(struct ath10k *ar)
        const struct ce_attr *attr;
        int pipe_num, ret = 0;
 
-       for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+       for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
                pipe_info = &ar_pci->pipe_info[pipe_num];
                attr = &host_ce_config_wlan[pipe_num];
 
@@ -1295,7 +1295,7 @@ static void ath10k_pci_buffer_cleanup(struct ath10k *ar)
        struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
        int pipe_num;
 
-       for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+       for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
                struct ath10k_pci_pipe *pipe_info;
 
                pipe_info = &ar_pci->pipe_info[pipe_num];
@@ -1310,7 +1310,7 @@ static void ath10k_pci_ce_deinit(struct ath10k *ar)
        struct ath10k_pci_pipe *pipe_info;
        int pipe_num;
 
-       for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+       for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
                pipe_info = &ar_pci->pipe_info[pipe_num];
                if (pipe_info->ce_hdl) {
                        ath10k_ce_deinit(pipe_info->ce_hdl);
@@ -1755,7 +1755,7 @@ static int ath10k_pci_ce_init(struct ath10k *ar)
        const struct ce_attr *attr;
        int pipe_num;
 
-       for (pipe_num = 0; pipe_num < ar_pci->ce_count; pipe_num++) {
+       for (pipe_num = 0; pipe_num < CE_COUNT; pipe_num++) {
                pipe_info = &ar_pci->pipe_info[pipe_num];
                pipe_info->pipe_num = pipe_num;
                pipe_info->hif_ce_state = ar;
@@ -1772,13 +1772,12 @@ static int ath10k_pci_ce_init(struct ath10k *ar)
                        return -1;
                }
 
-               if (pipe_num == ar_pci->ce_count - 1) {
+               if (pipe_num == CE_COUNT - 1) {
                        /*
                         * Reserve the ultimate CE for
                         * diagnostic Window support
                         */
-                       ar_pci->ce_diag =
-                       ar_pci->pipe_info[ar_pci->ce_count - 1].ce_hdl;
+                       ar_pci->ce_diag = pipe_info->ce_hdl;
                        continue;
                }
 
@@ -2235,7 +2234,6 @@ static int ath10k_pci_start_intr(struct ath10k *ar)
 
 exit:
        ar_pci->num_msi_intrs = num;
-       ar_pci->ce_count = CE_COUNT;
        return ret;
 }
 
index a304c33849021f68a7867303929b5208f6ad4bfd..73a3d4ee6ebff5813dfabdd130971757926f1142 100644 (file)
@@ -199,9 +199,6 @@ struct ath10k_pci {
        struct tasklet_struct intr_tq;
        struct tasklet_struct msi_fw_err;
 
-       /* Number of Copy Engines supported */
-       unsigned int ce_count;
-
        int started;
 
        atomic_t keep_awake_count;