xref: /openbmc/linux/drivers/misc/mei/hbm.h (revision 9b0d5efc421ac79d9a6d97c681eff93288093784)
10edb23fcSTomas Winkler /*
20edb23fcSTomas Winkler  *
30edb23fcSTomas Winkler  * Intel Management Engine Interface (Intel MEI) Linux driver
40edb23fcSTomas Winkler  * Copyright (c) 2003-2012, Intel Corporation.
50edb23fcSTomas Winkler  *
60edb23fcSTomas Winkler  * This program is free software; you can redistribute it and/or modify it
70edb23fcSTomas Winkler  * under the terms and conditions of the GNU General Public License,
80edb23fcSTomas Winkler  * version 2, as published by the Free Software Foundation.
90edb23fcSTomas Winkler  *
100edb23fcSTomas Winkler  * This program is distributed in the hope it will be useful, but WITHOUT
110edb23fcSTomas Winkler  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
120edb23fcSTomas Winkler  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
130edb23fcSTomas Winkler  * more details.
140edb23fcSTomas Winkler  *
150edb23fcSTomas Winkler  */
160edb23fcSTomas Winkler 
170edb23fcSTomas Winkler #ifndef _MEI_HBM_H_
180edb23fcSTomas Winkler #define _MEI_HBM_H_
190edb23fcSTomas Winkler 
20*9b0d5efcSTomas Winkler struct mei_device;
21*9b0d5efcSTomas Winkler struct mei_msg_hdr;
22*9b0d5efcSTomas Winkler struct mei_cl;
23*9b0d5efcSTomas Winkler 
24*9b0d5efcSTomas Winkler /**
25*9b0d5efcSTomas Winkler  * enum mei_hbm_state - host bus message protocol state
26*9b0d5efcSTomas Winkler  *
27*9b0d5efcSTomas Winkler  * @MEI_HBM_IDLE : protocol not started
28*9b0d5efcSTomas Winkler  * @MEI_HBM_START : start request message was sent
29*9b0d5efcSTomas Winkler  * @MEI_HBM_ENUM_CLIENTS : enumeration request was sent
30*9b0d5efcSTomas Winkler  * @MEI_HBM_CLIENT_PROPERTIES : acquiring clients properties
31*9b0d5efcSTomas Winkler  */
32*9b0d5efcSTomas Winkler enum mei_hbm_state {
33*9b0d5efcSTomas Winkler 	MEI_HBM_IDLE = 0,
34*9b0d5efcSTomas Winkler 	MEI_HBM_START,
35*9b0d5efcSTomas Winkler 	MEI_HBM_ENUM_CLIENTS,
36*9b0d5efcSTomas Winkler 	MEI_HBM_CLIENT_PROPERTIES,
37*9b0d5efcSTomas Winkler 	MEI_HBM_STARTED,
38*9b0d5efcSTomas Winkler 	MEI_HBM_STOP,
39*9b0d5efcSTomas Winkler };
40*9b0d5efcSTomas Winkler 
410edb23fcSTomas Winkler void mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr);
420edb23fcSTomas Winkler 
430edb23fcSTomas Winkler static inline void mei_hbm_hdr(struct mei_msg_hdr *hdr, size_t length)
440edb23fcSTomas Winkler {
450edb23fcSTomas Winkler 	hdr->host_addr = 0;
460edb23fcSTomas Winkler 	hdr->me_addr = 0;
470edb23fcSTomas Winkler 	hdr->length = length;
480edb23fcSTomas Winkler 	hdr->msg_complete = 1;
490edb23fcSTomas Winkler 	hdr->reserved = 0;
500edb23fcSTomas Winkler }
510edb23fcSTomas Winkler 
52*9b0d5efcSTomas Winkler int mei_hbm_start_req(struct mei_device *dev);
53*9b0d5efcSTomas Winkler int mei_hbm_start_wait(struct mei_device *dev);
540edb23fcSTomas Winkler int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl);
550edb23fcSTomas Winkler int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl);
560edb23fcSTomas Winkler int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl);
570edb23fcSTomas Winkler 
580edb23fcSTomas Winkler 
590edb23fcSTomas Winkler #endif /* _MEI_HBM_H_ */
600edb23fcSTomas Winkler 
61