blob: 159897ae5c423f773cd3e8cad3843eed1dce96ad [file] [log] [blame]
Siddarth Poddarb2011f62016-04-27 20:45:42 +05301/*
2 * Copyright (c) 2012, 2014, 2016 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_classify.h
30 * @brief API definitions for the tx classify module within the data SW.
31 */
32#ifndef _OL_TX_CLASSIFY__H_
33#define _OL_TX_CLASSIFY__H_
34
35#include <qdf_nbuf.h> /* qdf_nbuf_t */
36#include <ol_txrx_types.h> /* ol_txrx_vdev_t, etc. */
37
38static inline u_int8_t *
39ol_tx_dest_addr_find(
40 struct ol_txrx_pdev_t *pdev,
41 qdf_nbuf_t tx_nbuf)
42{
43 u_int8_t *hdr_ptr;
44 void *datap = qdf_nbuf_data(tx_nbuf);
45
46 if (pdev->frame_format == wlan_frm_fmt_raw) {
47 /* adjust hdr_ptr to RA */
48 struct ieee80211_frame *wh =
49 (struct ieee80211_frame *)datap;
50 hdr_ptr = wh->i_addr1;
51 } else if (pdev->frame_format ==
52 wlan_frm_fmt_native_wifi) {
53 /* adjust hdr_ptr to RA */
54 struct ieee80211_frame *wh = (
55 struct ieee80211_frame *)datap;
56 hdr_ptr = wh->i_addr1;
57 } else if (pdev->frame_format == wlan_frm_fmt_802_3) {
58 hdr_ptr = datap;
59 } else {
60 QDF_TRACE(QDF_MODULE_ID_TXRX,
61 QDF_TRACE_LEVEL_ERROR,
62 "Invalid standard frame type: %d\n",
63 pdev->frame_format);
64 qdf_assert(0);
65 hdr_ptr = NULL;
66 }
67 return hdr_ptr;
68}
69
70#if defined(CONFIG_HL_SUPPORT)
71
72/**
73 * @brief Classify a tx frame to which tid queue.
74 *
75 * @param vdev - the virtual device sending the data
76 * (for specifying the transmitter address for multicast / broadcast data)
77 * @param tx_desc - descriptor object with meta-data about the tx frame
78 * @param netbuf - the tx frame
79 * @param tx_msdu_info - characteristics of the tx frame
80 */
81struct ol_tx_frms_queue_t *
82ol_tx_classify(
83 struct ol_txrx_vdev_t *vdev,
84 struct ol_tx_desc_t *tx_desc,
85 qdf_nbuf_t netbuf,
86 struct ol_txrx_msdu_info_t *tx_msdu_info);
87
88struct ol_tx_frms_queue_t *
89ol_tx_classify_mgmt(
90 struct ol_txrx_vdev_t *vdev,
91 struct ol_tx_desc_t *tx_desc,
92 qdf_nbuf_t netbuf,
93 struct ol_txrx_msdu_info_t *tx_msdu_info);
94
95#else
96
97#define ol_tx_classify(vdev, tx_desc, netbuf, tx_msdu_info) NULL
98#define ol_tx_classify_mgmt(vdev, tx_desc, netbuf, tx_msdu_info) NULL
99
100#endif /* defined(CONFIG_HL_SUPPORT) */
101
102
103#endif /* _OL_TX_CLASSIFY__H_ */