blob: be809134a1c01fdd1d8c0552777dd51dc6949b8f [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28/**
29 * @file ol_tx_queue.h
30 * @brief API definitions for the tx frame queue module within the data SW.
31 */
32#ifndef _OL_TX_QUEUE__H_
33#define _OL_TX_QUEUE__H_
34
35#include <cdf_nbuf.h> /* cdf_nbuf_t */
36#include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */
37#include <cdf_types.h> /* bool */
38
39/*--- function prototypes for optional queue log feature --------------------*/
40#if defined(ENABLE_TX_QUEUE_LOG)
41
42void
43ol_tx_queue_log_enqueue(struct ol_txrx_pdev_t *pdev,
44 struct ol_txrx_msdu_info_t *msdu_info,
45 int frms, int bytes);
46void
47ol_tx_queue_log_dequeue(struct ol_txrx_pdev_t *pdev,
48 struct ol_tx_frms_queue_t *txq, int frms, int bytes);
49void
50ol_tx_queue_log_free(struct ol_txrx_pdev_t *pdev,
51 struct ol_tx_frms_queue_t *txq,
52 int tid, int frms, int bytes);
53#define OL_TX_QUEUE_LOG_ENQUEUE ol_tx_queue_log_enqueue
54#define OL_TX_QUEUE_LOG_DEQUEUE ol_tx_queue_log_dequeue
55#define OL_TX_QUEUE_LOG_FREE ol_tx_queue_log_free
56
57#else
58
59#define OL_TX_QUEUE_LOG_ENQUEUE(pdev, msdu_info, frms, bytes) /* no-op */
60#define OL_TX_QUEUE_LOG_DEQUEUE(pdev, txq, frms, bytes) /* no-op */
61#define OL_TX_QUEUE_LOG_FREE(pdev, txq, tid, frms, bytes) /* no-op */
62
63#endif /* TXRX_DEBUG_LEVEL > 5 */
64
65#define ol_tx_enqueue(pdev, txq, tx_desc, tx_msdu_info) /* no-op */
66#define ol_tx_dequeue(pdev, ext_tid, txq, head, num_frames, credit, bytes) 0
67#define ol_tx_queue_free(pdev, txq, tid) /* no-op */
68#define ol_tx_queue_discard(pdev, flush, tx_descs) /* no-op */
69
70void
71ol_tx_queue_log_sched(struct ol_txrx_pdev_t *pdev,
72 int credit,
73 int *num_active_tids,
74 uint32_t **active_bitmap, uint8_t **data);
75
76#define OL_TX_QUEUE_LOG_SCHED( \
77 pdev, credit, num_active_tids, active_bitmap, data)
78
79#define ol_tx_queues_display(pdev) /* no-op */
80
81#define ol_tx_queue_decs_reinit(peer, peer_id) /* no-op */
82
83#ifdef QCA_SUPPORT_TX_THROTTLE
84/**
85 * @brief - initialize the throttle context
86 * @param pdev - the physical device object, which stores the txqs
87 */
88void ol_tx_throttle_init(struct ol_txrx_pdev_t *pdev);
89#else
90#define ol_tx_throttle_init(pdev) /*no op */
91#endif
92#endif /* _OL_TX_QUEUE__H_ */