diva_dma.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. *
  3. Copyright (c) Eicon Networks, 2002.
  4. *
  5. This source file is supplied for the use with
  6. Eicon Networks range of DIVA Server Adapters.
  7. *
  8. Eicon File Revision : 2.1
  9. *
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14. *
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  17. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. See the GNU General Public License for more details.
  19. *
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. #ifndef __DIVA_DMA_MAPPING_IFC_H__
  26. #define __DIVA_DMA_MAPPING_IFC_H__
  27. typedef struct _diva_dma_map_entry diva_dma_map_entry_t;
  28. struct _diva_dma_map_entry *diva_alloc_dma_map(void *os_context, int nentries);
  29. void diva_init_dma_map_entry(struct _diva_dma_map_entry *pmap,
  30. int nr, void *virt, dword phys,
  31. void *addr_handle);
  32. int diva_alloc_dma_map_entry(struct _diva_dma_map_entry *pmap);
  33. void diva_free_dma_map_entry(struct _diva_dma_map_entry *pmap, int entry);
  34. void diva_get_dma_map_entry(struct _diva_dma_map_entry *pmap, int nr,
  35. void **pvirt, dword *pphys);
  36. void diva_free_dma_mapping(struct _diva_dma_map_entry *pmap);
  37. /*
  38. Functionality to be implemented by OS wrapper
  39. and running in process context
  40. */
  41. void diva_init_dma_map(void *hdev,
  42. struct _diva_dma_map_entry **ppmap,
  43. int nentries);
  44. void diva_free_dma_map(void *hdev,
  45. struct _diva_dma_map_entry *pmap);
  46. void *diva_get_entry_handle(struct _diva_dma_map_entry *pmap, int nr);
  47. #endif