wcd-dsp-glink.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _WCD_DSP_GLINK_H
  2. #define _WCD_DSP_GLINK_H
  3. #include <linux/types.h>
  4. #define WDSP_CH_NAME_MAX_LEN 50
  5. enum {
  6. WDSP_REG_PKT = 1,
  7. WDSP_CMD_PKT,
  8. WDSP_READY_PKT,
  9. };
  10. #define WDSP_READY_PKT WDSP_READY_PKT
  11. /*
  12. * struct wdsp_reg_pkt - Glink channel information structure format
  13. * @no_of_channels: Number of glink channels to open
  14. * @payload[0]: Dynamic array contains all the glink channels information
  15. */
  16. struct wdsp_reg_pkt {
  17. __u8 no_of_channels;
  18. __u8 payload[0];
  19. };
  20. /*
  21. * struct wdsp_cmd_pkt - WDSP command packet format
  22. * @ch_name: Name of the glink channel
  23. * @payload_size: Size of the payload
  24. * @payload[0]: Actual data payload
  25. */
  26. struct wdsp_cmd_pkt {
  27. char ch_name[WDSP_CH_NAME_MAX_LEN];
  28. __u32 payload_size;
  29. __u8 payload[0];
  30. };
  31. /*
  32. * struct wdsp_write_pkt - Format that userspace send the data to driver.
  33. * @pkt_type: Type of the packet(REG or CMD PKT)
  34. * @payload[0]: Payload is either cmd or reg pkt structure based on pkt type
  35. */
  36. struct wdsp_write_pkt {
  37. __u8 pkt_type;
  38. __u8 payload[0];
  39. };
  40. /*
  41. * struct wdsp_glink_ch_cfg - Defines the glink channel configuration.
  42. * @ch_name: Name of the glink channel
  43. * @latency_in_us: Latency specified in micro seconds for QOS
  44. * @no_of_intents: Number of intents prequeued
  45. * @intents_size[0]: Dynamic array to specify size of each intent
  46. */
  47. struct wdsp_glink_ch_cfg {
  48. char name[WDSP_CH_NAME_MAX_LEN];
  49. __u32 latency_in_us;
  50. __u32 no_of_intents;
  51. __u32 intents_size[0];
  52. };
  53. #endif /* _WCD_DSP_GLINK_H */