hisax_fcpcipnp.h 994 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "hisax_if.h"
  2. #include "hisax_isac.h"
  3. #include <linux/pci.h>
  4. #define HSCX_BUFMAX 4096
  5. enum {
  6. AVM_FRITZ_PCI,
  7. AVM_FRITZ_PNP,
  8. AVM_FRITZ_PCIV2,
  9. };
  10. struct hdlc_stat_reg {
  11. #ifdef __BIG_ENDIAN
  12. u_char fill;
  13. u_char mode;
  14. u_char xml;
  15. u_char cmd;
  16. #else
  17. u_char cmd;
  18. u_char xml;
  19. u_char mode;
  20. u_char fill;
  21. #endif
  22. } __attribute__((packed));
  23. struct fritz_bcs {
  24. struct hisax_b_if b_if;
  25. struct fritz_adapter *adapter;
  26. int mode;
  27. int channel;
  28. union {
  29. u_int ctrl;
  30. struct hdlc_stat_reg sr;
  31. } ctrl;
  32. u_int stat;
  33. int rcvidx;
  34. int fifo_size;
  35. u_char rcvbuf[HSCX_BUFMAX]; /* B-Channel receive Buffer */
  36. int tx_cnt; /* B-Channel transmit counter */
  37. struct sk_buff *tx_skb; /* B-Channel transmit Buffer */
  38. };
  39. struct fritz_adapter {
  40. int type;
  41. spinlock_t hw_lock;
  42. unsigned int io;
  43. unsigned int irq;
  44. struct isac isac;
  45. struct fritz_bcs bcs[2];
  46. u32 (*read_hdlc_status) (struct fritz_adapter *adapter, int nr);
  47. void (*write_ctrl) (struct fritz_bcs *bcs, int which);
  48. };