interface.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. *
  3. * Intel Management Engine Interface (Intel MEI) Linux driver
  4. * Copyright (c) 2003-2012, Intel Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. */
  16. #ifndef _MEI_INTERFACE_H_
  17. #define _MEI_INTERFACE_H_
  18. #include <linux/mei.h>
  19. #include "mei_dev.h"
  20. void mei_read_slots(struct mei_device *dev,
  21. unsigned char *buffer,
  22. unsigned long buffer_length);
  23. int mei_write_message(struct mei_device *dev,
  24. struct mei_msg_hdr *header,
  25. unsigned char *buf);
  26. bool mei_hbuf_is_empty(struct mei_device *dev);
  27. int mei_hbuf_empty_slots(struct mei_device *dev);
  28. static inline size_t mei_hbuf_max_data(const struct mei_device *dev)
  29. {
  30. return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr);
  31. }
  32. /* get slots (dwords) from a message length + header (bytes) */
  33. static inline unsigned char mei_data2slots(size_t length)
  34. {
  35. return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4);
  36. }
  37. int mei_count_full_read_slots(struct mei_device *dev);
  38. int mei_flow_ctrl_creds(struct mei_device *dev, struct mei_cl *cl);
  39. int mei_wd_send(struct mei_device *dev);
  40. int mei_wd_stop(struct mei_device *dev);
  41. int mei_wd_host_init(struct mei_device *dev);
  42. /*
  43. * mei_watchdog_register - Registering watchdog interface
  44. * once we got connection to the WD Client
  45. * @dev - mei device
  46. */
  47. void mei_watchdog_register(struct mei_device *dev);
  48. /*
  49. * mei_watchdog_unregister - Unregistering watchdog interface
  50. * @dev - mei device
  51. */
  52. void mei_watchdog_unregister(struct mei_device *dev);
  53. int mei_other_client_is_connecting(struct mei_device *dev, struct mei_cl *cl);
  54. int mei_flow_ctrl_reduce(struct mei_device *dev, struct mei_cl *cl);
  55. void mei_hbm_start_req(struct mei_device *dev);
  56. int mei_hbm_cl_flow_control_req(struct mei_device *dev, struct mei_cl *cl);
  57. int mei_hbm_cl_disconnect_req(struct mei_device *dev, struct mei_cl *cl);
  58. int mei_hbm_cl_connect_req(struct mei_device *dev, struct mei_cl *cl);
  59. void mei_host_client_init(struct work_struct *work);
  60. #endif /* _MEI_INTERFACE_H_ */