various cleanup patches
cover various cleanup patches
Bartosz Markowski (6):
ath10k: remove obsolete function prototype
ath10k: fix typo in ath10k Kconfig
ath10k: use if statement instead of cond. operator
ath10k: remove pointless goto label
ath10k: rename PCI target PS contol functions
ath10k: remove fw event chain for target dump notification
drivers/net/wireless/ath/ath10k/Kconfig | 2 +- drivers/net/wireless/ath/ath10k/ce.c | 63 +++++++++++++++---------------- drivers/net/wireless/ath/ath10k/core.c | 6 --- drivers/net/wireless/ath/ath10k/hif.h | 1 - drivers/net/wireless/ath/ath10k/htc.c | 9 ----- drivers/net/wireless/ath/ath10k/htc.h | 1 - drivers/net/wireless/ath/ath10k/htt.h | 3 +- drivers/net/wireless/ath/ath10k/pci.c | 28 +++++++------- drivers/net/wireless/ath/ath10k/pci.h | 12 +++--- 9 files changed, 52 insertions(+), 73 deletions(-)
Signature · 1 line
1.7.10
PATCH 1/6 ath10k: remove obsolete function prototype
--- drivers/net/wireless/ath/ath10k/htt.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/htt.h +1 -2
@@ -1310,9 +1310,8 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct htt_struct *htt);struct htt_tx_info *ath10k_htt_tx_info_alloc (struct htt_struct *htt);void ath10k_htt_tx_info_free (struct htt_struct *htt,struct htt_tx_info *pkt);void ath10k_htt_tx_info_unref (struct htt_struct *htt,struct htt_tx_info *pkt, -struct sk_buff *skb); +struct sk_buff *skb);struct htt_tx_info *ath10k_htt_tx_info_lookup (struct htt_struct *htt,u16 msdu_id); -void htt_t2h_stats_handler (struct htt_struct *htt,u8 *stats_msg_buf);int ath10k_htt_mgmt_tx (struct htt_struct *htt,struct sk_buff *);int ath10k_htt_tx (struct htt_struct *htt,struct sk_buff *);#endif
Signature · 1 line
1.7.10
PATCH 2/6 ath10k: fix typo in ath10k Kconfig
In reply to Bartosz Markowski--- drivers/net/wireless/ath/ath10k/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/Kconfig +1 -1
@@ -9,7 +9,7 @@ config ATH10K If you choose to build a module, it'll be called ath10k. config ATH10K_PCI - tristate "Atheros ath10 PCI support" + tristate "Atheros ath10k PCI support" depends on ATH10K && PCI ---help--- This module adds support for PCIE bus
Signature · 1 line
1.7.10
PATCH 3/6 ath10k: use if statement instead of cond. operator
In reply to Bartosz Markowski--- drivers/net/wireless/ath/ath10k/ce.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/ce.c +5 -2
@@ -292,8 +292,11 @@ static int ath10k_ce_completed_recv_next_nolock(struct ce_state *ce_state, *bufferp =__le32_to_cpu (sdesc.addr); *nbytesp = nbytes; *transfer_idp =MS (__le16_to_cpu (sdesc.flags),CE_DESC_FLAGS_META_DATA ); - *flagsp =__le16_to_cpu (sdesc.flags) &CE_DESC_FLAGS_BYTE_SWAP - ?CE_RECV_FLAG_SWAPPED :0 ; + +if (__le16_to_cpu (sdesc.flags) &CE_DESC_FLAGS_BYTE_SWAP ) + *flagsp =CE_RECV_FLAG_SWAPPED ; +else + *flagsp =0 ;if (per_transfer_contextp) *per_transfer_contextp =
Signature · 1 line
1.7.10
PATCH 4/6 ath10k: remove pointless goto label
In reply to Bartosz MarkowskiThere's nothing more than return call inside the label.
--- drivers/net/wireless/ath/ath10k/ce.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath10k/ce.c +2 -6
@@ -264,7 +264,6 @@ static int ath10k_ce_completed_recv_next_nolock(struct ce_state *ce_state,struct ce_ring_state *dest_ring = ce_state->dest_ring;unsigned int nentries_mask = dest_ring->nentries_mask;unsigned int sw_index = dest_ring->sw_index; -int ret;struct ce_desc *base = dest_ring->base_addr_owner_space;struct ce_desc *desc =CE_DEST_RING_TO_DESC (base, sw_index);
@@ -282,8 +281,7 @@ static int ath10k_ce_completed_recv_next_nolock(struct ce_state *ce_state,* corresponding descriptor has completed. We treat this * as a descriptor that is not yet done. */ - ret = -EIO ; - goto done; +return -EIO ; } desc->nbytes =0 ;
@@ -308,10 +306,8 @@ static int ath10k_ce_completed_recv_next_nolock(struct ce_state *ce_state,/* Update sw_index */ sw_index =CE_RING_IDX_INCR (nentries_mask, sw_index); dest_ring->sw_index = sw_index; - ret =0 ; -done: -return ret; +return 0 ; } int ath10k_ce_completed_recv_next(struct ce_state *ce_state,
Signature · 1 line
1.7.10
PATCH 5/6 ath10k: rename PCI target PS contol functions
In reply to Bartosz Markowski* TARGET_ACCESS_BEGIN() -> ath10k_pci_wake()
* TARGET_ACCESS_END() -> ath10k_pci_sleep()
--- drivers/net/wireless/ath/ath10k/ce.c | 48 ++++++++++++++++----------------- drivers/net/wireless/ath/ath10k/pci.c | 22 +++++++-------- drivers/net/wireless/ath/ath10k/pci.h | 12 ++++----- 3 files changed, 41 insertions(+), 41 deletions(-)
drivers/net/wireless/ath/ath10k/ce.c +24 -24
@@ -84,7 +84,7 @@ static int ath10k_ce_send_nolock(struct ce_state *ce_state,WARN_ON (nbytes > ce_state->src_sz_max); -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);if (unlikely (CE_RING_DELTA (nentries_mask, write_index, sw_index -1 ) <=0 )) {
@@ -119,7 +119,7 @@ static int ath10k_ce_send_nolock(struct ce_state *ce_state, src_ring->write_index = write_index; exit: -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);return ret; }
@@ -223,7 +223,7 @@ int ath10k_ce_recv_buf_enqueue(struct ce_state *ce_state, write_index = dest_ring->write_index; sw_index = dest_ring->sw_index; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);if (CE_RING_DELTA (nentries_mask, write_index, sw_index -1 ) >0 ) {struct ce_desc *base = dest_ring->base_addr_owner_space;
@@ -244,7 +244,7 @@ int ath10k_ce_recv_buf_enqueue(struct ce_state *ce_state, }else { ret = -EIO ; } -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);spin_unlock_bh (&ar_pci->ce_lock);return ret;
@@ -411,10 +411,10 @@ static int ath10k_ce_completed_send_next_nolock(struct ce_state *ce_state,* the SW has really caught up to the HW, or if the cached * value of the HW index has become stale. */ -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); src_ring->hw_index =CE_SRC_RING_READ_IDX_GET (targid, ctrl_addr); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); } read_index = src_ring->hw_index;
@@ -540,7 +540,7 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id)unsigned int id;unsigned int flags; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);spin_lock_bh (&ar_pci->ce_lock);/* Clear the copy-complete interrupts that will be handled here. */
@@ -588,7 +588,7 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id) CE_WATERMARK_MASK);spin_unlock_bh (&ar_pci->ce_lock); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); }/*
@@ -604,7 +604,7 @@ void ath10k_ce_per_engine_service_any(struct ath10k *ar)int ce_id;u32 intr_summary; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); intr_summary =CE_INTERRUPT_SUMMARY (ar, targid);for (ce_id =0 ; intr_summary && (ce_id < ar_pci->ce_count); ce_id++) {
@@ -617,7 +617,7 @@ void ath10k_ce_per_engine_service_any(struct ath10k *ar)ath10k_ce_per_engine_service (ar, ce_id); } -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); }/*
@@ -635,7 +635,7 @@ static void ath10k_ce_per_engine_handler_adjust(struct ce_state *ce_state,struct ath10k_pci *ar_pci =ath10k_pci_priv (ar);void __iomem *targid = ar_pci->mem; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);if ((!disable_copy_compl_intr) && (ce_state->send_cb || ce_state->recv_cb)) {
@@ -646,7 +646,7 @@ static void ath10k_ce_per_engine_handler_adjust(struct ce_state *ce_state,CE_WATERMARK_INTR_DISABLE (ar, targid, ctrl_addr); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); }void ath10k_ce_disable_interrupts (struct ath10k *ar)
@@ -655,14 +655,14 @@ void ath10k_ce_disable_interrupts(struct ath10k *ar)void __iomem *targid = ar_pci->mem;int ce_id; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);for (ce_id =0 ; ce_id < ar_pci->ce_count; ce_id++) {struct ce_state *ce_state = ar_pci->ce_id_to_state[ce_id];u32 ctrl_addr = ce_state->ctrl_addr;CE_COPY_COMPLETE_INTR_DISABLE (ar, targid, ctrl_addr); } -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); } void ath10k_ce_send_cb_register(struct ce_state *ce_state,
@@ -721,12 +721,12 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar, src_ring->nentries = nentries; src_ring->nentries_mask = nentries -1 ; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); src_ring->hw_index = src_ring->sw_index =CE_SRC_RING_READ_IDX_GET (targid, ctrl_addr); src_ring->write_index =CE_SRC_RING_WRITE_IDX_GET (targid, ctrl_addr); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); src_ring->per_transfer_context = (void **)ptr;
@@ -768,7 +768,7 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar, (((size_t ) src_ring->shadow_base_unaligned +CE_DESC_RING_ALIGN -1 ) & ~(CE_DESC_RING_ALIGN -1 )); -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);CE_SRC_RING_BASE_ADDR_SET (ar, targid, ctrl_addr, src_ring->base_addr_ce_space);CE_SRC_RING_SZ_SET (ar, targid, ctrl_addr, nentries);
@@ -777,7 +777,7 @@ static int ath10k_ce_init_src_ring(struct ath10k *ar,CE_SRC_RING_BYTE_SWAP_SET (ar, targid, ctrl_addr,0 );CE_SRC_RING_LOWMARK_SET (ar, targid, ctrl_addr,0 );CE_SRC_RING_HIGHMARK_SET (ar, targid, ctrl_addr, nentries); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);return 0 ; }
@@ -813,10 +813,10 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar, dest_ring->nentries = nentries; dest_ring->nentries_mask = nentries -1 ; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); dest_ring->sw_index =CE_DEST_RING_READ_IDX_GET (targid, ctrl_addr); dest_ring->write_index =CE_DEST_RING_WRITE_IDX_GET (targid, ctrl_addr); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); dest_ring->per_transfer_context = (void **)ptr;
@@ -853,14 +853,14 @@ static int ath10k_ce_init_dest_ring(struct ath10k *ar, dest_ring->base_addr_owner_space_unaligned; } -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);CE_DEST_RING_BASE_ADDR_SET (ar, targid, ctrl_addr, dest_ring->base_addr_ce_space);CE_DEST_RING_SZ_SET (ar, targid, ctrl_addr, nentries);CE_DEST_RING_BYTE_SWAP_SET (ar, targid, ctrl_addr,0 );CE_DEST_RING_LOWMARK_SET (ar, targid, ctrl_addr,0 );CE_DEST_RING_HIGHMARK_SET (ar, targid, ctrl_addr, nentries); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);return 0 ; }
@@ -936,9 +936,9 @@ struct ce_state *ath10k_ce_init(struct ath10k *ar, }/* Enable CE error interrupts */ -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);CE_ERROR_INTR_ENABLE (ar, targid, ctrl_addr); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);return ce_state; }
drivers/net/wireless/ath/ath10k/pci.c +11 -11
@@ -173,10 +173,10 @@ static int ath10k_pci_diag_read_mem(struct ath10k *ar, u32 address, u8 *data,* convert it from Target CPU virtual address space * to CE address space */ -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); address =TARG_CPU_SPACE_TO_CE_SPACE (ar, ar_pci->mem, address); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); ret =ath10k_ce_send (ce_diag,NULL , (u32 )address, nbytes,0 ,0 );
@@ -259,9 +259,9 @@ static int ath10k_pci_diag_read_access(struct ath10k *ar, u32 address, u32 *data targid = ar_pci->mem; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); *data =TARGET_READ (targid, address); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);return 0 ; } }
@@ -315,9 +315,9 @@ static int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address, u8 *data,* to * CE address space */ -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); address =TARG_CPU_SPACE_TO_CE_SPACE (ar, ar_pci->mem, address); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); remaining_bytes = orig_nbytes; ce_data = ce_data_base;
@@ -414,9 +414,9 @@ static int ath10k_pci_diag_write_access(struct ath10k *ar, u32 address, targid = ar_pci->mem; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar);TARGET_WRITE (ar, targid, address, data); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);return 0 ; }
@@ -1707,7 +1707,7 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)void __iomem *targid = ar_pci->mem;u32 fw_indicator_address, fw_indicator; -TARGET_ACCESS_BEGIN (ar); +ath10k_pci_wake (ar); fw_indicator_address = ar_pci->fw_indicator_address; fw_indicator =TARGET_READ (targid, fw_indicator_address);
@@ -1716,7 +1716,7 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)/* ACK: clear Target-side pending event */ TARGET_WRITE (ar, targid, fw_indicator_address, fw_indicator & ~FW_IND_EVENT_PENDING_T (ar)); -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar);if (ar_pci->started) {ath10k_pci_hif_dump_area (ar);
@@ -1729,7 +1729,7 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar)ath10k_warn ("early firmware event indicated\n" ); } }else { -TARGET_ACCESS_END (ar); +ath10k_pci_sleep (ar); } }
drivers/net/wireless/ath/ath10k/pci.h +6 -6
@@ -291,16 +291,16 @@ static inline void pci_write32_v1_workaround(struct ath10k *ar,* for use with these interfaces. * * Use TARGET_READ and TARGET_WRITE to access Target space. -* These calls must be bracketed by TARGET_ACCESS_BEGIN and -* TARGET_ACCESS_END. A single BEGIN/END pair is adequate for +* These calls must be bracketed by ath10k_pci_wake and +* ath10k_pci_sleep. A single BEGIN/END pair is adequate for * multiple READ/WRITE operations. * -* Use TARGET_ACCESS_BEGIN to put the Target in a state in +* Use ath10k_pci_wake to put the Target in a state in * which it is legal for the Host to directly access it. This * may involve waking the Target from a low power state, which * may take up to 2Ms! * -* Use TARGET_ACCESS_END to tell the Target that as far as +* Use ath10k_pci_sleep to tell the Target that as far as * this code path is concerned, it no longer needs to remain * directly accessible. BEGIN/END is under a reference counter; * multiple code paths may issue BEGIN/END on a single targid.
@@ -351,13 +351,13 @@ void ath10k_pci_target_ps_control(struct ath10k *ar,bool sleep_ok, bool wait_for_it); -static inline void TARGET_ACCESS_BEGIN (struct ath10k *ar) +static inline void ath10k_pci_wake (struct ath10k *ar) {if (ath10k_target_ps)ath10k_pci_target_ps_control (ar, false, true); } -static inline void TARGET_ACCESS_END (struct ath10k *ar) +static inline void ath10k_pci_sleep (struct ath10k *ar) {if (ath10k_target_ps)ath10k_pci_target_ps_control (ar, true, false);
Signature · 1 line
1.7.10
PATCH 6/6 ath10k: remove fw event chain for target dump notification
In reply to Bartosz MarkowskiWe throw the FW dump registers straight from the bottom layers, there's no recovery or any logic up, so get rid of the callbacks chain for now.
--- drivers/net/wireless/ath/ath10k/core.c | 6 ------ drivers/net/wireless/ath/ath10k/hif.h | 1 - drivers/net/wireless/ath/ath10k/htc.c | 9 --------- drivers/net/wireless/ath/ath10k/htc.h | 1 - drivers/net/wireless/ath/ath10k/pci.c | 6 ++---- 5 files changed, 2 insertions(+), 21 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +0 -6
@@ -68,11 +68,6 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { }, }; -static void ath10k_target_failure (struct ath10k *ar,int status) -{ -ath10k_dbg (ATH10K_DBG_CORE ,"%s\n" , __func__); -} -static void ath10k_send_suspend_complete (struct ath10k *ar) {ath10k_dbg (ATH10K_DBG_CORE ,"%s\n" , __func__);
@@ -565,7 +560,6 @@ int ath10k_core_register(struct ath10k *ar) goto err; } - htc_cb.target_failure = ath10k_target_failure; htc_cb.target_send_suspend_complete = ath10k_send_suspend_complete; ar->htc_handle =ath10k_htc_create (ar, &htc_cb);
drivers/net/wireless/ath/ath10k/hif.h +0 -1
@@ -44,7 +44,6 @@ struct ath10k_hif_cb {int (*rx_completion_handler)(struct ath10k *ar,struct sk_buff *wbuf,u8 pipe_id); -void (*fw_event_handler)(struct ath10k *ar); };struct ath10k_hif_ops {
drivers/net/wireless/ath/ath10k/htc.c +0 -9
@@ -380,14 +380,6 @@ static void ath10k_htc_flush_endpoint_tx(struct htc_target *target,/* Receive */ /***********/ -static void ath10k_htc_fw_event_handler (struct ath10k *ar) -{ -struct htc_target *target = ar->htc_handle; -struct htc_target_cb *htc_cb = &target->htc_cb; - - htc_cb->target_failure (ar, -EINVAL ); -} - static void ath10k_htc_process_credit_report(struct htc_target *target, const struct htc_credit_report *report, int len,
@@ -1024,7 +1016,6 @@ struct htc_target *ath10k_htc_create(struct ath10k *ar,/* setup HIF layer callbacks */ htc_callbacks.rx_completion_handler = ath10k_htc_rx_completion_handler; htc_callbacks.tx_completion_handler = ath10k_htc_tx_completion_handler; - htc_callbacks.fw_event_handler = ath10k_htc_fw_event_handler; target->ar = ar;/* Get HIF default pipe for HTC message exchange */
drivers/net/wireless/ath/ath10k/htc.h +0 -1
@@ -73,7 +73,6 @@ enum htc_endpoint_id { };struct htc_target_cb { -void (*target_failure)(struct ath10k *ar,int status);void (*target_send_suspend_complete)(struct ath10k *ar); };
drivers/net/wireless/ath/ath10k/pci.c +2 -4
@@ -1703,7 +1703,6 @@ void ath10k_pci_target_ps_control(struct ath10k *ar, bool sleep_ok,static void ath10k_pci_fw_interrupt_handler (struct ath10k *ar) {struct ath10k_pci *ar_pci =ath10k_pci_priv (ar); -struct ath10k_hif_cb *msg_callbacks = &ar_pci->msg_callbacks_current;void __iomem *targid = ar_pci->mem;u32 fw_indicator_address, fw_indicator;
@@ -1718,10 +1717,9 @@ static void ath10k_pci_fw_interrupt_handler(struct ath10k *ar) fw_indicator & ~FW_IND_EVENT_PENDING_T(ar));ath10k_pci_sleep (ar); -if (ar_pci->started) { +if (ar_pci->started)ath10k_pci_hif_dump_area (ar); - msg_callbacks->fw_event_handler (ar); - }else { +else {/* * Probable Target failure before we're prepared * to handle it. Generally unexpected.
Signature · 1 line
1.7.10
cover various cleanup patches
In reply to Bartosz MarkowskiQuoted 7 lines · Bartosz Markowski
Bartosz Markowski (6):
ath10k: remove obsolete function prototype
ath10k: fix typo in ath10kKconfig
ath10k: use if statement instead of cond. operator
ath10k: remove pointless goto label
ath10k: rename PCI target PS contol functions
ath10k: remove fw event chain for target dump notification
Thanks, all six applied.
Signature · 1 line
Kalle Valo