162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Linux network driver for QLogic BR-series Converged Network Adapter.
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
762306a36Sopenharmony_ci * Copyright (c) 2014-2015 QLogic Corporation
862306a36Sopenharmony_ci * All rights reserved
962306a36Sopenharmony_ci * www.qlogic.com
1062306a36Sopenharmony_ci */
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#ifndef __BFA_CEE_H__
1362306a36Sopenharmony_ci#define __BFA_CEE_H__
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include "bfa_defs_cna.h"
1662306a36Sopenharmony_ci#include "bfa_ioc.h"
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_citypedef void (*bfa_cee_get_attr_cbfn_t) (void *dev, enum bfa_status status);
1962306a36Sopenharmony_citypedef void (*bfa_cee_get_stats_cbfn_t) (void *dev, enum bfa_status status);
2062306a36Sopenharmony_citypedef void (*bfa_cee_reset_stats_cbfn_t) (void *dev, enum bfa_status status);
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_cistruct bfa_cee_cbfn {
2362306a36Sopenharmony_ci	bfa_cee_get_attr_cbfn_t    get_attr_cbfn;
2462306a36Sopenharmony_ci	void *get_attr_cbarg;
2562306a36Sopenharmony_ci	bfa_cee_get_stats_cbfn_t   get_stats_cbfn;
2662306a36Sopenharmony_ci	void *get_stats_cbarg;
2762306a36Sopenharmony_ci	bfa_cee_reset_stats_cbfn_t reset_stats_cbfn;
2862306a36Sopenharmony_ci	void *reset_stats_cbarg;
2962306a36Sopenharmony_ci};
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_cistruct bfa_cee {
3262306a36Sopenharmony_ci	void *dev;
3362306a36Sopenharmony_ci	bool get_attr_pending;
3462306a36Sopenharmony_ci	bool get_stats_pending;
3562306a36Sopenharmony_ci	bool reset_stats_pending;
3662306a36Sopenharmony_ci	enum bfa_status get_attr_status;
3762306a36Sopenharmony_ci	enum bfa_status get_stats_status;
3862306a36Sopenharmony_ci	enum bfa_status reset_stats_status;
3962306a36Sopenharmony_ci	struct bfa_cee_cbfn cbfn;
4062306a36Sopenharmony_ci	struct bfa_ioc_notify ioc_notify;
4162306a36Sopenharmony_ci	struct bfa_cee_attr *attr;
4262306a36Sopenharmony_ci	struct bfa_cee_stats *stats;
4362306a36Sopenharmony_ci	struct bfa_dma attr_dma;
4462306a36Sopenharmony_ci	struct bfa_dma stats_dma;
4562306a36Sopenharmony_ci	struct bfa_ioc *ioc;
4662306a36Sopenharmony_ci	struct bfa_mbox_cmd get_cfg_mb;
4762306a36Sopenharmony_ci	struct bfa_mbox_cmd get_stats_mb;
4862306a36Sopenharmony_ci	struct bfa_mbox_cmd reset_stats_mb;
4962306a36Sopenharmony_ci};
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ciu32 bfa_nw_cee_meminfo(void);
5262306a36Sopenharmony_civoid bfa_nw_cee_mem_claim(struct bfa_cee *cee, u8 *dma_kva,
5362306a36Sopenharmony_ci	u64 dma_pa);
5462306a36Sopenharmony_civoid bfa_nw_cee_attach(struct bfa_cee *cee, struct bfa_ioc *ioc, void *dev);
5562306a36Sopenharmony_cienum bfa_status bfa_nw_cee_get_attr(struct bfa_cee *cee,
5662306a36Sopenharmony_ci				struct bfa_cee_attr *attr,
5762306a36Sopenharmony_ci				bfa_cee_get_attr_cbfn_t cbfn, void *cbarg);
5862306a36Sopenharmony_ci#endif /* __BFA_CEE_H__ */
59