blob: 544ea956147666eaacbc2220720db648c63a7760 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Dhanashri Atre1f0cbe42015-11-19 10:56:53 -08002 * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
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_ctrl_txrx_api.h
30 * @brief Define the host control API functions called by the host data SW.
31 */
32#ifndef _OL_CTRL_TXRX_API__H_
33#define _OL_CTRL_TXRX_API__H_
34
35/* #include <osapi_linux.h> / * uint8_t * / */
36#include <osdep.h> /* uint8_t */
Nirav Shahcbc6d722016-03-01 16:24:53 +053037#include <qdf_nbuf.h> /* qdf_nbuf_t */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080038
Dhanashri Atre12a08392016-02-17 13:10:34 -080039#include <cdp_txrx_cmn.h> /* ol_txrx_pdev_handle */
Dhanashri Atre1f0cbe42015-11-19 10:56:53 -080040#include <ol_txrx_types.h> /* OL_TXRX_MAC_ADDR_LEN */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041#include <cds_ieee80211_common.h> /* ieee80211_frame */
42
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080043#ifdef SUPPORT_HOST_STATISTICS
44/** * @brief Update tx statistics
45 * @details
46 * Update tx statistics after tx complete.
47 *
48 * @param pdev - ol_pdev_handle instance
49 * @param vdev_id - ID of the virtual device that tx frame
50 * @param had_error - whether there is error when tx
51 */
52void ol_tx_statistics(ol_pdev_handle pdev, uint16_t vdev_id, int had_error);
53#else
54#define ol_tx_statistics(pdev, vdev_id, had_error)
55#endif
56
57/** * @brief Count on received packets for invalid peer case
58 *
59 * @param pdev - txrx pdev handle
60 * @param wh - received frame
61 * @param err_type - what kind of error occurred
62 */
63void ol_rx_err_inv_peer_statistics(ol_pdev_handle pdev,
64 struct ieee80211_frame *wh,
65 enum ol_rx_err_type err_type);
66
67/**
68 * @brief Count on received packets, both success and failed
69 *
70 * @param pdev - ol_pdev_handle handle
71 * @param vdev_id - ID of the virtual device received the erroneous rx frame
72 * @param err_type - what kind of error occurred
73 * @param sec_type - The cipher type the peer is using
74 * @param is_mcast - whether this is one multi cast frame
75 */
76void ol_rx_err_statistics(ol_pdev_handle pdev,
77 uint8_t vdev_id,
78 enum ol_rx_err_type err_type,
79 enum ol_sec_type sec_type, int is_mcast);
80
81/**
82 * @brief Provide notification of failure during host rx processing
83 * @details
84 * Indicate an error during host rx data processing, including what
85 * kind of error happened, when it happened, which peer and TID the
86 * erroneous rx frame is from, and what the erroneous rx frame itself
87 * is.
88 *
89 * @param pdev - handle to the ctrl SW's physical device object
90 * @param vdev_id - ID of the virtual device received the erroneous rx frame
91 * @param peer_mac_addr - MAC address of the peer that sent the erroneous
92 * rx frame
93 * @param tid - which TID within the peer sent the erroneous rx frame
94 * @param tsf32 - the timstamp in TSF units of the erroneous rx frame, or
95 * one of the fragments that when reassembled, constitute the rx frame
96 * @param err_type - what kind of error occurred
97 * @param rx_frame - the rx frame that had an error
98 * @pn - Packet sequence number
99 * @key_id - Key index octet received in IV of the frame
100 */
101void
102ol_rx_err(ol_pdev_handle pdev,
103 uint8_t vdev_id,
104 uint8_t *peer_mac_addr,
105 int tid,
106 uint32_t tsf32,
107 enum ol_rx_err_type err_type,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530108 qdf_nbuf_t rx_frame, uint64_t *pn, uint8_t key_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800109
110enum ol_rx_notify_type {
111 OL_RX_NOTIFY_IPV4_IGMP,
112};
113
114/**
115 * @brief Provide notification of reception of data of special interest.
116 * @details
117 * Indicate when "special" data has been received. The nature of the
118 * data that results in it being considered special is specified in the
119 * notify_type argument.
120 * This function is currently used by the data-path SW to notify the
121 * control path SW when the following types of rx data are received:
122 * + IPv4 IGMP frames
123 * The control SW can use these to learn about multicast group
124 * membership, if it so chooses.
125 *
126 * @param pdev - handle to the ctrl SW's physical device object
127 * @param vdev_id - ID of the virtual device received the special data
128 * @param peer_mac_addr - MAC address of the peer that sent the special data
129 * @param tid - which TID within the peer sent the special data
130 * @param tsf32 - the timstamp in TSF units of the special data
131 * @param notify_type - what kind of special data was received
132 * @param rx_frame - the rx frame containing the special data
133 */
134void
135ol_rx_notify(ol_pdev_handle pdev,
136 uint8_t vdev_id,
137 uint8_t *peer_mac_addr,
138 int tid,
139 uint32_t tsf32,
Nirav Shahcbc6d722016-03-01 16:24:53 +0530140 enum ol_rx_notify_type notify_type, qdf_nbuf_t rx_frame);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800141
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800142#define ol_ctrl_addba_req(pdev, peer_mac_addr, tid) ol_addba_req_reject
143#define ol_ctrl_rx_addba_complete(pdev, peer_mac_addr, tid, failed) /* no-op */
144
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800145#endif /* _OL_CTRL_TXRX_API__H_ */