blob: 1a55f586a8380a6f32ff1b61000bd011f2beeaa6 [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
2 * Copyright (c) 2011-2015 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 *
30 * This file dph_hash_table.h contains the definition of the scheduler class.
31 *
32 * Author: Sandesh Goel
33 * Date: 02/25/02
34 * History:-
35 * Date Modified by Modification Information
36 * --------------------------------------------------------------------
37 *
38 */
39
40#ifndef __DPH_HASH_TABLE_H__
41#define __DPH_HASH_TABLE_H__
42
43#include "ani_global.h"
44/* Compare MAC addresses, return true if same */
45static inline uint8_t dph_compare_mac_addr(uint8_t addr1[], uint8_t addr2[])
46{
47 return (addr1[0] == addr2[0]) &&
48 (addr1[1] == addr2[1]) &&
49 (addr1[2] == addr2[2]) &&
50 (addr1[3] == addr2[3]) &&
51 (addr1[4] == addr2[4]) && (addr1[5] == addr2[5]);
52}
53
54/* Hash table class */
55typedef struct {
56
57 /* The hash table itself */
58 tpDphHashNode *pHashTable;
59
60 /* The state array */
61 tDphHashNode *pDphNodeArray;
62 uint16_t size;
63} dphHashTableClass;
64
65/* The hash table object */
66extern dphHashTableClass dphHashTable;
67
68/* Print MAC addresse */
69extern void dph_print_mac_addr(struct sAniSirGlobal *pMac, uint8_t addr[],
70 uint32_t);
71
72tpDphHashNode dph_lookup_hash_entry(tpAniSirGlobal pMac, uint8_t staAddr[],
73 uint16_t *pStaId,
74 dphHashTableClass *pDphHashTable);
75tpDphHashNode dph_lookup_assoc_id(tpAniSirGlobal pMac, uint16_t staIdx,
76 uint16_t *assocId,
77 dphHashTableClass *pDphHashTable);
78
79/* Get a pointer to the hash node */
80extern tpDphHashNode dph_get_hash_entry(tpAniSirGlobal pMac, uint16_t staId,
81 dphHashTableClass *pDphHashTable);
82
83/* Add an entry to the hash table */
84extern tpDphHashNode dph_add_hash_entry(tpAniSirGlobal pMac,
85 tSirMacAddr staAddr,
86 uint16_t staId,
87 dphHashTableClass *pDphHashTable);
88
89/* Delete an entry from the hash table */
90extern tSirRetStatus dph_delete_hash_entry(tpAniSirGlobal pMac,
91 tSirMacAddr staAddr, uint16_t staId,
92 dphHashTableClass *pDphHashTable);
93
94void dph_hash_table_class_init(tpAniSirGlobal pMac,
95 dphHashTableClass *pDphHashTable);
96/* Initialize STA state */
97extern tpDphHashNode dph_init_sta_state(tpAniSirGlobal pMac,
98 tSirMacAddr staAddr,
99 uint16_t staId, uint8_t validStaIdx,
100 dphHashTableClass *pDphHashTable);
101
102#endif