lapb.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * These are the public elements of the Linux LAPB module.
  4. */
  5. #ifndef LAPB_KERNEL_H
  6. #define LAPB_KERNEL_H
  7. #include <linux/skbuff.h>
  8. #include <linux/timer.h>
  9. struct net_device;
  10. #define LAPB_OK 0
  11. #define LAPB_BADTOKEN 1
  12. #define LAPB_INVALUE 2
  13. #define LAPB_CONNECTED 3
  14. #define LAPB_NOTCONNECTED 4
  15. #define LAPB_REFUSED 5
  16. #define LAPB_TIMEDOUT 6
  17. #define LAPB_NOMEM 7
  18. #define LAPB_STANDARD 0x00
  19. #define LAPB_EXTENDED 0x01
  20. #define LAPB_SLP 0x00
  21. #define LAPB_MLP 0x02
  22. #define LAPB_DTE 0x00
  23. #define LAPB_DCE 0x04
  24. struct lapb_register_struct {
  25. void (*connect_confirmation)(struct net_device *dev, int reason);
  26. void (*connect_indication)(struct net_device *dev, int reason);
  27. void (*disconnect_confirmation)(struct net_device *dev, int reason);
  28. void (*disconnect_indication)(struct net_device *dev, int reason);
  29. int (*data_indication)(struct net_device *dev, struct sk_buff *skb);
  30. void (*data_transmit)(struct net_device *dev, struct sk_buff *skb);
  31. };
  32. struct lapb_parms_struct {
  33. unsigned int t1;
  34. unsigned int t1timer;
  35. unsigned int t2;
  36. unsigned int t2timer;
  37. unsigned int n2;
  38. unsigned int n2count;
  39. unsigned int window;
  40. unsigned int state;
  41. unsigned int mode;
  42. };
  43. extern int lapb_register(struct net_device *dev,
  44. const struct lapb_register_struct *callbacks);
  45. extern int lapb_unregister(struct net_device *dev);
  46. extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
  47. extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
  48. extern int lapb_connect_request(struct net_device *dev);
  49. extern int lapb_disconnect_request(struct net_device *dev);
  50. extern int lapb_data_request(struct net_device *dev, struct sk_buff *skb);
  51. extern int lapb_data_received(struct net_device *dev, struct sk_buff *skb);
  52. #endif