You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_H_
  2. #define STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_H_
  3. /*
  4. * Copyright (C) 2015 Mellanox Technologies Ltd.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of the
  9. * License, or any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301, USA.
  20. */
  21. FILE_LICENCE ( GPL2_OR_LATER );
  22. #include "mlx_utils.h"
  23. typedef enum {
  24. MlxPciWidthUint8 = 0,
  25. MlxPciWidthUint16,
  26. MlxPciWidthUint32,
  27. MlxPciWidthUint64,
  28. } mlx_pci_width;
  29. mlx_status
  30. mlx_pci_init(
  31. IN mlx_utils *utils
  32. );
  33. mlx_status
  34. mlx_pci_read(
  35. IN mlx_utils *utils,
  36. IN mlx_pci_width width,
  37. IN mlx_uint32 offset,
  38. IN mlx_uintn count,
  39. OUT mlx_void *buffer
  40. );
  41. mlx_status
  42. mlx_pci_write(
  43. IN mlx_utils *utils,
  44. IN mlx_pci_width width,
  45. IN mlx_uint32 offset,
  46. IN mlx_uintn count,
  47. IN mlx_void *buffer
  48. );
  49. mlx_status
  50. mlx_pci_mem_read(
  51. IN mlx_utils *utils,
  52. IN mlx_pci_width width,
  53. IN mlx_uint8 bar_index,
  54. IN mlx_uint64 offset,
  55. IN mlx_uintn count,
  56. OUT mlx_void *buffer
  57. );
  58. mlx_status
  59. mlx_pci_mem_write(
  60. IN mlx_utils *utils,
  61. IN mlx_pci_width width,
  62. IN mlx_uint8 bar_index,
  63. IN mlx_uint64 offset,
  64. IN mlx_uintn count,
  65. IN mlx_void *buffer
  66. );
  67. #endif /* STUB_MLXUTILS_INCLUDE_PUBLIC_PCI_H_ */