xdi_adapter.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* $Id: xdi_adapter.h,v 1.7 2004/03/21 17:26:01 armin Exp $ */
  3. #ifndef __DIVA_OS_XDI_ADAPTER_H__
  4. #define __DIVA_OS_XDI_ADAPTER_H__
  5. #define DIVAS_XDI_ADAPTER_BUS_PCI 0
  6. #define DIVAS_XDI_ADAPTER_BUS_ISA 1
  7. typedef struct _divas_pci_card_resources {
  8. byte bus;
  9. byte func;
  10. void *hdev;
  11. dword bar[8]; /* contains context of appropriate BAR Register */
  12. void __iomem *addr[8]; /* same bar, but mapped into memory */
  13. dword length[8]; /* bar length */
  14. int mem_type_id[MAX_MEM_TYPE];
  15. unsigned int qoffset;
  16. byte irq;
  17. } divas_pci_card_resources_t;
  18. typedef union _divas_card_resources {
  19. divas_pci_card_resources_t pci;
  20. } divas_card_resources_t;
  21. struct _diva_os_xdi_adapter;
  22. typedef int (*diva_init_card_proc_t)(struct _diva_os_xdi_adapter *a);
  23. typedef int (*diva_cmd_card_proc_t)(struct _diva_os_xdi_adapter *a,
  24. diva_xdi_um_cfg_cmd_t *data,
  25. int length);
  26. typedef void (*diva_xdi_clear_interrupts_proc_t)(struct
  27. _diva_os_xdi_adapter *);
  28. #define DIVA_XDI_MBOX_BUSY 1
  29. #define DIVA_XDI_MBOX_WAIT_XLOG 2
  30. typedef struct _xdi_mbox_t {
  31. dword status;
  32. diva_xdi_um_cfg_cmd_data_t cmd_data;
  33. dword data_length;
  34. void *data;
  35. } xdi_mbox_t;
  36. typedef struct _diva_os_idi_adapter_interface {
  37. diva_init_card_proc_t cleanup_adapter_proc;
  38. diva_cmd_card_proc_t cmd_proc;
  39. } diva_os_idi_adapter_interface_t;
  40. typedef struct _diva_os_xdi_adapter {
  41. struct list_head link;
  42. int CardIndex;
  43. int CardOrdinal;
  44. int controller; /* number of this controller */
  45. int Bus; /* PCI, ISA, ... */
  46. divas_card_resources_t resources;
  47. char port_name[24];
  48. ISDN_ADAPTER xdi_adapter;
  49. xdi_mbox_t xdi_mbox;
  50. diva_os_idi_adapter_interface_t interface;
  51. struct _diva_os_xdi_adapter *slave_adapters[3];
  52. void *slave_list;
  53. void *proc_adapter_dir; /* adapterX proc entry */
  54. void *proc_info; /* info proc entry */
  55. void *proc_grp_opt; /* group_optimization */
  56. void *proc_d_l1_down; /* dynamic_l1_down */
  57. volatile diva_xdi_clear_interrupts_proc_t clear_interrupts_proc;
  58. dword dsp_mask;
  59. } diva_os_xdi_adapter_t;
  60. #endif