blob: d04442a2ac54e26bf2d527b1bd7014cf1d76b01f [file] [log] [blame]
Debashis Duttc4c52dc2016-10-04 17:12:23 -07001/*
Jeff Johnson2cb8fc72016-12-17 10:45:08 -08002 * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
Debashis Duttc4c52dc2016-10-04 17:12:23 -07003 *
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 */
Jeff Johnson2cb8fc72016-12-17 10:45:08 -080018#ifndef _DP_PEER_H_
19#define _DP_PEER_H_
Debashis Duttc4c52dc2016-10-04 17:12:23 -070020
21#include <qdf_types.h>
22#include <qdf_lock.h>
23#include "dp_types.h"
24
25#define DP_INVALID_PEER_ID 0xffff
26
27/**
28 * dp_peer_find_by_id() - Returns peer object given the peer id
29 *
30 * @soc : core DP soc context
31 * @peer_id : peer id from peer object can be retrieved
32 *
33 * Return: struct dp_peer*: Pointer to DP peer object
34 */
35static inline struct dp_peer *
36dp_peer_find_by_id(struct dp_soc *soc,
37 uint16_t peer_id)
38{
39 struct dp_peer *peer;
40
41 /* TODO: Hold lock */
42 peer = (peer_id >= soc->max_peers) ? NULL :
43 soc->peer_id_to_obj_map[peer_id];
44
45 return peer;
46}
Jeff Johnson2cb8fc72016-12-17 10:45:08 -080047
48void dp_rx_peer_map_handler(void *soc_handle, uint16_t peer_id,
49 uint8_t vdev_id, uint8_t *peer_mac_addr);
50void dp_rx_peer_unmap_handler(void *soc_handle, uint16_t peer_id);
51void dp_rx_sec_ind_handler(void *soc_handle, uint16_t peer_id,
52 enum htt_sec_type sec_type, int is_unicast,
53 u_int32_t *michael_key, u_int32_t *rx_pn);
54
55#endif /* _DP_PEER_H_ */