Skip to content

Commit

Permalink
Merge branch 'for-linville' of git://github.com/kvalo/ath
Browse files Browse the repository at this point in the history
  • Loading branch information
John W. Linville committed May 30, 2014
2 parents 57afc62 + 08b8aa0 commit 8f1e5d3
Show file tree
Hide file tree
Showing 15 changed files with 534 additions and 305 deletions.
3 changes: 2 additions & 1 deletion drivers/net/wireless/ath/ath10k/bmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ int ath10k_bmi_write_memory(struct ath10k *ar, u32 address,
\
addr = host_interest_item_address(HI_ITEM(item)); \
ret = ath10k_bmi_read_memory(ar, addr, (u8 *)&tmp, 4); \
*val = __le32_to_cpu(tmp); \
if (!ret) \
*val = __le32_to_cpu(tmp); \
ret; \
})

Expand Down
27 changes: 27 additions & 0 deletions drivers/net/wireless/ath/ath10k/ce.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,33 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
return ret;
}

void __ath10k_ce_send_revert(struct ath10k_ce_pipe *pipe)
{
struct ath10k *ar = pipe->ar;
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
struct ath10k_ce_ring *src_ring = pipe->src_ring;
u32 ctrl_addr = pipe->ctrl_addr;

lockdep_assert_held(&ar_pci->ce_lock);

/*
* This function must be called only if there is an incomplete
* scatter-gather transfer (before index register is updated)
* that needs to be cleaned up.
*/
if (WARN_ON_ONCE(src_ring->write_index == src_ring->sw_index))
return;

if (WARN_ON_ONCE(src_ring->write_index ==
ath10k_ce_src_ring_write_index_get(ar, ctrl_addr)))
return;

src_ring->write_index--;
src_ring->write_index &= src_ring->nentries_mask;

src_ring->per_transfer_context[src_ring->write_index] = NULL;
}

int ath10k_ce_send(struct ath10k_ce_pipe *ce_state,
void *per_transfer_context,
u32 buffer,
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath10k/ce.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state,
unsigned int transfer_id,
unsigned int flags);

void __ath10k_ce_send_revert(struct ath10k_ce_pipe *pipe);

void ath10k_ce_send_cb_register(struct ath10k_ce_pipe *ce_state,
void (*send_cb)(struct ath10k_ce_pipe *),
int disable_interrupts);
Expand Down
Loading

0 comments on commit 8f1e5d3

Please sign in to comment.