blob: 1a922f6b7e6ed5dc51f9b7cf844ce93b0c13b09b [file] [log] [blame]
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05301/*
Pavankumar Nandeshwara2347162019-12-18 23:20:31 +05302 * Copyright (c) 2011-2016,2018-2019 The Linux Foundation. All rights reserved.
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05303 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 /**
20 * @file cdp_txrx_ctrl.h
21 * @brief Define the host data path control API functions
22 * called by the host control SW and the OS interface module
23 */
24
25#ifndef _CDP_TXRX_CTRL_DEF_H_
26#define _CDP_TXRX_CTRL_DEF_H_
27/* TODO: adf need to be replaced with qdf */
28/*
29 * Cleanups -- Might need cleanup
30 */
31#if !QCA_OL_TX_PDEV_LOCK && QCA_NSS_PLATFORM || \
32 (defined QCA_PARTNER_PLATFORM && QCA_PARTNER_SUPPORT_FAST_TX)
33#define VAP_TX_SPIN_LOCK(_x) spin_lock(_x)
34#define VAP_TX_SPIN_UNLOCK(_x) spin_unlock(_x)
35#else /* QCA_OL_TX_PDEV_LOCK */
36#define VAP_TX_SPIN_LOCK(_x)
37#define VAP_TX_SPIN_UNLOCK(_x)
38#endif /* QCA_OL_TX_PDEV_LOCK */
39
40#if QCA_OL_TX_PDEV_LOCK
41void ol_ll_pdev_tx_lock(void *);
42void ol_ll_pdev_tx_unlock(void *);
43#define OL_TX_LOCK(_x) ol_ll_pdev_tx_lock(_x)
44#define OL_TX_UNLOCK(_x) ol_ll_pdev_tx_unlock(_x)
45
46#define OL_TX_PDEV_LOCK(_x) qdf_spin_lock_bh(_x)
47#define OL_TX_PDEV_UNLOCK(_x) qdf_spin_unlock_bh(_x)
48#else
49#define OL_TX_PDEV_LOCK(_x)
50#define OL_TX_PDEV_UNLOCK(_x)
51
52#define OL_TX_LOCK(_x)
53#define OL_TX_UNLOCK(_x)
54#endif /* QCA_OL_TX_PDEV_LOCK */
55
56#if !QCA_OL_TX_PDEV_LOCK
57#define OL_TX_FLOW_CTRL_LOCK(_x) qdf_spin_lock_bh(_x)
58#define OL_TX_FLOW_CTRL_UNLOCK(_x) qdf_spin_unlock_bh(_x)
59
60#define OL_TX_DESC_LOCK(_x) qdf_spin_lock_bh(_x)
61#define OL_TX_DESC_UNLOCK(_x) qdf_spin_unlock_bh(_x)
62
phadiman7821bf82018-02-06 16:03:54 +053063#define OSIF_VAP_TX_LOCK(_y, _x) spin_lock(&((_x)->tx_lock))
64#define OSIF_VAP_TX_UNLOCK(_y, _x) spin_unlock(&((_x)->tx_lock))
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053065
66#define OL_TX_PEER_LOCK(_x, _id) qdf_spin_lock_bh(&((_x)->peer_lock[_id]))
67#define OL_TX_PEER_UNLOCK(_x, _id) qdf_spin_unlock_bh(&((_x)->peer_lock[_id]))
68
69#define OL_TX_PEER_UPDATE_LOCK(_x, _id) \
70 qdf_spin_lock_bh(&((_x)->peer_lock[_id]))
71#define OL_TX_PEER_UPDATE_UNLOCK(_x, _id) \
72 qdf_spin_unlock_bh(&((_x)->peer_lock[_id]))
73
74#else
phadiman7821bf82018-02-06 16:03:54 +053075#define OSIF_VAP_TX_LOCK(_y, _x) cdp_vdev_tx_lock( \
Pavankumar Nandeshwara2347162019-12-18 23:20:31 +053076 _y, wlan_vdev_get_id((_x)->ctrl_vdev))
phadiman7821bf82018-02-06 16:03:54 +053077#define OSIF_VAP_TX_UNLOCK(_y, _x) cdp_vdev_tx_unlock( \
Pavankumar Nandeshwara2347162019-12-18 23:20:31 +053078 _y, wlan_vdev_get_id((_x)->ctrl_vdev))
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053079
80#define OL_TX_FLOW_CTRL_LOCK(_x)
81#define OL_TX_FLOW_CTRL_UNLOCK(_x)
82
83#define OL_TX_DESC_LOCK(_x)
84#define OL_TX_DESC_UNLOCK(_x)
85
86#define OL_TX_PEER_LOCK(_x, _id)
87#define OL_TX_PEER_UNLOCK(_x, _id)
88
89#define OL_TX_PEER_UPDATE_LOCK(_x, _id) qdf_spin_lock_bh(&((_x)->tx_lock))
90#define OL_TX_PEER_UPDATE_UNLOCK(_x, _id) qdf_spin_unlock_bh(&((_x)->tx_lock))
91
92#endif /* !QCA_OL_TX_PDEV_LOCK */
93#endif
94