xdi_adapter.h 2.0 KB

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