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_COMMONRING_H
16 #define BRCMFMAC_COMMONRING_H
19 struct brcmf_commonring
{
28 int (*cr_ring_bell
)(void *ctx
);
29 int (*cr_update_rptr
)(void *ctx
);
30 int (*cr_update_wptr
)(void *ctx
);
31 int (*cr_write_rptr
)(void *ctx
);
32 int (*cr_write_wptr
)(void *ctx
);
43 void brcmf_commonring_register_cb(struct brcmf_commonring
*commonring
,
44 int (*cr_ring_bell
)(void *ctx
),
45 int (*cr_update_rptr
)(void *ctx
),
46 int (*cr_update_wptr
)(void *ctx
),
47 int (*cr_write_rptr
)(void *ctx
),
48 int (*cr_write_wptr
)(void *ctx
), void *ctx
);
49 void brcmf_commonring_config(struct brcmf_commonring
*commonring
, u16 depth
,
50 u16 item_len
, void *buf_addr
);
51 void brcmf_commonring_lock(struct brcmf_commonring
*commonring
);
52 void brcmf_commonring_unlock(struct brcmf_commonring
*commonring
);
53 bool brcmf_commonring_write_available(struct brcmf_commonring
*commonring
);
54 void *brcmf_commonring_reserve_for_write(struct brcmf_commonring
*commonring
);
56 brcmf_commonring_reserve_for_write_multiple(struct brcmf_commonring
*commonring
,
57 u16 n_items
, u16
*alloced
);
58 int brcmf_commonring_write_complete(struct brcmf_commonring
*commonring
);
59 void brcmf_commonring_write_cancel(struct brcmf_commonring
*commonring
,
61 void *brcmf_commonring_get_read_ptr(struct brcmf_commonring
*commonring
,
63 int brcmf_commonring_read_complete(struct brcmf_commonring
*commonring
);
65 #define brcmf_commonring_n_items(commonring) (commonring->depth)
66 #define brcmf_commonring_len_item(commonring) (commonring->item_len)
69 #endif /* BRCMFMAC_COMMONRING_H */
This page took 0.034755 seconds and 6 git commands to generate.