lapb.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #define LAPB_OK 0
  8. #define LAPB_BADTOKEN 1
  9. #define LAPB_INVALUE 2
  10. #define LAPB_CONNECTED 3
  11. #define LAPB_NOTCONNECTED 4
  12. #define LAPB_REFUSED 5
  13. #define LAPB_TIMEDOUT 6
  14. #define LAPB_NOMEM 7
  15. #define LAPB_STANDARD 0x00
  16. #define LAPB_EXTENDED 0x01
  17. #define LAPB_SLP 0x00
  18. #define LAPB_MLP 0x02
  19. #define LAPB_DTE 0x00
  20. #define LAPB_DCE 0x04
  21. struct lapb_register_struct {
  22. void (*connect_confirmation)(struct net_device *dev, int reason);
  23. void (*connect_indication)(struct net_device *dev, int reason);
  24. void (*disconnect_confirmation)(struct net_device *dev, int reason);
  25. void (*disconnect_indication)(struct net_device *dev, int reason);
  26. int (*data_indication)(struct net_device *dev, struct sk_buff *skb);
  27. void (*data_transmit)(struct net_device *dev, struct sk_buff *skb);
  28. };
  29. struct lapb_parms_struct {
  30. unsigned int t1;
  31. unsigned int t1timer;
  32. unsigned int t2;
  33. unsigned int t2timer;
  34. unsigned int n2;
  35. unsigned int n2count;
  36. unsigned int window;
  37. unsigned int state;
  38. unsigned int mode;
  39. };
  40. extern int lapb_register(struct net_device *dev,
  41. const struct lapb_register_struct *callbacks);
  42. extern int lapb_unregister(struct net_device *dev);
  43. extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
  44. extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
  45. extern int lapb_connect_request(struct net_device *dev);
  46. extern int lapb_disconnect_request(struct net_device *dev);
  47. extern int lapb_data_request(struct net_device *dev, struct sk_buff *skb);
  48. extern int lapb_data_received(struct net_device *dev, struct sk_buff *skb);
  49. #endif