1 /* Copyright (c) 2014 Broadcom Corporation
3 * Permission to use, copy, modify, and/or distribute this software for any
4 * purpose with or without fee is hereby granted, provided that the above
5 * copyright notice and this permission notice appear in all copies.
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 #ifndef BRCMFMAC_FLOWRING_H
16 #define BRCMFMAC_FLOWRING_H
19 #define BRCMF_FLOWRING_HASHSIZE 512 /* has to be 2^x */
20 #define BRCMF_FLOWRING_INVALID_ID 0xFFFFFFFF
23 struct brcmf_flowring_hash
{
36 struct brcmf_flowring_ring
{
39 enum ring_status status
;
40 struct sk_buff_head skblist
;
43 struct brcmf_flowring_tdls_entry
{
45 struct brcmf_flowring_tdls_entry
*next
;
48 struct brcmf_flowring
{
50 struct brcmf_flowring_hash hash
[BRCMF_FLOWRING_HASHSIZE
];
51 struct brcmf_flowring_ring
**rings
;
52 spinlock_t block_lock
;
53 enum proto_addr_mode addr_mode
[BRCMF_MAX_IFS
];
56 struct brcmf_flowring_tdls_entry
*tdls_entry
;
60 u32
brcmf_flowring_lookup(struct brcmf_flowring
*flow
, u8 da
[ETH_ALEN
],
62 u32
brcmf_flowring_create(struct brcmf_flowring
*flow
, u8 da
[ETH_ALEN
],
64 void brcmf_flowring_delete(struct brcmf_flowring
*flow
, u16 flowid
);
65 void brcmf_flowring_open(struct brcmf_flowring
*flow
, u16 flowid
);
66 u8
brcmf_flowring_tid(struct brcmf_flowring
*flow
, u16 flowid
);
67 u32
brcmf_flowring_enqueue(struct brcmf_flowring
*flow
, u16 flowid
,
69 struct sk_buff
*brcmf_flowring_dequeue(struct brcmf_flowring
*flow
, u16 flowid
);
70 void brcmf_flowring_reinsert(struct brcmf_flowring
*flow
, u16 flowid
,
72 u32
brcmf_flowring_qlen(struct brcmf_flowring
*flow
, u16 flowid
);
73 u8
brcmf_flowring_ifidx_get(struct brcmf_flowring
*flow
, u16 flowid
);
74 struct brcmf_flowring
*brcmf_flowring_attach(struct device
*dev
, u16 nrofrings
);
75 void brcmf_flowring_detach(struct brcmf_flowring
*flow
);
76 void brcmf_flowring_configure_addr_mode(struct brcmf_flowring
*flow
, int ifidx
,
77 enum proto_addr_mode addr_mode
);
78 void brcmf_flowring_delete_peer(struct brcmf_flowring
*flow
, int ifidx
,
80 void brcmf_flowring_add_tdls_peer(struct brcmf_flowring
*flow
, int ifidx
,
84 #endif /* BRCMFMAC_FLOWRING_H */