162306a36Sopenharmony_ci// SPDX-License-Identifier: ISC
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (c) 2014 Broadcom Corporation
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci#ifndef BRCMFMAC_MSGBUF_H
662306a36Sopenharmony_ci#define BRCMFMAC_MSGBUF_H
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#ifdef CONFIG_BRCMFMAC_PROTO_MSGBUF
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_MAX_ITEM	64
1162306a36Sopenharmony_ci#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_MAX_ITEM	1024
1262306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_MAX_ITEM	64
1362306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_TX_COMPLETE_MAX_ITEM		1024
1462306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_RX_COMPLETE_MAX_ITEM		1024
1562306a36Sopenharmony_ci#define BRCMF_H2D_TXFLOWRING_MAX_ITEM			512
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define BRCMF_H2D_MSGRING_CONTROL_SUBMIT_ITEMSIZE	40
1862306a36Sopenharmony_ci#define BRCMF_H2D_MSGRING_RXPOST_SUBMIT_ITEMSIZE	32
1962306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_CONTROL_COMPLETE_ITEMSIZE	24
2062306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE_PRE_V7	16
2162306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_TX_COMPLETE_ITEMSIZE		24
2262306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE_PRE_V7	32
2362306a36Sopenharmony_ci#define BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE		40
2462306a36Sopenharmony_ci#define BRCMF_H2D_TXFLOWRING_ITEMSIZE			48
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_cistruct msgbuf_buf_addr {
2762306a36Sopenharmony_ci	__le32		low_addr;
2862306a36Sopenharmony_ci	__le32		high_addr;
2962306a36Sopenharmony_ci};
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciint brcmf_proto_msgbuf_rx_trigger(struct device *dev);
3262306a36Sopenharmony_civoid brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u16 flowid);
3362306a36Sopenharmony_ciint brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr);
3462306a36Sopenharmony_civoid brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr);
3562306a36Sopenharmony_ci#else
3662306a36Sopenharmony_cistatic inline int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
3762306a36Sopenharmony_ci{
3862306a36Sopenharmony_ci	return 0;
3962306a36Sopenharmony_ci}
4062306a36Sopenharmony_cistatic inline void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr) {}
4162306a36Sopenharmony_ci#endif
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#endif /* BRCMFMAC_MSGBUF_H */
44