162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (c) 2003-2018, Intel Corporation. All rights reserved.
462306a36Sopenharmony_ci * Intel Management Engine Interface (Intel MEI) Linux driver
562306a36Sopenharmony_ci */
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#ifndef _MEI_HBM_H_
862306a36Sopenharmony_ci#define _MEI_HBM_H_
962306a36Sopenharmony_ci
1062306a36Sopenharmony_cistruct mei_device;
1162306a36Sopenharmony_cistruct mei_msg_hdr;
1262306a36Sopenharmony_cistruct mei_cl;
1362306a36Sopenharmony_cistruct mei_dma_data;
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/**
1662306a36Sopenharmony_ci * enum mei_hbm_state - host bus message protocol state
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci * @MEI_HBM_IDLE : protocol not started
1962306a36Sopenharmony_ci * @MEI_HBM_STARTING : start request message was sent
2062306a36Sopenharmony_ci * @MEI_HBM_CAP_SETUP : capabilities request message was sent
2162306a36Sopenharmony_ci * @MEI_HBM_DR_SETUP : dma ring setup request message was sent
2262306a36Sopenharmony_ci * @MEI_HBM_ENUM_CLIENTS : enumeration request was sent
2362306a36Sopenharmony_ci * @MEI_HBM_CLIENT_PROPERTIES : acquiring clients properties
2462306a36Sopenharmony_ci * @MEI_HBM_STARTED : enumeration was completed
2562306a36Sopenharmony_ci * @MEI_HBM_STOPPED : stopping exchange
2662306a36Sopenharmony_ci */
2762306a36Sopenharmony_cienum mei_hbm_state {
2862306a36Sopenharmony_ci	MEI_HBM_IDLE = 0,
2962306a36Sopenharmony_ci	MEI_HBM_STARTING,
3062306a36Sopenharmony_ci	MEI_HBM_CAP_SETUP,
3162306a36Sopenharmony_ci	MEI_HBM_DR_SETUP,
3262306a36Sopenharmony_ci	MEI_HBM_ENUM_CLIENTS,
3362306a36Sopenharmony_ci	MEI_HBM_CLIENT_PROPERTIES,
3462306a36Sopenharmony_ci	MEI_HBM_STARTED,
3562306a36Sopenharmony_ci	MEI_HBM_STOPPED,
3662306a36Sopenharmony_ci};
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ciconst char *mei_hbm_state_str(enum mei_hbm_state state);
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciint mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr);
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_civoid mei_hbm_idle(struct mei_device *dev);
4362306a36Sopenharmony_civoid mei_hbm_reset(struct mei_device *dev);
4462306a36Sopenharmony_ciint mei_hbm_start_req(struct mei_device *dev);
4562306a36Sopenharmony_ciint mei_hbm_start_wait(struct mei_device *dev);
4662306a36Sopenharmony_ciint mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl);
4762306a36Sopenharmony_ciint mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl);
4862306a36Sopenharmony_ciint mei_hbm_cl_disconnect_rsp(struct mei_device *dev, struct mei_cl *cl);
4962306a36Sopenharmony_ciint mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl);
5062306a36Sopenharmony_cibool mei_hbm_version_is_supported(struct mei_device *dev);
5162306a36Sopenharmony_ciint mei_hbm_pg(struct mei_device *dev, u8 pg_cmd);
5262306a36Sopenharmony_civoid mei_hbm_pg_resume(struct mei_device *dev);
5362306a36Sopenharmony_ciint mei_hbm_cl_notify_req(struct mei_device *dev,
5462306a36Sopenharmony_ci			  struct mei_cl *cl, u8 request);
5562306a36Sopenharmony_ciint mei_hbm_cl_dma_map_req(struct mei_device *dev, struct mei_cl *cl);
5662306a36Sopenharmony_ciint mei_hbm_cl_dma_unmap_req(struct mei_device *dev, struct mei_cl *cl);
5762306a36Sopenharmony_ci#endif /* _MEI_HBM_H_ */
5862306a36Sopenharmony_ci
59