hisax_if.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Interface between low level (hardware) drivers and
  3. * HiSax protocol stack
  4. *
  5. * Author Kai Germaschewski
  6. * Copyright 2001 by Kai Germaschewski <kai.germaschewski@gmx.de>
  7. *
  8. * This software may be used and distributed according to the terms
  9. * of the GNU General Public License, incorporated herein by reference.
  10. *
  11. */
  12. #ifndef __HISAX_IF_H__
  13. #define __HISAX_IF_H__
  14. #include <linux/skbuff.h>
  15. #define REQUEST 0
  16. #define CONFIRM 1
  17. #define INDICATION 2
  18. #define RESPONSE 3
  19. #define PH_ACTIVATE 0x0100
  20. #define PH_DEACTIVATE 0x0110
  21. #define PH_DATA 0x0120
  22. #define PH_PULL 0x0130
  23. #define PH_DATA_E 0x0140
  24. #define L1_MODE_NULL 0
  25. #define L1_MODE_TRANS 1
  26. #define L1_MODE_HDLC 2
  27. #define L1_MODE_EXTRN 3
  28. #define L1_MODE_HDLC_56K 4
  29. #define L1_MODE_MODEM 7
  30. #define L1_MODE_V32 8
  31. #define L1_MODE_FAX 9
  32. struct hisax_if {
  33. void *priv; // private to driver
  34. void (*l1l2)(struct hisax_if *, int pr, void *arg);
  35. void (*l2l1)(struct hisax_if *, int pr, void *arg);
  36. };
  37. struct hisax_b_if {
  38. struct hisax_if ifc;
  39. // private to hisax
  40. struct BCState *bcs;
  41. };
  42. struct hisax_d_if {
  43. struct hisax_if ifc;
  44. // private to hisax
  45. struct module *owner;
  46. struct IsdnCardState *cs;
  47. struct hisax_b_if *b_if[2];
  48. struct sk_buff_head erq;
  49. unsigned long ph_state;
  50. };
  51. int hisax_register(struct hisax_d_if *hisax_if, struct hisax_b_if *b_if[],
  52. char *name, int protocol);
  53. void hisax_unregister(struct hisax_d_if *hisax_if);
  54. #endif