hisax_fcpcipnp.h 1.0 KB

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