qcacmn: Update driver to use QDF NBUF APIs(2/2)
Update driver to use QDF NBUF APIs Change-Id: I555c739660e62e6d0237c65c57bcb169fec11cf4 CRs-Fixed: 981187
This commit is contained in:
@@ -149,7 +149,7 @@ int ce_send(struct CE_handle *copyeng,
|
|||||||
unsigned int user_flags);
|
unsigned int user_flags);
|
||||||
|
|
||||||
#ifdef WLAN_FEATURE_FASTPATH
|
#ifdef WLAN_FEATURE_FASTPATH
|
||||||
int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
|
int ce_send_fast(struct CE_handle *copyeng, qdf_nbuf_t *msdus,
|
||||||
unsigned int num_msdus, unsigned int transfer_id);
|
unsigned int num_msdus, unsigned int transfer_id);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -556,7 +556,7 @@ void hif_detach_htc(struct hif_opaque_softc *hif_ctx)
|
|||||||
QDF_STATUS
|
QDF_STATUS
|
||||||
hif_send_head(struct hif_opaque_softc *hif_ctx,
|
hif_send_head(struct hif_opaque_softc *hif_ctx,
|
||||||
uint8_t pipe, unsigned int transfer_id, unsigned int nbytes,
|
uint8_t pipe, unsigned int transfer_id, unsigned int nbytes,
|
||||||
cdf_nbuf_t nbuf, unsigned int data_attr)
|
qdf_nbuf_t nbuf, unsigned int data_attr)
|
||||||
{
|
{
|
||||||
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
|
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
|
||||||
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
|
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
|
||||||
@@ -567,7 +567,7 @@ hif_send_head(struct hif_opaque_softc *hif_ctx,
|
|||||||
int status, i = 0;
|
int status, i = 0;
|
||||||
unsigned int mux_id = 0;
|
unsigned int mux_id = 0;
|
||||||
|
|
||||||
QDF_ASSERT(nbytes <= cdf_nbuf_len(nbuf));
|
QDF_ASSERT(nbytes <= qdf_nbuf_len(nbuf));
|
||||||
|
|
||||||
transfer_id =
|
transfer_id =
|
||||||
(mux_id & MUX_ID_MASK) |
|
(mux_id & MUX_ID_MASK) |
|
||||||
@@ -586,8 +586,8 @@ hif_send_head(struct hif_opaque_softc *hif_ctx,
|
|||||||
qdf_dma_addr_t frag_paddr;
|
qdf_dma_addr_t frag_paddr;
|
||||||
int frag_bytes;
|
int frag_bytes;
|
||||||
|
|
||||||
frag_paddr = cdf_nbuf_get_frag_paddr(nbuf, nfrags);
|
frag_paddr = qdf_nbuf_get_frag_paddr(nbuf, nfrags);
|
||||||
frag_bytes = cdf_nbuf_get_frag_len(nbuf, nfrags);
|
frag_bytes = qdf_nbuf_get_frag_len(nbuf, nfrags);
|
||||||
/*
|
/*
|
||||||
* Clear the packet offset for all but the first CE desc.
|
* Clear the packet offset for all but the first CE desc.
|
||||||
*/
|
*/
|
||||||
@@ -597,7 +597,7 @@ hif_send_head(struct hif_opaque_softc *hif_ctx,
|
|||||||
status = ce_sendlist_buf_add(&sendlist, frag_paddr,
|
status = ce_sendlist_buf_add(&sendlist, frag_paddr,
|
||||||
frag_bytes >
|
frag_bytes >
|
||||||
bytes ? bytes : frag_bytes,
|
bytes ? bytes : frag_bytes,
|
||||||
cdf_nbuf_get_frag_is_wordstream
|
qdf_nbuf_get_frag_is_wordstream
|
||||||
(nbuf,
|
(nbuf,
|
||||||
nfrags) ? 0 :
|
nfrags) ? 0 :
|
||||||
CE_SEND_FLAG_SWAP_DISABLE,
|
CE_SEND_FLAG_SWAP_DISABLE,
|
||||||
@@ -626,10 +626,10 @@ hif_send_head(struct hif_opaque_softc *hif_ctx,
|
|||||||
return A_ERROR;
|
return A_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
NBUF_UPDATE_TX_PKT_COUNT(nbuf, NBUF_TX_PKT_HIF);
|
QDF_NBUF_UPDATE_TX_PKT_COUNT(nbuf, QDF_NBUF_TX_PKT_HIF);
|
||||||
DPTRACE(qdf_dp_trace(nbuf, QDF_DP_TRACE_HIF_PACKET_PTR_RECORD,
|
DPTRACE(qdf_dp_trace(nbuf, QDF_DP_TRACE_HIF_PACKET_PTR_RECORD,
|
||||||
(uint8_t *)(cdf_nbuf_data(nbuf)),
|
(uint8_t *)(qdf_nbuf_data(nbuf)),
|
||||||
sizeof(cdf_nbuf_data(nbuf))));
|
sizeof(qdf_nbuf_data(nbuf))));
|
||||||
status = ce_sendlist_send(ce_hdl, nbuf, &sendlist, transfer_id);
|
status = ce_sendlist_send(ce_hdl, nbuf, &sendlist, transfer_id);
|
||||||
QDF_ASSERT(status == QDF_STATUS_SUCCESS);
|
QDF_ASSERT(status == QDF_STATUS_SUCCESS);
|
||||||
|
|
||||||
@@ -703,7 +703,7 @@ hif_pci_ce_send_done(struct CE_handle *copyeng, void *ce_context,
|
|||||||
if (transfer_context != CE_SENDLIST_ITEM_CTXT) {
|
if (transfer_context != CE_SENDLIST_ITEM_CTXT) {
|
||||||
if (scn->target_status
|
if (scn->target_status
|
||||||
== OL_TRGET_STATUS_RESET)
|
== OL_TRGET_STATUS_RESET)
|
||||||
cdf_nbuf_free(transfer_context);
|
qdf_nbuf_free(transfer_context);
|
||||||
else
|
else
|
||||||
msg_callbacks->txCompletionHandler(
|
msg_callbacks->txCompletionHandler(
|
||||||
msg_callbacks->Context,
|
msg_callbacks->Context,
|
||||||
@@ -734,17 +734,17 @@ hif_pci_ce_send_done(struct CE_handle *copyeng, void *ce_context,
|
|||||||
* return: None
|
* return: None
|
||||||
*/
|
*/
|
||||||
static inline void hif_ce_do_recv(struct hif_msg_callbacks *msg_callbacks,
|
static inline void hif_ce_do_recv(struct hif_msg_callbacks *msg_callbacks,
|
||||||
cdf_nbuf_t netbuf, int nbytes,
|
qdf_nbuf_t netbuf, int nbytes,
|
||||||
struct HIF_CE_pipe_info *pipe_info) {
|
struct HIF_CE_pipe_info *pipe_info) {
|
||||||
if (nbytes <= pipe_info->buf_sz) {
|
if (nbytes <= pipe_info->buf_sz) {
|
||||||
cdf_nbuf_set_pktlen(netbuf, nbytes);
|
qdf_nbuf_set_pktlen(netbuf, nbytes);
|
||||||
msg_callbacks->
|
msg_callbacks->
|
||||||
rxCompletionHandler(msg_callbacks->Context,
|
rxCompletionHandler(msg_callbacks->Context,
|
||||||
netbuf, pipe_info->pipe_num);
|
netbuf, pipe_info->pipe_num);
|
||||||
} else {
|
} else {
|
||||||
HIF_ERROR("%s: Invalid Rx msg buf:%p nbytes:%d",
|
HIF_ERROR("%s: Invalid Rx msg buf:%p nbytes:%d",
|
||||||
__func__, netbuf, nbytes);
|
__func__, netbuf, nbytes);
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,14 +767,14 @@ hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context,
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
hif_pm_runtime_mark_last_busy(hif_sc->dev);
|
hif_pm_runtime_mark_last_busy(hif_sc->dev);
|
||||||
cdf_nbuf_unmap_single(scn->qdf_dev,
|
qdf_nbuf_unmap_single(scn->qdf_dev,
|
||||||
(cdf_nbuf_t) transfer_context,
|
(qdf_nbuf_t) transfer_context,
|
||||||
QDF_DMA_FROM_DEVICE);
|
QDF_DMA_FROM_DEVICE);
|
||||||
|
|
||||||
atomic_inc(&pipe_info->recv_bufs_needed);
|
atomic_inc(&pipe_info->recv_bufs_needed);
|
||||||
hif_post_recv_buffers_for_pipe(pipe_info);
|
hif_post_recv_buffers_for_pipe(pipe_info);
|
||||||
if (scn->target_status == OL_TRGET_STATUS_RESET)
|
if (scn->target_status == OL_TRGET_STATUS_RESET)
|
||||||
cdf_nbuf_free(transfer_context);
|
qdf_nbuf_free(transfer_context);
|
||||||
else
|
else
|
||||||
hif_ce_do_recv(msg_callbacks, transfer_context,
|
hif_ce_do_recv(msg_callbacks, transfer_context,
|
||||||
nbytes, pipe_info);
|
nbytes, pipe_info);
|
||||||
@@ -946,13 +946,13 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||||||
qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock);
|
qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock);
|
||||||
while (atomic_read(&pipe_info->recv_bufs_needed) > 0) {
|
while (atomic_read(&pipe_info->recv_bufs_needed) > 0) {
|
||||||
qdf_dma_addr_t CE_data; /* CE space buffer address */
|
qdf_dma_addr_t CE_data; /* CE space buffer address */
|
||||||
cdf_nbuf_t nbuf;
|
qdf_nbuf_t nbuf;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
atomic_dec(&pipe_info->recv_bufs_needed);
|
atomic_dec(&pipe_info->recv_bufs_needed);
|
||||||
qdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock);
|
qdf_spin_unlock_bh(&pipe_info->recv_bufs_needed_lock);
|
||||||
|
|
||||||
nbuf = cdf_nbuf_alloc(scn->qdf_dev, buf_sz, 0, 4, false);
|
nbuf = qdf_nbuf_alloc(scn->qdf_dev, buf_sz, 0, 4, false);
|
||||||
if (!nbuf) {
|
if (!nbuf) {
|
||||||
qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock);
|
qdf_spin_lock_bh(&pipe_info->recv_bufs_needed_lock);
|
||||||
pipe_info->nbuf_alloc_err_count++;
|
pipe_info->nbuf_alloc_err_count++;
|
||||||
@@ -968,12 +968,12 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cdf_nbuf_peek_header(nbuf, &data, &unused);
|
* qdf_nbuf_peek_header(nbuf, &data, &unused);
|
||||||
* CE_data = dma_map_single(dev, data, buf_sz, );
|
* CE_data = dma_map_single(dev, data, buf_sz, );
|
||||||
* DMA_FROM_DEVICE);
|
* DMA_FROM_DEVICE);
|
||||||
*/
|
*/
|
||||||
ret =
|
ret =
|
||||||
cdf_nbuf_map_single(scn->qdf_dev, nbuf,
|
qdf_nbuf_map_single(scn->qdf_dev, nbuf,
|
||||||
QDF_DMA_FROM_DEVICE);
|
QDF_DMA_FROM_DEVICE);
|
||||||
|
|
||||||
if (unlikely(ret != QDF_STATUS_SUCCESS)) {
|
if (unlikely(ret != QDF_STATUS_SUCCESS)) {
|
||||||
@@ -985,12 +985,12 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||||||
__func__, pipe_info->pipe_num,
|
__func__, pipe_info->pipe_num,
|
||||||
atomic_read(&pipe_info->recv_bufs_needed),
|
atomic_read(&pipe_info->recv_bufs_needed),
|
||||||
pipe_info->nbuf_dma_err_count);
|
pipe_info->nbuf_dma_err_count);
|
||||||
cdf_nbuf_free(nbuf);
|
qdf_nbuf_free(nbuf);
|
||||||
atomic_inc(&pipe_info->recv_bufs_needed);
|
atomic_inc(&pipe_info->recv_bufs_needed);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
CE_data = cdf_nbuf_get_frag_paddr(nbuf, 0);
|
CE_data = qdf_nbuf_get_frag_paddr(nbuf, 0);
|
||||||
|
|
||||||
qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data,
|
qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data,
|
||||||
buf_sz, DMA_FROM_DEVICE);
|
buf_sz, DMA_FROM_DEVICE);
|
||||||
@@ -1006,7 +1006,7 @@ static int hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||||||
atomic_read(&pipe_info->recv_bufs_needed),
|
atomic_read(&pipe_info->recv_bufs_needed),
|
||||||
pipe_info->nbuf_ce_enqueue_err_count);
|
pipe_info->nbuf_ce_enqueue_err_count);
|
||||||
atomic_inc(&pipe_info->recv_bufs_needed);
|
atomic_inc(&pipe_info->recv_bufs_needed);
|
||||||
cdf_nbuf_free(nbuf);
|
qdf_nbuf_free(nbuf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1129,7 +1129,7 @@ void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||||||
struct CE_handle *ce_hdl;
|
struct CE_handle *ce_hdl;
|
||||||
uint32_t buf_sz;
|
uint32_t buf_sz;
|
||||||
struct HIF_CE_state *hif_state;
|
struct HIF_CE_state *hif_state;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
qdf_dma_addr_t CE_data;
|
qdf_dma_addr_t CE_data;
|
||||||
void *per_CE_context;
|
void *per_CE_context;
|
||||||
|
|
||||||
@@ -1153,9 +1153,9 @@ void hif_recv_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||||||
while (ce_revoke_recv_next
|
while (ce_revoke_recv_next
|
||||||
(ce_hdl, &per_CE_context, (void **)&netbuf,
|
(ce_hdl, &per_CE_context, (void **)&netbuf,
|
||||||
&CE_data) == QDF_STATUS_SUCCESS) {
|
&CE_data) == QDF_STATUS_SUCCESS) {
|
||||||
cdf_nbuf_unmap_single(scn->qdf_dev, netbuf,
|
qdf_nbuf_unmap_single(scn->qdf_dev, netbuf,
|
||||||
QDF_DMA_FROM_DEVICE);
|
QDF_DMA_FROM_DEVICE);
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1164,7 +1164,7 @@ void hif_send_buffer_cleanup_on_pipe(struct HIF_CE_pipe_info *pipe_info)
|
|||||||
struct CE_handle *ce_hdl;
|
struct CE_handle *ce_hdl;
|
||||||
struct HIF_CE_state *hif_state;
|
struct HIF_CE_state *hif_state;
|
||||||
struct hif_softc *scn;
|
struct hif_softc *scn;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
void *per_CE_context;
|
void *per_CE_context;
|
||||||
qdf_dma_addr_t CE_data;
|
qdf_dma_addr_t CE_data;
|
||||||
unsigned int nbytes;
|
unsigned int nbytes;
|
||||||
|
@@ -468,12 +468,12 @@ ce_sendlist_send(struct CE_handle *copyeng,
|
|||||||
transfer_id, item->flags,
|
transfer_id, item->flags,
|
||||||
item->user_flags);
|
item->user_flags);
|
||||||
QDF_ASSERT(status == QDF_STATUS_SUCCESS);
|
QDF_ASSERT(status == QDF_STATUS_SUCCESS);
|
||||||
NBUF_UPDATE_TX_PKT_COUNT((cdf_nbuf_t)per_transfer_context,
|
QDF_NBUF_UPDATE_TX_PKT_COUNT((qdf_nbuf_t)per_transfer_context,
|
||||||
NBUF_TX_PKT_CE);
|
QDF_NBUF_TX_PKT_CE);
|
||||||
DPTRACE(qdf_dp_trace((cdf_nbuf_t)per_transfer_context,
|
DPTRACE(qdf_dp_trace((qdf_nbuf_t)per_transfer_context,
|
||||||
QDF_DP_TRACE_CE_PACKET_PTR_RECORD,
|
QDF_DP_TRACE_CE_PACKET_PTR_RECORD,
|
||||||
(uint8_t *)(((cdf_nbuf_t)per_transfer_context)->data),
|
(uint8_t *)(((qdf_nbuf_t)per_transfer_context)->data),
|
||||||
sizeof(((cdf_nbuf_t)per_transfer_context)->data)));
|
sizeof(((qdf_nbuf_t)per_transfer_context)->data)));
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Probably not worth the additional complexity to support
|
* Probably not worth the additional complexity to support
|
||||||
@@ -526,7 +526,7 @@ ce_buffer_addr_hi_set(struct CE_src_desc *shadow_src_desc,
|
|||||||
* Return: No. of packets that could be sent
|
* Return: No. of packets that could be sent
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
|
int ce_send_fast(struct CE_handle *copyeng, qdf_nbuf_t *msdus,
|
||||||
unsigned int num_msdus, unsigned int transfer_id)
|
unsigned int num_msdus, unsigned int transfer_id)
|
||||||
{
|
{
|
||||||
struct CE_state *ce_state = (struct CE_state *)copyeng;
|
struct CE_state *ce_state = (struct CE_state *)copyeng;
|
||||||
@@ -538,7 +538,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
|
|||||||
unsigned int write_index;
|
unsigned int write_index;
|
||||||
unsigned int sw_index;
|
unsigned int sw_index;
|
||||||
unsigned int frag_len;
|
unsigned int frag_len;
|
||||||
cdf_nbuf_t msdu;
|
qdf_nbuf_t msdu;
|
||||||
int i;
|
int i;
|
||||||
uint64_t dma_addr;
|
uint64_t dma_addr;
|
||||||
uint32_t user_flags = 0;
|
uint32_t user_flags = 0;
|
||||||
@@ -567,14 +567,14 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
|
|||||||
* structure instead?
|
* structure instead?
|
||||||
*/
|
*/
|
||||||
/* HTT/HTC header can be passed as a argument */
|
/* HTT/HTC header can be passed as a argument */
|
||||||
dma_addr = cdf_nbuf_get_frag_paddr(msdu, 0);
|
dma_addr = qdf_nbuf_get_frag_paddr(msdu, 0);
|
||||||
shadow_src_desc->buffer_addr = (uint32_t)(dma_addr &
|
shadow_src_desc->buffer_addr = (uint32_t)(dma_addr &
|
||||||
0xFFFFFFFF);
|
0xFFFFFFFF);
|
||||||
user_flags = cdf_nbuf_data_attr_get(msdu) & DESC_DATA_FLAG_MASK;
|
user_flags = qdf_nbuf_data_attr_get(msdu) & DESC_DATA_FLAG_MASK;
|
||||||
ce_buffer_addr_hi_set(shadow_src_desc, dma_addr, user_flags);
|
ce_buffer_addr_hi_set(shadow_src_desc, dma_addr, user_flags);
|
||||||
|
|
||||||
shadow_src_desc->meta_data = transfer_id;
|
shadow_src_desc->meta_data = transfer_id;
|
||||||
shadow_src_desc->nbytes = cdf_nbuf_get_frag_len(msdu, 0);
|
shadow_src_desc->nbytes = qdf_nbuf_get_frag_len(msdu, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HTC HTT header is a word stream, so byte swap if CE byte
|
* HTC HTT header is a word stream, so byte swap if CE byte
|
||||||
@@ -600,7 +600,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
|
|||||||
* Now fill out the ring descriptor for the actual data
|
* Now fill out the ring descriptor for the actual data
|
||||||
* packet
|
* packet
|
||||||
*/
|
*/
|
||||||
dma_addr = cdf_nbuf_get_frag_paddr(msdu, 1);
|
dma_addr = qdf_nbuf_get_frag_paddr(msdu, 1);
|
||||||
shadow_src_desc->buffer_addr = (uint32_t)(dma_addr &
|
shadow_src_desc->buffer_addr = (uint32_t)(dma_addr &
|
||||||
0xFFFFFFFF);
|
0xFFFFFFFF);
|
||||||
/*
|
/*
|
||||||
@@ -611,7 +611,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
|
|||||||
shadow_src_desc->meta_data = transfer_id;
|
shadow_src_desc->meta_data = transfer_id;
|
||||||
|
|
||||||
/* get actual packet length */
|
/* get actual packet length */
|
||||||
frag_len = cdf_nbuf_get_frag_len(msdu, 1);
|
frag_len = qdf_nbuf_get_frag_len(msdu, 1);
|
||||||
|
|
||||||
/* only read download_len once */
|
/* only read download_len once */
|
||||||
shadow_src_desc->nbytes = ce_state->download_len;
|
shadow_src_desc->nbytes = ce_state->download_len;
|
||||||
|
52
htc/htc.c
52
htc/htc.c
@@ -28,7 +28,7 @@
|
|||||||
#include "ol_if_athvar.h"
|
#include "ol_if_athvar.h"
|
||||||
#include "htc_debug.h"
|
#include "htc_debug.h"
|
||||||
#include "htc_internal.h"
|
#include "htc_internal.h"
|
||||||
#include <cdf_nbuf.h> /* cdf_nbuf_t */
|
#include <qdf_nbuf.h> /* qdf_nbuf_t */
|
||||||
#include <qdf_types.h> /* qdf_print */
|
#include <qdf_types.h> /* qdf_print */
|
||||||
#include <hif.h>
|
#include <hif.h>
|
||||||
#include "epping_main.h"
|
#include "epping_main.h"
|
||||||
@@ -62,11 +62,11 @@ static void reset_endpoint_states(HTC_TARGET *target);
|
|||||||
|
|
||||||
static void destroy_htc_tx_ctrl_packet(HTC_PACKET *pPacket)
|
static void destroy_htc_tx_ctrl_packet(HTC_PACKET *pPacket)
|
||||||
{
|
{
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
netbuf = (cdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
netbuf = (qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
||||||
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("free ctrl netbuf :0x%p \n", netbuf));
|
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("free ctrl netbuf :0x%p\n", netbuf));
|
||||||
if (netbuf != NULL) {
|
if (netbuf != NULL) {
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_mem_free(pPacket);
|
qdf_mem_free(pPacket);
|
||||||
@@ -75,7 +75,7 @@ static void destroy_htc_tx_ctrl_packet(HTC_PACKET *pPacket)
|
|||||||
static HTC_PACKET *build_htc_tx_ctrl_packet(qdf_device_t osdev)
|
static HTC_PACKET *build_htc_tx_ctrl_packet(qdf_device_t osdev)
|
||||||
{
|
{
|
||||||
HTC_PACKET *pPacket = NULL;
|
HTC_PACKET *pPacket = NULL;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
pPacket = (HTC_PACKET *) qdf_mem_malloc(sizeof(HTC_PACKET));
|
pPacket = (HTC_PACKET *) qdf_mem_malloc(sizeof(HTC_PACKET));
|
||||||
@@ -83,8 +83,8 @@ static HTC_PACKET *build_htc_tx_ctrl_packet(qdf_device_t osdev)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
A_MEMZERO(pPacket, sizeof(HTC_PACKET));
|
A_MEMZERO(pPacket, sizeof(HTC_PACKET));
|
||||||
netbuf =
|
netbuf = qdf_nbuf_alloc(osdev,
|
||||||
cdf_nbuf_alloc(osdev, HTC_CONTROL_BUFFER_SIZE, 20, 4, true);
|
HTC_CONTROL_BUFFER_SIZE, 20, 4, true);
|
||||||
if (NULL == netbuf) {
|
if (NULL == netbuf) {
|
||||||
qdf_mem_free(pPacket);
|
qdf_mem_free(pPacket);
|
||||||
pPacket = NULL;
|
pPacket = NULL;
|
||||||
@@ -146,7 +146,7 @@ void htc_dump(HTC_HANDLE HTCHandle, uint8_t CmdId, bool start)
|
|||||||
static void htc_cleanup(HTC_TARGET *target)
|
static void htc_cleanup(HTC_TARGET *target)
|
||||||
{
|
{
|
||||||
HTC_PACKET *pPacket;
|
HTC_PACKET *pPacket;
|
||||||
/* cdf_nbuf_t netbuf; */
|
/* qdf_nbuf_t netbuf; */
|
||||||
|
|
||||||
if (target->hif_dev != NULL) {
|
if (target->hif_dev != NULL) {
|
||||||
hif_detach_htc(target->hif_dev);
|
hif_detach_htc(target->hif_dev);
|
||||||
@@ -173,9 +173,9 @@ static void htc_cleanup(HTC_TARGET *target)
|
|||||||
if (NULL == pPacket) {
|
if (NULL == pPacket) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
netbuf = (cdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
netbuf = (qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
||||||
if (netbuf != NULL) {
|
if (netbuf != NULL) {
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_mem_free(pPacket);
|
qdf_mem_free(pPacket);
|
||||||
@@ -535,7 +535,7 @@ static void reset_endpoint_states(HTC_TARGET *target)
|
|||||||
|
|
||||||
A_STATUS htc_start(HTC_HANDLE HTCHandle)
|
A_STATUS htc_start(HTC_HANDLE HTCHandle)
|
||||||
{
|
{
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
A_STATUS status = A_OK;
|
A_STATUS status = A_OK;
|
||||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
||||||
HTC_SETUP_COMPLETE_EX_MSG *pSetupComp;
|
HTC_SETUP_COMPLETE_EX_MSG *pSetupComp;
|
||||||
@@ -558,11 +558,11 @@ A_STATUS htc_start(HTC_HANDLE HTCHandle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
netbuf =
|
netbuf =
|
||||||
(cdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pSendPacket);
|
(qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pSendPacket);
|
||||||
/* assemble setup complete message */
|
/* assemble setup complete message */
|
||||||
cdf_nbuf_put_tail(netbuf, sizeof(HTC_SETUP_COMPLETE_EX_MSG));
|
qdf_nbuf_put_tail(netbuf, sizeof(HTC_SETUP_COMPLETE_EX_MSG));
|
||||||
pSetupComp =
|
pSetupComp =
|
||||||
(HTC_SETUP_COMPLETE_EX_MSG *) cdf_nbuf_data(netbuf);
|
(HTC_SETUP_COMPLETE_EX_MSG *) qdf_nbuf_data(netbuf);
|
||||||
A_MEMZERO(pSetupComp, sizeof(HTC_SETUP_COMPLETE_EX_MSG));
|
A_MEMZERO(pSetupComp, sizeof(HTC_SETUP_COMPLETE_EX_MSG));
|
||||||
|
|
||||||
HTC_SET_FIELD(pSetupComp, HTC_SETUP_COMPLETE_EX_MSG,
|
HTC_SET_FIELD(pSetupComp, HTC_SETUP_COMPLETE_EX_MSG,
|
||||||
@@ -610,11 +610,11 @@ void htc_flush_surprise_remove(HTC_HANDLE HTCHandle)
|
|||||||
int i;
|
int i;
|
||||||
HTC_ENDPOINT *pEndpoint;
|
HTC_ENDPOINT *pEndpoint;
|
||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
cdf_nbuf_queue_t *rx_sg_queue = &target->RxSgQueue;
|
qdf_nbuf_queue_t *rx_sg_queue = &target->RxSgQueue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+htc_flush_surprise_remove \n"));
|
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+htc_flush_surprise_remove\n"));
|
||||||
|
|
||||||
/* cleanup endpoints */
|
/* cleanup endpoints */
|
||||||
for (i = 0; i < ENDPOINT_MAX; i++) {
|
for (i = 0; i < ENDPOINT_MAX; i++) {
|
||||||
@@ -627,9 +627,8 @@ void htc_flush_surprise_remove(HTC_HANDLE HTCHandle)
|
|||||||
|
|
||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
LOCK_HTC_RX(target);
|
LOCK_HTC_RX(target);
|
||||||
while ((netbuf = cdf_nbuf_queue_remove(rx_sg_queue)) != NULL) {
|
while ((netbuf = qdf_nbuf_queue_remove(rx_sg_queue)) != NULL)
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
}
|
|
||||||
RESET_RX_SG_CONFIG(target);
|
RESET_RX_SG_CONFIG(target);
|
||||||
UNLOCK_HTC_RX(target);
|
UNLOCK_HTC_RX(target);
|
||||||
#endif
|
#endif
|
||||||
@@ -646,11 +645,11 @@ void htc_stop(HTC_HANDLE HTCHandle)
|
|||||||
int i;
|
int i;
|
||||||
HTC_ENDPOINT *pEndpoint;
|
HTC_ENDPOINT *pEndpoint;
|
||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
cdf_nbuf_queue_t *rx_sg_queue = &target->RxSgQueue;
|
qdf_nbuf_queue_t *rx_sg_queue = &target->RxSgQueue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+htc_stop \n"));
|
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+htc_stop\n"));
|
||||||
|
|
||||||
/* cleanup endpoints */
|
/* cleanup endpoints */
|
||||||
for (i = 0; i < ENDPOINT_MAX; i++) {
|
for (i = 0; i < ENDPOINT_MAX; i++) {
|
||||||
@@ -674,9 +673,8 @@ void htc_stop(HTC_HANDLE HTCHandle)
|
|||||||
|
|
||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
LOCK_HTC_RX(target);
|
LOCK_HTC_RX(target);
|
||||||
while ((netbuf = cdf_nbuf_queue_remove(rx_sg_queue)) != NULL) {
|
while ((netbuf = qdf_nbuf_queue_remove(rx_sg_queue)) != NULL)
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
}
|
|
||||||
RESET_RX_SG_CONFIG(target);
|
RESET_RX_SG_CONFIG(target);
|
||||||
UNLOCK_HTC_RX(target);
|
UNLOCK_HTC_RX(target);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -443,7 +443,7 @@ A_STATUS htc_send_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
|
|||||||
@see also: htc_send_pkt
|
@see also: htc_send_pkt
|
||||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||||
#ifdef ATH_11AC_TXCOMPACT
|
#ifdef ATH_11AC_TXCOMPACT
|
||||||
A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, cdf_nbuf_t netbuf,
|
A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf,
|
||||||
int Epid, int ActualLength);
|
int Epid, int ActualLength);
|
||||||
#else /*ATH_11AC_TXCOMPACT */
|
#else /*ATH_11AC_TXCOMPACT */
|
||||||
A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
|
A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
|
||||||
|
@@ -35,7 +35,7 @@ extern "C" {
|
|||||||
#include <athdefs.h>
|
#include <athdefs.h>
|
||||||
#include "a_types.h"
|
#include "a_types.h"
|
||||||
#include "osapi_linux.h"
|
#include "osapi_linux.h"
|
||||||
#include <cdf_nbuf.h>
|
#include <qdf_nbuf.h>
|
||||||
#include <qdf_types.h>
|
#include <qdf_types.h>
|
||||||
#include <qdf_lock.h>
|
#include <qdf_lock.h>
|
||||||
#include <qdf_timer.h>
|
#include <qdf_timer.h>
|
||||||
@@ -173,7 +173,7 @@ typedef struct _HTC_TARGET {
|
|||||||
ServiceTxAllocTable[HTC_MAX_SERVICE_ALLOC_ENTRIES];
|
ServiceTxAllocTable[HTC_MAX_SERVICE_ALLOC_ENTRIES];
|
||||||
int TargetCreditSize;
|
int TargetCreditSize;
|
||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
cdf_nbuf_queue_t RxSgQueue;
|
qdf_nbuf_queue_t RxSgQueue;
|
||||||
A_BOOL IsRxSgInprogress;
|
A_BOOL IsRxSgInprogress;
|
||||||
A_UINT32 CurRxSgTotalLen; /* current total length */
|
A_UINT32 CurRxSgTotalLen; /* current total length */
|
||||||
A_UINT32 ExpRxSgTotalLen; /* expected total length */
|
A_UINT32 ExpRxSgTotalLen; /* expected total length */
|
||||||
@@ -227,9 +227,9 @@ typedef struct _HTC_TARGET {
|
|||||||
} while (0);
|
} while (0);
|
||||||
/* internal HTC functions */
|
/* internal HTC functions */
|
||||||
|
|
||||||
QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
|
||||||
uint8_t pipeID);
|
uint8_t pipeID);
|
||||||
QDF_STATUS htc_tx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
QDF_STATUS htc_tx_completion_handler(void *Context, qdf_nbuf_t netbuf,
|
||||||
unsigned int transferID, uint32_t toeplitz_hash_result);
|
unsigned int transferID, uint32_t toeplitz_hash_result);
|
||||||
|
|
||||||
HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target);
|
HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target);
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#include "htc_debug.h"
|
#include "htc_debug.h"
|
||||||
#include "htc_internal.h"
|
#include "htc_internal.h"
|
||||||
#include "cds_api.h"
|
#include "cds_api.h"
|
||||||
#include <cdf_nbuf.h> /* cdf_nbuf_t */
|
#include <qdf_nbuf.h> /* qdf_nbuf_t */
|
||||||
#include "epping_main.h"
|
#include "epping_main.h"
|
||||||
|
|
||||||
/* HTC Control message receive timeout msec */
|
/* HTC Control message receive timeout msec */
|
||||||
@@ -209,17 +209,17 @@ void free_htc_packet_container(HTC_TARGET *target, HTC_PACKET *pPacket)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
cdf_nbuf_t rx_sg_to_single_netbuf(HTC_TARGET *target)
|
qdf_nbuf_t rx_sg_to_single_netbuf(HTC_TARGET *target)
|
||||||
{
|
{
|
||||||
cdf_nbuf_t skb;
|
qdf_nbuf_t skb;
|
||||||
uint8_t *anbdata;
|
uint8_t *anbdata;
|
||||||
uint8_t *anbdata_new;
|
uint8_t *anbdata_new;
|
||||||
uint32_t anblen;
|
uint32_t anblen;
|
||||||
cdf_nbuf_t new_skb = NULL;
|
qdf_nbuf_t new_skb = NULL;
|
||||||
uint32_t sg_queue_len;
|
uint32_t sg_queue_len;
|
||||||
cdf_nbuf_queue_t *rx_sg_queue = &target->RxSgQueue;
|
qdf_nbuf_queue_t *rx_sg_queue = &target->RxSgQueue;
|
||||||
|
|
||||||
sg_queue_len = cdf_nbuf_queue_len(rx_sg_queue);
|
sg_queue_len = qdf_nbuf_queue_len(rx_sg_queue);
|
||||||
|
|
||||||
if (sg_queue_len <= 1) {
|
if (sg_queue_len <= 1) {
|
||||||
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
|
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
|
||||||
@@ -227,7 +227,7 @@ cdf_nbuf_t rx_sg_to_single_netbuf(HTC_TARGET *target)
|
|||||||
goto _failed;
|
goto _failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
new_skb = cdf_nbuf_alloc(target->ExpRxSgTotalLen, 0, 4, false);
|
new_skb = qdf_nbuf_alloc(target->ExpRxSgTotalLen, 0, 4, false);
|
||||||
if (new_skb == NULL) {
|
if (new_skb == NULL) {
|
||||||
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
|
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
|
||||||
("rx_sg_to_single_netbuf: can't allocate %u size netbuf\n",
|
("rx_sg_to_single_netbuf: can't allocate %u size netbuf\n",
|
||||||
@@ -235,16 +235,16 @@ cdf_nbuf_t rx_sg_to_single_netbuf(HTC_TARGET *target)
|
|||||||
goto _failed;
|
goto _failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
cdf_nbuf_peek_header(new_skb, &anbdata_new, &anblen);
|
qdf_nbuf_peek_header(new_skb, &anbdata_new, &anblen);
|
||||||
|
|
||||||
skb = cdf_nbuf_queue_remove(rx_sg_queue);
|
skb = qdf_nbuf_queue_remove(rx_sg_queue);
|
||||||
do {
|
do {
|
||||||
cdf_nbuf_peek_header(skb, &anbdata, &anblen);
|
qdf_nbuf_peek_header(skb, &anbdata, &anblen);
|
||||||
qdf_mem_copy(anbdata_new, anbdata, cdf_nbuf_len(skb));
|
qdf_mem_copy(anbdata_new, anbdata, qdf_nbuf_len(skb));
|
||||||
cdf_nbuf_put_tail(new_skb, cdf_nbuf_len(skb));
|
qdf_nbuf_put_tail(new_skb, qdf_nbuf_len(skb));
|
||||||
anbdata_new += cdf_nbuf_len(skb);
|
anbdata_new += qdf_nbuf_len(skb);
|
||||||
cdf_nbuf_free(skb);
|
qdf_nbuf_free(skb);
|
||||||
skb = cdf_nbuf_queue_remove(rx_sg_queue);
|
skb = qdf_nbuf_queue_remove(rx_sg_queue);
|
||||||
} while (skb != NULL);
|
} while (skb != NULL);
|
||||||
|
|
||||||
RESET_RX_SG_CONFIG(target);
|
RESET_RX_SG_CONFIG(target);
|
||||||
@@ -252,16 +252,15 @@ cdf_nbuf_t rx_sg_to_single_netbuf(HTC_TARGET *target)
|
|||||||
|
|
||||||
_failed:
|
_failed:
|
||||||
|
|
||||||
while ((skb = cdf_nbuf_queue_remove(rx_sg_queue)) != NULL) {
|
while ((skb = qdf_nbuf_queue_remove(rx_sg_queue)) != NULL)
|
||||||
cdf_nbuf_free(skb);
|
qdf_nbuf_free(skb);
|
||||||
}
|
|
||||||
|
|
||||||
RESET_RX_SG_CONFIG(target);
|
RESET_RX_SG_CONFIG(target);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
|
||||||
uint8_t pipeID)
|
uint8_t pipeID)
|
||||||
{
|
{
|
||||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||||
@@ -278,8 +277,8 @@ QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
|||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
LOCK_HTC_RX(target);
|
LOCK_HTC_RX(target);
|
||||||
if (target->IsRxSgInprogress) {
|
if (target->IsRxSgInprogress) {
|
||||||
target->CurRxSgTotalLen += cdf_nbuf_len(netbuf);
|
target->CurRxSgTotalLen += qdf_nbuf_len(netbuf);
|
||||||
cdf_nbuf_queue_add(&target->RxSgQueue, netbuf);
|
qdf_nbuf_queue_add(&target->RxSgQueue, netbuf);
|
||||||
if (target->CurRxSgTotalLen == target->ExpRxSgTotalLen) {
|
if (target->CurRxSgTotalLen == target->ExpRxSgTotalLen) {
|
||||||
netbuf = rx_sg_to_single_netbuf(target);
|
netbuf = rx_sg_to_single_netbuf(target);
|
||||||
if (netbuf == NULL) {
|
if (netbuf == NULL) {
|
||||||
@@ -295,8 +294,8 @@ QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
|||||||
UNLOCK_HTC_RX(target);
|
UNLOCK_HTC_RX(target);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
netdata = cdf_nbuf_data(netbuf);
|
netdata = qdf_nbuf_data(netbuf);
|
||||||
netlen = cdf_nbuf_len(netbuf);
|
netlen = qdf_nbuf_len(netbuf);
|
||||||
|
|
||||||
HtcHdr = (HTC_FRAME_HDR *) netdata;
|
HtcHdr = (HTC_FRAME_HDR *) netdata;
|
||||||
|
|
||||||
@@ -333,8 +332,8 @@ QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
|||||||
#ifdef RX_SG_SUPPORT
|
#ifdef RX_SG_SUPPORT
|
||||||
LOCK_HTC_RX(target);
|
LOCK_HTC_RX(target);
|
||||||
target->IsRxSgInprogress = true;
|
target->IsRxSgInprogress = true;
|
||||||
cdf_nbuf_queue_init(&target->RxSgQueue);
|
qdf_nbuf_queue_init(&target->RxSgQueue);
|
||||||
cdf_nbuf_queue_add(&target->RxSgQueue, netbuf);
|
qdf_nbuf_queue_add(&target->RxSgQueue, netbuf);
|
||||||
target->ExpRxSgTotalLen = (payloadLen + HTC_HDR_LENGTH);
|
target->ExpRxSgTotalLen = (payloadLen + HTC_HDR_LENGTH);
|
||||||
target->CurRxSgTotalLen += netlen;
|
target->CurRxSgTotalLen += netlen;
|
||||||
UNLOCK_HTC_RX(target);
|
UNLOCK_HTC_RX(target);
|
||||||
@@ -404,9 +403,9 @@ QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
|||||||
int wow_nack = 0;
|
int wow_nack = 0;
|
||||||
|
|
||||||
/* remove HTC header */
|
/* remove HTC header */
|
||||||
cdf_nbuf_pull_head(netbuf, HTC_HDR_LENGTH);
|
qdf_nbuf_pull_head(netbuf, HTC_HDR_LENGTH);
|
||||||
netdata = cdf_nbuf_data(netbuf);
|
netdata = qdf_nbuf_data(netbuf);
|
||||||
netlen = cdf_nbuf_len(netbuf);
|
netlen = qdf_nbuf_len(netbuf);
|
||||||
|
|
||||||
htc_msg = (HTC_UNKNOWN_MSG *) netdata;
|
htc_msg = (HTC_UNKNOWN_MSG *) netdata;
|
||||||
message_id =
|
message_id =
|
||||||
@@ -465,7 +464,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
netbuf = NULL;
|
netbuf = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -482,11 +481,11 @@ QDF_STATUS htc_rx_completion_handler(void *Context, cdf_nbuf_t netbuf,
|
|||||||
pPacket->Status = QDF_STATUS_SUCCESS;
|
pPacket->Status = QDF_STATUS_SUCCESS;
|
||||||
pPacket->Endpoint = htc_ep_id;
|
pPacket->Endpoint = htc_ep_id;
|
||||||
pPacket->pPktContext = netbuf;
|
pPacket->pPktContext = netbuf;
|
||||||
pPacket->pBuffer = cdf_nbuf_data(netbuf) + HTC_HDR_LENGTH;
|
pPacket->pBuffer = qdf_nbuf_data(netbuf) + HTC_HDR_LENGTH;
|
||||||
pPacket->ActualLength = netlen - HTC_HEADER_LEN - trailerlen;
|
pPacket->ActualLength = netlen - HTC_HEADER_LEN - trailerlen;
|
||||||
|
|
||||||
cdf_nbuf_pull_head(netbuf, HTC_HEADER_LEN);
|
qdf_nbuf_pull_head(netbuf, HTC_HEADER_LEN);
|
||||||
cdf_nbuf_set_pktlen(netbuf, pPacket->ActualLength);
|
qdf_nbuf_set_pktlen(netbuf, pPacket->ActualLength);
|
||||||
|
|
||||||
recv_packet_completion(target, pEndpoint, pPacket);
|
recv_packet_completion(target, pEndpoint, pPacket);
|
||||||
/* recover the packet container */
|
/* recover the packet container */
|
||||||
@@ -500,7 +499,7 @@ _out:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (netbuf != NULL) {
|
if (netbuf != NULL) {
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
122
htc/htc_send.c
122
htc/htc_send.c
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "htc_debug.h"
|
#include "htc_debug.h"
|
||||||
#include "htc_internal.h"
|
#include "htc_internal.h"
|
||||||
#include <cdf_nbuf.h> /* cdf_nbuf_t */
|
#include <qdf_nbuf.h> /* qdf_nbuf_t */
|
||||||
#include <qdf_mem.h> /* qdf_mem_malloc */
|
#include <qdf_mem.h> /* qdf_mem_malloc */
|
||||||
#include "epping_main.h"
|
#include "epping_main.h"
|
||||||
|
|
||||||
@@ -133,9 +133,9 @@ void htc_get_control_endpoint_tx_host_credits(HTC_HANDLE HTCHandle, int *credits
|
|||||||
static inline void restore_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket)
|
static inline void restore_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket)
|
||||||
{
|
{
|
||||||
if (pPacket->PktInfo.AsTx.Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) {
|
if (pPacket->PktInfo.AsTx.Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) {
|
||||||
cdf_nbuf_t netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
qdf_nbuf_t netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
||||||
cdf_nbuf_unmap(target->osdev, netbuf, QDF_DMA_TO_DEVICE);
|
qdf_nbuf_unmap(target->osdev, netbuf, QDF_DMA_TO_DEVICE);
|
||||||
cdf_nbuf_pull_head(netbuf, sizeof(HTC_FRAME_HDR));
|
qdf_nbuf_pull_head(netbuf, sizeof(HTC_FRAME_HDR));
|
||||||
pPacket->PktInfo.AsTx.Flags &= ~HTC_TX_PACKET_FLAG_FIXUP_NETBUF;
|
pPacket->PktInfo.AsTx.Flags &= ~HTC_TX_PACKET_FLAG_FIXUP_NETBUF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,11 +205,11 @@ HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target)
|
|||||||
{
|
{
|
||||||
HTC_PACKET *pPacket;
|
HTC_PACKET *pPacket;
|
||||||
HTC_PACKET_QUEUE *pQueueSave;
|
HTC_PACKET_QUEUE *pQueueSave;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
LOCK_HTC_TX(target);
|
LOCK_HTC_TX(target);
|
||||||
if (NULL == target->pBundleFreeList) {
|
if (NULL == target->pBundleFreeList) {
|
||||||
UNLOCK_HTC_TX(target);
|
UNLOCK_HTC_TX(target);
|
||||||
netbuf = cdf_nbuf_alloc(NULL,
|
netbuf = qdf_nbuf_alloc(NULL,
|
||||||
target->MaxMsgsPerHTCBundle *
|
target->MaxMsgsPerHTCBundle *
|
||||||
target->TargetCreditSize, 0, 4, false);
|
target->TargetCreditSize, 0, 4, false);
|
||||||
AR_DEBUG_ASSERT(netbuf);
|
AR_DEBUG_ASSERT(netbuf);
|
||||||
@@ -219,25 +219,25 @@ HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target)
|
|||||||
pPacket = qdf_mem_malloc(sizeof(HTC_PACKET));
|
pPacket = qdf_mem_malloc(sizeof(HTC_PACKET));
|
||||||
AR_DEBUG_ASSERT(pPacket);
|
AR_DEBUG_ASSERT(pPacket);
|
||||||
if (!pPacket) {
|
if (!pPacket) {
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
pQueueSave = qdf_mem_malloc(sizeof(HTC_PACKET_QUEUE));
|
pQueueSave = qdf_mem_malloc(sizeof(HTC_PACKET_QUEUE));
|
||||||
AR_DEBUG_ASSERT(pQueueSave);
|
AR_DEBUG_ASSERT(pQueueSave);
|
||||||
if (!pQueueSave) {
|
if (!pQueueSave) {
|
||||||
cdf_nbuf_free(netbuf);
|
qdf_nbuf_free(netbuf);
|
||||||
qdf_mem_free(pPacket);
|
qdf_mem_free(pPacket);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
INIT_HTC_PACKET_QUEUE(pQueueSave);
|
INIT_HTC_PACKET_QUEUE(pQueueSave);
|
||||||
pPacket->pContext = pQueueSave;
|
pPacket->pContext = pQueueSave;
|
||||||
SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, netbuf);
|
SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, netbuf);
|
||||||
pPacket->pBuffer = cdf_nbuf_data(netbuf);
|
pPacket->pBuffer = qdf_nbuf_data(netbuf);
|
||||||
pPacket->BufferLength = cdf_nbuf_len(netbuf);
|
pPacket->BufferLength = qdf_nbuf_len(netbuf);
|
||||||
|
|
||||||
/* store the original head room so that we can restore this when we "free" the packet */
|
/* store the original head room so that we can restore this when we "free" the packet */
|
||||||
/* free packet puts the packet back on the free list */
|
/* free packet puts the packet back on the free list */
|
||||||
pPacket->netbufOrigHeadRoom = cdf_nbuf_headroom(netbuf);
|
pPacket->netbufOrigHeadRoom = qdf_nbuf_headroom(netbuf);
|
||||||
return pPacket;
|
return pPacket;
|
||||||
}
|
}
|
||||||
/* already done malloc - restore from free list */
|
/* already done malloc - restore from free list */
|
||||||
@@ -257,7 +257,7 @@ HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target)
|
|||||||
void free_htc_bundle_packet(HTC_TARGET *target, HTC_PACKET *pPacket)
|
void free_htc_bundle_packet(HTC_TARGET *target, HTC_PACKET *pPacket)
|
||||||
{
|
{
|
||||||
A_UINT32 curentHeadRoom;
|
A_UINT32 curentHeadRoom;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
HTC_PACKET_QUEUE *pQueueSave;
|
HTC_PACKET_QUEUE *pQueueSave;
|
||||||
|
|
||||||
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
||||||
@@ -272,14 +272,14 @@ void free_htc_bundle_packet(HTC_TARGET *target, HTC_PACKET *pPacket)
|
|||||||
/* and eventually HIF ends up doing another malloc big enough to store the */
|
/* and eventually HIF ends up doing another malloc big enough to store the */
|
||||||
/* data + its header */
|
/* data + its header */
|
||||||
|
|
||||||
curentHeadRoom = cdf_nbuf_headroom(netbuf);
|
curentHeadRoom = qdf_nbuf_headroom(netbuf);
|
||||||
cdf_nbuf_pull_head(netbuf,
|
qdf_nbuf_pull_head(netbuf,
|
||||||
pPacket->netbufOrigHeadRoom - curentHeadRoom);
|
pPacket->netbufOrigHeadRoom - curentHeadRoom);
|
||||||
cdf_nbuf_trim_tail(netbuf, cdf_nbuf_len(netbuf));
|
qdf_nbuf_trim_tail(netbuf, qdf_nbuf_len(netbuf));
|
||||||
|
|
||||||
/* restore the pBuffer pointer. HIF changes this */
|
/* restore the pBuffer pointer. HIF changes this */
|
||||||
pPacket->pBuffer = cdf_nbuf_data(netbuf);
|
pPacket->pBuffer = qdf_nbuf_data(netbuf);
|
||||||
pPacket->BufferLength = cdf_nbuf_len(netbuf);
|
pPacket->BufferLength = qdf_nbuf_len(netbuf);
|
||||||
|
|
||||||
/* restore queue */
|
/* restore queue */
|
||||||
pQueueSave = (HTC_PACKET_QUEUE *) pPacket->pContext;
|
pQueueSave = (HTC_PACKET_QUEUE *) pPacket->pContext;
|
||||||
@@ -307,12 +307,12 @@ static A_STATUS htc_send_bundled_netbuf(HTC_TARGET *target,
|
|||||||
{
|
{
|
||||||
qdf_size_t data_len;
|
qdf_size_t data_len;
|
||||||
A_STATUS status;
|
A_STATUS status;
|
||||||
cdf_nbuf_t bundleBuf;
|
qdf_nbuf_t bundleBuf;
|
||||||
uint32_t data_attr = 0;
|
uint32_t data_attr = 0;
|
||||||
|
|
||||||
bundleBuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacketTx);
|
bundleBuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacketTx);
|
||||||
data_len = pBundleBuffer - cdf_nbuf_data(bundleBuf);
|
data_len = pBundleBuffer - qdf_nbuf_data(bundleBuf);
|
||||||
cdf_nbuf_put_tail(bundleBuf, data_len);
|
qdf_nbuf_put_tail(bundleBuf, data_len);
|
||||||
SET_HTC_PACKET_INFO_TX(pPacketTx,
|
SET_HTC_PACKET_INFO_TX(pPacketTx,
|
||||||
target,
|
target,
|
||||||
pBundleBuffer,
|
pBundleBuffer,
|
||||||
@@ -342,7 +342,7 @@ static void htc_issue_packets_bundle(HTC_TARGET *target,
|
|||||||
HTC_PACKET_QUEUE *pPktQueue)
|
HTC_PACKET_QUEUE *pPktQueue)
|
||||||
{
|
{
|
||||||
int i, frag_count, nbytes;
|
int i, frag_count, nbytes;
|
||||||
cdf_nbuf_t netbuf, bundleBuf;
|
qdf_nbuf_t netbuf, bundleBuf;
|
||||||
unsigned char *pBundleBuffer = NULL;
|
unsigned char *pBundleBuffer = NULL;
|
||||||
HTC_PACKET *pPacket = NULL, *pPacketTx = NULL;
|
HTC_PACKET *pPacket = NULL, *pPacketTx = NULL;
|
||||||
HTC_FRAME_HDR *pHtcHdr;
|
HTC_FRAME_HDR *pHtcHdr;
|
||||||
@@ -361,7 +361,7 @@ static void htc_issue_packets_bundle(HTC_TARGET *target,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bundleBuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacketTx);
|
bundleBuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacketTx);
|
||||||
pBundleBuffer = cdf_nbuf_data(bundleBuf);
|
pBundleBuffer = qdf_nbuf_data(bundleBuf);
|
||||||
pQueueSave = (HTC_PACKET_QUEUE *) pPacketTx->pContext;
|
pQueueSave = (HTC_PACKET_QUEUE *) pPacketTx->pContext;
|
||||||
while (1) {
|
while (1) {
|
||||||
pPacket = htc_packet_dequeue(pPktQueue);
|
pPacket = htc_packet_dequeue(pPktQueue);
|
||||||
@@ -401,13 +401,13 @@ static void htc_issue_packets_bundle(HTC_TARGET *target,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bundleBuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacketTx);
|
bundleBuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacketTx);
|
||||||
pBundleBuffer = cdf_nbuf_data(bundleBuf);
|
pBundleBuffer = qdf_nbuf_data(bundleBuf);
|
||||||
pQueueSave = (HTC_PACKET_QUEUE *) pPacketTx->pContext;
|
pQueueSave = (HTC_PACKET_QUEUE *) pPacketTx->pContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
bundlesSpaceRemaining -= transferLength;
|
bundlesSpaceRemaining -= transferLength;
|
||||||
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
||||||
pHtcHdr = (HTC_FRAME_HDR *) cdf_nbuf_get_frag_vaddr(netbuf, 0);
|
pHtcHdr = (HTC_FRAME_HDR *) qdf_nbuf_get_frag_vaddr(netbuf, 0);
|
||||||
HTC_WRITE32(pHtcHdr,
|
HTC_WRITE32(pHtcHdr,
|
||||||
SM(pPacket->ActualLength,
|
SM(pPacket->ActualLength,
|
||||||
HTC_FRAME_HDR_PAYLOADLEN) | SM(pPacket->PktInfo.
|
HTC_FRAME_HDR_PAYLOADLEN) | SM(pPacket->PktInfo.
|
||||||
@@ -421,12 +421,12 @@ static void htc_issue_packets_bundle(HTC_TARGET *target,
|
|||||||
HTC_FRAME_HDR_CONTROLBYTES1) | SM(creditPad,
|
HTC_FRAME_HDR_CONTROLBYTES1) | SM(creditPad,
|
||||||
HTC_FRAME_HDR_RESERVED));
|
HTC_FRAME_HDR_RESERVED));
|
||||||
pHtcHdr->reserved = creditPad;
|
pHtcHdr->reserved = creditPad;
|
||||||
frag_count = cdf_nbuf_get_num_frags(netbuf);
|
frag_count = qdf_nbuf_get_num_frags(netbuf);
|
||||||
nbytes = pPacket->ActualLength + HTC_HDR_LENGTH;
|
nbytes = pPacket->ActualLength + HTC_HDR_LENGTH;
|
||||||
for (i = 0; i < frag_count && nbytes > 0; i++) {
|
for (i = 0; i < frag_count && nbytes > 0; i++) {
|
||||||
int frag_len = cdf_nbuf_get_frag_len(netbuf, i);
|
int frag_len = qdf_nbuf_get_frag_len(netbuf, i);
|
||||||
unsigned char *frag_addr =
|
unsigned char *frag_addr =
|
||||||
cdf_nbuf_get_frag_vaddr(netbuf, i);
|
qdf_nbuf_get_frag_vaddr(netbuf, i);
|
||||||
if (frag_len > nbytes) {
|
if (frag_len > nbytes) {
|
||||||
frag_len = nbytes;
|
frag_len = nbytes;
|
||||||
}
|
}
|
||||||
@@ -437,7 +437,7 @@ static void htc_issue_packets_bundle(HTC_TARGET *target,
|
|||||||
HTC_PACKET_ENQUEUE(pQueueSave, pPacket);
|
HTC_PACKET_ENQUEUE(pQueueSave, pPacket);
|
||||||
pBundleBuffer += creditPad;
|
pBundleBuffer += creditPad;
|
||||||
}
|
}
|
||||||
if (pBundleBuffer != cdf_nbuf_data(bundleBuf)) {
|
if (pBundleBuffer != qdf_nbuf_data(bundleBuf)) {
|
||||||
/* send out remaining buffer */
|
/* send out remaining buffer */
|
||||||
htc_send_bundled_netbuf(target, pEndpoint, pBundleBuffer,
|
htc_send_bundled_netbuf(target, pEndpoint, pBundleBuffer,
|
||||||
pPacketTx);
|
pPacketTx);
|
||||||
@@ -453,7 +453,7 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target,
|
|||||||
HTC_PACKET_QUEUE *pPktQueue)
|
HTC_PACKET_QUEUE *pPktQueue)
|
||||||
{
|
{
|
||||||
A_STATUS status = A_OK;
|
A_STATUS status = A_OK;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
HTC_PACKET *pPacket = NULL;
|
HTC_PACKET *pPacket = NULL;
|
||||||
uint16_t payloadLen;
|
uint16_t payloadLen;
|
||||||
HTC_FRAME_HDR *pHtcHdr;
|
HTC_FRAME_HDR *pHtcHdr;
|
||||||
@@ -492,9 +492,8 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target,
|
|||||||
payloadLen = pPacket->ActualLength;
|
payloadLen = pPacket->ActualLength;
|
||||||
/* setup HTC frame header */
|
/* setup HTC frame header */
|
||||||
|
|
||||||
pHtcHdr =
|
pHtcHdr = (HTC_FRAME_HDR *)
|
||||||
(HTC_FRAME_HDR *) cdf_nbuf_get_frag_vaddr(netbuf,
|
qdf_nbuf_get_frag_vaddr(netbuf, 0);
|
||||||
0);
|
|
||||||
AR_DEBUG_ASSERT(pHtcHdr);
|
AR_DEBUG_ASSERT(pHtcHdr);
|
||||||
|
|
||||||
HTC_WRITE32(pHtcHdr,
|
HTC_WRITE32(pHtcHdr,
|
||||||
@@ -520,7 +519,7 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target,
|
|||||||
*/
|
*/
|
||||||
if (pPacket->PktInfo.AsTx.
|
if (pPacket->PktInfo.AsTx.
|
||||||
Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) {
|
Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) {
|
||||||
cdf_nbuf_map(target->osdev,
|
qdf_nbuf_map(target->osdev,
|
||||||
GET_HTC_PACKET_NET_BUF_CONTEXT
|
GET_HTC_PACKET_NET_BUF_CONTEXT
|
||||||
(pPacket), QDF_DMA_TO_DEVICE);
|
(pPacket), QDF_DMA_TO_DEVICE);
|
||||||
}
|
}
|
||||||
@@ -868,9 +867,9 @@ void get_htc_send_packets(HTC_TARGET *target,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* FIX THIS:
|
* FIX THIS:
|
||||||
* For now, avoid calling cdf_nbuf_get_num_frags before calling
|
* For now, avoid calling qdf_nbuf_get_num_frags before calling
|
||||||
* cdf_nbuf_map, because the MacOS version of cdf_nbuf_t doesn't
|
* qdf_nbuf_map, because the MacOS version of qdf_nbuf_t doesn't
|
||||||
* support cdf_nbuf_get_num_frags until after cdf_nbuf_map has
|
* support qdf_nbuf_get_num_frags until after qdf_nbuf_map has
|
||||||
* been done.
|
* been done.
|
||||||
* Assume that the non-data netbufs, i.e. the WMI message netbufs,
|
* Assume that the non-data netbufs, i.e. the WMI message netbufs,
|
||||||
* consist of a single fragment.
|
* consist of a single fragment.
|
||||||
@@ -879,7 +878,7 @@ void get_htc_send_packets(HTC_TARGET *target,
|
|||||||
(pPacket->PktInfo.AsTx.
|
(pPacket->PktInfo.AsTx.
|
||||||
Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) ? 1
|
Flags & HTC_TX_PACKET_FLAG_FIXUP_NETBUF) ? 1
|
||||||
/* WMI messages are in a single-fragment network buffer */ :
|
/* WMI messages are in a single-fragment network buffer */ :
|
||||||
cdf_nbuf_get_num_frags(GET_HTC_PACKET_NET_BUF_CONTEXT
|
qdf_nbuf_get_num_frags(GET_HTC_PACKET_NET_BUF_CONTEXT
|
||||||
(pPacket));
|
(pPacket));
|
||||||
Resources -= num_frags;
|
Resources -= num_frags;
|
||||||
}
|
}
|
||||||
@@ -998,7 +997,7 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
|
|||||||
pPacket);
|
pPacket);
|
||||||
/* put it in the send queue */
|
/* put it in the send queue */
|
||||||
/* add HTC_FRAME_HDR space reservation again */
|
/* add HTC_FRAME_HDR space reservation again */
|
||||||
cdf_nbuf_push_head
|
qdf_nbuf_push_head
|
||||||
(GET_HTC_PACKET_NET_BUF_CONTEXT
|
(GET_HTC_PACKET_NET_BUF_CONTEXT
|
||||||
(pPacket), sizeof(HTC_FRAME_HDR));
|
(pPacket), sizeof(HTC_FRAME_HDR));
|
||||||
|
|
||||||
@@ -1230,7 +1229,7 @@ A_STATUS htc_send_pkts_multiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueu
|
|||||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
||||||
HTC_ENDPOINT *pEndpoint;
|
HTC_ENDPOINT *pEndpoint;
|
||||||
HTC_PACKET *pPacket;
|
HTC_PACKET *pPacket;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
HTC_FRAME_HDR *pHtcHdr;
|
HTC_FRAME_HDR *pHtcHdr;
|
||||||
|
|
||||||
AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
|
AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
|
||||||
@@ -1265,9 +1264,9 @@ A_STATUS htc_send_pkts_multiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueu
|
|||||||
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
||||||
AR_DEBUG_ASSERT(netbuf);
|
AR_DEBUG_ASSERT(netbuf);
|
||||||
|
|
||||||
cdf_nbuf_push_head(netbuf, sizeof(HTC_FRAME_HDR));
|
qdf_nbuf_push_head(netbuf, sizeof(HTC_FRAME_HDR));
|
||||||
/* setup HTC frame header */
|
/* setup HTC frame header */
|
||||||
pHtcHdr = (HTC_FRAME_HDR *) cdf_nbuf_get_frag_vaddr(netbuf, 0);
|
pHtcHdr = (HTC_FRAME_HDR *) qdf_nbuf_get_frag_vaddr(netbuf, 0);
|
||||||
AR_DEBUG_ASSERT(pHtcHdr);
|
AR_DEBUG_ASSERT(pHtcHdr);
|
||||||
HTC_WRITE32(pHtcHdr,
|
HTC_WRITE32(pHtcHdr,
|
||||||
SM(pPacket->ActualLength,
|
SM(pPacket->ActualLength,
|
||||||
@@ -1289,7 +1288,7 @@ A_STATUS htc_send_pkts_multiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueu
|
|||||||
* mapped. This only applies to non-data frames, since data frames
|
* mapped. This only applies to non-data frames, since data frames
|
||||||
* were already mapped as they entered into the driver.
|
* were already mapped as they entered into the driver.
|
||||||
*/
|
*/
|
||||||
cdf_nbuf_map(target->osdev,
|
qdf_nbuf_map(target->osdev,
|
||||||
GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket),
|
GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket),
|
||||||
QDF_DMA_TO_DEVICE);
|
QDF_DMA_TO_DEVICE);
|
||||||
|
|
||||||
@@ -1349,7 +1348,7 @@ A_STATUS htc_send_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket)
|
|||||||
|
|
||||||
#ifdef ATH_11AC_TXCOMPACT
|
#ifdef ATH_11AC_TXCOMPACT
|
||||||
|
|
||||||
A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, cdf_nbuf_t netbuf, int Epid,
|
A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf, int Epid,
|
||||||
int ActualLength)
|
int ActualLength)
|
||||||
{
|
{
|
||||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
||||||
@@ -1380,10 +1379,10 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, cdf_nbuf_t netbuf, int Epid,
|
|||||||
if (hif_pm_runtime_get(target->hif_dev))
|
if (hif_pm_runtime_get(target->hif_dev))
|
||||||
return A_ERROR;
|
return A_ERROR;
|
||||||
|
|
||||||
pHtcHdr = (HTC_FRAME_HDR *) cdf_nbuf_get_frag_vaddr(netbuf, 0);
|
pHtcHdr = (HTC_FRAME_HDR *) qdf_nbuf_get_frag_vaddr(netbuf, 0);
|
||||||
AR_DEBUG_ASSERT(pHtcHdr);
|
AR_DEBUG_ASSERT(pHtcHdr);
|
||||||
|
|
||||||
data_attr = cdf_nbuf_data_attr_get(netbuf);
|
data_attr = qdf_nbuf_data_attr_get(netbuf);
|
||||||
|
|
||||||
HTC_WRITE32(pHtcHdr, SM(ActualLength, HTC_FRAME_HDR_PAYLOADLEN) |
|
HTC_WRITE32(pHtcHdr, SM(ActualLength, HTC_FRAME_HDR_PAYLOADLEN) |
|
||||||
SM(Epid, HTC_FRAME_HDR_ENDPOINTID));
|
SM(Epid, HTC_FRAME_HDR_ENDPOINTID));
|
||||||
@@ -1409,10 +1408,10 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, cdf_nbuf_t netbuf, int Epid,
|
|||||||
|
|
||||||
pEndpoint->SeqNo++;
|
pEndpoint->SeqNo++;
|
||||||
|
|
||||||
NBUF_UPDATE_TX_PKT_COUNT(netbuf, NBUF_TX_PKT_HTC);
|
QDF_NBUF_UPDATE_TX_PKT_COUNT(netbuf, QDF_NBUF_TX_PKT_HTC);
|
||||||
DPTRACE(qdf_dp_trace(netbuf, QDF_DP_TRACE_HTC_PACKET_PTR_RECORD,
|
DPTRACE(qdf_dp_trace(netbuf, QDF_DP_TRACE_HTC_PACKET_PTR_RECORD,
|
||||||
(uint8_t *)(cdf_nbuf_data(netbuf)),
|
(uint8_t *)(qdf_nbuf_data(netbuf)),
|
||||||
sizeof(cdf_nbuf_data(netbuf))));
|
sizeof(qdf_nbuf_data(netbuf))));
|
||||||
status = hif_send_head(target->hif_dev,
|
status = hif_send_head(target->hif_dev,
|
||||||
pEndpoint->UL_PipeID,
|
pEndpoint->UL_PipeID,
|
||||||
pEndpoint->Id, ActualLength, netbuf, data_attr);
|
pEndpoint->Id, ActualLength, netbuf, data_attr);
|
||||||
@@ -1429,7 +1428,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
|
|||||||
HTC_ENDPOINT *pEndpoint;
|
HTC_ENDPOINT *pEndpoint;
|
||||||
HTC_FRAME_HDR *pHtcHdr;
|
HTC_FRAME_HDR *pHtcHdr;
|
||||||
HTC_PACKET_QUEUE sendQueue;
|
HTC_PACKET_QUEUE sendQueue;
|
||||||
cdf_nbuf_t netbuf = NULL;
|
qdf_nbuf_t netbuf = NULL;
|
||||||
int tx_resources;
|
int tx_resources;
|
||||||
A_STATUS status = A_OK;
|
A_STATUS status = A_OK;
|
||||||
uint32_t data_attr = 0;
|
uint32_t data_attr = 0;
|
||||||
@@ -1440,7 +1439,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
|
|||||||
|
|
||||||
/* add HTC_FRAME_HDR in the initial fragment */
|
/* add HTC_FRAME_HDR in the initial fragment */
|
||||||
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
netbuf = GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket);
|
||||||
pHtcHdr = (HTC_FRAME_HDR *) cdf_nbuf_get_frag_vaddr(netbuf, 0);
|
pHtcHdr = (HTC_FRAME_HDR *) qdf_nbuf_get_frag_vaddr(netbuf, 0);
|
||||||
AR_DEBUG_ASSERT(pHtcHdr);
|
AR_DEBUG_ASSERT(pHtcHdr);
|
||||||
|
|
||||||
HTC_WRITE32(pHtcHdr,
|
HTC_WRITE32(pHtcHdr,
|
||||||
@@ -1544,10 +1543,10 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
|
|||||||
get_htc_send_packets(target, pEndpoint, &sendQueue, tx_resources);
|
get_htc_send_packets(target, pEndpoint, &sendQueue, tx_resources);
|
||||||
UNLOCK_HTC_TX(target);
|
UNLOCK_HTC_TX(target);
|
||||||
}
|
}
|
||||||
NBUF_UPDATE_TX_PKT_COUNT(netbuf, NBUF_TX_PKT_HTC);
|
QDF_NBUF_UPDATE_TX_PKT_COUNT(netbuf, QDF_NBUF_TX_PKT_HTC);
|
||||||
DPTRACE(qdf_dp_trace(netbuf, QDF_DP_TRACE_HTC_PACKET_PTR_RECORD,
|
DPTRACE(qdf_dp_trace(netbuf, QDF_DP_TRACE_HTC_PACKET_PTR_RECORD,
|
||||||
(uint8_t *)(cdf_nbuf_data(netbuf)),
|
(uint8_t *)(qdf_nbuf_data(netbuf)),
|
||||||
sizeof(cdf_nbuf_data(netbuf))));
|
sizeof(qdf_nbuf_data(netbuf))));
|
||||||
|
|
||||||
/* send what we can */
|
/* send what we can */
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -1629,15 +1628,16 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
|
|||||||
#endif /*ATH_11AC_TXCOMPACT */
|
#endif /*ATH_11AC_TXCOMPACT */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In the adapted HIF layer, cdf_nbuf_t are passed between HIF and HTC, since upper layers expects
|
* In the adapted HIF layer, qdf_nbuf_t are passed between HIF and HTC,
|
||||||
* HTC_PACKET containers we use the completed netbuf and lookup its corresponding HTC packet buffer
|
* since upper layers expects HTC_PACKET containers we use the completed netbuf
|
||||||
* from a lookup list.
|
* and lookup its corresponding HTC packet buffer from a lookup list.
|
||||||
* This is extra overhead that can be fixed by re-aligning HIF interfaces with HTC.
|
* This is extra overhead that can be fixed by re-aligning HIF interfaces
|
||||||
|
* with HTC.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target,
|
static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target,
|
||||||
HTC_ENDPOINT *pEndpoint,
|
HTC_ENDPOINT *pEndpoint,
|
||||||
cdf_nbuf_t netbuf)
|
qdf_nbuf_t netbuf)
|
||||||
{
|
{
|
||||||
HTC_PACKET *pPacket = NULL;
|
HTC_PACKET *pPacket = NULL;
|
||||||
HTC_PACKET *pFoundPacket = NULL;
|
HTC_PACKET *pFoundPacket = NULL;
|
||||||
@@ -1655,7 +1655,7 @@ static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target,
|
|||||||
UNLOCK_HTC_TX(target);
|
UNLOCK_HTC_TX(target);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (netbuf == (cdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket)) {
|
if (netbuf == (qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket)) {
|
||||||
UNLOCK_HTC_TX(target);
|
UNLOCK_HTC_TX(target);
|
||||||
return pPacket;
|
return pPacket;
|
||||||
} else {
|
} else {
|
||||||
@@ -1679,7 +1679,7 @@ static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target,
|
|||||||
}
|
}
|
||||||
/* check for removal */
|
/* check for removal */
|
||||||
if (netbuf ==
|
if (netbuf ==
|
||||||
(cdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket)) {
|
(qdf_nbuf_t) GET_HTC_PACKET_NET_BUF_CONTEXT(pPacket)) {
|
||||||
/* found it */
|
/* found it */
|
||||||
HTC_PACKET_REMOVE(&lookupQueue, pPacket);
|
HTC_PACKET_REMOVE(&lookupQueue, pPacket);
|
||||||
pFoundPacket = pPacket;
|
pFoundPacket = pPacket;
|
||||||
@@ -1698,7 +1698,7 @@ static HTC_PACKET *htc_lookup_tx_packet(HTC_TARGET *target,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QDF_STATUS htc_tx_completion_handler(void *Context,
|
QDF_STATUS htc_tx_completion_handler(void *Context,
|
||||||
cdf_nbuf_t netbuf, unsigned int EpID,
|
qdf_nbuf_t netbuf, unsigned int EpID,
|
||||||
uint32_t toeplitz_hash_result)
|
uint32_t toeplitz_hash_result)
|
||||||
{
|
{
|
||||||
HTC_TARGET *target = (HTC_TARGET *) Context;
|
HTC_TARGET *target = (HTC_TARGET *) Context;
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "htc_debug.h"
|
#include "htc_debug.h"
|
||||||
#include "htc_internal.h"
|
#include "htc_internal.h"
|
||||||
#include <cdf_nbuf.h> /* cdf_nbuf_t */
|
#include <qdf_nbuf.h> /* qdf_nbuf_t */
|
||||||
#include "hif.h"
|
#include "hif.h"
|
||||||
|
|
||||||
/* use credit flow control over HTC */
|
/* use credit flow control over HTC */
|
||||||
@@ -66,7 +66,7 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
|
|||||||
HTC_ENDPOINT_ID assignedEndpoint = ENDPOINT_MAX;
|
HTC_ENDPOINT_ID assignedEndpoint = ENDPOINT_MAX;
|
||||||
HTC_ENDPOINT *pEndpoint;
|
HTC_ENDPOINT *pEndpoint;
|
||||||
unsigned int maxMsgSize = 0;
|
unsigned int maxMsgSize = 0;
|
||||||
cdf_nbuf_t netbuf;
|
qdf_nbuf_t netbuf;
|
||||||
A_UINT8 txAlloc;
|
A_UINT8 txAlloc;
|
||||||
int length;
|
int length;
|
||||||
A_BOOL disableCreditFlowCtrl = false;
|
A_BOOL disableCreditFlowCtrl = false;
|
||||||
@@ -109,16 +109,16 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
|
|||||||
}
|
}
|
||||||
|
|
||||||
netbuf =
|
netbuf =
|
||||||
(cdf_nbuf_t)
|
(qdf_nbuf_t)
|
||||||
GET_HTC_PACKET_NET_BUF_CONTEXT(pSendPacket);
|
GET_HTC_PACKET_NET_BUF_CONTEXT(pSendPacket);
|
||||||
length =
|
length =
|
||||||
sizeof(HTC_CONNECT_SERVICE_MSG) +
|
sizeof(HTC_CONNECT_SERVICE_MSG) +
|
||||||
pConnectReq->MetaDataLength;
|
pConnectReq->MetaDataLength;
|
||||||
|
|
||||||
/* assemble connect service message */
|
/* assemble connect service message */
|
||||||
cdf_nbuf_put_tail(netbuf, length);
|
qdf_nbuf_put_tail(netbuf, length);
|
||||||
pConnectMsg =
|
pConnectMsg =
|
||||||
(HTC_CONNECT_SERVICE_MSG *) cdf_nbuf_data(netbuf);
|
(HTC_CONNECT_SERVICE_MSG *) qdf_nbuf_data(netbuf);
|
||||||
|
|
||||||
if (NULL == pConnectMsg) {
|
if (NULL == pConnectMsg) {
|
||||||
AR_DEBUG_ASSERT(0);
|
AR_DEBUG_ASSERT(0);
|
||||||
|
Reference in New Issue
Block a user