iorpc_usb_host.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * Copyright 2012 Tilera Corporation. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation, version 2.
  7. *
  8. * This program is distributed in the hope that it will be useful, but
  9. * WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  11. * NON INFRINGEMENT. See the GNU General Public License for
  12. * more details.
  13. */
  14. /* This file is machine-generated; DO NOT EDIT! */
  15. #include "gxio/iorpc_usb_host.h"
  16. struct cfg_interrupt_param {
  17. union iorpc_interrupt interrupt;
  18. };
  19. int gxio_usb_host_cfg_interrupt(gxio_usb_host_context_t *context, int inter_x,
  20. int inter_y, int inter_ipi, int inter_event)
  21. {
  22. struct cfg_interrupt_param temp;
  23. struct cfg_interrupt_param *params = &temp;
  24. params->interrupt.kernel.x = inter_x;
  25. params->interrupt.kernel.y = inter_y;
  26. params->interrupt.kernel.ipi = inter_ipi;
  27. params->interrupt.kernel.event = inter_event;
  28. return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  29. sizeof(*params), GXIO_USB_HOST_OP_CFG_INTERRUPT);
  30. }
  31. EXPORT_SYMBOL(gxio_usb_host_cfg_interrupt);
  32. struct register_client_memory_param {
  33. HV_PTE pte;
  34. unsigned int flags;
  35. };
  36. int gxio_usb_host_register_client_memory(gxio_usb_host_context_t *context,
  37. HV_PTE pte, unsigned int flags)
  38. {
  39. struct register_client_memory_param temp;
  40. struct register_client_memory_param *params = &temp;
  41. params->pte = pte;
  42. params->flags = flags;
  43. return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  44. sizeof(*params),
  45. GXIO_USB_HOST_OP_REGISTER_CLIENT_MEMORY);
  46. }
  47. EXPORT_SYMBOL(gxio_usb_host_register_client_memory);
  48. struct get_mmio_base_param {
  49. HV_PTE base;
  50. };
  51. int gxio_usb_host_get_mmio_base(gxio_usb_host_context_t *context, HV_PTE *base)
  52. {
  53. int __result;
  54. struct get_mmio_base_param temp;
  55. struct get_mmio_base_param *params = &temp;
  56. __result =
  57. hv_dev_pread(context->fd, 0, (HV_VirtAddr) params, sizeof(*params),
  58. GXIO_USB_HOST_OP_GET_MMIO_BASE);
  59. *base = params->base;
  60. return __result;
  61. }
  62. EXPORT_SYMBOL(gxio_usb_host_get_mmio_base);
  63. struct check_mmio_offset_param {
  64. unsigned long offset;
  65. unsigned long size;
  66. };
  67. int gxio_usb_host_check_mmio_offset(gxio_usb_host_context_t *context,
  68. unsigned long offset, unsigned long size)
  69. {
  70. struct check_mmio_offset_param temp;
  71. struct check_mmio_offset_param *params = &temp;
  72. params->offset = offset;
  73. params->size = size;
  74. return hv_dev_pwrite(context->fd, 0, (HV_VirtAddr) params,
  75. sizeof(*params),
  76. GXIO_USB_HOST_OP_CHECK_MMIO_OFFSET);
  77. }
  78. EXPORT_SYMBOL(gxio_usb_host_check_mmio_offset);