qcacld-3.0: Update driver to use QDF NBUF APIs(1/2)

Update driver to use QDF NBUF APIs

Change-Id: I4409b6c046de1221b57baed45088d5f3b898b565
CRs-Fixed: 981188
Цей коміт міститься в:
Nirav Shah
2016-03-01 16:24:53 +05:30
зафіксовано Gerrit - the friendly Code Review server
джерело 600c3a00be
коміт cbc6d72570
79 змінених файлів з 1299 додано та 4505 видалено

Різницю між файлами не показано, бо вона завелика Завантажити різницю

Різницю між файлами не показано, бо вона завелика Завантажити різницю

Різницю між файлами не показано, бо вона завелика Завантажити різницю

Переглянути файл

@@ -54,11 +54,11 @@
struct cds_pkt_t; struct cds_pkt_t;
typedef struct cds_pkt_t cds_pkt_t; typedef struct cds_pkt_t cds_pkt_t;
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#define CDS_PKT_TRAC_TYPE_EAPOL NBUF_PKT_TRAC_TYPE_EAPOL #define CDS_PKT_TRAC_TYPE_EAPOL QDF_NBUF_PKT_TRAC_TYPE_EAPOL
#define CDS_PKT_TRAC_TYPE_DHCP NBUF_PKT_TRAC_TYPE_DHCP #define CDS_PKT_TRAC_TYPE_DHCP QDF_NBUF_PKT_TRAC_TYPE_DHCP
#define CDS_PKT_TRAC_TYPE_MGMT_ACTION NBUF_PKT_TRAC_TYPE_MGMT_ACTION /* Managment action frame */ #define CDS_PKT_TRAC_TYPE_MGMT_ACTION QDF_NBUF_PKT_TRAC_TYPE_MGMT_ACTION
#define CDS_PKT_TRAC_DUMP_CMD 9999 #define CDS_PKT_TRAC_DUMP_CMD 9999

Переглянути файл

@@ -43,7 +43,7 @@
#include <qdf_mc_timer.h> #include <qdf_mc_timer.h>
#include <qdf_trace.h> #include <qdf_trace.h>
#include <wlan_hdd_main.h> #include <wlan_hdd_main.h>
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_mem.h" #include "qdf_mem.h"
#define TX_PKT_MIN_HEADROOM (64) #define TX_PKT_MIN_HEADROOM (64)
@@ -83,8 +83,8 @@ QDF_STATUS cds_pkt_return_packet(cds_pkt_t *packet)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
/* Free up the Adf nbuf */ /* Free up the qdf nbuf */
cdf_nbuf_free(packet->pkt_buf); qdf_nbuf_free(packet->pkt_buf);
packet->pkt_buf = NULL; packet->pkt_buf = NULL;
@@ -120,7 +120,7 @@ cds_pkt_get_packet_length(cds_pkt_t *pPacket, uint16_t *pPacketSize)
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
/* return the requested information */ /* return the requested information */
*pPacketSize = cdf_nbuf_len(pPacket->pkt_buf); *pPacketSize = qdf_nbuf_len(pPacket->pkt_buf);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -265,7 +265,7 @@ void cds_pkt_proto_trace_init(void)
/* Register callback function to NBUF /* Register callback function to NBUF
* Lower layer event also will be reported to here */ * Lower layer event also will be reported to here */
cdf_nbuf_reg_trace_cb(cds_pkt_trace_buf_update); qdf_nbuf_reg_trace_cb(cds_pkt_trace_buf_update);
return; return;
} }
@@ -293,18 +293,18 @@ QDF_STATUS cds_packet_alloc_debug(uint16_t size, void **data, void **ppPacket,
uint8_t *file_name, uint32_t line_num) uint8_t *file_name, uint32_t line_num)
{ {
QDF_STATUS cdf_ret_status = QDF_STATUS_E_FAILURE; QDF_STATUS cdf_ret_status = QDF_STATUS_E_FAILURE;
cdf_nbuf_t nbuf; qdf_nbuf_t nbuf;
nbuf = nbuf = qdf_nbuf_alloc_debug(NULL,
cdf_nbuf_alloc_debug(NULL, roundup(size + TX_PKT_MIN_HEADROOM, 4), roundup(size + TX_PKT_MIN_HEADROOM, 4),
TX_PKT_MIN_HEADROOM, sizeof(uint32_t), false, TX_PKT_MIN_HEADROOM, sizeof(uint32_t), false,
file_name, line_num); file_name, line_num);
if (nbuf != NULL) { if (nbuf != NULL) {
cdf_nbuf_put_tail(nbuf, size); qdf_nbuf_put_tail(nbuf, size);
cdf_nbuf_set_protocol(nbuf, ETH_P_CONTROL); qdf_nbuf_set_protocol(nbuf, ETH_P_CONTROL);
*ppPacket = nbuf; *ppPacket = nbuf;
*data = cdf_nbuf_data(nbuf); *data = qdf_nbuf_data(nbuf);
cdf_ret_status = QDF_STATUS_SUCCESS; cdf_ret_status = QDF_STATUS_SUCCESS;
} }
@@ -318,16 +318,16 @@ QDF_STATUS cds_packet_alloc_debug(uint16_t size, void **data, void **ppPacket,
QDF_STATUS cds_packet_alloc(uint16_t size, void **data, void **ppPacket) QDF_STATUS cds_packet_alloc(uint16_t size, void **data, void **ppPacket)
{ {
QDF_STATUS cdf_ret_status = QDF_STATUS_E_FAILURE; QDF_STATUS cdf_ret_status = QDF_STATUS_E_FAILURE;
cdf_nbuf_t nbuf; qdf_nbuf_t nbuf;
nbuf = cdf_nbuf_alloc(NULL, roundup(size + TX_PKT_MIN_HEADROOM, 4), nbuf = qdf_nbuf_alloc(NULL, roundup(size + TX_PKT_MIN_HEADROOM, 4),
TX_PKT_MIN_HEADROOM, sizeof(uint32_t), false); TX_PKT_MIN_HEADROOM, sizeof(uint32_t), false);
if (nbuf != NULL) { if (nbuf != NULL) {
cdf_nbuf_put_tail(nbuf, size); qdf_nbuf_put_tail(nbuf, size);
cdf_nbuf_set_protocol(nbuf, ETH_P_CONTROL); qdf_nbuf_set_protocol(nbuf, ETH_P_CONTROL);
*ppPacket = nbuf; *ppPacket = nbuf;
*data = cdf_nbuf_data(nbuf); *data = qdf_nbuf_data(nbuf);
cdf_ret_status = QDF_STATUS_SUCCESS; cdf_ret_status = QDF_STATUS_SUCCESS;
} }
@@ -341,5 +341,5 @@ QDF_STATUS cds_packet_alloc(uint16_t size, void **data, void **ppPacket)
---------------------------------------------------------------------------*/ ---------------------------------------------------------------------------*/
void cds_packet_free(void *pPacket) void cds_packet_free(void *pPacket)
{ {
cdf_nbuf_free((cdf_nbuf_t) pPacket); qdf_nbuf_free((qdf_nbuf_t) pPacket);
} }

Переглянути файл

@@ -731,7 +731,7 @@ void cds_drop_rxpkt_by_staid(p_cds_sched_context pSchedContext, uint16_t staId)
{ {
struct list_head local_list; struct list_head local_list;
struct cds_ol_rx_pkt *pkt, *tmp; struct cds_ol_rx_pkt *pkt, *tmp;
cdf_nbuf_t buf, next_buf; qdf_nbuf_t buf, next_buf;
INIT_LIST_HEAD(&local_list); INIT_LIST_HEAD(&local_list);
spin_lock_bh(&pSchedContext->ol_rx_queue_lock); spin_lock_bh(&pSchedContext->ol_rx_queue_lock);
@@ -750,8 +750,8 @@ void cds_drop_rxpkt_by_staid(p_cds_sched_context pSchedContext, uint16_t staId)
list_del(&pkt->list); list_del(&pkt->list);
buf = pkt->Rxpkt; buf = pkt->Rxpkt;
while (buf) { while (buf) {
next_buf = cdf_nbuf_queue_next(buf); next_buf = qdf_nbuf_queue_next(buf);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
buf = next_buf; buf = next_buf;
} }
cds_free_ol_rx_pkt(pSchedContext, pkt); cds_free_ol_rx_pkt(pSchedContext, pkt);

Переглянути файл

@@ -121,14 +121,14 @@ void htt_htc_misc_pkt_list_add(struct htt_pdev_t *pdev, struct htt_htc_pkt *pkt)
void htt_htc_misc_pkt_pool_free(struct htt_pdev_t *pdev) void htt_htc_misc_pkt_pool_free(struct htt_pdev_t *pdev)
{ {
struct htt_htc_pkt_union *pkt, *next; struct htt_htc_pkt_union *pkt, *next;
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
pkt = pdev->htt_htc_pkt_misclist; pkt = pdev->htt_htc_pkt_misclist;
while (pkt) { while (pkt) {
next = pkt->u.next; next = pkt->u.next;
netbuf = (cdf_nbuf_t) (pkt->u.pkt.htc_pkt.pNetBufContext); netbuf = (qdf_nbuf_t) (pkt->u.pkt.htc_pkt.pNetBufContext);
cdf_nbuf_unmap(pdev->osdev, netbuf, QDF_DMA_TO_DEVICE); qdf_nbuf_unmap(pdev->osdev, netbuf, QDF_DMA_TO_DEVICE);
cdf_nbuf_free(netbuf); qdf_nbuf_free(netbuf);
qdf_mem_free(pkt); qdf_mem_free(pkt);
pkt = next; pkt = next;
} }

Переглянути файл

@@ -32,7 +32,7 @@
#include <htc_api.h> /* HTC_PACKET */ #include <htc_api.h> /* HTC_PACKET */
#include <htt.h> /* HTT_T2H_MSG_TYPE, etc. */ #include <htt.h> /* HTT_T2H_MSG_TYPE, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <qdf_mem.h> /* qdf_mem_set */ #include <qdf_mem.h> /* qdf_mem_set */
#include <ol_fw_tx_dbg.h> /* ol_fw_tx_dbg_ppdu_base */ #include <ol_fw_tx_dbg.h> /* ol_fw_tx_dbg_ppdu_base */

Переглянути файл

@@ -43,7 +43,7 @@
*/ */
#include <qdf_mem.h> /* qdf_mem_copy */ #include <qdf_mem.h> /* qdf_mem_copy */
#include <cdf_nbuf.h> /* cdf_nbuf_map_single */ #include <qdf_nbuf.h> /* qdf_nbuf_map_single */
#include <htc_api.h> /* HTC_PACKET */ #include <htc_api.h> /* HTC_PACKET */
#include <htc.h> /* HTC_HDR_ALIGNMENT_PADDING */ #include <htc.h> /* HTC_HDR_ALIGNMENT_PADDING */
#include <htt.h> /* HTT host->target msg defs */ #include <htt.h> /* HTT host->target msg defs */
@@ -62,25 +62,25 @@
static void static void
htt_h2t_send_complete_free_netbuf(void *pdev, A_STATUS status, htt_h2t_send_complete_free_netbuf(void *pdev, A_STATUS status,
cdf_nbuf_t netbuf, uint16_t msdu_id) qdf_nbuf_t netbuf, uint16_t msdu_id)
{ {
cdf_nbuf_free(netbuf); qdf_nbuf_free(netbuf);
} }
void htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt) void htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt)
{ {
void (*send_complete_part2)(void *pdev, A_STATUS status, void (*send_complete_part2)(void *pdev, A_STATUS status,
cdf_nbuf_t msdu, uint16_t msdu_id); qdf_nbuf_t msdu, uint16_t msdu_id);
struct htt_pdev_t *pdev = (struct htt_pdev_t *)context; struct htt_pdev_t *pdev = (struct htt_pdev_t *)context;
struct htt_htc_pkt *htt_pkt; struct htt_htc_pkt *htt_pkt;
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
send_complete_part2 = htc_pkt->pPktContext; send_complete_part2 = htc_pkt->pPktContext;
htt_pkt = container_of(htc_pkt, struct htt_htc_pkt, htc_pkt); htt_pkt = container_of(htc_pkt, struct htt_htc_pkt, htc_pkt);
/* process (free or keep) the netbuf that held the message */ /* process (free or keep) the netbuf that held the message */
netbuf = (cdf_nbuf_t) htc_pkt->pNetBufContext; netbuf = (qdf_nbuf_t) htc_pkt->pNetBufContext;
if (send_complete_part2 != NULL) { if (send_complete_part2 != NULL) {
send_complete_part2(htt_pkt->pdev_ctxt, htc_pkt->Status, netbuf, send_complete_part2(htt_pkt->pdev_ctxt, htc_pkt->Status, netbuf,
htt_pkt->msdu_id); htt_pkt->msdu_id);
@@ -101,7 +101,7 @@ A_STATUS htt_h2t_frag_desc_bank_cfg_msg(struct htt_pdev_t *pdev)
A_STATUS rc = A_OK; A_STATUS rc = A_OK;
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
u_int32_t *msg_word; u_int32_t *msg_word;
struct htt_tx_frag_desc_bank_cfg_t *bank_cfg; struct htt_tx_frag_desc_bank_cfg_t *bank_cfg;
@@ -115,7 +115,7 @@ A_STATUS htt_h2t_frag_desc_bank_cfg_msg(struct htt_pdev_t *pdev)
pkt->msdu_id = HTT_TX_COMPL_INV_MSDU_ID; pkt->msdu_id = HTT_TX_COMPL_INV_MSDU_ID;
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
msg = cdf_nbuf_alloc( msg = qdf_nbuf_alloc(
pdev->osdev, pdev->osdev,
HTT_MSG_BUF_SIZE(sizeof(struct htt_tx_frag_desc_bank_cfg_t)), HTT_MSG_BUF_SIZE(sizeof(struct htt_tx_frag_desc_bank_cfg_t)),
/* reserve room for the HTC header */ /* reserve room for the HTC header */
@@ -131,14 +131,14 @@ A_STATUS htt_h2t_frag_desc_bank_cfg_msg(struct htt_pdev_t *pdev)
* separately during the below call to adf_nbuf_push_head. * separately during the below call to adf_nbuf_push_head.
* The contribution from the HTC header is added separately inside HTC. * The contribution from the HTC header is added separately inside HTC.
*/ */
cdf_nbuf_put_tail(msg, sizeof(struct htt_tx_frag_desc_bank_cfg_t)); qdf_nbuf_put_tail(msg, sizeof(struct htt_tx_frag_desc_bank_cfg_t));
/* fill in the message contents */ /* fill in the message contents */
msg_word = (u_int32_t *) cdf_nbuf_data(msg); msg_word = (u_int32_t *) qdf_nbuf_data(msg);
memset(msg_word, 0 , sizeof(struct htt_tx_frag_desc_bank_cfg_t)); memset(msg_word, 0 , sizeof(struct htt_tx_frag_desc_bank_cfg_t));
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG);
@@ -170,8 +170,8 @@ A_STATUS htt_h2t_frag_desc_bank_cfg_msg(struct htt_pdev_t *pdev)
SET_HTC_PACKET_INFO_TX( SET_HTC_PACKET_INFO_TX(
&pkt->htc_pkt, &pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
@@ -187,7 +187,7 @@ A_STATUS htt_h2t_frag_desc_bank_cfg_msg(struct htt_pdev_t *pdev)
A_STATUS htt_h2t_ver_req_msg(struct htt_pdev_t *pdev) A_STATUS htt_h2t_ver_req_msg(struct htt_pdev_t *pdev)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
pkt = htt_htc_pkt_alloc(pdev); pkt = htt_htc_pkt_alloc(pdev);
@@ -201,7 +201,7 @@ A_STATUS htt_h2t_ver_req_msg(struct htt_pdev_t *pdev)
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for the HTC header */ /* reserve room for the HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_VER_REQ_BYTES), msg = qdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_VER_REQ_BYTES),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
true); true);
if (!msg) { if (!msg) {
@@ -212,23 +212,23 @@ A_STATUS htt_h2t_ver_req_msg(struct htt_pdev_t *pdev)
/* /*
* Set the length of the message. * Set the length of the message.
* The contribution from the HTC_HDR_ALIGNMENT_PADDING is added * The contribution from the HTC_HDR_ALIGNMENT_PADDING is added
* separately during the below call to cdf_nbuf_push_head. * separately during the below call to qdf_nbuf_push_head.
* The contribution from the HTC header is added separately inside HTC. * The contribution from the HTC header is added separately inside HTC.
*/ */
cdf_nbuf_put_tail(msg, HTT_VER_REQ_BYTES); qdf_nbuf_put_tail(msg, HTT_VER_REQ_BYTES);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_VERSION_REQ); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_VERSION_REQ);
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), cdf_nbuf_len(msg), qdf_nbuf_data(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
@@ -247,7 +247,7 @@ A_STATUS htt_h2t_ver_req_msg(struct htt_pdev_t *pdev)
A_STATUS htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev) A_STATUS htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
int enable_ctrl_data, enable_mgmt_data, int enable_ctrl_data, enable_mgmt_data,
enable_null_data, enable_phy_data, enable_hdr, enable_null_data, enable_phy_data, enable_hdr,
@@ -264,7 +264,7 @@ A_STATUS htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev)
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for the HTC header */ /* reserve room for the HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, msg = qdf_nbuf_alloc(pdev->osdev,
HTT_MSG_BUF_SIZE(HTT_RX_RING_CFG_BYTES(1)), HTT_MSG_BUF_SIZE(HTT_RX_RING_CFG_BYTES(1)),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
true); true);
@@ -275,16 +275,16 @@ A_STATUS htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev)
/* /*
* Set the length of the message. * Set the length of the message.
* The contribution from the HTC_HDR_ALIGNMENT_PADDING is added * The contribution from the HTC_HDR_ALIGNMENT_PADDING is added
* separately during the below call to cdf_nbuf_push_head. * separately during the below call to qdf_nbuf_push_head.
* The contribution from the HTC header is added separately inside HTC. * The contribution from the HTC header is added separately inside HTC.
*/ */
cdf_nbuf_put_tail(msg, HTT_RX_RING_CFG_BYTES(1)); qdf_nbuf_put_tail(msg, HTT_RX_RING_CFG_BYTES(1));
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_RX_RING_CFG); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_RX_RING_CFG);
@@ -414,8 +414,8 @@ A_STATUS htt_h2t_rx_ring_cfg_msg_ll(struct htt_pdev_t *pdev)
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
HTC_TX_PACKET_TAG_RUNTIME_PUT); HTC_TX_PACKET_TAG_RUNTIME_PUT);
@@ -437,7 +437,7 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev,
uint8_t cfg_stat_type, uint32_t cfg_val, uint64_t cookie) uint8_t cfg_stat_type, uint32_t cfg_val, uint64_t cookie)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
uint16_t htc_tag = 1; uint16_t htc_tag = 1;
@@ -463,7 +463,7 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev,
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
msg = cdf_nbuf_alloc(pdev->osdev, msg = qdf_nbuf_alloc(pdev->osdev,
HTT_MSG_BUF_SIZE(HTT_H2T_STATS_REQ_MSG_SZ), HTT_MSG_BUF_SIZE(HTT_H2T_STATS_REQ_MSG_SZ),
/* reserve room for HTC header */ /* reserve room for HTC header */
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
@@ -473,13 +473,13 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev,
return -EINVAL; /* failure */ return -EINVAL; /* failure */
} }
/* set the length of the message */ /* set the length of the message */
cdf_nbuf_put_tail(msg, HTT_H2T_STATS_REQ_MSG_SZ); qdf_nbuf_put_tail(msg, HTT_H2T_STATS_REQ_MSG_SZ);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_STATS_REQ); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_STATS_REQ);
@@ -504,8 +504,8 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev,
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
htc_tag); /* tag - not relevant here */ htc_tag); /* tag - not relevant here */
@@ -524,7 +524,7 @@ htt_h2t_dbg_stats_get(struct htt_pdev_t *pdev,
A_STATUS htt_h2t_sync_msg(struct htt_pdev_t *pdev, uint8_t sync_cnt) A_STATUS htt_h2t_sync_msg(struct htt_pdev_t *pdev, uint8_t sync_cnt)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
pkt = htt_htc_pkt_alloc(pdev); pkt = htt_htc_pkt_alloc(pdev);
@@ -538,7 +538,7 @@ A_STATUS htt_h2t_sync_msg(struct htt_pdev_t *pdev, uint8_t sync_cnt)
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for HTC header */ /* reserve room for HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_H2T_SYNC_MSG_SZ), msg = qdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_H2T_SYNC_MSG_SZ),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
false); false);
if (!msg) { if (!msg) {
@@ -546,13 +546,13 @@ A_STATUS htt_h2t_sync_msg(struct htt_pdev_t *pdev, uint8_t sync_cnt)
return A_NO_MEMORY; return A_NO_MEMORY;
} }
/* set the length of the message */ /* set the length of the message */
cdf_nbuf_put_tail(msg, HTT_H2T_SYNC_MSG_SZ); qdf_nbuf_put_tail(msg, HTT_H2T_SYNC_MSG_SZ);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SYNC); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SYNC);
@@ -560,8 +560,8 @@ A_STATUS htt_h2t_sync_msg(struct htt_pdev_t *pdev, uint8_t sync_cnt)
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
HTC_TX_PACKET_TAG_RUNTIME_PUT); HTC_TX_PACKET_TAG_RUNTIME_PUT);
@@ -582,7 +582,7 @@ htt_h2t_aggr_cfg_msg(struct htt_pdev_t *pdev,
int max_subfrms_ampdu, int max_subfrms_amsdu) int max_subfrms_ampdu, int max_subfrms_amsdu)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
pkt = htt_htc_pkt_alloc(pdev); pkt = htt_htc_pkt_alloc(pdev);
@@ -596,7 +596,7 @@ htt_h2t_aggr_cfg_msg(struct htt_pdev_t *pdev,
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for HTC header */ /* reserve room for HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_AGGR_CFG_MSG_SZ), msg = qdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_AGGR_CFG_MSG_SZ),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
false); false);
if (!msg) { if (!msg) {
@@ -604,13 +604,13 @@ htt_h2t_aggr_cfg_msg(struct htt_pdev_t *pdev,
return -EINVAL; /* failure */ return -EINVAL; /* failure */
} }
/* set the length of the message */ /* set the length of the message */
cdf_nbuf_put_tail(msg, HTT_AGGR_CFG_MSG_SZ); qdf_nbuf_put_tail(msg, HTT_AGGR_CFG_MSG_SZ);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_AGGR_CFG); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_AGGR_CFG);
@@ -627,8 +627,8 @@ htt_h2t_aggr_cfg_msg(struct htt_pdev_t *pdev,
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
HTC_TX_PACKET_TAG_RUNTIME_PUT); HTC_TX_PACKET_TAG_RUNTIME_PUT);
@@ -657,7 +657,7 @@ htt_h2t_aggr_cfg_msg(struct htt_pdev_t *pdev,
int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev) int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
pkt = htt_htc_pkt_alloc(pdev); pkt = htt_htc_pkt_alloc(pdev);
@@ -671,7 +671,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for HTC header */ /* reserve room for HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_WDI_IPA_CFG_SZ), msg = qdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_WDI_IPA_CFG_SZ),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
false); false);
if (!msg) { if (!msg) {
@@ -679,13 +679,13 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
return A_NO_MEMORY; return A_NO_MEMORY;
} }
/* set the length of the message */ /* set the length of the message */
cdf_nbuf_put_tail(msg, HTT_WDI_IPA_CFG_SZ); qdf_nbuf_put_tail(msg, HTT_WDI_IPA_CFG_SZ);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(*msg_word, HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(*msg_word,
@@ -734,8 +734,8 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
HTC_TX_PACKET_TAG_RUNTIME_PUT); HTC_TX_PACKET_TAG_RUNTIME_PUT);
@@ -749,7 +749,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev) int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
pkt = htt_htc_pkt_alloc(pdev); pkt = htt_htc_pkt_alloc(pdev);
@@ -763,7 +763,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for HTC header */ /* reserve room for HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_WDI_IPA_CFG_SZ), msg = qdf_nbuf_alloc(pdev->osdev, HTT_MSG_BUF_SIZE(HTT_WDI_IPA_CFG_SZ),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
false); false);
if (!msg) { if (!msg) {
@@ -771,13 +771,13 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
return -A_NO_MEMORY; return -A_NO_MEMORY;
} }
/* set the length of the message */ /* set the length of the message */
cdf_nbuf_put_tail(msg, HTT_WDI_IPA_CFG_SZ); qdf_nbuf_put_tail(msg, HTT_WDI_IPA_CFG_SZ);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(*msg_word, HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(*msg_word,
@@ -878,8 +878,8 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
@@ -904,7 +904,7 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
bool uc_active, bool is_tx) bool uc_active, bool is_tx)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
uint8_t active_target = 0; uint8_t active_target = 0;
@@ -919,7 +919,7 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for HTC header */ /* reserve room for HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, msg = qdf_nbuf_alloc(pdev->osdev,
HTT_MSG_BUF_SIZE(HTT_WDI_IPA_OP_REQUEST_SZ), HTT_MSG_BUF_SIZE(HTT_WDI_IPA_OP_REQUEST_SZ),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
false); false);
@@ -928,13 +928,13 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
return -A_NO_MEMORY; return -A_NO_MEMORY;
} }
/* set the length of the message */ /* set the length of the message */
cdf_nbuf_put_tail(msg, HTT_WDI_IPA_OP_REQUEST_SZ); qdf_nbuf_put_tail(msg, HTT_WDI_IPA_OP_REQUEST_SZ);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
if (uc_active && is_tx) if (uc_active && is_tx)
@@ -951,8 +951,8 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
@@ -973,7 +973,7 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev) int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
{ {
struct htt_htc_pkt *pkt; struct htt_htc_pkt *pkt;
cdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
pkt = htt_htc_pkt_alloc(pdev); pkt = htt_htc_pkt_alloc(pdev);
@@ -987,7 +987,7 @@ int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
pkt->pdev_ctxt = NULL; /* not used during send-done callback */ pkt->pdev_ctxt = NULL; /* not used during send-done callback */
/* reserve room for HTC header */ /* reserve room for HTC header */
msg = cdf_nbuf_alloc(pdev->osdev, msg = qdf_nbuf_alloc(pdev->osdev,
HTT_MSG_BUF_SIZE(HTT_WDI_IPA_OP_REQUEST_SZ), HTT_MSG_BUF_SIZE(HTT_WDI_IPA_OP_REQUEST_SZ),
HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4, HTC_HEADER_LEN + HTC_HDR_ALIGNMENT_PADDING, 4,
false); false);
@@ -996,13 +996,13 @@ int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
return -A_NO_MEMORY; return -A_NO_MEMORY;
} }
/* set the length of the message */ /* set the length of the message */
cdf_nbuf_put_tail(msg, HTT_WDI_IPA_OP_REQUEST_SZ); qdf_nbuf_put_tail(msg, HTT_WDI_IPA_OP_REQUEST_SZ);
/* fill in the message contents */ /* fill in the message contents */
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
/* rewind beyond alignment pad to get to the HTC header reserved area */ /* rewind beyond alignment pad to get to the HTC header reserved area */
cdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
*msg_word = 0; *msg_word = 0;
HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(*msg_word, HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(*msg_word,
@@ -1011,8 +1011,8 @@ int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt, SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
htt_h2t_send_complete_free_netbuf, htt_h2t_send_complete_free_netbuf,
cdf_nbuf_data(msg), qdf_nbuf_data(msg),
cdf_nbuf_len(msg), qdf_nbuf_len(msg),
pdev->htc_endpoint, pdev->htc_endpoint,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */

Переглянути файл

@@ -29,7 +29,7 @@
#define _HTT_INTERNAL__H_ #define _HTT_INTERNAL__H_
#include <athdefs.h> /* A_STATUS */ #include <athdefs.h> /* A_STATUS */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <qdf_util.h> /* qdf_assert */ #include <qdf_util.h> /* qdf_assert */
#include <htc_api.h> /* HTC_PACKET */ #include <htc_api.h> /* HTC_PACKET */
@@ -133,10 +133,10 @@ struct rx_buf_debug {
bool in_use; bool in_use;
}; };
#endif #endif
static inline struct htt_host_rx_desc_base *htt_rx_desc(cdf_nbuf_t msdu) static inline struct htt_host_rx_desc_base *htt_rx_desc(qdf_nbuf_t msdu)
{ {
return (struct htt_host_rx_desc_base *) return (struct htt_host_rx_desc_base *)
(((size_t) (cdf_nbuf_head(msdu) + HTT_RX_DESC_ALIGN_MASK)) & (((size_t) (qdf_nbuf_head(msdu) + HTT_RX_DESC_ALIGN_MASK)) &
~HTT_RX_DESC_ALIGN_MASK); ~HTT_RX_DESC_ALIGN_MASK);
} }
@@ -191,7 +191,7 @@ static inline void htt_print_rx_desc_lro(struct htt_host_rx_desc_base *rx_desc)
* *
* Return: none * Return: none
*/ */
static inline void htt_rx_extract_lro_info(cdf_nbuf_t msdu, static inline void htt_rx_extract_lro_info(qdf_nbuf_t msdu,
struct htt_host_rx_desc_base *rx_desc) struct htt_host_rx_desc_base *rx_desc)
{ {
NBUF_CB_RX_LRO_ELIGIBLE(msdu) = rx_desc->msdu_end.lro_eligible; NBUF_CB_RX_LRO_ELIGIBLE(msdu) = rx_desc->msdu_end.lro_eligible;
@@ -212,7 +212,7 @@ static inline void htt_rx_extract_lro_info(cdf_nbuf_t msdu,
#else #else
static inline void htt_print_rx_desc_lro(struct htt_host_rx_desc_base *rx_desc) static inline void htt_print_rx_desc_lro(struct htt_host_rx_desc_base *rx_desc)
{} {}
static inline void htt_rx_extract_lro_info(cdf_nbuf_t msdu, static inline void htt_rx_extract_lro_info(qdf_nbuf_t msdu,
struct htt_host_rx_desc_base *rx_desc) {} struct htt_host_rx_desc_base *rx_desc) {}
#endif /* FEATURE_LRO */ #endif /* FEATURE_LRO */
@@ -388,19 +388,19 @@ static inline void htt_print_rx_desc(struct htt_host_rx_desc_base *rx_desc)
#define HTT_TX_NBUF_QUEUE_REMOVE(_pdev, _msdu) do { \ #define HTT_TX_NBUF_QUEUE_REMOVE(_pdev, _msdu) do { \
HTT_TX_MUTEX_ACQUIRE(&_pdev->txnbufq_mutex); \ HTT_TX_MUTEX_ACQUIRE(&_pdev->txnbufq_mutex); \
_msdu = cdf_nbuf_queue_remove(&_pdev->txnbufq);\ _msdu = qdf_nbuf_queue_remove(&_pdev->txnbufq);\
HTT_TX_MUTEX_RELEASE(&_pdev->txnbufq_mutex); \ HTT_TX_MUTEX_RELEASE(&_pdev->txnbufq_mutex); \
} while (0) } while (0)
#define HTT_TX_NBUF_QUEUE_ADD(_pdev, _msdu) do { \ #define HTT_TX_NBUF_QUEUE_ADD(_pdev, _msdu) do { \
HTT_TX_MUTEX_ACQUIRE(&_pdev->txnbufq_mutex); \ HTT_TX_MUTEX_ACQUIRE(&_pdev->txnbufq_mutex); \
cdf_nbuf_queue_add(&_pdev->txnbufq, _msdu); \ qdf_nbuf_queue_add(&_pdev->txnbufq, _msdu); \
HTT_TX_MUTEX_RELEASE(&_pdev->txnbufq_mutex); \ HTT_TX_MUTEX_RELEASE(&_pdev->txnbufq_mutex); \
} while (0) } while (0)
#define HTT_TX_NBUF_QUEUE_INSERT_HEAD(_pdev, _msdu) do { \ #define HTT_TX_NBUF_QUEUE_INSERT_HEAD(_pdev, _msdu) do { \
HTT_TX_MUTEX_ACQUIRE(&_pdev->txnbufq_mutex); \ HTT_TX_MUTEX_ACQUIRE(&_pdev->txnbufq_mutex); \
cdf_nbuf_queue_insert_head(&_pdev->txnbufq, _msdu);\ qdf_nbuf_queue_insert_head(&_pdev->txnbufq, _msdu);\
HTT_TX_MUTEX_RELEASE(&_pdev->txnbufq_mutex); \ HTT_TX_MUTEX_RELEASE(&_pdev->txnbufq_mutex); \
} while (0) } while (0)
#else #else
@@ -463,9 +463,9 @@ void htt_htc_disable_aspm(struct htt_pdev_t *pdev);
int int
htt_rx_hash_list_insert(struct htt_pdev_t *pdev, uint32_t paddr, htt_rx_hash_list_insert(struct htt_pdev_t *pdev, uint32_t paddr,
cdf_nbuf_t netbuf); qdf_nbuf_t netbuf);
cdf_nbuf_t htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, uint32_t paddr); qdf_nbuf_t htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, uint32_t paddr);
#ifdef IPA_OFFLOAD #ifdef IPA_OFFLOAD
int int
@@ -551,7 +551,7 @@ void htt_rx_dbg_rxbuf_init(struct htt_pdev_t *pdev)
static inline static inline
void htt_rx_dbg_rxbuf_set(struct htt_pdev_t *pdev, void htt_rx_dbg_rxbuf_set(struct htt_pdev_t *pdev,
uint32_t paddr, uint32_t paddr,
cdf_nbuf_t rx_netbuf) qdf_nbuf_t rx_netbuf)
{ {
if (pdev->rx_buff_list) { if (pdev->rx_buff_list) {
pdev->rx_buff_list[pdev->rx_buff_index].paddr = pdev->rx_buff_list[pdev->rx_buff_index].paddr =
@@ -574,7 +574,7 @@ void htt_rx_dbg_rxbuf_set(struct htt_pdev_t *pdev,
*/ */
static inline static inline
void htt_rx_dbg_rxbuf_reset(struct htt_pdev_t *pdev, void htt_rx_dbg_rxbuf_reset(struct htt_pdev_t *pdev,
cdf_nbuf_t netbuf) qdf_nbuf_t netbuf)
{ {
uint32_t index; uint32_t index;
@@ -609,13 +609,13 @@ void htt_rx_dbg_rxbuf_init(struct htt_pdev_t *pdev)
static inline static inline
void htt_rx_dbg_rxbuf_set(struct htt_pdev_t *pdev, void htt_rx_dbg_rxbuf_set(struct htt_pdev_t *pdev,
uint32_t paddr, uint32_t paddr,
cdf_nbuf_t rx_netbuf) qdf_nbuf_t rx_netbuf)
{ {
return; return;
} }
static inline static inline
void htt_rx_dbg_rxbuf_reset(struct htt_pdev_t *pdev, void htt_rx_dbg_rxbuf_reset(struct htt_pdev_t *pdev,
cdf_nbuf_t netbuf) qdf_nbuf_t netbuf)
{ {
return; return;
} }

Переглянути файл

@@ -41,7 +41,7 @@
#include <qdf_mem.h> /* qdf_mem_malloc,free, etc. */ #include <qdf_mem.h> /* qdf_mem_malloc,free, etc. */
#include <qdf_types.h> /* qdf_print, bool */ #include <qdf_types.h> /* qdf_print, bool */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_timer.h> /* qdf_timer_free */ #include <qdf_timer.h> /* qdf_timer_free */
#include <htt.h> /* HTT_HL_RX_DESC_SIZE */ #include <htt.h> /* HTT_HL_RX_DESC_SIZE */
@@ -128,13 +128,13 @@ void htt_rx_hash_deinit(struct htt_pdev_t *pdev)
listnode_offset); listnode_offset);
if (hash_entry->netbuf) { if (hash_entry->netbuf) {
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
cdf_nbuf_unmap(pdev->osdev, hash_entry->netbuf, qdf_nbuf_unmap(pdev->osdev, hash_entry->netbuf,
QDF_DMA_BIDIRECTIONAL); QDF_DMA_BIDIRECTIONAL);
#else #else
cdf_nbuf_unmap(pdev->osdev, hash_entry->netbuf, qdf_nbuf_unmap(pdev->osdev, hash_entry->netbuf,
QDF_DMA_FROM_DEVICE); QDF_DMA_FROM_DEVICE);
#endif #endif
cdf_nbuf_free(hash_entry->netbuf); qdf_nbuf_free(hash_entry->netbuf);
hash_entry->paddr = 0; hash_entry->paddr = 0;
} }
list_iter = list_iter->next; list_iter = list_iter->next;
@@ -230,11 +230,11 @@ void htt_rx_ring_fill_n(struct htt_pdev_t *pdev, int num)
idx = *(pdev->rx_ring.alloc_idx.vaddr); idx = *(pdev->rx_ring.alloc_idx.vaddr);
while (num > 0) { while (num > 0) {
qdf_dma_addr_t paddr; qdf_dma_addr_t paddr;
cdf_nbuf_t rx_netbuf; qdf_nbuf_t rx_netbuf;
int headroom; int headroom;
rx_netbuf = rx_netbuf =
cdf_nbuf_alloc(pdev->osdev, HTT_RX_BUF_SIZE, qdf_nbuf_alloc(pdev->osdev, HTT_RX_BUF_SIZE,
0, 4, false); 0, 4, false);
if (!rx_netbuf) { if (!rx_netbuf) {
qdf_timer_stop(&pdev->rx_ring. qdf_timer_stop(&pdev->rx_ring.
@@ -269,26 +269,26 @@ void htt_rx_ring_fill_n(struct htt_pdev_t *pdev, int num)
smp_mb(); smp_mb();
#endif #endif
/* /*
* Adjust cdf_nbuf_data to point to the location in the buffer * Adjust qdf_nbuf_data to point to the location in the buffer
* where the rx descriptor will be filled in. * where the rx descriptor will be filled in.
*/ */
headroom = cdf_nbuf_data(rx_netbuf) - (uint8_t *) rx_desc; headroom = qdf_nbuf_data(rx_netbuf) - (uint8_t *) rx_desc;
cdf_nbuf_push_head(rx_netbuf, headroom); qdf_nbuf_push_head(rx_netbuf, headroom);
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
status = status =
cdf_nbuf_map(pdev->osdev, rx_netbuf, qdf_nbuf_map(pdev->osdev, rx_netbuf,
QDF_DMA_BIDIRECTIONAL); QDF_DMA_BIDIRECTIONAL);
#else #else
status = status =
cdf_nbuf_map(pdev->osdev, rx_netbuf, qdf_nbuf_map(pdev->osdev, rx_netbuf,
QDF_DMA_FROM_DEVICE); QDF_DMA_FROM_DEVICE);
#endif #endif
if (status != QDF_STATUS_SUCCESS) { if (status != QDF_STATUS_SUCCESS) {
cdf_nbuf_free(rx_netbuf); qdf_nbuf_free(rx_netbuf);
goto fail; goto fail;
} }
paddr = cdf_nbuf_get_frag_paddr(rx_netbuf, 0); paddr = qdf_nbuf_get_frag_paddr(rx_netbuf, 0);
if (pdev->cfg.is_full_reorder_offload) { if (pdev->cfg.is_full_reorder_offload) {
if (qdf_unlikely if (qdf_unlikely
(htt_rx_hash_list_insert(pdev, paddr, (htt_rx_hash_list_insert(pdev, paddr,
@@ -296,13 +296,13 @@ void htt_rx_ring_fill_n(struct htt_pdev_t *pdev, int num)
qdf_print("%s: hash insert failed!\n", qdf_print("%s: hash insert failed!\n",
__func__); __func__);
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
cdf_nbuf_unmap(pdev->osdev, rx_netbuf, qdf_nbuf_unmap(pdev->osdev, rx_netbuf,
QDF_DMA_BIDIRECTIONAL); QDF_DMA_BIDIRECTIONAL);
#else #else
cdf_nbuf_unmap(pdev->osdev, rx_netbuf, qdf_nbuf_unmap(pdev->osdev, rx_netbuf,
QDF_DMA_FROM_DEVICE); QDF_DMA_FROM_DEVICE);
#endif #endif
cdf_nbuf_free(rx_netbuf); qdf_nbuf_free(rx_netbuf);
goto fail; goto fail;
} }
htt_rx_dbg_rxbuf_set(pdev, paddr, rx_netbuf); htt_rx_dbg_rxbuf_set(pdev, paddr, rx_netbuf);
@@ -360,17 +360,17 @@ void htt_rx_detach(struct htt_pdev_t *pdev)
while (sw_rd_idx != *(pdev->rx_ring.alloc_idx.vaddr)) { while (sw_rd_idx != *(pdev->rx_ring.alloc_idx.vaddr)) {
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
cdf_nbuf_unmap(pdev->osdev, qdf_nbuf_unmap(pdev->osdev,
pdev->rx_ring.buf. pdev->rx_ring.buf.
netbufs_ring[sw_rd_idx], netbufs_ring[sw_rd_idx],
QDF_DMA_BIDIRECTIONAL); QDF_DMA_BIDIRECTIONAL);
#else #else
cdf_nbuf_unmap(pdev->osdev, qdf_nbuf_unmap(pdev->osdev,
pdev->rx_ring.buf. pdev->rx_ring.buf.
netbufs_ring[sw_rd_idx], netbufs_ring[sw_rd_idx],
QDF_DMA_FROM_DEVICE); QDF_DMA_FROM_DEVICE);
#endif #endif
cdf_nbuf_free(pdev->rx_ring.buf. qdf_nbuf_free(pdev->rx_ring.buf.
netbufs_ring[sw_rd_idx]); netbufs_ring[sw_rd_idx]);
sw_rd_idx++; sw_rd_idx++;
sw_rd_idx &= pdev->rx_ring.size_mask; sw_rd_idx &= pdev->rx_ring.size_mask;
@@ -623,10 +623,10 @@ htt_rx_msdu_actions(htt_pdev_handle pdev,
*inspect = rx_msdu_fw_desc & FW_RX_DESC_INSPECT_M; *inspect = rx_msdu_fw_desc & FW_RX_DESC_INSPECT_M;
} }
static inline cdf_nbuf_t htt_rx_netbuf_pop(htt_pdev_handle pdev) static inline qdf_nbuf_t htt_rx_netbuf_pop(htt_pdev_handle pdev)
{ {
int idx; int idx;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
HTT_ASSERT1(htt_rx_ring_elems(pdev) != 0); HTT_ASSERT1(htt_rx_ring_elems(pdev) != 0);
@@ -644,7 +644,7 @@ static inline cdf_nbuf_t htt_rx_netbuf_pop(htt_pdev_handle pdev)
return msdu; return msdu;
} }
static inline cdf_nbuf_t static inline qdf_nbuf_t
htt_rx_in_order_netbuf_pop(htt_pdev_handle pdev, uint32_t paddr) htt_rx_in_order_netbuf_pop(htt_pdev_handle pdev, uint32_t paddr)
{ {
HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0); HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0);
@@ -657,7 +657,7 @@ htt_rx_in_order_netbuf_pop(htt_pdev_handle pdev, uint32_t paddr)
#ifdef CHECKSUM_OFFLOAD #ifdef CHECKSUM_OFFLOAD
static inline static inline
void void
htt_set_checksum_result_ll(htt_pdev_handle pdev, cdf_nbuf_t msdu, htt_set_checksum_result_ll(htt_pdev_handle pdev, qdf_nbuf_t msdu,
struct htt_host_rx_desc_base *rx_desc) struct htt_host_rx_desc_base *rx_desc)
{ {
#define MAX_IP_VER 2 #define MAX_IP_VER 2
@@ -704,7 +704,7 @@ htt_set_checksum_result_ll(htt_pdev_handle pdev, cdf_nbuf_t msdu,
QDF_NBUF_RX_CKSUM_NONE : QDF_NBUF_RX_CKSUM_NONE :
QDF_NBUF_RX_CKSUM_TCP_UDP_UNNECESSARY; QDF_NBUF_RX_CKSUM_TCP_UDP_UNNECESSARY;
} }
cdf_nbuf_set_rx_cksum(msdu, &cksum); qdf_nbuf_set_rx_cksum(msdu, &cksum);
#undef MAX_IP_VER #undef MAX_IP_VER
#undef MAX_PROTO_VAL #undef MAX_PROTO_VAL
} }
@@ -713,13 +713,13 @@ htt_set_checksum_result_ll(htt_pdev_handle pdev, cdf_nbuf_t msdu,
#endif #endif
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
void htt_rx_print_rx_indication(cdf_nbuf_t rx_ind_msg, htt_pdev_handle pdev) void htt_rx_print_rx_indication(qdf_nbuf_t rx_ind_msg, htt_pdev_handle pdev)
{ {
uint32_t *msg_word; uint32_t *msg_word;
int byte_offset; int byte_offset;
int mpdu_range, num_mpdu_range; int mpdu_range, num_mpdu_range;
msg_word = (uint32_t *) cdf_nbuf_data(rx_ind_msg); msg_word = (uint32_t *) qdf_nbuf_data(rx_ind_msg);
qdf_print qdf_print
("------------------HTT RX IND-----------------------------\n"); ("------------------HTT RX IND-----------------------------\n");
@@ -795,11 +795,11 @@ void htt_rx_print_rx_indication(cdf_nbuf_t rx_ind_msg, htt_pdev_handle pdev)
int int
htt_rx_amsdu_pop_ll(htt_pdev_handle pdev, htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
cdf_nbuf_t *head_msdu, cdf_nbuf_t *tail_msdu) qdf_nbuf_t *head_msdu, qdf_nbuf_t *tail_msdu)
{ {
int msdu_len, msdu_chaining = 0; int msdu_len, msdu_chaining = 0;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
struct htt_host_rx_desc_base *rx_desc; struct htt_host_rx_desc_base *rx_desc;
uint8_t *rx_ind_data; uint8_t *rx_ind_data;
uint32_t *msg_word, num_msdu_bytes; uint32_t *msg_word, num_msdu_bytes;
@@ -807,7 +807,7 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
uint8_t pad_bytes = 0; uint8_t pad_bytes = 0;
HTT_ASSERT1(htt_rx_ring_elems(pdev) != 0); HTT_ASSERT1(htt_rx_ring_elems(pdev) != 0);
rx_ind_data = cdf_nbuf_data(rx_ind_msg); rx_ind_data = qdf_nbuf_data(rx_ind_msg);
msg_word = (uint32_t *) rx_ind_data; msg_word = (uint32_t *) rx_ind_data;
msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word); msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word);
@@ -830,14 +830,14 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
* Set the netbuf length to be the entire buffer length * Set the netbuf length to be the entire buffer length
* initially, so the unmap will unmap the entire buffer. * initially, so the unmap will unmap the entire buffer.
*/ */
cdf_nbuf_set_pktlen(msdu, HTT_RX_BUF_SIZE); qdf_nbuf_set_pktlen(msdu, HTT_RX_BUF_SIZE);
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
cdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_BIDIRECTIONAL); qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_BIDIRECTIONAL);
#else #else
cdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE); qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE);
#endif #endif
/* cache consistency has been taken care of by cdf_nbuf_unmap */ /* cache consistency has been taken care of by qdf_nbuf_unmap */
/* /*
* Now read the rx descriptor. * Now read the rx descriptor.
@@ -854,7 +854,7 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
* than the descriptor. * than the descriptor.
*/ */
cdf_nbuf_pull_head(msdu, qdf_nbuf_pull_head(msdu,
HTT_RX_STD_DESC_RESERVATION + pad_bytes); HTT_RX_STD_DESC_RESERVATION + pad_bytes);
/* /*
@@ -879,7 +879,7 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
RX_ATTENTION_0_MSDU_DONE_MASK))) { RX_ATTENTION_0_MSDU_DONE_MASK))) {
qdf_mdelay(1); qdf_mdelay(1);
cdf_invalidate_range((void *)rx_desc, qdf_invalidate_range((void *)rx_desc,
(void *)((char *)rx_desc + (void *)((char *)rx_desc +
HTT_RX_STD_DESC_RESERVATION)); HTT_RX_STD_DESC_RESERVATION));
@@ -895,7 +895,7 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
#ifdef HTT_RX_RESTORE #ifdef HTT_RX_RESTORE
qdf_print("RX done bit error detected!\n"); qdf_print("RX done bit error detected!\n");
cdf_nbuf_set_next(msdu, NULL); qdf_nbuf_set_next(msdu, NULL);
*tail_msdu = msdu; *tail_msdu = msdu;
pdev->rx_ring.rx_reset = 1; pdev->rx_ring.rx_reset = 1;
return msdu_chaining; return msdu_chaining;
@@ -997,7 +997,7 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
if (msdu_len > 0x3000) if (msdu_len > 0x3000)
break; break;
#endif #endif
cdf_nbuf_trim_tail(msdu, qdf_nbuf_trim_tail(msdu,
HTT_RX_BUF_SIZE - HTT_RX_BUF_SIZE -
(RX_STD_DESC_SIZE + (RX_STD_DESC_SIZE +
msdu_len)); msdu_len));
@@ -1005,10 +1005,10 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
} while (0); } while (0);
while (msdu_chained--) { while (msdu_chained--) {
cdf_nbuf_t next = htt_rx_netbuf_pop(pdev); qdf_nbuf_t next = htt_rx_netbuf_pop(pdev);
cdf_nbuf_set_pktlen(next, HTT_RX_BUF_SIZE); qdf_nbuf_set_pktlen(next, HTT_RX_BUF_SIZE);
msdu_len -= HTT_RX_BUF_SIZE; msdu_len -= HTT_RX_BUF_SIZE;
cdf_nbuf_set_next(msdu, next); qdf_nbuf_set_next(msdu, next);
msdu = next; msdu = next;
msdu_chaining = 1; msdu_chaining = 1;
@@ -1025,7 +1025,7 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
RX_STD_DESC_SIZE); RX_STD_DESC_SIZE);
} }
cdf_nbuf_trim_tail(next, qdf_nbuf_trim_tail(next,
HTT_RX_BUF_SIZE - HTT_RX_BUF_SIZE -
(RX_STD_DESC_SIZE + (RX_STD_DESC_SIZE +
msdu_len)); msdu_len));
@@ -1038,11 +1038,11 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
RX_MSDU_END_4_LAST_MSDU_LSB; RX_MSDU_END_4_LAST_MSDU_LSB;
if (last_msdu) { if (last_msdu) {
cdf_nbuf_set_next(msdu, NULL); qdf_nbuf_set_next(msdu, NULL);
break; break;
} else { } else {
cdf_nbuf_t next = htt_rx_netbuf_pop(pdev); qdf_nbuf_t next = htt_rx_netbuf_pop(pdev);
cdf_nbuf_set_next(msdu, next); qdf_nbuf_set_next(msdu, next);
msdu = next; msdu = next;
} }
} }
@@ -1065,26 +1065,26 @@ htt_rx_amsdu_pop_ll(htt_pdev_handle pdev,
int int
htt_rx_offload_msdu_pop_ll(htt_pdev_handle pdev, htt_rx_offload_msdu_pop_ll(htt_pdev_handle pdev,
cdf_nbuf_t offload_deliver_msg, qdf_nbuf_t offload_deliver_msg,
int *vdev_id, int *vdev_id,
int *peer_id, int *peer_id,
int *tid, int *tid,
uint8_t *fw_desc, uint8_t *fw_desc,
cdf_nbuf_t *head_buf, cdf_nbuf_t *tail_buf) qdf_nbuf_t *head_buf, qdf_nbuf_t *tail_buf)
{ {
cdf_nbuf_t buf; qdf_nbuf_t buf;
uint32_t *msdu_hdr, msdu_len; uint32_t *msdu_hdr, msdu_len;
*head_buf = *tail_buf = buf = htt_rx_netbuf_pop(pdev); *head_buf = *tail_buf = buf = htt_rx_netbuf_pop(pdev);
/* Fake read mpdu_desc to keep desc ptr in sync */ /* Fake read mpdu_desc to keep desc ptr in sync */
htt_rx_mpdu_desc_list_next(pdev, NULL); htt_rx_mpdu_desc_list_next(pdev, NULL);
cdf_nbuf_set_pktlen(buf, HTT_RX_BUF_SIZE); qdf_nbuf_set_pktlen(buf, HTT_RX_BUF_SIZE);
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
cdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_BIDIRECTIONAL); qdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_BIDIRECTIONAL);
#else #else
cdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_FROM_DEVICE); qdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_FROM_DEVICE);
#endif #endif
msdu_hdr = (uint32_t *) cdf_nbuf_data(buf); msdu_hdr = (uint32_t *) qdf_nbuf_data(buf);
/* First dword */ /* First dword */
msdu_len = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(*msdu_hdr); msdu_len = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(*msdu_hdr);
@@ -1096,8 +1096,8 @@ htt_rx_offload_msdu_pop_ll(htt_pdev_handle pdev,
*tid = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(*msdu_hdr); *tid = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(*msdu_hdr);
*fw_desc = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(*msdu_hdr); *fw_desc = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(*msdu_hdr);
cdf_nbuf_pull_head(buf, HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES); qdf_nbuf_pull_head(buf, HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES);
cdf_nbuf_set_pktlen(buf, msdu_len); qdf_nbuf_set_pktlen(buf, msdu_len);
return 0; return 0;
} }
@@ -1109,9 +1109,9 @@ htt_rx_offload_paddr_msdu_pop_ll(htt_pdev_handle pdev,
int *peer_id, int *peer_id,
int *tid, int *tid,
uint8_t *fw_desc, uint8_t *fw_desc,
cdf_nbuf_t *head_buf, cdf_nbuf_t *tail_buf) qdf_nbuf_t *head_buf, qdf_nbuf_t *tail_buf)
{ {
cdf_nbuf_t buf; qdf_nbuf_t buf;
uint32_t *msdu_hdr, msdu_len; uint32_t *msdu_hdr, msdu_len;
uint32_t *curr_msdu; uint32_t *curr_msdu;
uint32_t paddr; uint32_t paddr;
@@ -1125,13 +1125,13 @@ htt_rx_offload_paddr_msdu_pop_ll(htt_pdev_handle pdev,
qdf_print("%s: netbuf pop failed!\n", __func__); qdf_print("%s: netbuf pop failed!\n", __func__);
return 0; return 0;
} }
cdf_nbuf_set_pktlen(buf, HTT_RX_BUF_SIZE); qdf_nbuf_set_pktlen(buf, HTT_RX_BUF_SIZE);
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
cdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_BIDIRECTIONAL); qdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_BIDIRECTIONAL);
#else #else
cdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_FROM_DEVICE); qdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_FROM_DEVICE);
#endif #endif
msdu_hdr = (uint32_t *) cdf_nbuf_data(buf); msdu_hdr = (uint32_t *) qdf_nbuf_data(buf);
/* First dword */ /* First dword */
msdu_len = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(*msdu_hdr); msdu_len = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(*msdu_hdr);
@@ -1143,13 +1143,13 @@ htt_rx_offload_paddr_msdu_pop_ll(htt_pdev_handle pdev,
*tid = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(*msdu_hdr); *tid = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(*msdu_hdr);
*fw_desc = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(*msdu_hdr); *fw_desc = HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(*msdu_hdr);
cdf_nbuf_pull_head(buf, HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES); qdf_nbuf_pull_head(buf, HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES);
cdf_nbuf_set_pktlen(buf, msdu_len); qdf_nbuf_set_pktlen(buf, msdu_len);
return 0; return 0;
} }
extern void extern void
dump_pkt(cdf_nbuf_t nbuf, uint32_t nbuf_paddr, int len); dump_pkt(qdf_nbuf_t nbuf, uint32_t nbuf_paddr, int len);
#ifdef RX_HASH_DEBUG #ifdef RX_HASH_DEBUG
#define HTT_RX_CHECK_MSDU_COUNT(msdu_count) HTT_ASSERT_ALWAYS(msdu_count) #define HTT_RX_CHECK_MSDU_COUNT(msdu_count) HTT_ASSERT_ALWAYS(msdu_count)
@@ -1160,10 +1160,10 @@ dump_pkt(cdf_nbuf_t nbuf, uint32_t nbuf_paddr, int len);
/* Return values: 1 - success, 0 - failure */ /* Return values: 1 - success, 0 - failure */
int int
htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
cdf_nbuf_t *head_msdu, cdf_nbuf_t *tail_msdu) qdf_nbuf_t *head_msdu, qdf_nbuf_t *tail_msdu)
{ {
cdf_nbuf_t msdu, next, prev = NULL; qdf_nbuf_t msdu, next, prev = NULL;
uint8_t *rx_ind_data; uint8_t *rx_ind_data;
uint32_t *msg_word; uint32_t *msg_word;
unsigned int msdu_count = 0; unsigned int msdu_count = 0;
@@ -1172,7 +1172,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0); HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0);
rx_ind_data = cdf_nbuf_data(rx_ind_msg); rx_ind_data = qdf_nbuf_data(rx_ind_msg);
msg_word = (uint32_t *) rx_ind_data; msg_word = (uint32_t *) rx_ind_data;
offload_ind = HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(*msg_word); offload_ind = HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(*msg_word);
@@ -1206,14 +1206,14 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
* Set the netbuf length to be the entire buffer length * Set the netbuf length to be the entire buffer length
* initially, so the unmap will unmap the entire buffer. * initially, so the unmap will unmap the entire buffer.
*/ */
cdf_nbuf_set_pktlen(msdu, HTT_RX_BUF_SIZE); qdf_nbuf_set_pktlen(msdu, HTT_RX_BUF_SIZE);
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
cdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_BIDIRECTIONAL); qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_BIDIRECTIONAL);
#else #else
cdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE); qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE);
#endif #endif
/* cache consistency has been taken care of by cdf_nbuf_unmap */ /* cache consistency has been taken care of by qdf_nbuf_unmap */
rx_desc = htt_rx_desc(msdu); rx_desc = htt_rx_desc(msdu);
htt_rx_extract_lro_info(msdu, rx_desc); htt_rx_extract_lro_info(msdu, rx_desc);
@@ -1222,14 +1222,14 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
* Make the netbuf's data pointer point to the payload rather * Make the netbuf's data pointer point to the payload rather
* than the descriptor. * than the descriptor.
*/ */
cdf_nbuf_pull_head(msdu, HTT_RX_STD_DESC_RESERVATION); qdf_nbuf_pull_head(msdu, HTT_RX_STD_DESC_RESERVATION);
#if HTT_PADDR64 #if HTT_PADDR64
#define NEXT_FIELD_OFFSET_IN32 2 #define NEXT_FIELD_OFFSET_IN32 2
#else /* ! HTT_PADDR64 */ #else /* ! HTT_PADDR64 */
#define NEXT_FIELD_OFFSET_IN32 1 #define NEXT_FIELD_OFFSET_IN32 1
#endif /* HTT_PADDR64 */ #endif /* HTT_PADDR64 */
# #
cdf_nbuf_trim_tail(msdu, qdf_nbuf_trim_tail(msdu,
HTT_RX_BUF_SIZE - HTT_RX_BUF_SIZE -
(RX_STD_DESC_SIZE + (RX_STD_DESC_SIZE +
HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET( HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(
@@ -1263,7 +1263,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
return 0; return 0;
} else { } else {
*tail_msdu = prev; *tail_msdu = prev;
cdf_nbuf_set_next(prev, NULL); qdf_nbuf_set_next(prev, NULL);
return 1; return 1;
} }
} else { /* if this is not the last msdu */ } else { /* if this is not the last msdu */
@@ -1284,7 +1284,7 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
* next pointer of the preceding msdu * next pointer of the preceding msdu
*/ */
if (prev) { if (prev) {
cdf_nbuf_set_next(prev, next); qdf_nbuf_set_next(prev, next);
} else { } else {
/* if this is the first msdu, update the /* if this is the first msdu, update the
* head pointer * head pointer
@@ -1311,22 +1311,22 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
*tail_msdu = NULL; *tail_msdu = NULL;
return 0; return 0;
} }
cdf_nbuf_set_next(msdu, next); qdf_nbuf_set_next(msdu, next);
prev = msdu; prev = msdu;
msdu = next; msdu = next;
} else { } else {
*tail_msdu = msdu; *tail_msdu = msdu;
cdf_nbuf_set_next(msdu, NULL); qdf_nbuf_set_next(msdu, NULL);
} }
} }
return 1; return 1;
} }
/* Util fake function that has same prototype as cdf_nbuf_clone that just /* Util fake function that has same prototype as qdf_nbuf_clone that just
* retures the same nbuf * retures the same nbuf
*/ */
cdf_nbuf_t htt_rx_cdf_noclone_buf(cdf_nbuf_t buf) qdf_nbuf_t htt_rx_cdf_noclone_buf(qdf_nbuf_t buf)
{ {
return buf; return buf;
} }
@@ -1393,15 +1393,15 @@ htt_rx_parse_ppdu_start_status(struct htt_host_rx_desc_base *rx_desc,
/* This function is used by montior mode code to restitch an MSDU list /* This function is used by montior mode code to restitch an MSDU list
* corresponding to an MPDU back into an MPDU by linking up the skbs. * corresponding to an MPDU back into an MPDU by linking up the skbs.
*/ */
cdf_nbuf_t qdf_nbuf_t
htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev, htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
cdf_nbuf_t head_msdu, qdf_nbuf_t head_msdu,
struct ieee80211_rx_status *rx_status, struct ieee80211_rx_status *rx_status,
unsigned clone_not_reqd) unsigned clone_not_reqd)
{ {
cdf_nbuf_t msdu, mpdu_buf, prev_buf, msdu_orig, head_frag_list_cloned; qdf_nbuf_t msdu, mpdu_buf, prev_buf, msdu_orig, head_frag_list_cloned;
cdf_nbuf_t (*clone_nbuf_fn)(cdf_nbuf_t buf); qdf_nbuf_t (*clone_nbuf_fn)(qdf_nbuf_t buf);
unsigned decap_format, wifi_hdr_len, sec_hdr_len, msdu_llc_len, unsigned decap_format, wifi_hdr_len, sec_hdr_len, msdu_llc_len,
mpdu_buf_len, decap_hdr_pull_bytes, frag_list_sum_len, dir, mpdu_buf_len, decap_hdr_pull_bytes, frag_list_sum_len, dir,
is_amsdu, is_first_frag, amsdu_pad, msdu_len; is_amsdu, is_first_frag, amsdu_pad, msdu_len;
@@ -1415,7 +1415,7 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
* waste cycles cloning the packets * waste cycles cloning the packets
*/ */
clone_nbuf_fn = clone_nbuf_fn =
clone_not_reqd ? htt_rx_cdf_noclone_buf : cdf_nbuf_clone; clone_not_reqd ? htt_rx_cdf_noclone_buf : qdf_nbuf_clone;
/* The nbuf has been pulled just beyond the status and points to the /* The nbuf has been pulled just beyond the status and points to the
* payload * payload
@@ -1452,13 +1452,13 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
frag_list_sum_len = 0; frag_list_sum_len = 0;
is_first_frag = 1; is_first_frag = 1;
msdu_len = cdf_nbuf_len(mpdu_buf); msdu_len = qdf_nbuf_len(mpdu_buf);
/* Drop the zero-length msdu */ /* Drop the zero-length msdu */
if (!msdu_len) if (!msdu_len)
goto mpdu_stitch_fail; goto mpdu_stitch_fail;
msdu_orig = cdf_nbuf_next(head_msdu); msdu_orig = qdf_nbuf_next(head_msdu);
while (msdu_orig) { while (msdu_orig) {
@@ -1472,7 +1472,7 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
head_frag_list_cloned = msdu; head_frag_list_cloned = msdu;
} }
msdu_len = cdf_nbuf_len(msdu); msdu_len = qdf_nbuf_len(msdu);
/* Drop the zero-length msdu */ /* Drop the zero-length msdu */
if (!msdu_len) if (!msdu_len)
goto mpdu_stitch_fail; goto mpdu_stitch_fail;
@@ -1480,22 +1480,22 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
frag_list_sum_len += msdu_len; frag_list_sum_len += msdu_len;
/* Maintain the linking of the cloned MSDUS */ /* Maintain the linking of the cloned MSDUS */
cdf_nbuf_set_next_ext(prev_buf, msdu); qdf_nbuf_set_next_ext(prev_buf, msdu);
/* Move to the next */ /* Move to the next */
prev_buf = msdu; prev_buf = msdu;
msdu_orig = cdf_nbuf_next(msdu_orig); msdu_orig = qdf_nbuf_next(msdu_orig);
} }
/* The last msdu length need be larger than HTT_FCS_LEN */ /* The last msdu length need be larger than HTT_FCS_LEN */
if (msdu_len < HTT_FCS_LEN) if (msdu_len < HTT_FCS_LEN)
goto mpdu_stitch_fail; goto mpdu_stitch_fail;
cdf_nbuf_trim_tail(prev_buf, HTT_FCS_LEN); qdf_nbuf_trim_tail(prev_buf, HTT_FCS_LEN);
/* If there were more fragments to this RAW frame */ /* If there were more fragments to this RAW frame */
if (head_frag_list_cloned) { if (head_frag_list_cloned) {
cdf_nbuf_append_ext_list(mpdu_buf, qdf_nbuf_append_ext_list(mpdu_buf,
head_frag_list_cloned, head_frag_list_cloned,
frag_list_sum_len); frag_list_sum_len);
} }
@@ -1544,7 +1544,7 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
* accomodating any radio-tap /prism like PHY header * accomodating any radio-tap /prism like PHY header
*/ */
#define HTT_MAX_MONITOR_HEADER (512) #define HTT_MAX_MONITOR_HEADER (512)
mpdu_buf = cdf_nbuf_alloc(pdev->osdev, mpdu_buf = qdf_nbuf_alloc(pdev->osdev,
HTT_MAX_MONITOR_HEADER + mpdu_buf_len, HTT_MAX_MONITOR_HEADER + mpdu_buf_len,
HTT_MAX_MONITOR_HEADER, 4, false); HTT_MAX_MONITOR_HEADER, 4, false);
@@ -1556,7 +1556,7 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
*/ */
prev_buf = mpdu_buf; prev_buf = mpdu_buf;
dest = cdf_nbuf_put_tail(prev_buf, wifi_hdr_len); dest = qdf_nbuf_put_tail(prev_buf, wifi_hdr_len);
if (!dest) if (!dest)
goto mpdu_stitch_fail; goto mpdu_stitch_fail;
qdf_mem_copy(dest, hdr_desc, wifi_hdr_len); qdf_mem_copy(dest, hdr_desc, wifi_hdr_len);
@@ -1591,7 +1591,7 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
} else { } else {
/* Maintain the linking of the cloned MSDUS */ /* Maintain the linking of the cloned MSDUS */
cdf_nbuf_set_next_ext(prev_buf, msdu); qdf_nbuf_set_next_ext(prev_buf, msdu);
/* Reload the hdr ptr only on non-first MSDUs */ /* Reload the hdr ptr only on non-first MSDUs */
rx_desc = htt_rx_desc(msdu_orig); rx_desc = htt_rx_desc(msdu_orig);
@@ -1600,18 +1600,18 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
} }
/* Copy this buffers MSDU related status into the prev buffer */ /* Copy this buffers MSDU related status into the prev buffer */
dest = cdf_nbuf_put_tail(prev_buf, msdu_llc_len + amsdu_pad); dest = qdf_nbuf_put_tail(prev_buf, msdu_llc_len + amsdu_pad);
dest += amsdu_pad; dest += amsdu_pad;
qdf_mem_copy(dest, hdr_desc, msdu_llc_len); qdf_mem_copy(dest, hdr_desc, msdu_llc_len);
/* Push the MSDU buffer beyond the decap header */ /* Push the MSDU buffer beyond the decap header */
cdf_nbuf_pull_head(msdu, decap_hdr_pull_bytes); qdf_nbuf_pull_head(msdu, decap_hdr_pull_bytes);
frag_list_sum_len += frag_list_sum_len +=
msdu_llc_len + cdf_nbuf_len(msdu) + amsdu_pad; msdu_llc_len + qdf_nbuf_len(msdu) + amsdu_pad;
/* Set up intra-AMSDU pad to be added to start of next buffer - /* Set up intra-AMSDU pad to be added to start of next buffer -
* AMSDU pad is 4 byte pad on AMSDU subframe */ * AMSDU pad is 4 byte pad on AMSDU subframe */
amsdu_pad = (msdu_llc_len + cdf_nbuf_len(msdu)) & 0x3; amsdu_pad = (msdu_llc_len + qdf_nbuf_len(msdu)) & 0x3;
amsdu_pad = amsdu_pad ? (4 - amsdu_pad) : 0; amsdu_pad = amsdu_pad ? (4 - amsdu_pad) : 0;
/* TODO FIXME How do we handle MSDUs that have fraglist - Should /* TODO FIXME How do we handle MSDUs that have fraglist - Should
@@ -1621,12 +1621,12 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
/* Move to the next */ /* Move to the next */
prev_buf = msdu; prev_buf = msdu;
msdu_orig = cdf_nbuf_next(msdu_orig); msdu_orig = qdf_nbuf_next(msdu_orig);
} }
/* TODO: Convert this to suitable cdf routines */ /* TODO: Convert this to suitable cdf routines */
cdf_nbuf_append_ext_list(mpdu_buf, head_frag_list_cloned, qdf_nbuf_append_ext_list(mpdu_buf, head_frag_list_cloned,
frag_list_sum_len); frag_list_sum_len);
mpdu_stitch_done: mpdu_stitch_done:
@@ -1644,8 +1644,8 @@ mpdu_stitch_done:
msdu = head_msdu; msdu = head_msdu;
while (msdu) { while (msdu) {
msdu_orig = msdu; msdu_orig = msdu;
msdu = cdf_nbuf_next(msdu); msdu = qdf_nbuf_next(msdu);
cdf_nbuf_set_next(msdu_orig, NULL); qdf_nbuf_set_next(msdu_orig, NULL);
} }
} }
@@ -1656,27 +1656,27 @@ mpdu_stitch_fail:
if (!clone_not_reqd) { if (!clone_not_reqd) {
/* Free the head buffer */ /* Free the head buffer */
if (mpdu_buf) if (mpdu_buf)
cdf_nbuf_free(mpdu_buf); qdf_nbuf_free(mpdu_buf);
/* Free the partial list */ /* Free the partial list */
while (head_frag_list_cloned) { while (head_frag_list_cloned) {
msdu = head_frag_list_cloned; msdu = head_frag_list_cloned;
head_frag_list_cloned = head_frag_list_cloned =
cdf_nbuf_next_ext(head_frag_list_cloned); qdf_nbuf_next_ext(head_frag_list_cloned);
cdf_nbuf_free(msdu); qdf_nbuf_free(msdu);
} }
} else { } else {
/* Free the alloced head buffer */ /* Free the alloced head buffer */
if (decap_format != HW_RX_DECAP_FORMAT_RAW) if (decap_format != HW_RX_DECAP_FORMAT_RAW)
if (mpdu_buf) if (mpdu_buf)
cdf_nbuf_free(mpdu_buf); qdf_nbuf_free(mpdu_buf);
/* Free the orig buffers */ /* Free the orig buffers */
msdu = head_msdu; msdu = head_msdu;
while (msdu) { while (msdu) {
msdu_orig = msdu; msdu_orig = msdu;
msdu = cdf_nbuf_next(msdu); msdu = qdf_nbuf_next(msdu);
cdf_nbuf_free(msdu_orig); qdf_nbuf_free(msdu_orig);
} }
} }
@@ -1698,8 +1698,8 @@ int16_t htt_rx_mpdu_desc_rssi_dbm(htt_pdev_handle pdev, void *mpdu_desc)
* to either htt_rx_amsdu_pop_ll or htt_rx_amsdu_rx_in_order_pop_ll. * to either htt_rx_amsdu_pop_ll or htt_rx_amsdu_rx_in_order_pop_ll.
*/ */
int (*htt_rx_amsdu_pop)(htt_pdev_handle pdev, int (*htt_rx_amsdu_pop)(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
cdf_nbuf_t *head_msdu, cdf_nbuf_t *tail_msdu); qdf_nbuf_t *head_msdu, qdf_nbuf_t *tail_msdu);
/* /*
* htt_rx_frag_pop - * htt_rx_frag_pop -
@@ -1707,20 +1707,20 @@ int (*htt_rx_amsdu_pop)(htt_pdev_handle pdev,
* to either htt_rx_amsdu_pop_ll * to either htt_rx_amsdu_pop_ll
*/ */
int (*htt_rx_frag_pop)(htt_pdev_handle pdev, int (*htt_rx_frag_pop)(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
cdf_nbuf_t *head_msdu, cdf_nbuf_t *tail_msdu); qdf_nbuf_t *head_msdu, qdf_nbuf_t *tail_msdu);
int int
(*htt_rx_offload_msdu_pop)(htt_pdev_handle pdev, (*htt_rx_offload_msdu_pop)(htt_pdev_handle pdev,
cdf_nbuf_t offload_deliver_msg, qdf_nbuf_t offload_deliver_msg,
int *vdev_id, int *vdev_id,
int *peer_id, int *peer_id,
int *tid, int *tid,
uint8_t *fw_desc, uint8_t *fw_desc,
cdf_nbuf_t *head_buf, cdf_nbuf_t *tail_buf); qdf_nbuf_t *head_buf, qdf_nbuf_t *tail_buf);
void * (*htt_rx_mpdu_desc_list_next)(htt_pdev_handle pdev, void * (*htt_rx_mpdu_desc_list_next)(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg); qdf_nbuf_t rx_ind_msg);
bool (*htt_rx_mpdu_desc_retry)( bool (*htt_rx_mpdu_desc_retry)(
htt_pdev_handle pdev, void *mpdu_desc); htt_pdev_handle pdev, void *mpdu_desc);
@@ -1744,17 +1744,17 @@ bool (*htt_rx_msdu_is_wlan_mcast)(htt_pdev_handle pdev, void *msdu_desc);
int (*htt_rx_msdu_is_frag)(htt_pdev_handle pdev, void *msdu_desc); int (*htt_rx_msdu_is_frag)(htt_pdev_handle pdev, void *msdu_desc);
void * (*htt_rx_msdu_desc_retrieve)(htt_pdev_handle pdev, cdf_nbuf_t msdu); void * (*htt_rx_msdu_desc_retrieve)(htt_pdev_handle pdev, qdf_nbuf_t msdu);
bool (*htt_rx_mpdu_is_encrypted)(htt_pdev_handle pdev, void *mpdu_desc); bool (*htt_rx_mpdu_is_encrypted)(htt_pdev_handle pdev, void *mpdu_desc);
bool (*htt_rx_msdu_desc_key_id)(htt_pdev_handle pdev, bool (*htt_rx_msdu_desc_key_id)(htt_pdev_handle pdev,
void *mpdu_desc, uint8_t *key_id); void *mpdu_desc, uint8_t *key_id);
void *htt_rx_mpdu_desc_list_next_ll(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg) void *htt_rx_mpdu_desc_list_next_ll(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg)
{ {
int idx = pdev->rx_ring.sw_rd_idx.msdu_desc; int idx = pdev->rx_ring.sw_rd_idx.msdu_desc;
cdf_nbuf_t netbuf = pdev->rx_ring.buf.netbufs_ring[idx]; qdf_nbuf_t netbuf = pdev->rx_ring.buf.netbufs_ring[idx];
pdev->rx_ring.sw_rd_idx.msdu_desc = pdev->rx_ring.sw_rd_idx.msdu_payld; pdev->rx_ring.sw_rd_idx.msdu_desc = pdev->rx_ring.sw_rd_idx.msdu_payld;
return (void *)htt_rx_desc(netbuf); return (void *)htt_rx_desc(netbuf);
} }
@@ -1773,12 +1773,12 @@ bool (*htt_rx_msdu_center_freq)(
uint8_t *phy_mode); uint8_t *phy_mode);
void *htt_rx_in_ord_mpdu_desc_list_next_ll(htt_pdev_handle pdev, void *htt_rx_in_ord_mpdu_desc_list_next_ll(htt_pdev_handle pdev,
cdf_nbuf_t netbuf) qdf_nbuf_t netbuf)
{ {
return (void *)htt_rx_desc(netbuf); return (void *)htt_rx_desc(netbuf);
} }
void *htt_rx_msdu_desc_retrieve_ll(htt_pdev_handle pdev, cdf_nbuf_t msdu) void *htt_rx_msdu_desc_retrieve_ll(htt_pdev_handle pdev, qdf_nbuf_t msdu)
{ {
return htt_rx_desc(msdu); return htt_rx_desc(msdu);
} }
@@ -1834,12 +1834,12 @@ htt_rx_msdu_desc_key_id_ll(htt_pdev_handle pdev, void *mpdu_desc,
return true; return true;
} }
void htt_rx_desc_frame_free(htt_pdev_handle htt_pdev, cdf_nbuf_t msdu) void htt_rx_desc_frame_free(htt_pdev_handle htt_pdev, qdf_nbuf_t msdu)
{ {
cdf_nbuf_free(msdu); qdf_nbuf_free(msdu);
} }
void htt_rx_msdu_desc_free(htt_pdev_handle htt_pdev, cdf_nbuf_t msdu) void htt_rx_msdu_desc_free(htt_pdev_handle htt_pdev, qdf_nbuf_t msdu)
{ {
/* /*
* The rx descriptor is in the same buffer as the rx MSDU payload, * The rx descriptor is in the same buffer as the rx MSDU payload,
@@ -1944,7 +1944,7 @@ static inline void htt_list_remove(struct htt_list_node *node)
Returns 0 - success, 1 - failure */ Returns 0 - success, 1 - failure */
int int
htt_rx_hash_list_insert(struct htt_pdev_t *pdev, uint32_t paddr, htt_rx_hash_list_insert(struct htt_pdev_t *pdev, uint32_t paddr,
cdf_nbuf_t netbuf) qdf_nbuf_t netbuf)
{ {
int i; int i;
struct htt_rx_hash_entry *hash_element = NULL; struct htt_rx_hash_entry *hash_element = NULL;
@@ -1994,11 +1994,11 @@ htt_rx_hash_list_insert(struct htt_pdev_t *pdev, uint32_t paddr,
/* Given a physical address this function will find the corresponding network /* Given a physical address this function will find the corresponding network
buffer from the hash table. buffer from the hash table.
Note: this function is not thread-safe */ Note: this function is not thread-safe */
cdf_nbuf_t htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, uint32_t paddr) qdf_nbuf_t htt_rx_hash_list_lookup(struct htt_pdev_t *pdev, uint32_t paddr)
{ {
uint32_t i; uint32_t i;
struct htt_list_node *list_iter = NULL; struct htt_list_node *list_iter = NULL;
cdf_nbuf_t netbuf = NULL; qdf_nbuf_t netbuf = NULL;
struct htt_rx_hash_entry *hash_entry; struct htt_rx_hash_entry *hash_entry;
i = RX_HASH_FUNCTION(paddr); i = RX_HASH_FUNCTION(paddr);
@@ -2162,7 +2162,7 @@ int htt_rx_attach(struct htt_pdev_t *pdev)
*pdev->rx_ring.target_idx.vaddr = 0; *pdev->rx_ring.target_idx.vaddr = 0;
} else { } else {
pdev->rx_ring.buf.netbufs_ring = pdev->rx_ring.buf.netbufs_ring =
qdf_mem_malloc(pdev->rx_ring.size * sizeof(cdf_nbuf_t)); qdf_mem_malloc(pdev->rx_ring.size * sizeof(qdf_nbuf_t));
if (!pdev->rx_ring.buf.netbufs_ring) if (!pdev->rx_ring.buf.netbufs_ring)
goto fail1; goto fail1;

Переглянути файл

@@ -38,7 +38,7 @@
#include <wma.h> #include <wma.h>
#include <htc_api.h> /* HTC_PACKET */ #include <htc_api.h> /* HTC_PACKET */
#include <htt.h> /* HTT_T2H_MSG_TYPE, etc. */ #include <htt.h> /* HTT_T2H_MSG_TYPE, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_htt_rx_api.h> #include <ol_htt_rx_api.h>
#include <ol_htt_tx_api.h> #include <ol_htt_tx_api.h>
@@ -86,16 +86,16 @@ static uint8_t *htt_t2h_mac_addr_deswizzle(uint8_t *tgt_mac_addr,
#endif #endif
} }
static void htt_rx_frag_set_last_msdu(struct htt_pdev_t *pdev, cdf_nbuf_t msg) static void htt_rx_frag_set_last_msdu(struct htt_pdev_t *pdev, qdf_nbuf_t msg)
{ {
uint32_t *msg_word; uint32_t *msg_word;
unsigned num_msdu_bytes; unsigned num_msdu_bytes;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
struct htt_host_rx_desc_base *rx_desc; struct htt_host_rx_desc_base *rx_desc;
int start_idx; int start_idx;
uint8_t *p_fw_msdu_rx_desc = 0; uint8_t *p_fw_msdu_rx_desc = 0;
msg_word = (uint32_t *) cdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
num_msdu_bytes = HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET( num_msdu_bytes = HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET(
*(msg_word + HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32)); *(msg_word + HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32));
/* /*
@@ -123,22 +123,22 @@ static void htt_rx_frag_set_last_msdu(struct htt_pdev_t *pdev, cdf_nbuf_t msg)
*/ */
start_idx = pdev->rx_ring.sw_rd_idx.msdu_payld; start_idx = pdev->rx_ring.sw_rd_idx.msdu_payld;
msdu = pdev->rx_ring.buf.netbufs_ring[start_idx]; msdu = pdev->rx_ring.buf.netbufs_ring[start_idx];
cdf_nbuf_set_pktlen(msdu, HTT_RX_BUF_SIZE); qdf_nbuf_set_pktlen(msdu, HTT_RX_BUF_SIZE);
cdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE); qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE);
rx_desc = htt_rx_desc(msdu); rx_desc = htt_rx_desc(msdu);
*((uint8_t *) &rx_desc->fw_desc.u.val) = *p_fw_msdu_rx_desc; *((uint8_t *) &rx_desc->fw_desc.u.val) = *p_fw_msdu_rx_desc;
rx_desc->msdu_end.last_msdu = 1; rx_desc->msdu_end.last_msdu = 1;
cdf_nbuf_map(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE); qdf_nbuf_map(pdev->osdev, msdu, QDF_DMA_FROM_DEVICE);
} }
/* Target to host Msg/event handler for low priority messages*/ /* Target to host Msg/event handler for low priority messages*/
void htt_t2h_lp_msg_handler(void *context, cdf_nbuf_t htt_t2h_msg) void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg)
{ {
struct htt_pdev_t *pdev = (struct htt_pdev_t *)context; struct htt_pdev_t *pdev = (struct htt_pdev_t *)context;
uint32_t *msg_word; uint32_t *msg_word;
enum htt_t2h_msg_type msg_type; enum htt_t2h_msg_type msg_type;
msg_word = (uint32_t *) cdf_nbuf_data(htt_t2h_msg); msg_word = (uint32_t *) qdf_nbuf_data(htt_t2h_msg);
msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word); msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word);
switch (msg_type) { switch (msg_type) {
case HTT_T2H_MSG_TYPE_VERSION_CONF: case HTT_T2H_MSG_TYPE_VERSION_CONF:
@@ -473,7 +473,7 @@ void htt_t2h_lp_msg_handler(void *context, cdf_nbuf_t htt_t2h_msg)
break; break;
}; };
/* Free the indication buffer */ /* Free the indication buffer */
cdf_nbuf_free(htt_t2h_msg); qdf_nbuf_free(htt_t2h_msg);
} }
/* Generic Target to host Msg/event handler for low priority messages /* Generic Target to host Msg/event handler for low priority messages
@@ -484,7 +484,7 @@ void htt_t2h_lp_msg_handler(void *context, cdf_nbuf_t htt_t2h_msg)
void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
{ {
struct htt_pdev_t *pdev = (struct htt_pdev_t *)context; struct htt_pdev_t *pdev = (struct htt_pdev_t *)context;
cdf_nbuf_t htt_t2h_msg = (cdf_nbuf_t) pkt->pPktContext; qdf_nbuf_t htt_t2h_msg = (qdf_nbuf_t) pkt->pPktContext;
uint32_t *msg_word; uint32_t *msg_word;
enum htt_t2h_msg_type msg_type; enum htt_t2h_msg_type msg_type;
@@ -492,21 +492,21 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
if (pkt->Status != A_OK) { if (pkt->Status != A_OK) {
if (pkt->Status != A_ECANCELED) if (pkt->Status != A_ECANCELED)
pdev->stats.htc_err_cnt++; pdev->stats.htc_err_cnt++;
cdf_nbuf_free(htt_t2h_msg); qdf_nbuf_free(htt_t2h_msg);
return; return;
} }
#ifdef HTT_RX_RESTORE #ifdef HTT_RX_RESTORE
if (qdf_unlikely(pdev->rx_ring.rx_reset)) { if (qdf_unlikely(pdev->rx_ring.rx_reset)) {
qdf_print("rx restore ..\n"); qdf_print("rx restore ..\n");
cdf_nbuf_free(htt_t2h_msg); qdf_nbuf_free(htt_t2h_msg);
return; return;
} }
#endif #endif
/* confirm alignment */ /* confirm alignment */
HTT_ASSERT3((((unsigned long)cdf_nbuf_data(htt_t2h_msg)) & 0x3) == 0); HTT_ASSERT3((((unsigned long)qdf_nbuf_data(htt_t2h_msg)) & 0x3) == 0);
msg_word = (uint32_t *) cdf_nbuf_data(htt_t2h_msg); msg_word = (uint32_t *) qdf_nbuf_data(htt_t2h_msg);
msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word); msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word);
#if defined(HELIUMPLUS_DEBUG) #if defined(HELIUMPLUS_DEBUG)
@@ -686,7 +686,7 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
}; };
/* Free the indication buffer */ /* Free the indication buffer */
cdf_nbuf_free(htt_t2h_msg); qdf_nbuf_free(htt_t2h_msg);
} }
/*--- target->host HTT message Info Element access methods ------------------*/ /*--- target->host HTT message Info Element access methods ------------------*/
@@ -717,43 +717,43 @@ uint16_t htt_tx_compl_desc_id(void *iterator, int num)
/*--- rx indication message ---*/ /*--- rx indication message ---*/
int htt_rx_ind_flush(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg) int htt_rx_ind_flush(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) cdf_nbuf_data(rx_ind_msg); msg_word = (uint32_t *) qdf_nbuf_data(rx_ind_msg);
return HTT_RX_IND_FLUSH_VALID_GET(*msg_word); return HTT_RX_IND_FLUSH_VALID_GET(*msg_word);
} }
void void
htt_rx_ind_flush_seq_num_range(htt_pdev_handle pdev, htt_rx_ind_flush_seq_num_range(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
unsigned *seq_num_start, unsigned *seq_num_end) unsigned *seq_num_start, unsigned *seq_num_end)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) cdf_nbuf_data(rx_ind_msg); msg_word = (uint32_t *) qdf_nbuf_data(rx_ind_msg);
msg_word++; msg_word++;
*seq_num_start = HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(*msg_word); *seq_num_start = HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(*msg_word);
*seq_num_end = HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(*msg_word); *seq_num_end = HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(*msg_word);
} }
int htt_rx_ind_release(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg) int htt_rx_ind_release(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) cdf_nbuf_data(rx_ind_msg); msg_word = (uint32_t *) qdf_nbuf_data(rx_ind_msg);
return HTT_RX_IND_REL_VALID_GET(*msg_word); return HTT_RX_IND_REL_VALID_GET(*msg_word);
} }
void void
htt_rx_ind_release_seq_num_range(htt_pdev_handle pdev, htt_rx_ind_release_seq_num_range(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
unsigned *seq_num_start, unsigned *seq_num_end) unsigned *seq_num_start, unsigned *seq_num_end)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) cdf_nbuf_data(rx_ind_msg); msg_word = (uint32_t *) qdf_nbuf_data(rx_ind_msg);
msg_word++; msg_word++;
*seq_num_start = HTT_RX_IND_REL_SEQ_NUM_START_GET(*msg_word); *seq_num_start = HTT_RX_IND_REL_SEQ_NUM_START_GET(*msg_word);
*seq_num_end = HTT_RX_IND_REL_SEQ_NUM_END_GET(*msg_word); *seq_num_end = HTT_RX_IND_REL_SEQ_NUM_END_GET(*msg_word);
@@ -761,13 +761,13 @@ htt_rx_ind_release_seq_num_range(htt_pdev_handle pdev,
void void
htt_rx_ind_mpdu_range_info(struct htt_pdev_t *pdev, htt_rx_ind_mpdu_range_info(struct htt_pdev_t *pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
int mpdu_range_num, int mpdu_range_num,
enum htt_rx_status *status, int *mpdu_count) enum htt_rx_status *status, int *mpdu_count)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) cdf_nbuf_data(rx_ind_msg); msg_word = (uint32_t *) qdf_nbuf_data(rx_ind_msg);
msg_word += pdev->rx_mpdu_range_offset_words + mpdu_range_num; msg_word += pdev->rx_mpdu_range_offset_words + mpdu_range_num;
*status = HTT_RX_IND_MPDU_STATUS_GET(*msg_word); *status = HTT_RX_IND_MPDU_STATUS_GET(*msg_word);
*mpdu_count = HTT_RX_IND_MPDU_COUNT_GET(*msg_word); *mpdu_count = HTT_RX_IND_MPDU_COUNT_GET(*msg_word);
@@ -783,13 +783,13 @@ htt_rx_ind_mpdu_range_info(struct htt_pdev_t *pdev,
* *
* Return: RSSI in dBm, or HTT_INVALID_RSSI * Return: RSSI in dBm, or HTT_INVALID_RSSI
*/ */
int16_t htt_rx_ind_rssi_dbm(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg) int16_t htt_rx_ind_rssi_dbm(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg)
{ {
int8_t rssi; int8_t rssi;
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) msg_word = (uint32_t *)
(cdf_nbuf_data(rx_ind_msg) + (qdf_nbuf_data(rx_ind_msg) +
HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET); HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET);
/* check if the RX_IND message contains valid rx PPDU start info */ /* check if the RX_IND message contains valid rx PPDU start info */
@@ -813,7 +813,7 @@ int16_t htt_rx_ind_rssi_dbm(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg)
* Return: RSSI, or HTT_INVALID_RSSI * Return: RSSI, or HTT_INVALID_RSSI
*/ */
int16_t int16_t
htt_rx_ind_rssi_dbm_chain(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg, htt_rx_ind_rssi_dbm_chain(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg,
int8_t chain) int8_t chain)
{ {
int8_t rssi; int8_t rssi;
@@ -823,7 +823,7 @@ htt_rx_ind_rssi_dbm_chain(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg,
return HTT_RSSI_INVALID; return HTT_RSSI_INVALID;
msg_word = (uint32_t *) msg_word = (uint32_t *)
(cdf_nbuf_data(rx_ind_msg) + (qdf_nbuf_data(rx_ind_msg) +
HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET); HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET);
/* check if the RX_IND message contains valid rx PPDU start info */ /* check if the RX_IND message contains valid rx PPDU start info */
@@ -869,13 +869,13 @@ htt_rx_ind_rssi_dbm_chain(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg,
* Return the data rate provided in a rx indication message. * Return the data rate provided in a rx indication message.
*/ */
void void
htt_rx_ind_legacy_rate(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg, htt_rx_ind_legacy_rate(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg,
uint8_t *legacy_rate, uint8_t *legacy_rate_sel) uint8_t *legacy_rate, uint8_t *legacy_rate_sel)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) msg_word = (uint32_t *)
(cdf_nbuf_data(rx_ind_msg) + (qdf_nbuf_data(rx_ind_msg) +
HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET); HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET);
/* check if the RX_IND message contains valid rx PPDU start info */ /* check if the RX_IND message contains valid rx PPDU start info */
@@ -901,14 +901,14 @@ htt_rx_ind_legacy_rate(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg,
* Return the timestamp provided in a rx indication message. * Return the timestamp provided in a rx indication message.
*/ */
void void
htt_rx_ind_timestamp(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg, htt_rx_ind_timestamp(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg,
uint32_t *timestamp_microsec, uint32_t *timestamp_microsec,
uint8_t *timestamp_submicrosec) uint8_t *timestamp_submicrosec)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) msg_word = (uint32_t *)
(cdf_nbuf_data(rx_ind_msg) + (qdf_nbuf_data(rx_ind_msg) +
HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET); HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET);
/* check if the RX_IND message contains valid rx PPDU start info */ /* check if the RX_IND message contains valid rx PPDU start info */
@@ -934,12 +934,12 @@ htt_rx_ind_timestamp(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg,
* Return: TSF timestamp * Return: TSF timestamp
*/ */
uint32_t uint32_t
htt_rx_ind_tsf32(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg) htt_rx_ind_tsf32(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) msg_word = (uint32_t *)
(cdf_nbuf_data(rx_ind_msg) + (qdf_nbuf_data(rx_ind_msg) +
HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET); HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET);
/* check if the RX_IND message contains valid rx PPDU start info */ /* check if the RX_IND message contains valid rx PPDU start info */
@@ -959,12 +959,12 @@ htt_rx_ind_tsf32(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg)
* Return: Extended TID * Return: Extended TID
*/ */
uint8_t uint8_t
htt_rx_ind_ext_tid(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg) htt_rx_ind_ext_tid(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) msg_word = (uint32_t *)
(cdf_nbuf_data(rx_ind_msg)); (qdf_nbuf_data(rx_ind_msg));
return HTT_RX_IND_EXT_TID_GET(*msg_word); return HTT_RX_IND_EXT_TID_GET(*msg_word);
} }
@@ -987,12 +987,12 @@ htt_t2h_dbg_stats_hdr_parse(uint8_t *stats_info_list,
void void
htt_rx_frag_ind_flush_seq_num_range(htt_pdev_handle pdev, htt_rx_frag_ind_flush_seq_num_range(htt_pdev_handle pdev,
cdf_nbuf_t rx_frag_ind_msg, qdf_nbuf_t rx_frag_ind_msg,
int *seq_num_start, int *seq_num_end) int *seq_num_start, int *seq_num_end)
{ {
uint32_t *msg_word; uint32_t *msg_word;
msg_word = (uint32_t *) cdf_nbuf_data(rx_frag_ind_msg); msg_word = (uint32_t *) qdf_nbuf_data(rx_frag_ind_msg);
msg_word++; msg_word++;
*seq_num_start = HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET(*msg_word); *seq_num_start = HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET(*msg_word);
*seq_num_end = HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET(*msg_word); *seq_num_end = HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET(*msg_word);

Переглянути файл

@@ -39,7 +39,7 @@
#include <osdep.h> /* uint32_t, offsetof, etc. */ #include <osdep.h> /* uint32_t, offsetof, etc. */
#include <qdf_types.h> /* qdf_dma_addr_t */ #include <qdf_types.h> /* qdf_dma_addr_t */
#include <qdf_mem.h> /* qdf_mem_alloc_consistent et al */ #include <qdf_mem.h> /* qdf_mem_alloc_consistent et al */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_time.h> /* qdf_mdelay */ #include <qdf_time.h> /* qdf_mdelay */
#include <htt.h> /* htt_tx_msdu_desc_t */ #include <htt.h> /* htt_tx_msdu_desc_t */
@@ -548,7 +548,7 @@ void htt_tx_desc_flag_batch_more(htt_pdev_handle pdev, void *desc)
because of No CE desc*/ because of No CE desc*/
void htt_tx_sched(htt_pdev_handle pdev) void htt_tx_sched(htt_pdev_handle pdev)
{ {
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
int download_len = pdev->download_len; int download_len = pdev->download_len;
int packet_len; int packet_len;
@@ -556,7 +556,7 @@ void htt_tx_sched(htt_pdev_handle pdev)
while (msdu != NULL) { while (msdu != NULL) {
int not_accepted; int not_accepted;
/* packet length includes HTT tx desc frag added above */ /* packet length includes HTT tx desc frag added above */
packet_len = cdf_nbuf_len(msdu); packet_len = qdf_nbuf_len(msdu);
if (packet_len < download_len) { if (packet_len < download_len) {
/* /*
* This case of packet length being less than the * This case of packet length being less than the
@@ -583,7 +583,7 @@ void htt_tx_sched(htt_pdev_handle pdev)
} }
} }
int htt_tx_send_std(htt_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t msdu_id) int htt_tx_send_std(htt_pdev_handle pdev, qdf_nbuf_t msdu, uint16_t msdu_id)
{ {
int download_len = pdev->download_len; int download_len = pdev->download_len;
@@ -591,7 +591,7 @@ int htt_tx_send_std(htt_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t msdu_id)
int packet_len; int packet_len;
/* packet length includes HTT tx desc frag added above */ /* packet length includes HTT tx desc frag added above */
packet_len = cdf_nbuf_len(msdu); packet_len = qdf_nbuf_len(msdu);
if (packet_len < download_len) { if (packet_len < download_len) {
/* /*
* This case of packet length being less than the nominal * This case of packet length being less than the nominal
@@ -605,17 +605,17 @@ int htt_tx_send_std(htt_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t msdu_id)
download_len = packet_len; download_len = packet_len;
} }
NBUF_UPDATE_TX_PKT_COUNT(msdu, NBUF_TX_PKT_HTT); QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu, QDF_NBUF_TX_PKT_HTT);
DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_HTT_PACKET_PTR_RECORD, DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_HTT_PACKET_PTR_RECORD,
(uint8_t *)(cdf_nbuf_data(msdu)), (uint8_t *)(qdf_nbuf_data(msdu)),
sizeof(cdf_nbuf_data(msdu)))); sizeof(qdf_nbuf_data(msdu))));
if (cdf_nbuf_queue_len(&pdev->txnbufq) > 0) { if (qdf_nbuf_queue_len(&pdev->txnbufq) > 0) {
HTT_TX_NBUF_QUEUE_ADD(pdev, msdu); HTT_TX_NBUF_QUEUE_ADD(pdev, msdu);
htt_tx_sched(pdev); htt_tx_sched(pdev);
return 0; return 0;
} }
cdf_nbuf_trace_update(msdu, "HT:T:"); qdf_nbuf_trace_update(msdu, "HT:T:");
if (htc_send_data_pkt if (htc_send_data_pkt
(pdev->htc_pdev, msdu, pdev->htc_endpoint, download_len)) { (pdev->htc_pdev, msdu, pdev->htc_endpoint, download_len)) {
HTT_TX_NBUF_QUEUE_ADD(pdev, msdu); HTT_TX_NBUF_QUEUE_ADD(pdev, msdu);
@@ -643,8 +643,8 @@ void
htt_tx_resume_handler(void *context) { } htt_tx_resume_handler(void *context) { }
#endif #endif
cdf_nbuf_t qdf_nbuf_t
htt_tx_send_batch(htt_pdev_handle pdev, cdf_nbuf_t head_msdu, int num_msdus) htt_tx_send_batch(htt_pdev_handle pdev, qdf_nbuf_t head_msdu, int num_msdus)
{ {
qdf_print("*** %s curently only applies for HL systems\n", __func__); qdf_print("*** %s curently only applies for HL systems\n", __func__);
qdf_assert(0); qdf_assert(0);
@@ -654,7 +654,7 @@ htt_tx_send_batch(htt_pdev_handle pdev, cdf_nbuf_t head_msdu, int num_msdus)
int int
htt_tx_send_nonstd(htt_pdev_handle pdev, htt_tx_send_nonstd(htt_pdev_handle pdev,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
uint16_t msdu_id, enum htt_pkt_type pkt_type) uint16_t msdu_id, enum htt_pkt_type pkt_type)
{ {
int download_len; int download_len;
@@ -678,15 +678,15 @@ htt_tx_send_nonstd(htt_pdev_handle pdev,
#ifdef QCA_TX_HTT2_SUPPORT #ifdef QCA_TX_HTT2_SUPPORT
static inline HTC_ENDPOINT_ID static inline HTC_ENDPOINT_ID
htt_tx_htt2_get_ep_id(htt_pdev_handle pdev, cdf_nbuf_t msdu) htt_tx_htt2_get_ep_id(htt_pdev_handle pdev, qdf_nbuf_t msdu)
{ {
/* /*
* TX HTT2 service mainly for small sized frame and check if * TX HTT2 service mainly for small sized frame and check if
* this candidate frame allow or not. * this candidate frame allow or not.
*/ */
if ((pdev->htc_tx_htt2_endpoint != ENDPOINT_UNUSED) && if ((pdev->htc_tx_htt2_endpoint != ENDPOINT_UNUSED) &&
cdf_nbuf_get_tx_parallel_dnload_frm(msdu) && qdf_nbuf_get_tx_parallel_dnload_frm(msdu) &&
(cdf_nbuf_len(msdu) < pdev->htc_tx_htt2_max_size)) (qdf_nbuf_len(msdu) < pdev->htc_tx_htt2_max_size))
return pdev->htc_tx_htt2_endpoint; return pdev->htc_tx_htt2_endpoint;
else else
return pdev->htc_endpoint; return pdev->htc_endpoint;
@@ -697,7 +697,7 @@ htt_tx_htt2_get_ep_id(htt_pdev_handle pdev, cdf_nbuf_t msdu)
static inline int static inline int
htt_tx_send_base(htt_pdev_handle pdev, htt_tx_send_base(htt_pdev_handle pdev,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
uint16_t msdu_id, int download_len, uint8_t more_data) uint16_t msdu_id, int download_len, uint8_t more_data)
{ {
struct htt_host_tx_desc_t *htt_host_tx_desc; struct htt_host_tx_desc_t *htt_host_tx_desc;
@@ -711,7 +711,7 @@ htt_tx_send_base(htt_pdev_handle pdev,
* Retrieve it so we can provide its HTC header space to HTC. * Retrieve it so we can provide its HTC header space to HTC.
*/ */
htt_host_tx_desc = (struct htt_host_tx_desc_t *) htt_host_tx_desc = (struct htt_host_tx_desc_t *)
cdf_nbuf_get_frag_vaddr(msdu, 0); qdf_nbuf_get_frag_vaddr(msdu, 0);
pkt = htt_htc_pkt_alloc(pdev); pkt = htt_htc_pkt_alloc(pdev);
if (!pkt) if (!pkt)
@@ -721,7 +721,7 @@ htt_tx_send_base(htt_pdev_handle pdev,
pkt->pdev_ctxt = pdev->txrx_pdev; pkt->pdev_ctxt = pdev->txrx_pdev;
/* packet length includes HTT tx desc frag added above */ /* packet length includes HTT tx desc frag added above */
packet_len = cdf_nbuf_len(msdu); packet_len = qdf_nbuf_len(msdu);
if (packet_len < download_len) { if (packet_len < download_len) {
/* /*
* This case of packet length being less than the nominal * This case of packet length being less than the nominal
@@ -746,23 +746,23 @@ htt_tx_send_base(htt_pdev_handle pdev,
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msdu); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msdu);
cdf_nbuf_trace_update(msdu, "HT:T:"); qdf_nbuf_trace_update(msdu, "HT:T:");
NBUF_UPDATE_TX_PKT_COUNT(msdu, NBUF_TX_PKT_HTT); QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu, QDF_NBUF_TX_PKT_HTT);
DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_HTT_PACKET_PTR_RECORD, DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_HTT_PACKET_PTR_RECORD,
(uint8_t *)(cdf_nbuf_data(msdu)), (uint8_t *)(qdf_nbuf_data(msdu)),
sizeof(cdf_nbuf_data(msdu)))); sizeof(qdf_nbuf_data(msdu))));
htc_send_data_pkt(pdev->htc_pdev, &pkt->htc_pkt, more_data); htc_send_data_pkt(pdev->htc_pdev, &pkt->htc_pkt, more_data);
return 0; /* success */ return 0; /* success */
} }
cdf_nbuf_t qdf_nbuf_t
htt_tx_send_batch(htt_pdev_handle pdev, cdf_nbuf_t head_msdu, int num_msdus) htt_tx_send_batch(htt_pdev_handle pdev, qdf_nbuf_t head_msdu, int num_msdus)
{ {
cdf_nbuf_t rejected = NULL; qdf_nbuf_t rejected = NULL;
uint16_t *msdu_id_storage; uint16_t *msdu_id_storage;
uint16_t msdu_id; uint16_t msdu_id;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
/* /*
* FOR NOW, iterate through the batch, sending the frames singly. * FOR NOW, iterate through the batch, sending the frames singly.
* Eventually HTC and HIF should be able to accept a batch of * Eventually HTC and HIF should be able to accept a batch of
@@ -770,14 +770,14 @@ htt_tx_send_batch(htt_pdev_handle pdev, cdf_nbuf_t head_msdu, int num_msdus)
*/ */
msdu = head_msdu; msdu = head_msdu;
while (num_msdus--) { while (num_msdus--) {
cdf_nbuf_t next_msdu = cdf_nbuf_next(msdu); qdf_nbuf_t next_msdu = qdf_nbuf_next(msdu);
msdu_id_storage = ol_tx_msdu_id_storage(msdu); msdu_id_storage = ol_tx_msdu_id_storage(msdu);
msdu_id = *msdu_id_storage; msdu_id = *msdu_id_storage;
/* htt_tx_send_base returns 0 as success and 1 as failure */ /* htt_tx_send_base returns 0 as success and 1 as failure */
if (htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len, if (htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len,
num_msdus)) { num_msdus)) {
cdf_nbuf_set_next(msdu, rejected); qdf_nbuf_set_next(msdu, rejected);
rejected = msdu; rejected = msdu;
} }
msdu = next_msdu; msdu = next_msdu;
@@ -787,7 +787,7 @@ htt_tx_send_batch(htt_pdev_handle pdev, cdf_nbuf_t head_msdu, int num_msdus)
int int
htt_tx_send_nonstd(htt_pdev_handle pdev, htt_tx_send_nonstd(htt_pdev_handle pdev,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
uint16_t msdu_id, enum htt_pkt_type pkt_type) uint16_t msdu_id, enum htt_pkt_type pkt_type)
{ {
int download_len; int download_len;
@@ -806,7 +806,7 @@ htt_tx_send_nonstd(htt_pdev_handle pdev,
return htt_tx_send_base(pdev, msdu, msdu_id, download_len, 0); return htt_tx_send_base(pdev, msdu, msdu_id, download_len, 0);
} }
int htt_tx_send_std(htt_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t msdu_id) int htt_tx_send_std(htt_pdev_handle pdev, qdf_nbuf_t msdu, uint16_t msdu_id)
{ {
return htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len, 0); return htt_tx_send_base(pdev, msdu, msdu_id, pdev->download_len, 0);
} }
@@ -865,7 +865,7 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
unsigned int uc_tx_partition_base) unsigned int uc_tx_partition_base)
{ {
unsigned int tx_buffer_count; unsigned int tx_buffer_count;
cdf_nbuf_t buffer_vaddr; qdf_nbuf_t buffer_vaddr;
qdf_dma_addr_t buffer_paddr; qdf_dma_addr_t buffer_paddr;
uint32_t *header_ptr; uint32_t *header_ptr;
uint32_t *ring_vaddr; uint32_t *ring_vaddr;
@@ -876,7 +876,7 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
/* Allocate TX buffers as many as possible */ /* Allocate TX buffers as many as possible */
for (tx_buffer_count = 0; for (tx_buffer_count = 0;
tx_buffer_count < (uc_tx_buf_cnt - 1); tx_buffer_count++) { tx_buffer_count < (uc_tx_buf_cnt - 1); tx_buffer_count++) {
buffer_vaddr = cdf_nbuf_alloc(pdev->osdev, buffer_vaddr = qdf_nbuf_alloc(pdev->osdev,
uc_tx_buf_sz, 0, 4, false); uc_tx_buf_sz, 0, 4, false);
if (!buffer_vaddr) { if (!buffer_vaddr) {
qdf_print("%s: TX BUF alloc fail, loop index: %d", qdf_print("%s: TX BUF alloc fail, loop index: %d",
@@ -885,8 +885,8 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
} }
/* Init buffer */ /* Init buffer */
qdf_mem_zero(cdf_nbuf_data(buffer_vaddr), uc_tx_buf_sz); qdf_mem_zero(qdf_nbuf_data(buffer_vaddr), uc_tx_buf_sz);
header_ptr = (uint32_t *) cdf_nbuf_data(buffer_vaddr); header_ptr = (uint32_t *) qdf_nbuf_data(buffer_vaddr);
/* HTT control header */ /* HTT control header */
*header_ptr = HTT_IPA_UC_OFFLOAD_TX_HEADER_DEFAULT; *header_ptr = HTT_IPA_UC_OFFLOAD_TX_HEADER_DEFAULT;
@@ -896,8 +896,8 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
*header_ptr |= ((uint16_t) uc_tx_partition_base + *header_ptr |= ((uint16_t) uc_tx_partition_base +
tx_buffer_count) << 16; tx_buffer_count) << 16;
cdf_nbuf_map(pdev->osdev, buffer_vaddr, QDF_DMA_BIDIRECTIONAL); qdf_nbuf_map(pdev->osdev, buffer_vaddr, QDF_DMA_BIDIRECTIONAL);
buffer_paddr = cdf_nbuf_get_frag_paddr(buffer_vaddr, 0); buffer_paddr = qdf_nbuf_get_frag_paddr(buffer_vaddr, 0);
header_ptr++; header_ptr++;
*header_ptr = (uint32_t) (buffer_paddr + *header_ptr = (uint32_t) (buffer_paddr +
IPA_UC_TX_BUF_FRAG_DESC_OFFSET); IPA_UC_TX_BUF_FRAG_DESC_OFFSET);
@@ -924,7 +924,7 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
unsigned int uc_tx_partition_base) unsigned int uc_tx_partition_base)
{ {
unsigned int tx_buffer_count; unsigned int tx_buffer_count;
cdf_nbuf_t buffer_vaddr; qdf_nbuf_t buffer_vaddr;
qdf_dma_addr_t buffer_paddr; qdf_dma_addr_t buffer_paddr;
uint32_t *header_ptr; uint32_t *header_ptr;
uint32_t *ring_vaddr; uint32_t *ring_vaddr;
@@ -936,7 +936,7 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
/* Allocate TX buffers as many as possible */ /* Allocate TX buffers as many as possible */
for (tx_buffer_count = 0; for (tx_buffer_count = 0;
tx_buffer_count < (uc_tx_buf_cnt - 1); tx_buffer_count++) { tx_buffer_count < (uc_tx_buf_cnt - 1); tx_buffer_count++) {
buffer_vaddr = cdf_nbuf_alloc(pdev->osdev, buffer_vaddr = qdf_nbuf_alloc(pdev->osdev,
uc_tx_buf_sz, 0, 4, false); uc_tx_buf_sz, 0, 4, false);
if (!buffer_vaddr) { if (!buffer_vaddr) {
qdf_print("%s: TX BUF alloc fail, loop index: %d", qdf_print("%s: TX BUF alloc fail, loop index: %d",
@@ -945,8 +945,8 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
} }
/* Init buffer */ /* Init buffer */
qdf_mem_zero(cdf_nbuf_data(buffer_vaddr), uc_tx_buf_sz); qdf_mem_zero(qdf_nbuf_data(buffer_vaddr), uc_tx_buf_sz);
header_ptr = (uint32_t *) cdf_nbuf_data(buffer_vaddr); header_ptr = (uint32_t *) qdf_nbuf_data(buffer_vaddr);
/* HTT control header */ /* HTT control header */
*header_ptr = HTT_IPA_UC_OFFLOAD_TX_HEADER_DEFAULT; *header_ptr = HTT_IPA_UC_OFFLOAD_TX_HEADER_DEFAULT;
@@ -956,8 +956,8 @@ int htt_tx_ipa_uc_wdi_tx_buf_alloc(struct htt_pdev_t *pdev,
*header_ptr |= ((uint16_t) uc_tx_partition_base + *header_ptr |= ((uint16_t) uc_tx_partition_base +
tx_buffer_count) << 16; tx_buffer_count) << 16;
cdf_nbuf_map(pdev->osdev, buffer_vaddr, QDF_DMA_BIDIRECTIONAL); qdf_nbuf_map(pdev->osdev, buffer_vaddr, QDF_DMA_BIDIRECTIONAL);
buffer_paddr = cdf_nbuf_get_frag_paddr(buffer_vaddr, 0); buffer_paddr = qdf_nbuf_get_frag_paddr(buffer_vaddr, 0);
header_ptr++; header_ptr++;
/* Frag Desc Pointer */ /* Frag Desc Pointer */
@@ -1019,7 +1019,7 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
} }
/* Allocate TX COMP Ring */ /* Allocate TX COMP Ring */
tx_comp_ring_size = uc_tx_buf_cnt * sizeof(cdf_nbuf_t); tx_comp_ring_size = uc_tx_buf_cnt * sizeof(qdf_nbuf_t);
pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr = pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr =
qdf_mem_alloc_consistent( qdf_mem_alloc_consistent(
pdev->osdev, pdev->osdev->dev, pdev->osdev, pdev->osdev->dev,
@@ -1035,15 +1035,15 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
/* Allocate TX BUF vAddress Storage */ /* Allocate TX BUF vAddress Storage */
pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg = pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg =
(cdf_nbuf_t *) qdf_mem_malloc(uc_tx_buf_cnt * (qdf_nbuf_t *) qdf_mem_malloc(uc_tx_buf_cnt *
sizeof(cdf_nbuf_t)); sizeof(qdf_nbuf_t));
if (!pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg) { if (!pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg) {
qdf_print("%s: TX BUF POOL vaddr storage alloc fail", __func__); qdf_print("%s: TX BUF POOL vaddr storage alloc fail", __func__);
return_code = -ENOBUFS; return_code = -ENOBUFS;
goto free_tx_comp_base; goto free_tx_comp_base;
} }
qdf_mem_zero(pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg, qdf_mem_zero(pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg,
uc_tx_buf_cnt * sizeof(cdf_nbuf_t)); uc_tx_buf_cnt * sizeof(qdf_nbuf_t));
pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt = htt_tx_ipa_uc_wdi_tx_buf_alloc( pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt = htt_tx_ipa_uc_wdi_tx_buf_alloc(
pdev, uc_tx_buf_sz, uc_tx_buf_cnt, uc_tx_partition_base); pdev, uc_tx_buf_sz, uc_tx_buf_cnt, uc_tx_partition_base);
@@ -1090,7 +1090,8 @@ int htt_tx_ipa_uc_detach(struct htt_pdev_t *pdev)
if (pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr) { if (pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr) {
qdf_mem_free_consistent( qdf_mem_free_consistent(
pdev->osdev, pdev->osdev,
ol_cfg_ipa_uc_tx_max_buf_cnt(pdev->ctrl_pdev) * sizeof(cdf_nbuf_t), ol_cfg_ipa_uc_tx_max_buf_cnt(pdev->ctrl_pdev) *
sizeof(qdf_nbuf_t),
pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr, pdev->ipa_uc_tx_rsc.tx_comp_base.vaddr,
pdev->ipa_uc_tx_rsc.tx_comp_base.paddr, pdev->ipa_uc_tx_rsc.tx_comp_base.paddr,
qdf_get_dma_mem_context((&pdev->ipa_uc_tx_rsc. qdf_get_dma_mem_context((&pdev->ipa_uc_tx_rsc.
@@ -1101,11 +1102,11 @@ int htt_tx_ipa_uc_detach(struct htt_pdev_t *pdev)
/* Free each single buffer */ /* Free each single buffer */
for (idx = 0; idx < pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt; idx++) { for (idx = 0; idx < pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt; idx++) {
if (pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg[idx]) { if (pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg[idx]) {
cdf_nbuf_unmap(pdev->osdev, qdf_nbuf_unmap(pdev->osdev,
pdev->ipa_uc_tx_rsc. pdev->ipa_uc_tx_rsc.
tx_buf_pool_vaddr_strg[idx], tx_buf_pool_vaddr_strg[idx],
QDF_DMA_FROM_DEVICE); QDF_DMA_FROM_DEVICE);
cdf_nbuf_free(pdev->ipa_uc_tx_rsc. qdf_nbuf_free(pdev->ipa_uc_tx_rsc.
tx_buf_pool_vaddr_strg[idx]); tx_buf_pool_vaddr_strg[idx]);
} }
} }

Переглянути файл

@@ -33,7 +33,7 @@
#include <qdf_lock.h> /* qdf_spinlock_t */ #include <qdf_lock.h> /* qdf_spinlock_t */
#include <qdf_timer.h> /* qdf_timer_t */ #include <qdf_timer.h> /* qdf_timer_t */
#include <qdf_atomic.h> /* qdf_atomic_inc */ #include <qdf_atomic.h> /* qdf_atomic_inc */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <htc_api.h> /* HTC_PACKET */ #include <htc_api.h> /* HTC_PACKET */
#include <ol_ctrl_api.h> /* ol_pdev_handle */ #include <ol_ctrl_api.h> /* ol_pdev_handle */
@@ -83,9 +83,9 @@ struct htt_host_tx_desc_t {
}; };
struct htt_tx_mgmt_desc_buf { struct htt_tx_mgmt_desc_buf {
cdf_nbuf_t msg_buf; qdf_nbuf_t msg_buf;
A_BOOL is_inuse; A_BOOL is_inuse;
cdf_nbuf_t mgmt_frm; qdf_nbuf_t mgmt_frm;
}; };
struct htt_tx_mgmt_desc_ctxt { struct htt_tx_mgmt_desc_ctxt {
@@ -100,7 +100,7 @@ struct htt_list_node {
struct htt_rx_hash_entry { struct htt_rx_hash_entry {
A_UINT32 paddr; A_UINT32 paddr;
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
A_UINT8 fromlist; A_UINT8 fromlist;
struct htt_list_node listnode; struct htt_list_node listnode;
#ifdef RX_HASH_DEBUG #ifdef RX_HASH_DEBUG
@@ -133,7 +133,7 @@ struct htt_ipa_uc_tx_resource_t {
struct uc_shared_mem_t tx_comp_base; struct uc_shared_mem_t tx_comp_base;
uint32_t tx_comp_idx_paddr; uint32_t tx_comp_idx_paddr;
cdf_nbuf_t *tx_buf_pool_vaddr_strg; qdf_nbuf_t *tx_buf_pool_vaddr_strg;
uint32_t alloc_tx_buf_cnt; uint32_t alloc_tx_buf_cnt;
}; };
@@ -229,7 +229,7 @@ struct htt_pdev_t {
#ifdef ATH_11AC_TXCOMPACT #ifdef ATH_11AC_TXCOMPACT
HTT_TX_MUTEX_TYPE txnbufq_mutex; HTT_TX_MUTEX_TYPE txnbufq_mutex;
cdf_nbuf_queue_t txnbufq; qdf_nbuf_queue_t txnbufq;
struct htt_htc_pkt_union *htt_htc_pkt_misclist; struct htt_htc_pkt_union *htt_htc_pkt_misclist;
#endif #endif
@@ -259,7 +259,7 @@ struct htt_pdev_t {
* The host SW uses this netbufs ring to locate the nw * The host SW uses this netbufs ring to locate the nw
* buffer objects whose data buffers the HW has filled. * buffer objects whose data buffers the HW has filled.
*/ */
cdf_nbuf_t *netbufs_ring; qdf_nbuf_t *netbufs_ring;
/* /*
* Ring of buffer addresses - * Ring of buffer addresses -
* This ring holds the "physical" device address of the * This ring holds the "physical" device address of the
@@ -370,7 +370,7 @@ struct htt_pdev_t {
int download_len; int download_len;
void (*tx_send_complete_part2)(void *pdev, A_STATUS status, void (*tx_send_complete_part2)(void *pdev, A_STATUS status,
cdf_nbuf_t msdu, uint16_t msdu_id); qdf_nbuf_t msdu, uint16_t msdu_id);
HTT_TX_MUTEX_TYPE htt_tx_mutex; HTT_TX_MUTEX_TYPE htt_tx_mutex;

Переглянути файл

@@ -36,7 +36,7 @@
#define _OL_HTT_API__H_ #define _OL_HTT_API__H_
#include <qdf_types.h> /* qdf_device_t */ #include <qdf_types.h> /* qdf_device_t */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <athdefs.h> /* A_STATUS */ #include <athdefs.h> /* A_STATUS */
#include <htc_api.h> /* HTC_HANDLE */ #include <htc_api.h> /* HTC_HANDLE */
#include <ol_ctrl_api.h> /* ol_pdev_handle */ #include <ol_ctrl_api.h> /* ol_pdev_handle */

Переглянути файл

@@ -40,7 +40,7 @@
/* #include <osapi_linux.h> / * uint16_t, etc. * / */ /* #include <osapi_linux.h> / * uint16_t, etc. * / */
#include <osdep.h> /* uint16_t, etc. */ #include <osdep.h> /* uint16_t, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <qdf_types.h> /* bool */ #include <qdf_types.h> /* bool */
#include <htt.h> /* HTT_RX_IND_MPDU_STATUS */ #include <htt.h> /* HTT_RX_IND_MPDU_STATUS */
@@ -109,7 +109,7 @@ PREPACK struct ocb_rx_stats_hdr_t {
* -OR- * -OR-
* 0 - the message's rx flush command is invalid and should be ignored * 0 - the message's rx flush command is invalid and should be ignored
*/ */
int htt_rx_ind_flush(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg); int htt_rx_ind_flush(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg);
/** /**
* @brief Return the sequence number starting the range of MPDUs to flush. * @brief Return the sequence number starting the range of MPDUs to flush.
@@ -138,7 +138,7 @@ int htt_rx_ind_flush(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg);
*/ */
void void
htt_rx_ind_flush_seq_num_range(htt_pdev_handle pdev, htt_rx_ind_flush_seq_num_range(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
unsigned *seq_num_start, unsigned *seq_num_end); unsigned *seq_num_start, unsigned *seq_num_end);
/** /**
@@ -160,7 +160,7 @@ htt_rx_ind_flush_seq_num_range(htt_pdev_handle pdev,
* -OR- * -OR-
* 0 - the message's rx release command is invalid and should be ignored * 0 - the message's rx release command is invalid and should be ignored
*/ */
int htt_rx_ind_release(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg); int htt_rx_ind_release(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg);
/** /**
* @brief Return the sequence number starting the range of MPDUs to release. * @brief Return the sequence number starting the range of MPDUs to release.
@@ -189,7 +189,7 @@ int htt_rx_ind_release(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg);
*/ */
void void
htt_rx_ind_release_seq_num_range(htt_pdev_handle pdev, htt_rx_ind_release_seq_num_range(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
unsigned *seq_num_start, unsigned *seq_num_start,
unsigned *seq_num_end); unsigned *seq_num_end);
@@ -234,7 +234,7 @@ enum htt_rx_status {
*/ */
void void
htt_rx_ind_mpdu_range_info(htt_pdev_handle pdev, htt_rx_ind_mpdu_range_info(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
int mpdu_range_num, int mpdu_range_num,
enum htt_rx_status *status, int *mpdu_count); enum htt_rx_status *status, int *mpdu_count);
@@ -248,27 +248,27 @@ htt_rx_ind_mpdu_range_info(htt_pdev_handle pdev,
* @return RSSI in dBm, or HTT_INVALID_RSSI * @return RSSI in dBm, or HTT_INVALID_RSSI
*/ */
int16_t int16_t
htt_rx_ind_rssi_dbm(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg); htt_rx_ind_rssi_dbm(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg);
int16_t int16_t
htt_rx_ind_rssi_dbm_chain(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg, htt_rx_ind_rssi_dbm_chain(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg,
int8_t chain); int8_t chain);
void void
htt_rx_ind_legacy_rate(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg, htt_rx_ind_legacy_rate(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg,
uint8_t *legacy_rate, uint8_t *legacy_rate_sel); uint8_t *legacy_rate, uint8_t *legacy_rate_sel);
void void
htt_rx_ind_timestamp(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg, htt_rx_ind_timestamp(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg,
uint32_t *timestamp_microsec, uint32_t *timestamp_microsec,
uint8_t *timestamp_submicrosec); uint8_t *timestamp_submicrosec);
uint32_t uint32_t
htt_rx_ind_tsf32(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg); htt_rx_ind_tsf32(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg);
uint8_t uint8_t
htt_rx_ind_ext_tid(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg); htt_rx_ind_ext_tid(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg);
/*==================== rx MPDU descriptor access methods ====================*/ /*==================== rx MPDU descriptor access methods ====================*/
@@ -654,13 +654,13 @@ extern bool
*/ */
extern int extern int
(*htt_rx_amsdu_pop)(htt_pdev_handle pdev, (*htt_rx_amsdu_pop)(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
cdf_nbuf_t *head_msdu, cdf_nbuf_t *tail_msdu); qdf_nbuf_t *head_msdu, qdf_nbuf_t *tail_msdu);
extern int extern int
(*htt_rx_frag_pop)(htt_pdev_handle pdev, (*htt_rx_frag_pop)(htt_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
cdf_nbuf_t *head_msdu, cdf_nbuf_t *tail_msdu); qdf_nbuf_t *head_msdu, qdf_nbuf_t *tail_msdu);
/** /**
* @brief Return a linked list of buffers holding one MSDU * @brief Return a linked list of buffers holding one MSDU
@@ -685,12 +685,12 @@ extern int
*/ */
extern int extern int
(*htt_rx_offload_msdu_pop)(htt_pdev_handle pdev, (*htt_rx_offload_msdu_pop)(htt_pdev_handle pdev,
cdf_nbuf_t offload_deliver_msg, qdf_nbuf_t offload_deliver_msg,
int *vdev_id, int *vdev_id,
int *peer_id, int *peer_id,
int *tid, int *tid,
uint8_t *fw_desc, uint8_t *fw_desc,
cdf_nbuf_t *head_buf, cdf_nbuf_t *tail_buf); qdf_nbuf_t *head_buf, qdf_nbuf_t *tail_buf);
/** /**
* @brief Return the rx descriptor for the next rx MPDU. * @brief Return the rx descriptor for the next rx MPDU.
@@ -713,7 +713,7 @@ extern int
* by an rx ind msg * by an rx ind msg
*/ */
extern void * extern void *
(*htt_rx_mpdu_desc_list_next)(htt_pdev_handle pdev, cdf_nbuf_t rx_ind_msg); (*htt_rx_mpdu_desc_list_next)(htt_pdev_handle pdev, qdf_nbuf_t rx_ind_msg);
/** /**
* @brief Retrieve a previously-stored rx descriptor from a MSDU buffer. * @brief Retrieve a previously-stored rx descriptor from a MSDU buffer.
@@ -727,7 +727,7 @@ extern void *
* @return the corresponding abstract rx MSDU descriptor * @return the corresponding abstract rx MSDU descriptor
*/ */
extern void * extern void *
(*htt_rx_msdu_desc_retrieve)(htt_pdev_handle pdev, cdf_nbuf_t msdu); (*htt_rx_msdu_desc_retrieve)(htt_pdev_handle pdev, qdf_nbuf_t msdu);
/** /**
* @brief Free both an rx MSDU descriptor and the associated MSDU buffer. * @brief Free both an rx MSDU descriptor and the associated MSDU buffer.
@@ -749,7 +749,7 @@ extern void *
* @param rx_msdu_desc - rx descriptor for the MSDU being freed * @param rx_msdu_desc - rx descriptor for the MSDU being freed
* @param msdu - rx frame buffer for the MSDU being freed * @param msdu - rx frame buffer for the MSDU being freed
*/ */
void htt_rx_desc_frame_free(htt_pdev_handle htt_pdev, cdf_nbuf_t msdu); void htt_rx_desc_frame_free(htt_pdev_handle htt_pdev, qdf_nbuf_t msdu);
/** /**
* @brief Look up and free the rx descriptor for a MSDU. * @brief Look up and free the rx descriptor for a MSDU.
@@ -766,7 +766,7 @@ void htt_rx_desc_frame_free(htt_pdev_handle htt_pdev, cdf_nbuf_t msdu);
* @param htt_pdev - the HTT instance the rx data was received on * @param htt_pdev - the HTT instance the rx data was received on
* @param msdu - rx frame buffer for the rx MSDU descriptor being freed * @param msdu - rx frame buffer for the rx MSDU descriptor being freed
*/ */
void htt_rx_msdu_desc_free(htt_pdev_handle htt_pdev, cdf_nbuf_t msdu); void htt_rx_msdu_desc_free(htt_pdev_handle htt_pdev, qdf_nbuf_t msdu);
/** /**
* @brief Add new MSDU buffers for the target to fill. * @brief Add new MSDU buffers for the target to fill.
@@ -805,9 +805,9 @@ void htt_rx_msdu_buff_replenish(htt_pdev_handle pdev);
* list, else operates on a cloned nbuf * list, else operates on a cloned nbuf
* @return network buffer handle to the MPDU * @return network buffer handle to the MPDU
*/ */
cdf_nbuf_t qdf_nbuf_t
htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev, htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
cdf_nbuf_t head_msdu, qdf_nbuf_t head_msdu,
struct ieee80211_rx_status *rx_status, struct ieee80211_rx_status *rx_status,
unsigned clone_not_reqd); unsigned clone_not_reqd);
@@ -822,7 +822,7 @@ htt_rx_restitch_mpdu_from_msdus(htt_pdev_handle pdev,
*/ */
void void
htt_rx_frag_ind_flush_seq_num_range(htt_pdev_handle pdev, htt_rx_frag_ind_flush_seq_num_range(htt_pdev_handle pdev,
cdf_nbuf_t rx_frag_ind_msg, qdf_nbuf_t rx_frag_ind_msg,
int *seq_num_start, int *seq_num_end); int *seq_num_start, int *seq_num_end);
/** /**
* @brief Return the HL rx desc size * @brief Return the HL rx desc size
@@ -837,7 +837,7 @@ uint16_t htt_rx_msdu_rx_desc_size_hl(htt_pdev_handle pdev, void *msdu_desc);
* @param msdu - network buffer handle * @param msdu - network buffer handle
* @param vowstats - handle to vow ext stats. * @param vowstats - handle to vow ext stats.
*/ */
void htt_rx_get_vowext_stats(cdf_nbuf_t msdu, struct vow_extstats *vowstats); void htt_rx_get_vowext_stats(qdf_nbuf_t msdu, struct vow_extstats *vowstats);
/** /**
* @brief parses the offload message passed by the target. * @brief parses the offload message passed by the target.
@@ -859,5 +859,5 @@ htt_rx_offload_paddr_msdu_pop_ll(htt_pdev_handle pdev,
int *peer_id, int *peer_id,
int *tid, int *tid,
uint8_t *fw_desc, uint8_t *fw_desc,
cdf_nbuf_t *head_buf, cdf_nbuf_t *tail_buf); qdf_nbuf_t *head_buf, qdf_nbuf_t *tail_buf);
#endif /* _OL_HTT_RX_API__H_ */ #endif /* _OL_HTT_RX_API__H_ */

Переглянути файл

@@ -39,7 +39,7 @@
/* #include <osapi_linux.h> / * uint16_t, etc. * / */ /* #include <osapi_linux.h> / * uint16_t, etc. * / */
#include <osdep.h> /* uint16_t, etc. */ #include <osdep.h> /* uint16_t, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_cfg.h> /* wlan_frm_fmt */ #include <ol_cfg.h> /* wlan_frm_fmt */
#include <htt.h> /* needed by inline functions */ #include <htt.h> /* needed by inline functions */
@@ -256,13 +256,13 @@ struct htt_msdu_info_t {
uint8_t *dest_addr; uint8_t *dest_addr;
*/ */
uint8_t l3_hdr_offset; /* wrt cdf_nbuf_data(msdu), in bytes */ uint8_t l3_hdr_offset; /* wrt qdf_nbuf_data(msdu), in bytes */
/* l4_hdr_offset is not currently used. /* l4_hdr_offset is not currently used.
* It could be used to specify to a TCP/UDP checksum computation * It could be used to specify to a TCP/UDP checksum computation
* engine where the TCP/UDP header starts. * engine where the TCP/UDP header starts.
*/ */
/* uint8_t l4_hdr_offset; - wrt cdf_nbuf_data(msdu), in bytes */ /* uint8_t l4_hdr_offset; - wrt qdf_nbuf_data(msdu), in bytes */
} info; } info;
/* the action sub-struct specifies how to process the MSDU */ /* the action sub-struct specifies how to process the MSDU */
struct { struct {
@@ -419,7 +419,7 @@ void htt_tx_pending_discard(htt_pdev_handle pdev);
* function assumes the tx frame is the default frame type, as specified * function assumes the tx frame is the default frame type, as specified
* by ol_cfg_frame_type. "Raw" frames need to be transmitted through the * by ol_cfg_frame_type. "Raw" frames need to be transmitted through the
* alternate htt_tx_send_nonstd function. * alternate htt_tx_send_nonstd function.
* The tx descriptor has already been attached to the cdf_nbuf object during * The tx descriptor has already been attached to the qdf_nbuf object during
* a preceding call to htt_tx_desc_init. * a preceding call to htt_tx_desc_init.
* *
* @param htt_pdev - the handle of the physical device sending the tx data * @param htt_pdev - the handle of the physical device sending the tx data
@@ -428,7 +428,7 @@ void htt_tx_pending_discard(htt_pdev_handle pdev);
* @return 0 -> success, -OR- 1 -> failure * @return 0 -> success, -OR- 1 -> failure
*/ */
int int
htt_tx_send_std(htt_pdev_handle htt_pdev, cdf_nbuf_t msdu, uint16_t msdu_id); htt_tx_send_std(htt_pdev_handle htt_pdev, qdf_nbuf_t msdu, uint16_t msdu_id);
/** /**
* @brief Download a Batch Of Tx MSDUs * @brief Download a Batch Of Tx MSDUs
@@ -442,9 +442,9 @@ htt_tx_send_std(htt_pdev_handle htt_pdev, cdf_nbuf_t msdu, uint16_t msdu_id);
* @param num_msdus - The total Number of MSDU's provided for batch tx * @param num_msdus - The total Number of MSDU's provided for batch tx
* @return null-terminated linked-list of unaccepted frames * @return null-terminated linked-list of unaccepted frames
*/ */
cdf_nbuf_t qdf_nbuf_t
htt_tx_send_batch(htt_pdev_handle htt_pdev, htt_tx_send_batch(htt_pdev_handle htt_pdev,
cdf_nbuf_t head_msdu, int num_msdus); qdf_nbuf_t head_msdu, int num_msdus);
/* The htt scheduler for queued packets in htt /* The htt scheduler for queued packets in htt
* htt when unable to send to HTC because of lack of resource * htt when unable to send to HTC because of lack of resource
@@ -459,7 +459,7 @@ void htt_tx_sched(htt_pdev_handle pdev);
*/ */
int int
htt_tx_send_nonstd(htt_pdev_handle htt_pdev, htt_tx_send_nonstd(htt_pdev_handle htt_pdev,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
uint16_t msdu_id, enum htt_pkt_type pkt_type); uint16_t msdu_id, enum htt_pkt_type pkt_type);
/** /**
@@ -532,7 +532,7 @@ htt_tx_desc_init(htt_pdev_handle pdev,
void *htt_tx_desc, void *htt_tx_desc,
qdf_dma_addr_t htt_tx_desc_paddr, qdf_dma_addr_t htt_tx_desc_paddr,
uint16_t msdu_id, uint16_t msdu_id,
cdf_nbuf_t msdu, struct htt_msdu_info_t *msdu_info, qdf_nbuf_t msdu, struct htt_msdu_info_t *msdu_info,
struct qdf_tso_info_t *tso_info, struct qdf_tso_info_t *tso_info,
struct ocb_tx_ctrl_hdr_t *tx_ctrl, struct ocb_tx_ctrl_hdr_t *tx_ctrl,
uint8_t is_dsrc) uint8_t is_dsrc)
@@ -568,7 +568,7 @@ htt_tx_desc_init(htt_pdev_handle pdev,
if (qdf_likely(pdev->cfg.ce_classify_enabled)) { if (qdf_likely(pdev->cfg.ce_classify_enabled)) {
if (qdf_likely(pkt_type == htt_pkt_type_eth2 || if (qdf_likely(pkt_type == htt_pkt_type_eth2 ||
pkt_type == htt_pkt_type_ethernet)) pkt_type == htt_pkt_type_ethernet))
cdf_nbuf_tx_info_get(msdu, pkt_type, pkt_subtype, qdf_nbuf_tx_info_get(msdu, pkt_type, pkt_subtype,
hw_classify); hw_classify);
ce_pkt_type = htt_to_ce_pkt_type[pkt_type]; ce_pkt_type = htt_to_ce_pkt_type[pkt_type];
@@ -611,7 +611,7 @@ htt_tx_desc_init(htt_pdev_handle pdev,
if (tso_info->is_tso) if (tso_info->is_tso)
HTT_TX_DESC_FRM_LEN_SET(local_word1, tso_info->total_len); HTT_TX_DESC_FRM_LEN_SET(local_word1, tso_info->total_len);
else else
HTT_TX_DESC_FRM_LEN_SET(local_word1, cdf_nbuf_len(msdu)); HTT_TX_DESC_FRM_LEN_SET(local_word1, qdf_nbuf_len(msdu));
HTT_TX_DESC_FRM_ID_SET(local_word1, msdu_id); HTT_TX_DESC_FRM_ID_SET(local_word1, msdu_id);
*word1 = local_word1; *word1 = local_word1;
@@ -659,8 +659,8 @@ htt_tx_desc_init(htt_pdev_handle pdev,
local_desc_ext.is_dsrc = (is_dsrc != 0); local_desc_ext.is_dsrc = (is_dsrc != 0);
cdf_nbuf_push_head(msdu, sizeof(local_desc_ext)); qdf_nbuf_push_head(msdu, sizeof(local_desc_ext));
qdf_mem_copy(cdf_nbuf_data(msdu), &local_desc_ext, qdf_mem_copy(qdf_nbuf_data(msdu), &local_desc_ext,
sizeof(local_desc_ext)); sizeof(local_desc_ext));
} }
@@ -675,11 +675,11 @@ htt_tx_desc_init(htt_pdev_handle pdev,
* Setting the flag for this final fragment suffices for specifying * Setting the flag for this final fragment suffices for specifying
* all fragments provided by the OS rather than added by the driver. * all fragments provided by the OS rather than added by the driver.
*/ */
cdf_nbuf_set_frag_is_wordstream(msdu, cdf_nbuf_get_num_frags(msdu) - 1, qdf_nbuf_set_frag_is_wordstream(msdu, qdf_nbuf_get_num_frags(msdu) - 1,
0); 0);
/* store a link to the HTT tx descriptor within the netbuf */ /* store a link to the HTT tx descriptor within the netbuf */
cdf_nbuf_frag_push_head(msdu, sizeof(struct htt_host_tx_desc_t), qdf_nbuf_frag_push_head(msdu, sizeof(struct htt_host_tx_desc_t),
(char *)htt_host_tx_desc, /* virtual addr */ (char *)htt_host_tx_desc, /* virtual addr */
htt_tx_desc_paddr); htt_tx_desc_paddr);
@@ -691,17 +691,17 @@ htt_tx_desc_init(htt_pdev_handle pdev,
* the host is big-endian, to convert to the target's little-endian * the host is big-endian, to convert to the target's little-endian
* format. * format.
*/ */
cdf_nbuf_set_frag_is_wordstream(msdu, 0, 1); qdf_nbuf_set_frag_is_wordstream(msdu, 0, 1);
if (qdf_likely(pdev->cfg.ce_classify_enabled && if (qdf_likely(pdev->cfg.ce_classify_enabled &&
(msdu_info->info.l2_hdr_type != htt_pkt_type_mgmt))) { (msdu_info->info.l2_hdr_type != htt_pkt_type_mgmt))) {
uint32_t pkt_offset = cdf_nbuf_get_frag_len(msdu, 0); uint32_t pkt_offset = qdf_nbuf_get_frag_len(msdu, 0);
data_attr = hw_classify << QDF_CE_TX_CLASSIFY_BIT_S; data_attr = hw_classify << QDF_CE_TX_CLASSIFY_BIT_S;
data_attr |= ce_pkt_type << QDF_CE_TX_PKT_TYPE_BIT_S; data_attr |= ce_pkt_type << QDF_CE_TX_PKT_TYPE_BIT_S;
data_attr |= pkt_offset << QDF_CE_TX_PKT_OFFSET_BIT_S; data_attr |= pkt_offset << QDF_CE_TX_PKT_OFFSET_BIT_S;
} }
cdf_nbuf_data_attr_set(msdu, data_attr); qdf_nbuf_data_attr_set(msdu, data_attr);
} }
/** /**
@@ -909,9 +909,9 @@ void htt_tx_mgmt_desc_pool_alloc(struct htt_pdev_t *pdev, A_UINT32 num_elems);
* @param - pointer to the mamangement from UMAC * @param - pointer to the mamangement from UMAC
* @return - pointer the allocated mgmt descriptor * @return - pointer the allocated mgmt descriptor
*/ */
cdf_nbuf_t qdf_nbuf_t
htt_tx_mgmt_desc_alloc(struct htt_pdev_t *pdev, A_UINT32 *desc_id, htt_tx_mgmt_desc_alloc(struct htt_pdev_t *pdev, A_UINT32 *desc_id,
cdf_nbuf_t mgmt_frm); qdf_nbuf_t mgmt_frm);
/** htt_tx_mgmt_desc_free /** htt_tx_mgmt_desc_free
* @description - releases the management descriptor back to the pool * @description - releases the management descriptor back to the pool

Переглянути файл

@@ -33,7 +33,7 @@
#define _OL_TXRX_CTRL_API__H_ #define _OL_TXRX_CTRL_API__H_
#include <athdefs.h> /* A_STATUS */ #include <athdefs.h> /* A_STATUS */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <qdf_types.h> /* qdf_device_t */ #include <qdf_types.h> /* qdf_device_t */
#include <htc_api.h> /* HTC_HANDLE */ #include <htc_api.h> /* HTC_HANDLE */
@@ -543,7 +543,7 @@ ol_txrx_vdev_detach(ol_txrx_vdev_handle data_vdev,
void ol_txrx_pdev_detach(ol_txrx_pdev_handle data_pdev, int force); void ol_txrx_pdev_detach(ol_txrx_pdev_handle data_pdev, int force);
typedef void typedef void
(*ol_txrx_data_tx_cb)(void *ctxt, cdf_nbuf_t tx_frm, int had_error); (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
/** /**
* @brief Store a delivery notification callback for specific data frames. * @brief Store a delivery notification callback for specific data frames.
@@ -583,12 +583,12 @@ ol_txrx_data_tx_cb_set(ol_txrx_vdev_handle data_vdev,
* @param tx_spec - what non-standard handling to apply to the tx data frames * @param tx_spec - what non-standard handling to apply to the tx data frames
* @param msdu_list - NULL-terminated list of tx MSDUs * @param msdu_list - NULL-terminated list of tx MSDUs
*/ */
cdf_nbuf_t qdf_nbuf_t
ol_tx_non_std(ol_txrx_vdev_handle data_vdev, ol_tx_non_std(ol_txrx_vdev_handle data_vdev,
enum ol_tx_spec tx_spec, cdf_nbuf_t msdu_list); enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
typedef void typedef void
(*ol_txrx_mgmt_tx_cb)(void *ctxt, cdf_nbuf_t tx_mgmt_frm, int had_error); (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
/** /**
* @brief Store a callback for delivery notifications for management frames. * @brief Store a callback for delivery notifications for management frames.
@@ -634,7 +634,7 @@ ol_txrx_mgmt_tx_cb_set(ol_txrx_pdev_handle pdev,
*/ */
int int
ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev, ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev,
cdf_nbuf_t tx_mgmt_frm, qdf_nbuf_t tx_mgmt_frm,
uint8_t type, uint8_t use_6mbps, uint16_t chanfreq); uint8_t type, uint8_t use_6mbps, uint16_t chanfreq);
/** /**

Переглянути файл

@@ -34,14 +34,14 @@
#include <htt.h> /* HTT_TX_COMPL_IND_STAT */ #include <htt.h> /* HTT_TX_COMPL_IND_STAT */
#include <athdefs.h> /* A_STATUS */ #include <athdefs.h> /* A_STATUS */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_txrx_api.h> /* ol_txrx_pdev_handle */ #include <ol_txrx_api.h> /* ol_txrx_pdev_handle */
static inline uint16_t *ol_tx_msdu_id_storage(cdf_nbuf_t msdu) static inline uint16_t *ol_tx_msdu_id_storage(qdf_nbuf_t msdu)
{ {
qdf_assert(cdf_nbuf_headroom(msdu) >= (sizeof(uint16_t) * 2 - 1)); qdf_assert(qdf_nbuf_headroom(msdu) >= (sizeof(uint16_t) * 2 - 1));
return (uint16_t *) (((qdf_size_t) (cdf_nbuf_head(msdu) + 1)) & ~0x1); return (uint16_t *) (((qdf_size_t) (qdf_nbuf_head(msdu) + 1)) & ~0x1);
} }
/** /**
@@ -59,7 +59,7 @@ static inline uint16_t *ol_tx_msdu_id_storage(cdf_nbuf_t msdu)
*/ */
void void
ol_tx_download_done_ll(void *pdev, ol_tx_download_done_ll(void *pdev,
A_STATUS status, cdf_nbuf_t msdu, uint16_t msdu_id); A_STATUS status, qdf_nbuf_t msdu, uint16_t msdu_id);
/** /**
* @brief Tx MSDU download completion for HL system without tx completion msgs * @brief Tx MSDU download completion for HL system without tx completion msgs
@@ -75,7 +75,7 @@ ol_tx_download_done_ll(void *pdev,
*/ */
void void
ol_tx_download_done_hl_free(void *pdev, ol_tx_download_done_hl_free(void *pdev,
A_STATUS status, cdf_nbuf_t msdu, uint16_t msdu_id); A_STATUS status, qdf_nbuf_t msdu, uint16_t msdu_id);
/** /**
* @brief Tx MSDU download completion for HL system with tx completion msgs * @brief Tx MSDU download completion for HL system with tx completion msgs
@@ -96,7 +96,7 @@ ol_tx_download_done_hl_free(void *pdev,
void void
ol_tx_download_done_hl_retain(void *pdev, ol_tx_download_done_hl_retain(void *pdev,
A_STATUS status, A_STATUS status,
cdf_nbuf_t msdu, uint16_t msdu_id); qdf_nbuf_t msdu, uint16_t msdu_id);
/* /*
* For now, make the host HTT -> host txrx tx completion status * For now, make the host HTT -> host txrx tx completion status
@@ -233,7 +233,7 @@ void ol_tx_target_credit_update(struct ol_txrx_pdev_t *pdev, int credit_delta);
*/ */
void void
ol_rx_indication_handler(ol_txrx_pdev_handle pdev, ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
uint16_t peer_id, uint8_t tid, int num_mpdu_ranges); uint16_t peer_id, uint8_t tid, int num_mpdu_ranges);
/** /**
@@ -253,7 +253,7 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
* @param tid - what (extended) traffic type the rx data is * @param tid - what (extended) traffic type the rx data is
*/ */
void ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev, void ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t rx_frag_ind_msg, qdf_nbuf_t rx_frag_ind_msg,
uint16_t peer_id, uint8_t tid); uint16_t peer_id, uint8_t tid);
/** /**
@@ -277,7 +277,7 @@ void ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev,
*/ */
void void
ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev, ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t msg, int msdu_cnt); qdf_nbuf_t msg, int msdu_cnt);
/** /**
* @brief Process a peer map message sent by the target. * @brief Process a peer map message sent by the target.
@@ -572,7 +572,7 @@ ol_txrx_peer_qoscapable_get(struct ol_txrx_pdev_t *txrx_pdev, uint16_t peer_id);
*/ */
void void
ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev, ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
uint16_t peer_id, uint16_t peer_id,
uint8_t tid, uint8_t is_offload); uint8_t tid, uint8_t is_offload);

Переглянути файл

@@ -32,7 +32,7 @@
#ifndef _OL_TXRX_OSIF_API__H_ #ifndef _OL_TXRX_OSIF_API__H_
#define _OL_TXRX_OSIF_API__H_ #define _OL_TXRX_OSIF_API__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_osif_api.h> /* ol_osif_vdev_handle */ #include <ol_osif_api.h> /* ol_osif_vdev_handle */
#include <ol_txrx_api.h> /* ol_txrx_pdev_handle, etc. */ #include <ol_txrx_api.h> /* ol_txrx_pdev_handle, etc. */
@@ -46,21 +46,21 @@
*/ */
struct ol_rx_cached_buf { struct ol_rx_cached_buf {
struct list_head list; struct list_head list;
cdf_nbuf_t buf; qdf_nbuf_t buf;
}; };
/** /**
* @typedef ol_txrx_rx_fp * @typedef ol_txrx_rx_fp
* @brief receive function to hand batches of data frames from txrx to OS shim * @brief receive function to hand batches of data frames from txrx to OS shim
*/ */
typedef void (*ol_txrx_rx_fp)(void *osif_dev, cdf_nbuf_t msdus); typedef void (*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdus);
/** /**
* @typedef ol_txrx_tx_fp * @typedef ol_txrx_tx_fp
* @brief top-level transmit function * @brief top-level transmit function
*/ */
typedef cdf_nbuf_t (*ol_txrx_tx_fp)(ol_txrx_vdev_handle data_vdev, typedef qdf_nbuf_t (*ol_txrx_tx_fp)(ol_txrx_vdev_handle data_vdev,
cdf_nbuf_t msdu_list); qdf_nbuf_t msdu_list);
/** /**
* @typedef ol_txrx_tx_non_std_fp * @typedef ol_txrx_tx_non_std_fp
@@ -82,9 +82,9 @@ typedef cdf_nbuf_t (*ol_txrx_tx_fp)(ol_txrx_vdev_handle data_vdev,
* @param tx_spec - what non-standard operations to apply to the tx frame * @param tx_spec - what non-standard operations to apply to the tx frame
* @param msdu_list - tx frame(s), in a null-terminated list * @param msdu_list - tx frame(s), in a null-terminated list
*/ */
typedef cdf_nbuf_t (*ol_txrx_tx_non_std_fp)(ol_txrx_vdev_handle data_vdev, typedef qdf_nbuf_t (*ol_txrx_tx_non_std_fp)(ol_txrx_vdev_handle data_vdev,
enum ol_tx_spec tx_spec, enum ol_tx_spec tx_spec,
cdf_nbuf_t msdu_list); qdf_nbuf_t msdu_list);
struct txrx_rx_metainfo; struct txrx_rx_metainfo;
@@ -111,7 +111,7 @@ struct ol_txrx_desc_type {
typedef QDF_STATUS (*ol_rx_callback_fp)(void *p_cds_gctx, typedef QDF_STATUS (*ol_rx_callback_fp)(void *p_cds_gctx,
cdf_nbuf_t pDataBuff, qdf_nbuf_t pDataBuff,
uint8_t ucSTAId); uint8_t ucSTAId);
typedef void (*ol_tx_pause_callback_fp)(uint8_t vdev_id, typedef void (*ol_tx_pause_callback_fp)(uint8_t vdev_id,
@@ -250,16 +250,16 @@ ol_txrx_osif_vdev_register(ol_txrx_vdev_handle txrx_vdev,
* NULL if the segmentation fails, - OR - * NULL if the segmentation fails, - OR -
* a NULL-terminated list of segment network buffers * a NULL-terminated list of segment network buffers
*/ */
cdf_nbuf_t ol_txrx_osif_tso_segment(ol_txrx_vdev_handle txrx_vdev, qdf_nbuf_t ol_txrx_osif_tso_segment(ol_txrx_vdev_handle txrx_vdev,
int max_seg_payload_bytes, int max_seg_payload_bytes,
cdf_nbuf_t jumbo_tcp_frame); qdf_nbuf_t jumbo_tcp_frame);
cdf_nbuf_t ol_tx_send_data_frame(uint8_t sta_id, cdf_nbuf_t skb, qdf_nbuf_t ol_tx_send_data_frame(uint8_t sta_id, qdf_nbuf_t skb,
uint8_t proto_type); uint8_t proto_type);
#ifdef IPA_OFFLOAD #ifdef IPA_OFFLOAD
cdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev, qdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev,
cdf_nbuf_t skb); qdf_nbuf_t skb);
#endif #endif
QDF_STATUS ol_txrx_register_peer(ol_rx_callback_fp rxcb, QDF_STATUS ol_txrx_register_peer(ol_rx_callback_fp rxcb,
@@ -272,7 +272,7 @@ QDF_STATUS ol_txrx_change_peer_state(uint8_t sta_id,
bool roam_synch_in_progress); bool roam_synch_in_progress);
void ol_rx_data_process(struct ol_txrx_peer_t *peer, void ol_rx_data_process(struct ol_txrx_peer_t *peer,
cdf_nbuf_t rx_buf_list); qdf_nbuf_t rx_buf_list);
void ol_txrx_flush_rx_frames(struct ol_txrx_peer_t *peer, void ol_txrx_flush_rx_frames(struct ol_txrx_peer_t *peer,
bool drop); bool drop);

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2014-2015 The Linux Foundation. All rights reserved. * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -61,6 +61,6 @@ struct vow_extstats {
* @param msdu - network buffer handle * @param msdu - network buffer handle
* @param pdev - handle to htt dev. * @param pdev - handle to htt dev.
*/ */
void ol_ath_add_vow_extstats(htt_pdev_handle pdev, cdf_nbuf_t msdu); void ol_ath_add_vow_extstats(htt_pdev_handle pdev, qdf_nbuf_t msdu);
#endif /* _VOW_DEFINES__H_ */ #endif /* _VOW_DEFINES__H_ */

Переглянути файл

@@ -34,7 +34,7 @@
/* #include <osapi_linux.h> / * uint8_t * / */ /* #include <osapi_linux.h> / * uint8_t * / */
#include <osdep.h> /* uint8_t */ #include <osdep.h> /* uint8_t */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_ctrl_api.h> /* ol_vdev_handle */ #include <ol_ctrl_api.h> /* ol_vdev_handle */
#include <ol_txrx_api.h> /* ol_txrx_peer_handle, etc. */ #include <ol_txrx_api.h> /* ol_txrx_peer_handle, etc. */
@@ -106,7 +106,7 @@ ol_rx_err(ol_pdev_handle pdev,
int tid, int tid,
uint32_t tsf32, uint32_t tsf32,
enum ol_rx_err_type err_type, enum ol_rx_err_type err_type,
cdf_nbuf_t rx_frame, uint64_t *pn, uint8_t key_id); qdf_nbuf_t rx_frame, uint64_t *pn, uint8_t key_id);
enum ol_rx_notify_type { enum ol_rx_notify_type {
OL_RX_NOTIFY_IPV4_IGMP, OL_RX_NOTIFY_IPV4_IGMP,
@@ -138,7 +138,7 @@ ol_rx_notify(ol_pdev_handle pdev,
uint8_t *peer_mac_addr, uint8_t *peer_mac_addr,
int tid, int tid,
uint32_t tsf32, uint32_t tsf32,
enum ol_rx_notify_type notify_type, cdf_nbuf_t rx_frame); enum ol_rx_notify_type notify_type, qdf_nbuf_t rx_frame);
/** /**
* @brief Indicate when a paused STA has tx data available. * @brief Indicate when a paused STA has tx data available.

Переглянути файл

@@ -32,7 +32,7 @@
#ifndef _OL_OSIF_TXRX_API_H_ #ifndef _OL_OSIF_TXRX_API_H_
#define _OL_OSIF_TXRX_API_H_ #define _OL_OSIF_TXRX_API_H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
/** /**
* @brief Call tx completion handler to release the buffers * @brief Call tx completion handler to release the buffers

Переглянути файл

@@ -25,7 +25,7 @@
* to the Linux Foundation. * to the Linux Foundation.
*/ */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_util.h> /* qdf_cpu_to_le64 */ #include <qdf_util.h> /* qdf_cpu_to_le64 */
#include <qdf_types.h> /* bool */ #include <qdf_types.h> /* bool */
#include <cds_ieee80211_common.h> /* ieee80211_frame */ #include <cds_ieee80211_common.h> /* ieee80211_frame */
@@ -68,7 +68,7 @@
#endif #endif
void ol_rx_data_process(struct ol_txrx_peer_t *peer, void ol_rx_data_process(struct ol_txrx_peer_t *peer,
cdf_nbuf_t rx_buf_list); qdf_nbuf_t rx_buf_list);
#ifdef HTT_RX_RESTORE #ifdef HTT_RX_RESTORE
@@ -84,16 +84,16 @@ static void ol_rx_restore_handler(struct work_struct *htt_rx)
static DECLARE_WORK(ol_rx_restore_work, ol_rx_restore_handler); static DECLARE_WORK(ol_rx_restore_work, ol_rx_restore_handler);
void ol_rx_trigger_restore(htt_pdev_handle htt_pdev, cdf_nbuf_t head_msdu, void ol_rx_trigger_restore(htt_pdev_handle htt_pdev, qdf_nbuf_t head_msdu,
cdf_nbuf_t tail_msdu) qdf_nbuf_t tail_msdu)
{ {
cdf_nbuf_t next; qdf_nbuf_t next;
while (head_msdu) { while (head_msdu) {
next = cdf_nbuf_next(head_msdu); next = qdf_nbuf_next(head_msdu);
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO,
"freeing %p\n", head_msdu); "freeing %p\n", head_msdu);
cdf_nbuf_free(head_msdu); qdf_nbuf_free(head_msdu);
head_msdu = next; head_msdu = next;
} }
@@ -106,7 +106,7 @@ void ol_rx_trigger_restore(htt_pdev_handle htt_pdev, cdf_nbuf_t head_msdu,
#endif #endif
static void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev, static void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev,
void *rx_mpdu_desc, cdf_nbuf_t msdu) void *rx_mpdu_desc, qdf_nbuf_t msdu)
{ {
uint8_t a1[IEEE80211_ADDR_LEN]; uint8_t a1[IEEE80211_ADDR_LEN];
htt_pdev_handle htt_pdev = pdev->htt_pdev; htt_pdev_handle htt_pdev = pdev->htt_pdev;
@@ -166,7 +166,7 @@ ol_rx_rssi_avg(struct ol_txrx_pdev_t *pdev, int16_t rssi_old, int16_t rssi_new)
} }
static void static void
ol_rx_ind_rssi_update(struct ol_txrx_peer_t *peer, cdf_nbuf_t rx_ind_msg) ol_rx_ind_rssi_update(struct ol_txrx_peer_t *peer, qdf_nbuf_t rx_ind_msg)
{ {
struct ol_txrx_pdev_t *pdev = peer->vdev->pdev; struct ol_txrx_pdev_t *pdev = peer->vdev->pdev;
peer->rssi_dbm = ol_rx_rssi_avg(pdev, peer->rssi_dbm, peer->rssi_dbm = ol_rx_rssi_avg(pdev, peer->rssi_dbm,
@@ -192,12 +192,12 @@ ol_rx_mpdu_rssi_update(struct ol_txrx_peer_t *peer, void *rx_mpdu_desc)
#endif /* QCA_SUPPORT_PEER_DATA_RX_RSSI */ #endif /* QCA_SUPPORT_PEER_DATA_RX_RSSI */
void discard_msdus(htt_pdev_handle htt_pdev, void discard_msdus(htt_pdev_handle htt_pdev,
cdf_nbuf_t head_msdu, qdf_nbuf_t head_msdu,
cdf_nbuf_t tail_msdu) qdf_nbuf_t tail_msdu)
{ {
while (1) { while (1) {
cdf_nbuf_t next; qdf_nbuf_t next;
next = cdf_nbuf_next( next = qdf_nbuf_next(
head_msdu); head_msdu);
htt_rx_desc_frame_free htt_rx_desc_frame_free
(htt_pdev, (htt_pdev,
@@ -212,12 +212,12 @@ void discard_msdus(htt_pdev_handle htt_pdev,
} }
void chain_msdus(htt_pdev_handle htt_pdev, void chain_msdus(htt_pdev_handle htt_pdev,
cdf_nbuf_t head_msdu, qdf_nbuf_t head_msdu,
cdf_nbuf_t tail_msdu) qdf_nbuf_t tail_msdu)
{ {
while (1) { while (1) {
cdf_nbuf_t next; qdf_nbuf_t next;
next = cdf_nbuf_next(head_msdu); next = qdf_nbuf_next(head_msdu);
htt_rx_desc_frame_free( htt_rx_desc_frame_free(
htt_pdev, htt_pdev,
head_msdu); head_msdu);
@@ -232,8 +232,8 @@ void process_reorder(ol_txrx_pdev_handle pdev,
void *rx_mpdu_desc, void *rx_mpdu_desc,
uint8_t tid, uint8_t tid,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
cdf_nbuf_t head_msdu, qdf_nbuf_t head_msdu,
cdf_nbuf_t tail_msdu, qdf_nbuf_t tail_msdu,
int num_mpdu_ranges, int num_mpdu_ranges,
int num_pdus, int num_pdus,
bool rx_ind_release bool rx_ind_release
@@ -310,7 +310,7 @@ void process_reorder(ol_txrx_pdev_handle pdev,
void void
ol_rx_indication_handler(ol_txrx_pdev_handle pdev, ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
uint16_t peer_id, uint8_t tid, int num_mpdu_ranges) uint16_t peer_id, uint8_t tid, int num_mpdu_ranges)
{ {
int mpdu_range, i; int mpdu_range, i;
@@ -383,7 +383,7 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
if (htt_rx_ind_release(pdev->htt_pdev, rx_ind_msg)) { if (htt_rx_ind_release(pdev->htt_pdev, rx_ind_msg)) {
/* the ind info of release is saved here and do release at the /* the ind info of release is saved here and do release at the
* end. This is for the reason of in HL case, the cdf_nbuf_t * end. This is for the reason of in HL case, the qdf_nbuf_t
* for msg and payload are the same buf. And the buf will be * for msg and payload are the same buf. And the buf will be
* changed during processing */ * changed during processing */
rx_ind_release = true; rx_ind_release = true;
@@ -398,7 +398,7 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
for (mpdu_range = 0; mpdu_range < num_mpdu_ranges; mpdu_range++) { for (mpdu_range = 0; mpdu_range < num_mpdu_ranges; mpdu_range++) {
enum htt_rx_status status; enum htt_rx_status status;
int i, num_mpdus; int i, num_mpdus;
cdf_nbuf_t head_msdu, tail_msdu, msdu; qdf_nbuf_t head_msdu, tail_msdu, msdu;
void *rx_mpdu_desc; void *rx_mpdu_desc;
#ifdef DEBUG_DMA_DONE #ifdef DEBUG_DMA_DONE
@@ -558,8 +558,8 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
} }
while (1) { while (1) {
/* Free the nbuf */ /* Free the nbuf */
cdf_nbuf_t next; qdf_nbuf_t next;
next = cdf_nbuf_next(msdu); next = qdf_nbuf_next(msdu);
htt_rx_desc_frame_free(htt_pdev, msdu); htt_rx_desc_frame_free(htt_pdev, msdu);
if (msdu == tail_msdu) if (msdu == tail_msdu)
break; break;
@@ -649,7 +649,7 @@ ol_rx_sec_ind_handler(ol_txrx_pdev_handle pdev,
#include <cds_ieee80211_common.h> #include <cds_ieee80211_common.h>
static void transcap_nwifi_to_8023(cdf_nbuf_t msdu) static void transcap_nwifi_to_8023(qdf_nbuf_t msdu)
{ {
struct ieee80211_frame *wh; struct ieee80211_frame *wh;
uint32_t hdrsize; uint32_t hdrsize;
@@ -661,7 +661,7 @@ static void transcap_nwifi_to_8023(cdf_nbuf_t msdu)
uint8_t a3[IEEE80211_ADDR_LEN]; uint8_t a3[IEEE80211_ADDR_LEN];
uint8_t fc1; uint8_t fc1;
wh = (struct ieee80211_frame *)cdf_nbuf_data(msdu); wh = (struct ieee80211_frame *)qdf_nbuf_data(msdu);
qdf_mem_copy(a1, wh->i_addr1, IEEE80211_ADDR_LEN); qdf_mem_copy(a1, wh->i_addr1, IEEE80211_ADDR_LEN);
qdf_mem_copy(a2, wh->i_addr2, IEEE80211_ADDR_LEN); qdf_mem_copy(a2, wh->i_addr2, IEEE80211_ADDR_LEN);
qdf_mem_copy(a3, wh->i_addr3, IEEE80211_ADDR_LEN); qdf_mem_copy(a3, wh->i_addr3, IEEE80211_ADDR_LEN);
@@ -669,17 +669,17 @@ static void transcap_nwifi_to_8023(cdf_nbuf_t msdu)
/* Native Wifi header is 80211 non-QoS header */ /* Native Wifi header is 80211 non-QoS header */
hdrsize = sizeof(struct ieee80211_frame); hdrsize = sizeof(struct ieee80211_frame);
llchdr = (struct llc *)(((uint8_t *) cdf_nbuf_data(msdu)) + hdrsize); llchdr = (struct llc *)(((uint8_t *) qdf_nbuf_data(msdu)) + hdrsize);
ether_type = llchdr->llc_un.type_snap.ether_type; ether_type = llchdr->llc_un.type_snap.ether_type;
/* /*
* Now move the data pointer to the beginning of the mac header : * Now move the data pointer to the beginning of the mac header :
* new-header = old-hdr + (wifhdrsize + llchdrsize - ethhdrsize) * new-header = old-hdr + (wifhdrsize + llchdrsize - ethhdrsize)
*/ */
cdf_nbuf_pull_head(msdu, qdf_nbuf_pull_head(msdu,
(hdrsize + sizeof(struct llc) - (hdrsize + sizeof(struct llc) -
sizeof(struct ether_header))); sizeof(struct ether_header)));
eth_hdr = (struct ether_header *)(cdf_nbuf_data(msdu)); eth_hdr = (struct ether_header *)(qdf_nbuf_data(msdu));
switch (fc1) { switch (fc1) {
case IEEE80211_FC1_DIR_NODS: case IEEE80211_FC1_DIR_NODS:
qdf_mem_copy(eth_hdr->ether_dhost, a1, IEEE80211_ADDR_LEN); qdf_mem_copy(eth_hdr->ether_dhost, a1, IEEE80211_ADDR_LEN);
@@ -705,7 +705,7 @@ void ol_rx_notify(ol_pdev_handle pdev,
uint8_t *peer_mac_addr, uint8_t *peer_mac_addr,
int tid, int tid,
uint32_t tsf32, uint32_t tsf32,
enum ol_rx_notify_type notify_type, cdf_nbuf_t rx_frame) enum ol_rx_notify_type notify_type, qdf_nbuf_t rx_frame)
{ {
/* /*
* NOTE: This is used in qca_main for AP mode to handle IGMP * NOTE: This is used in qca_main for AP mode to handle IGMP
@@ -732,14 +732,14 @@ void ol_rx_notify(ol_pdev_handle pdev,
void void
ol_rx_inspect(struct ol_txrx_vdev_t *vdev, ol_rx_inspect(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu, void *rx_desc) unsigned tid, qdf_nbuf_t msdu, void *rx_desc)
{ {
ol_txrx_pdev_handle pdev = vdev->pdev; ol_txrx_pdev_handle pdev = vdev->pdev;
uint8_t *data, *l3_hdr; uint8_t *data, *l3_hdr;
uint16_t ethertype; uint16_t ethertype;
int offset; int offset;
data = cdf_nbuf_data(msdu); data = qdf_nbuf_data(msdu);
if (pdev->frame_format == wlan_frm_fmt_native_wifi) { if (pdev->frame_format == wlan_frm_fmt_native_wifi) {
offset = SIZEOF_80211_HDR + LLC_SNAP_HDR_OFFSET_ETHERTYPE; offset = SIZEOF_80211_HDR + LLC_SNAP_HDR_OFFSET_ETHERTYPE;
l3_hdr = data + SIZEOF_80211_HDR + LLC_SNAP_HDR_LEN; l3_hdr = data + SIZEOF_80211_HDR + LLC_SNAP_HDR_LEN;
@@ -764,10 +764,10 @@ ol_rx_inspect(struct ol_txrx_vdev_t *vdev,
void void
ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev, ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t msg, int msdu_cnt) qdf_nbuf_t msg, int msdu_cnt)
{ {
int vdev_id, peer_id, tid; int vdev_id, peer_id, tid;
cdf_nbuf_t head_buf, tail_buf, buf; qdf_nbuf_t head_buf, tail_buf, buf;
struct ol_txrx_peer_t *peer; struct ol_txrx_peer_t *peer;
uint8_t fw_desc; uint8_t fw_desc;
htt_pdev_handle htt_pdev = pdev->htt_pdev; htt_pdev_handle htt_pdev = pdev->htt_pdev;
@@ -782,8 +782,8 @@ ol_rx_offload_deliver_ind_handler(ol_txrx_pdev_handle pdev,
} else { } else {
buf = head_buf; buf = head_buf;
while (1) { while (1) {
cdf_nbuf_t next; qdf_nbuf_t next;
next = cdf_nbuf_next(buf); next = qdf_nbuf_next(buf);
htt_rx_desc_frame_free(htt_pdev, buf); htt_rx_desc_frame_free(htt_pdev, buf);
if (buf == tail_buf) if (buf == tail_buf)
break; break;
@@ -801,7 +801,7 @@ ol_rx_mic_error_handler(
u_int8_t tid, u_int8_t tid,
u_int16_t peer_id, u_int16_t peer_id,
void *msdu_desc, void *msdu_desc,
cdf_nbuf_t msdu) qdf_nbuf_t msdu)
{ {
union htt_rx_pn_t pn = {0}; union htt_rx_pn_t pn = {0};
u_int8_t key_id = 0; u_int8_t key_id = 0;
@@ -836,7 +836,7 @@ ol_rx_mic_error_handler(
*/ */
bool bool
ol_rx_filter(struct ol_txrx_vdev_t *vdev, ol_rx_filter(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, cdf_nbuf_t msdu, void *rx_desc) struct ol_txrx_peer_t *peer, qdf_nbuf_t msdu, void *rx_desc)
{ {
#define FILTER_STATUS_REJECT 1 #define FILTER_STATUS_REJECT 1
#define FILTER_STATUS_ACCEPT 0 #define FILTER_STATUS_ACCEPT 0
@@ -867,7 +867,7 @@ ol_rx_filter(struct ol_txrx_vdev_t *vdev,
offset = ETHERNET_ADDR_LEN * 2; offset = ETHERNET_ADDR_LEN * 2;
} }
/* get header info from msdu */ /* get header info from msdu */
wh = cdf_nbuf_data(msdu); wh = qdf_nbuf_data(msdu);
/* get ether type */ /* get ether type */
ether_type = (wh[offset] << 8) | wh[offset + 1]; ether_type = (wh[offset] << 8) | wh[offset + 1];
@@ -963,13 +963,13 @@ ol_rx_filter(struct ol_txrx_vdev_t *vdev,
void void
ol_rx_deliver(struct ol_txrx_vdev_t *vdev, ol_rx_deliver(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t msdu_list) struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t msdu_list)
{ {
ol_txrx_pdev_handle pdev = vdev->pdev; ol_txrx_pdev_handle pdev = vdev->pdev;
htt_pdev_handle htt_pdev = pdev->htt_pdev; htt_pdev_handle htt_pdev = pdev->htt_pdev;
cdf_nbuf_t deliver_list_head = NULL; qdf_nbuf_t deliver_list_head = NULL;
cdf_nbuf_t deliver_list_tail = NULL; qdf_nbuf_t deliver_list_tail = NULL;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
bool filter = false; bool filter = false;
#ifdef QCA_SUPPORT_SW_TXRX_ENCAP #ifdef QCA_SUPPORT_SW_TXRX_ENCAP
struct ol_rx_decap_info_t info; struct ol_rx_decap_info_t info;
@@ -984,7 +984,7 @@ ol_rx_deliver(struct ol_txrx_vdev_t *vdev,
while (msdu) { while (msdu) {
void *rx_desc; void *rx_desc;
int discard, inspect, dummy_fwd; int discard, inspect, dummy_fwd;
cdf_nbuf_t next = cdf_nbuf_next(msdu); qdf_nbuf_t next = qdf_nbuf_next(msdu);
rx_desc = htt_rx_msdu_desc_retrieve(pdev->htt_pdev, msdu); rx_desc = htt_rx_msdu_desc_retrieve(pdev->htt_pdev, msdu);
@@ -1002,7 +1002,7 @@ ol_rx_deliver(struct ol_txrx_vdev_t *vdev,
peer->mac_addr.raw[0], peer->mac_addr.raw[1], peer->mac_addr.raw[0], peer->mac_addr.raw[1],
peer->mac_addr.raw[2], peer->mac_addr.raw[3], peer->mac_addr.raw[2], peer->mac_addr.raw[3],
peer->mac_addr.raw[4], peer->mac_addr.raw[5], peer->mac_addr.raw[4], peer->mac_addr.raw[5],
cdf_nbuf_len(msdu)); qdf_nbuf_len(msdu));
goto DONE; goto DONE;
} }
#endif #endif
@@ -1028,13 +1028,13 @@ DONE:
ol_txrx_frm_dump_tcp_seq | ol_txrx_frm_dump_tcp_seq |
ol_txrx_frm_dump_contents, ol_txrx_frm_dump_contents,
0 /* don't print contents */); 0 /* don't print contents */);
cdf_nbuf_free(msdu); qdf_nbuf_free(msdu);
/* If discarding packet is last packet of the delivery /* If discarding packet is last packet of the delivery
list, NULL terminator should be added list, NULL terminator should be added
for delivery list. */ for delivery list. */
if (next == NULL && deliver_list_head) { if (next == NULL && deliver_list_head) {
/* add NULL terminator */ /* add NULL terminator */
cdf_nbuf_set_next(deliver_list_tail, NULL); qdf_nbuf_set_next(deliver_list_tail, NULL);
} }
} else { } else {
/* /*
@@ -1117,9 +1117,9 @@ DONE:
rx_header.tsf32 = peer->last_pkt_tsf; rx_header.tsf32 = peer->last_pkt_tsf;
rx_header.ext_tid = peer->last_pkt_tid; rx_header.ext_tid = peer->last_pkt_tid;
cdf_nbuf_push_head(msdu, qdf_nbuf_push_head(msdu,
sizeof(rx_header)); sizeof(rx_header));
qdf_mem_copy(cdf_nbuf_data(msdu), qdf_mem_copy(qdf_nbuf_data(msdu),
&rx_header, sizeof(rx_header)); &rx_header, sizeof(rx_header));
/* Construct the ethernet header with /* Construct the ethernet header with
@@ -1128,9 +1128,9 @@ DONE:
RX stats header. */ RX stats header. */
eth_header.ether_type = QDF_SWAP_U16( eth_header.ether_type = QDF_SWAP_U16(
ETHERTYPE_OCB_RX); ETHERTYPE_OCB_RX);
cdf_nbuf_push_head(msdu, qdf_nbuf_push_head(msdu,
sizeof(eth_header)); sizeof(eth_header));
qdf_mem_copy(cdf_nbuf_data(msdu), qdf_mem_copy(qdf_nbuf_data(msdu),
&eth_header, &eth_header,
sizeof(eth_header)); sizeof(eth_header));
} }
@@ -1150,7 +1150,7 @@ DONE:
#if defined(PERE_IP_HDR_ALIGNMENT_WAR) #if defined(PERE_IP_HDR_ALIGNMENT_WAR)
if (pdev->host_80211_enable) if (pdev->host_80211_enable)
for (msdu = deliver_list_head; msdu; msdu = cdf_nbuf_next(msdu)) for (msdu = deliver_list_head; msdu; msdu = qdf_nbuf_next(msdu))
transcap_nwifi_to_8023(msdu); transcap_nwifi_to_8023(msdu);
#endif #endif
@@ -1164,15 +1164,15 @@ DONE:
void void
ol_rx_discard(struct ol_txrx_vdev_t *vdev, ol_rx_discard(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t msdu_list) struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t msdu_list)
{ {
ol_txrx_pdev_handle pdev = vdev->pdev; ol_txrx_pdev_handle pdev = vdev->pdev;
htt_pdev_handle htt_pdev = pdev->htt_pdev; htt_pdev_handle htt_pdev = pdev->htt_pdev;
while (msdu_list) { while (msdu_list) {
cdf_nbuf_t msdu = msdu_list; qdf_nbuf_t msdu = msdu_list;
msdu_list = cdf_nbuf_next(msdu_list); msdu_list = qdf_nbuf_next(msdu_list);
TXRX_PRINT(TXRX_PRINT_LEVEL_INFO1, TXRX_PRINT(TXRX_PRINT_LEVEL_INFO1,
"discard rx %p from partly-deleted peer %p " "discard rx %p from partly-deleted peer %p "
"(%02x:%02x:%02x:%02x:%02x:%02x)\n", "(%02x:%02x:%02x:%02x:%02x:%02x)\n",
@@ -1214,12 +1214,12 @@ ol_rx_peer_cleanup(struct ol_txrx_vdev_t *vdev, struct ol_txrx_peer_t *peer)
/* /*
* Free frames including both rx descriptors and buffers * Free frames including both rx descriptors and buffers
*/ */
void ol_rx_frames_free(htt_pdev_handle htt_pdev, cdf_nbuf_t frames) void ol_rx_frames_free(htt_pdev_handle htt_pdev, qdf_nbuf_t frames)
{ {
cdf_nbuf_t next, frag = frames; qdf_nbuf_t next, frag = frames;
while (frag) { while (frag) {
next = cdf_nbuf_next(frag); next = qdf_nbuf_next(frag);
htt_rx_desc_frame_free(htt_pdev, frag); htt_rx_desc_frame_free(htt_pdev, frag);
frag = next; frag = next;
} }
@@ -1227,7 +1227,7 @@ void ol_rx_frames_free(htt_pdev_handle htt_pdev, cdf_nbuf_t frames)
void void
ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev, ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t rx_ind_msg, qdf_nbuf_t rx_ind_msg,
uint16_t peer_id, uint16_t peer_id,
uint8_t tid, uint8_t is_offload) uint8_t tid, uint8_t is_offload)
{ {
@@ -1235,7 +1235,7 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
struct ol_txrx_peer_t *peer = NULL; struct ol_txrx_peer_t *peer = NULL;
htt_pdev_handle htt_pdev = NULL; htt_pdev_handle htt_pdev = NULL;
int status; int status;
cdf_nbuf_t head_msdu, tail_msdu = NULL; qdf_nbuf_t head_msdu, tail_msdu = NULL;
if (pdev) { if (pdev) {
peer = ol_txrx_peer_find_by_id(pdev, peer_id); peer = ol_txrx_peer_find_by_id(pdev, peer_id);
@@ -1271,7 +1271,7 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
/* Send the chain of MSDUs to the OS */ /* Send the chain of MSDUs to the OS */
/* rx_opt_proc takes a NULL-terminated list of msdu netbufs */ /* rx_opt_proc takes a NULL-terminated list of msdu netbufs */
cdf_nbuf_set_next(tail_msdu, NULL); qdf_nbuf_set_next(tail_msdu, NULL);
/* Pktlog */ /* Pktlog */
#ifdef WDI_EVENT_ENABLE #ifdef WDI_EVENT_ENABLE
@@ -1287,8 +1287,8 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
"%s: Couldn't find peer from ID 0x%x\n", "%s: Couldn't find peer from ID 0x%x\n",
__func__, peer_id); __func__, peer_id);
while (head_msdu) { while (head_msdu) {
cdf_nbuf_t msdu = head_msdu; qdf_nbuf_t msdu = head_msdu;
head_msdu = cdf_nbuf_next(head_msdu); head_msdu = qdf_nbuf_next(head_msdu);
htt_rx_desc_frame_free(htt_pdev, msdu); htt_rx_desc_frame_free(htt_pdev, msdu);
} }
return; return;
@@ -1301,9 +1301,9 @@ ol_rx_in_order_indication_handler(ol_txrx_pdev_handle pdev,
void void
ol_rx_in_order_deliver(struct ol_txrx_vdev_t *vdev, ol_rx_in_order_deliver(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list) unsigned tid, qdf_nbuf_t msdu_list)
{ {
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
msdu = msdu_list; msdu = msdu_list;
/* /*
@@ -1314,7 +1314,7 @@ ol_rx_in_order_deliver(struct ol_txrx_vdev_t *vdev,
*/ */
while (msdu) { while (msdu) {
cdf_nbuf_t next = cdf_nbuf_next(msdu); qdf_nbuf_t next = qdf_nbuf_next(msdu);
OL_RX_PEER_STATS_UPDATE(peer, msdu); OL_RX_PEER_STATS_UPDATE(peer, msdu);
OL_RX_ERR_STATISTICS_1(vdev->pdev, vdev, peer, rx_desc, OL_RX_ERR_STATISTICS_1(vdev->pdev, vdev, peer, rx_desc,
@@ -1338,7 +1338,7 @@ ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev,
uint32_t *msg_word) uint32_t *msg_word)
{ {
int vdev_id, peer_id, tid; int vdev_id, peer_id, tid;
cdf_nbuf_t head_buf, tail_buf, buf; qdf_nbuf_t head_buf, tail_buf, buf;
struct ol_txrx_peer_t *peer; struct ol_txrx_peer_t *peer;
uint8_t fw_desc; uint8_t fw_desc;
int msdu_iter = 0; int msdu_iter = 0;
@@ -1355,8 +1355,8 @@ ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev,
} else { } else {
buf = head_buf; buf = head_buf;
while (1) { while (1) {
cdf_nbuf_t next; qdf_nbuf_t next;
next = cdf_nbuf_next(buf); next = qdf_nbuf_next(buf);
htt_rx_desc_frame_free(htt_pdev, buf); htt_rx_desc_frame_free(htt_pdev, buf);
if (buf == tail_buf) if (buf == tail_buf)
break; break;
@@ -1376,7 +1376,7 @@ ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev,
* @param msdu - network buffer handle * @param msdu - network buffer handle
* @param pdev - handle to htt dev. * @param pdev - handle to htt dev.
*/ */
void ol_ath_add_vow_extstats(htt_pdev_handle pdev, cdf_nbuf_t msdu) void ol_ath_add_vow_extstats(htt_pdev_handle pdev, qdf_nbuf_t msdu)
{ {
/* FIX THIS: /* FIX THIS:
* txrx should not be directly using data types (scn) * txrx should not be directly using data types (scn)
@@ -1393,7 +1393,7 @@ void ol_ath_add_vow_extstats(htt_pdev_handle pdev, cdf_nbuf_t msdu)
int offset; int offset;
struct vow_extstats vowstats; struct vow_extstats vowstats;
data = cdf_nbuf_data(msdu); data = qdf_nbuf_data(msdu);
offset = ETHERNET_ADDR_LEN * 2; offset = ETHERNET_ADDR_LEN * 2;
l3_hdr = data + ETHERNET_HDR_LEN; l3_hdr = data + ETHERNET_HDR_LEN;

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014-2015 The Linux Foundation. All rights reserved. * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -28,18 +28,18 @@
#ifndef _OL_RX__H_ #ifndef _OL_RX__H_
#define _OL_RX__H_ #define _OL_RX__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */ #include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */
void void
ol_rx_deliver(struct ol_txrx_vdev_t *vdev, ol_rx_deliver(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t head_msdu); struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t head_msdu);
void void
ol_rx_discard(struct ol_txrx_vdev_t *vdev, ol_rx_discard(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t head_msdu); struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t head_msdu);
void ol_rx_frames_free(htt_pdev_handle htt_pdev, cdf_nbuf_t frames); void ol_rx_frames_free(htt_pdev_handle htt_pdev, qdf_nbuf_t frames);
void ol_rx_peer_init(struct ol_txrx_pdev_t *pdev, struct ol_txrx_peer_t *peer); void ol_rx_peer_init(struct ol_txrx_pdev_t *pdev, struct ol_txrx_peer_t *peer);
@@ -49,7 +49,7 @@ ol_rx_peer_cleanup(struct ol_txrx_vdev_t *vdev, struct ol_txrx_peer_t *peer);
void void
ol_rx_in_order_deliver(struct ol_txrx_vdev_t *vdev, ol_rx_in_order_deliver(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t head_msdu); unsigned tid, qdf_nbuf_t head_msdu);
void void
ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev, ol_rx_offload_paddr_deliver_ind_handler(htt_pdev_handle htt_pdev,
@@ -62,6 +62,6 @@ ol_rx_mic_error_handler(
u_int8_t tid, u_int8_t tid,
u_int16_t peer_id, u_int16_t peer_id,
void *msdu_desc, void *msdu_desc,
cdf_nbuf_t msdu); qdf_nbuf_t msdu);
#endif /* _OL_RX__H_ */ #endif /* _OL_RX__H_ */

Переглянути файл

@@ -61,7 +61,7 @@
#include <ol_txrx_internal.h> #include <ol_txrx_internal.h>
#include <ol_ctrl_txrx_api.h> #include <ol_ctrl_txrx_api.h>
#include <ol_txrx_peer_find.h> #include <ol_txrx_peer_find.h>
#include <cdf_nbuf.h> #include <qdf_nbuf.h>
#include <ieee80211.h> #include <ieee80211.h>
#include <qdf_util.h> #include <qdf_util.h>
#include <athdefs.h> #include <athdefs.h>
@@ -107,18 +107,18 @@ const struct ol_rx_defrag_cipher f_wep = {
inline struct ieee80211_frame *ol_rx_frag_get_mac_hdr( inline struct ieee80211_frame *ol_rx_frag_get_mac_hdr(
htt_pdev_handle htt_pdev, htt_pdev_handle htt_pdev,
cdf_nbuf_t frag) qdf_nbuf_t frag)
{ {
return return
(struct ieee80211_frame *) cdf_nbuf_data(frag); (struct ieee80211_frame *) qdf_nbuf_data(frag);
} }
#define ol_rx_frag_pull_hdr(pdev, frag, hdrsize) \ #define ol_rx_frag_pull_hdr(pdev, frag, hdrsize) \
cdf_nbuf_pull_head(frag, hdrsize); qdf_nbuf_pull_head(frag, hdrsize);
#define OL_RX_FRAG_CLONE(frag) NULL /* no-op */ #define OL_RX_FRAG_CLONE(frag) NULL /* no-op */
static inline void static inline void
ol_rx_frag_desc_adjust(ol_txrx_pdev_handle pdev, ol_rx_frag_desc_adjust(ol_txrx_pdev_handle pdev,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
void **rx_desc_old_position, void **rx_desc_old_position,
void **ind_old_position, int *rx_desc_len) void **ind_old_position, int *rx_desc_len)
{ {
@@ -132,14 +132,14 @@ ol_rx_frag_desc_adjust(ol_txrx_pdev_handle pdev,
*/ */
void void
ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev, ol_rx_frag_indication_handler(ol_txrx_pdev_handle pdev,
cdf_nbuf_t rx_frag_ind_msg, qdf_nbuf_t rx_frag_ind_msg,
uint16_t peer_id, uint8_t tid) uint16_t peer_id, uint8_t tid)
{ {
uint16_t seq_num; uint16_t seq_num;
int seq_num_start, seq_num_end; int seq_num_start, seq_num_end;
struct ol_txrx_peer_t *peer; struct ol_txrx_peer_t *peer;
htt_pdev_handle htt_pdev; htt_pdev_handle htt_pdev;
cdf_nbuf_t head_msdu, tail_msdu; qdf_nbuf_t head_msdu, tail_msdu;
void *rx_mpdu_desc; void *rx_mpdu_desc;
htt_pdev = pdev->htt_pdev; htt_pdev = pdev->htt_pdev;
@@ -213,7 +213,7 @@ ol_rx_reorder_flush_frag(htt_pdev_handle htt_pdev,
void void
ol_rx_reorder_store_frag(ol_txrx_pdev_handle pdev, ol_rx_reorder_store_frag(ol_txrx_pdev_handle pdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, uint16_t seq_num, cdf_nbuf_t frag) unsigned tid, uint16_t seq_num, qdf_nbuf_t frag)
{ {
struct ieee80211_frame *fmac_hdr, *mac_hdr; struct ieee80211_frame *fmac_hdr, *mac_hdr;
uint8_t fragno, more_frag, all_frag_present = 0; uint8_t fragno, more_frag, all_frag_present = 0;
@@ -236,7 +236,7 @@ ol_rx_reorder_store_frag(ol_txrx_pdev_handle pdev,
if ((!more_frag) && (!fragno) && (!rx_reorder_array_elem->head)) { if ((!more_frag) && (!fragno) && (!rx_reorder_array_elem->head)) {
rx_reorder_array_elem->head = frag; rx_reorder_array_elem->head = frag;
rx_reorder_array_elem->tail = frag; rx_reorder_array_elem->tail = frag;
cdf_nbuf_set_next(frag, NULL); qdf_nbuf_set_next(frag, NULL);
ol_rx_defrag(pdev, peer, tid, rx_reorder_array_elem->head); ol_rx_defrag(pdev, peer, tid, rx_reorder_array_elem->head);
rx_reorder_array_elem->head = NULL; rx_reorder_array_elem->head = NULL;
rx_reorder_array_elem->tail = NULL; rx_reorder_array_elem->tail = NULL;
@@ -292,15 +292,15 @@ ol_rx_reorder_store_frag(ol_txrx_pdev_handle pdev,
*/ */
void void
ol_rx_fraglist_insert(htt_pdev_handle htt_pdev, ol_rx_fraglist_insert(htt_pdev_handle htt_pdev,
cdf_nbuf_t *head_addr, qdf_nbuf_t *head_addr,
cdf_nbuf_t *tail_addr, qdf_nbuf_t *tail_addr,
cdf_nbuf_t frag, uint8_t *all_frag_present) qdf_nbuf_t frag, uint8_t *all_frag_present)
{ {
cdf_nbuf_t next, prev = NULL, cur = *head_addr; qdf_nbuf_t next, prev = NULL, cur = *head_addr;
struct ieee80211_frame *mac_hdr, *cmac_hdr, *next_hdr, *lmac_hdr; struct ieee80211_frame *mac_hdr, *cmac_hdr, *next_hdr, *lmac_hdr;
uint8_t fragno, cur_fragno, lfragno, next_fragno; uint8_t fragno, cur_fragno, lfragno, next_fragno;
uint8_t last_morefrag = 1, count = 0; uint8_t last_morefrag = 1, count = 0;
cdf_nbuf_t frag_clone; qdf_nbuf_t frag_clone;
qdf_assert(frag); qdf_assert(frag);
frag_clone = OL_RX_FRAG_CLONE(frag); frag_clone = OL_RX_FRAG_CLONE(frag);
@@ -314,7 +314,7 @@ ol_rx_fraglist_insert(htt_pdev_handle htt_pdev,
if (!(*head_addr)) { if (!(*head_addr)) {
*head_addr = frag; *head_addr = frag;
*tail_addr = frag; *tail_addr = frag;
cdf_nbuf_set_next(*tail_addr, NULL); qdf_nbuf_set_next(*tail_addr, NULL);
return; return;
} }
/* For efficiency, compare with tail first */ /* For efficiency, compare with tail first */
@@ -323,9 +323,9 @@ ol_rx_fraglist_insert(htt_pdev_handle htt_pdev,
lfragno = qdf_le16_to_cpu(*(uint16_t *) lmac_hdr->i_seq) & lfragno = qdf_le16_to_cpu(*(uint16_t *) lmac_hdr->i_seq) &
IEEE80211_SEQ_FRAG_MASK; IEEE80211_SEQ_FRAG_MASK;
if (fragno > lfragno) { if (fragno > lfragno) {
cdf_nbuf_set_next(*tail_addr, frag); qdf_nbuf_set_next(*tail_addr, frag);
*tail_addr = frag; *tail_addr = frag;
cdf_nbuf_set_next(*tail_addr, NULL); qdf_nbuf_set_next(*tail_addr, NULL);
} else { } else {
do { do {
cmac_hdr = (struct ieee80211_frame *) cmac_hdr = (struct ieee80211_frame *)
@@ -334,7 +334,7 @@ ol_rx_fraglist_insert(htt_pdev_handle htt_pdev,
qdf_le16_to_cpu(*(uint16_t *) cmac_hdr->i_seq) & qdf_le16_to_cpu(*(uint16_t *) cmac_hdr->i_seq) &
IEEE80211_SEQ_FRAG_MASK; IEEE80211_SEQ_FRAG_MASK;
prev = cur; prev = cur;
cur = cdf_nbuf_next(cur); cur = qdf_nbuf_next(cur);
} while (fragno > cur_fragno); } while (fragno > cur_fragno);
if (fragno == cur_fragno) { if (fragno == cur_fragno) {
@@ -342,11 +342,11 @@ ol_rx_fraglist_insert(htt_pdev_handle htt_pdev,
*all_frag_present = 0; *all_frag_present = 0;
return; return;
} else { } else {
cdf_nbuf_set_next(prev, frag); qdf_nbuf_set_next(prev, frag);
cdf_nbuf_set_next(frag, cur); qdf_nbuf_set_next(frag, cur);
} }
} }
next = cdf_nbuf_next(*head_addr); next = qdf_nbuf_next(*head_addr);
lmac_hdr = (struct ieee80211_frame *)ol_rx_frag_get_mac_hdr(htt_pdev, lmac_hdr = (struct ieee80211_frame *)ol_rx_frag_get_mac_hdr(htt_pdev,
*tail_addr); *tail_addr);
last_morefrag = lmac_hdr->i_fc[1] & IEEE80211_FC1_MORE_FRAG; last_morefrag = lmac_hdr->i_fc[1] & IEEE80211_FC1_MORE_FRAG;
@@ -362,7 +362,7 @@ ol_rx_fraglist_insert(htt_pdev_handle htt_pdev,
if (next_fragno != count) if (next_fragno != count)
break; break;
next = cdf_nbuf_next(next); next = qdf_nbuf_next(next);
} while (next); } while (next);
if (!next) { if (!next) {
@@ -448,10 +448,10 @@ void ol_rx_defrag_waitlist_flush(struct ol_txrx_pdev_t *pdev)
*/ */
void void
ol_rx_defrag(ol_txrx_pdev_handle pdev, ol_rx_defrag(ol_txrx_pdev_handle pdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t frag_list) struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t frag_list)
{ {
struct ol_txrx_vdev_t *vdev = NULL; struct ol_txrx_vdev_t *vdev = NULL;
cdf_nbuf_t tmp_next, msdu, prev = NULL, cur = frag_list; qdf_nbuf_t tmp_next, msdu, prev = NULL, cur = frag_list;
uint8_t index, tkip_demic = 0; uint8_t index, tkip_demic = 0;
uint16_t hdr_space; uint16_t hdr_space;
void *rx_desc; void *rx_desc;
@@ -471,12 +471,12 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
} }
while (cur) { while (cur) {
tmp_next = cdf_nbuf_next(cur); tmp_next = qdf_nbuf_next(cur);
cdf_nbuf_set_next(cur, NULL); qdf_nbuf_set_next(cur, NULL);
if (!ol_rx_pn_check_base(vdev, peer, tid, cur)) { if (!ol_rx_pn_check_base(vdev, peer, tid, cur)) {
/* PN check failed,discard frags */ /* PN check failed,discard frags */
if (prev) { if (prev) {
cdf_nbuf_set_next(prev, NULL); qdf_nbuf_set_next(prev, NULL);
ol_rx_frames_free(htt_pdev, frag_list); ol_rx_frames_free(htt_pdev, frag_list);
} }
ol_rx_frames_free(htt_pdev, tmp_next); ol_rx_frames_free(htt_pdev, tmp_next);
@@ -485,9 +485,9 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
return; return;
} }
/* remove FCS from each fragment */ /* remove FCS from each fragment */
cdf_nbuf_trim_tail(cur, DEFRAG_IEEE80211_FCS_LEN); qdf_nbuf_trim_tail(cur, DEFRAG_IEEE80211_FCS_LEN);
prev = cur; prev = cur;
cdf_nbuf_set_next(cur, tmp_next); qdf_nbuf_set_next(cur, tmp_next);
cur = tmp_next; cur = tmp_next;
} }
cur = frag_list; cur = frag_list;
@@ -504,7 +504,7 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
/* fall-through to rest of tkip ops */ /* fall-through to rest of tkip ops */
case htt_sec_type_tkip_nomic: case htt_sec_type_tkip_nomic:
while (cur) { while (cur) {
tmp_next = cdf_nbuf_next(cur); tmp_next = qdf_nbuf_next(cur);
if (!ol_rx_frag_tkip_decap(pdev, cur, hdr_space)) { if (!ol_rx_frag_tkip_decap(pdev, cur, hdr_space)) {
/* TKIP decap failed, discard frags */ /* TKIP decap failed, discard frags */
ol_rx_frames_free(htt_pdev, frag_list); ol_rx_frames_free(htt_pdev, frag_list);
@@ -518,7 +518,7 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
case htt_sec_type_aes_ccmp: case htt_sec_type_aes_ccmp:
while (cur) { while (cur) {
tmp_next = cdf_nbuf_next(cur); tmp_next = qdf_nbuf_next(cur);
if (!ol_rx_frag_ccmp_demic(pdev, cur, hdr_space)) { if (!ol_rx_frag_ccmp_demic(pdev, cur, hdr_space)) {
/* CCMP demic failed, discard frags */ /* CCMP demic failed, discard frags */
ol_rx_frames_free(htt_pdev, frag_list); ol_rx_frames_free(htt_pdev, frag_list);
@@ -541,7 +541,7 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
case htt_sec_type_wep104: case htt_sec_type_wep104:
case htt_sec_type_wep128: case htt_sec_type_wep128:
while (cur) { while (cur) {
tmp_next = cdf_nbuf_next(cur); tmp_next = qdf_nbuf_next(cur);
if (!ol_rx_frag_wep_decap(pdev, cur, hdr_space)) { if (!ol_rx_frag_wep_decap(pdev, cur, hdr_space)) {
/* wep decap failed, discard frags */ /* wep decap failed, discard frags */
ol_rx_frames_free(htt_pdev, frag_list); ol_rx_frames_free(htt_pdev, frag_list);
@@ -589,7 +589,7 @@ ol_rx_defrag(ol_txrx_pdev_handle pdev,
*/ */
int int
ol_rx_frag_tkip_decap(ol_txrx_pdev_handle pdev, ol_rx_frag_tkip_decap(ol_txrx_pdev_handle pdev,
cdf_nbuf_t msdu, uint16_t hdrlen) qdf_nbuf_t msdu, uint16_t hdrlen)
{ {
uint8_t *ivp, *origHdr; uint8_t *ivp, *origHdr;
@@ -602,15 +602,15 @@ ol_rx_frag_tkip_decap(ol_txrx_pdev_handle pdev,
&rx_desc_old_position, &rx_desc_old_position,
&ind_old_position, &rx_desc_len); &ind_old_position, &rx_desc_len);
/* Header should have extended IV */ /* Header should have extended IV */
origHdr = (uint8_t *) (cdf_nbuf_data(msdu) + rx_desc_len); origHdr = (uint8_t *) (qdf_nbuf_data(msdu) + rx_desc_len);
ivp = origHdr + hdrlen; ivp = origHdr + hdrlen;
if (!(ivp[IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV)) if (!(ivp[IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV))
return OL_RX_DEFRAG_ERR; return OL_RX_DEFRAG_ERR;
qdf_mem_move(origHdr + f_tkip.ic_header, origHdr, hdrlen); qdf_mem_move(origHdr + f_tkip.ic_header, origHdr, hdrlen);
cdf_nbuf_pull_head(msdu, f_tkip.ic_header); qdf_nbuf_pull_head(msdu, f_tkip.ic_header);
cdf_nbuf_trim_tail(msdu, f_tkip.ic_trailer); qdf_nbuf_trim_tail(msdu, f_tkip.ic_trailer);
return OL_RX_DEFRAG_OK; return OL_RX_DEFRAG_OK;
} }
@@ -618,7 +618,7 @@ ol_rx_frag_tkip_decap(ol_txrx_pdev_handle pdev,
* Handling WEP processing for defragmentation * Handling WEP processing for defragmentation
*/ */
int int
ol_rx_frag_wep_decap(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t hdrlen) ol_rx_frag_wep_decap(ol_txrx_pdev_handle pdev, qdf_nbuf_t msdu, uint16_t hdrlen)
{ {
uint8_t *origHdr; uint8_t *origHdr;
void *rx_desc_old_position = NULL; void *rx_desc_old_position = NULL;
@@ -629,10 +629,10 @@ ol_rx_frag_wep_decap(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t hdrlen)
msdu, msdu,
&rx_desc_old_position, &rx_desc_old_position,
&ind_old_position, &rx_desc_len); &ind_old_position, &rx_desc_len);
origHdr = (uint8_t *) (cdf_nbuf_data(msdu) + rx_desc_len); origHdr = (uint8_t *) (qdf_nbuf_data(msdu) + rx_desc_len);
qdf_mem_move(origHdr + f_wep.ic_header, origHdr, hdrlen); qdf_mem_move(origHdr + f_wep.ic_header, origHdr, hdrlen);
cdf_nbuf_pull_head(msdu, f_wep.ic_header); qdf_nbuf_pull_head(msdu, f_wep.ic_header);
cdf_nbuf_trim_tail(msdu, f_wep.ic_trailer); qdf_nbuf_trim_tail(msdu, f_wep.ic_trailer);
return OL_RX_DEFRAG_OK; return OL_RX_DEFRAG_OK;
} }
@@ -641,7 +641,7 @@ ol_rx_frag_wep_decap(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu, uint16_t hdrlen)
*/ */
int int
ol_rx_frag_tkip_demic(ol_txrx_pdev_handle pdev, const uint8_t *key, ol_rx_frag_tkip_demic(ol_txrx_pdev_handle pdev, const uint8_t *key,
cdf_nbuf_t msdu, uint16_t hdrlen) qdf_nbuf_t msdu, uint16_t hdrlen)
{ {
int status; int status;
uint32_t pktlen; uint32_t pktlen;
@@ -668,7 +668,7 @@ ol_rx_frag_tkip_demic(ol_txrx_pdev_handle pdev, const uint8_t *key,
if (!qdf_mem_cmp(mic, mic0, f_tkip.ic_miclen)) if (!qdf_mem_cmp(mic, mic0, f_tkip.ic_miclen))
return OL_RX_DEFRAG_ERR; return OL_RX_DEFRAG_ERR;
cdf_nbuf_trim_tail(msdu, f_tkip.ic_miclen); qdf_nbuf_trim_tail(msdu, f_tkip.ic_miclen);
return OL_RX_DEFRAG_OK; return OL_RX_DEFRAG_OK;
} }
@@ -677,7 +677,7 @@ ol_rx_frag_tkip_demic(ol_txrx_pdev_handle pdev, const uint8_t *key,
*/ */
int int
ol_rx_frag_ccmp_decap(ol_txrx_pdev_handle pdev, ol_rx_frag_ccmp_decap(ol_txrx_pdev_handle pdev,
cdf_nbuf_t nbuf, uint16_t hdrlen) qdf_nbuf_t nbuf, uint16_t hdrlen)
{ {
uint8_t *ivp, *origHdr; uint8_t *ivp, *origHdr;
void *rx_desc_old_position = NULL; void *rx_desc_old_position = NULL;
@@ -689,13 +689,13 @@ ol_rx_frag_ccmp_decap(ol_txrx_pdev_handle pdev,
&rx_desc_old_position, &rx_desc_old_position,
&ind_old_position, &rx_desc_len); &ind_old_position, &rx_desc_len);
origHdr = (uint8_t *) (cdf_nbuf_data(nbuf) + rx_desc_len); origHdr = (uint8_t *) (qdf_nbuf_data(nbuf) + rx_desc_len);
ivp = origHdr + hdrlen; ivp = origHdr + hdrlen;
if (!(ivp[IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV)) if (!(ivp[IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV))
return OL_RX_DEFRAG_ERR; return OL_RX_DEFRAG_ERR;
qdf_mem_move(origHdr + f_ccmp.ic_header, origHdr, hdrlen); qdf_mem_move(origHdr + f_ccmp.ic_header, origHdr, hdrlen);
cdf_nbuf_pull_head(nbuf, f_ccmp.ic_header); qdf_nbuf_pull_head(nbuf, f_ccmp.ic_header);
return OL_RX_DEFRAG_OK; return OL_RX_DEFRAG_OK;
} }
@@ -705,7 +705,7 @@ ol_rx_frag_ccmp_decap(ol_txrx_pdev_handle pdev,
*/ */
int int
ol_rx_frag_ccmp_demic(ol_txrx_pdev_handle pdev, ol_rx_frag_ccmp_demic(ol_txrx_pdev_handle pdev,
cdf_nbuf_t wbuf, uint16_t hdrlen) qdf_nbuf_t wbuf, uint16_t hdrlen)
{ {
uint8_t *ivp, *origHdr; uint8_t *ivp, *origHdr;
void *rx_desc_old_position = NULL; void *rx_desc_old_position = NULL;
@@ -717,13 +717,13 @@ ol_rx_frag_ccmp_demic(ol_txrx_pdev_handle pdev,
&rx_desc_old_position, &rx_desc_old_position,
&ind_old_position, &rx_desc_len); &ind_old_position, &rx_desc_len);
origHdr = (uint8_t *) (cdf_nbuf_data(wbuf) + rx_desc_len); origHdr = (uint8_t *) (qdf_nbuf_data(wbuf) + rx_desc_len);
ivp = origHdr + hdrlen; ivp = origHdr + hdrlen;
if (!(ivp[IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV)) if (!(ivp[IEEE80211_WEP_IVLEN] & IEEE80211_WEP_EXTIV))
return OL_RX_DEFRAG_ERR; return OL_RX_DEFRAG_ERR;
cdf_nbuf_trim_tail(wbuf, f_ccmp.ic_trailer); qdf_nbuf_trim_tail(wbuf, f_ccmp.ic_trailer);
return OL_RX_DEFRAG_OK; return OL_RX_DEFRAG_OK;
} }
@@ -779,7 +779,7 @@ void ol_rx_defrag_michdr(const struct ieee80211_frame *wh0, uint8_t hdr[])
int int
ol_rx_defrag_mic(ol_txrx_pdev_handle pdev, ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
const uint8_t *key, const uint8_t *key,
cdf_nbuf_t wbuf, qdf_nbuf_t wbuf,
uint16_t off, uint16_t data_len, uint8_t mic[]) uint16_t off, uint16_t data_len, uint8_t mic[])
{ {
uint8_t hdr[16] = { 0, }; uint8_t hdr[16] = { 0, };
@@ -795,7 +795,7 @@ ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
&rx_desc_old_position, &rx_desc_old_position,
&ind_old_position, &rx_desc_len); &ind_old_position, &rx_desc_len);
ol_rx_defrag_michdr((struct ieee80211_frame *)(cdf_nbuf_data(wbuf) + ol_rx_defrag_michdr((struct ieee80211_frame *)(qdf_nbuf_data(wbuf) +
rx_desc_len), hdr); rx_desc_len), hdr);
l = get_le32(key); l = get_le32(key);
r = get_le32(key + 4); r = get_le32(key + 4);
@@ -811,7 +811,7 @@ ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
michael_block(l, r); michael_block(l, r);
/* first buffer has special handling */ /* first buffer has special handling */
data = (uint8_t *) cdf_nbuf_data(wbuf) + rx_desc_len + off; data = (uint8_t *) qdf_nbuf_data(wbuf) + rx_desc_len + off;
space = ol_rx_defrag_len(wbuf) - rx_desc_len - off; space = ol_rx_defrag_len(wbuf) - rx_desc_len - off;
for (;; ) { for (;; ) {
if (space > data_len) if (space > data_len)
@@ -828,7 +828,7 @@ ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
if (data_len < sizeof(uint32_t)) if (data_len < sizeof(uint32_t))
break; break;
wbuf = cdf_nbuf_next(wbuf); wbuf = qdf_nbuf_next(wbuf);
if (wbuf == NULL) if (wbuf == NULL)
return OL_RX_DEFRAG_ERR; return OL_RX_DEFRAG_ERR;
@@ -840,7 +840,7 @@ ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
* Block straddles buffers, split references. * Block straddles buffers, split references.
*/ */
data_next = data_next =
(uint8_t *) cdf_nbuf_data(wbuf) + rx_desc_len; (uint8_t *) qdf_nbuf_data(wbuf) + rx_desc_len;
if ((ol_rx_defrag_len(wbuf) - rx_desc_len) < if ((ol_rx_defrag_len(wbuf) - rx_desc_len) <
sizeof(uint32_t) - space) { sizeof(uint32_t) - space) {
return OL_RX_DEFRAG_ERR; return OL_RX_DEFRAG_ERR;
@@ -874,7 +874,7 @@ ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
/* /*
* Setup for next buffer. * Setup for next buffer.
*/ */
data = (uint8_t *) cdf_nbuf_data(wbuf) + rx_desc_len; data = (uint8_t *) qdf_nbuf_data(wbuf) + rx_desc_len;
space = ol_rx_defrag_len(wbuf) - rx_desc_len; space = ol_rx_defrag_len(wbuf) - rx_desc_len;
} }
} }
@@ -923,26 +923,26 @@ uint16_t ol_rx_frag_hdrsize(const void *data)
/* /*
* Recombine and decap fragments * Recombine and decap fragments
*/ */
cdf_nbuf_t qdf_nbuf_t
ol_rx_defrag_decap_recombine(htt_pdev_handle htt_pdev, ol_rx_defrag_decap_recombine(htt_pdev_handle htt_pdev,
cdf_nbuf_t frag_list, uint16_t hdrsize) qdf_nbuf_t frag_list, uint16_t hdrsize)
{ {
cdf_nbuf_t tmp; qdf_nbuf_t tmp;
cdf_nbuf_t msdu = frag_list; qdf_nbuf_t msdu = frag_list;
cdf_nbuf_t rx_nbuf = frag_list; qdf_nbuf_t rx_nbuf = frag_list;
struct ieee80211_frame *wh; struct ieee80211_frame *wh;
msdu = cdf_nbuf_next(msdu); msdu = qdf_nbuf_next(msdu);
cdf_nbuf_set_next(rx_nbuf, NULL); qdf_nbuf_set_next(rx_nbuf, NULL);
while (msdu) { while (msdu) {
htt_rx_msdu_desc_free(htt_pdev, msdu); htt_rx_msdu_desc_free(htt_pdev, msdu);
tmp = cdf_nbuf_next(msdu); tmp = qdf_nbuf_next(msdu);
cdf_nbuf_set_next(msdu, NULL); qdf_nbuf_set_next(msdu, NULL);
ol_rx_frag_pull_hdr(htt_pdev, msdu, hdrsize); ol_rx_frag_pull_hdr(htt_pdev, msdu, hdrsize);
if (!ol_rx_defrag_concat(rx_nbuf, msdu)) { if (!ol_rx_defrag_concat(rx_nbuf, msdu)) {
ol_rx_frames_free(htt_pdev, tmp); ol_rx_frames_free(htt_pdev, tmp);
htt_rx_desc_frame_free(htt_pdev, rx_nbuf); htt_rx_desc_frame_free(htt_pdev, rx_nbuf);
cdf_nbuf_free(msdu); qdf_nbuf_free(msdu);
/* msdu rx desc already freed above */ /* msdu rx desc already freed above */
return NULL; return NULL;
} }
@@ -956,7 +956,7 @@ ol_rx_defrag_decap_recombine(htt_pdev_handle htt_pdev,
return rx_nbuf; return rx_nbuf;
} }
void ol_rx_defrag_nwifi_to_8023(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu) void ol_rx_defrag_nwifi_to_8023(ol_txrx_pdev_handle pdev, qdf_nbuf_t msdu)
{ {
struct ieee80211_frame wh; struct ieee80211_frame wh;
uint32_t hdrsize; uint32_t hdrsize;
@@ -972,10 +972,10 @@ void ol_rx_defrag_nwifi_to_8023(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu)
&rx_desc_old_position, &rx_desc_old_position,
&ind_old_position, &rx_desc_len); &ind_old_position, &rx_desc_len);
wh_ptr = (struct ieee80211_frame *)(cdf_nbuf_data(msdu) + rx_desc_len); wh_ptr = (struct ieee80211_frame *)(qdf_nbuf_data(msdu) + rx_desc_len);
qdf_mem_copy(&wh, wh_ptr, sizeof(wh)); qdf_mem_copy(&wh, wh_ptr, sizeof(wh));
hdrsize = sizeof(struct ieee80211_frame); hdrsize = sizeof(struct ieee80211_frame);
qdf_mem_copy(&llchdr, ((uint8_t *) (cdf_nbuf_data(msdu) + qdf_mem_copy(&llchdr, ((uint8_t *) (qdf_nbuf_data(msdu) +
rx_desc_len)) + hdrsize, rx_desc_len)) + hdrsize,
sizeof(struct llc_snap_hdr_t)); sizeof(struct llc_snap_hdr_t));
@@ -983,10 +983,10 @@ void ol_rx_defrag_nwifi_to_8023(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu)
* Now move the data pointer to the beginning of the mac header : * Now move the data pointer to the beginning of the mac header :
* new-header = old-hdr + (wifhdrsize + llchdrsize - ethhdrsize) * new-header = old-hdr + (wifhdrsize + llchdrsize - ethhdrsize)
*/ */
cdf_nbuf_pull_head(msdu, (rx_desc_len + hdrsize + qdf_nbuf_pull_head(msdu, (rx_desc_len + hdrsize +
sizeof(struct llc_snap_hdr_t) - sizeof(struct llc_snap_hdr_t) -
sizeof(struct ethernet_hdr_t))); sizeof(struct ethernet_hdr_t)));
eth_hdr = (struct ethernet_hdr_t *)(cdf_nbuf_data(msdu)); eth_hdr = (struct ethernet_hdr_t *)(qdf_nbuf_data(msdu));
switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) { switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) {
case IEEE80211_FC1_DIR_NODS: case IEEE80211_FC1_DIR_NODS:
qdf_mem_copy(eth_hdr->dest_addr, wh.i_addr1, qdf_mem_copy(eth_hdr->dest_addr, wh.i_addr1,
@@ -1016,7 +1016,7 @@ void ol_rx_defrag_nwifi_to_8023(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu)
*/ */
void void
ol_rx_defrag_qos_decap(ol_txrx_pdev_handle pdev, ol_rx_defrag_qos_decap(ol_txrx_pdev_handle pdev,
cdf_nbuf_t nbuf, uint16_t hdrlen) qdf_nbuf_t nbuf, uint16_t hdrlen)
{ {
struct ieee80211_frame *wh; struct ieee80211_frame *wh;
uint16_t qoslen; uint16_t qoslen;
@@ -1029,7 +1029,7 @@ ol_rx_defrag_qos_decap(ol_txrx_pdev_handle pdev,
&rx_desc_old_position, &rx_desc_old_position,
&ind_old_position, &rx_desc_len); &ind_old_position, &rx_desc_len);
wh = (struct ieee80211_frame *)(cdf_nbuf_data(nbuf) + rx_desc_len); wh = (struct ieee80211_frame *)(qdf_nbuf_data(nbuf) + rx_desc_len);
if (DEFRAG_IEEE80211_QOS_HAS_SEQ(wh)) { if (DEFRAG_IEEE80211_QOS_HAS_SEQ(wh)) {
qoslen = sizeof(struct ieee80211_qoscntl); qoslen = sizeof(struct ieee80211_qoscntl);
/* Qos frame with Order bit set indicates a HTC frame */ /* Qos frame with Order bit set indicates a HTC frame */
@@ -1039,19 +1039,19 @@ ol_rx_defrag_qos_decap(ol_txrx_pdev_handle pdev,
/* remove QoS filed from header */ /* remove QoS filed from header */
hdrlen -= qoslen; hdrlen -= qoslen;
qdf_mem_move((uint8_t *) wh + qoslen, wh, hdrlen); qdf_mem_move((uint8_t *) wh + qoslen, wh, hdrlen);
wh = (struct ieee80211_frame *)cdf_nbuf_pull_head(nbuf, wh = (struct ieee80211_frame *)qdf_nbuf_pull_head(nbuf,
rx_desc_len + rx_desc_len +
qoslen); qoslen);
/* clear QoS bit */ /* clear QoS bit */
/* /*
* KW# 6154 'cdf_nbuf_pull_head' in turn calls * KW# 6154 'qdf_nbuf_pull_head' in turn calls
* __cdf_nbuf_pull_head, * __qdf_nbuf_pull_head,
* which returns NULL if there is not sufficient data to pull. * which returns NULL if there is not sufficient data to pull.
* It's guaranteed that cdf_nbuf_pull_head will succeed rather * It's guaranteed that qdf_nbuf_pull_head will succeed rather
* than returning NULL, since the entire rx frame is already * than returning NULL, since the entire rx frame is already
* present in the rx buffer. * present in the rx buffer.
* However, to make it obvious to static analyzers that this * However, to make it obvious to static analyzers that this
* code is safe, add an explicit check that cdf_nbuf_pull_head * code is safe, add an explicit check that qdf_nbuf_pull_head
* returns a non-NULL value. * returns a non-NULL value.
* Since this part of the code is not performance-critical, * Since this part of the code is not performance-critical,
* adding this explicit check is okay. * adding this explicit check is okay.

Переглянути файл

@@ -28,7 +28,7 @@
#ifndef _OL_RX_DEFRAG_H_ #ifndef _OL_RX_DEFRAG_H_
#define _OL_RX_DEFRAG_H_ #define _OL_RX_DEFRAG_H_
#include <cdf_nbuf.h> #include <qdf_nbuf.h>
#include <cds_ieee80211_common.h> #include <cds_ieee80211_common.h>
#include <qdf_util.h> #include <qdf_util.h>
#include <qdf_types.h> #include <qdf_types.h>
@@ -54,16 +54,16 @@ enum {
}; };
#define ol_rx_defrag_copydata(buf, offset, len, _to) \ #define ol_rx_defrag_copydata(buf, offset, len, _to) \
cdf_nbuf_copy_bits(buf, offset, len, _to) qdf_nbuf_copy_bits(buf, offset, len, _to)
#define ol_rx_defrag_len(buf) \ #define ol_rx_defrag_len(buf) \
cdf_nbuf_len(buf) qdf_nbuf_len(buf)
void void
ol_rx_fraglist_insert(htt_pdev_handle htt_pdev, ol_rx_fraglist_insert(htt_pdev_handle htt_pdev,
cdf_nbuf_t *head_addr, qdf_nbuf_t *head_addr,
cdf_nbuf_t *tail_addr, qdf_nbuf_t *tail_addr,
cdf_nbuf_t frag, uint8_t *all_frag_present); qdf_nbuf_t frag, uint8_t *all_frag_present);
void ol_rx_defrag_waitlist_add(struct ol_txrx_peer_t *peer, unsigned tid); void ol_rx_defrag_waitlist_add(struct ol_txrx_peer_t *peer, unsigned tid);
@@ -73,33 +73,33 @@ void ol_rx_defrag_waitlist_flush(struct ol_txrx_pdev_t *pdev);
void void
ol_rx_defrag(ol_txrx_pdev_handle pdev, ol_rx_defrag(ol_txrx_pdev_handle pdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t frag_list); struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t frag_list);
int int
ol_rx_frag_tkip_decap(ol_txrx_pdev_handle pdev, ol_rx_frag_tkip_decap(ol_txrx_pdev_handle pdev,
cdf_nbuf_t msdu, uint16_t hdrlen); qdf_nbuf_t msdu, uint16_t hdrlen);
int int
ol_rx_frag_wep_decap(ol_txrx_pdev_handle pdev, ol_rx_frag_wep_decap(ol_txrx_pdev_handle pdev,
cdf_nbuf_t nbuf, uint16_t hdrlen); qdf_nbuf_t nbuf, uint16_t hdrlen);
void ol_rx_defrag_nwifi_to_8023(ol_txrx_pdev_handle pdev, cdf_nbuf_t msdu); void ol_rx_defrag_nwifi_to_8023(ol_txrx_pdev_handle pdev, qdf_nbuf_t msdu);
void void
ol_rx_defrag_qos_decap(ol_txrx_pdev_handle pdev, ol_rx_defrag_qos_decap(ol_txrx_pdev_handle pdev,
cdf_nbuf_t nbuf, uint16_t hdrlen); qdf_nbuf_t nbuf, uint16_t hdrlen);
int int
ol_rx_frag_tkip_demic(ol_txrx_pdev_handle pdev, ol_rx_frag_tkip_demic(ol_txrx_pdev_handle pdev,
const uint8_t *key, cdf_nbuf_t msdu, uint16_t hdrlen); const uint8_t *key, qdf_nbuf_t msdu, uint16_t hdrlen);
int int
ol_rx_frag_ccmp_decap(ol_txrx_pdev_handle pdev, ol_rx_frag_ccmp_decap(ol_txrx_pdev_handle pdev,
cdf_nbuf_t nbuf, uint16_t hdrlen); qdf_nbuf_t nbuf, uint16_t hdrlen);
int int
ol_rx_frag_ccmp_demic(ol_txrx_pdev_handle pdev, ol_rx_frag_ccmp_demic(ol_txrx_pdev_handle pdev,
cdf_nbuf_t wbuf, uint16_t hdrlen); qdf_nbuf_t wbuf, uint16_t hdrlen);
uint16_t ol_rx_frag_hdrsize(const void *data); uint16_t ol_rx_frag_hdrsize(const void *data);
@@ -108,16 +108,16 @@ void ol_rx_defrag_michdr(const struct ieee80211_frame *wh0, uint8_t hdr[]);
void void
ol_rx_reorder_store_frag(ol_txrx_pdev_handle pdev, ol_rx_reorder_store_frag(ol_txrx_pdev_handle pdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, uint16_t seq_num, cdf_nbuf_t frag); unsigned tid, uint16_t seq_num, qdf_nbuf_t frag);
cdf_nbuf_t qdf_nbuf_t
ol_rx_defrag_decap_recombine(htt_pdev_handle htt_pdev, ol_rx_defrag_decap_recombine(htt_pdev_handle htt_pdev,
cdf_nbuf_t frag_list, uint16_t hdrsize); qdf_nbuf_t frag_list, uint16_t hdrsize);
int int
ol_rx_defrag_mic(ol_txrx_pdev_handle pdev, ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
const uint8_t *key, const uint8_t *key,
cdf_nbuf_t wbuf, qdf_nbuf_t wbuf,
uint16_t off, uint16_t data_len, uint8_t mic[]); uint16_t off, uint16_t data_len, uint8_t mic[]);
void void
@@ -167,16 +167,16 @@ static inline void put_le32(uint8_t *p, uint32_t v)
p[3] = (v >> 24) & 0xff; p[3] = (v >> 24) & 0xff;
} }
static inline uint8_t ol_rx_defrag_concat(cdf_nbuf_t dst, cdf_nbuf_t src) static inline uint8_t ol_rx_defrag_concat(qdf_nbuf_t dst, qdf_nbuf_t src)
{ {
/* /*
* Inside cdf_nbuf_cat, if it is necessary to reallocate dst * Inside qdf_nbuf_cat, if it is necessary to reallocate dst
* to provide space for src, the headroom portion is copied from * to provide space for src, the headroom portion is copied from
* the original dst buffer to the larger new dst buffer. * the original dst buffer to the larger new dst buffer.
* (This is needed, because the headroom of the dst buffer * (This is needed, because the headroom of the dst buffer
* contains the rx desc.) * contains the rx desc.)
*/ */
if (cdf_nbuf_cat(dst, src)) if (qdf_nbuf_cat(dst, src))
return OL_RX_DEFRAG_ERR; return OL_RX_DEFRAG_ERR;
return OL_RX_DEFRAG_OK; return OL_RX_DEFRAG_OK;

Переглянути файл

@@ -26,7 +26,7 @@
*/ */
/* standard header files */ /* standard header files */
#include <cdf_nbuf.h> /* cdf_nbuf_map */ #include <qdf_nbuf.h> /* qdf_nbuf_map */
#include <qdf_mem.h> /* qdf_mem_cmp */ #include <qdf_mem.h> /* qdf_mem_cmp */
/* external header files */ /* external header files */
@@ -48,7 +48,7 @@
* Check that this Packet is suitable for forwarding. If yes, then * Check that this Packet is suitable for forwarding. If yes, then
* prepare the new 802.11 header. * prepare the new 802.11 header.
*/ */
static inline void ol_ap_fwd_check(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu) static inline void ol_ap_fwd_check(struct ol_txrx_vdev_t *vdev, qdf_nbuf_t msdu)
{ {
struct ieee80211_frame *mac_header; struct ieee80211_frame *mac_header;
unsigned char tmp_addr[IEEE80211_ADDR_LEN]; unsigned char tmp_addr[IEEE80211_ADDR_LEN];
@@ -57,7 +57,7 @@ static inline void ol_ap_fwd_check(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu)
unsigned char fromds; unsigned char fromds;
unsigned char tods; unsigned char tods;
mac_header = (struct ieee80211_frame *)(cdf_nbuf_data(msdu)); mac_header = (struct ieee80211_frame *)(qdf_nbuf_data(msdu));
TXRX_ASSERT1(mac_header); TXRX_ASSERT1(mac_header);
type = mac_header->i_fc[0] & IEEE80211_FC0_TYPE_MASK; type = mac_header->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
@@ -107,7 +107,7 @@ static inline void ol_ap_fwd_check(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu)
} }
} }
static inline void ol_rx_fwd_to_tx(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu) static inline void ol_rx_fwd_to_tx(struct ol_txrx_vdev_t *vdev, qdf_nbuf_t msdu)
{ {
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
@@ -118,8 +118,8 @@ static inline void ol_rx_fwd_to_tx(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu)
* Map the netbuf, so it's accessible to the DMA that * Map the netbuf, so it's accessible to the DMA that
* sends it to the target. * sends it to the target.
*/ */
cdf_nbuf_map_single(pdev->osdev, msdu, QDF_DMA_TO_DEVICE); qdf_nbuf_map_single(pdev->osdev, msdu, QDF_DMA_TO_DEVICE);
cdf_nbuf_set_next(msdu, NULL); /* add NULL terminator */ qdf_nbuf_set_next(msdu, NULL); /* add NULL terminator */
msdu = OL_TX_LL(vdev, msdu); msdu = OL_TX_LL(vdev, msdu);
@@ -129,19 +129,19 @@ static inline void ol_rx_fwd_to_tx(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu)
* We could store the frame and try again later, * We could store the frame and try again later,
* but the simplest solution is to discard the frames. * but the simplest solution is to discard the frames.
*/ */
cdf_nbuf_unmap_single(pdev->osdev, msdu, QDF_DMA_TO_DEVICE); qdf_nbuf_unmap_single(pdev->osdev, msdu, QDF_DMA_TO_DEVICE);
cdf_nbuf_tx_free(msdu, NBUF_PKT_ERROR); qdf_nbuf_tx_free(msdu, QDF_NBUF_PKT_ERROR);
} }
} }
void void
ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev, ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t msdu_list) struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t msdu_list)
{ {
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
cdf_nbuf_t deliver_list_head = NULL; qdf_nbuf_t deliver_list_head = NULL;
cdf_nbuf_t deliver_list_tail = NULL; qdf_nbuf_t deliver_list_tail = NULL;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
msdu = msdu_list; msdu = msdu_list;
while (msdu) { while (msdu) {
@@ -151,7 +151,7 @@ ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
* Remember the next list elem, because our processing * Remember the next list elem, because our processing
* may cause the MSDU to get linked into a different list. * may cause the MSDU to get linked into a different list.
*/ */
msdu_list = cdf_nbuf_next(msdu); msdu_list = qdf_nbuf_next(msdu);
rx_desc = htt_rx_msdu_desc_retrieve(pdev->htt_pdev, msdu); rx_desc = htt_rx_msdu_desc_retrieve(pdev->htt_pdev, msdu);
@@ -182,9 +182,9 @@ ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
* Fw will take care of filling proper tid. * Fw will take care of filling proper tid.
*/ */
if (tid != HTT_NON_QOS_TID) { if (tid != HTT_NON_QOS_TID) {
cdf_nbuf_set_tid(msdu, tid); qdf_nbuf_set_tid(msdu, tid);
} else { } else {
cdf_nbuf_set_tid(msdu, qdf_nbuf_set_tid(msdu,
QDF_NBUF_TX_EXT_TID_INVALID); QDF_NBUF_TX_EXT_TID_INVALID);
} }
/* /*
@@ -195,14 +195,14 @@ ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
*/ */
if (htt_rx_msdu_discard(pdev->htt_pdev, rx_desc)) { if (htt_rx_msdu_discard(pdev->htt_pdev, rx_desc)) {
htt_rx_msdu_desc_free(pdev->htt_pdev, msdu); htt_rx_msdu_desc_free(pdev->htt_pdev, msdu);
cdf_net_buf_debug_release_skb(msdu); qdf_net_buf_debug_release_skb(msdu);
ol_rx_fwd_to_tx(tx_vdev, msdu); ol_rx_fwd_to_tx(tx_vdev, msdu);
msdu = NULL; /* already handled this MSDU */ msdu = NULL; /* already handled this MSDU */
TXRX_STATS_ADD(pdev, TXRX_STATS_ADD(pdev,
pub.rx.intra_bss_fwd.packets_fwd, 1); pub.rx.intra_bss_fwd.packets_fwd, 1);
} else { } else {
cdf_nbuf_t copy; qdf_nbuf_t copy;
copy = cdf_nbuf_copy(msdu); copy = qdf_nbuf_copy(msdu);
if (copy) if (copy)
ol_rx_fwd_to_tx(tx_vdev, copy); ol_rx_fwd_to_tx(tx_vdev, copy);
TXRX_STATS_ADD(pdev, TXRX_STATS_ADD(pdev,
@@ -221,7 +221,7 @@ ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
} }
if (deliver_list_head) { if (deliver_list_head) {
/* add NULL terminator */ /* add NULL terminator */
cdf_nbuf_set_next(deliver_list_tail, NULL); qdf_nbuf_set_next(deliver_list_tail, NULL);
if (ol_cfg_is_full_reorder_offload(pdev->ctrl_pdev)) { if (ol_cfg_is_full_reorder_offload(pdev->ctrl_pdev)) {
ol_rx_in_order_deliver(vdev, peer, tid, ol_rx_in_order_deliver(vdev, peer, tid,
deliver_list_head); deliver_list_head);

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014 The Linux Foundation. All rights reserved. * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -28,19 +28,19 @@
#ifndef _OL_RX_FWD_H_ #ifndef _OL_RX_FWD_H_
#define _OL_RX_FWD_H_ #define _OL_RX_FWD_H_
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <ol_txrx_api.h> /* ol_txrx_peer_t, etc. */ #include <ol_txrx_api.h> /* ol_txrx_peer_t, etc. */
cdf_nbuf_t qdf_nbuf_t
ol_rx_fwd_mcast_check_sta(struct ol_txrx_vdev_t *vdev, ol_rx_fwd_mcast_check_sta(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
cdf_nbuf_t msdu, void *rx_desc, int is_wlan_mcast); qdf_nbuf_t msdu, void *rx_desc, int is_wlan_mcast);
cdf_nbuf_t qdf_nbuf_t
ol_rx_fwd_mcast_check_ap(struct ol_txrx_vdev_t *vdev, ol_rx_fwd_mcast_check_ap(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
cdf_nbuf_t msdu, void *rx_desc, int is_wlan_mcast); qdf_nbuf_t msdu, void *rx_desc, int is_wlan_mcast);
/** /**
* @brief Check if rx frames should be transmitted over WLAN. * @brief Check if rx frames should be transmitted over WLAN.
@@ -70,6 +70,6 @@ ol_rx_fwd_mcast_check_ap(struct ol_txrx_vdev_t *vdev,
void void
ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev, ol_rx_fwd_check(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list); unsigned tid, qdf_nbuf_t msdu_list);
#endif /* _OL_RX_FWD_H_ */ #endif /* _OL_RX_FWD_H_ */

Переглянути файл

@@ -25,7 +25,7 @@
* to the Linux Foundation. * to the Linux Foundation.
*/ */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_htt_rx_api.h> /* htt_rx_pn_t, etc. */ #include <ol_htt_rx_api.h> /* htt_rx_pn_t, etc. */
#include <ol_ctrl_txrx_api.h> /* ol_rx_err */ #include <ol_ctrl_txrx_api.h> /* ol_rx_err */
@@ -41,7 +41,7 @@
if (!head) { \ if (!head) { \
head = mpdu; \ head = mpdu; \
} else { \ } else { \
cdf_nbuf_set_next(tail, mpdu); \ qdf_nbuf_set_next(tail, mpdu); \
} \ } \
tail = mpdu_tail; \ tail = mpdu_tail; \
} while (0) } while (0)
@@ -80,16 +80,16 @@ int ol_rx_pn_wapi_cmp(union htt_rx_pn_t *new_pn,
return pn_is_replay; return pn_is_replay;
} }
cdf_nbuf_t qdf_nbuf_t
ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev, ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list) unsigned tid, qdf_nbuf_t msdu_list)
{ {
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
union htt_rx_pn_t *last_pn; union htt_rx_pn_t *last_pn;
cdf_nbuf_t out_list_head = NULL; qdf_nbuf_t out_list_head = NULL;
cdf_nbuf_t out_list_tail = NULL; qdf_nbuf_t out_list_tail = NULL;
cdf_nbuf_t mpdu; qdf_nbuf_t mpdu;
int index; /* unicast vs. multicast */ int index; /* unicast vs. multicast */
int pn_len; int pn_len;
void *rx_desc; void *rx_desc;
@@ -114,7 +114,7 @@ ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev,
last_pn = &peer->tids_last_pn[tid]; last_pn = &peer->tids_last_pn[tid];
mpdu = msdu_list; mpdu = msdu_list;
while (mpdu) { while (mpdu) {
cdf_nbuf_t mpdu_tail, next_mpdu; qdf_nbuf_t mpdu_tail, next_mpdu;
union htt_rx_pn_t new_pn; union htt_rx_pn_t new_pn;
int pn_is_replay = 0; int pn_is_replay = 0;
@@ -148,7 +148,7 @@ ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev,
} }
if (pn_is_replay) { if (pn_is_replay) {
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
static uint32_t last_pncheck_print_time /* = 0 */; static uint32_t last_pncheck_print_time /* = 0 */;
int log_level; int log_level;
uint32_t current_time_ms; uint32_t current_time_ms;
@@ -198,10 +198,10 @@ ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev,
mpdu, NULL, 0); mpdu, NULL, 0);
/* free all MSDUs within this MPDU */ /* free all MSDUs within this MPDU */
do { do {
cdf_nbuf_t next_msdu; qdf_nbuf_t next_msdu;
OL_RX_ERR_STATISTICS_1(pdev, vdev, peer, OL_RX_ERR_STATISTICS_1(pdev, vdev, peer,
rx_desc, OL_RX_ERR_PN); rx_desc, OL_RX_ERR_PN);
next_msdu = cdf_nbuf_next(msdu); next_msdu = qdf_nbuf_next(msdu);
htt_rx_desc_frame_free(pdev->htt_pdev, msdu); htt_rx_desc_frame_free(pdev->htt_pdev, msdu);
if (msdu == mpdu_tail) if (msdu == mpdu_tail)
break; break;
@@ -228,14 +228,14 @@ ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev,
} }
/* make sure the list is null-terminated */ /* make sure the list is null-terminated */
if (out_list_tail) if (out_list_tail)
cdf_nbuf_set_next(out_list_tail, NULL); qdf_nbuf_set_next(out_list_tail, NULL);
return out_list_head; return out_list_head;
} }
void void
ol_rx_pn_check(struct ol_txrx_vdev_t *vdev, ol_rx_pn_check(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t msdu_list) struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t msdu_list)
{ {
msdu_list = ol_rx_pn_check_base(vdev, peer, tid, msdu_list); msdu_list = ol_rx_pn_check_base(vdev, peer, tid, msdu_list);
ol_rx_fwd_check(vdev, peer, tid, msdu_list); ol_rx_fwd_check(vdev, peer, tid, msdu_list);
@@ -244,7 +244,7 @@ ol_rx_pn_check(struct ol_txrx_vdev_t *vdev,
void void
ol_rx_pn_check_only(struct ol_txrx_vdev_t *vdev, ol_rx_pn_check_only(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list) unsigned tid, qdf_nbuf_t msdu_list)
{ {
msdu_list = ol_rx_pn_check_base(vdev, peer, tid, msdu_list); msdu_list = ol_rx_pn_check_base(vdev, peer, tid, msdu_list);
ol_rx_deliver(vdev, peer, tid, msdu_list); ol_rx_deliver(vdev, peer, tid, msdu_list);

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014 The Linux Foundation. All rights reserved. * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -28,7 +28,7 @@
#ifndef _OL_RX_PN_H_ #ifndef _OL_RX_PN_H_
#define _OL_RX_PN_H_ #define _OL_RX_PN_H_
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <ol_txrx_api.h> /* ol_txrx_peer_t, etc. */ #include <ol_txrx_api.h> /* ol_txrx_peer_t, etc. */
@@ -60,7 +60,7 @@ int ol_rx_pn_wapi_cmp(union htt_rx_pn_t *new_pn,
*/ */
void void
ol_rx_pn_check(struct ol_txrx_vdev_t *vdev, ol_rx_pn_check(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, unsigned tid, cdf_nbuf_t msdu_list); struct ol_txrx_peer_t *peer, unsigned tid, qdf_nbuf_t msdu_list);
/** /**
* @brief If applicable, check the Packet Number to detect replays. * @brief If applicable, check the Packet Number to detect replays.
@@ -82,7 +82,7 @@ ol_rx_pn_check(struct ol_txrx_vdev_t *vdev,
void void
ol_rx_pn_check_only(struct ol_txrx_vdev_t *vdev, ol_rx_pn_check_only(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list); unsigned tid, qdf_nbuf_t msdu_list);
/** /**
* @brief If applicable, check the Packet Number to detect replays. * @brief If applicable, check the Packet Number to detect replays.
@@ -97,9 +97,9 @@ ol_rx_pn_check_only(struct ol_txrx_vdev_t *vdev,
* (if PN check is applicable, i.e. PN length > 0) * (if PN check is applicable, i.e. PN length > 0)
* @return list of netbufs that didn't fail the PN check * @return list of netbufs that didn't fail the PN check
*/ */
cdf_nbuf_t qdf_nbuf_t
ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev, ol_rx_pn_check_base(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list); unsigned tid, qdf_nbuf_t msdu_list);
#endif /* _OL_RX_PN_H_ */ #endif /* _OL_RX_PN_H_ */

Переглянути файл

@@ -27,7 +27,7 @@
/*=== header file includes ===*/ /*=== header file includes ===*/
/* generic utilities */ /* generic utilities */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* cdf_nbuf_t, etc. */
#include <qdf_mem.h> /* qdf_mem_malloc */ #include <qdf_mem.h> /* qdf_mem_malloc */
#include <ieee80211.h> /* IEEE80211_SEQ_MAX */ #include <ieee80211.h> /* IEEE80211_SEQ_MAX */
@@ -86,7 +86,7 @@ static char g_log2ceil[] = {
#define OL_RX_REORDER_LIST_APPEND(head_msdu, tail_msdu, rx_reorder_array_elem) \ #define OL_RX_REORDER_LIST_APPEND(head_msdu, tail_msdu, rx_reorder_array_elem) \
do { \ do { \
if (tail_msdu) { \ if (tail_msdu) { \
cdf_nbuf_set_next(tail_msdu, \ qdf_nbuf_set_next(tail_msdu, \
rx_reorder_array_elem->head); \ rx_reorder_array_elem->head); \
} \ } \
} while (0) } while (0)
@@ -223,14 +223,14 @@ void
ol_rx_reorder_store(struct ol_txrx_pdev_t *pdev, ol_rx_reorder_store(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, unsigned tid,
unsigned idx, cdf_nbuf_t head_msdu, cdf_nbuf_t tail_msdu) unsigned idx, qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu)
{ {
struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem; struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem;
idx &= peer->tids_rx_reorder[tid].win_sz_mask; idx &= peer->tids_rx_reorder[tid].win_sz_mask;
rx_reorder_array_elem = &peer->tids_rx_reorder[tid].array[idx]; rx_reorder_array_elem = &peer->tids_rx_reorder[tid].array[idx];
if (rx_reorder_array_elem->head) { if (rx_reorder_array_elem->head) {
cdf_nbuf_set_next(rx_reorder_array_elem->tail, head_msdu); qdf_nbuf_set_next(rx_reorder_array_elem->tail, head_msdu);
} else { } else {
rx_reorder_array_elem->head = head_msdu; rx_reorder_array_elem->head = head_msdu;
OL_RX_REORDER_MPDU_CNT_INCR(&peer->tids_rx_reorder[tid], 1); OL_RX_REORDER_MPDU_CNT_INCR(&peer->tids_rx_reorder[tid], 1);
@@ -246,8 +246,8 @@ ol_rx_reorder_release(struct ol_txrx_vdev_t *vdev,
unsigned idx; unsigned idx;
unsigned win_sz, win_sz_mask; unsigned win_sz, win_sz_mask;
struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem; struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem;
cdf_nbuf_t head_msdu; qdf_nbuf_t head_msdu;
cdf_nbuf_t tail_msdu; qdf_nbuf_t tail_msdu;
OL_RX_REORDER_IDX_START_SELF_SELECT(peer, tid, &idx_start); OL_RX_REORDER_IDX_START_SELF_SELECT(peer, tid, &idx_start);
/* may get reset below */ /* may get reset below */
@@ -305,7 +305,7 @@ ol_rx_reorder_release(struct ol_txrx_vdev_t *vdev,
head_msdu)); head_msdu));
peer->tids_last_seq[tid] = seq_num; peer->tids_last_seq[tid] = seq_num;
/* rx_opt_proc takes a NULL-terminated list of msdu netbufs */ /* rx_opt_proc takes a NULL-terminated list of msdu netbufs */
cdf_nbuf_set_next(tail_msdu, NULL); qdf_nbuf_set_next(tail_msdu, NULL);
peer->rx_opt_proc(vdev, peer, tid, head_msdu); peer->rx_opt_proc(vdev, peer, tid, head_msdu);
} }
/* /*
@@ -327,8 +327,8 @@ ol_rx_reorder_flush(struct ol_txrx_vdev_t *vdev,
unsigned win_sz; unsigned win_sz;
uint8_t win_sz_mask; uint8_t win_sz_mask;
struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem; struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem;
cdf_nbuf_t head_msdu = NULL; qdf_nbuf_t head_msdu = NULL;
cdf_nbuf_t tail_msdu = NULL; qdf_nbuf_t tail_msdu = NULL;
pdev = vdev->pdev; pdev = vdev->pdev;
win_sz = peer->tids_rx_reorder[tid].win_sz; win_sz = peer->tids_rx_reorder[tid].win_sz;
@@ -371,7 +371,7 @@ ol_rx_reorder_flush(struct ol_txrx_vdev_t *vdev,
rx_reorder_array_elem->tail = NULL; rx_reorder_array_elem->tail = NULL;
continue; continue;
} }
cdf_nbuf_set_next(tail_msdu, qdf_nbuf_set_next(tail_msdu,
rx_reorder_array_elem->head); rx_reorder_array_elem->head);
tail_msdu = rx_reorder_array_elem->tail; tail_msdu = rx_reorder_array_elem->tail;
rx_reorder_array_elem->head = rx_reorder_array_elem->head =
@@ -390,13 +390,13 @@ ol_rx_reorder_flush(struct ol_txrx_vdev_t *vdev,
htt_rx_msdu_desc_retrieve(htt_pdev, head_msdu)); htt_rx_msdu_desc_retrieve(htt_pdev, head_msdu));
peer->tids_last_seq[tid] = seq_num; peer->tids_last_seq[tid] = seq_num;
/* rx_opt_proc takes a NULL-terminated list of msdu netbufs */ /* rx_opt_proc takes a NULL-terminated list of msdu netbufs */
cdf_nbuf_set_next(tail_msdu, NULL); qdf_nbuf_set_next(tail_msdu, NULL);
if (action == htt_rx_flush_release) { if (action == htt_rx_flush_release) {
peer->rx_opt_proc(vdev, peer, tid, head_msdu); peer->rx_opt_proc(vdev, peer, tid, head_msdu);
} else { } else {
do { do {
cdf_nbuf_t next; qdf_nbuf_t next;
next = cdf_nbuf_next(head_msdu); next = qdf_nbuf_next(head_msdu);
htt_rx_desc_frame_free(pdev->htt_pdev, htt_rx_desc_frame_free(pdev->htt_pdev,
head_msdu); head_msdu);
head_msdu = next; head_msdu = next;
@@ -596,8 +596,8 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
struct ol_txrx_peer_t *peer; struct ol_txrx_peer_t *peer;
struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem; struct ol_rx_reorder_array_elem_t *rx_reorder_array_elem;
unsigned win_sz_mask; unsigned win_sz_mask;
cdf_nbuf_t head_msdu = NULL; qdf_nbuf_t head_msdu = NULL;
cdf_nbuf_t tail_msdu = NULL; qdf_nbuf_t tail_msdu = NULL;
htt_pdev_handle htt_pdev = pdev->htt_pdev; htt_pdev_handle htt_pdev = pdev->htt_pdev;
int seq_num, i = 0; int seq_num, i = 0;
@@ -630,7 +630,7 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
if (rx_reorder_array_elem->head) { if (rx_reorder_array_elem->head) {
if (pn_ie_cnt && seq_num == (int)(pn_ie[i])) { if (pn_ie_cnt && seq_num == (int)(pn_ie[i])) {
cdf_nbuf_t msdu, next_msdu, mpdu_head, qdf_nbuf_t msdu, next_msdu, mpdu_head,
mpdu_tail; mpdu_tail;
static uint32_t last_pncheck_print_time; static uint32_t last_pncheck_print_time;
/* Do not need to initialize as C does it */ /* Do not need to initialize as C does it */
@@ -691,7 +691,7 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
/* free all MSDUs within this MPDU */ /* free all MSDUs within this MPDU */
do { do {
next_msdu = cdf_nbuf_next(msdu); next_msdu = qdf_nbuf_next(msdu);
htt_rx_desc_frame_free(htt_pdev, msdu); htt_rx_desc_frame_free(htt_pdev, msdu);
if (msdu == mpdu_tail) if (msdu == mpdu_tail)
break; break;
@@ -704,7 +704,7 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
head_msdu = rx_reorder_array_elem->head; head_msdu = rx_reorder_array_elem->head;
tail_msdu = rx_reorder_array_elem->tail; tail_msdu = rx_reorder_array_elem->tail;
} else { } else {
cdf_nbuf_set_next( qdf_nbuf_set_next(
tail_msdu, tail_msdu,
rx_reorder_array_elem->head); rx_reorder_array_elem->head);
tail_msdu = rx_reorder_array_elem->tail; tail_msdu = rx_reorder_array_elem->tail;
@@ -718,7 +718,7 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
if (head_msdu) { if (head_msdu) {
/* rx_opt_proc takes a NULL-terminated list of msdu netbufs */ /* rx_opt_proc takes a NULL-terminated list of msdu netbufs */
cdf_nbuf_set_next(tail_msdu, NULL); qdf_nbuf_set_next(tail_msdu, NULL);
peer->rx_opt_proc(vdev, peer, tid, head_msdu); peer->rx_opt_proc(vdev, peer, tid, head_msdu);
} }
} }

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014-2015 The Linux Foundation. All rights reserved. * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -28,7 +28,7 @@
#ifndef _OL_RX_REORDER__H_ #ifndef _OL_RX_REORDER__H_
#define _OL_RX_REORDER__H_ #define _OL_RX_REORDER__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <ol_txrx_api.h> /* ol_txrx_peer_t, etc. */ #include <ol_txrx_api.h> /* ol_txrx_peer_t, etc. */
@@ -39,7 +39,7 @@ ol_rx_reorder_store(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, unsigned tid,
unsigned reorder_array_index, unsigned reorder_array_index,
cdf_nbuf_t head_msdu, cdf_nbuf_t tail_msdu); qdf_nbuf_t head_msdu, qdf_nbuf_t tail_msdu);
void void
ol_rx_reorder_release(struct ol_txrx_vdev_t *vdev, ol_rx_reorder_release(struct ol_txrx_vdev_t *vdev,

Переглянути файл

@@ -27,7 +27,7 @@
/*=== header file includes ===*/ /*=== header file includes ===*/
/* generic utilities */ /* generic utilities */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_timer.h> #include <qdf_timer.h>
#include <qdf_time.h> #include <qdf_time.h>

Переглянути файл

@@ -26,7 +26,7 @@
*/ */
/* OS abstraction libraries */ /* OS abstraction libraries */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_atomic.h> /* qdf_atomic_read, etc. */ #include <qdf_atomic.h> /* qdf_atomic_read, etc. */
#include <qdf_util.h> /* qdf_unlikely */ #include <qdf_util.h> /* qdf_unlikely */
@@ -56,7 +56,7 @@
#include <htt_internal.h> #include <htt_internal.h>
#include <htt_types.h> /* htc_endpoint */ #include <htt_types.h> /* htc_endpoint */
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 /* WLAN_FEATURE_FASTPATH */ #endif /* WLAN_FEATURE_FASTPATH */
@@ -91,11 +91,11 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
* Return: 0 - success, >0 - error * Return: 0 - success, >0 - error
*/ */
static inline uint8_t ol_tx_prepare_tso(ol_txrx_vdev_handle vdev, static inline uint8_t ol_tx_prepare_tso(ol_txrx_vdev_handle vdev,
cdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info) qdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info)
{ {
msdu_info->tso_info.curr_seg = NULL; msdu_info->tso_info.curr_seg = NULL;
if (cdf_nbuf_is_tso(msdu)) { if (qdf_nbuf_is_tso(msdu)) {
int num_seg = cdf_nbuf_get_tso_num_seg(msdu); int num_seg = qdf_nbuf_get_tso_num_seg(msdu);
msdu_info->tso_info.tso_seg_list = NULL; msdu_info->tso_info.tso_seg_list = NULL;
msdu_info->tso_info.num_segs = num_seg; msdu_info->tso_info.num_segs = num_seg;
while (num_seg) { while (num_seg) {
@@ -121,7 +121,7 @@ static inline uint8_t ol_tx_prepare_tso(ol_txrx_vdev_handle vdev,
return 1; return 1;
} }
} }
cdf_nbuf_get_tso_info(vdev->pdev->osdev, qdf_nbuf_get_tso_info(vdev->pdev->osdev,
msdu, &(msdu_info->tso_info)); msdu, &(msdu_info->tso_info));
msdu_info->tso_info.curr_seg = msdu_info->tso_info.curr_seg =
msdu_info->tso_info.tso_seg_list; msdu_info->tso_info.tso_seg_list;
@@ -142,13 +142,13 @@ static inline uint8_t ol_tx_prepare_tso(ol_txrx_vdev_handle vdev,
* *
* Return: skb/NULL for success * Return: skb/NULL for success
*/ */
cdf_nbuf_t ol_tx_send_data_frame(uint8_t sta_id, cdf_nbuf_t skb, qdf_nbuf_t ol_tx_send_data_frame(uint8_t sta_id, qdf_nbuf_t skb,
uint8_t proto_type) uint8_t proto_type)
{ {
void *qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); void *qdf_ctx = cds_get_context(QDF_MODULE_ID_QDF_DEVICE);
struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
struct ol_txrx_peer_t *peer; struct ol_txrx_peer_t *peer;
cdf_nbuf_t ret; qdf_nbuf_t ret;
QDF_STATUS status; QDF_STATUS status;
if (qdf_unlikely(!pdev)) { if (qdf_unlikely(!pdev)) {
@@ -181,27 +181,27 @@ cdf_nbuf_t ol_tx_send_data_frame(uint8_t sta_id, cdf_nbuf_t skb,
return skb; return skb;
} }
status = cdf_nbuf_map_single(qdf_ctx, skb, QDF_DMA_TO_DEVICE); status = qdf_nbuf_map_single(qdf_ctx, skb, QDF_DMA_TO_DEVICE);
if (qdf_unlikely(status != QDF_STATUS_SUCCESS)) { if (qdf_unlikely(status != QDF_STATUS_SUCCESS)) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN,
"%s: nbuf map failed", __func__); "%s: nbuf map failed", __func__);
return skb; return skb;
} }
cdf_nbuf_trace_set_proto_type(skb, proto_type); qdf_nbuf_trace_set_proto_type(skb, proto_type);
if ((ol_cfg_is_ip_tcp_udp_checksum_offload_enabled(pdev->ctrl_pdev)) if ((ol_cfg_is_ip_tcp_udp_checksum_offload_enabled(pdev->ctrl_pdev))
&& (cdf_nbuf_get_protocol(skb) == htons(ETH_P_IP)) && (qdf_nbuf_get_protocol(skb) == htons(ETH_P_IP))
&& (cdf_nbuf_get_ip_summed(skb) == CHECKSUM_PARTIAL)) && (qdf_nbuf_get_ip_summed(skb) == CHECKSUM_PARTIAL))
cdf_nbuf_set_ip_summed(skb, CHECKSUM_COMPLETE); qdf_nbuf_set_ip_summed(skb, CHECKSUM_COMPLETE);
/* Terminate the (single-element) list of tx frames */ /* Terminate the (single-element) list of tx frames */
cdf_nbuf_set_next(skb, NULL); qdf_nbuf_set_next(skb, NULL);
ret = OL_TX_LL(peer->vdev, skb); ret = OL_TX_LL(peer->vdev, skb);
if (ret) { if (ret) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_WARN,
"%s: Failed to tx", __func__); "%s: Failed to tx", __func__);
cdf_nbuf_unmap_single(qdf_ctx, ret, QDF_DMA_TO_DEVICE); qdf_nbuf_unmap_single(qdf_ctx, ret, QDF_DMA_TO_DEVICE);
return ret; return ret;
} }
@@ -216,11 +216,11 @@ cdf_nbuf_t ol_tx_send_data_frame(uint8_t sta_id, cdf_nbuf_t skb,
* *
* Return: skb/ NULL is for success * Return: skb/ NULL is for success
*/ */
cdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev, qdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev,
cdf_nbuf_t skb) qdf_nbuf_t skb)
{ {
ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX); ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
cdf_nbuf_t ret; qdf_nbuf_t ret;
if (qdf_unlikely(!pdev)) { if (qdf_unlikely(!pdev)) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
@@ -229,12 +229,12 @@ cdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev,
} }
if ((ol_cfg_is_ip_tcp_udp_checksum_offload_enabled(pdev->ctrl_pdev)) if ((ol_cfg_is_ip_tcp_udp_checksum_offload_enabled(pdev->ctrl_pdev))
&& (cdf_nbuf_get_protocol(skb) == htons(ETH_P_IP)) && (qdf_nbuf_get_protocol(skb) == htons(ETH_P_IP))
&& (cdf_nbuf_get_ip_summed(skb) == CHECKSUM_PARTIAL)) && (qdf_nbuf_get_ip_summed(skb) == CHECKSUM_PARTIAL))
cdf_nbuf_set_ip_summed(skb, CHECKSUM_COMPLETE); qdf_nbuf_set_ip_summed(skb, CHECKSUM_COMPLETE);
/* Terminate the (single-element) list of tx frames */ /* Terminate the (single-element) list of tx frames */
cdf_nbuf_set_next(skb, NULL); qdf_nbuf_set_next(skb, NULL);
ret = OL_TX_LL((struct ol_txrx_vdev_t *)vdev, skb); ret = OL_TX_LL((struct ol_txrx_vdev_t *)vdev, skb);
if (ret) { if (ret) {
TXRX_PRINT(TXRX_PRINT_LEVEL_WARN, TXRX_PRINT(TXRX_PRINT_LEVEL_WARN,
@@ -248,9 +248,9 @@ cdf_nbuf_t ol_tx_send_ipa_data_frame(void *vdev,
#if defined(FEATURE_TSO) #if defined(FEATURE_TSO)
cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list) qdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
{ {
cdf_nbuf_t msdu = msdu_list; qdf_nbuf_t msdu = msdu_list;
struct ol_txrx_msdu_info_t msdu_info; struct ol_txrx_msdu_info_t msdu_info;
msdu_info.htt.info.l2_hdr_type = vdev->pdev->htt_pkt_type; msdu_info.htt.info.l2_hdr_type = vdev->pdev->htt_pkt_type;
@@ -262,11 +262,11 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* within the list. * within the list.
*/ */
while (msdu) { while (msdu) {
cdf_nbuf_t next; qdf_nbuf_t next;
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
int segments = 1; int segments = 1;
msdu_info.htt.info.ext_tid = cdf_nbuf_get_tid(msdu); msdu_info.htt.info.ext_tid = qdf_nbuf_get_tid(msdu);
msdu_info.peer = NULL; msdu_info.peer = NULL;
if (qdf_unlikely(ol_tx_prepare_tso(vdev, msdu, &msdu_info))) { if (qdf_unlikely(ol_tx_prepare_tso(vdev, msdu, &msdu_info))) {
@@ -283,7 +283,7 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* ol_tx_send function, so store the next pointer before the * ol_tx_send function, so store the next pointer before the
* tx_send call. * tx_send call.
*/ */
next = cdf_nbuf_next(msdu); next = qdf_nbuf_next(msdu);
/* init the current segment to the 1st segment in the list */ /* init the current segment to the 1st segment in the list */
while (segments) { while (segments) {
@@ -301,7 +301,7 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* receiving tx completion for all segments of an nbuf * receiving tx completion for all segments of an nbuf
*/ */
if (segments) if (segments)
cdf_nbuf_inc_users(msdu); qdf_nbuf_inc_users(msdu);
ol_tx_prepare_ll(tx_desc, vdev, msdu, &msdu_info); ol_tx_prepare_ll(tx_desc, vdev, msdu, &msdu_info);
@@ -318,7 +318,7 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
msdu_info.tso_info.curr_seg->next; msdu_info.tso_info.curr_seg->next;
} }
cdf_nbuf_reset_num_frags(msdu); qdf_nbuf_reset_num_frags(msdu);
if (msdu_info.tso_info.is_tso) { if (msdu_info.tso_info.is_tso) {
TXRX_STATS_TSO_INC_SEG(vdev->pdev); TXRX_STATS_TSO_INC_SEG(vdev->pdev);
@@ -336,9 +336,9 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
} }
#else /* TSO */ #else /* TSO */
cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list) qdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
{ {
cdf_nbuf_t msdu = msdu_list; qdf_nbuf_t msdu = msdu_list;
struct ol_txrx_msdu_info_t msdu_info; struct ol_txrx_msdu_info_t msdu_info;
msdu_info.htt.info.l2_hdr_type = vdev->pdev->htt_pkt_type; msdu_info.htt.info.l2_hdr_type = vdev->pdev->htt_pkt_type;
@@ -351,10 +351,10 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* within the list. * within the list.
*/ */
while (msdu) { while (msdu) {
cdf_nbuf_t next; qdf_nbuf_t next;
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
msdu_info.htt.info.ext_tid = cdf_nbuf_get_tid(msdu); msdu_info.htt.info.ext_tid = qdf_nbuf_get_tid(msdu);
msdu_info.peer = NULL; msdu_info.peer = NULL;
ol_tx_prepare_ll(tx_desc, vdev, msdu, &msdu_info); ol_tx_prepare_ll(tx_desc, vdev, msdu, &msdu_info);
@@ -368,7 +368,7 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* ol_tx_send function, so store the next pointer before the * ol_tx_send function, so store the next pointer before the
* tx_send call. * tx_send call.
*/ */
next = cdf_nbuf_next(msdu); next = qdf_nbuf_next(msdu);
ol_tx_send(vdev->pdev, tx_desc, msdu); ol_tx_send(vdev->pdev, tx_desc, msdu);
msdu = next; msdu = next;
} }
@@ -394,7 +394,7 @@ cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
*/ */
static inline struct ol_tx_desc_t * static inline struct ol_tx_desc_t *
ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev, ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev,
ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu, ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu,
uint32_t pkt_download_len, uint32_t ep_id, uint32_t pkt_download_len, uint32_t ep_id,
struct ol_txrx_msdu_info_t *msdu_info) struct ol_txrx_msdu_info_t *msdu_info)
{ {
@@ -436,10 +436,10 @@ ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev,
&msdu_info->htt, &msdu_info->tso_info, &msdu_info->htt, &msdu_info->tso_info,
NULL, vdev->opmode == wlan_op_mode_ocb); NULL, vdev->opmode == wlan_op_mode_ocb);
num_frags = cdf_nbuf_get_num_frags(msdu); num_frags = qdf_nbuf_get_num_frags(msdu);
/* num_frags are expected to be 2 max */ /* num_frags are expected to be 2 max */
num_frags = (num_frags > NBUF_CB_TX_MAX_EXTRA_FRAGS) num_frags = (num_frags > QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS)
? NBUF_CB_TX_MAX_EXTRA_FRAGS ? QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS
: num_frags; : num_frags;
#if defined(HELIUMPLUS_PADDR64) #if defined(HELIUMPLUS_PADDR64)
/* /*
@@ -463,8 +463,8 @@ ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev,
qdf_size_t frag_len; qdf_size_t frag_len;
qdf_dma_addr_t frag_paddr; qdf_dma_addr_t frag_paddr;
frag_len = cdf_nbuf_get_frag_len(msdu, i); frag_len = qdf_nbuf_get_frag_len(msdu, i);
frag_paddr = cdf_nbuf_get_frag_paddr(msdu, i); frag_paddr = qdf_nbuf_get_frag_paddr(msdu, i);
#if defined(HELIUMPLUS_PADDR64) #if defined(HELIUMPLUS_PADDR64)
htt_tx_desc_frag(pdev->htt_pdev, tx_desc->htt_frag_desc, htt_tx_desc_frag(pdev->htt_pdev, tx_desc->htt_frag_desc,
i - 1, frag_paddr, frag_len); i - 1, frag_paddr, frag_len);
@@ -491,8 +491,8 @@ ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev,
/* /*
* TODO : Can we remove this check and always download a fixed length ? * TODO : Can we remove this check and always download a fixed length ?
* */ * */
if (qdf_unlikely(cdf_nbuf_len(msdu) < pkt_download_len)) if (qdf_unlikely(qdf_nbuf_len(msdu) < pkt_download_len))
pkt_download_len = cdf_nbuf_len(msdu); pkt_download_len = qdf_nbuf_len(msdu);
/* Fill the HTC header information */ /* Fill the HTC header information */
/* /*
@@ -513,10 +513,10 @@ ol_tx_prepare_ll_fast(struct ol_txrx_pdev_t *pdev,
* *
* Return: on success return NULL, pointer to nbuf when it fails to send. * Return: on success return NULL, pointer to nbuf when it fails to send.
*/ */
cdf_nbuf_t qdf_nbuf_t
ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list) ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
{ {
cdf_nbuf_t msdu = msdu_list; qdf_nbuf_t msdu = msdu_list;
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
uint32_t pkt_download_len = uint32_t pkt_download_len =
((struct htt_pdev_t *)(pdev->htt_pdev))->download_len; ((struct htt_pdev_t *)(pdev->htt_pdev))->download_len;
@@ -532,11 +532,11 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* within the list. * within the list.
*/ */
while (msdu) { while (msdu) {
cdf_nbuf_t next; qdf_nbuf_t next;
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
int segments = 1; int segments = 1;
msdu_info.htt.info.ext_tid = cdf_nbuf_get_tid(msdu); msdu_info.htt.info.ext_tid = qdf_nbuf_get_tid(msdu);
msdu_info.peer = NULL; msdu_info.peer = NULL;
if (qdf_unlikely(ol_tx_prepare_tso(vdev, msdu, &msdu_info))) { if (qdf_unlikely(ol_tx_prepare_tso(vdev, msdu, &msdu_info))) {
@@ -553,7 +553,7 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* inside the ce_send_fast function, so store the next * inside the ce_send_fast function, so store the next
* pointer before the ce_send call. * pointer before the ce_send call.
*/ */
next = cdf_nbuf_next(msdu); next = qdf_nbuf_next(msdu);
/* init the current segment to the 1st segment in the list */ /* init the current segment to the 1st segment in the list */
while (segments) { while (segments) {
@@ -570,13 +570,13 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* receiving tx completion for all segments of an nbuf * receiving tx completion for all segments of an nbuf
*/ */
if (segments) if (segments)
cdf_nbuf_inc_users(msdu); qdf_nbuf_inc_users(msdu);
msdu_info.htt.info.frame_type = pdev->htt_pkt_type; msdu_info.htt.info.frame_type = pdev->htt_pkt_type;
msdu_info.htt.info.vdev_id = vdev->vdev_id; msdu_info.htt.info.vdev_id = vdev->vdev_id;
msdu_info.htt.action.cksum_offload = msdu_info.htt.action.cksum_offload =
cdf_nbuf_get_tx_cksum(msdu); qdf_nbuf_get_tx_cksum(msdu);
switch (cdf_nbuf_get_exemption_type(msdu)) { switch (qdf_nbuf_get_exemption_type(msdu)) {
case QDF_NBUF_EXEMPT_NO_EXEMPTION: case QDF_NBUF_EXEMPT_NO_EXEMPTION:
case QDF_NBUF_EXEMPT_ON_KEY_MAPPING_KEY_UNAVAILABLE: case QDF_NBUF_EXEMPT_ON_KEY_MAPPING_KEY_UNAVAILABLE:
/* We want to encrypt this frame */ /* We want to encrypt this frame */
@@ -619,7 +619,7 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
} }
if (msdu_info.tso_info.is_tso) { if (msdu_info.tso_info.is_tso) {
cdf_nbuf_reset_num_frags(msdu); qdf_nbuf_reset_num_frags(msdu);
TXRX_STATS_TSO_INC_SEG(vdev->pdev); TXRX_STATS_TSO_INC_SEG(vdev->pdev);
TXRX_STATS_TSO_INC_SEG_IDX(vdev->pdev); TXRX_STATS_TSO_INC_SEG_IDX(vdev->pdev);
} }
@@ -640,10 +640,10 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
return NULL; /* all MSDUs were accepted */ return NULL; /* all MSDUs were accepted */
} }
#else #else
cdf_nbuf_t qdf_nbuf_t
ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list) ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
{ {
cdf_nbuf_t msdu = msdu_list; qdf_nbuf_t msdu = msdu_list;
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
uint32_t pkt_download_len = uint32_t pkt_download_len =
((struct htt_pdev_t *)(pdev->htt_pdev))->download_len; ((struct htt_pdev_t *)(pdev->htt_pdev))->download_len;
@@ -660,17 +660,17 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* within the list. * within the list.
*/ */
while (msdu) { while (msdu) {
cdf_nbuf_t next; qdf_nbuf_t next;
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
msdu_info.htt.info.ext_tid = cdf_nbuf_get_tid(msdu); msdu_info.htt.info.ext_tid = qdf_nbuf_get_tid(msdu);
msdu_info.peer = NULL; msdu_info.peer = NULL;
msdu_info.htt.info.frame_type = pdev->htt_pkt_type; msdu_info.htt.info.frame_type = pdev->htt_pkt_type;
msdu_info.htt.info.vdev_id = vdev->vdev_id; msdu_info.htt.info.vdev_id = vdev->vdev_id;
msdu_info.htt.action.cksum_offload = msdu_info.htt.action.cksum_offload =
cdf_nbuf_get_tx_cksum(msdu); qdf_nbuf_get_tx_cksum(msdu);
switch (cdf_nbuf_get_exemption_type(msdu)) { switch (qdf_nbuf_get_exemption_type(msdu)) {
case QDF_NBUF_EXEMPT_NO_EXEMPTION: case QDF_NBUF_EXEMPT_NO_EXEMPTION:
case QDF_NBUF_EXEMPT_ON_KEY_MAPPING_KEY_UNAVAILABLE: case QDF_NBUF_EXEMPT_ON_KEY_MAPPING_KEY_UNAVAILABLE:
/* We want to encrypt this frame */ /* We want to encrypt this frame */
@@ -701,7 +701,7 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* inside the ce_send_fast function, so store the next * inside the ce_send_fast function, so store the next
* pointer before the ce_send call. * pointer before the ce_send call.
*/ */
next = cdf_nbuf_next(msdu); next = qdf_nbuf_next(msdu);
if ((0 == ce_send_fast(pdev->ce_tx_hdl, &msdu, 1, if ((0 == ce_send_fast(pdev->ce_tx_hdl, &msdu, 1,
ep_id))) { ep_id))) {
/* The packet could not be sent */ /* The packet could not be sent */
@@ -728,8 +728,8 @@ ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
* ol_tx_ll_wrapper() wrapper to ol_tx_ll * ol_tx_ll_wrapper() wrapper to ol_tx_ll
* *
*/ */
static inline cdf_nbuf_t static inline qdf_nbuf_t
ol_tx_ll_wrapper(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list) ol_tx_ll_wrapper(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
{ {
struct hif_opaque_softc *hif_device = struct hif_opaque_softc *hif_device =
(struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF); (struct hif_opaque_softc *)cds_get_context(QDF_MODULE_ID_HIF);
@@ -742,8 +742,8 @@ ol_tx_ll_wrapper(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
return msdu_list; return msdu_list;
} }
#else #else
static inline cdf_nbuf_t static inline qdf_nbuf_t
ol_tx_ll_wrapper(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list) ol_tx_ll_wrapper(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
{ {
return ol_tx_ll(vdev, msdu_list); return ol_tx_ll(vdev, msdu_list);
} }
@@ -778,17 +778,17 @@ static void ol_tx_vdev_ll_pause_queue_send_base(struct ol_txrx_vdev_t *vdev)
max_to_accept = vdev->pdev->tx_desc.num_free - max_to_accept = vdev->pdev->tx_desc.num_free -
OL_TX_VDEV_PAUSE_QUEUE_SEND_MARGIN; OL_TX_VDEV_PAUSE_QUEUE_SEND_MARGIN;
while (max_to_accept > 0 && vdev->ll_pause.txq.depth) { while (max_to_accept > 0 && vdev->ll_pause.txq.depth) {
cdf_nbuf_t tx_msdu; qdf_nbuf_t tx_msdu;
max_to_accept--; max_to_accept--;
vdev->ll_pause.txq.depth--; vdev->ll_pause.txq.depth--;
tx_msdu = vdev->ll_pause.txq.head; tx_msdu = vdev->ll_pause.txq.head;
if (tx_msdu) { if (tx_msdu) {
vdev->ll_pause.txq.head = cdf_nbuf_next(tx_msdu); vdev->ll_pause.txq.head = qdf_nbuf_next(tx_msdu);
if (NULL == vdev->ll_pause.txq.head) if (NULL == vdev->ll_pause.txq.head)
vdev->ll_pause.txq.tail = NULL; vdev->ll_pause.txq.tail = NULL;
cdf_nbuf_set_next(tx_msdu, NULL); qdf_nbuf_set_next(tx_msdu, NULL);
NBUF_UPDATE_TX_PKT_COUNT(tx_msdu, QDF_NBUF_UPDATE_TX_PKT_COUNT(tx_msdu,
NBUF_TX_PKT_TXRX_DEQUEUE); QDF_NBUF_TX_PKT_TXRX_DEQUEUE);
tx_msdu = ol_tx_ll_wrapper(vdev, tx_msdu); tx_msdu = ol_tx_ll_wrapper(vdev, tx_msdu);
/* /*
* It is unexpected that ol_tx_ll would reject the frame * It is unexpected that ol_tx_ll would reject the frame
@@ -799,9 +799,9 @@ static void ol_tx_vdev_ll_pause_queue_send_base(struct ol_txrx_vdev_t *vdev)
* For simplicity, just drop the frame. * For simplicity, just drop the frame.
*/ */
if (tx_msdu) { if (tx_msdu) {
cdf_nbuf_unmap(vdev->pdev->osdev, tx_msdu, qdf_nbuf_unmap(vdev->pdev->osdev, tx_msdu,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
cdf_nbuf_tx_free(tx_msdu, NBUF_PKT_ERROR); qdf_nbuf_tx_free(tx_msdu, QDF_NBUF_PKT_ERROR);
} }
} }
} }
@@ -817,33 +817,34 @@ static void ol_tx_vdev_ll_pause_queue_send_base(struct ol_txrx_vdev_t *vdev)
qdf_spin_unlock_bh(&vdev->ll_pause.mutex); qdf_spin_unlock_bh(&vdev->ll_pause.mutex);
} }
static cdf_nbuf_t static qdf_nbuf_t
ol_tx_vdev_pause_queue_append(struct ol_txrx_vdev_t *vdev, ol_tx_vdev_pause_queue_append(struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t msdu_list, uint8_t start_timer) qdf_nbuf_t msdu_list, uint8_t start_timer)
{ {
qdf_spin_lock_bh(&vdev->ll_pause.mutex); qdf_spin_lock_bh(&vdev->ll_pause.mutex);
while (msdu_list && while (msdu_list &&
vdev->ll_pause.txq.depth < vdev->ll_pause.max_q_depth) { vdev->ll_pause.txq.depth < vdev->ll_pause.max_q_depth) {
cdf_nbuf_t next = cdf_nbuf_next(msdu_list); qdf_nbuf_t next = qdf_nbuf_next(msdu_list);
NBUF_UPDATE_TX_PKT_COUNT(msdu_list, NBUF_TX_PKT_TXRX_ENQUEUE); QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu_list,
QDF_NBUF_TX_PKT_TXRX_ENQUEUE);
DPTRACE(qdf_dp_trace(msdu_list, DPTRACE(qdf_dp_trace(msdu_list,
QDF_DP_TRACE_TXRX_QUEUE_PACKET_PTR_RECORD, QDF_DP_TRACE_TXRX_QUEUE_PACKET_PTR_RECORD,
(uint8_t *)(cdf_nbuf_data(msdu_list)), (uint8_t *)(qdf_nbuf_data(msdu_list)),
sizeof(cdf_nbuf_data(msdu_list)))); sizeof(qdf_nbuf_data(msdu_list))));
vdev->ll_pause.txq.depth++; vdev->ll_pause.txq.depth++;
if (!vdev->ll_pause.txq.head) { if (!vdev->ll_pause.txq.head) {
vdev->ll_pause.txq.head = msdu_list; vdev->ll_pause.txq.head = msdu_list;
vdev->ll_pause.txq.tail = msdu_list; vdev->ll_pause.txq.tail = msdu_list;
} else { } else {
cdf_nbuf_set_next(vdev->ll_pause.txq.tail, msdu_list); qdf_nbuf_set_next(vdev->ll_pause.txq.tail, msdu_list);
} }
vdev->ll_pause.txq.tail = msdu_list; vdev->ll_pause.txq.tail = msdu_list;
msdu_list = next; msdu_list = next;
} }
if (vdev->ll_pause.txq.tail) if (vdev->ll_pause.txq.tail)
cdf_nbuf_set_next(vdev->ll_pause.txq.tail, NULL); qdf_nbuf_set_next(vdev->ll_pause.txq.tail, NULL);
if (start_timer) { if (start_timer) {
qdf_timer_stop(&vdev->ll_pause.timer); qdf_timer_stop(&vdev->ll_pause.timer);
@@ -860,7 +861,7 @@ ol_tx_vdev_pause_queue_append(struct ol_txrx_vdev_t *vdev,
* Store up the tx frame in the vdev's tx queue if the vdev is paused. * Store up the tx frame in the vdev's tx queue if the vdev is paused.
* If there are too many frames in the tx queue, reject it. * If there are too many frames in the tx queue, reject it.
*/ */
cdf_nbuf_t ol_tx_ll_queue(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list) qdf_nbuf_t ol_tx_ll_queue(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list)
{ {
uint16_t eth_type; uint16_t eth_type;
uint32_t paused_reason; uint32_t paused_reason;
@@ -874,10 +875,10 @@ cdf_nbuf_t ol_tx_ll_queue(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED) == OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED) ==
paused_reason)) { paused_reason)) {
eth_type = (((struct ethernet_hdr_t *) eth_type = (((struct ethernet_hdr_t *)
cdf_nbuf_data(msdu_list))-> qdf_nbuf_data(msdu_list))->
ethertype[0] << 8) | ethertype[0] << 8) |
(((struct ethernet_hdr_t *) (((struct ethernet_hdr_t *)
cdf_nbuf_data(msdu_list))->ethertype[1]); qdf_nbuf_data(msdu_list))->ethertype[1]);
if (ETHERTYPE_IS_EAPOL_WAPI(eth_type)) { if (ETHERTYPE_IS_EAPOL_WAPI(eth_type)) {
msdu_list = ol_tx_ll_wrapper(vdev, msdu_list); msdu_list = ol_tx_ll_wrapper(vdev, msdu_list);
return msdu_list; return msdu_list;
@@ -918,7 +919,7 @@ cdf_nbuf_t ol_tx_ll_queue(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list)
void ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev) void ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev)
{ {
int max_to_send; /* tracks how many frames have been sent */ int max_to_send; /* tracks how many frames have been sent */
cdf_nbuf_t tx_msdu; qdf_nbuf_t tx_msdu;
struct ol_txrx_vdev_t *vdev = NULL; struct ol_txrx_vdev_t *vdev = NULL;
uint8_t more; uint8_t more;
@@ -961,12 +962,12 @@ void ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev)
vdev->ll_pause.txq.depth--; vdev->ll_pause.txq.depth--;
vdev->ll_pause.txq.head = vdev->ll_pause.txq.head =
cdf_nbuf_next(tx_msdu); qdf_nbuf_next(tx_msdu);
if (NULL == vdev->ll_pause.txq.head) if (NULL == vdev->ll_pause.txq.head)
vdev->ll_pause.txq.tail = NULL; vdev->ll_pause.txq.tail = NULL;
cdf_nbuf_set_next(tx_msdu, NULL); qdf_nbuf_set_next(tx_msdu, NULL);
tx_msdu = ol_tx_ll_wrapper(vdev, tx_msdu); tx_msdu = ol_tx_ll_wrapper(vdev, tx_msdu);
/* /*
* It is unexpected that ol_tx_ll would reject * It is unexpected that ol_tx_ll would reject
@@ -978,10 +979,10 @@ void ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev)
* For simplicity, just drop the frame. * For simplicity, just drop the frame.
*/ */
if (tx_msdu) { if (tx_msdu) {
cdf_nbuf_unmap(pdev->osdev, tx_msdu, qdf_nbuf_unmap(pdev->osdev, tx_msdu,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
cdf_nbuf_tx_free(tx_msdu, qdf_nbuf_tx_free(tx_msdu,
NBUF_PKT_ERROR); QDF_NBUF_PKT_ERROR);
} }
} }
/*check if there are more msdus to transmit */ /*check if there are more msdus to transmit */
@@ -1038,11 +1039,11 @@ static inline uint8_t ol_txrx_tx_raw_subtype(enum ol_tx_spec tx_spec)
return sub_type; return sub_type;
} }
cdf_nbuf_t qdf_nbuf_t
ol_tx_non_std_ll(ol_txrx_vdev_handle vdev, ol_tx_non_std_ll(ol_txrx_vdev_handle vdev,
enum ol_tx_spec tx_spec, cdf_nbuf_t msdu_list) enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
{ {
cdf_nbuf_t msdu = msdu_list; qdf_nbuf_t msdu = msdu_list;
htt_pdev_handle htt_pdev = vdev->pdev->htt_pdev; htt_pdev_handle htt_pdev = vdev->pdev->htt_pdev;
struct ol_txrx_msdu_info_t msdu_info; struct ol_txrx_msdu_info_t msdu_info;
@@ -1056,10 +1057,10 @@ ol_tx_non_std_ll(ol_txrx_vdev_handle vdev,
* within the list. * within the list.
*/ */
while (msdu) { while (msdu) {
cdf_nbuf_t next; qdf_nbuf_t next;
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
msdu_info.htt.info.ext_tid = cdf_nbuf_get_tid(msdu); msdu_info.htt.info.ext_tid = qdf_nbuf_get_tid(msdu);
msdu_info.peer = NULL; msdu_info.peer = NULL;
msdu_info.tso_info.is_tso = 0; msdu_info.tso_info.is_tso = 0;
@@ -1070,7 +1071,7 @@ ol_tx_non_std_ll(ol_txrx_vdev_handle vdev,
* ol_tx_send function, so store the next pointer before the * ol_tx_send function, so store the next pointer before the
* tx_send call. * tx_send call.
*/ */
next = cdf_nbuf_next(msdu); next = qdf_nbuf_next(msdu);
if (tx_spec != ol_tx_spec_std) { if (tx_spec != ol_tx_spec_std) {
if (tx_spec & ol_tx_spec_no_free) { if (tx_spec & ol_tx_spec_no_free) {
@@ -1126,26 +1127,26 @@ ol_tx_non_std_ll(ol_txrx_vdev_handle vdev,
* parse_ocb_tx_header() - Function to check for OCB * parse_ocb_tx_header() - Function to check for OCB
* TX control header on a packet and extract it if present * TX control header on a packet and extract it if present
* *
* @msdu: Pointer to OS packet (cdf_nbuf_t) * @msdu: Pointer to OS packet (qdf_nbuf_t)
*/ */
#define OCB_HEADER_VERSION 1 #define OCB_HEADER_VERSION 1
bool parse_ocb_tx_header(cdf_nbuf_t msdu, bool parse_ocb_tx_header(qdf_nbuf_t msdu,
struct ocb_tx_ctrl_hdr_t *tx_ctrl) struct ocb_tx_ctrl_hdr_t *tx_ctrl)
{ {
struct ether_header *eth_hdr_p; struct ether_header *eth_hdr_p;
struct ocb_tx_ctrl_hdr_t *tx_ctrl_hdr; struct ocb_tx_ctrl_hdr_t *tx_ctrl_hdr;
/* Check if TX control header is present */ /* Check if TX control header is present */
eth_hdr_p = (struct ether_header *) cdf_nbuf_data(msdu); eth_hdr_p = (struct ether_header *) qdf_nbuf_data(msdu);
if (eth_hdr_p->ether_type != QDF_SWAP_U16(ETHERTYPE_OCB_TX)) if (eth_hdr_p->ether_type != QDF_SWAP_U16(ETHERTYPE_OCB_TX))
/* TX control header is not present. Nothing to do.. */ /* TX control header is not present. Nothing to do.. */
return true; return true;
/* Remove the ethernet header */ /* Remove the ethernet header */
cdf_nbuf_pull_head(msdu, sizeof(struct ether_header)); qdf_nbuf_pull_head(msdu, sizeof(struct ether_header));
/* Parse the TX control header */ /* Parse the TX control header */
tx_ctrl_hdr = (struct ocb_tx_ctrl_hdr_t *) cdf_nbuf_data(msdu); tx_ctrl_hdr = (struct ocb_tx_ctrl_hdr_t *) qdf_nbuf_data(msdu);
if (tx_ctrl_hdr->version == OCB_HEADER_VERSION) { if (tx_ctrl_hdr->version == OCB_HEADER_VERSION) {
if (tx_ctrl) if (tx_ctrl)
@@ -1157,13 +1158,13 @@ bool parse_ocb_tx_header(cdf_nbuf_t msdu,
} }
/* Remove the TX control header */ /* Remove the TX control header */
cdf_nbuf_pull_head(msdu, tx_ctrl_hdr->length); qdf_nbuf_pull_head(msdu, tx_ctrl_hdr->length);
return true; return true;
} }
cdf_nbuf_t qdf_nbuf_t
ol_tx_non_std(ol_txrx_vdev_handle vdev, ol_tx_non_std(ol_txrx_vdev_handle vdev,
enum ol_tx_spec tx_spec, cdf_nbuf_t msdu_list) enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
{ {
return ol_tx_non_std_ll(vdev, tx_spec, msdu_list); return ol_tx_non_std_ll(vdev, tx_spec, msdu_list);
} }
@@ -1230,7 +1231,7 @@ void dump_frag_desc(char *msg, struct ol_tx_desc_t *tx_desc)
int int
ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev, ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev,
cdf_nbuf_t tx_mgmt_frm, qdf_nbuf_t tx_mgmt_frm,
uint8_t type, uint8_t use_6mbps, uint16_t chanfreq) uint8_t type, uint8_t use_6mbps, uint16_t chanfreq)
{ {
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
@@ -1287,7 +1288,7 @@ ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev,
tx_msdu_info.peer = NULL; tx_msdu_info.peer = NULL;
cdf_nbuf_map_single(pdev->osdev, tx_mgmt_frm, QDF_DMA_TO_DEVICE); qdf_nbuf_map_single(pdev->osdev, tx_mgmt_frm, QDF_DMA_TO_DEVICE);
/* For LL tx_comp_req is not used so initialized to 0 */ /* For LL tx_comp_req is not used so initialized to 0 */
tx_msdu_info.htt.action.tx_comp_req = 0; tx_msdu_info.htt.action.tx_comp_req = 0;
tx_desc = ol_tx_desc_ll(pdev, vdev, tx_mgmt_frm, &tx_msdu_info); tx_desc = ol_tx_desc_ll(pdev, vdev, tx_mgmt_frm, &tx_msdu_info);
@@ -1310,7 +1311,7 @@ ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev,
htt_tx_desc_frags_table_set( htt_tx_desc_frags_table_set(
pdev->htt_pdev, pdev->htt_pdev,
tx_desc->htt_tx_desc, tx_desc->htt_tx_desc,
cdf_nbuf_get_frag_paddr(tx_mgmt_frm, 1), qdf_nbuf_get_frag_paddr(tx_mgmt_frm, 1),
0, 0); 0, 0);
#if defined(HELIUMPLUS_PADDR64) && defined(HELIUMPLUS_DEBUG) #if defined(HELIUMPLUS_PADDR64) && defined(HELIUMPLUS_DEBUG)
dump_frag_desc( dump_frag_desc(
@@ -1319,7 +1320,7 @@ ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev,
#endif /* defined(HELIUMPLUS_PADDR64) */ #endif /* defined(HELIUMPLUS_PADDR64) */
} }
if (!tx_desc) { if (!tx_desc) {
cdf_nbuf_unmap_single(pdev->osdev, tx_mgmt_frm, qdf_nbuf_unmap_single(pdev->osdev, tx_mgmt_frm,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
return -EINVAL; /* can't accept the tx mgmt frame */ return -EINVAL; /* can't accept the tx mgmt frame */
} }
@@ -1328,7 +1329,9 @@ ol_txrx_mgmt_send(ol_txrx_vdev_handle vdev,
tx_desc->pkt_type = type + OL_TXRX_MGMT_TYPE_BASE; tx_desc->pkt_type = type + OL_TXRX_MGMT_TYPE_BASE;
htt_tx_desc_set_chanfreq(tx_desc->htt_tx_desc, chanfreq); htt_tx_desc_set_chanfreq(tx_desc->htt_tx_desc, chanfreq);
NBUF_CB_TX_PACKET_TRACK(tx_desc->netbuf) = NBUF_TX_PKT_MGMT_TRACK; ol_tx_send_nonstd(pdev, tx_desc, tx_mgmt_frm, QDF_NBUF_CB_TX_PACKET_TRACK(tx_desc->netbuf) =
QDF_NBUF_TX_PKT_MGMT_TRACK;
ol_tx_send_nonstd(pdev, tx_desc, tx_mgmt_frm,
htt_pkt_type_mgmt); htt_pkt_type_mgmt);
return 0; /* accepted the tx mgmt frame */ return 0; /* accepted the tx mgmt frame */
@@ -1339,8 +1342,8 @@ void ol_txrx_sync(ol_txrx_pdev_handle pdev, uint8_t sync_cnt)
htt_h2t_sync_msg(pdev->htt_pdev, sync_cnt); htt_h2t_sync_msg(pdev->htt_pdev, sync_cnt);
} }
cdf_nbuf_t ol_tx_reinject(struct ol_txrx_vdev_t *vdev, qdf_nbuf_t ol_tx_reinject(struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t msdu, uint16_t peer_id) qdf_nbuf_t msdu, uint16_t peer_id)
{ {
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
struct ol_txrx_msdu_info_t msdu_info; struct ol_txrx_msdu_info_t msdu_info;

Переглянути файл

@@ -32,18 +32,18 @@
#ifndef _OL_TX__H_ #ifndef _OL_TX__H_
#define _OL_TX__H_ #define _OL_TX__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <qdf_lock.h> #include <qdf_lock.h>
#include <ol_txrx_api.h> /* ol_txrx_vdev_handle */ #include <ol_txrx_api.h> /* ol_txrx_vdev_handle */
#include <ol_txrx_types.h> /* ol_tx_desc_t, ol_txrx_msdu_info_t */ #include <ol_txrx_types.h> /* ol_tx_desc_t, ol_txrx_msdu_info_t */
cdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list); qdf_nbuf_t ol_tx_ll(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list);
#ifdef WLAN_FEATURE_FASTPATH #ifdef WLAN_FEATURE_FASTPATH
cdf_nbuf_t ol_tx_ll_fast(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list); qdf_nbuf_t ol_tx_ll_fast(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list);
#endif #endif
cdf_nbuf_t ol_tx_ll_queue(ol_txrx_vdev_handle vdev, cdf_nbuf_t msdu_list); qdf_nbuf_t ol_tx_ll_queue(ol_txrx_vdev_handle vdev, qdf_nbuf_t msdu_list);
#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
#define OL_TX_LL ol_tx_ll_queue #define OL_TX_LL ol_tx_ll_queue
@@ -65,14 +65,14 @@ void ol_tx_pdev_ll_pause_queue_send_all(struct ol_txrx_pdev_t *pdev)
return; return;
} }
#endif #endif
cdf_nbuf_t qdf_nbuf_t
ol_tx_non_std_ll(ol_txrx_vdev_handle data_vdev, ol_tx_non_std_ll(ol_txrx_vdev_handle data_vdev,
enum ol_tx_spec tx_spec, cdf_nbuf_t msdu_list); enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
cdf_nbuf_t qdf_nbuf_t
ol_tx_reinject(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu, uint16_t peer_id); ol_tx_reinject(struct ol_txrx_vdev_t *vdev, qdf_nbuf_t msdu, uint16_t peer_id);
void ol_txrx_mgmt_tx_complete(void *ctxt, cdf_nbuf_t netbuf, int err); void ol_txrx_mgmt_tx_complete(void *ctxt, qdf_nbuf_t netbuf, int err);
#if defined(FEATURE_TSO) #if defined(FEATURE_TSO)

Переглянути файл

@@ -26,7 +26,7 @@
*/ */
#include <qdf_net_types.h> /* QDF_NBUF_EXEMPT_NO_EXEMPTION, etc. */ #include <qdf_net_types.h> /* QDF_NBUF_EXEMPT_NO_EXEMPTION, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_util.h> /* qdf_assert */ #include <qdf_util.h> /* qdf_assert */
#include <qdf_lock.h> /* cdf_spinlock */ #include <qdf_lock.h> /* cdf_spinlock */
#ifdef QCA_COMPUTE_TX_DELAY #ifdef QCA_COMPUTE_TX_DELAY
@@ -307,12 +307,12 @@ extern void
dump_frag_desc(char *msg, struct ol_tx_desc_t *tx_desc); dump_frag_desc(char *msg, struct ol_tx_desc_t *tx_desc);
void void
dump_pkt(cdf_nbuf_t nbuf, qdf_dma_addr_t nbuf_paddr, int len) dump_pkt(qdf_nbuf_t nbuf, qdf_dma_addr_t nbuf_paddr, int len)
{ {
qdf_print("%s: Pkt: VA 0x%p PA 0x%llx len %d\n", __func__, qdf_print("%s: Pkt: VA 0x%p PA 0x%llx len %d\n", __func__,
cdf_nbuf_data(nbuf), nbuf_paddr, len); qdf_nbuf_data(nbuf), nbuf_paddr, len);
print_hex_dump(KERN_DEBUG, "Pkt: ", DUMP_PREFIX_ADDRESS, 16, 4, print_hex_dump(KERN_DEBUG, "Pkt: ", DUMP_PREFIX_ADDRESS, 16, 4,
cdf_nbuf_data(nbuf), len, true); qdf_nbuf_data(nbuf), len, true);
} }
const uint32_t htt_to_ce_pkt_type[] = { const uint32_t htt_to_ce_pkt_type[] = {
@@ -326,7 +326,7 @@ const uint32_t htt_to_ce_pkt_type[] = {
struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_vdev_t *vdev, struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t netbuf, qdf_nbuf_t netbuf,
struct ol_txrx_msdu_info_t *msdu_info) struct ol_txrx_msdu_info_t *msdu_info)
{ {
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
@@ -334,8 +334,8 @@ struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev,
uint32_t num_frags; uint32_t num_frags;
msdu_info->htt.info.vdev_id = vdev->vdev_id; msdu_info->htt.info.vdev_id = vdev->vdev_id;
msdu_info->htt.action.cksum_offload = cdf_nbuf_get_tx_cksum(netbuf); msdu_info->htt.action.cksum_offload = qdf_nbuf_get_tx_cksum(netbuf);
switch (cdf_nbuf_get_exemption_type(netbuf)) { switch (qdf_nbuf_get_exemption_type(netbuf)) {
case QDF_NBUF_EXEMPT_NO_EXEMPTION: case QDF_NBUF_EXEMPT_NO_EXEMPTION:
case QDF_NBUF_EXEMPT_ON_KEY_MAPPING_KEY_UNAVAILABLE: case QDF_NBUF_EXEMPT_ON_KEY_MAPPING_KEY_UNAVAILABLE:
/* We want to encrypt this frame */ /* We want to encrypt this frame */
@@ -379,10 +379,10 @@ struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev,
* Skip the prefix fragment (HTT tx descriptor) that was added * Skip the prefix fragment (HTT tx descriptor) that was added
* during the call to htt_tx_desc_init above. * during the call to htt_tx_desc_init above.
*/ */
num_frags = cdf_nbuf_get_num_frags(netbuf); num_frags = qdf_nbuf_get_num_frags(netbuf);
/* num_frags are expected to be 2 max */ /* num_frags are expected to be 2 max */
num_frags = (num_frags > NBUF_CB_TX_MAX_EXTRA_FRAGS) num_frags = (num_frags > QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS)
? NBUF_CB_TX_MAX_EXTRA_FRAGS ? QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS
: num_frags; : num_frags;
#if defined(HELIUMPLUS_PADDR64) #if defined(HELIUMPLUS_PADDR64)
/* /*
@@ -408,10 +408,10 @@ struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev,
qdf_dma_addr_t frag_paddr; qdf_dma_addr_t frag_paddr;
#ifdef HELIUMPLUS_DEBUG #ifdef HELIUMPLUS_DEBUG
void *frag_vaddr; void *frag_vaddr;
frag_vaddr = cdf_nbuf_get_frag_vaddr(netbuf, i); frag_vaddr = qdf_nbuf_get_frag_vaddr(netbuf, i);
#endif #endif
frag_len = cdf_nbuf_get_frag_len(netbuf, i); frag_len = qdf_nbuf_get_frag_len(netbuf, i);
frag_paddr = cdf_nbuf_get_frag_paddr(netbuf, i); frag_paddr = qdf_nbuf_get_frag_paddr(netbuf, i);
#if defined(HELIUMPLUS_PADDR64) #if defined(HELIUMPLUS_PADDR64)
htt_tx_desc_frag(pdev->htt_pdev, tx_desc->htt_frag_desc, i - 1, htt_tx_desc_frag(pdev->htt_pdev, tx_desc->htt_frag_desc, i - 1,
frag_paddr, frag_len); frag_paddr, frag_len);
@@ -438,25 +438,25 @@ void ol_tx_desc_frame_list_free(struct ol_txrx_pdev_t *pdev,
ol_tx_desc_list *tx_descs, int had_error) ol_tx_desc_list *tx_descs, int had_error)
{ {
struct ol_tx_desc_t *tx_desc, *tmp; struct ol_tx_desc_t *tx_desc, *tmp;
cdf_nbuf_t msdus = NULL; qdf_nbuf_t msdus = NULL;
TAILQ_FOREACH_SAFE(tx_desc, tx_descs, tx_desc_list_elem, tmp) { TAILQ_FOREACH_SAFE(tx_desc, tx_descs, tx_desc_list_elem, tmp) {
cdf_nbuf_t msdu = tx_desc->netbuf; qdf_nbuf_t msdu = tx_desc->netbuf;
qdf_atomic_init(&tx_desc->ref_cnt); /* clear the ref cnt */ qdf_atomic_init(&tx_desc->ref_cnt); /* clear the ref cnt */
#ifdef QCA_SUPPORT_SW_TXRX_ENCAP #ifdef QCA_SUPPORT_SW_TXRX_ENCAP
/* restore original hdr offset */ /* restore original hdr offset */
OL_TX_RESTORE_HDR(tx_desc, msdu); OL_TX_RESTORE_HDR(tx_desc, msdu);
#endif #endif
cdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_TO_DEVICE); qdf_nbuf_unmap(pdev->osdev, msdu, QDF_DMA_TO_DEVICE);
/* free the tx desc */ /* free the tx desc */
ol_tx_desc_free(pdev, tx_desc); ol_tx_desc_free(pdev, tx_desc);
/* link the netbuf into a list to free as a batch */ /* link the netbuf into a list to free as a batch */
cdf_nbuf_set_next(msdu, msdus); qdf_nbuf_set_next(msdu, msdus);
msdus = msdu; msdus = msdu;
} }
/* free the netbufs as a batch */ /* free the netbufs as a batch */
cdf_nbuf_tx_free(msdus, had_error); qdf_nbuf_tx_free(msdus, had_error);
} }
void ol_tx_desc_frame_free_nonstd(struct ol_txrx_pdev_t *pdev, void ol_tx_desc_frame_free_nonstd(struct ol_txrx_pdev_t *pdev,
@@ -472,11 +472,11 @@ void ol_tx_desc_frame_free_nonstd(struct ol_txrx_pdev_t *pdev,
OL_TX_RESTORE_HDR(tx_desc, (tx_desc->netbuf)); OL_TX_RESTORE_HDR(tx_desc, (tx_desc->netbuf));
#endif #endif
trace_str = (had_error) ? "OT:C:F:" : "OT:C:S:"; trace_str = (had_error) ? "OT:C:F:" : "OT:C:S:";
cdf_nbuf_trace_update(tx_desc->netbuf, trace_str); qdf_nbuf_trace_update(tx_desc->netbuf, trace_str);
if (tx_desc->pkt_type == ol_tx_frm_no_free) { if (tx_desc->pkt_type == ol_tx_frm_no_free) {
/* free the tx desc but don't unmap or free the frame */ /* free the tx desc but don't unmap or free the frame */
if (pdev->tx_data_callback.func) { if (pdev->tx_data_callback.func) {
cdf_nbuf_set_next(tx_desc->netbuf, NULL); qdf_nbuf_set_next(tx_desc->netbuf, NULL);
pdev->tx_data_callback.func(pdev->tx_data_callback.ctxt, pdev->tx_data_callback.func(pdev->tx_data_callback.ctxt,
tx_desc->netbuf, had_error); tx_desc->netbuf, had_error);
ol_tx_desc_free(pdev, tx_desc); ol_tx_desc_free(pdev, tx_desc);
@@ -484,7 +484,7 @@ void ol_tx_desc_frame_free_nonstd(struct ol_txrx_pdev_t *pdev,
} }
/* let the code below unmap and free the frame */ /* let the code below unmap and free the frame */
} }
cdf_nbuf_unmap(pdev->osdev, tx_desc->netbuf, QDF_DMA_TO_DEVICE); qdf_nbuf_unmap(pdev->osdev, tx_desc->netbuf, QDF_DMA_TO_DEVICE);
/* check the frame type to see what kind of special steps are needed */ /* check the frame type to see what kind of special steps are needed */
if ((tx_desc->pkt_type >= OL_TXRX_MGMT_TYPE_BASE) && if ((tx_desc->pkt_type >= OL_TXRX_MGMT_TYPE_BASE) &&
(tx_desc->pkt_type != 0xff)) { (tx_desc->pkt_type != 0xff)) {
@@ -524,11 +524,11 @@ void ol_tx_desc_frame_free_nonstd(struct ol_txrx_pdev_t *pdev,
ota_ack_cb(ctxt, tx_desc->netbuf, had_error); ota_ack_cb(ctxt, tx_desc->netbuf, had_error);
} }
/* free the netbuf */ /* free the netbuf */
cdf_nbuf_free(tx_desc->netbuf); qdf_nbuf_free(tx_desc->netbuf);
} else { } else {
/* single regular frame */ /* single regular frame */
cdf_nbuf_set_next(tx_desc->netbuf, NULL); qdf_nbuf_set_next(tx_desc->netbuf, NULL);
cdf_nbuf_tx_free(tx_desc->netbuf, had_error); qdf_nbuf_tx_free(tx_desc->netbuf, had_error);
} }
/* free the tx desc */ /* free the tx desc */
ol_tx_desc_free(pdev, tx_desc); ol_tx_desc_free(pdev, tx_desc);

Переглянути файл

@@ -33,7 +33,7 @@
#define _OL_TX_DESC__H_ #define _OL_TX_DESC__H_
#include <cds_queue.h> /* TAILQ_HEAD */ #include <cds_queue.h> /* TAILQ_HEAD */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_txrx_types.h> /* ol_tx_desc_t */ #include <ol_txrx_types.h> /* ol_tx_desc_t */
#include <ol_txrx_internal.h> /*TXRX_ASSERT2 */ #include <ol_txrx_internal.h> /*TXRX_ASSERT2 */
@@ -63,7 +63,7 @@ ol_tx_desc_alloc_wrapper(struct ol_txrx_pdev_t *pdev,
*/ */
struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev, struct ol_tx_desc_t *ol_tx_desc_ll(struct ol_txrx_pdev_t *pdev,
struct ol_txrx_vdev_t *vdev, struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t netbuf, qdf_nbuf_t netbuf,
struct ol_txrx_msdu_info_t *msdu_info); struct ol_txrx_msdu_info_t *msdu_info);
/** /**

Переглянути файл

@@ -25,7 +25,7 @@
* to the Linux Foundation. * to the Linux Foundation.
*/ */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_atomic.h> /* qdf_atomic_read, etc. */ #include <qdf_atomic.h> /* qdf_atomic_read, etc. */
#include <ol_cfg.h> /* ol_cfg_addba_retry */ #include <ol_cfg.h> /* ol_cfg_addba_retry */
#include <htt.h> /* HTT_TX_EXT_TID_MGMT */ #include <htt.h> /* HTT_TX_EXT_TID_MGMT */
@@ -91,14 +91,14 @@ void ol_txrx_vdev_flush(ol_txrx_vdev_handle vdev)
qdf_timer_stop(&vdev->ll_pause.timer); qdf_timer_stop(&vdev->ll_pause.timer);
vdev->ll_pause.is_q_timer_on = false; vdev->ll_pause.is_q_timer_on = false;
while (vdev->ll_pause.txq.head) { while (vdev->ll_pause.txq.head) {
cdf_nbuf_t next = qdf_nbuf_t next =
cdf_nbuf_next(vdev->ll_pause.txq.head); qdf_nbuf_next(vdev->ll_pause.txq.head);
cdf_nbuf_set_next(vdev->ll_pause.txq.head, NULL); qdf_nbuf_set_next(vdev->ll_pause.txq.head, NULL);
cdf_nbuf_unmap(vdev->pdev->osdev, qdf_nbuf_unmap(vdev->pdev->osdev,
vdev->ll_pause.txq.head, vdev->ll_pause.txq.head,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
cdf_nbuf_tx_free(vdev->ll_pause.txq.head, qdf_nbuf_tx_free(vdev->ll_pause.txq.head,
NBUF_PKT_ERROR); QDF_NBUF_PKT_ERROR);
vdev->ll_pause.txq.head = next; vdev->ll_pause.txq.head = next;
} }
vdev->ll_pause.txq.tail = NULL; vdev->ll_pause.txq.tail = NULL;

Переглянути файл

@@ -32,7 +32,7 @@
#ifndef _OL_TX_QUEUE__H_ #ifndef _OL_TX_QUEUE__H_
#define _OL_TX_QUEUE__H_ #define _OL_TX_QUEUE__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */ #include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */
#include <qdf_types.h> /* bool */ #include <qdf_types.h> /* bool */

Переглянути файл

@@ -28,7 +28,7 @@
#include <qdf_atomic.h> /* qdf_atomic_inc, etc. */ #include <qdf_atomic.h> /* qdf_atomic_inc, etc. */
#include <qdf_lock.h> /* cdf_os_spinlock */ #include <qdf_lock.h> /* cdf_os_spinlock */
#include <qdf_time.h> /* qdf_system_ticks, etc. */ #include <qdf_time.h> /* qdf_system_ticks, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <qdf_net_types.h> /* QDF_NBUF_TX_EXT_TID_INVALID */ #include <qdf_net_types.h> /* QDF_NBUF_TX_EXT_TID_INVALID */
#include <cds_queue.h> /* TAILQ */ #include <cds_queue.h> /* TAILQ */
@@ -133,15 +133,15 @@
static inline uint16_t static inline uint16_t
ol_tx_send_base(struct ol_txrx_pdev_t *pdev, ol_tx_send_base(struct ol_txrx_pdev_t *pdev,
struct ol_tx_desc_t *tx_desc, cdf_nbuf_t msdu) struct ol_tx_desc_t *tx_desc, qdf_nbuf_t msdu)
{ {
int msdu_credit_consumed; int msdu_credit_consumed;
TX_CREDIT_DEBUG_PRINT("TX %d bytes\n", cdf_nbuf_len(msdu)); TX_CREDIT_DEBUG_PRINT("TX %d bytes\n", qdf_nbuf_len(msdu));
TX_CREDIT_DEBUG_PRINT(" <HTT> Decrease credit %d - 1 = %d, len:%d.\n", TX_CREDIT_DEBUG_PRINT(" <HTT> Decrease credit %d - 1 = %d, len:%d.\n",
qdf_atomic_read(&pdev->target_tx_credit), qdf_atomic_read(&pdev->target_tx_credit),
qdf_atomic_read(&pdev->target_tx_credit) - 1, qdf_atomic_read(&pdev->target_tx_credit) - 1,
cdf_nbuf_len(msdu)); qdf_nbuf_len(msdu));
msdu_credit_consumed = htt_tx_msdu_credit(msdu); msdu_credit_consumed = htt_tx_msdu_credit(msdu);
OL_TX_TARGET_CREDIT_DECR_INT(pdev, msdu_credit_consumed); OL_TX_TARGET_CREDIT_DECR_INT(pdev, msdu_credit_consumed);
@@ -174,7 +174,7 @@ ol_tx_send_base(struct ol_txrx_pdev_t *pdev,
void void
ol_tx_send(struct ol_txrx_pdev_t *pdev, ol_tx_send(struct ol_txrx_pdev_t *pdev,
struct ol_tx_desc_t *tx_desc, cdf_nbuf_t msdu) struct ol_tx_desc_t *tx_desc, qdf_nbuf_t msdu)
{ {
int msdu_credit_consumed; int msdu_credit_consumed;
uint16_t id; uint16_t id;
@@ -182,10 +182,10 @@ ol_tx_send(struct ol_txrx_pdev_t *pdev,
msdu_credit_consumed = ol_tx_send_base(pdev, tx_desc, msdu); msdu_credit_consumed = ol_tx_send_base(pdev, tx_desc, msdu);
id = ol_tx_desc_id(pdev, tx_desc); id = ol_tx_desc_id(pdev, tx_desc);
NBUF_UPDATE_TX_PKT_COUNT(msdu, NBUF_TX_PKT_TXRX); QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu, QDF_NBUF_TX_PKT_TXRX);
DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_TXRX_PACKET_PTR_RECORD, DPTRACE(qdf_dp_trace(msdu, QDF_DP_TRACE_TXRX_PACKET_PTR_RECORD,
(uint8_t *)(cdf_nbuf_data(msdu)), (uint8_t *)(qdf_nbuf_data(msdu)),
sizeof(cdf_nbuf_data(msdu)))); sizeof(qdf_nbuf_data(msdu))));
failed = htt_tx_send_std(pdev->htt_pdev, msdu, id); failed = htt_tx_send_std(pdev->htt_pdev, msdu, id);
if (qdf_unlikely(failed)) { if (qdf_unlikely(failed)) {
OL_TX_TARGET_CREDIT_INCR_INT(pdev, msdu_credit_consumed); OL_TX_TARGET_CREDIT_INCR_INT(pdev, msdu_credit_consumed);
@@ -195,18 +195,18 @@ ol_tx_send(struct ol_txrx_pdev_t *pdev,
void void
ol_tx_send_batch(struct ol_txrx_pdev_t *pdev, ol_tx_send_batch(struct ol_txrx_pdev_t *pdev,
cdf_nbuf_t head_msdu, int num_msdus) qdf_nbuf_t head_msdu, int num_msdus)
{ {
cdf_nbuf_t rejected; qdf_nbuf_t rejected;
OL_TX_CREDIT_RECLAIM(pdev); OL_TX_CREDIT_RECLAIM(pdev);
rejected = htt_tx_send_batch(pdev->htt_pdev, head_msdu, num_msdus); rejected = htt_tx_send_batch(pdev->htt_pdev, head_msdu, num_msdus);
while (qdf_unlikely(rejected)) { while (qdf_unlikely(rejected)) {
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
uint16_t *msdu_id_storage; uint16_t *msdu_id_storage;
cdf_nbuf_t next; qdf_nbuf_t next;
next = cdf_nbuf_next(rejected); next = qdf_nbuf_next(rejected);
msdu_id_storage = ol_tx_msdu_id_storage(rejected); msdu_id_storage = ol_tx_msdu_id_storage(rejected);
tx_desc = ol_tx_desc_find(pdev, *msdu_id_storage); tx_desc = ol_tx_desc_find(pdev, *msdu_id_storage);
@@ -220,7 +220,7 @@ ol_tx_send_batch(struct ol_txrx_pdev_t *pdev,
void void
ol_tx_send_nonstd(struct ol_txrx_pdev_t *pdev, ol_tx_send_nonstd(struct ol_txrx_pdev_t *pdev,
struct ol_tx_desc_t *tx_desc, struct ol_tx_desc_t *tx_desc,
cdf_nbuf_t msdu, enum htt_pkt_type pkt_type) qdf_nbuf_t msdu, enum htt_pkt_type pkt_type)
{ {
int msdu_credit_consumed; int msdu_credit_consumed;
uint16_t id; uint16_t id;
@@ -228,7 +228,7 @@ ol_tx_send_nonstd(struct ol_txrx_pdev_t *pdev,
msdu_credit_consumed = ol_tx_send_base(pdev, tx_desc, msdu); msdu_credit_consumed = ol_tx_send_base(pdev, tx_desc, msdu);
id = ol_tx_desc_id(pdev, tx_desc); id = ol_tx_desc_id(pdev, tx_desc);
NBUF_UPDATE_TX_PKT_COUNT(msdu, NBUF_TX_PKT_TXRX); QDF_NBUF_UPDATE_TX_PKT_COUNT(msdu, QDF_NBUF_TX_PKT_TXRX);
failed = htt_tx_send_nonstd(pdev->htt_pdev, msdu, id, pkt_type); failed = htt_tx_send_nonstd(pdev->htt_pdev, msdu, id, pkt_type);
if (failed) { if (failed) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
@@ -240,7 +240,7 @@ ol_tx_send_nonstd(struct ol_txrx_pdev_t *pdev,
static inline void static inline void
ol_tx_download_done_base(struct ol_txrx_pdev_t *pdev, ol_tx_download_done_base(struct ol_txrx_pdev_t *pdev,
A_STATUS status, cdf_nbuf_t msdu, uint16_t msdu_id) A_STATUS status, qdf_nbuf_t msdu, uint16_t msdu_id)
{ {
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
@@ -283,7 +283,7 @@ ol_tx_download_done_base(struct ol_txrx_pdev_t *pdev,
void void
ol_tx_download_done_ll(void *pdev, ol_tx_download_done_ll(void *pdev,
A_STATUS status, cdf_nbuf_t msdu, uint16_t msdu_id) A_STATUS status, qdf_nbuf_t msdu, uint16_t msdu_id)
{ {
ol_tx_download_done_base((struct ol_txrx_pdev_t *)pdev, status, msdu, ol_tx_download_done_base((struct ol_txrx_pdev_t *)pdev, status, msdu,
msdu_id); msdu_id);
@@ -292,7 +292,7 @@ ol_tx_download_done_ll(void *pdev,
void void
ol_tx_download_done_hl_retain(void *txrx_pdev, ol_tx_download_done_hl_retain(void *txrx_pdev,
A_STATUS status, A_STATUS status,
cdf_nbuf_t msdu, uint16_t msdu_id) qdf_nbuf_t msdu, uint16_t msdu_id)
{ {
struct ol_txrx_pdev_t *pdev = txrx_pdev; struct ol_txrx_pdev_t *pdev = txrx_pdev;
ol_tx_download_done_base(pdev, status, msdu, msdu_id); ol_tx_download_done_base(pdev, status, msdu, msdu_id);
@@ -300,7 +300,7 @@ ol_tx_download_done_hl_retain(void *txrx_pdev,
void void
ol_tx_download_done_hl_free(void *txrx_pdev, ol_tx_download_done_hl_free(void *txrx_pdev,
A_STATUS status, cdf_nbuf_t msdu, uint16_t msdu_id) A_STATUS status, qdf_nbuf_t msdu, uint16_t msdu_id)
{ {
struct ol_txrx_pdev_t *pdev = txrx_pdev; struct ol_txrx_pdev_t *pdev = txrx_pdev;
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
@@ -363,8 +363,8 @@ ol_tx_delay_compute(struct ol_txrx_pdev_t *pdev,
qdf_atomic_init(&(_tx_desc)->ref_cnt); \ qdf_atomic_init(&(_tx_desc)->ref_cnt); \
/* restore orginal hdr offset */ \ /* restore orginal hdr offset */ \
OL_TX_RESTORE_HDR((_tx_desc), (_netbuf)); \ OL_TX_RESTORE_HDR((_tx_desc), (_netbuf)); \
cdf_nbuf_unmap((_pdev)->osdev, (_netbuf), QDF_DMA_TO_DEVICE); \ qdf_nbuf_unmap((_pdev)->osdev, (_netbuf), QDF_DMA_TO_DEVICE); \
cdf_nbuf_free((_netbuf)); \ qdf_nbuf_free((_netbuf)); \
((union ol_tx_desc_list_elem_t *)(_tx_desc))->next = \ ((union ol_tx_desc_list_elem_t *)(_tx_desc))->next = \
(_lcl_freelist); \ (_lcl_freelist); \
if (qdf_unlikely(!lcl_freelist)) { \ if (qdf_unlikely(!lcl_freelist)) { \
@@ -379,8 +379,8 @@ ol_tx_delay_compute(struct ol_txrx_pdev_t *pdev,
do { \ do { \
/* restore orginal hdr offset */ \ /* restore orginal hdr offset */ \
OL_TX_RESTORE_HDR((_tx_desc), (_netbuf)); \ OL_TX_RESTORE_HDR((_tx_desc), (_netbuf)); \
cdf_nbuf_unmap((_pdev)->osdev, (_netbuf), QDF_DMA_TO_DEVICE); \ qdf_nbuf_unmap((_pdev)->osdev, (_netbuf), QDF_DMA_TO_DEVICE); \
cdf_nbuf_free((_netbuf)); \ qdf_nbuf_free((_netbuf)); \
((union ol_tx_desc_list_elem_t *)(_tx_desc))->next = \ ((union ol_tx_desc_list_elem_t *)(_tx_desc))->next = \
(_lcl_freelist); \ (_lcl_freelist); \
if (qdf_unlikely(!lcl_freelist)) { \ if (qdf_unlikely(!lcl_freelist)) { \
@@ -488,7 +488,7 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev,
char *trace_str; char *trace_str;
uint32_t byte_cnt = 0; uint32_t byte_cnt = 0;
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
union ol_tx_desc_list_elem_t *lcl_freelist = NULL; union ol_tx_desc_list_elem_t *lcl_freelist = NULL;
union ol_tx_desc_list_elem_t *tx_desc_last = NULL; union ol_tx_desc_list_elem_t *tx_desc_last = NULL;
@@ -505,9 +505,9 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev,
netbuf = tx_desc->netbuf; netbuf = tx_desc->netbuf;
qdf_runtime_pm_put(); qdf_runtime_pm_put();
cdf_nbuf_trace_update(netbuf, trace_str); qdf_nbuf_trace_update(netbuf, trace_str);
/* Per SDU update of byte count */ /* Per SDU update of byte count */
byte_cnt += cdf_nbuf_len(netbuf); byte_cnt += qdf_nbuf_len(netbuf);
if (OL_TX_DESC_NO_REFS(tx_desc)) { if (OL_TX_DESC_NO_REFS(tx_desc)) {
ol_tx_statistics( ol_tx_statistics(
pdev->ctrl_pdev, pdev->ctrl_pdev,
@@ -518,7 +518,7 @@ ol_tx_completion_handler(ol_txrx_pdev_handle pdev,
ol_tx_msdu_complete(pdev, tx_desc, tx_descs, netbuf, ol_tx_msdu_complete(pdev, tx_desc, tx_descs, netbuf,
lcl_freelist, tx_desc_last, status); lcl_freelist, tx_desc_last, status);
} }
NBUF_UPDATE_TX_PKT_COUNT(netbuf, NBUF_TX_PKT_FREE); QDF_NBUF_UPDATE_TX_PKT_COUNT(netbuf, QDF_NBUF_TX_PKT_FREE);
#ifdef QCA_SUPPORT_TXDESC_SANITY_CHECKS #ifdef QCA_SUPPORT_TXDESC_SANITY_CHECKS
tx_desc->pkt_type = 0xff; tx_desc->pkt_type = 0xff;
#ifdef QCA_COMPUTE_TX_DELAY #ifdef QCA_COMPUTE_TX_DELAY
@@ -561,15 +561,15 @@ ol_tx_single_completion_handler(ol_txrx_pdev_handle pdev,
enum htt_tx_status status, uint16_t tx_desc_id) enum htt_tx_status status, uint16_t tx_desc_id)
{ {
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
tx_desc = ol_tx_desc_find(pdev, tx_desc_id); tx_desc = ol_tx_desc_find(pdev, tx_desc_id);
tx_desc->status = status; tx_desc->status = status;
netbuf = tx_desc->netbuf; netbuf = tx_desc->netbuf;
NBUF_UPDATE_TX_PKT_COUNT(netbuf, NBUF_TX_PKT_FREE); QDF_NBUF_UPDATE_TX_PKT_COUNT(netbuf, QDF_NBUF_TX_PKT_FREE);
/* Do one shot statistics */ /* Do one shot statistics */
TXRX_STATS_UPDATE_TX_STATS(pdev, status, 1, cdf_nbuf_len(netbuf)); TXRX_STATS_UPDATE_TX_STATS(pdev, status, 1, qdf_nbuf_len(netbuf));
if (OL_TX_DESC_NO_REFS(tx_desc)) { if (OL_TX_DESC_NO_REFS(tx_desc)) {
ol_tx_desc_frame_free_nonstd(pdev, tx_desc, ol_tx_desc_frame_free_nonstd(pdev, tx_desc,
@@ -599,7 +599,7 @@ ol_tx_inspect_handler(ol_txrx_pdev_handle pdev,
struct ol_tx_desc_t *tx_desc; struct ol_tx_desc_t *tx_desc;
union ol_tx_desc_list_elem_t *lcl_freelist = NULL; union ol_tx_desc_list_elem_t *lcl_freelist = NULL;
union ol_tx_desc_list_elem_t *tx_desc_last = NULL; union ol_tx_desc_list_elem_t *tx_desc_last = NULL;
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
ol_tx_desc_list tx_descs; ol_tx_desc_list tx_descs;
TAILQ_INIT(&tx_descs); TAILQ_INIT(&tx_descs);
@@ -760,10 +760,10 @@ ol_tx_delay_hist(ol_txrx_pdev_handle pdev,
#ifdef QCA_COMPUTE_TX_DELAY_PER_TID #ifdef QCA_COMPUTE_TX_DELAY_PER_TID
static inline uint8_t *ol_tx_dest_addr_find(struct ol_txrx_pdev_t *pdev, static inline uint8_t *ol_tx_dest_addr_find(struct ol_txrx_pdev_t *pdev,
cdf_nbuf_t tx_nbuf) qdf_nbuf_t tx_nbuf)
{ {
uint8_t *hdr_ptr; uint8_t *hdr_ptr;
void *datap = cdf_nbuf_data(tx_nbuf); void *datap = qdf_nbuf_data(tx_nbuf);
if (pdev->frame_format == wlan_frm_fmt_raw) { if (pdev->frame_format == wlan_frm_fmt_raw) {
/* adjust hdr_ptr to RA */ /* adjust hdr_ptr to RA */
@@ -787,7 +787,7 @@ static inline uint8_t *ol_tx_dest_addr_find(struct ol_txrx_pdev_t *pdev,
static uint8_t static uint8_t
ol_tx_delay_tid_from_l3_hdr(struct ol_txrx_pdev_t *pdev, ol_tx_delay_tid_from_l3_hdr(struct ol_txrx_pdev_t *pdev,
cdf_nbuf_t msdu, struct ol_tx_desc_t *tx_desc) qdf_nbuf_t msdu, struct ol_tx_desc_t *tx_desc)
{ {
uint16_t ethertype; uint16_t ethertype;
uint8_t *dest_addr, *l3_hdr; uint8_t *dest_addr, *l3_hdr;
@@ -810,14 +810,14 @@ ol_tx_delay_tid_from_l3_hdr(struct ol_txrx_pdev_t *pdev,
if (pdev->frame_format == wlan_frm_fmt_802_3) { if (pdev->frame_format == wlan_frm_fmt_802_3) {
struct ethernet_hdr_t *enet_hdr; struct ethernet_hdr_t *enet_hdr;
enet_hdr = (struct ethernet_hdr_t *)cdf_nbuf_data(msdu); enet_hdr = (struct ethernet_hdr_t *)qdf_nbuf_data(msdu);
l2_hdr_size = sizeof(struct ethernet_hdr_t); l2_hdr_size = sizeof(struct ethernet_hdr_t);
ethertype = ethertype =
(enet_hdr->ethertype[0] << 8) | enet_hdr->ethertype[1]; (enet_hdr->ethertype[0] << 8) | enet_hdr->ethertype[1];
if (!IS_ETHERTYPE(ethertype)) { if (!IS_ETHERTYPE(ethertype)) {
struct llc_snap_hdr_t *llc_hdr; struct llc_snap_hdr_t *llc_hdr;
llc_hdr = (struct llc_snap_hdr_t *) llc_hdr = (struct llc_snap_hdr_t *)
(cdf_nbuf_data(msdu) + l2_hdr_size); (qdf_nbuf_data(msdu) + l2_hdr_size);
l2_hdr_size += sizeof(struct llc_snap_hdr_t); l2_hdr_size += sizeof(struct llc_snap_hdr_t);
ethertype = ethertype =
(llc_hdr->ethertype[0] << 8) | llc_hdr-> (llc_hdr->ethertype[0] << 8) | llc_hdr->
@@ -826,13 +826,13 @@ ol_tx_delay_tid_from_l3_hdr(struct ol_txrx_pdev_t *pdev,
} else { } else {
struct llc_snap_hdr_t *llc_hdr; struct llc_snap_hdr_t *llc_hdr;
l2_hdr_size = sizeof(struct ieee80211_frame); l2_hdr_size = sizeof(struct ieee80211_frame);
llc_hdr = (struct llc_snap_hdr_t *)(cdf_nbuf_data(msdu) llc_hdr = (struct llc_snap_hdr_t *)(qdf_nbuf_data(msdu)
+ l2_hdr_size); + l2_hdr_size);
l2_hdr_size += sizeof(struct llc_snap_hdr_t); l2_hdr_size += sizeof(struct llc_snap_hdr_t);
ethertype = ethertype =
(llc_hdr->ethertype[0] << 8) | llc_hdr->ethertype[1]; (llc_hdr->ethertype[0] << 8) | llc_hdr->ethertype[1];
} }
l3_hdr = cdf_nbuf_data(msdu) + l2_hdr_size; l3_hdr = qdf_nbuf_data(msdu) + l2_hdr_size;
if (ETHERTYPE_IPV4 == ethertype) { if (ETHERTYPE_IPV4 == ethertype) {
return (((struct ipv4_hdr_t *)l3_hdr)->tos >> 5) & 0x7; return (((struct ipv4_hdr_t *)l3_hdr)->tos >> 5) & 0x7;
} else if (ETHERTYPE_IPV6 == ethertype) { } else if (ETHERTYPE_IPV6 == ethertype) {
@@ -850,8 +850,8 @@ static int ol_tx_delay_category(struct ol_txrx_pdev_t *pdev, uint16_t msdu_id)
struct ol_tx_desc_t *tx_desc = ol_tx_desc_find(pdev, msdu_id); struct ol_tx_desc_t *tx_desc = ol_tx_desc_find(pdev, msdu_id);
uint8_t tid; uint8_t tid;
cdf_nbuf_t msdu = tx_desc->netbuf; qdf_nbuf_t msdu = tx_desc->netbuf;
tid = cdf_nbuf_get_tid(msdu); tid = qdf_nbuf_get_tid(msdu);
if (tid == QDF_NBUF_TX_EXT_TID_INVALID) { if (tid == QDF_NBUF_TX_EXT_TID_INVALID) {
tid = ol_tx_delay_tid_from_l3_hdr(pdev, msdu, tx_desc); tid = ol_tx_delay_tid_from_l3_hdr(pdev, msdu, tx_desc);
if (tid == QDF_NBUF_TX_EXT_TID_INVALID) { if (tid == QDF_NBUF_TX_EXT_TID_INVALID) {

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2014 The Linux Foundation. All rights reserved. * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -32,7 +32,7 @@
#ifndef _OL_TX_SEND__H_ #ifndef _OL_TX_SEND__H_
#define _OL_TX_SEND__H_ #define _OL_TX_SEND__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_txrx_types.h> /* ol_tx_send_t */ #include <ol_txrx_types.h> /* ol_tx_send_t */
/** /**
@@ -52,7 +52,7 @@ void ol_tx_discard_target_frms(ol_txrx_pdev_handle pdev);
*/ */
void void
ol_tx_send(struct ol_txrx_pdev_t *pdev, ol_tx_send(struct ol_txrx_pdev_t *pdev,
struct ol_tx_desc_t *tx_desc, cdf_nbuf_t msdu); struct ol_tx_desc_t *tx_desc, qdf_nbuf_t msdu);
/** /**
* @brief Send a tx batch download to the target. * @brief Send a tx batch download to the target.
@@ -67,7 +67,7 @@ ol_tx_send(struct ol_txrx_pdev_t *pdev,
int int
ol_tx_send_batch(struct ol_txrx_pdev_t *pdev, ol_tx_send_batch(struct ol_txrx_pdev_t *pdev,
cdf_nbuf_t msdu_list, int num_msdus); qdf_nbuf_t msdu_list, int num_msdus);
/** /**
* @brief Send a tx frame with a non-std header or payload type to the target. * @brief Send a tx frame with a non-std header or payload type to the target.
@@ -82,5 +82,5 @@ ol_tx_send_batch(struct ol_txrx_pdev_t *pdev,
void void
ol_tx_send_nonstd(struct ol_txrx_pdev_t *pdev, ol_tx_send_nonstd(struct ol_txrx_pdev_t *pdev,
struct ol_tx_desc_t *tx_desc, struct ol_tx_desc_t *tx_desc,
cdf_nbuf_t msdu, enum htt_pkt_type pkt_type); qdf_nbuf_t msdu, enum htt_pkt_type pkt_type);
#endif /* _OL_TX_SEND__H_ */ #endif /* _OL_TX_SEND__H_ */

Переглянути файл

@@ -30,7 +30,7 @@
#include <osdep.h> /* uint32_t, etc. */ #include <osdep.h> /* uint32_t, etc. */
#include <qdf_mem.h> /* qdf_mem_malloc,free */ #include <qdf_mem.h> /* qdf_mem_malloc,free */
#include <qdf_types.h> /* qdf_device_t, qdf_print */ #include <qdf_types.h> /* qdf_device_t, qdf_print */
#include <qdf_lock.h> /* cdf_spinlock */ #include <qdf_lock.h> /* qdf_spinlock */
#include <qdf_atomic.h> /* qdf_atomic_read */ #include <qdf_atomic.h> /* qdf_atomic_read */
/* Required for WLAN_FEATURE_FASTPATH */ /* Required for WLAN_FEATURE_FASTPATH */
@@ -1190,11 +1190,11 @@ ol_txrx_vdev_detach(ol_txrx_vdev_handle vdev,
qdf_timer_free(&vdev->ll_pause.timer); qdf_timer_free(&vdev->ll_pause.timer);
vdev->ll_pause.is_q_timer_on = false; vdev->ll_pause.is_q_timer_on = false;
while (vdev->ll_pause.txq.head) { while (vdev->ll_pause.txq.head) {
cdf_nbuf_t next = cdf_nbuf_next(vdev->ll_pause.txq.head); qdf_nbuf_t next = qdf_nbuf_next(vdev->ll_pause.txq.head);
cdf_nbuf_set_next(vdev->ll_pause.txq.head, NULL); qdf_nbuf_set_next(vdev->ll_pause.txq.head, NULL);
cdf_nbuf_unmap(pdev->osdev, vdev->ll_pause.txq.head, qdf_nbuf_unmap(pdev->osdev, vdev->ll_pause.txq.head,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
cdf_nbuf_tx_free(vdev->ll_pause.txq.head, NBUF_PKT_ERROR); qdf_nbuf_tx_free(vdev->ll_pause.txq.head, QDF_NBUF_PKT_ERROR);
vdev->ll_pause.txq.head = next; vdev->ll_pause.txq.head = next;
} }
qdf_spin_unlock_bh(&vdev->ll_pause.mutex); qdf_spin_unlock_bh(&vdev->ll_pause.mutex);
@@ -1287,12 +1287,12 @@ void ol_txrx_flush_rx_frames(struct ol_txrx_peer_t *peer,
list_del(&cache_buf->list); list_del(&cache_buf->list);
qdf_spin_unlock_bh(&peer->bufq_lock); qdf_spin_unlock_bh(&peer->bufq_lock);
if (drop) { if (drop) {
cdf_nbuf_free(cache_buf->buf); qdf_nbuf_free(cache_buf->buf);
} else { } else {
/* Flush the cached frames to HDD */ /* Flush the cached frames to HDD */
ret = data_rx(cds_ctx, cache_buf->buf, peer->local_id); ret = data_rx(cds_ctx, cache_buf->buf, peer->local_id);
if (ret != QDF_STATUS_SUCCESS) if (ret != QDF_STATUS_SUCCESS)
cdf_nbuf_free(cache_buf->buf); qdf_nbuf_free(cache_buf->buf);
} }
qdf_mem_free(cache_buf); qdf_mem_free(cache_buf);
qdf_spin_lock_bh(&peer->bufq_lock); qdf_spin_lock_bh(&peer->bufq_lock);
@@ -2939,7 +2939,7 @@ void ol_txrx_display_stats(uint16_t value)
ol_tx_dump_flow_pool_info(); ol_tx_dump_flow_pool_info();
break; break;
case WLAN_TXRX_DESC_STATS: case WLAN_TXRX_DESC_STATS:
cdf_nbuf_tx_desc_count_display(); qdf_nbuf_tx_desc_count_display();
break; break;
default: default:
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
@@ -2967,7 +2967,7 @@ void ol_txrx_clear_stats(uint16_t value)
ol_tx_clear_flow_pool_stats(); ol_tx_clear_flow_pool_stats();
break; break;
case WLAN_TXRX_DESC_STATS: case WLAN_TXRX_DESC_STATS:
cdf_nbuf_tx_desc_count_clear(); qdf_nbuf_tx_desc_count_clear();
break; break;
default: default:
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
@@ -2984,10 +2984,10 @@ void ol_txrx_clear_stats(uint16_t value)
* Return: None * Return: None
*/ */
static void ol_rx_data_cb(struct ol_txrx_peer_t *peer, static void ol_rx_data_cb(struct ol_txrx_peer_t *peer,
cdf_nbuf_t buf_list) qdf_nbuf_t buf_list)
{ {
void *cds_ctx = cds_get_global_context(); void *cds_ctx = cds_get_global_context();
cdf_nbuf_t buf, next_buf; qdf_nbuf_t buf, next_buf;
QDF_STATUS ret; QDF_STATUS ret;
ol_rx_callback_fp data_rx = NULL; ol_rx_callback_fp data_rx = NULL;
@@ -3012,12 +3012,12 @@ static void ol_rx_data_cb(struct ol_txrx_peer_t *peer,
buf = buf_list; buf = buf_list;
while (buf) { while (buf) {
next_buf = cdf_nbuf_queue_next(buf); next_buf = qdf_nbuf_queue_next(buf);
cdf_nbuf_set_next(buf, NULL); /* Add NULL terminator */ qdf_nbuf_set_next(buf, NULL); /* Add NULL terminator */
ret = data_rx(cds_ctx, buf, peer->local_id); ret = data_rx(cds_ctx, buf, peer->local_id);
if (ret != QDF_STATUS_SUCCESS) { if (ret != QDF_STATUS_SUCCESS) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "Frame Rx to HDD failed"); TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "Frame Rx to HDD failed");
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
buf = next_buf; buf = next_buf;
} }
@@ -3027,8 +3027,8 @@ free_buf:
TXRX_PRINT(TXRX_PRINT_LEVEL_WARN, "%s:Dropping frames", __func__); TXRX_PRINT(TXRX_PRINT_LEVEL_WARN, "%s:Dropping frames", __func__);
buf = buf_list; buf = buf_list;
while (buf) { while (buf) {
next_buf = cdf_nbuf_queue_next(buf); next_buf = qdf_nbuf_queue_next(buf);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
buf = next_buf; buf = next_buf;
} }
} }
@@ -3041,12 +3041,12 @@ free_buf:
* Return: None * Return: None
*/ */
void ol_rx_data_process(struct ol_txrx_peer_t *peer, void ol_rx_data_process(struct ol_txrx_peer_t *peer,
cdf_nbuf_t rx_buf_list) qdf_nbuf_t rx_buf_list)
{ {
/* Firmware data path active response will use shim RX thread /* Firmware data path active response will use shim RX thread
* T2H MSG running on SIRQ context, * T2H MSG running on SIRQ context,
* IPA kernel module API should not be called on SIRQ CTXT */ * IPA kernel module API should not be called on SIRQ CTXT */
cdf_nbuf_t buf, next_buf; qdf_nbuf_t buf, next_buf;
ol_rx_callback_fp data_rx = NULL; ol_rx_callback_fp data_rx = NULL;
ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX); ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
@@ -3069,15 +3069,15 @@ void ol_rx_data_process(struct ol_txrx_peer_t *peer,
struct ol_rx_cached_buf *cache_buf; struct ol_rx_cached_buf *cache_buf;
buf = rx_buf_list; buf = rx_buf_list;
while (buf) { while (buf) {
next_buf = cdf_nbuf_queue_next(buf); next_buf = qdf_nbuf_queue_next(buf);
cache_buf = qdf_mem_malloc(sizeof(*cache_buf)); cache_buf = qdf_mem_malloc(sizeof(*cache_buf));
if (!cache_buf) { if (!cache_buf) {
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, TXRX_PRINT(TXRX_PRINT_LEVEL_ERR,
"Failed to allocate buf to cache the rx frames"); "Failed to allocate buf to cache the rx frames");
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} else { } else {
/* Add NULL terminator */ /* Add NULL terminator */
cdf_nbuf_set_next(buf, NULL); qdf_nbuf_set_next(buf, NULL);
cache_buf->buf = buf; cache_buf->buf = buf;
qdf_spin_lock_bh(&peer->bufq_lock); qdf_spin_lock_bh(&peer->bufq_lock);
list_add_tail(&cache_buf->list, list_add_tail(&cache_buf->list,
@@ -3126,8 +3126,8 @@ drop_rx_buf:
TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "Dropping rx packets"); TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "Dropping rx packets");
buf = rx_buf_list; buf = rx_buf_list;
while (buf) { while (buf) {
next_buf = cdf_nbuf_queue_next(buf); next_buf = qdf_nbuf_queue_next(buf);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
buf = next_buf; buf = next_buf;
} }
} }
@@ -3137,7 +3137,7 @@ drop_rx_buf:
* @rxcb: rx callback * @rxcb: rx callback
* @sta_desc: sta descriptor * @sta_desc: sta descriptor
* *
* Return: CDF Status * Return: QDF Status
*/ */
QDF_STATUS ol_txrx_register_peer(ol_rx_callback_fp rxcb, QDF_STATUS ol_txrx_register_peer(ol_rx_callback_fp rxcb,
struct ol_txrx_desc_type *sta_desc) struct ol_txrx_desc_type *sta_desc)
@@ -3187,7 +3187,7 @@ QDF_STATUS ol_txrx_register_peer(ol_rx_callback_fp rxcb,
* ol_txrx_clear_peer() - clear peer * ol_txrx_clear_peer() - clear peer
* @sta_id: sta id * @sta_id: sta id
* *
* Return: CDF Status * Return: QDF Status
*/ */
QDF_STATUS ol_txrx_clear_peer(uint8_t sta_id) QDF_STATUS ol_txrx_clear_peer(uint8_t sta_id)
{ {
@@ -3320,7 +3320,7 @@ exit:
* ol_txrx_register_pause_cb() - register pause callback * ol_txrx_register_pause_cb() - register pause callback
* @pause_cb: pause callback * @pause_cb: pause callback
* *
* Return: CDF status * Return: QDF status
*/ */
QDF_STATUS ol_txrx_register_pause_cb(ol_tx_pause_callback_fp pause_cb) QDF_STATUS ol_txrx_register_pause_cb(ol_tx_pause_callback_fp pause_cb)
{ {

Переглянути файл

@@ -28,7 +28,7 @@
#ifndef _OL_TXRX__H_ #ifndef _OL_TXRX__H_
#define _OL_TXRX__H_ #define _OL_TXRX__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */ #include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */
#include <ol_ctrl_api.h> /* ol_pdev_handle */ #include <ol_ctrl_api.h> /* ol_pdev_handle */
#include "cds_sched.h" #include "cds_sched.h"

Переглянути файл

@@ -35,7 +35,7 @@
*/ */
#ifdef QCA_SUPPORT_SW_TXRX_ENCAP #ifdef QCA_SUPPORT_SW_TXRX_ENCAP
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <cds_ieee80211_common.h> /* ieee80211_frame */ #include <cds_ieee80211_common.h> /* ieee80211_frame */
#include <net.h> /* struct llc, struct ether_header, etc. */ #include <net.h> /* struct llc, struct ether_header, etc. */
#include <ol_txrx_internal.h> /* TXRX_ASSERT1 */ #include <ol_txrx_internal.h> /* TXRX_ASSERT1 */
@@ -44,14 +44,14 @@
#define OL_TX_COPY_NATIVE_WIFI_HEADER(wh, msdu, hdsize, localbuf) \ #define OL_TX_COPY_NATIVE_WIFI_HEADER(wh, msdu, hdsize, localbuf) \
do { \ do { \
wh = (struct ieee80211_frame *)cdf_nbuf_data(msdu); \ wh = (struct ieee80211_frame *)qdf_nbuf_data(msdu); \
if ((wh->i_fc[1] & \ if ((wh->i_fc[1] & \
IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) { \ IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) { \
hdsize = sizeof(struct ieee80211_frame_addr4); \ hdsize = sizeof(struct ieee80211_frame_addr4); \
} else { \ } else { \
hdsize = sizeof(struct ieee80211_frame); \ hdsize = sizeof(struct ieee80211_frame); \
} \ } \
if (cdf_nbuf_len(msdu) < hdsize) { \ if (qdf_nbuf_len(msdu) < hdsize) { \
return A_ERROR; \ return A_ERROR; \
} \ } \
qdf_mem_copy(localbuf, wh, hdsize); \ qdf_mem_copy(localbuf, wh, hdsize); \
@@ -59,18 +59,18 @@
} while (0) } while (0)
static inline A_STATUS static inline A_STATUS
ol_tx_copy_native_wifi_header(cdf_nbuf_t msdu, ol_tx_copy_native_wifi_header(qdf_nbuf_t msdu,
uint8_t *hdsize, uint8_t *localbuf) uint8_t *hdsize, uint8_t *localbuf)
{ {
struct ieee80211_frame *wh = struct ieee80211_frame *wh =
(struct ieee80211_frame *)cdf_nbuf_data(msdu); (struct ieee80211_frame *)qdf_nbuf_data(msdu);
if ((wh->i_fc[1] & if ((wh->i_fc[1] &
IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) { IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) {
*hdsize = sizeof(struct ieee80211_frame_addr4); *hdsize = sizeof(struct ieee80211_frame_addr4);
} else { } else {
*hdsize = sizeof(struct ieee80211_frame); *hdsize = sizeof(struct ieee80211_frame);
} }
if (cdf_nbuf_len(msdu) < *hdsize) if (qdf_nbuf_len(msdu) < *hdsize)
return A_ERROR; return A_ERROR;
qdf_mem_copy(localbuf, wh, *hdsize); qdf_mem_copy(localbuf, wh, *hdsize);
@@ -80,7 +80,7 @@ ol_tx_copy_native_wifi_header(cdf_nbuf_t msdu,
static inline A_STATUS static inline A_STATUS
ol_tx_encap_from_native_wifi(struct ol_txrx_vdev_t *vdev, ol_tx_encap_from_native_wifi(struct ol_txrx_vdev_t *vdev,
struct ol_tx_desc_t *tx_desc, struct ol_tx_desc_t *tx_desc,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
struct ol_txrx_msdu_info_t *tx_msdu_info) struct ol_txrx_msdu_info_t *tx_msdu_info)
{ {
uint8_t localbuf[sizeof(struct ieee80211_qosframe_htc_addr4)]; uint8_t localbuf[sizeof(struct ieee80211_qosframe_htc_addr4)];
@@ -127,7 +127,7 @@ ol_tx_encap_from_native_wifi(struct ol_txrx_vdev_t *vdev,
htt_tx_desc_mpdu_header(tx_desc->htt_tx_desc, htt_tx_desc_mpdu_header(tx_desc->htt_tx_desc,
new_hdsize), localbuf, new_hdsize), localbuf,
new_hdsize); new_hdsize);
cdf_nbuf_pull_head(msdu, hdsize); qdf_nbuf_pull_head(msdu, hdsize);
tx_msdu_info->htt.info.l3_hdr_offset = new_hdsize; tx_msdu_info->htt.info.l3_hdr_offset = new_hdsize;
tx_desc->orig_l2_hdr_bytes = hdsize; tx_desc->orig_l2_hdr_bytes = hdsize;
} }
@@ -148,7 +148,7 @@ ol_tx_encap_from_native_wifi(struct ol_txrx_vdev_t *vdev,
htt_tx_desc_mpdu_header(tx_desc->htt_tx_desc, htt_tx_desc_mpdu_header(tx_desc->htt_tx_desc,
hdsize); hdsize);
qdf_mem_copy((void *)wh, localbuf, hdsize); qdf_mem_copy((void *)wh, localbuf, hdsize);
cdf_nbuf_pull_head(msdu, hdsize); qdf_nbuf_pull_head(msdu, hdsize);
tx_msdu_info->htt.info.l3_hdr_offset = hdsize; tx_msdu_info->htt.info.l3_hdr_offset = hdsize;
tx_desc->orig_l2_hdr_bytes = hdsize; tx_desc->orig_l2_hdr_bytes = hdsize;
} }
@@ -160,7 +160,7 @@ ol_tx_encap_from_native_wifi(struct ol_txrx_vdev_t *vdev,
static inline A_STATUS static inline A_STATUS
ol_tx_encap_from_8023(struct ol_txrx_vdev_t *vdev, ol_tx_encap_from_8023(struct ol_txrx_vdev_t *vdev,
struct ol_tx_desc_t *tx_desc, struct ol_tx_desc_t *tx_desc,
cdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *tx_msdu_info) qdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *tx_msdu_info)
{ {
uint8_t localbuf[sizeof(struct ieee80211_qosframe_htc_addr4) uint8_t localbuf[sizeof(struct ieee80211_qosframe_htc_addr4)
+ sizeof(struct llc_snap_hdr_t)]; + sizeof(struct llc_snap_hdr_t)];
@@ -183,7 +183,7 @@ ol_tx_encap_from_8023(struct ol_txrx_vdev_t *vdev,
*/ */
peer = tx_msdu_info->peer; peer = tx_msdu_info->peer;
eth_hdr = (struct ethernet_hdr_t *)cdf_nbuf_data(msdu); eth_hdr = (struct ethernet_hdr_t *)qdf_nbuf_data(msdu);
hdsize = sizeof(struct ethernet_hdr_t); hdsize = sizeof(struct ethernet_hdr_t);
wh = (struct ieee80211_frame *)localbuf; wh = (struct ieee80211_frame *)localbuf;
wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_DATA;
@@ -277,7 +277,7 @@ ol_tx_encap_from_8023(struct ol_txrx_vdev_t *vdev,
htt_tx_desc_mpdu_header(tx_desc->htt_tx_desc, htt_tx_desc_mpdu_header(tx_desc->htt_tx_desc,
new_l2_hdsize), localbuf, new_l2_hdsize), localbuf,
new_hdsize); new_hdsize);
cdf_nbuf_pull_head(msdu, hdsize); qdf_nbuf_pull_head(msdu, hdsize);
tx_msdu_info->htt.info.l3_hdr_offset = new_l2_hdsize; tx_msdu_info->htt.info.l3_hdr_offset = new_l2_hdsize;
tx_desc->orig_l2_hdr_bytes = hdsize; tx_desc->orig_l2_hdr_bytes = hdsize;
return A_OK; return A_OK;
@@ -286,7 +286,7 @@ ol_tx_encap_from_8023(struct ol_txrx_vdev_t *vdev,
A_STATUS A_STATUS
ol_tx_encap(struct ol_txrx_vdev_t *vdev, ol_tx_encap(struct ol_txrx_vdev_t *vdev,
struct ol_tx_desc_t *tx_desc, struct ol_tx_desc_t *tx_desc,
cdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info) qdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info)
{ {
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
@@ -303,7 +303,7 @@ ol_tx_encap(struct ol_txrx_vdev_t *vdev,
static inline void static inline void
ol_rx_decap_to_native_wifi(struct ol_txrx_vdev_t *vdev, ol_rx_decap_to_native_wifi(struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
struct ol_rx_decap_info_t *info, struct ol_rx_decap_info_t *info,
struct ethernet_hdr_t *ethr_hdr) struct ethernet_hdr_t *ethr_hdr)
{ {
@@ -322,7 +322,7 @@ ol_rx_decap_to_native_wifi(struct ol_txrx_vdev_t *vdev,
else else
hdsize = sizeof(struct ieee80211_frame); hdsize = sizeof(struct ieee80211_frame);
wh = (struct ieee80211_frame_addr4 *)cdf_nbuf_push_head(msdu, hdsize); wh = (struct ieee80211_frame_addr4 *)qdf_nbuf_push_head(msdu, hdsize);
TXRX_ASSERT2(wh != NULL); TXRX_ASSERT2(wh != NULL);
TXRX_ASSERT2(hdsize <= info->hdr_len); TXRX_ASSERT2(hdsize <= info->hdr_len);
qdf_mem_copy((uint8_t *) wh, info->hdr, hdsize); qdf_mem_copy((uint8_t *) wh, info->hdr, hdsize);
@@ -365,7 +365,7 @@ ol_rx_decap_to_native_wifi(struct ol_txrx_vdev_t *vdev,
static inline void static inline void
ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev, ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t msdu, qdf_nbuf_t msdu,
struct ol_rx_decap_info_t *info, struct ol_rx_decap_info_t *info,
struct ethernet_hdr_t *ethr_hdr) struct ethernet_hdr_t *ethr_hdr)
{ {
@@ -381,7 +381,7 @@ ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev,
* if ethr_hdr is null, rx frame is 802.11 format(HW ft disabled) * if ethr_hdr is null, rx frame is 802.11 format(HW ft disabled)
* if ethr_hdr is not null, rx frame is "subfrm of amsdu". * if ethr_hdr is not null, rx frame is "subfrm of amsdu".
*/ */
buf = (uint8_t *) cdf_nbuf_data(msdu); buf = (uint8_t *) qdf_nbuf_data(msdu);
llc_hdr = (struct llc_snap_hdr_t *)buf; llc_hdr = (struct llc_snap_hdr_t *)buf;
ether_type = (llc_hdr->ethertype[0] << 8) | llc_hdr->ethertype[1]; ether_type = (llc_hdr->ethertype[0] << 8) | llc_hdr->ethertype[1];
/* do llc remove if needed */ /* do llc remove if needed */
@@ -401,9 +401,9 @@ ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev,
} }
} }
if (l2_hdr_space > ETHERNET_HDR_LEN) if (l2_hdr_space > ETHERNET_HDR_LEN)
buf = cdf_nbuf_pull_head(msdu, l2_hdr_space - ETHERNET_HDR_LEN); buf = qdf_nbuf_pull_head(msdu, l2_hdr_space - ETHERNET_HDR_LEN);
else if (l2_hdr_space < ETHERNET_HDR_LEN) else if (l2_hdr_space < ETHERNET_HDR_LEN)
buf = cdf_nbuf_push_head(msdu, ETHERNET_HDR_LEN - l2_hdr_space); buf = qdf_nbuf_push_head(msdu, ETHERNET_HDR_LEN - l2_hdr_space);
/* normal msdu(non-subfrm of A-MSDU) if ethr_hdr is null */ /* normal msdu(non-subfrm of A-MSDU) if ethr_hdr is null */
if (ethr_hdr == NULL) { if (ethr_hdr == NULL) {
@@ -444,10 +444,10 @@ ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev,
ethr_hdr->ethertype[1] = (ether_type) & 0xff; ethr_hdr->ethertype[1] = (ether_type) & 0xff;
} else { } else {
uint32_t pktlen = uint32_t pktlen =
cdf_nbuf_len(msdu) - sizeof(ethr_hdr->ethertype); qdf_nbuf_len(msdu) - sizeof(ethr_hdr->ethertype);
TXRX_ASSERT2(pktlen <= ETHERNET_MTU); TXRX_ASSERT2(pktlen <= ETHERNET_MTU);
ether_type = (uint16_t) pktlen; ether_type = (uint16_t) pktlen;
ether_type = cdf_nbuf_len(msdu) - sizeof(struct ethernet_hdr_t); ether_type = qdf_nbuf_len(msdu) - sizeof(struct ethernet_hdr_t);
ethr_hdr->ethertype[0] = (ether_type >> 8) & 0xff; ethr_hdr->ethertype[0] = (ether_type >> 8) & 0xff;
ethr_hdr->ethertype[1] = (ether_type) & 0xff; ethr_hdr->ethertype[1] = (ether_type) & 0xff;
} }
@@ -456,18 +456,18 @@ ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev,
static inline A_STATUS static inline A_STATUS
ol_rx_decap_subfrm_amsdu(struct ol_txrx_vdev_t *vdev, ol_rx_decap_subfrm_amsdu(struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t msdu, struct ol_rx_decap_info_t *info) qdf_nbuf_t msdu, struct ol_rx_decap_info_t *info)
{ {
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
uint8_t *subfrm_hdr; uint8_t *subfrm_hdr;
uint8_t localbuf[ETHERNET_HDR_LEN]; uint8_t localbuf[ETHERNET_HDR_LEN];
struct ethernet_hdr_t *ether_hdr = (struct ethernet_hdr_t *)localbuf; struct ethernet_hdr_t *ether_hdr = (struct ethernet_hdr_t *)localbuf;
subfrm_hdr = (uint8_t *) cdf_nbuf_data(msdu); subfrm_hdr = (uint8_t *) qdf_nbuf_data(msdu);
if (pdev->frame_format == wlan_frm_fmt_native_wifi) { if (pdev->frame_format == wlan_frm_fmt_native_wifi) {
/* decap to native wifi */ /* decap to native wifi */
qdf_mem_copy(ether_hdr, subfrm_hdr, ETHERNET_HDR_LEN); qdf_mem_copy(ether_hdr, subfrm_hdr, ETHERNET_HDR_LEN);
cdf_nbuf_pull_head(msdu, ETHERNET_HDR_LEN); qdf_nbuf_pull_head(msdu, ETHERNET_HDR_LEN);
ol_rx_decap_to_native_wifi(vdev, msdu, info, ether_hdr); ol_rx_decap_to_native_wifi(vdev, msdu, info, ether_hdr);
} else if (pdev->frame_format == wlan_frm_fmt_802_3) { } else if (pdev->frame_format == wlan_frm_fmt_802_3) {
if (pdev->sw_rx_llc_proc_enable) { if (pdev->sw_rx_llc_proc_enable) {
@@ -475,7 +475,7 @@ ol_rx_decap_subfrm_amsdu(struct ol_txrx_vdev_t *vdev,
* 802.11 table P-3 * 802.11 table P-3
*/ */
qdf_mem_copy(ether_hdr, subfrm_hdr, ETHERNET_HDR_LEN); qdf_mem_copy(ether_hdr, subfrm_hdr, ETHERNET_HDR_LEN);
cdf_nbuf_pull_head(msdu, ETHERNET_HDR_LEN); qdf_nbuf_pull_head(msdu, ETHERNET_HDR_LEN);
ol_rx_decap_to_8023(vdev, msdu, info, ether_hdr); ol_rx_decap_to_8023(vdev, msdu, info, ether_hdr);
} else { } else {
/* subfrm of A-MSDU is already in 802.3 format. /* subfrm of A-MSDU is already in 802.3 format.
@@ -492,11 +492,11 @@ ol_rx_decap_subfrm_amsdu(struct ol_txrx_vdev_t *vdev,
static inline A_STATUS static inline A_STATUS
ol_rx_decap_msdu(struct ol_txrx_vdev_t *vdev, ol_rx_decap_msdu(struct ol_txrx_vdev_t *vdev,
cdf_nbuf_t msdu, struct ol_rx_decap_info_t *info) qdf_nbuf_t msdu, struct ol_rx_decap_info_t *info)
{ {
struct ol_txrx_pdev_t *pdev = vdev->pdev; struct ol_txrx_pdev_t *pdev = vdev->pdev;
struct ieee80211_frame *wh; struct ieee80211_frame *wh;
wh = (struct ieee80211_frame *)cdf_nbuf_data(msdu); wh = (struct ieee80211_frame *)qdf_nbuf_data(msdu);
if (pdev->frame_format == wlan_frm_fmt_native_wifi) { if (pdev->frame_format == wlan_frm_fmt_native_wifi) {
/* Decap to native wifi because according to MSFT( /* Decap to native wifi because according to MSFT(
@@ -509,7 +509,7 @@ ol_rx_decap_msdu(struct ol_txrx_vdev_t *vdev,
TXRX_ASSERT2(info->hdr_len <= sizeof(info->hdr)); TXRX_ASSERT2(info->hdr_len <= sizeof(info->hdr));
qdf_mem_copy(info->hdr, /* use info->hdr as temp buf. */ qdf_mem_copy(info->hdr, /* use info->hdr as temp buf. */
wh, info->hdr_len); wh, info->hdr_len);
cdf_nbuf_pull_head(msdu, info->hdr_len); qdf_nbuf_pull_head(msdu, info->hdr_len);
ol_rx_decap_to_native_wifi(vdev, msdu, info, NULL); ol_rx_decap_to_native_wifi(vdev, msdu, info, NULL);
/* 802.11 hdr^ eth_hdr^ */ /* 802.11 hdr^ eth_hdr^ */
} }
@@ -519,7 +519,7 @@ ol_rx_decap_msdu(struct ol_txrx_vdev_t *vdev,
TXRX_ASSERT2(info->hdr_len <= sizeof(info->hdr)); TXRX_ASSERT2(info->hdr_len <= sizeof(info->hdr));
qdf_mem_copy(info->hdr, /* use info->hdr as temp buf. */ qdf_mem_copy(info->hdr, /* use info->hdr as temp buf. */
wh, info->hdr_len); wh, info->hdr_len);
cdf_nbuf_pull_head(msdu, info->hdr_len); qdf_nbuf_pull_head(msdu, info->hdr_len);
/* remove llc snap hdr if it's necessary according to /* remove llc snap hdr if it's necessary according to
* 802.11 table P-3 * 802.11 table P-3
*/ */
@@ -541,7 +541,7 @@ ol_rx_decap_msdu(struct ol_txrx_vdev_t *vdev,
A_STATUS A_STATUS
ol_rx_decap(struct ol_txrx_vdev_t *vdev, ol_rx_decap(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
cdf_nbuf_t msdu, struct ol_rx_decap_info_t *info) qdf_nbuf_t msdu, struct ol_rx_decap_info_t *info)
{ {
A_STATUS status; A_STATUS status;
uint8_t *mpdu_hdr; uint8_t *mpdu_hdr;
@@ -559,14 +559,14 @@ ol_rx_decap(struct ol_txrx_vdev_t *vdev,
* subsequent subfrm 802.11 header recovery * subsequent subfrm 802.11 header recovery
* in certain chip(such as Riva). * in certain chip(such as Riva).
*/ */
mpdu_hdr = cdf_nbuf_data(msdu); mpdu_hdr = qdf_nbuf_data(msdu);
info->hdr_len = info->hdr_len =
ol_txrx_ieee80211_hdrsize(mpdu_hdr); ol_txrx_ieee80211_hdrsize(mpdu_hdr);
TXRX_ASSERT2(info->hdr_len <= TXRX_ASSERT2(info->hdr_len <=
sizeof(info->hdr)); sizeof(info->hdr));
qdf_mem_copy(info->hdr, mpdu_hdr, qdf_mem_copy(info->hdr, mpdu_hdr,
info->hdr_len); info->hdr_len);
cdf_nbuf_pull_head(msdu, info->hdr_len); qdf_nbuf_pull_head(msdu, info->hdr_len);
} }
} }
} }

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2014-2015 The Linux Foundation. All rights reserved. * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -34,7 +34,7 @@
#ifdef QCA_SUPPORT_SW_TXRX_ENCAP #ifdef QCA_SUPPORT_SW_TXRX_ENCAP
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* qdf_nbuf_t */
#include <cds_ieee80211_common.h> /* ieee80211_qosframe_htc_addr4 */ #include <cds_ieee80211_common.h> /* ieee80211_qosframe_htc_addr4 */
#include <ol_txrx_types.h> /* ol_tx_desc_t, ol_txrx_msdu_info_t */ #include <ol_txrx_types.h> /* ol_tx_desc_t, ol_txrx_msdu_info_t */
@@ -48,7 +48,7 @@
* with or without QOS control field based on peer's QOS capabilites. * with or without QOS control field based on peer's QOS capabilites.
* @param vdev - handle to vdev object * @param vdev - handle to vdev object
* @param tx_desc - tx desc struct,some fields will be updated. * @param tx_desc - tx desc struct,some fields will be updated.
* @param msdu - cdf_nbuf_t * @param msdu - qdf_nbuf_t
* @param msdu_info - informations from tx classification. * @param msdu_info - informations from tx classification.
* @return * @return
* A_OK: encap operation sucessful * A_OK: encap operation sucessful
@@ -57,7 +57,7 @@
A_STATUS A_STATUS
ol_tx_encap(struct ol_txrx_vdev_t *vdev, ol_tx_encap(struct ol_txrx_vdev_t *vdev,
struct ol_tx_desc_t *tx_desc, struct ol_tx_desc_t *tx_desc,
cdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info); qdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info);
struct ol_rx_decap_info_t { struct ol_rx_decap_info_t {
uint8_t hdr[sizeof(struct ieee80211_qosframe_htc_addr4)]; uint8_t hdr[sizeof(struct ieee80211_qosframe_htc_addr4)];
@@ -75,7 +75,7 @@ struct ol_rx_decap_info_t {
* if Target haven't done that. * if Target haven't done that.
* @param vdev - handle to vdev object * @param vdev - handle to vdev object
* @param peer - the peer object. * @param peer - the peer object.
* @param msdu - cdf_nbuf_t * @param msdu - qdf_nbuf_t
* @param info - ol_rx_decap_info_t: context info for decap * @param info - ol_rx_decap_info_t: context info for decap
* @return * @return
* A_OK: decap operation sucessful * A_OK: decap operation sucessful
@@ -84,12 +84,12 @@ struct ol_rx_decap_info_t {
A_STATUS A_STATUS
ol_rx_decap(struct ol_txrx_vdev_t *vdev, ol_rx_decap(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
cdf_nbuf_t msdu, struct ol_rx_decap_info_t *info); qdf_nbuf_t msdu, struct ol_rx_decap_info_t *info);
static inline A_STATUS static inline A_STATUS
OL_TX_ENCAP(struct ol_txrx_vdev_t *vdev, OL_TX_ENCAP(struct ol_txrx_vdev_t *vdev,
struct ol_tx_desc_t *tx_desc, struct ol_tx_desc_t *tx_desc,
cdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info) qdf_nbuf_t msdu, struct ol_txrx_msdu_info_t *msdu_info)
{ {
if (vdev->pdev->sw_tx_encap) if (vdev->pdev->sw_tx_encap)
return ol_tx_encap(vdev, tx_desc, msdu, msdu_info); return ol_tx_encap(vdev, tx_desc, msdu, msdu_info);
@@ -99,7 +99,7 @@ OL_TX_ENCAP(struct ol_txrx_vdev_t *vdev,
static inline A_STATUS static inline A_STATUS
OL_RX_DECAP(struct ol_txrx_vdev_t *vdev, OL_RX_DECAP(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
cdf_nbuf_t msdu, struct ol_rx_decap_info_t *info) qdf_nbuf_t msdu, struct ol_rx_decap_info_t *info)
{ {
if (vdev->pdev->sw_rx_decap) if (vdev->pdev->sw_rx_decap)
return ol_rx_decap(vdev, peer, msdu, info); return ol_rx_decap(vdev, peer, msdu, info);
@@ -109,7 +109,7 @@ OL_RX_DECAP(struct ol_txrx_vdev_t *vdev,
#define OL_TX_RESTORE_HDR(__tx_desc, __msdu) \ #define OL_TX_RESTORE_HDR(__tx_desc, __msdu) \
do { \ do { \
if (__tx_desc->orig_l2_hdr_bytes != 0) \ if (__tx_desc->orig_l2_hdr_bytes != 0) \
cdf_nbuf_push_head(__msdu, \ qdf_nbuf_push_head(__msdu, \
__tx_desc->orig_l2_hdr_bytes); \ __tx_desc->orig_l2_hdr_bytes); \
} while (0) } while (0)
#else #else

Переглянути файл

@@ -26,7 +26,7 @@
*/ */
/* OS abstraction libraries */ /* OS abstraction libraries */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <cdf_atomic.h> /* qdf_atomic_read, etc. */ #include <cdf_atomic.h> /* qdf_atomic_read, etc. */
#include <qdf_util.h> /* qdf_unlikely */ #include <qdf_util.h> /* qdf_unlikely */

Переглянути файл

@@ -29,7 +29,7 @@
#define _OL_TXRX_INTERNAL__H_ #define _OL_TXRX_INTERNAL__H_
#include <qdf_util.h> /* qdf_assert */ #include <qdf_util.h> /* qdf_assert */
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* cdf_nbuf_t */
#include <qdf_mem.h> /* qdf_mem_set */ #include <qdf_mem.h> /* qdf_mem_set */
#include <cds_ieee80211_common.h> /* ieee80211_frame */ #include <cds_ieee80211_common.h> /* ieee80211_frame */
#include <ol_htt_rx_api.h> /* htt_rx_msdu_desc_completes_mpdu, etc. */ #include <ol_htt_rx_api.h> /* htt_rx_msdu_desc_completes_mpdu, etc. */
@@ -160,7 +160,7 @@ extern unsigned g_txrx_print_level;
if (!(head)) { \ if (!(head)) { \
(head) = (elem); \ (head) = (elem); \
} else { \ } else { \
cdf_nbuf_set_next((tail), (elem)); \ qdf_nbuf_set_next((tail), (elem)); \
} \ } \
(tail) = (elem); \ (tail) = (elem); \
} while (0) } while (0)
@@ -168,10 +168,10 @@ extern unsigned g_txrx_print_level;
static inline void static inline void
ol_rx_mpdu_list_next(struct ol_txrx_pdev_t *pdev, ol_rx_mpdu_list_next(struct ol_txrx_pdev_t *pdev,
void *mpdu_list, void *mpdu_list,
cdf_nbuf_t *mpdu_tail, cdf_nbuf_t *next_mpdu) qdf_nbuf_t *mpdu_tail, qdf_nbuf_t *next_mpdu)
{ {
htt_pdev_handle htt_pdev = pdev->htt_pdev; htt_pdev_handle htt_pdev = pdev->htt_pdev;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
/* /*
* For now, we use a simply flat list of MSDUs. * For now, we use a simply flat list of MSDUs.
@@ -181,12 +181,12 @@ ol_rx_mpdu_list_next(struct ol_txrx_pdev_t *pdev,
msdu = mpdu_list; msdu = mpdu_list;
while (!htt_rx_msdu_desc_completes_mpdu while (!htt_rx_msdu_desc_completes_mpdu
(htt_pdev, htt_rx_msdu_desc_retrieve(htt_pdev, msdu))) { (htt_pdev, htt_rx_msdu_desc_retrieve(htt_pdev, msdu))) {
msdu = cdf_nbuf_next(msdu); msdu = qdf_nbuf_next(msdu);
TXRX_ASSERT2(msdu); TXRX_ASSERT2(msdu);
} }
/* msdu now points to the last MSDU within the first MPDU */ /* msdu now points to the last MSDU within the first MPDU */
*mpdu_tail = msdu; *mpdu_tail = msdu;
*next_mpdu = cdf_nbuf_next(msdu); *next_mpdu = qdf_nbuf_next(msdu);
} }
/*--- txrx stats macros ---*/ /*--- txrx stats macros ---*/
@@ -203,7 +203,7 @@ ol_rx_mpdu_list_next(struct ol_txrx_pdev_t *pdev,
#define TXRX_STATS_MSDU_INCR(pdev, field, netbuf) \ #define TXRX_STATS_MSDU_INCR(pdev, field, netbuf) \
do { \ do { \
TXRX_STATS_INCR((pdev), pub.field.pkts); \ TXRX_STATS_INCR((pdev), pub.field.pkts); \
TXRX_STATS_ADD((pdev), pub.field.bytes, cdf_nbuf_len(netbuf)); \ TXRX_STATS_ADD((pdev), pub.field.bytes, qdf_nbuf_len(netbuf)); \
} while (0) } while (0)
/* conditional defs based on verbosity level */ /* conditional defs based on verbosity level */
@@ -211,10 +211,10 @@ ol_rx_mpdu_list_next(struct ol_txrx_pdev_t *pdev,
#define TXRX_STATS_MSDU_LIST_INCR(pdev, field, netbuf_list) \ #define TXRX_STATS_MSDU_LIST_INCR(pdev, field, netbuf_list) \
do { \ do { \
cdf_nbuf_t tmp_list = netbuf_list; \ qdf_nbuf_t tmp_list = netbuf_list; \
while (tmp_list) { \ while (tmp_list) { \
TXRX_STATS_MSDU_INCR(pdev, field, tmp_list); \ TXRX_STATS_MSDU_INCR(pdev, field, tmp_list); \
tmp_list = cdf_nbuf_next(tmp_list); \ tmp_list = qdf_nbuf_next(tmp_list); \
} \ } \
} while (0) } while (0)
@@ -373,7 +373,7 @@ enum ol_txrx_frm_dump_options {
static inline void static inline void
ol_txrx_frms_dump(const char *name, ol_txrx_frms_dump(const char *name,
struct ol_txrx_pdev_t *pdev, struct ol_txrx_pdev_t *pdev,
cdf_nbuf_t frm, qdf_nbuf_t frm,
enum ol_txrx_frm_dump_options display_options, int max_len) enum ol_txrx_frm_dump_options display_options, int max_len)
{ {
#define TXRX_FRM_DUMP_MAX_LEN 128 #define TXRX_FRM_DUMP_MAX_LEN 128
@@ -385,7 +385,7 @@ ol_txrx_frms_dump(const char *name,
name); name);
} }
while (frm) { while (frm) {
p = cdf_nbuf_data(frm); p = qdf_nbuf_data(frm);
if (display_options & ol_txrx_frm_dump_tcp_seq) { if (display_options & ol_txrx_frm_dump_tcp_seq) {
int tcp_offset; int tcp_offset;
int l2_hdr_size; int l2_hdr_size;
@@ -475,8 +475,8 @@ NOT_IP_TCP:
if (display_options & ol_txrx_frm_dump_contents) { if (display_options & ol_txrx_frm_dump_contents) {
int i, frag_num, len_lim; int i, frag_num, len_lim;
len_lim = max_len; len_lim = max_len;
if (len_lim > cdf_nbuf_len(frm)) if (len_lim > qdf_nbuf_len(frm))
len_lim = cdf_nbuf_len(frm); len_lim = qdf_nbuf_len(frm);
if (len_lim > TXRX_FRM_DUMP_MAX_LEN) if (len_lim > TXRX_FRM_DUMP_MAX_LEN)
len_lim = TXRX_FRM_DUMP_MAX_LEN; len_lim = TXRX_FRM_DUMP_MAX_LEN;
@@ -489,11 +489,11 @@ NOT_IP_TCP:
while (i < len_lim) { while (i < len_lim) {
int frag_bytes; int frag_bytes;
frag_bytes = frag_bytes =
cdf_nbuf_get_frag_len(frm, frag_num); qdf_nbuf_get_frag_len(frm, frag_num);
if (frag_bytes > len_lim - i) if (frag_bytes > len_lim - i)
frag_bytes = len_lim - i; frag_bytes = len_lim - i;
if (frag_bytes > 0) { if (frag_bytes > 0) {
p = cdf_nbuf_get_frag_vaddr(frm, p = qdf_nbuf_get_frag_vaddr(frm,
frag_num); frag_num);
qdf_mem_copy(&local_buf[i], p, qdf_mem_copy(&local_buf[i], p,
frag_bytes); frag_bytes);
@@ -504,7 +504,7 @@ NOT_IP_TCP:
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO,
"frame %p data (%p), hex dump of bytes 0-%d of %d:\n", "frame %p data (%p), hex dump of bytes 0-%d of %d:\n",
frm, p, len_lim - 1, (int)cdf_nbuf_len(frm)); frm, p, len_lim - 1, (int)qdf_nbuf_len(frm));
p = local_buf; p = local_buf;
while (len_lim > 16) { while (len_lim > 16) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE(QDF_MODULE_ID_TXRX,
@@ -532,7 +532,7 @@ NOT_IP_TCP:
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO, QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO,
"\n"); "\n");
} }
frm = cdf_nbuf_next(frm); frm = qdf_nbuf_next(frm);
} }
} }
#else #else
@@ -571,7 +571,7 @@ NOT_IP_TCP:
if (ol_cfg_frame_type(pdev->ctrl_pdev) == \ if (ol_cfg_frame_type(pdev->ctrl_pdev) == \
wlan_frm_fmt_native_wifi) { \ wlan_frm_fmt_native_wifi) { \
/* For windows, it is always native wifi header .*/ \ /* For windows, it is always native wifi header .*/ \
wh = (struct ieee80211_frame *)cdf_nbuf_data(rx_msdu); \ wh = (struct ieee80211_frame *)qdf_nbuf_data(rx_msdu); \
} \ } \
ol_rx_err_inv_peer_statistics(pdev->ctrl_pdev, \ ol_rx_err_inv_peer_statistics(pdev->ctrl_pdev, \
wh, OL_RX_ERR_UNKNOWN_PEER); \ wh, OL_RX_ERR_UNKNOWN_PEER); \
@@ -613,7 +613,7 @@ NOT_IP_TCP:
do { \ do { \
qdf_spin_lock_bh(&peer->vdev->pdev->peer_stat_mutex); \ qdf_spin_lock_bh(&peer->vdev->pdev->peer_stat_mutex); \
peer->stats.tx_or_rx.frms.type += 1; \ peer->stats.tx_or_rx.frms.type += 1; \
peer->stats.tx_or_rx.bytes.type += cdf_nbuf_len(msdu); \ peer->stats.tx_or_rx.bytes.type += qdf_nbuf_len(msdu); \
qdf_spin_unlock_bh(&peer->vdev->pdev->peer_stat_mutex); \ qdf_spin_unlock_bh(&peer->vdev->pdev->peer_stat_mutex); \
} while (0) } while (0)
#define OL_TXRX_PEER_STATS_UPDATE(peer, tx_or_rx, msdu) \ #define OL_TXRX_PEER_STATS_UPDATE(peer, tx_or_rx, msdu) \
@@ -622,10 +622,10 @@ NOT_IP_TCP:
struct ol_txrx_pdev_t *pdev = vdev->pdev; \ struct ol_txrx_pdev_t *pdev = vdev->pdev; \
uint8_t *dest_addr; \ uint8_t *dest_addr; \
if (pdev->frame_format == wlan_frm_fmt_802_3) { \ if (pdev->frame_format == wlan_frm_fmt_802_3) { \
dest_addr = cdf_nbuf_data(msdu); \ dest_addr = qdf_nbuf_data(msdu); \
} else { /* 802.11 format */ \ } else { /* 802.11 format */ \
struct ieee80211_frame *frm; \ struct ieee80211_frame *frm; \
frm = (struct ieee80211_frame *) cdf_nbuf_data(msdu); \ frm = (struct ieee80211_frame *) qdf_nbuf_data(msdu); \
if (vdev->opmode == wlan_op_mode_ap) { \ if (vdev->opmode == wlan_op_mode_ap) { \
dest_addr = (uint8_t *) &(frm->i_addr1[0]); \ dest_addr = (uint8_t *) &(frm->i_addr1[0]); \
} else { \ } else { \

Переглянути файл

@@ -32,7 +32,7 @@
#ifndef _OL_TXRX_TYPES__H_ #ifndef _OL_TXRX_TYPES__H_
#define _OL_TXRX_TYPES__H_ #define _OL_TXRX_TYPES__H_
#include <cdf_nbuf.h> /* cdf_nbuf_t */ #include <qdf_nbuf.h> /* cdf_nbuf_t */
#include <qdf_mem.h> #include <qdf_mem.h>
#include <cds_queue.h> /* TAILQ */ #include <cds_queue.h> /* TAILQ */
#include <a_types.h> /* A_UINT8 */ #include <a_types.h> /* A_UINT8 */
@@ -127,7 +127,7 @@ enum ol_tx_frm_type {
}; };
struct ol_tx_desc_t { struct ol_tx_desc_t {
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
void *htt_tx_desc; void *htt_tx_desc;
uint16_t id; uint16_t id;
qdf_dma_addr_t htt_tx_desc_paddr; qdf_dma_addr_t htt_tx_desc_paddr;
@@ -536,7 +536,7 @@ struct ol_txrx_pdev_t {
/* rx proc function */ /* rx proc function */
void (*rx_opt_proc)(struct ol_txrx_vdev_t *vdev, void (*rx_opt_proc)(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list); unsigned tid, qdf_nbuf_t msdu_list);
/* tx data delivery notification callback function */ /* tx data delivery notification callback function */
struct { struct {
@@ -827,8 +827,8 @@ struct ol_txrx_vdev_t {
struct { struct {
struct { struct {
cdf_nbuf_t head; qdf_nbuf_t head;
cdf_nbuf_t tail; qdf_nbuf_t tail;
int depth; int depth;
} txq; } txq;
uint32_t paused_reason; uint32_t paused_reason;
@@ -877,8 +877,8 @@ struct ol_txrx_vdev_t {
}; };
struct ol_rx_reorder_array_elem_t { struct ol_rx_reorder_array_elem_t {
cdf_nbuf_t head; qdf_nbuf_t head;
cdf_nbuf_t tail; qdf_nbuf_t tail;
}; };
struct ol_rx_reorder_t { struct ol_rx_reorder_t {
@@ -967,7 +967,7 @@ struct ol_txrx_peer_t {
*/ */
void (*rx_opt_proc)(struct ol_txrx_vdev_t *vdev, void (*rx_opt_proc)(struct ol_txrx_vdev_t *vdev,
struct ol_txrx_peer_t *peer, struct ol_txrx_peer_t *peer,
unsigned tid, cdf_nbuf_t msdu_list); unsigned tid, qdf_nbuf_t msdu_list);
#ifdef QCA_ENABLE_OL_TXRX_PEER_STATS #ifdef QCA_ENABLE_OL_TXRX_PEER_STATS
ol_txrx_peer_stats_t stats; ol_txrx_peer_stats_t stats;

Переглянути файл

@@ -29,10 +29,9 @@
#define TXRX_H #define TXRX_H
#include "cds_api.h" #include "cds_api.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "csr_api.h" #include "csr_api.h"
#include "sap_api.h" #include "sap_api.h"
#include "cdf_nbuf.h"
#include "ol_txrx_osif_api.h" #include "ol_txrx_osif_api.h"
/* wait on peer deletion timeout value in milliseconds */ /* wait on peer deletion timeout value in milliseconds */
@@ -117,11 +116,11 @@ typedef void (*ol_txrx_vdev_delete_cb)(void *context);
* @typedef ol_txrx_tx_fp * @typedef ol_txrx_tx_fp
* @brief top-level transmit function * @brief top-level transmit function
*/ */
typedef cdf_nbuf_t typedef qdf_nbuf_t
(*ol_txrx_tx_fp)(struct ol_txrx_vdev_t *vdev, cdf_nbuf_t msdu_list); (*ol_txrx_tx_fp)(struct ol_txrx_vdev_t *vdev, qdf_nbuf_t msdu_list);
typedef void typedef void
(*ol_txrx_mgmt_tx_cb)(void *ctxt, cdf_nbuf_t tx_mgmt_frm, int had_error); (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
/* If RSSI realm is changed, send notification to Clients, SME, HDD */ /* If RSSI realm is changed, send notification to Clients, SME, HDD */
typedef QDF_STATUS (*wlan_txrx_rssi_cross_thresh)(void *adapter, u8 rssi, typedef QDF_STATUS (*wlan_txrx_rssi_cross_thresh)(void *adapter, u8 rssi,
@@ -141,7 +140,7 @@ struct wlan_txrx_ind_req {
/* Rx callback registered with txrx */ /* Rx callback registered with txrx */
typedef int (*wlan_txrx_cb_type)(void *g_cdsctx, cdf_nbuf_t buf, u8 sta_id, typedef int (*wlan_txrx_cb_type)(void *g_cdsctx, qdf_nbuf_t buf, u8 sta_id,
struct txrx_rx_metainfo *rx_meta_info); struct txrx_rx_metainfo *rx_meta_info);
static inline int wlan_txrx_get_rssi(void *g_cdsctx, u8 sta_id, int8_t *rssi) static inline int wlan_txrx_get_rssi(void *g_cdsctx, u8 sta_id, int8_t *rssi)

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -29,7 +29,7 @@
#define _WDI_EVENT_H_ #define _WDI_EVENT_H_
#include "athdefs.h" #include "athdefs.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#define WDI_EVENT_BASE 0x100 /* Event starting number */ #define WDI_EVENT_BASE 0x100 /* Event starting number */
enum WDI_EVENT { enum WDI_EVENT {
@@ -45,7 +45,7 @@ enum WDI_EVENT {
}; };
struct wdi_event_rx_peer_invalid_msg { struct wdi_event_rx_peer_invalid_msg {
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
struct ieee80211_frame *wh; struct ieee80211_frame *wh;
uint8_t vdev_id; uint8_t vdev_id;
}; };

Переглянути файл

@@ -45,8 +45,8 @@
* FIXME: Temporary hack - until IPA functionality gets restored * FIXME: Temporary hack - until IPA functionality gets restored
* *
*/ */
typedef void (*hdd_ipa_nbuf_cb_fn)(cdf_nbuf_t); typedef void (*hdd_ipa_nbuf_cb_fn)(qdf_nbuf_t);
void hdd_ipa_nbuf_cb(cdf_nbuf_t skb); /* Fwd declare */ void hdd_ipa_nbuf_cb(qdf_nbuf_t skb); /* Fwd declare */
static inline hdd_ipa_nbuf_cb_fn wlan_hdd_stub_ipa_fn(void) static inline hdd_ipa_nbuf_cb_fn wlan_hdd_stub_ipa_fn(void)
{ {
return hdd_ipa_nbuf_cb; return hdd_ipa_nbuf_cb;
@@ -54,7 +54,7 @@ static inline hdd_ipa_nbuf_cb_fn wlan_hdd_stub_ipa_fn(void)
QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx); QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx);
QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx); QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx);
QDF_STATUS hdd_ipa_process_rxt(void *cds_context, cdf_nbuf_t rxBuf, QDF_STATUS hdd_ipa_process_rxt(void *cds_context, qdf_nbuf_t rxBuf,
uint8_t sta_id); uint8_t sta_id);
int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id, int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
enum ipa_wlan_event type, uint8_t *mac_addr); enum ipa_wlan_event type, uint8_t *mac_addr);
@@ -86,7 +86,7 @@ static inline QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx)
} }
static inline QDF_STATUS hdd_ipa_process_rxt(void *cds_context, static inline QDF_STATUS hdd_ipa_process_rxt(void *cds_context,
cdf_nbuf_t rxBuf, uint8_t sta_id) qdf_nbuf_t rxBuf, uint8_t sta_id)
{ {
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

Переглянути файл

@@ -47,11 +47,11 @@ QDF_STATUS hdd_softap_init_tx_rx_sta(hdd_adapter_t *pAdapter,
QDF_STATUS hdd_softap_deinit_tx_rx_sta(hdd_adapter_t *pAdapter, QDF_STATUS hdd_softap_deinit_tx_rx_sta(hdd_adapter_t *pAdapter,
uint8_t STAId); uint8_t STAId);
QDF_STATUS hdd_softap_rx_packet_cbk(void *cds_context, QDF_STATUS hdd_softap_rx_packet_cbk(void *cds_context,
cdf_nbuf_t rxBufChain, qdf_nbuf_t rxBufChain,
uint8_t staId); uint8_t staId);
#ifdef IPA_OFFLOAD #ifdef IPA_OFFLOAD
QDF_STATUS hdd_softap_rx_mul_packet_cbk(void *cds_context, QDF_STATUS hdd_softap_rx_mul_packet_cbk(void *cds_context,
cdf_nbuf_t rx_buf_list, uint8_t staId); qdf_nbuf_t rx_buf_list, uint8_t staId);
#endif /* IPA_OFFLOAD */ #endif /* IPA_OFFLOAD */
QDF_STATUS hdd_softap_deregister_sta(hdd_adapter_t *pAdapter, QDF_STATUS hdd_softap_deregister_sta(hdd_adapter_t *pAdapter,

Переглянути файл

@@ -57,12 +57,12 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
void hdd_tx_timeout(struct net_device *dev); void hdd_tx_timeout(struct net_device *dev);
QDF_STATUS hdd_init_tx_rx(hdd_adapter_t *pAdapter); QDF_STATUS hdd_init_tx_rx(hdd_adapter_t *pAdapter);
QDF_STATUS hdd_deinit_tx_rx(hdd_adapter_t *pAdapter); QDF_STATUS hdd_deinit_tx_rx(hdd_adapter_t *pAdapter);
QDF_STATUS hdd_rx_packet_cbk(void *cds_context, cdf_nbuf_t rxBufChain, QDF_STATUS hdd_rx_packet_cbk(void *cds_context, qdf_nbuf_t rxBufChain,
uint8_t staId); uint8_t staId);
#ifdef IPA_OFFLOAD #ifdef IPA_OFFLOAD
QDF_STATUS hdd_rx_mul_packet_cbk(void *cds_context, QDF_STATUS hdd_rx_mul_packet_cbk(void *cds_context,
cdf_nbuf_t rx_buf_list, uint8_t staId); qdf_nbuf_t rx_buf_list, uint8_t staId);
#endif /* IPA_OFFLOAD */ #endif /* IPA_OFFLOAD */
QDF_STATUS hdd_ibss_get_sta_id(hdd_station_ctx_t *pHddStaCtx, QDF_STATUS hdd_ibss_get_sta_id(hdd_station_ctx_t *pHddStaCtx,

Переглянути файл

@@ -376,7 +376,7 @@ struct hdd_ipa_priv {
uint8_t num_iface; uint8_t num_iface;
enum hdd_ipa_rm_state rm_state; enum hdd_ipa_rm_state rm_state;
/* /*
* IPA driver can send RM notifications with IRQ disabled so using cdf * IPA driver can send RM notifications with IRQ disabled so using qdf
* APIs as it is taken care gracefully. Without this, kernel would throw * APIs as it is taken care gracefully. Without this, kernel would throw
* an warning if spin_lock_bh is used while IRQ is disabled * an warning if spin_lock_bh is used while IRQ is disabled
*/ */
@@ -390,7 +390,7 @@ struct hdd_ipa_priv {
enum ipa_client_type prod_client; enum ipa_client_type prod_client;
atomic_t tx_ref_cnt; atomic_t tx_ref_cnt;
cdf_nbuf_queue_t pm_queue_head; qdf_nbuf_queue_t pm_queue_head;
struct work_struct pm_work; struct work_struct pm_work;
qdf_spinlock_t pm_lock; qdf_spinlock_t pm_lock;
bool suspended; bool suspended;
@@ -2130,7 +2130,7 @@ static int hdd_ipa_rm_try_release(struct hdd_ipa_priv *hdd_ipa)
qdf_spin_lock_bh(&hdd_ipa->pm_lock); qdf_spin_lock_bh(&hdd_ipa->pm_lock);
if (!cdf_nbuf_is_queue_empty(&hdd_ipa->pm_queue_head)) { if (!qdf_nbuf_is_queue_empty(&hdd_ipa->pm_queue_head)) {
qdf_spin_unlock_bh(&hdd_ipa->pm_lock); qdf_spin_unlock_bh(&hdd_ipa->pm_lock);
return -EAGAIN; return -EAGAIN;
} }
@@ -2508,7 +2508,7 @@ static void hdd_ipa_destroy_rm_resource(struct hdd_ipa_priv *hdd_ipa)
* *
* Return: None * Return: None
*/ */
static void hdd_ipa_send_skb_to_network(cdf_nbuf_t skb, static void hdd_ipa_send_skb_to_network(qdf_nbuf_t skb,
hdd_adapter_t *adapter) hdd_adapter_t *adapter)
{ {
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa; struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
@@ -2518,13 +2518,13 @@ static void hdd_ipa_send_skb_to_network(cdf_nbuf_t skb,
HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO_LOW, "Invalid adapter: 0x%p", HDD_IPA_LOG(QDF_TRACE_LEVEL_INFO_LOW, "Invalid adapter: 0x%p",
adapter); adapter);
HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
return; return;
} }
if (cds_is_driver_unloading()) { if (cds_is_driver_unloading()) {
HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
return; return;
} }
@@ -2559,11 +2559,11 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
{ {
struct hdd_ipa_priv *hdd_ipa = NULL; struct hdd_ipa_priv *hdd_ipa = NULL;
hdd_adapter_t *adapter = NULL; hdd_adapter_t *adapter = NULL;
cdf_nbuf_t skb; qdf_nbuf_t skb;
uint8_t iface_id; uint8_t iface_id;
uint8_t session_id; uint8_t session_id;
struct hdd_ipa_iface_context *iface_context; struct hdd_ipa_iface_context *iface_context;
cdf_nbuf_t copy; qdf_nbuf_t copy;
uint8_t fw_desc; uint8_t fw_desc;
int ret; int ret;
@@ -2571,7 +2571,7 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
switch (evt) { switch (evt) {
case IPA_RECEIVE: case IPA_RECEIVE:
skb = (cdf_nbuf_t) data; skb = (qdf_nbuf_t) data;
if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) { if (hdd_ipa_uc_is_enabled(hdd_ipa->hdd_ctx)) {
session_id = (uint8_t)skb->cb[0]; session_id = (uint8_t)skb->cb[0];
iface_id = vdev_to_iface[session_id]; iface_id = vdev_to_iface[session_id];
@@ -2589,7 +2589,7 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
HDD_IPA_DBG_DUMP(QDF_TRACE_LEVEL_INFO_HIGH, HDD_IPA_DBG_DUMP(QDF_TRACE_LEVEL_INFO_HIGH,
"w2i -- skb", skb->data, 8); "w2i -- skb", skb->data, 8);
HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
return; return;
} }
@@ -2628,7 +2628,7 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
QDF_TRACE_LEVEL_DEBUG, QDF_TRACE_LEVEL_DEBUG,
"Forward packet to Tx (fw_desc=%d)", "Forward packet to Tx (fw_desc=%d)",
fw_desc); fw_desc);
copy = cdf_nbuf_copy(skb); copy = qdf_nbuf_copy(skb);
if (copy) { if (copy) {
hdd_ipa->ipa_tx_forward++; hdd_ipa->ipa_tx_forward++;
ret = hdd_softap_hard_start_xmit( ret = hdd_softap_hard_start_xmit(
@@ -2649,7 +2649,7 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
if (fw_desc & HDD_IPA_FW_RX_DESC_DISCARD_M) { if (fw_desc & HDD_IPA_FW_RX_DESC_DISCARD_M) {
HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa); HDD_IPA_INCREASE_INTERNAL_DROP_COUNT(hdd_ipa);
hdd_ipa->ipa_rx_discard++; hdd_ipa->ipa_rx_discard++;
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
break; break;
} }
@@ -2674,13 +2674,15 @@ static void hdd_ipa_w2i_cb(void *priv, enum ipa_dp_evt_type evt,
* *
* Return: None * Return: None
*/ */
void hdd_ipa_nbuf_cb(cdf_nbuf_t skb) void hdd_ipa_nbuf_cb(qdf_nbuf_t skb)
{ {
struct hdd_ipa_priv *hdd_ipa = ghdd_ipa; struct hdd_ipa_priv *hdd_ipa = ghdd_ipa;
HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "%p", wlan_hdd_stub_priv_to_addr(NBUF_CB_TX_IPA_PRIV(skb))); HDD_IPA_LOG(QDF_TRACE_LEVEL_DEBUG, "%p",
wlan_hdd_stub_priv_to_addr(QDF_NBUF_CB_TX_IPA_PRIV(skb)));
/* FIXME: This is broken; PRIV_DATA is now 31 bits */ /* FIXME: This is broken; PRIV_DATA is now 31 bits */
ipa_free_skb((struct ipa_rx_data *)wlan_hdd_stub_priv_to_addr(NBUF_CB_TX_IPA_PRIV(skb))); ipa_free_skb((struct ipa_rx_data *)
wlan_hdd_stub_priv_to_addr(QDF_NBUF_CB_TX_IPA_PRIV(skb)));
hdd_ipa->stats.num_tx_comp_cnt++; hdd_ipa->stats.num_tx_comp_cnt++;
@@ -2703,7 +2705,7 @@ static void hdd_ipa_send_pkt_to_tl(
struct hdd_ipa_priv *hdd_ipa = iface_context->hdd_ipa; struct hdd_ipa_priv *hdd_ipa = iface_context->hdd_ipa;
uint8_t interface_id; uint8_t interface_id;
hdd_adapter_t *adapter = NULL; hdd_adapter_t *adapter = NULL;
cdf_nbuf_t skb; qdf_nbuf_t skb;
qdf_spin_lock_bh(&iface_context->interface_lock); qdf_spin_lock_bh(&iface_context->interface_lock);
adapter = iface_context->adapter; adapter = iface_context->adapter;
@@ -2736,21 +2738,21 @@ static void hdd_ipa_send_pkt_to_tl(
skb = ipa_tx_desc->skb; skb = ipa_tx_desc->skb;
qdf_mem_set(skb->cb, sizeof(skb->cb), 0); qdf_mem_set(skb->cb, sizeof(skb->cb), 0);
cdf_nbuf_ipa_owned_set(skb); qdf_nbuf_ipa_owned_set(skb);
/* FIXME: This is broken. No such field in cb any more: /* FIXME: This is broken. No such field in cb any more:
NBUF_CALLBACK_FN(skb) = hdd_ipa_nbuf_cb; */ NBUF_CALLBACK_FN(skb) = hdd_ipa_nbuf_cb; */
if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) { if (hdd_ipa_uc_sta_is_enabled(hdd_ipa->hdd_ctx)) {
cdf_nbuf_mapped_paddr_set(skb, qdf_nbuf_mapped_paddr_set(skb,
ipa_tx_desc->dma_addr ipa_tx_desc->dma_addr
+ HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_FRAG_HEADER
+ HDD_IPA_WLAN_IPA_HEADER); + HDD_IPA_WLAN_IPA_HEADER);
ipa_tx_desc->skb->len -= ipa_tx_desc->skb->len -=
HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_IPA_HEADER; HDD_IPA_WLAN_FRAG_HEADER + HDD_IPA_WLAN_IPA_HEADER;
} else } else
cdf_nbuf_mapped_paddr_set(skb, ipa_tx_desc->dma_addr); qdf_nbuf_mapped_paddr_set(skb, ipa_tx_desc->dma_addr);
/* FIXME: This is broken: priv_data is 31 bits */ /* FIXME: This is broken: priv_data is 31 bits */
cdf_nbuf_ipa_priv_set(skb, wlan_hdd_stub_addr_to_priv(ipa_tx_desc)); qdf_nbuf_ipa_priv_set(skb, wlan_hdd_stub_addr_to_priv(ipa_tx_desc));
adapter->stats.tx_bytes += ipa_tx_desc->skb->len; adapter->stats.tx_bytes += ipa_tx_desc->skb->len;
@@ -2785,12 +2787,13 @@ static void hdd_ipa_pm_send_pkt_to_tl(struct work_struct *work)
struct hdd_ipa_priv, struct hdd_ipa_priv,
pm_work); pm_work);
struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL; struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL;
cdf_nbuf_t skb; qdf_nbuf_t skb;
uint32_t dequeued = 0; uint32_t dequeued = 0;
qdf_spin_lock_bh(&hdd_ipa->pm_lock); qdf_spin_lock_bh(&hdd_ipa->pm_lock);
while (((skb = cdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) != NULL)) { while (((skb = qdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head))
!= NULL)) {
qdf_spin_unlock_bh(&hdd_ipa->pm_lock); qdf_spin_unlock_bh(&hdd_ipa->pm_lock);
pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb;
@@ -2825,13 +2828,13 @@ static void hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
struct hdd_ipa_priv *hdd_ipa = NULL; struct hdd_ipa_priv *hdd_ipa = NULL;
struct ipa_rx_data *ipa_tx_desc; struct ipa_rx_data *ipa_tx_desc;
struct hdd_ipa_iface_context *iface_context; struct hdd_ipa_iface_context *iface_context;
cdf_nbuf_t skb; qdf_nbuf_t skb;
struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL; struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL;
QDF_STATUS status = QDF_STATUS_SUCCESS; QDF_STATUS status = QDF_STATUS_SUCCESS;
iface_context = (struct hdd_ipa_iface_context *)priv; iface_context = (struct hdd_ipa_iface_context *)priv;
if (evt != IPA_RECEIVE) { if (evt != IPA_RECEIVE) {
skb = (cdf_nbuf_t) data; skb = (qdf_nbuf_t) data;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
iface_context->stats.num_tx_drop++; iface_context->stats.num_tx_drop++;
return; return;
@@ -2879,7 +2882,7 @@ static void hdd_ipa_i2w_cb(void *priv, enum ipa_dp_evt_type evt,
pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb;
pm_tx_cb->iface_context = iface_context; pm_tx_cb->iface_context = iface_context;
pm_tx_cb->ipa_tx_desc = ipa_tx_desc; pm_tx_cb->ipa_tx_desc = ipa_tx_desc;
cdf_nbuf_queue_add(&hdd_ipa->pm_queue_head, skb); qdf_nbuf_queue_add(&hdd_ipa->pm_queue_head, skb);
hdd_ipa->stats.num_tx_queued++; hdd_ipa->stats.num_tx_queued++;
qdf_spin_unlock_bh(&hdd_ipa->pm_lock); qdf_spin_unlock_bh(&hdd_ipa->pm_lock);
@@ -4066,7 +4069,7 @@ QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx)
INIT_WORK(&hdd_ipa->pm_work, hdd_ipa_pm_send_pkt_to_tl); INIT_WORK(&hdd_ipa->pm_work, hdd_ipa_pm_send_pkt_to_tl);
#endif #endif
qdf_spinlock_create(&hdd_ipa->pm_lock); qdf_spinlock_create(&hdd_ipa->pm_lock);
cdf_nbuf_queue_init(&hdd_ipa->pm_queue_head); qdf_nbuf_queue_init(&hdd_ipa->pm_queue_head);
ret = hdd_ipa_setup_rm(hdd_ipa); ret = hdd_ipa_setup_rm(hdd_ipa);
if (ret) if (ret)
@@ -4140,7 +4143,7 @@ QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx)
struct hdd_ipa_priv *hdd_ipa = hdd_ctx->hdd_ipa; struct hdd_ipa_priv *hdd_ipa = hdd_ctx->hdd_ipa;
int i; int i;
struct hdd_ipa_iface_context *iface_context = NULL; struct hdd_ipa_iface_context *iface_context = NULL;
cdf_nbuf_t skb; qdf_nbuf_t skb;
struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL; struct hdd_ipa_pm_tx_cb *pm_tx_cb = NULL;
if (!hdd_ipa_is_enabled(hdd_ctx)) if (!hdd_ipa_is_enabled(hdd_ctx))
@@ -4163,7 +4166,8 @@ QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx)
qdf_spin_lock_bh(&hdd_ipa->pm_lock); qdf_spin_lock_bh(&hdd_ipa->pm_lock);
while (((skb = cdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head)) != NULL)) { while (((skb = qdf_nbuf_queue_remove(&hdd_ipa->pm_queue_head))
!= NULL)) {
qdf_spin_unlock_bh(&hdd_ipa->pm_lock); qdf_spin_unlock_bh(&hdd_ipa->pm_lock);
pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb; pm_tx_cb = (struct hdd_ipa_pm_tx_cb *)skb->cb;

Переглянути файл

@@ -258,7 +258,7 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac]; ++pAdapter->hdd_stats.hddTxRxStats.txXmitClassifiedAC[ac];
#if defined (IPA_OFFLOAD) #if defined (IPA_OFFLOAD)
if (!cdf_nbuf_ipa_owned_get(skb)) { if (!qdf_nbuf_ipa_owned_get(skb)) {
#endif #endif
/* Check if the buffer has enough header room */ /* Check if the buffer has enough header room */
skb = skb_unshare(skb, GFP_ATOMIC); skb = skb_unshare(skb, GFP_ATOMIC);
@@ -299,18 +299,18 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Zero out skb's context buffer for the driver to use */ /* Zero out skb's context buffer for the driver to use */
qdf_mem_set(skb->cb, sizeof(skb->cb), 0); qdf_mem_set(skb->cb, sizeof(skb->cb), 0);
NBUF_CB_TX_PACKET_TRACK(skb) = NBUF_TX_PKT_DATA_TRACK; QDF_NBUF_CB_TX_PACKET_TRACK(skb) = QDF_NBUF_TX_PKT_DATA_TRACK;
NBUF_UPDATE_TX_PKT_COUNT(skb, NBUF_TX_PKT_HDD); QDF_NBUF_UPDATE_TX_PKT_COUNT(skb, QDF_NBUF_TX_PKT_HDD);
qdf_dp_trace_set_track(skb); qdf_dp_trace_set_track(skb);
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_PTR_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_PTR_RECORD,
(uint8_t *)skb->data, sizeof(skb->data))); (uint8_t *)skb->data, sizeof(skb->data)));
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD,
(uint8_t *)skb->data, cdf_nbuf_len(skb))); (uint8_t *)skb->data, qdf_nbuf_len(skb)));
if (cdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE) if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD,
(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE], (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
(cdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE))); (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE)));
if (ol_tx_send_data_frame(STAId, skb, if (ol_tx_send_data_frame(STAId, skb,
proto_type) != NULL) { proto_type) != NULL) {
@@ -327,11 +327,11 @@ int hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
drop_pkt: drop_pkt:
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
(uint8_t *)skb->data, cdf_nbuf_len(skb))); (uint8_t *)skb->data, qdf_nbuf_len(skb)));
if (cdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE) if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE], (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
(cdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE))); (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE)));
kfree_skb(skb); kfree_skb(skb);
drop_pkt_accounting: drop_pkt_accounting:
@@ -490,7 +490,7 @@ QDF_STATUS hdd_softap_deinit_tx_rx_sta(hdd_adapter_t *pAdapter, uint8_t STAId)
/** /**
* hdd_softap_rx_packet_cbk() - Receive packet handler * hdd_softap_rx_packet_cbk() - Receive packet handler
* @cds_context: pointer to CDS context * @cds_context: pointer to CDS context
* @rxBuf: pointer to rx cdf_nbuf * @rxBuf: pointer to rx qdf_nbuf
* @staId: Station Id * @staId: Station Id
* *
* Receive callback registered with TL. TL will call this to notify * Receive callback registered with TL. TL will call this to notify
@@ -501,7 +501,7 @@ QDF_STATUS hdd_softap_deinit_tx_rx_sta(hdd_adapter_t *pAdapter, uint8_t STAId)
* QDF_STATUS_SUCCESS otherwise * QDF_STATUS_SUCCESS otherwise
*/ */
QDF_STATUS hdd_softap_rx_packet_cbk(void *cds_context, QDF_STATUS hdd_softap_rx_packet_cbk(void *cds_context,
cdf_nbuf_t rxBuf, uint8_t staId) qdf_nbuf_t rxBuf, uint8_t staId)
{ {
hdd_adapter_t *pAdapter = NULL; hdd_adapter_t *pAdapter = NULL;
int rxstat; int rxstat;
@@ -578,7 +578,7 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *cds_context,
/* Remove SKB from internal tracking table before submitting /* Remove SKB from internal tracking table before submitting
* it to stack * it to stack
*/ */
cdf_net_buf_debug_release_skb(rxBuf); qdf_net_buf_debug_release_skb(rxBuf);
if (hdd_napi_enabled(HDD_NAPI_ANY) && !pHddCtx->config->enableRxThread) if (hdd_napi_enabled(HDD_NAPI_ANY) && !pHddCtx->config->enableRxThread)
rxstat = netif_receive_skb(skb); rxstat = netif_receive_skb(skb);

Переглянути файл

@@ -368,7 +368,7 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Get TL AC corresponding to Qdisc queue index/AC. */ /* Get TL AC corresponding to Qdisc queue index/AC. */
ac = hdd_qdisc_ac_to_tl_ac[skb->queue_mapping]; ac = hdd_qdisc_ac_to_tl_ac[skb->queue_mapping];
if (!cdf_nbuf_ipa_owned_get(skb)) { if (!qdf_nbuf_ipa_owned_get(skb)) {
/* Check if the buffer has enough header room */ /* Check if the buffer has enough header room */
skb = skb_unshare(skb, GFP_ATOMIC); skb = skb_unshare(skb, GFP_ATOMIC);
if (!skb) if (!skb)
@@ -476,20 +476,20 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Zero out skb's context buffer for the driver to use */ /* Zero out skb's context buffer for the driver to use */
qdf_mem_set(skb->cb, sizeof(skb->cb), 0); qdf_mem_set(skb->cb, sizeof(skb->cb), 0);
NBUF_CB_TX_PACKET_TRACK(skb) = NBUF_TX_PKT_DATA_TRACK; QDF_NBUF_CB_TX_PACKET_TRACK(skb) = QDF_NBUF_TX_PKT_DATA_TRACK;
NBUF_UPDATE_TX_PKT_COUNT(skb, NBUF_TX_PKT_HDD); QDF_NBUF_UPDATE_TX_PKT_COUNT(skb, QDF_NBUF_TX_PKT_HDD);
qdf_dp_trace_set_track(skb); qdf_dp_trace_set_track(skb);
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_PTR_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_PTR_RECORD,
(uint8_t *)skb->data, sizeof(skb->data))); (uint8_t *)skb->data, sizeof(skb->data)));
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD,
(uint8_t *)skb->data, cdf_nbuf_len(skb))); (uint8_t *)skb->data, qdf_nbuf_len(skb)));
if (cdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE) if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_HDD_PACKET_RECORD,
(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE], (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
(cdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE))); (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE)));
if (ol_tx_send_data_frame(STAId, (cdf_nbuf_t) skb, if (ol_tx_send_data_frame(STAId, (qdf_nbuf_t) skb,
proto_type) != NULL) { proto_type) != NULL) {
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_WARN, QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_WARN,
"%s: Failed to send packet to txrx for staid:%d", "%s: Failed to send packet to txrx for staid:%d",
@@ -503,11 +503,11 @@ int hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
drop_pkt: drop_pkt:
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
(uint8_t *)skb->data, cdf_nbuf_len(skb))); (uint8_t *)skb->data, qdf_nbuf_len(skb)));
if (cdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE) if (qdf_nbuf_len(skb) > QDF_DP_TRACE_RECORD_SIZE)
DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD, DPTRACE(qdf_dp_trace(skb, QDF_DP_TRACE_DROP_PACKET_RECORD,
(uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE], (uint8_t *)&skb->data[QDF_DP_TRACE_RECORD_SIZE],
(cdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE))); (qdf_nbuf_len(skb)-QDF_DP_TRACE_RECORD_SIZE)));
++pAdapter->stats.tx_dropped; ++pAdapter->stats.tx_dropped;
++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped; ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
@@ -642,7 +642,7 @@ QDF_STATUS hdd_deinit_tx_rx(hdd_adapter_t *pAdapter)
/** /**
* hdd_rx_packet_cbk() - Receive packet handler * hdd_rx_packet_cbk() - Receive packet handler
* @cds_context: pointer to CDS context * @cds_context: pointer to CDS context
* @rxBuf: pointer to rx cdf_nbuf * @rxBuf: pointer to rx qdf_nbuf
* @staId: Station Id * @staId: Station Id
* *
* Receive callback registered with TL. TL will call this to notify * Receive callback registered with TL. TL will call this to notify
@@ -652,7 +652,7 @@ QDF_STATUS hdd_deinit_tx_rx(hdd_adapter_t *pAdapter)
* Return: QDF_STATUS_E_FAILURE if any errors encountered, * Return: QDF_STATUS_E_FAILURE if any errors encountered,
* QDF_STATUS_SUCCESS otherwise * QDF_STATUS_SUCCESS otherwise
*/ */
QDF_STATUS hdd_rx_packet_cbk(void *cds_context, cdf_nbuf_t rxBuf, uint8_t staId) QDF_STATUS hdd_rx_packet_cbk(void *cds_context, qdf_nbuf_t rxBuf, uint8_t staId)
{ {
hdd_adapter_t *pAdapter = NULL; hdd_adapter_t *pAdapter = NULL;
hdd_context_t *pHddCtx = NULL; hdd_context_t *pHddCtx = NULL;
@@ -706,7 +706,7 @@ QDF_STATUS hdd_rx_packet_cbk(void *cds_context, cdf_nbuf_t rxBuf, uint8_t staId)
/* Remove SKB from internal tracking table before submitting /* Remove SKB from internal tracking table before submitting
* it to stack * it to stack
*/ */
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -740,7 +740,7 @@ QDF_STATUS hdd_rx_packet_cbk(void *cds_context, cdf_nbuf_t rxBuf, uint8_t staId)
/* Remove SKB from internal tracking table before submitting /* Remove SKB from internal tracking table before submitting
* it to stack * it to stack
*/ */
cdf_net_buf_debug_release_skb(rxBuf); qdf_net_buf_debug_release_skb(rxBuf);
if (HDD_LRO_NO_RX == if (HDD_LRO_NO_RX ==
hdd_lro_rx(pHddCtx, pAdapter, skb)) { hdd_lro_rx(pHddCtx, pAdapter, skb)) {

Переглянути файл

@@ -35,6 +35,7 @@
#include "wma_types.h" #include "wma_types.h"
#include "sme_api.h" #include "sme_api.h"
#include "mac_init_api.h" #include "mac_init_api.h"
#include "qdf_trace.h"
/* /*
* Cookie for SYS messages. Note that anyone posting a SYS Message * Cookie for SYS messages. Note that anyone posting a SYS Message
@@ -72,6 +73,7 @@ QDF_STATUS sys_build_message_header(SYS_MSG_ID sysMsgId, cds_msg_t *pMsg)
* *
* Return: none * Return: none
*/ */
#ifdef QDF_ENABLE_TRACING
void sys_stop_complete_cb(void *pUserData) void sys_stop_complete_cb(void *pUserData)
{ {
qdf_event_t *pStopEvt = (qdf_event_t *) pUserData; qdf_event_t *pStopEvt = (qdf_event_t *) pUserData;
@@ -80,6 +82,12 @@ void sys_stop_complete_cb(void *pUserData)
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
} }
#else
void sys_stop_complete_cb(void *pUserData)
{
return;
}
#endif
/** /**
* sys_stop() - To post stop message to system module * sys_stop() - To post stop message to system module

Переглянути файл

@@ -49,7 +49,7 @@
/*DFS New Include Start*/ /*DFS New Include Start*/
#include <qdf_net_types.h> /* QDF_NBUF_EXEMPT_NO_EXEMPTION, etc. */ #include <qdf_net_types.h> /* QDF_NBUF_EXEMPT_NO_EXEMPTION, etc. */
#include <cdf_nbuf.h> /* cdf_nbuf_t, etc. */ #include <qdf_nbuf.h> /* qdf_nbuf_t, etc. */
#include <qdf_util.h> /* qdf_assert */ #include <qdf_util.h> /* qdf_assert */
#include <qdf_lock.h> /* cdf_spinlock */ #include <qdf_lock.h> /* cdf_spinlock */
#include <cds_queue.h> /* TAILQ */ #include <cds_queue.h> /* TAILQ */

Переглянути файл

@@ -96,7 +96,7 @@ typedef struct {
struct task_struct *pid; struct task_struct *pid;
void *arg; void *arg;
bool done; bool done;
cdf_nbuf_t skb; qdf_nbuf_t skb;
HTC_ENDPOINT_ID eid; HTC_ENDPOINT_ID eid;
struct semaphore sem; struct semaphore sem;
bool inited; bool inited;
@@ -142,7 +142,7 @@ typedef struct epping_adapter_s {
uint8_t sessionId; uint8_t sessionId;
/* for mboxping */ /* for mboxping */
qdf_spinlock_t data_lock; qdf_spinlock_t data_lock;
cdf_nbuf_queue_t nodrop_queue; qdf_nbuf_queue_t nodrop_queue;
qdf_timer_t epping_timer; qdf_timer_t epping_timer;
epping_tx_timer_state_t epping_timer_state; epping_tx_timer_state_t epping_timer_state;
bool registered; bool registered;
@@ -168,7 +168,7 @@ void epping_set_kperf_flag(epping_adapter_t *pAdapter,
/* epping_tx signatures */ /* epping_tx signatures */
void epping_tx_timer_expire(epping_adapter_t *pAdapter); void epping_tx_timer_expire(epping_adapter_t *pAdapter);
void epping_tx_complete_multiple(void *ctx, HTC_PACKET_QUEUE *pPacketQueue); void epping_tx_complete_multiple(void *ctx, HTC_PACKET_QUEUE *pPacketQueue);
int epping_tx_send(cdf_nbuf_t skb, epping_adapter_t *pAdapter); int epping_tx_send(qdf_nbuf_t skb, epping_adapter_t *pAdapter);
#ifdef HIF_SDIO #ifdef HIF_SDIO
HTC_SEND_FULL_ACTION epping_tx_queue_full(void *Context, HTC_PACKET *pPacket); HTC_SEND_FULL_ACTION epping_tx_queue_full(void *Context, HTC_PACKET *pPacket);
@@ -192,6 +192,6 @@ void epping_register_tx_copier(HTC_ENDPOINT_ID eid,
void epping_unregister_tx_copier(HTC_ENDPOINT_ID eid, void epping_unregister_tx_copier(HTC_ENDPOINT_ID eid,
epping_context_t *pEpping_ctx); epping_context_t *pEpping_ctx);
void epping_tx_copier_schedule(epping_context_t *pEpping_ctx, void epping_tx_copier_schedule(epping_context_t *pEpping_ctx,
HTC_ENDPOINT_ID eid, cdf_nbuf_t skb); HTC_ENDPOINT_ID eid, qdf_nbuf_t skb);
#endif /* HIF_PCI */ #endif /* HIF_PCI */
#endif /* end #ifndef EPPING_INTERNAL_H */ #endif /* end #ifndef EPPING_INTERNAL_H */

Переглянути файл

@@ -83,7 +83,7 @@ void epping_refill(void *ctx, HTC_ENDPOINT_ID Endpoint)
__func__, buffersToRefill, Endpoint); __func__, buffersToRefill, Endpoint);
for (RxBuffers = 0; RxBuffers < buffersToRefill; RxBuffers++) { for (RxBuffers = 0; RxBuffers < buffersToRefill; RxBuffers++) {
osBuf = cdf_nbuf_alloc(NULL, AR6000_BUFFER_SIZE, osBuf = qdf_nbuf_alloc(NULL, AR6000_BUFFER_SIZE,
AR6000_MIN_HEAD_ROOM, 4, false); AR6000_MIN_HEAD_ROOM, 4, false);
if (NULL == osBuf) { if (NULL == osBuf) {
break; break;
@@ -93,7 +93,7 @@ void epping_refill(void *ctx, HTC_ENDPOINT_ID Endpoint)
pPacket = (HTC_PACKET *) (A_NETBUF_HEAD(osBuf)); pPacket = (HTC_PACKET *) (A_NETBUF_HEAD(osBuf));
/* set re-fill info */ /* set re-fill info */
SET_HTC_PACKET_INFO_RX_REFILL(pPacket, osBuf, SET_HTC_PACKET_INFO_RX_REFILL(pPacket, osBuf,
cdf_nbuf_data(osBuf), qdf_nbuf_data(osBuf),
AR6000_BUFFER_SIZE, Endpoint); AR6000_BUFFER_SIZE, Endpoint);
SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, osBuf); SET_HTC_PACKET_NET_BUF_CONTEXT(pPacket, osBuf);
/* add to queue */ /* add to queue */
@@ -123,9 +123,9 @@ void epping_rx(void *ctx, HTC_PACKET *pPacket)
if (status != A_OK) { if (status != A_OK) {
if (status != A_ECANCELED) { if (status != A_ECANCELED) {
printk("%s: RX ERR (%d) \n", __func__, status); printk("%s: RX ERR (%d)\n", __func__, status);
} }
cdf_nbuf_free(pktSkb); qdf_nbuf_free(pktSkb);
return; return;
} }
@@ -135,7 +135,7 @@ void epping_rx(void *ctx, HTC_PACKET *pPacket)
A_NETBUF_PULL(pktSkb, EPPING_ALIGNMENT_PAD); A_NETBUF_PULL(pktSkb, EPPING_ALIGNMENT_PAD);
} }
if (enb_rx_dump) if (enb_rx_dump)
epping_hex_dump((void *)cdf_nbuf_data(pktSkb), epping_hex_dump((void *)qdf_nbuf_data(pktSkb),
pktSkb->len, __func__); pktSkb->len, __func__);
pktSkb->dev = dev; pktSkb->dev = dev;
if ((pktSkb->dev->flags & IFF_UP) == IFF_UP) { if ((pktSkb->dev->flags & IFF_UP) == IFF_UP) {
@@ -155,7 +155,7 @@ void epping_rx(void *ctx, HTC_PACKET *pPacket)
} }
} else { } else {
++pAdapter->stats.rx_dropped; ++pAdapter->stats.rx_dropped;
cdf_nbuf_free(pktSkb); qdf_nbuf_free(pktSkb);
} }
} }
} }

Переглянути файл

@@ -56,11 +56,11 @@
static bool enb_tx_dump; static bool enb_tx_dump;
void epping_tx_dup_pkt(epping_adapter_t *pAdapter, void epping_tx_dup_pkt(epping_adapter_t *pAdapter,
HTC_ENDPOINT_ID eid, cdf_nbuf_t skb) HTC_ENDPOINT_ID eid, qdf_nbuf_t skb)
{ {
struct epping_cookie *cookie = NULL; struct epping_cookie *cookie = NULL;
int skb_len, ret; int skb_len, ret;
cdf_nbuf_t new_skb; qdf_nbuf_t new_skb;
cookie = epping_alloc_cookie(pAdapter->pEpping_ctx); cookie = epping_alloc_cookie(pAdapter->pEpping_ctx);
if (cookie == NULL) { if (cookie == NULL) {
@@ -69,25 +69,25 @@ void epping_tx_dup_pkt(epping_adapter_t *pAdapter,
__func__); __func__);
return; return;
} }
new_skb = cdf_nbuf_copy(skb); new_skb = qdf_nbuf_copy(skb);
if (!new_skb) { if (!new_skb) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: cdf_nbuf_copy returns no resource\n", __func__); "%s: qdf_nbuf_copy returns no resource\n", __func__);
epping_free_cookie(pAdapter->pEpping_ctx, cookie); epping_free_cookie(pAdapter->pEpping_ctx, cookie);
return; return;
} }
SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt, SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt,
cookie, cdf_nbuf_data(skb), cookie, qdf_nbuf_data(skb),
cdf_nbuf_len(new_skb), eid, 0); qdf_nbuf_len(new_skb), eid, 0);
SET_HTC_PACKET_NET_BUF_CONTEXT(&cookie->HtcPkt, new_skb); SET_HTC_PACKET_NET_BUF_CONTEXT(&cookie->HtcPkt, new_skb);
skb_len = (int)cdf_nbuf_len(new_skb); skb_len = (int)qdf_nbuf_len(new_skb);
/* send the packet */ /* send the packet */
ret = htc_send_pkt(pAdapter->pEpping_ctx->HTCHandle, &cookie->HtcPkt); ret = htc_send_pkt(pAdapter->pEpping_ctx->HTCHandle, &cookie->HtcPkt);
if (ret != A_OK) { if (ret != A_OK) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: htc_send_pkt failed, ret = %d\n", __func__, ret); "%s: htc_send_pkt failed, ret = %d\n", __func__, ret);
epping_free_cookie(pAdapter->pEpping_ctx, cookie); epping_free_cookie(pAdapter->pEpping_ctx, cookie);
cdf_nbuf_free(new_skb); qdf_nbuf_free(new_skb);
return; return;
} }
pAdapter->stats.tx_bytes += skb_len; pAdapter->stats.tx_bytes += skb_len;
@@ -99,9 +99,9 @@ void epping_tx_dup_pkt(epping_adapter_t *pAdapter,
} }
} }
static int epping_tx_send_int(cdf_nbuf_t skb, epping_adapter_t *pAdapter) static int epping_tx_send_int(qdf_nbuf_t skb, epping_adapter_t *pAdapter)
{ {
EPPING_HEADER *eppingHdr = (EPPING_HEADER *) cdf_nbuf_data(skb); EPPING_HEADER *eppingHdr = (EPPING_HEADER *) qdf_nbuf_data(skb);
HTC_ENDPOINT_ID eid = ENDPOINT_UNUSED; HTC_ENDPOINT_ID eid = ENDPOINT_UNUSED;
struct epping_cookie *cookie = NULL; struct epping_cookie *cookie = NULL;
A_UINT8 ac = 0; A_UINT8 ac = 0;
@@ -143,7 +143,7 @@ static int epping_tx_send_int(cdf_nbuf_t skb, epping_adapter_t *pAdapter)
epping_set_kperf_flag(pAdapter, eid, tmpHdr.CmdBuffer_t[0]); epping_set_kperf_flag(pAdapter, eid, tmpHdr.CmdBuffer_t[0]);
} }
SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt, SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt,
cookie, cdf_nbuf_data(skb), cdf_nbuf_len(skb), cookie, qdf_nbuf_data(skb), qdf_nbuf_len(skb),
eid, 0); eid, 0);
SET_HTC_PACKET_NET_BUF_CONTEXT(&cookie->HtcPkt, skb); SET_HTC_PACKET_NET_BUF_CONTEXT(&cookie->HtcPkt, skb);
skb_len = skb->len; skb_len = skb->len;
@@ -170,25 +170,25 @@ static int epping_tx_send_int(cdf_nbuf_t skb, epping_adapter_t *pAdapter)
void epping_tx_timer_expire(epping_adapter_t *pAdapter) void epping_tx_timer_expire(epping_adapter_t *pAdapter)
{ {
cdf_nbuf_t nodrop_skb; qdf_nbuf_t nodrop_skb;
EPPING_LOG(QDF_TRACE_LEVEL_INFO, "%s: queue len: %d\n", __func__, EPPING_LOG(QDF_TRACE_LEVEL_INFO, "%s: queue len: %d\n", __func__,
cdf_nbuf_queue_len(&pAdapter->nodrop_queue)); qdf_nbuf_queue_len(&pAdapter->nodrop_queue));
if (!cdf_nbuf_queue_len(&pAdapter->nodrop_queue)) { if (!qdf_nbuf_queue_len(&pAdapter->nodrop_queue)) {
/* nodrop queue is empty so no need to arm timer */ /* nodrop queue is empty so no need to arm timer */
pAdapter->epping_timer_state = EPPING_TX_TIMER_STOPPED; pAdapter->epping_timer_state = EPPING_TX_TIMER_STOPPED;
return; return;
} }
/* try to flush nodrop queue */ /* try to flush nodrop queue */
while ((nodrop_skb = cdf_nbuf_queue_remove(&pAdapter->nodrop_queue))) { while ((nodrop_skb = qdf_nbuf_queue_remove(&pAdapter->nodrop_queue))) {
if (epping_tx_send_int(nodrop_skb, pAdapter)) { if (epping_tx_send_int(nodrop_skb, pAdapter)) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: nodrop: %p xmit fail in timer\n", "%s: nodrop: %p xmit fail in timer\n",
__func__, nodrop_skb); __func__, nodrop_skb);
/* fail to xmit so put the nodrop packet to the nodrop queue */ /* fail to xmit so put the nodrop packet to the nodrop queue */
cdf_nbuf_queue_insert_head(&pAdapter->nodrop_queue, qdf_nbuf_queue_insert_head(&pAdapter->nodrop_queue,
nodrop_skb); nodrop_skb);
break; break;
} else { } else {
@@ -213,19 +213,19 @@ void epping_tx_timer_expire(epping_adapter_t *pAdapter)
} }
} }
int epping_tx_send(cdf_nbuf_t skb, epping_adapter_t *pAdapter) int epping_tx_send(qdf_nbuf_t skb, epping_adapter_t *pAdapter)
{ {
cdf_nbuf_t nodrop_skb; qdf_nbuf_t nodrop_skb;
EPPING_HEADER *eppingHdr; EPPING_HEADER *eppingHdr;
A_UINT8 ac = 0; A_UINT8 ac = 0;
eppingHdr = (EPPING_HEADER *) cdf_nbuf_data(skb); eppingHdr = (EPPING_HEADER *) qdf_nbuf_data(skb);
if (!IS_EPPING_PACKET(eppingHdr)) { if (!IS_EPPING_PACKET(eppingHdr)) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: Recived non endpoint ping packets\n", __func__); "%s: Recived non endpoint ping packets\n", __func__);
/* no packet to send, cleanup */ /* no packet to send, cleanup */
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
return -ENOMEM; return -ENOMEM;
} }
@@ -236,7 +236,7 @@ int epping_tx_send(cdf_nbuf_t skb, epping_adapter_t *pAdapter)
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: ac %d is not mapped to mboxping service\n", "%s: ac %d is not mapped to mboxping service\n",
__func__, ac); __func__, ac);
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
return -ENOMEM; return -ENOMEM;
} }
@@ -252,13 +252,13 @@ int epping_tx_send(cdf_nbuf_t skb, epping_adapter_t *pAdapter)
*/ */
/* check the nodrop queue first */ /* check the nodrop queue first */
while ((nodrop_skb = cdf_nbuf_queue_remove(&pAdapter->nodrop_queue))) { while ((nodrop_skb = qdf_nbuf_queue_remove(&pAdapter->nodrop_queue))) {
if (epping_tx_send_int(nodrop_skb, pAdapter)) { if (epping_tx_send_int(nodrop_skb, pAdapter)) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: nodrop: %p xmit fail\n", __func__, "%s: nodrop: %p xmit fail\n", __func__,
nodrop_skb); nodrop_skb);
/* fail to xmit so put the nodrop packet to the nodrop queue */ /* fail to xmit so put the nodrop packet to the nodrop queue */
cdf_nbuf_queue_insert_head(&pAdapter->nodrop_queue, qdf_nbuf_queue_insert_head(&pAdapter->nodrop_queue,
nodrop_skb); nodrop_skb);
/* no cookie so free the current skb */ /* no cookie so free the current skb */
goto tx_fail; goto tx_fail;
@@ -278,7 +278,7 @@ int epping_tx_send(cdf_nbuf_t skb, epping_adapter_t *pAdapter)
tx_fail: tx_fail:
if (!IS_EPING_PACKET_NO_DROP(eppingHdr)) { if (!IS_EPING_PACKET_NO_DROP(eppingHdr)) {
/* allow to drop the skb so drop it */ /* allow to drop the skb so drop it */
cdf_nbuf_free(skb); qdf_nbuf_free(skb);
++pAdapter->stats.tx_dropped; ++pAdapter->stats.tx_dropped;
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: Tx skb %p dropped, stats.tx_dropped = %ld\n", "%s: Tx skb %p dropped, stats.tx_dropped = %ld\n",
@@ -287,7 +287,7 @@ tx_fail:
} else { } else {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL, EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: nodrop: %p queued\n", __func__, skb); "%s: nodrop: %p queued\n", __func__, skb);
cdf_nbuf_queue_add(&pAdapter->nodrop_queue, skb); qdf_nbuf_queue_add(&pAdapter->nodrop_queue, skb);
qdf_spin_lock_bh(&pAdapter->data_lock); qdf_spin_lock_bh(&pAdapter->data_lock);
if (pAdapter->epping_timer_state != EPPING_TX_TIMER_RUNNING) { if (pAdapter->epping_timer_state != EPPING_TX_TIMER_RUNNING) {
pAdapter->epping_timer_state = EPPING_TX_TIMER_RUNNING; pAdapter->epping_timer_state = EPPING_TX_TIMER_RUNNING;
@@ -317,13 +317,13 @@ void epping_tx_complete_multiple(void *ctx, HTC_PACKET_QUEUE *pPacketQueue)
struct net_device *dev = pAdapter->dev; struct net_device *dev = pAdapter->dev;
A_STATUS status; A_STATUS status;
HTC_ENDPOINT_ID eid; HTC_ENDPOINT_ID eid;
cdf_nbuf_t pktSkb; qdf_nbuf_t pktSkb;
struct epping_cookie *cookie; struct epping_cookie *cookie;
A_BOOL flushing = false; A_BOOL flushing = false;
cdf_nbuf_queue_t skb_queue; qdf_nbuf_queue_t skb_queue;
HTC_PACKET *htc_pkt; HTC_PACKET *htc_pkt;
cdf_nbuf_queue_init(&skb_queue); qdf_nbuf_queue_init(&skb_queue);
qdf_spin_lock_bh(&pAdapter->data_lock); qdf_spin_lock_bh(&pAdapter->data_lock);
@@ -337,13 +337,13 @@ void epping_tx_complete_multiple(void *ctx, HTC_PACKET_QUEUE *pPacketQueue)
cookie = htc_pkt->pPktContext; cookie = htc_pkt->pPktContext;
ASSERT(pktSkb); ASSERT(pktSkb);
ASSERT(htc_pkt->pBuffer == cdf_nbuf_data(pktSkb)); ASSERT(htc_pkt->pBuffer == qdf_nbuf_data(pktSkb));
/* add this to the list, use faster non-lock API */ /* add this to the list, use faster non-lock API */
cdf_nbuf_queue_add(&skb_queue, pktSkb); qdf_nbuf_queue_add(&skb_queue, pktSkb);
if (A_SUCCESS(status)) { if (A_SUCCESS(status)) {
ASSERT(htc_pkt->ActualLength == cdf_nbuf_len(pktSkb)); ASSERT(htc_pkt->ActualLength == qdf_nbuf_len(pktSkb));
} }
EPPING_LOG(QDF_TRACE_LEVEL_INFO, EPPING_LOG(QDF_TRACE_LEVEL_INFO,
"%s skb=%p data=%p len=0x%x eid=%d ", "%s skb=%p data=%p len=0x%x eid=%d ",
@@ -370,12 +370,12 @@ void epping_tx_complete_multiple(void *ctx, HTC_PACKET_QUEUE *pPacketQueue)
qdf_spin_unlock_bh(&pAdapter->data_lock); qdf_spin_unlock_bh(&pAdapter->data_lock);
/* free all skbs in our local list */ /* free all skbs in our local list */
while (cdf_nbuf_queue_len(&skb_queue)) { while (qdf_nbuf_queue_len(&skb_queue)) {
/* use non-lock version */ /* use non-lock version */
pktSkb = cdf_nbuf_queue_remove(&skb_queue); pktSkb = qdf_nbuf_queue_remove(&skb_queue);
if (pktSkb == NULL) if (pktSkb == NULL)
break; break;
cdf_nbuf_free(pktSkb); qdf_nbuf_free(pktSkb);
pEpping_ctx->total_tx_acks++; pEpping_ctx->total_tx_acks++;
} }

Переглянути файл

@@ -312,11 +312,11 @@ void epping_destroy_adapter(epping_adapter_t *pAdapter)
qdf_timer_free(&pAdapter->epping_timer); qdf_timer_free(&pAdapter->epping_timer);
pAdapter->epping_timer_state = EPPING_TX_TIMER_STOPPED; pAdapter->epping_timer_state = EPPING_TX_TIMER_STOPPED;
while (cdf_nbuf_queue_len(&pAdapter->nodrop_queue)) { while (qdf_nbuf_queue_len(&pAdapter->nodrop_queue)) {
cdf_nbuf_t tmp_nbuf = NULL; qdf_nbuf_t tmp_nbuf = NULL;
tmp_nbuf = cdf_nbuf_queue_remove(&pAdapter->nodrop_queue); tmp_nbuf = qdf_nbuf_queue_remove(&pAdapter->nodrop_queue);
if (tmp_nbuf) if (tmp_nbuf)
cdf_nbuf_free(tmp_nbuf); qdf_nbuf_free(tmp_nbuf);
} }
free_netdev(dev); free_netdev(dev);
@@ -368,7 +368,7 @@ epping_adapter_t *epping_add_adapter(epping_context_t *pEpping_ctx,
qdf_mem_copy(pAdapter->macAddressCurrent.bytes, qdf_mem_copy(pAdapter->macAddressCurrent.bytes,
macAddr, sizeof(tSirMacAddr)); macAddr, sizeof(tSirMacAddr));
qdf_spinlock_create(&pAdapter->data_lock); qdf_spinlock_create(&pAdapter->data_lock);
cdf_nbuf_queue_init(&pAdapter->nodrop_queue); qdf_nbuf_queue_init(&pAdapter->nodrop_queue);
pAdapter->epping_timer_state = EPPING_TX_TIMER_STOPPED; pAdapter->epping_timer_state = EPPING_TX_TIMER_STOPPED;
qdf_timer_init(epping_get_cdf_ctx(), &pAdapter->epping_timer, qdf_timer_init(epping_get_cdf_ctx(), &pAdapter->epping_timer,
epping_timer_expire, dev, QDF_TIMER_TYPE_SW); epping_timer_expire, dev, QDF_TIMER_TYPE_SW);

Переглянути файл

@@ -1392,7 +1392,7 @@ wmi_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
len, WMI_DBGLOG_CFG_CMDID); len, WMI_DBGLOG_CFG_CMDID);
if (status != A_OK) if (status != A_OK)
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return status; return status;
} }

Переглянути файл

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012-2014 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
* *
* Previously licensed under the ISC license by Qualcomm Atheros, Inc. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
* *
@@ -59,7 +59,7 @@ char *pktlog_getbuf(struct ol_pktlog_dev_t *pl_dev,
A_STATUS process_tx_info(struct ol_txrx_pdev_t *pdev, void *data); A_STATUS process_tx_info(struct ol_txrx_pdev_t *pdev, void *data);
A_STATUS process_rx_info(void *pdev, void *data); A_STATUS process_rx_info(void *pdev, void *data);
A_STATUS process_rx_info_remote(void *pdev, cdf_nbuf_t amsdu); A_STATUS process_rx_info_remote(void *pdev, qdf_nbuf_t amsdu);
A_STATUS process_rate_find(void *pdev, void *data); A_STATUS process_rate_find(void *pdev, void *data);
A_STATUS process_rate_update(void *pdev, void *data); A_STATUS process_rate_update(void *pdev, void *data);

Переглянути файл

@@ -406,7 +406,7 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data)
msdu_id_offset); msdu_id_offset);
uint8_t *addr, *vap_addr; uint8_t *addr, *vap_addr;
uint8_t vdev_id; uint8_t vdev_id;
cdf_nbuf_t netbuf; qdf_nbuf_t netbuf;
uint32_t len; uint32_t len;
qdf_mem_set(&pl_msdu_info, sizeof(pl_msdu_info), 0); qdf_mem_set(&pl_msdu_info, sizeof(pl_msdu_info), 0);
@@ -436,7 +436,7 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data)
htt_tx_desc = (uint32_t *) tx_desc->htt_tx_desc; htt_tx_desc = (uint32_t *) tx_desc->htt_tx_desc;
qdf_assert(htt_tx_desc); qdf_assert(htt_tx_desc);
cdf_nbuf_peek_header(netbuf, &addr, &len); qdf_nbuf_peek_header(netbuf, &addr, &len);
if (len < (2 * IEEE80211_ADDR_LEN)) { if (len < (2 * IEEE80211_ADDR_LEN)) {
qdf_print("TX frame does not have a valid" qdf_print("TX frame does not have a valid"
@@ -482,7 +482,7 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data)
return A_OK; return A_OK;
} }
A_STATUS process_rx_info_remote(void *pdev, cdf_nbuf_t amsdu) A_STATUS process_rx_info_remote(void *pdev, qdf_nbuf_t amsdu)
{ {
struct ol_pktlog_dev_t *pl_dev; struct ol_pktlog_dev_t *pl_dev;
struct ath_pktlog_info *pl_info; struct ath_pktlog_info *pl_info;
@@ -490,7 +490,7 @@ A_STATUS process_rx_info_remote(void *pdev, cdf_nbuf_t amsdu)
struct ath_pktlog_hdr pl_hdr; struct ath_pktlog_hdr pl_hdr;
struct ath_pktlog_rx_info rxstat_log; struct ath_pktlog_rx_info rxstat_log;
size_t log_size; size_t log_size;
cdf_nbuf_t msdu; qdf_nbuf_t msdu;
if (!pdev) { if (!pdev) {
printk("Invalid pdev in %s\n", __func__); printk("Invalid pdev in %s\n", __func__);
@@ -506,7 +506,7 @@ A_STATUS process_rx_info_remote(void *pdev, cdf_nbuf_t amsdu)
while (msdu) { while (msdu) {
rx_desc = rx_desc =
(struct htt_host_rx_desc_base *)(cdf_nbuf_data(msdu)) - 1; (struct htt_host_rx_desc_base *)(qdf_nbuf_data(msdu)) - 1;
log_size = log_size =
sizeof(*rx_desc) - sizeof(struct htt_host_fw_desc_base); sizeof(*rx_desc) - sizeof(struct htt_host_fw_desc_base);
@@ -530,7 +530,7 @@ A_STATUS process_rx_info_remote(void *pdev, cdf_nbuf_t amsdu)
log_size, &pl_hdr); log_size, &pl_hdr);
qdf_mem_copy(rxstat_log.rx_desc, (void *)rx_desc + qdf_mem_copy(rxstat_log.rx_desc, (void *)rx_desc +
sizeof(struct htt_host_fw_desc_base), pl_hdr.size); sizeof(struct htt_host_fw_desc_base), pl_hdr.size);
msdu = cdf_nbuf_next(msdu); msdu = qdf_nbuf_next(msdu);
} }
return A_OK; return A_OK;
} }

Переглянути файл

@@ -509,7 +509,7 @@ struct scan_param {
* @lock: lock * @lock: lock
*/ */
struct beacon_info { struct beacon_info {
cdf_nbuf_t buf; qdf_nbuf_t buf;
uint32_t len; uint32_t len;
uint8_t dma_mapped; uint8_t dma_mapped;
uint32_t tim_ie_offset; uint32_t tim_ie_offset;
@@ -991,7 +991,7 @@ struct dbs_hw_mode_info {
struct wmi_desc_t { struct wmi_desc_t {
pWMATxRxCompFunc tx_cmpl_cb; pWMATxRxCompFunc tx_cmpl_cb;
pWMAAckFnTxComp ota_post_proc_cb; pWMAAckFnTxComp ota_post_proc_cb;
cdf_nbuf_t nbuf; qdf_nbuf_t nbuf;
uint32_t desc_id; uint32_t desc_id;
}; };
@@ -1216,7 +1216,7 @@ typedef struct {
pWMAAckFnTxComp umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15]; pWMAAckFnTxComp umac_ota_ack_cb[SIR_MAC_MGMT_RESERVED15];
pWMAAckFnTxComp umac_data_ota_ack_cb; pWMAAckFnTxComp umac_data_ota_ack_cb;
unsigned long last_umac_data_ota_timestamp; unsigned long last_umac_data_ota_timestamp;
cdf_nbuf_t last_umac_data_nbuf; qdf_nbuf_t last_umac_data_nbuf;
bool needShutdown; bool needShutdown;
uint32_t num_mem_chunks; uint32_t num_mem_chunks;
struct wma_mem_chunk mem_chunks[MAX_MEM_CHUNKS]; struct wma_mem_chunk mem_chunks[MAX_MEM_CHUNKS];

Переглянути файл

@@ -156,7 +156,7 @@ void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type,
void *body_ptr, uint32_t body_val); void *body_ptr, uint32_t body_val);
void wma_data_tx_ack_comp_hdlr(void *wma_context, void wma_data_tx_ack_comp_hdlr(void *wma_context,
cdf_nbuf_t netbuf, int32_t status); qdf_nbuf_t netbuf, int32_t status);
QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param, QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param,
int value); int value);

Переглянути файл

@@ -45,7 +45,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -846,7 +846,7 @@ static void wma_data_tx_ack_work_handler(void *ack_work)
* Return: none * Return: none
*/ */
void void
wma_data_tx_ack_comp_hdlr(void *wma_context, cdf_nbuf_t netbuf, int32_t status) wma_data_tx_ack_comp_hdlr(void *wma_context, qdf_nbuf_t netbuf, int32_t status)
{ {
ol_txrx_pdev_handle pdev; ol_txrx_pdev_handle pdev;
tp_wma_handle wma_handle = (tp_wma_handle) wma_context; tp_wma_handle wma_handle = (tp_wma_handle) wma_context;
@@ -897,8 +897,8 @@ wma_data_tx_ack_comp_hdlr(void *wma_context, cdf_nbuf_t netbuf, int32_t status)
free_nbuf: free_nbuf:
/* unmap and freeing the tx buf as txrx is not taking care */ /* unmap and freeing the tx buf as txrx is not taking care */
cdf_nbuf_unmap_single(pdev->osdev, netbuf, QDF_DMA_TO_DEVICE); qdf_nbuf_unmap_single(pdev->osdev, netbuf, QDF_DMA_TO_DEVICE);
cdf_nbuf_free(netbuf); qdf_nbuf_free(netbuf);
} }
/** /**
@@ -1026,7 +1026,7 @@ QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t
if (ret) { if (ret) {
WMA_LOGP("%s: Failed to send enable/disable MCC" WMA_LOGP("%s: Failed to send enable/disable MCC"
" adaptive scheduler command", __func__); " adaptive scheduler command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -1134,7 +1134,7 @@ QDF_STATUS wma_set_mcc_channel_time_latency
if (ret) { if (ret) {
WMA_LOGE("%s: Failed to send MCC Channel Time Latency command", WMA_LOGE("%s: Failed to send MCC Channel Time Latency command",
__func__); __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
QDF_ASSERT(0); QDF_ASSERT(0);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
@@ -1266,7 +1266,7 @@ QDF_STATUS wma_set_mcc_channel_time_quota
WMI_RESMGR_SET_CHAN_TIME_QUOTA_CMDID); WMI_RESMGR_SET_CHAN_TIME_QUOTA_CMDID);
if (ret) { if (ret) {
WMA_LOGE("Failed to send MCC Channel Time Quota command"); WMA_LOGE("Failed to send MCC Channel Time Quota command");
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
QDF_ASSERT(0); QDF_ASSERT(0);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
@@ -1540,9 +1540,9 @@ wma_mgmt_tx_comp_conf_ind(tp_wma_handle wma_handle, uint8_t sub_type,
* Return: none * Return: none
*/ */
static void static void
wma_mgmt_tx_ack_comp_hdlr(void *wma_context, cdf_nbuf_t netbuf, int32_t status) wma_mgmt_tx_ack_comp_hdlr(void *wma_context, qdf_nbuf_t netbuf, int32_t status)
{ {
tpSirMacFrameCtl pFc = (tpSirMacFrameCtl) (cdf_nbuf_data(netbuf)); tpSirMacFrameCtl pFc = (tpSirMacFrameCtl) (qdf_nbuf_data(netbuf));
tp_wma_handle wma_handle = (tp_wma_handle) wma_context; tp_wma_handle wma_handle = (tp_wma_handle) wma_context;
if (wma_handle && wma_handle->umac_ota_ack_cb[pFc->subType]) { if (wma_handle && wma_handle->umac_ota_ack_cb[pFc->subType]) {
@@ -1583,7 +1583,7 @@ wma_mgmt_tx_ack_comp_hdlr(void *wma_context, cdf_nbuf_t netbuf, int32_t status)
* Return: none * Return: none
*/ */
static void static void
wma_mgmt_tx_dload_comp_hldr(void *wma_context, cdf_nbuf_t netbuf, wma_mgmt_tx_dload_comp_hldr(void *wma_context, qdf_nbuf_t netbuf,
int32_t status) int32_t status)
{ {
QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
@@ -2004,7 +2004,7 @@ QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle,
status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
WMI_THERMAL_MGMT_CMDID); WMI_THERMAL_MGMT_CMDID);
if (status) { if (status) {
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
WMA_LOGE("%s:Failed to send thermal mgmt command", __func__); WMA_LOGE("%s:Failed to send thermal mgmt command", __func__);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
@@ -2141,7 +2141,7 @@ int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
* *
* Return: none * Return: none
*/ */
static void wma_decap_to_8023(cdf_nbuf_t msdu, struct wma_decap_info_t *info) static void wma_decap_to_8023(qdf_nbuf_t msdu, struct wma_decap_info_t *info)
{ {
struct llc_snap_hdr_t *llc_hdr; struct llc_snap_hdr_t *llc_hdr;
uint16_t ether_type; uint16_t ether_type;
@@ -2151,7 +2151,7 @@ static void wma_decap_to_8023(cdf_nbuf_t msdu, struct wma_decap_info_t *info)
uint8_t *buf; uint8_t *buf;
struct ethernet_hdr_t *ethr_hdr; struct ethernet_hdr_t *ethr_hdr;
buf = (uint8_t *) cdf_nbuf_data(msdu); buf = (uint8_t *) qdf_nbuf_data(msdu);
llc_hdr = (struct llc_snap_hdr_t *)buf; llc_hdr = (struct llc_snap_hdr_t *)buf;
ether_type = (llc_hdr->ethertype[0] << 8) | llc_hdr->ethertype[1]; ether_type = (llc_hdr->ethertype[0] << 8) | llc_hdr->ethertype[1];
/* do llc remove if needed */ /* do llc remove if needed */
@@ -2171,9 +2171,9 @@ static void wma_decap_to_8023(cdf_nbuf_t msdu, struct wma_decap_info_t *info)
} }
} }
if (l2_hdr_space > ETHERNET_HDR_LEN) { if (l2_hdr_space > ETHERNET_HDR_LEN) {
buf = cdf_nbuf_pull_head(msdu, l2_hdr_space - ETHERNET_HDR_LEN); buf = qdf_nbuf_pull_head(msdu, l2_hdr_space - ETHERNET_HDR_LEN);
} else if (l2_hdr_space < ETHERNET_HDR_LEN) { } else if (l2_hdr_space < ETHERNET_HDR_LEN) {
buf = cdf_nbuf_push_head(msdu, ETHERNET_HDR_LEN - l2_hdr_space); buf = qdf_nbuf_push_head(msdu, ETHERNET_HDR_LEN - l2_hdr_space);
} }
/* mpdu hdr should be present in info,re-create ethr_hdr based on mpdu hdr */ /* mpdu hdr should be present in info,re-create ethr_hdr based on mpdu hdr */
@@ -2211,9 +2211,9 @@ static void wma_decap_to_8023(cdf_nbuf_t msdu, struct wma_decap_info_t *info)
ethr_hdr->ethertype[1] = (ether_type) & 0xff; ethr_hdr->ethertype[1] = (ether_type) & 0xff;
} else { } else {
uint32_t pktlen = uint32_t pktlen =
cdf_nbuf_len(msdu) - sizeof(ethr_hdr->ethertype); qdf_nbuf_len(msdu) - sizeof(ethr_hdr->ethertype);
ether_type = (uint16_t) pktlen; ether_type = (uint16_t) pktlen;
ether_type = cdf_nbuf_len(msdu) - sizeof(struct ethernet_hdr_t); ether_type = qdf_nbuf_len(msdu) - sizeof(struct ethernet_hdr_t);
ethr_hdr->ethertype[0] = (ether_type >> 8) & 0xff; ethr_hdr->ethertype[0] = (ether_type >> 8) & 0xff;
ethr_hdr->ethertype[1] = (ether_type) & 0xff; ethr_hdr->ethertype[1] = (ether_type) & 0xff;
} }
@@ -2393,8 +2393,8 @@ mgmt_wmi_unified_cmd_send(tp_wma_handle wma_handle, void *tx_frame,
sizeof(uint32_t))); sizeof(uint32_t)));
bufp += WMI_TLV_HDR_SIZE; bufp += WMI_TLV_HDR_SIZE;
qdf_mem_copy(bufp, pData, bufp_len); qdf_mem_copy(bufp, pData, bufp_len);
cdf_nbuf_map_single(qdf_ctx, tx_frame, QDF_DMA_TO_DEVICE); qdf_nbuf_map_single(qdf_ctx, tx_frame, QDF_DMA_TO_DEVICE);
dma_addr = cdf_nbuf_get_frag_paddr(tx_frame, 0); dma_addr = qdf_nbuf_get_frag_paddr(tx_frame, 0);
cmd->paddr_lo = (uint32_t)(dma_addr & 0xffffffff); cmd->paddr_lo = (uint32_t)(dma_addr & 0xffffffff);
#if defined(HELIUMPLUS_PADDR64) #if defined(HELIUMPLUS_PADDR64)
cmd->paddr_hi = (uint32_t)((dma_addr >> 32) & 0x1F); cmd->paddr_hi = (uint32_t)((dma_addr >> 32) & 0x1F);
@@ -2447,7 +2447,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
int32_t is_high_latency; int32_t is_high_latency;
ol_txrx_vdev_handle txrx_vdev; ol_txrx_vdev_handle txrx_vdev;
enum frame_index tx_frm_index = GENERIC_NODOWNLD_NOACK_COMP_INDEX; enum frame_index tx_frm_index = GENERIC_NODOWNLD_NOACK_COMP_INDEX;
tpSirMacFrameCtl pFc = (tpSirMacFrameCtl) (cdf_nbuf_data(tx_frame)); tpSirMacFrameCtl pFc = (tpSirMacFrameCtl) (qdf_nbuf_data(tx_frame));
uint8_t use_6mbps = 0; uint8_t use_6mbps = 0;
uint8_t downld_comp_required = 0; uint8_t downld_comp_required = 0;
uint16_t chanfreq; uint16_t chanfreq;
@@ -2495,7 +2495,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
WMA_LOGE("No Support to send other frames except 802.11 Mgmt/Data"); WMA_LOGE("No Support to send other frames except 802.11 Mgmt/Data");
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
mHdr = (tpSirMacMgmtHdr)cdf_nbuf_data(tx_frame); mHdr = (tpSirMacMgmtHdr)qdf_nbuf_data(tx_frame);
#ifdef WLAN_FEATURE_11W #ifdef WLAN_FEATURE_11W
if ((iface && iface->rmfEnabled) && if ((iface && iface->rmfEnabled) &&
(frmType == TXRX_FRM_802_11_MGMT) && (frmType == TXRX_FRM_802_11_MGMT) &&
@@ -2503,7 +2503,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
pFc->subType == SIR_MAC_MGMT_DEAUTH || pFc->subType == SIR_MAC_MGMT_DEAUTH ||
pFc->subType == SIR_MAC_MGMT_ACTION)) { pFc->subType == SIR_MAC_MGMT_ACTION)) {
struct ieee80211_frame *wh = struct ieee80211_frame *wh =
(struct ieee80211_frame *)cdf_nbuf_data(tx_frame); (struct ieee80211_frame *)qdf_nbuf_data(tx_frame);
if (!IEEE80211_IS_BROADCAST(wh->i_addr1) && if (!IEEE80211_IS_BROADCAST(wh->i_addr1) &&
!IEEE80211_IS_MULTICAST(wh->i_addr1)) { !IEEE80211_IS_MULTICAST(wh->i_addr1)) {
if (pFc->wep) { if (pFc->wep) {
@@ -2586,7 +2586,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
(pFc->subType == SIR_MAC_MGMT_PROBE_RSP)) { (pFc->subType == SIR_MAC_MGMT_PROBE_RSP)) {
uint64_t adjusted_tsf_le; uint64_t adjusted_tsf_le;
struct ieee80211_frame *wh = struct ieee80211_frame *wh =
(struct ieee80211_frame *)cdf_nbuf_data(tx_frame); (struct ieee80211_frame *)qdf_nbuf_data(tx_frame);
/* Make the TSF offset negative to match TSF in beacons */ /* Make the TSF offset negative to match TSF in beacons */
adjusted_tsf_le = cpu_to_le64(0ULL - adjusted_tsf_le = cpu_to_le64(0ULL -
@@ -2595,14 +2595,14 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
A_MEMCPY(&wh[1], &adjusted_tsf_le, sizeof(adjusted_tsf_le)); A_MEMCPY(&wh[1], &adjusted_tsf_le, sizeof(adjusted_tsf_le));
} }
if (frmType == TXRX_FRM_802_11_DATA) { if (frmType == TXRX_FRM_802_11_DATA) {
cdf_nbuf_t ret; qdf_nbuf_t ret;
cdf_nbuf_t skb = (cdf_nbuf_t) tx_frame; qdf_nbuf_t skb = (qdf_nbuf_t) tx_frame;
ol_txrx_pdev_handle pdev = ol_txrx_pdev_handle pdev =
cds_get_context(QDF_MODULE_ID_TXRX); cds_get_context(QDF_MODULE_ID_TXRX);
struct wma_decap_info_t decap_info; struct wma_decap_info_t decap_info;
struct ieee80211_frame *wh = struct ieee80211_frame *wh =
(struct ieee80211_frame *)cdf_nbuf_data(skb); (struct ieee80211_frame *)qdf_nbuf_data(skb);
unsigned long curr_timestamp = qdf_mc_timer_get_system_ticks(); unsigned long curr_timestamp = qdf_mc_timer_get_system_ticks();
if (pdev == NULL) { if (pdev == NULL) {
@@ -2645,7 +2645,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
/* Take out 802.11 header from skb */ /* Take out 802.11 header from skb */
decap_info.hdr_len = wma_ieee80211_hdrsize(wh); decap_info.hdr_len = wma_ieee80211_hdrsize(wh);
qdf_mem_copy(decap_info.hdr, wh, decap_info.hdr_len); qdf_mem_copy(decap_info.hdr, wh, decap_info.hdr_len);
cdf_nbuf_pull_head(skb, decap_info.hdr_len); qdf_nbuf_pull_head(skb, decap_info.hdr_len);
/* Decapsulate to 802.3 format */ /* Decapsulate to 802.3 format */
wma_decap_to_8023(skb, &decap_info); wma_decap_to_8023(skb, &decap_info);
@@ -2654,7 +2654,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
qdf_mem_set(skb->cb, sizeof(skb->cb), 0); qdf_mem_set(skb->cb, sizeof(skb->cb), 0);
/* Do the DMA Mapping */ /* Do the DMA Mapping */
cdf_nbuf_map_single(pdev->osdev, skb, QDF_DMA_TO_DEVICE); qdf_nbuf_map_single(pdev->osdev, skb, QDF_DMA_TO_DEVICE);
/* Terminate the (single-element) list of tx frames */ /* Terminate the (single-element) list of tx frames */
skb->next = NULL; skb->next = NULL;
@@ -2671,7 +2671,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
if (ret) { if (ret) {
WMA_LOGE("TxRx Rejected. Fail to do Tx"); WMA_LOGE("TxRx Rejected. Fail to do Tx");
cdf_nbuf_unmap_single(pdev->osdev, skb, qdf_nbuf_unmap_single(pdev->osdev, skb,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
/* Call Download Cb so that umac can free the buffer */ /* Call Download Cb so that umac can free the buffer */
if (tx_frm_download_comp_cb) if (tx_frm_download_comp_cb)
@@ -2718,7 +2718,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
NBUF_PKT_TRAC_TYPE_MGMT_ACTION); NBUF_PKT_TRAC_TYPE_MGMT_ACTION);
if (proto_type & NBUF_PKT_TRAC_TYPE_MGMT_ACTION) if (proto_type & NBUF_PKT_TRAC_TYPE_MGMT_ACTION)
cds_pkt_trace_buf_update("WM:T:MACT"); cds_pkt_trace_buf_update("WM:T:MACT");
cdf_nbuf_trace_set_proto_type(tx_frame, proto_type); qdf_nbuf_trace_set_proto_type(tx_frame, proto_type);
#endif /* QCA_PKT_PROTO_TRACE */ #endif /* QCA_PKT_PROTO_TRACE */
} else { } else {
if (downld_comp_required) if (downld_comp_required)
@@ -2893,7 +2893,7 @@ QDF_STATUS wma_ds_peek_rx_packet_info(cds_pkt_t *pkt, void **pkt_meta,
*/ */
void ol_rx_err(ol_pdev_handle pdev, uint8_t vdev_id, void ol_rx_err(ol_pdev_handle pdev, uint8_t vdev_id,
uint8_t *peer_mac_addr, int tid, uint32_t tsf32, uint8_t *peer_mac_addr, int tid, uint32_t tsf32,
enum ol_rx_err_type err_type, cdf_nbuf_t rx_frame, enum ol_rx_err_type err_type, qdf_nbuf_t rx_frame,
uint64_t *pn, uint8_t key_id) uint64_t *pn, uint8_t key_id)
{ {
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA); tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
@@ -2909,9 +2909,9 @@ void ol_rx_err(ol_pdev_handle pdev, uint8_t vdev_id,
if (err_type != OL_RX_ERR_TKIP_MIC) if (err_type != OL_RX_ERR_TKIP_MIC)
return; return;
if (cdf_nbuf_len(rx_frame) < sizeof(*eth_hdr)) if (qdf_nbuf_len(rx_frame) < sizeof(*eth_hdr))
return; return;
eth_hdr = (struct ether_header *)cdf_nbuf_data(rx_frame); eth_hdr = (struct ether_header *)qdf_nbuf_data(rx_frame);
mic_err_ind = qdf_mem_malloc(sizeof(*mic_err_ind)); mic_err_ind = qdf_mem_malloc(sizeof(*mic_err_ind));
if (!mic_err_ind) { if (!mic_err_ind) {
WMA_LOGE("%s: Failed to allocate memory for MIC indication message", WMA_LOGE("%s: Failed to allocate memory for MIC indication message",
@@ -3069,7 +3069,7 @@ QDF_STATUS wma_lro_config_cmd(tp_wma_handle wma_handle,
status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf,
sizeof(*cmd), WMI_LRO_CONFIG_CMDID); sizeof(*cmd), WMI_LRO_CONFIG_CMDID);
if (status) { if (status) {
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
WMA_LOGE("%s:Failed to send WMI_LRO_CONFIG_CMDID", __func__); WMA_LOGE("%s:Failed to send WMI_LRO_CONFIG_CMDID", __func__);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }

Переглянути файл

@@ -45,7 +45,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -752,7 +752,7 @@ static int32_t wmi_unified_peer_delete_send(wmi_unified_t wmi,
if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_DELETE_CMDID)) { if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_DELETE_CMDID)) {
WMA_LOGP("%s: Failed to send peer delete command", __func__); WMA_LOGP("%s: Failed to send peer delete command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
WMA_LOGD("%s: peer_addr %pM vdev_id %d", __func__, peer_addr, vdev_id); WMA_LOGD("%s: peer_addr %pM vdev_id %d", __func__, peer_addr, vdev_id);
@@ -801,7 +801,7 @@ static void wma_vdev_start_rsp(tp_wma_handle wma,
goto send_fail_resp; goto send_fail_resp;
} }
qdf_mem_zero(bcn, sizeof(*bcn)); qdf_mem_zero(bcn, sizeof(*bcn));
bcn->buf = cdf_nbuf_alloc(NULL, WMA_BCN_BUF_MAX_SIZE, 0, bcn->buf = qdf_nbuf_alloc(NULL, WMA_BCN_BUF_MAX_SIZE, 0,
sizeof(uint32_t), 0); sizeof(uint32_t), 0);
if (!bcn->buf) { if (!bcn->buf) {
WMA_LOGE("%s: No memory allocated for beacon buffer", WMA_LOGE("%s: No memory allocated for beacon buffer",
@@ -1125,7 +1125,7 @@ int32_t wmi_unified_peer_flush_tids_send(wmi_unified_t wmi,
if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_FLUSH_TIDS_CMDID)) { if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_FLUSH_TIDS_CMDID)) {
WMA_LOGP("%s: Failed to send flush tid command", __func__); WMA_LOGP("%s: Failed to send flush tid command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
WMA_LOGD("%s: peer_addr %pM vdev_id %d", __func__, peer_addr, vdev_id); WMA_LOGD("%s: peer_addr %pM vdev_id %d", __func__, peer_addr, vdev_id);
@@ -1267,7 +1267,7 @@ static int wmi_unified_peer_create_send(wmi_unified_t wmi,
if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_CREATE_CMDID)) { if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_CREATE_CMDID)) {
WMA_LOGP("%s: failed to send WMI_PEER_CREATE_CMDID", __func__); WMA_LOGP("%s: failed to send WMI_PEER_CREATE_CMDID", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
WMA_LOGD("%s: peer_addr %pM vdev_id %d", __func__, peer_addr, vdev_id); WMA_LOGD("%s: peer_addr %pM vdev_id %d", __func__, peer_addr, vdev_id);
@@ -1369,7 +1369,7 @@ static int wmi_unified_vdev_down_send(wmi_unified_t wmi, uint8_t vdev_id)
cmd->vdev_id = vdev_id; cmd->vdev_id = vdev_id;
if (wmi_unified_cmd_send(wmi, buf, len, WMI_VDEV_DOWN_CMDID)) { if (wmi_unified_cmd_send(wmi, buf, len, WMI_VDEV_DOWN_CMDID)) {
WMA_LOGP("%s: Failed to send vdev down", __func__); WMA_LOGP("%s: Failed to send vdev down", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
WMA_LOGE("%s: vdev_id %d", __func__, vdev_id); WMA_LOGE("%s: vdev_id %d", __func__, vdev_id);
@@ -1651,7 +1651,7 @@ void wma_hidden_ssid_vdev_restart_on_vdev_stop(tp_wma_handle wma_handle,
WMA_LOGE("%s: Failed to send vdev restart command", __func__); WMA_LOGE("%s: Failed to send vdev restart command", __func__);
qdf_atomic_set(&intr[sessionId].vdev_restart_params. qdf_atomic_set(&intr[sessionId].vdev_restart_params.
hidden_ssid_restart_in_progress, 0); hidden_ssid_restart_in_progress, 0);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
} }
@@ -1779,9 +1779,9 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
WMA_LOGD("%s: Freeing beacon struct %p, " WMA_LOGD("%s: Freeing beacon struct %p, "
"template memory %p", __func__, bcn, bcn->buf); "template memory %p", __func__, bcn, bcn->buf);
if (bcn->dma_mapped) if (bcn->dma_mapped)
cdf_nbuf_unmap_single(pdev->osdev, bcn->buf, qdf_nbuf_unmap_single(pdev->osdev, bcn->buf,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
cdf_nbuf_free(bcn->buf); qdf_nbuf_free(bcn->buf);
qdf_mem_free(bcn); qdf_mem_free(bcn);
wma->interfaces[resp_event->vdev_id].beacon = NULL; wma->interfaces[resp_event->vdev_id].beacon = NULL;
} }
@@ -2211,7 +2211,7 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
" Failed to send VDEV START command", " Failed to send VDEV START command",
__func__, __LINE__); __func__, __LINE__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
@@ -2326,7 +2326,7 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
if (ret < 0) { if (ret < 0) {
WMA_LOGP("%s: Failed to send vdev start command", __func__); WMA_LOGP("%s: Failed to send vdev start command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
@@ -2787,9 +2787,9 @@ void wma_vdev_resp_timer(void *data)
WMA_LOGD("%s: Freeing beacon struct %p, " WMA_LOGD("%s: Freeing beacon struct %p, "
"template memory %p", __func__, bcn, bcn->buf); "template memory %p", __func__, bcn, bcn->buf);
if (bcn->dma_mapped) if (bcn->dma_mapped)
cdf_nbuf_unmap_single(pdev->osdev, bcn->buf, qdf_nbuf_unmap_single(pdev->osdev, bcn->buf,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
cdf_nbuf_free(bcn->buf); qdf_nbuf_free(bcn->buf);
qdf_mem_free(bcn); qdf_mem_free(bcn);
wma->interfaces[tgt_req->vdev_id].beacon = NULL; wma->interfaces[tgt_req->vdev_id].beacon = NULL;
} }
@@ -3758,7 +3758,7 @@ int wmi_unified_vdev_up_send(wmi_unified_t wmi,
WMI_CHAR_ARRAY_TO_MAC_ADDR(bssid, &cmd->vdev_bssid); WMI_CHAR_ARRAY_TO_MAC_ADDR(bssid, &cmd->vdev_bssid);
if (wmi_unified_cmd_send(wmi, buf, len, WMI_VDEV_UP_CMDID)) { if (wmi_unified_cmd_send(wmi, buf, len, WMI_VDEV_UP_CMDID)) {
WMA_LOGP("%s: Failed to send vdev up command", __func__); WMA_LOGP("%s: Failed to send vdev up command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
return 0; return 0;
@@ -4617,7 +4617,7 @@ int32_t wmi_unified_vdev_stop_send(wmi_unified_t wmi, uint8_t vdev_id)
cmd->vdev_id = vdev_id; cmd->vdev_id = vdev_id;
if (wmi_unified_cmd_send(wmi, buf, len, WMI_VDEV_STOP_CMDID)) { if (wmi_unified_cmd_send(wmi, buf, len, WMI_VDEV_STOP_CMDID)) {
WMA_LOGP("%s: Failed to send vdev stop command", __func__); WMA_LOGP("%s: Failed to send vdev stop command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
return 0; return 0;

Переглянути файл

@@ -46,7 +46,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -971,7 +971,7 @@ QDF_STATUS wma_get_link_speed(WMA_HANDLE handle, tSirLinkSpeedInfo *pLinkSpeed)
if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len,
WMI_PEER_GET_ESTIMATED_LINKSPEED_CMDID)) { WMI_PEER_GET_ESTIMATED_LINKSPEED_CMDID)) {
WMA_LOGE("%s: failed to send link speed command", __func__); WMA_LOGE("%s: failed to send link speed command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -1131,7 +1131,7 @@ int32_t wmi_unified_pdev_green_ap_ps_enable_cmd(wmi_unified_t wmi_handle,
if (wmi_unified_cmd_send(wmi_handle, buf, len, if (wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID)) { WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID)) {
WMA_LOGE("Set Green AP PS param Failed val %d", value); WMA_LOGE("Set Green AP PS param Failed val %d", value);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
return 0; return 0;
@@ -1179,7 +1179,7 @@ int32_t wmi_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
if (ret) { if (ret) {
WMA_LOGE("PROFILE_TRIGGER cmd Failed with value %d", WMA_LOGE("PROFILE_TRIGGER cmd Failed with value %d",
value1); value1);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return ret; return ret;
} }
break; break;
@@ -1203,7 +1203,7 @@ int32_t wmi_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
if (ret) { if (ret) {
WMA_LOGE("PROFILE_DATA cmd Failed for id %d value %d", WMA_LOGE("PROFILE_DATA cmd Failed for id %d value %d",
value1, value2); value1, value2);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return ret; return ret;
} }
break; break;
@@ -1229,7 +1229,7 @@ int32_t wmi_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
if (ret) { if (ret) {
WMA_LOGE("HIST_INTVL cmd Failed for id %d value %d", WMA_LOGE("HIST_INTVL cmd Failed for id %d value %d",
value1, value2); value1, value2);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return ret; return ret;
} }
break; break;
@@ -1256,7 +1256,7 @@ int32_t wmi_unified_fw_profiling_cmd(wmi_unified_t wmi_handle,
if (ret) { if (ret) {
WMA_LOGE("enable cmd Failed for id %d value %d", WMA_LOGE("enable cmd Failed for id %d value %d",
value1, value2); value1, value2);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return ret; return ret;
} }
break; break;
@@ -1937,7 +1937,7 @@ void wma_start_oem_data_req(tp_wma_handle wma_handle,
if (ret != EOK) { if (ret != EOK) {
WMA_LOGE(FL(":wmi cmd send failed")); WMA_LOGE(FL(":wmi cmd send failed"));
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
out: out:
@@ -4460,7 +4460,7 @@ void wma_del_ts_req(tp_wma_handle wma, tDelTsParams *msg)
if (wmi_unified_cmd_send(wma->wmi_handle, buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, buf, len,
WMI_VDEV_WMM_DELTS_CMDID)) { WMI_VDEV_WMM_DELTS_CMDID)) {
WMA_LOGP("%s: Failed to send vdev DELTS command", __func__); WMA_LOGP("%s: Failed to send vdev DELTS command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
#ifdef WLAN_FEATURE_ROAM_OFFLOAD #ifdef WLAN_FEATURE_ROAM_OFFLOAD
if (msg->setRICparams == true) if (msg->setRICparams == true)
@@ -4529,7 +4529,7 @@ void wma_aggr_qos_req(tp_wma_handle wma,
__func__); __func__);
pAggrQosRspMsg->status[i] = pAggrQosRspMsg->status[i] =
QDF_STATUS_E_FAILURE; QDF_STATUS_E_FAILURE;
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
} }
} }
@@ -4592,7 +4592,7 @@ void wma_add_ts_req(tp_wma_handle wma, tAddTsParams *msg)
WMI_VDEV_WMM_ADDTS_CMDID)) { WMI_VDEV_WMM_ADDTS_CMDID)) {
WMA_LOGP("%s: Failed to send vdev ADDTS command", __func__); WMA_LOGP("%s: Failed to send vdev ADDTS command", __func__);
msg->status = QDF_STATUS_E_FAILURE; msg->status = QDF_STATUS_E_FAILURE;
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
#ifdef WLAN_FEATURE_ROAM_OFFLOAD #ifdef WLAN_FEATURE_ROAM_OFFLOAD
if (msg->setRICparams == true) if (msg->setRICparams == true)
@@ -5486,7 +5486,7 @@ QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
&vdev_id)) { &vdev_id)) {
WMA_LOGE("%s: Failed to find vdev id for %pM", __func__, WMA_LOGE("%s: Failed to find vdev id for %pM", __func__,
pAddPeriodicTxPtrnParams->mac_address.bytes); pAddPeriodicTxPtrnParams->mac_address.bytes);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf); buf_ptr = (uint8_t *) wmi_buf_data(wmi_buf);
@@ -5518,7 +5518,7 @@ QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle,
WMI_ADD_PROACTIVE_ARP_RSP_PATTERN_CMDID)) { WMI_ADD_PROACTIVE_ARP_RSP_PATTERN_CMDID)) {
WMA_LOGE("%s: failed to add pattern set state command", WMA_LOGE("%s: failed to add pattern set state command",
__func__); __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -5557,7 +5557,7 @@ QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
&vdev_id)) { &vdev_id)) {
WMA_LOGE("%s: Failed to find vdev id for %pM", __func__, WMA_LOGE("%s: Failed to find vdev id for %pM", __func__,
pDelPeriodicTxPtrnParams->mac_address.bytes); pDelPeriodicTxPtrnParams->mac_address.bytes);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
} }
cmd = (WMI_DEL_PROACTIVE_ARP_RSP_PATTERN_CMD_fixed_param *) cmd = (WMI_DEL_PROACTIVE_ARP_RSP_PATTERN_CMD_fixed_param *)
@@ -5576,7 +5576,7 @@ QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle,
if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len,
WMI_DEL_PROACTIVE_ARP_RSP_PATTERN_CMDID)) { WMI_DEL_PROACTIVE_ARP_RSP_PATTERN_CMDID)) {
WMA_LOGE("%s: failed to send del pattern command", __func__); WMA_LOGE("%s: failed to send del pattern command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -6316,7 +6316,7 @@ void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
WMI_PDEV_SET_REGDOMAIN_CMDID)) { WMI_PDEV_SET_REGDOMAIN_CMDID)) {
WMA_LOGP("%s: Failed to send pdev set regdomain command", WMA_LOGP("%s: Failed to send pdev set regdomain command",
__func__); __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
if ((((reg_dmn & ~COUNTRY_ERD_FLAG) == CTRY_JAPAN) || if ((((reg_dmn & ~COUNTRY_ERD_FLAG) == CTRY_JAPAN) ||
@@ -6577,7 +6577,7 @@ int wma_suspend_target(WMA_HANDLE handle, int disable_target_intr)
ret = wmi_unified_cmd_send(wma_handle->wmi_handle, wmibuf, len, ret = wmi_unified_cmd_send(wma_handle->wmi_handle, wmibuf, len,
WMI_PDEV_SUSPEND_CMDID); WMI_PDEV_SUSPEND_CMDID);
if (ret < 0) { if (ret < 0) {
cdf_nbuf_free(wmibuf); qdf_nbuf_free(wmibuf);
return ret; return ret;
} }
@@ -6913,7 +6913,7 @@ int wma_set_tdls_offchan_mode(WMA_HANDLE handle,
if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len,
WMI_TDLS_SET_OFFCHAN_MODE_CMDID)) { WMI_TDLS_SET_OFFCHAN_MODE_CMDID)) {
WMA_LOGP(FL("failed to send tdls off chan command")); WMA_LOGP(FL("failed to send tdls off chan command"));
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
ret = -EIO; ret = -EIO;
} }
@@ -7021,7 +7021,7 @@ int wma_update_fw_tdls_state(WMA_HANDLE handle, void *pwmaTdlsparams)
if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len,
WMI_TDLS_SET_STATE_CMDID)) { WMI_TDLS_SET_STATE_CMDID)) {
WMA_LOGP("%s: failed to send tdls set state command", __func__); WMA_LOGP("%s: failed to send tdls set state command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
ret = -EIO; ret = -EIO;
goto end_fw_tdls_state; goto end_fw_tdls_state;
} }
@@ -7223,7 +7223,7 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
WMI_TDLS_PEER_UPDATE_CMDID)) { WMI_TDLS_PEER_UPDATE_CMDID)) {
WMA_LOGE("%s: failed to send tdls peer update state command", WMA_LOGE("%s: failed to send tdls peer update state command",
__func__); __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
ret = -EIO; ret = -EIO;
goto end_tdls_peer_state; goto end_tdls_peer_state;
} }

Переглянути файл

@@ -47,7 +47,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -1492,7 +1492,7 @@ int wma_process_fw_event_handler(struct wmi_unified *wmi_handle,
params_buf = qdf_mem_malloc(sizeof(wma_process_fw_event_params)); params_buf = qdf_mem_malloc(sizeof(wma_process_fw_event_params));
if (!params_buf) { if (!params_buf) {
WMA_LOGE("%s: Failed alloc memory for params_buf", __func__); WMA_LOGE("%s: Failed alloc memory for params_buf", __func__);
cdf_nbuf_free(evt_buf); qdf_nbuf_free(evt_buf);
return -ENOMEM; return -ENOMEM;
} }
@@ -1507,7 +1507,7 @@ int wma_process_fw_event_handler(struct wmi_unified *wmi_handle,
cds_mq_post_message(CDS_MQ_ID_WMA, &cds_msg)) { cds_mq_post_message(CDS_MQ_ID_WMA, &cds_msg)) {
WMA_LOGP("%s: Failed to post WMA_PROCESS_FW_EVENT msg", WMA_LOGP("%s: Failed to post WMA_PROCESS_FW_EVENT msg",
__func__); __func__);
cdf_nbuf_free(evt_buf); qdf_nbuf_free(evt_buf);
qdf_mem_free(params_buf); qdf_mem_free(params_buf);
return -EFAULT; return -EFAULT;
} }
@@ -3013,9 +3013,9 @@ QDF_STATUS wma_wmi_service_close(void *cds_ctx)
if (bcn) { if (bcn) {
if (bcn->dma_mapped) if (bcn->dma_mapped)
cdf_nbuf_unmap_single(wma_handle->qdf_dev, qdf_nbuf_unmap_single(wma_handle->qdf_dev,
bcn->buf, QDF_DMA_TO_DEVICE); bcn->buf, QDF_DMA_TO_DEVICE);
cdf_nbuf_free(bcn->buf); qdf_nbuf_free(bcn->buf);
qdf_mem_free(bcn); qdf_mem_free(bcn);
wma_handle->interfaces[i].beacon = NULL; wma_handle->interfaces[i].beacon = NULL;
} }
@@ -3609,7 +3609,7 @@ static wmi_buf_t wma_setup_wmi_init_msg(tp_wma_handle wma_handle,
/* allocate memory requested by FW */ /* allocate memory requested by FW */
if (ev->num_mem_reqs > WMI_MAX_MEM_REQS) { if (ev->num_mem_reqs > WMI_MAX_MEM_REQS) {
QDF_ASSERT(0); QDF_ASSERT(0);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return NULL; return NULL;
} }
@@ -5487,7 +5487,7 @@ QDF_STATUS wma_send_soc_set_pcl_cmd(tp_wma_handle wma_handle,
if (wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, if (wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
WMI_SOC_SET_PCL_CMDID)) { WMI_SOC_SET_PCL_CMDID)) {
WMA_LOGE("%s: Failed to send WMI_SOC_SET_PCL_CMDID", __func__); WMA_LOGE("%s: Failed to send WMI_SOC_SET_PCL_CMDID", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -5549,7 +5549,7 @@ QDF_STATUS wma_send_soc_set_hw_mode_cmd(tp_wma_handle wma_handle,
WMI_SOC_SET_HW_MODE_CMDID)) { WMI_SOC_SET_HW_MODE_CMDID)) {
WMA_LOGE("%s: Failed to send WMI_SOC_SET_HW_MODE_CMDID", WMA_LOGE("%s: Failed to send WMI_SOC_SET_HW_MODE_CMDID",
__func__); __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
goto fail; goto fail;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -5620,7 +5620,7 @@ QDF_STATUS wma_send_soc_set_dual_mac_config(tp_wma_handle wma_handle,
WMI_SOC_SET_DUAL_MAC_CONFIG_CMDID)) { WMI_SOC_SET_DUAL_MAC_CONFIG_CMDID)) {
WMA_LOGE("%s: Failed to send WMI_SOC_SET_DUAL_MAC_CONFIG_CMDID", WMA_LOGE("%s: Failed to send WMI_SOC_SET_DUAL_MAC_CONFIG_CMDID",
__func__); __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

Переглянути файл

@@ -46,7 +46,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -111,7 +111,7 @@ static void wma_send_bcn_buf_ll(tp_wma_handle wma,
qdf_spin_lock_bh(&bcn->lock); qdf_spin_lock_bh(&bcn->lock);
bcn_payload = cdf_nbuf_data(bcn->buf); bcn_payload = qdf_nbuf_data(bcn->buf);
tim_ie = (struct beacon_tim_ie *)(&bcn_payload[bcn->tim_ie_offset]); tim_ie = (struct beacon_tim_ie *)(&bcn_payload[bcn->tim_ie_offset]);
@@ -200,12 +200,12 @@ static void wma_send_bcn_buf_ll(tp_wma_handle wma,
} }
if (bcn->dma_mapped) { if (bcn->dma_mapped) {
cdf_nbuf_unmap_single(pdev->osdev, bcn->buf, QDF_DMA_TO_DEVICE); qdf_nbuf_unmap_single(pdev->osdev, bcn->buf, QDF_DMA_TO_DEVICE);
bcn->dma_mapped = 0; bcn->dma_mapped = 0;
} }
ret = cdf_nbuf_map_single(pdev->osdev, bcn->buf, QDF_DMA_TO_DEVICE); ret = qdf_nbuf_map_single(pdev->osdev, bcn->buf, QDF_DMA_TO_DEVICE);
if (ret != QDF_STATUS_SUCCESS) { if (ret != QDF_STATUS_SUCCESS) {
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
WMA_LOGE("%s: failed map beacon buf to DMA region", __func__); WMA_LOGE("%s: failed map beacon buf to DMA region", __func__);
qdf_spin_unlock_bh(&bcn->lock); qdf_spin_unlock_bh(&bcn->lock);
return; return;
@@ -220,7 +220,7 @@ static void wma_send_bcn_buf_ll(tp_wma_handle wma,
cmd->vdev_id = vdev_id; cmd->vdev_id = vdev_id;
cmd->data_len = bcn->len; cmd->data_len = bcn->len;
cmd->frame_ctrl = *((A_UINT16 *) wh->i_fc); cmd->frame_ctrl = *((A_UINT16 *) wh->i_fc);
cmd->frag_ptr = cdf_nbuf_get_frag_paddr(bcn->buf, 0); cmd->frag_ptr = qdf_nbuf_get_frag_paddr(bcn->buf, 0);
/* notify Firmware of DTM and mcast/bcast traffic */ /* notify Firmware of DTM and mcast/bcast traffic */
if (tim_ie->dtim_count == 0) { if (tim_ie->dtim_count == 0) {
@@ -653,7 +653,7 @@ void wma_set_sta_sa_query_param(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, buf, len,
WMI_PMF_OFFLOAD_SET_SA_QUERY_CMDID)) { WMI_PMF_OFFLOAD_SET_SA_QUERY_CMDID)) {
WMA_LOGE(FL("Failed to offload STA SA Query")); WMA_LOGE(FL("Failed to offload STA SA Query"));
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
WMA_LOGD(FL("Exit :")); WMA_LOGD(FL("Exit :"));
@@ -723,7 +723,7 @@ void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
WMA_LOGE("%s: received null pointer, hostv4addr:%p " WMA_LOGE("%s: received null pointer, hostv4addr:%p "
"destv4addr:%p destmac:%p ", __func__, "destv4addr:%p destmac:%p ", __func__,
hostv4addr, destv4addr, destmac); hostv4addr, destv4addr, destmac);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return; return;
} }
cmd->method = WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE; cmd->method = WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE;
@@ -739,7 +739,7 @@ void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id,
if (wmi_unified_cmd_send(wma->wmi_handle, buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, buf, len,
WMI_STA_KEEPALIVE_CMDID)) { WMI_STA_KEEPALIVE_CMDID)) {
WMA_LOGE("Failed to set KeepAlive"); WMA_LOGE("Failed to set KeepAlive");
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
WMA_LOGD("%s: Exit", __func__); WMA_LOGD("%s: Exit", __func__);
@@ -1069,7 +1069,7 @@ int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma,
WMA_LOGE WMA_LOGE
("Set WMI_VDEV_PARAM_DROP_UNENCRY Param status:%d\n", ("Set WMI_VDEV_PARAM_DROP_UNENCRY Param status:%d\n",
ret); ret);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return ret; return ret;
} }
} }
@@ -1164,7 +1164,7 @@ int32_t wmi_unified_send_peer_assoc(tp_wma_handle wma,
if (ret != EOK) { if (ret != EOK) {
WMA_LOGP("%s: Failed to send peer assoc command ret = %d", WMA_LOGP("%s: Failed to send peer assoc command ret = %d",
__func__, ret); __func__, ret);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
return ret; return ret;
} }
@@ -1519,7 +1519,7 @@ static wmi_buf_t wma_setup_install_key_cmd(tp_wma_handle wma_handle,
/* TODO: MFP ? */ /* TODO: MFP ? */
WMA_LOGE("%s:Invalid encryption type:%d", __func__, WMA_LOGE("%s:Invalid encryption type:%d", __func__,
key_params->key_type); key_params->key_type);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return NULL; return NULL;
} }
@@ -1680,7 +1680,7 @@ void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info)
status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
WMI_VDEV_INSTALL_KEY_CMDID); WMI_VDEV_INSTALL_KEY_CMDID);
if (status) { if (status) {
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
WMA_LOGE("%s:Failed to send install key command", WMA_LOGE("%s:Failed to send install key command",
__func__); __func__);
key_info->status = QDF_STATUS_E_FAILURE; key_info->status = QDF_STATUS_E_FAILURE;
@@ -1872,7 +1872,7 @@ static void wma_set_ibsskey_helper(tp_wma_handle wma_handle,
status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
WMI_VDEV_INSTALL_KEY_CMDID); WMI_VDEV_INSTALL_KEY_CMDID);
if (status) { if (status) {
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
WMA_LOGE("%s:Failed to send install key command", WMA_LOGE("%s:Failed to send install key command",
__func__); __func__);
} }
@@ -1991,7 +1991,7 @@ void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info)
status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, status = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
WMI_VDEV_INSTALL_KEY_CMDID); WMI_VDEV_INSTALL_KEY_CMDID);
if (status) { if (status) {
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
WMA_LOGE("%s:Failed to send install key command", WMA_LOGE("%s:Failed to send install key command",
__func__); __func__);
key_info->status = QDF_STATUS_E_FAILURE; key_info->status = QDF_STATUS_E_FAILURE;
@@ -2327,8 +2327,8 @@ QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id,
* this will be send to target on the reception of SWBA * this will be send to target on the reception of SWBA
* event from target. * event from target.
*/ */
cdf_nbuf_trim_tail(bcn->buf, cdf_nbuf_len(bcn->buf)); qdf_nbuf_trim_tail(bcn->buf, qdf_nbuf_len(bcn->buf));
memcpy(cdf_nbuf_data(bcn->buf), memcpy(qdf_nbuf_data(bcn->buf),
bcn_info->beacon + 4 /* Exclude beacon length field */, bcn_info->beacon + 4 /* Exclude beacon length field */,
len); len);
if (bcn_info->timIeOffset > 3) { if (bcn_info->timIeOffset > 3) {
@@ -2342,7 +2342,7 @@ QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id,
} else { } else {
bcn->p2p_ie_offset = bcn_info->p2pIeOffset; bcn->p2p_ie_offset = bcn_info->p2pIeOffset;
} }
bcn_payload = cdf_nbuf_data(bcn->buf); bcn_payload = qdf_nbuf_data(bcn->buf);
if (bcn->tim_ie_offset) { if (bcn->tim_ie_offset) {
tim_ie = tim_ie =
(struct beacon_tim_ie *)(&bcn_payload[bcn->tim_ie_offset]); (struct beacon_tim_ie *)(&bcn_payload[bcn->tim_ie_offset]);
@@ -2355,7 +2355,7 @@ QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id,
tim_ie->tim_bitctl = 0; tim_ie->tim_bitctl = 0;
} }
cdf_nbuf_put_tail(bcn->buf, len); qdf_nbuf_put_tail(bcn->buf, len);
bcn->len = len; bcn->len = len;
qdf_spin_unlock_bh(&bcn->lock); qdf_spin_unlock_bh(&bcn->lock);
@@ -2421,7 +2421,7 @@ int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
qdf_spin_lock_bh(&bcn->lock); qdf_spin_lock_bh(&bcn->lock);
qdf_mem_zero(&bcn_info, sizeof(bcn_info)); qdf_mem_zero(&bcn_info, sizeof(bcn_info));
bcn_info.beacon = cdf_nbuf_data(bcn->buf); bcn_info.beacon = qdf_nbuf_data(bcn->buf);
bcn_info.p2pIeOffset = bcn->p2p_ie_offset; bcn_info.p2pIeOffset = bcn->p2p_ie_offset;
bcn_info.beaconLength = bcn->len; bcn_info.beaconLength = bcn->len;
bcn_info.timIeOffset = bcn->tim_ie_offset; bcn_info.timIeOffset = bcn->tim_ie_offset;
@@ -2701,7 +2701,7 @@ int wma_mgmt_tx_completion_handler(void *handle, uint8_t *cmpl_event_params,
} }
if (wmi_desc->nbuf) if (wmi_desc->nbuf)
cdf_nbuf_unmap_single(pdev->osdev, wmi_desc->nbuf, qdf_nbuf_unmap_single(pdev->osdev, wmi_desc->nbuf,
QDF_DMA_TO_DEVICE); QDF_DMA_TO_DEVICE);
if (wmi_desc->tx_cmpl_cb) if (wmi_desc->tx_cmpl_cb)
wmi_desc->tx_cmpl_cb(wma_handle->mac_context, wmi_desc->tx_cmpl_cb(wma_handle->mac_context,
@@ -3012,13 +3012,13 @@ static
int wma_process_bip(tp_wma_handle wma_handle, int wma_process_bip(tp_wma_handle wma_handle,
struct wma_txrx_node *iface, struct wma_txrx_node *iface,
struct ieee80211_frame *wh, struct ieee80211_frame *wh,
cdf_nbuf_t wbuf qdf_nbuf_t wbuf
) )
{ {
uint16_t key_id; uint16_t key_id;
uint8_t *efrm; uint8_t *efrm;
efrm = cdf_nbuf_data(wbuf) + cdf_nbuf_len(wbuf); efrm = qdf_nbuf_data(wbuf) + qdf_nbuf_len(wbuf);
key_id = (uint16_t)*(efrm - cds_get_mmie_size() + 2); key_id = (uint16_t)*(efrm - cds_get_mmie_size() + 2);
if (!((key_id == WMA_IGTK_KEY_INDEX_4) if (!((key_id == WMA_IGTK_KEY_INDEX_4)
@@ -3032,14 +3032,14 @@ int wma_process_bip(tp_wma_handle wma_handle,
* if 11w offload is enabled then mmie validation is performed * if 11w offload is enabled then mmie validation is performed
* in firmware, host just need to trim the mmie. * in firmware, host just need to trim the mmie.
*/ */
cdf_nbuf_trim_tail(wbuf, cds_get_mmie_size()); qdf_nbuf_trim_tail(wbuf, cds_get_mmie_size());
} else { } else {
if (cds_is_mmie_valid(iface->key.key, if (cds_is_mmie_valid(iface->key.key,
iface->key.key_id[key_id - WMA_IGTK_KEY_INDEX_4].ipn, iface->key.key_id[key_id - WMA_IGTK_KEY_INDEX_4].ipn,
(uint8_t *) wh, efrm)) { (uint8_t *) wh, efrm)) {
WMA_LOGE(FL("Protected BC/MC frame MMIE validation successful")); WMA_LOGE(FL("Protected BC/MC frame MMIE validation successful"));
/* Remove MMIE */ /* Remove MMIE */
cdf_nbuf_trim_tail(wbuf, cds_get_mmie_size()); qdf_nbuf_trim_tail(wbuf, cds_get_mmie_size());
} else { } else {
WMA_LOGE(FL("BC/MC MIC error or MMIE not present, dropping the frame")); WMA_LOGE(FL("BC/MC MIC error or MMIE not present, dropping the frame"));
return -EINVAL; return -EINVAL;
@@ -3063,7 +3063,7 @@ int wma_process_rmf_frame(tp_wma_handle wma_handle,
struct wma_txrx_node *iface, struct wma_txrx_node *iface,
struct ieee80211_frame *wh, struct ieee80211_frame *wh,
cds_pkt_t *rx_pkt, cds_pkt_t *rx_pkt,
cdf_nbuf_t wbuf) qdf_nbuf_t wbuf)
{ {
uint8_t *orig_hdr; uint8_t *orig_hdr;
uint8_t *ccmp; uint8_t *ccmp;
@@ -3076,7 +3076,7 @@ int wma_process_rmf_frame(tp_wma_handle wma_handle,
return -EINVAL; return -EINVAL;
} }
orig_hdr = (uint8_t *) cdf_nbuf_data(wbuf); orig_hdr = (uint8_t *) qdf_nbuf_data(wbuf);
/* Pointer to head of CCMP header */ /* Pointer to head of CCMP header */
ccmp = orig_hdr + sizeof(*wh); ccmp = orig_hdr + sizeof(*wh);
if (wma_is_ccmp_pn_replay_attack( if (wma_is_ccmp_pn_replay_attack(
@@ -3092,13 +3092,13 @@ int wma_process_rmf_frame(tp_wma_handle wma_handle,
qdf_mem_move(orig_hdr + qdf_mem_move(orig_hdr +
IEEE80211_CCMP_HEADERLEN, wh, IEEE80211_CCMP_HEADERLEN, wh,
sizeof(*wh)); sizeof(*wh));
cdf_nbuf_pull_head(wbuf, qdf_nbuf_pull_head(wbuf,
IEEE80211_CCMP_HEADERLEN); IEEE80211_CCMP_HEADERLEN);
cdf_nbuf_trim_tail(wbuf, IEEE80211_CCMP_MICLEN); qdf_nbuf_trim_tail(wbuf, IEEE80211_CCMP_MICLEN);
rx_pkt->pkt_meta.mpdu_hdr_ptr = rx_pkt->pkt_meta.mpdu_hdr_ptr =
cdf_nbuf_data(wbuf); qdf_nbuf_data(wbuf);
rx_pkt->pkt_meta.mpdu_len = cdf_nbuf_len(wbuf); rx_pkt->pkt_meta.mpdu_len = qdf_nbuf_len(wbuf);
rx_pkt->pkt_meta.mpdu_data_len = rx_pkt->pkt_meta.mpdu_data_len =
rx_pkt->pkt_meta.mpdu_len - rx_pkt->pkt_meta.mpdu_len -
rx_pkt->pkt_meta.mpdu_hdr_len; rx_pkt->pkt_meta.mpdu_hdr_len;
@@ -3143,7 +3143,7 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
struct wma_txrx_node *iface = NULL; struct wma_txrx_node *iface = NULL;
uint8_t vdev_id = WMA_INVALID_VDEV_ID; uint8_t vdev_id = WMA_INVALID_VDEV_ID;
cds_pkt_t *rx_pkt; cds_pkt_t *rx_pkt;
cdf_nbuf_t wbuf; qdf_nbuf_t wbuf;
struct ieee80211_frame *wh; struct ieee80211_frame *wh;
uint8_t mgt_type, mgt_subtype; uint8_t mgt_type, mgt_subtype;
int status; int status;
@@ -3217,7 +3217,7 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
rx_pkt->pkt_meta.roamCandidateInd = 0; rx_pkt->pkt_meta.roamCandidateInd = 0;
/* Why not just use rx_event->hdr.buf_len? */ /* Why not just use rx_event->hdr.buf_len? */
wbuf = cdf_nbuf_alloc(NULL, roundup(hdr->buf_len, 4), 0, 4, false); wbuf = qdf_nbuf_alloc(NULL, roundup(hdr->buf_len, 4), 0, 4, false);
if (!wbuf) { if (!wbuf) {
WMA_LOGE("%s: Failed to allocate wbuf for mgmt rx len(%u)", WMA_LOGE("%s: Failed to allocate wbuf for mgmt rx len(%u)",
__func__, hdr->buf_len); __func__, hdr->buf_len);
@@ -3225,11 +3225,11 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data,
return -ENOMEM; return -ENOMEM;
} }
cdf_nbuf_put_tail(wbuf, hdr->buf_len); qdf_nbuf_put_tail(wbuf, hdr->buf_len);
cdf_nbuf_set_protocol(wbuf, ETH_P_CONTROL); qdf_nbuf_set_protocol(wbuf, ETH_P_CONTROL);
wh = (struct ieee80211_frame *)cdf_nbuf_data(wbuf); wh = (struct ieee80211_frame *)qdf_nbuf_data(wbuf);
rx_pkt->pkt_meta.mpdu_hdr_ptr = cdf_nbuf_data(wbuf); rx_pkt->pkt_meta.mpdu_hdr_ptr = qdf_nbuf_data(wbuf);
rx_pkt->pkt_meta.mpdu_data_ptr = rx_pkt->pkt_meta.mpdu_hdr_ptr + rx_pkt->pkt_meta.mpdu_data_ptr = rx_pkt->pkt_meta.mpdu_hdr_ptr +
rx_pkt->pkt_meta.mpdu_hdr_len; rx_pkt->pkt_meta.mpdu_hdr_len;
rx_pkt->pkt_meta.tsf_delta = hdr->tsf_delta; rx_pkt->pkt_meta.tsf_delta = hdr->tsf_delta;

Переглянути файл

@@ -45,7 +45,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -154,7 +154,7 @@ int32_t wmi_unified_set_sta_ps_param(wmi_unified_t wmi_handle,
WMI_STA_POWERSAVE_PARAM_CMDID)) { WMI_STA_POWERSAVE_PARAM_CMDID)) {
WMA_LOGE("Set Sta Ps param Failed vdevId %d Param %d val %d", WMA_LOGE("Set Sta Ps param Failed vdevId %d Param %d val %d",
vdev_id, param, value); vdev_id, param, value);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
/* Store the PS Status */ /* Store the PS Status */
@@ -578,7 +578,7 @@ int32_t wmi_unified_set_sta_ps(wmi_unified_t wmi_handle,
WMI_STA_POWERSAVE_MODE_CMDID)) { WMI_STA_POWERSAVE_MODE_CMDID)) {
WMA_LOGE("Set Sta Mode Ps Failed vdevId %d val %d", WMA_LOGE("Set Sta Mode Ps Failed vdevId %d val %d",
vdev_id, val); vdev_id, val);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return -EIO; return -EIO;
} }
return 0; return 0;
@@ -1526,7 +1526,7 @@ static void wma_update_beacon_noa_ie(struct beacon_info *bcn,
} else { /* NoA is not present in previous beacon */ } else { /* NoA is not present in previous beacon */
WMA_LOGD("%s: NoA not present in previous beacon, add it" WMA_LOGD("%s: NoA not present in previous beacon, add it"
"bcn->len %u", __func__, bcn->len); "bcn->len %u", __func__, bcn->len);
buf = cdf_nbuf_data(bcn->buf); buf = qdf_nbuf_data(bcn->buf);
bcn->noa_ie = buf + bcn->len; bcn->noa_ie = buf + bcn->len;
} }

Переглянути файл

@@ -46,7 +46,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -724,7 +724,7 @@ QDF_STATUS wma_stop_scan(tp_wma_handle wma_handle,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
error: error:
if (buf) if (buf)
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
error1: error1:
return qdf_status; return qdf_status;
} }
@@ -3076,7 +3076,7 @@ void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts)
__func__); __func__);
if (is_add_ts) if (is_add_ts)
((tAddTsParams *) msg)->status = QDF_STATUS_E_FAILURE; ((tAddTsParams *) msg)->status = QDF_STATUS_E_FAILURE;
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
} }
} }
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */ #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
@@ -3135,7 +3135,7 @@ void wma_process_unit_test_cmd(WMA_HANDLE handle,
if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma_handle->wmi_handle, wmi_buf, len,
WMI_UNIT_TEST_CMDID)) { WMI_UNIT_TEST_CMDID)) {
WMA_LOGP("%s: failed to send unit test command", __func__); WMA_LOGP("%s: failed to send unit test command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return; return;
} }
return; return;
@@ -3215,7 +3215,7 @@ void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id)
WMI_ROAM_SYNCH_COMPLETE)) { WMI_ROAM_SYNCH_COMPLETE)) {
WMA_LOGP("%s: failed to send roam synch confirmation", WMA_LOGP("%s: failed to send roam synch confirmation",
__func__); __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return; return;
} }
return; return;
@@ -5405,7 +5405,7 @@ QDF_STATUS wma_start_extscan(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, buf, if (wmi_unified_cmd_send(wma->wmi_handle, buf,
len, WMI_EXTSCAN_START_CMDID)) { len, WMI_EXTSCAN_START_CMDID)) {
WMA_LOGE("%s: failed to send command", __func__); WMA_LOGE("%s: failed to send command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
wma->interfaces[pstart->sessionId].extscan_in_progress = true; wma->interfaces[pstart->sessionId].extscan_in_progress = true;
@@ -5460,7 +5460,7 @@ QDF_STATUS wma_stop_extscan(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len,
WMI_EXTSCAN_STOP_CMDID)) { WMI_EXTSCAN_STOP_CMDID)) {
WMA_LOGE("%s: failed to command", __func__); WMA_LOGE("%s: failed to command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
wma->interfaces[pstopcmd->sessionId].extscan_in_progress = false; wma->interfaces[pstopcmd->sessionId].extscan_in_progress = false;
@@ -5609,7 +5609,7 @@ QDF_STATUS wma_get_buf_extscan_hotlist_cmd(tp_wma_handle wma_handle,
if (wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, if (wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len,
WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID)) { WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID)) {
WMA_LOGE("%s: failed to send command", __func__); WMA_LOGE("%s: failed to send command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
index = index + min_entries; index = index + min_entries;
@@ -5718,7 +5718,7 @@ QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len,
WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID)) { WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID)) {
WMA_LOGE("%s: failed to command", __func__); WMA_LOGE("%s: failed to command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -5849,7 +5849,7 @@ QDF_STATUS wma_extscan_start_change_monitor(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, buf, len,
WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID)) { WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID)) {
WMA_LOGE("%s: failed to send command", __func__); WMA_LOGE("%s: failed to send command", __func__);
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -5918,7 +5918,7 @@ QDF_STATUS wma_extscan_stop_change_monitor(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len,
WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID)) { WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID)) {
WMA_LOGE("%s: failed to command", __func__); WMA_LOGE("%s: failed to command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -5972,7 +5972,7 @@ QDF_STATUS wma_extscan_get_cached_results(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len,
WMI_EXTSCAN_GET_CACHED_RESULTS_CMDID)) { WMI_EXTSCAN_GET_CACHED_RESULTS_CMDID)) {
WMA_LOGE("%s: failed to command", __func__); WMA_LOGE("%s: failed to command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -6024,7 +6024,7 @@ QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len,
WMI_EXTSCAN_GET_CAPABILITIES_CMDID)) { WMI_EXTSCAN_GET_CAPABILITIES_CMDID)) {
WMA_LOGE("%s: failed to command", __func__); WMA_LOGE("%s: failed to command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -6531,7 +6531,7 @@ QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui)
if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len, if (wmi_unified_cmd_send(wma->wmi_handle, wmi_buf, len,
WMI_SCAN_PROB_REQ_OUI_CMDID)) { WMI_SCAN_PROB_REQ_OUI_CMDID)) {
WMA_LOGE("%s: failed to send command", __func__); WMA_LOGE("%s: failed to send command", __func__);
cdf_nbuf_free(wmi_buf); qdf_nbuf_free(wmi_buf);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;

Переглянути файл

@@ -45,7 +45,7 @@
#include "ol_txrx_ctrl_api.h" #include "ol_txrx_ctrl_api.h"
#include "wlan_tgt_def_config.h" #include "wlan_tgt_def_config.h"
#include "cdf_nbuf.h" #include "qdf_nbuf.h"
#include "qdf_types.h" #include "qdf_types.h"
#include "ol_txrx_api.h" #include "ol_txrx_api.h"
#include "qdf_mem.h" #include "qdf_mem.h"
@@ -2172,7 +2172,7 @@ void *wma_get_beacon_buffer_by_vdev_id(uint8_t vdev_id, uint32_t *buffer_size)
qdf_spin_lock_bh(&beacon->lock); qdf_spin_lock_bh(&beacon->lock);
buf_size = cdf_nbuf_len(beacon->buf); buf_size = qdf_nbuf_len(beacon->buf);
buf = qdf_mem_malloc(buf_size); buf = qdf_mem_malloc(buf_size);
if (!buf) { if (!buf) {
@@ -2181,7 +2181,7 @@ void *wma_get_beacon_buffer_by_vdev_id(uint8_t vdev_id, uint32_t *buffer_size)
return NULL; return NULL;
} }
qdf_mem_copy(buf, cdf_nbuf_data(beacon->buf), buf_size); qdf_mem_copy(buf, qdf_nbuf_data(beacon->buf), buf_size);
qdf_spin_unlock_bh(&beacon->lock); qdf_spin_unlock_bh(&beacon->lock);

Переглянути файл

@@ -177,7 +177,7 @@ wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint16_t len, uint8_t *file_name,
return NULL; return NULL;
} }
wmi_buf = cdf_nbuf_alloc_debug(NULL, wmi_buf = qdf_nbuf_alloc_debug(NULL,
roundup(len + WMI_MIN_HEAD_ROOM, 4), roundup(len + WMI_MIN_HEAD_ROOM, 4),
WMI_MIN_HEAD_ROOM, 4, false, file_name, WMI_MIN_HEAD_ROOM, 4, false, file_name,
line_num); line_num);
@@ -186,19 +186,19 @@ wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint16_t len, uint8_t *file_name,
return NULL; return NULL;
/* Clear the wmi buffer */ /* Clear the wmi buffer */
OS_MEMZERO(cdf_nbuf_data(wmi_buf), len); OS_MEMZERO(qdf_nbuf_data(wmi_buf), len);
/* /*
* Set the length of the buffer to match the allocation size. * Set the length of the buffer to match the allocation size.
*/ */
cdf_nbuf_set_pktlen(wmi_buf, len); qdf_nbuf_set_pktlen(wmi_buf, len);
return wmi_buf; return wmi_buf;
} }
void wmi_buf_free(wmi_buf_t net_buf) void wmi_buf_free(wmi_buf_t net_buf)
{ {
cdf_nbuf_free(net_buf); qdf_nbuf_free(net_buf);
} }
#else #else
wmi_buf_t wmi_buf_alloc(wmi_unified_t wmi_handle, uint16_t len) wmi_buf_t wmi_buf_alloc(wmi_unified_t wmi_handle, uint16_t len)
@@ -210,24 +210,24 @@ wmi_buf_t wmi_buf_alloc(wmi_unified_t wmi_handle, uint16_t len)
return NULL; return NULL;
} }
wmi_buf = cdf_nbuf_alloc(NULL, roundup(len + WMI_MIN_HEAD_ROOM, 4), wmi_buf = qdf_nbuf_alloc(NULL, roundup(len + WMI_MIN_HEAD_ROOM, 4),
WMI_MIN_HEAD_ROOM, 4, false); WMI_MIN_HEAD_ROOM, 4, false);
if (!wmi_buf) if (!wmi_buf)
return NULL; return NULL;
/* Clear the wmi buffer */ /* Clear the wmi buffer */
OS_MEMZERO(cdf_nbuf_data(wmi_buf), len); OS_MEMZERO(qdf_nbuf_data(wmi_buf), len);
/* /*
* Set the length of the buffer to match the allocation size. * Set the length of the buffer to match the allocation size.
*/ */
cdf_nbuf_set_pktlen(wmi_buf, len); qdf_nbuf_set_pktlen(wmi_buf, len);
return wmi_buf; return wmi_buf;
} }
void wmi_buf_free(wmi_buf_t net_buf) void wmi_buf_free(wmi_buf_t net_buf)
{ {
cdf_nbuf_free(net_buf); qdf_nbuf_free(net_buf);
} }
#endif #endif
@@ -813,7 +813,7 @@ int wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, int len,
/* Do sanity check on the TLV parameter structure */ /* Do sanity check on the TLV parameter structure */
{ {
void *buf_ptr = (void *)cdf_nbuf_data(buf); void *buf_ptr = (void *)qdf_nbuf_data(buf);
if (wmitlv_check_command_tlv_params(NULL, buf_ptr, len, cmd_id) if (wmitlv_check_command_tlv_params(NULL, buf_ptr, len, cmd_id)
!= 0) { != 0) {
@@ -824,13 +824,13 @@ int wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, int len,
} }
} }
if (cdf_nbuf_push_head(buf, sizeof(WMI_CMD_HDR)) == NULL) { if (qdf_nbuf_push_head(buf, sizeof(WMI_CMD_HDR)) == NULL) {
pr_err("%s, Failed to send cmd %x, no memory\n", pr_err("%s, Failed to send cmd %x, no memory\n",
__func__, cmd_id); __func__, cmd_id);
return -ENOMEM; return -ENOMEM;
} }
WMI_SET_FIELD(cdf_nbuf_data(buf), WMI_CMD_HDR, COMMANDID, cmd_id); WMI_SET_FIELD(qdf_nbuf_data(buf), WMI_CMD_HDR, COMMANDID, cmd_id);
qdf_atomic_inc(&wmi_handle->pending_cmds); qdf_atomic_inc(&wmi_handle->pending_cmds);
if (qdf_atomic_read(&wmi_handle->pending_cmds) >= WMI_MAX_CMDS) { if (qdf_atomic_read(&wmi_handle->pending_cmds) >= WMI_MAX_CMDS) {
@@ -854,7 +854,7 @@ int wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, int len,
SET_HTC_PACKET_INFO_TX(pkt, SET_HTC_PACKET_INFO_TX(pkt,
NULL, NULL,
cdf_nbuf_data(buf), len + sizeof(WMI_CMD_HDR), qdf_nbuf_data(buf), len + sizeof(WMI_CMD_HDR),
/* htt_host_data_dl_len(buf)+20 */ /* htt_host_data_dl_len(buf)+20 */
wmi_handle->wmi_endpoint_id, htc_tag); wmi_handle->wmi_endpoint_id, htc_tag);
@@ -867,9 +867,9 @@ int wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, int len,
/*Record 16 bytes of WMI cmd data - exclude TLV and WMI headers */ /*Record 16 bytes of WMI cmd data - exclude TLV and WMI headers */
if (cmd_id == WMI_MGMT_TX_SEND_CMDID) { if (cmd_id == WMI_MGMT_TX_SEND_CMDID) {
WMI_MGMT_COMMAND_RECORD(cmd_id, WMI_MGMT_COMMAND_RECORD(cmd_id,
((uint32_t *)cdf_nbuf_data(buf) + 2)); ((uint32_t *)qdf_nbuf_data(buf) + 2));
} else { } else {
WMI_COMMAND_RECORD(cmd_id, ((uint32_t *) cdf_nbuf_data(buf) + WMI_COMMAND_RECORD(cmd_id, ((uint32_t *) qdf_nbuf_data(buf) +
2)); 2));
} }
@@ -956,9 +956,9 @@ static int wmi_unified_event_rx(struct wmi_unified *wmi_handle,
ASSERT(evt_buf != NULL); ASSERT(evt_buf != NULL);
id = WMI_GET_FIELD(cdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID);
if (cdf_nbuf_pull_head(evt_buf, sizeof(WMI_CMD_HDR)) == NULL) if (qdf_nbuf_pull_head(evt_buf, sizeof(WMI_CMD_HDR)) == NULL)
goto end; goto end;
idx = wmi_unified_get_event_handler_ix(wmi_handle, id); idx = wmi_unified_get_event_handler_ix(wmi_handle, id);
@@ -968,15 +968,15 @@ static int wmi_unified_event_rx(struct wmi_unified *wmi_handle,
goto end; goto end;
} }
event = cdf_nbuf_data(evt_buf); event = qdf_nbuf_data(evt_buf);
len = cdf_nbuf_len(evt_buf); len = qdf_nbuf_len(evt_buf);
/* Call the WMI registered event handler */ /* Call the WMI registered event handler */
status = wmi_handle->event_handler[idx] (wmi_handle->scn_handle, status = wmi_handle->event_handler[idx] (wmi_handle->scn_handle,
event, len); event, len);
end: end:
cdf_nbuf_free(evt_buf); qdf_nbuf_free(evt_buf);
return status; return status;
} }
#endif /* 0 */ #endif /* 0 */
@@ -1024,15 +1024,15 @@ static void wmi_process_fw_event_worker_thread_ctx
uint8_t *data; uint8_t *data;
evt_buf = (wmi_buf_t) htc_packet->pPktContext; evt_buf = (wmi_buf_t) htc_packet->pPktContext;
id = WMI_GET_FIELD(cdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID);
data = cdf_nbuf_data(evt_buf); data = qdf_nbuf_data(evt_buf);
qdf_spin_lock_bh(&wmi_handle->wmi_record_lock); qdf_spin_lock_bh(&wmi_handle->wmi_record_lock);
/* Exclude 4 bytes of TLV header */ /* Exclude 4 bytes of TLV header */
WMI_RX_EVENT_RECORD(id, ((uint8_t *) data + 4)); WMI_RX_EVENT_RECORD(id, ((uint8_t *) data + 4));
qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock); qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock);
qdf_spin_lock_bh(&wmi_handle->eventq_lock); qdf_spin_lock_bh(&wmi_handle->eventq_lock);
cdf_nbuf_queue_add(&wmi_handle->event_queue, evt_buf); qdf_nbuf_queue_add(&wmi_handle->event_queue, evt_buf);
qdf_spin_unlock_bh(&wmi_handle->eventq_lock); qdf_spin_unlock_bh(&wmi_handle->eventq_lock);
schedule_work(&wmi_handle->rx_event_work); schedule_work(&wmi_handle->rx_event_work);
return; return;
@@ -1049,7 +1049,7 @@ void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet)
uint32_t id; uint32_t id;
evt_buf = (wmi_buf_t) htc_packet->pPktContext; evt_buf = (wmi_buf_t) htc_packet->pPktContext;
id = WMI_GET_FIELD(cdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID);
switch (id) { switch (id) {
/*Event will be handled in tasklet ctx*/ /*Event will be handled in tasklet ctx*/
case WMI_TX_PAUSE_EVENTID: case WMI_TX_PAUSE_EVENTID:
@@ -1090,13 +1090,13 @@ void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf)
void *wmi_cmd_struct_ptr = NULL; void *wmi_cmd_struct_ptr = NULL;
int tlv_ok_status = 0; int tlv_ok_status = 0;
id = WMI_GET_FIELD(cdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID);
if (cdf_nbuf_pull_head(evt_buf, sizeof(WMI_CMD_HDR)) == NULL) if (qdf_nbuf_pull_head(evt_buf, sizeof(WMI_CMD_HDR)) == NULL)
goto end; goto end;
data = cdf_nbuf_data(evt_buf); data = qdf_nbuf_data(evt_buf);
len = cdf_nbuf_len(evt_buf); len = qdf_nbuf_len(evt_buf);
/* Validate and pad(if necessary) the TLVs */ /* Validate and pad(if necessary) the TLVs */
tlv_ok_status = wmitlv_check_and_pad_event_tlvs(wmi_handle->scn_handle, tlv_ok_status = wmitlv_check_and_pad_event_tlvs(wmi_handle->scn_handle,
@@ -1164,7 +1164,7 @@ void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf)
} }
end: end:
wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr); wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr);
cdf_nbuf_free(evt_buf); qdf_nbuf_free(evt_buf);
} }
void wmi_rx_event_work(struct work_struct *work) void wmi_rx_event_work(struct work_struct *work)
@@ -1174,12 +1174,12 @@ void wmi_rx_event_work(struct work_struct *work)
wmi_buf_t buf; wmi_buf_t buf;
qdf_spin_lock_bh(&wmi->eventq_lock); qdf_spin_lock_bh(&wmi->eventq_lock);
buf = cdf_nbuf_queue_remove(&wmi->event_queue); buf = qdf_nbuf_queue_remove(&wmi->event_queue);
qdf_spin_unlock_bh(&wmi->eventq_lock); qdf_spin_unlock_bh(&wmi->eventq_lock);
while (buf) { while (buf) {
__wmi_control_rx(wmi, buf); __wmi_control_rx(wmi, buf);
qdf_spin_lock_bh(&wmi->eventq_lock); qdf_spin_lock_bh(&wmi->eventq_lock);
buf = cdf_nbuf_queue_remove(&wmi->event_queue); buf = qdf_nbuf_queue_remove(&wmi->event_queue);
qdf_spin_unlock_bh(&wmi->eventq_lock); qdf_spin_unlock_bh(&wmi->eventq_lock);
} }
} }
@@ -1219,7 +1219,7 @@ void *wmi_unified_attach(ol_scn_t scn_handle,
qdf_atomic_init(&wmi_handle->is_target_suspended); qdf_atomic_init(&wmi_handle->is_target_suspended);
wmi_runtime_pm_init(wmi_handle); wmi_runtime_pm_init(wmi_handle);
qdf_spinlock_create(&wmi_handle->eventq_lock); qdf_spinlock_create(&wmi_handle->eventq_lock);
cdf_nbuf_queue_init(&wmi_handle->event_queue); qdf_nbuf_queue_init(&wmi_handle->event_queue);
#ifdef CONFIG_CNSS #ifdef CONFIG_CNSS
cnss_init_work(&wmi_handle->rx_event_work, wmi_rx_event_work); cnss_init_work(&wmi_handle->rx_event_work, wmi_rx_event_work);
#else #else
@@ -1238,10 +1238,10 @@ void wmi_unified_detach(struct wmi_unified *wmi_handle)
cds_flush_work(&wmi_handle->rx_event_work); cds_flush_work(&wmi_handle->rx_event_work);
qdf_spin_lock_bh(&wmi_handle->eventq_lock); qdf_spin_lock_bh(&wmi_handle->eventq_lock);
buf = cdf_nbuf_queue_remove(&wmi_handle->event_queue); buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
while (buf) { while (buf) {
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
buf = cdf_nbuf_queue_remove(&wmi_handle->event_queue); buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
} }
qdf_spin_unlock_bh(&wmi_handle->eventq_lock); qdf_spin_unlock_bh(&wmi_handle->eventq_lock);
if (wmi_handle != NULL) { if (wmi_handle != NULL) {
@@ -1270,10 +1270,10 @@ wmi_unified_remove_work(struct wmi_unified *wmi_handle)
"Enter: %s", __func__); "Enter: %s", __func__);
cds_flush_work(&wmi_handle->rx_event_work); cds_flush_work(&wmi_handle->rx_event_work);
qdf_spin_lock_bh(&wmi_handle->eventq_lock); qdf_spin_lock_bh(&wmi_handle->eventq_lock);
buf = cdf_nbuf_queue_remove(&wmi_handle->event_queue); buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
while (buf) { while (buf) {
cdf_nbuf_free(buf); qdf_nbuf_free(buf);
buf = cdf_nbuf_queue_remove(&wmi_handle->event_queue); buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue);
} }
qdf_spin_unlock_bh(&wmi_handle->eventq_lock); qdf_spin_unlock_bh(&wmi_handle->eventq_lock);
QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_INFO, QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_INFO,
@@ -1290,7 +1290,7 @@ void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
ASSERT(wmi_cmd_buf); ASSERT(wmi_cmd_buf);
#ifdef WMI_INTERFACE_EVENT_LOGGING #ifdef WMI_INTERFACE_EVENT_LOGGING
cmd_id = WMI_GET_FIELD(cdf_nbuf_data(wmi_cmd_buf), cmd_id = WMI_GET_FIELD(qdf_nbuf_data(wmi_cmd_buf),
WMI_CMD_HDR, COMMANDID); WMI_CMD_HDR, COMMANDID);
#ifdef QCA_WIFI_3_0_EMU #ifdef QCA_WIFI_3_0_EMU
@@ -1303,15 +1303,15 @@ void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
- exclude TLV and WMI headers */ - exclude TLV and WMI headers */
if (cmd_id == WMI_MGMT_TX_SEND_CMDID) { if (cmd_id == WMI_MGMT_TX_SEND_CMDID) {
WMI_MGMT_COMMAND_TX_CMP_RECORD(cmd_id, WMI_MGMT_COMMAND_TX_CMP_RECORD(cmd_id,
((uint32_t *) cdf_nbuf_data(wmi_cmd_buf) + 2)); ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) + 2));
} else { } else {
WMI_COMMAND_TX_CMP_RECORD(cmd_id, WMI_COMMAND_TX_CMP_RECORD(cmd_id,
((uint32_t *) cdf_nbuf_data(wmi_cmd_buf) + 2)); ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) + 2));
} }
qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock); qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock);
#endif #endif
cdf_nbuf_free(wmi_cmd_buf); qdf_nbuf_free(wmi_cmd_buf);
qdf_mem_free(htc_pkt); qdf_mem_free(htc_pkt);
qdf_atomic_dec(&wmi_handle->pending_cmds); qdf_atomic_dec(&wmi_handle->pending_cmds);
} }

Переглянути файл

@@ -38,8 +38,8 @@
#include "wmi.h" #include "wmi.h"
#include "htc_api.h" #include "htc_api.h"
typedef cdf_nbuf_t wmi_buf_t; typedef qdf_nbuf_t wmi_buf_t;
#define wmi_buf_data(_buf) cdf_nbuf_data(_buf) #define wmi_buf_data(_buf) qdf_nbuf_data(_buf)
/** /**
* attach for unified WMI * attach for unified WMI

Переглянути файл

@@ -39,7 +39,7 @@
#define WMI_UNIFIED_MAX_EVENT 0x100 #define WMI_UNIFIED_MAX_EVENT 0x100
#define WMI_MAX_CMDS 1024 #define WMI_MAX_CMDS 1024
typedef cdf_nbuf_t wmi_buf_t; typedef qdf_nbuf_t wmi_buf_t;
#ifdef WMI_INTERFACE_EVENT_LOGGING #ifdef WMI_INTERFACE_EVENT_LOGGING
@@ -77,7 +77,7 @@ struct wmi_unified {
uint32_t max_event_idx; uint32_t max_event_idx;
void *htc_handle; void *htc_handle;
qdf_spinlock_t eventq_lock; qdf_spinlock_t eventq_lock;
cdf_nbuf_queue_t event_queue; qdf_nbuf_queue_t event_queue;
struct work_struct rx_event_work; struct work_struct rx_event_work;
#ifdef WLAN_OPEN_SOURCE #ifdef WLAN_OPEN_SOURCE
struct fwdebug dbglog; struct fwdebug dbglog;