card.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* $Id: card.h,v 1.1.10.1 2001/09/23 22:24:59 kai Exp $
  2. *
  3. * Driver parameters for SpellCaster ISA ISDN adapters
  4. *
  5. * Copyright (C) 1996 SpellCaster Telecommunications Inc.
  6. *
  7. * This software may be used and distributed according to the terms
  8. * of the GNU General Public License, incorporated herein by reference.
  9. *
  10. * For more information, please contact gpl-info@spellcast.com or write:
  11. *
  12. * SpellCaster Telecommunications Inc.
  13. * 5621 Finch Avenue East, Unit #3
  14. * Scarborough, Ontario Canada
  15. * M1B 2T9
  16. * +1 (416) 297-8565
  17. * +1 (416) 297-6433 Facsimile
  18. */
  19. #ifndef CARD_H
  20. #define CARD_H
  21. /*
  22. * We need these if they're not already included
  23. */
  24. #include <linux/timer.h>
  25. #include <linux/time.h>
  26. #include <linux/isdnif.h>
  27. #include "message.h"
  28. /*
  29. * Amount of time to wait for a reset to complete
  30. */
  31. #define CHECKRESET_TIME msecs_to_jiffies(4000)
  32. /*
  33. * Amount of time between line status checks
  34. */
  35. #define CHECKSTAT_TIME msecs_to_jiffies(8000)
  36. /*
  37. * The maximum amount of time to wait for a message response
  38. * to arrive. Use exclusively by send_and_receive
  39. */
  40. #define SAR_TIMEOUT msecs_to_jiffies(10000)
  41. /*
  42. * Macro to determine is a card id is valid
  43. */
  44. #define IS_VALID_CARD(x) ((x >= 0) && (x <= cinst))
  45. /*
  46. * Per channel status and configuration
  47. */
  48. typedef struct {
  49. int l2_proto;
  50. int l3_proto;
  51. char dn[50];
  52. unsigned long first_sendbuf; /* Offset of first send buffer */
  53. unsigned int num_sendbufs; /* Number of send buffers */
  54. unsigned int free_sendbufs; /* Number of free sendbufs */
  55. unsigned int next_sendbuf; /* Next sequential buffer */
  56. char eazlist[50]; /* Set with SETEAZ */
  57. char sillist[50]; /* Set with SETSIL */
  58. int eazclear; /* Don't accept calls if TRUE */
  59. } bchan;
  60. /*
  61. * Everything you want to know about the adapter ...
  62. */
  63. typedef struct {
  64. int model;
  65. int driverId; /* LL Id */
  66. char devicename[20]; /* The device name */
  67. isdn_if *card; /* ISDN4Linux structure */
  68. bchan *channel; /* status of the B channels */
  69. char nChannels; /* Number of channels */
  70. unsigned int interrupt; /* Interrupt number */
  71. int iobase; /* I/O Base address */
  72. int ioport[MAX_IO_REGS]; /* Index to I/O ports */
  73. int shmem_pgport; /* port for the exp mem page reg. */
  74. int shmem_magic; /* adapter magic number */
  75. unsigned int rambase; /* Shared RAM base address */
  76. unsigned int ramsize; /* Size of shared memory */
  77. RspMessage async_msg; /* Async response message */
  78. int want_async_messages; /* Snoop the Q ? */
  79. unsigned char seq_no; /* Next send seq. number */
  80. struct timer_list reset_timer; /* Check reset timer */
  81. struct timer_list stat_timer; /* Check startproc timer */
  82. unsigned char nphystat; /* Latest PhyStat info */
  83. unsigned char phystat; /* Last PhyStat info */
  84. HWConfig_pl hwconfig; /* Hardware config info */
  85. char load_ver[11]; /* CommManage Version string */
  86. char proc_ver[11]; /* CommEngine Version */
  87. int StartOnReset; /* Indicates startproc after reset */
  88. int EngineUp; /* Indicates CommEngine Up */
  89. int trace_mode; /* Indicate if tracing is on */
  90. spinlock_t lock; /* local lock */
  91. } board;
  92. #endif /* CARD_H */