18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: ISC
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2014 Broadcom Corporation
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci#ifndef BRCMFMAC_MSGBUF_H
68c2ecf20Sopenharmony_ci#define BRCMFMAC_MSGBUF_H
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifdef CONFIG_BRCMFMAC_PROTO_MSGBUF
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM	64
118c2ecf20Sopenharmony_ci#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM	512
128c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM	64
138c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_TX_COMPLETE_MAX_ITEM		1024
148c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM		512
158c2ecf20Sopenharmony_ci#define BRCMF_H2D_TXFLOWRING_MAX_ITEM			512
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE	40
188c2ecf20Sopenharmony_ci#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_ITEMSIZE	32
198c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_ITEMSIZE	24
208c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE_PRE_V7	16
218c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE		24
228c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE_PRE_V7	32
238c2ecf20Sopenharmony_ci#define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE		40
248c2ecf20Sopenharmony_ci#define BRCMF_H2D_TXFLOWRING_ITEMSIZE			48
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistruct msgbuf_buf_addr {
278c2ecf20Sopenharmony_ci	__le32		low_addr;
288c2ecf20Sopenharmony_ci	__le32		high_addr;
298c2ecf20Sopenharmony_ci};
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciint brcmf_proto_msgbuf_rx_trigger(struct device *dev);
328c2ecf20Sopenharmony_civoid brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u16 flowid);
338c2ecf20Sopenharmony_ciint brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr);
348c2ecf20Sopenharmony_civoid brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr);
358c2ecf20Sopenharmony_ci#else
368c2ecf20Sopenharmony_cistatic inline int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
378c2ecf20Sopenharmony_ci{
388c2ecf20Sopenharmony_ci	return 0;
398c2ecf20Sopenharmony_ci}
408c2ecf20Sopenharmony_cistatic inline void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr) {}
418c2ecf20Sopenharmony_ci#endif
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#endif /* BRCMFMAC_MSGBUF_H */
44