blob: 0eb40e6a0efc3640f44519299271a9a9b557e3c6 [file] [log] [blame]
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07001/*
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +05302 * Copyright (c) 2016-2017, 2019 The Linux Foundation. All rights reserved.
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07003 *
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07004 * 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
Yun Park93ac3882017-04-03 08:35:45 -070019/**
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070020 * @file cdp_txrx_raw.h
21 * @brief Define the host data path raw mode API functions
22 * called by the host control SW and the OS interface module
23 */
24#ifndef _CDP_TXRX_RAW_H_
25#define _CDP_TXRX_RAW_H_
26
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -080027#include "cdp_txrx_handle.h"
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053028#include "cdp_txrx_ops.h"
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070029/* TODO: adf need to be replaced with qdf */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053030static inline int cdp_get_nwifi_mode(ol_txrx_soc_handle soc,
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053031 uint8_t vdev_id)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053032{
Venkata Sharath Chandra Manchalac4a6b842017-10-25 12:18:08 -070033 if (!soc || !soc->ops) {
34 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
35 "%s: Invalid Instance", __func__);
36 QDF_BUG(0);
37 return 0;
38 }
39
40 if (!soc->ops->raw_ops ||
41 !soc->ops->raw_ops->txrx_get_nwifi_mode)
42 return 0;
43
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053044 return soc->ops->raw_ops->txrx_get_nwifi_mode(soc, vdev_id);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053045}
Venkateswara Swamy Bandaru45f85562017-02-20 18:28:40 +053046
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070047/**
Venkateswara Swamy Bandaru45f85562017-02-20 18:28:40 +053048 * @brief finds the ast entry for the packet
49 * @details: Finds the ast entry i.e 4th address for the packet based on the
50 * details in the netbuf.
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070051 *
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053052 * @param soc - soc handle
53 * @param vdev_id - id of the data virtual device object
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070054 * @param pnbuf - pointer to nbuf
Venkateswara Swamy Bandaru45f85562017-02-20 18:28:40 +053055 * @param raw_ast - pointer to fill ast information
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070056 *
57 * @return - 0 on success, -1 on error, 1 if more nbufs need to be consumed.
58 */
59
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053060static inline QDF_STATUS
61cdp_rawsim_get_astentry(ol_txrx_soc_handle soc, uint8_t vdev_id,
Venkateswara Swamy Bandaru45f85562017-02-20 18:28:40 +053062 qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053063{
Venkateswara Swamy Bandaru45f85562017-02-20 18:28:40 +053064
Venkata Sharath Chandra Manchalac4a6b842017-10-25 12:18:08 -070065 if (!soc || !soc->ops) {
66 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
67 "%s: Invalid Instance", __func__);
68 QDF_BUG(0);
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053069 return QDF_STATUS_E_FAILURE;
Venkata Sharath Chandra Manchalac4a6b842017-10-25 12:18:08 -070070 }
71
72 if (!soc->ops->raw_ops ||
73 !soc->ops->raw_ops->rsim_get_astentry)
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053074 return QDF_STATUS_E_FAILURE;
Venkateswara Swamy Bandaru45f85562017-02-20 18:28:40 +053075
Pavankumar Nandeshware54c5842019-09-29 16:01:09 +053076 return soc->ops->raw_ops->rsim_get_astentry(soc, vdev_id,
77 pnbuf, raw_ast);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053078}
79
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070080#endif