Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * These are the public elements of the Linux LAPB module.
0004  */
0005 
0006 #ifndef LAPB_KERNEL_H
0007 #define LAPB_KERNEL_H
0008 
0009 #include <linux/skbuff.h>
0010 #include <linux/timer.h>
0011 
0012 struct net_device;
0013 
0014 #define LAPB_OK         0
0015 #define LAPB_BADTOKEN       1
0016 #define LAPB_INVALUE        2
0017 #define LAPB_CONNECTED      3
0018 #define LAPB_NOTCONNECTED   4
0019 #define LAPB_REFUSED        5
0020 #define LAPB_TIMEDOUT       6
0021 #define LAPB_NOMEM      7
0022 
0023 #define LAPB_STANDARD       0x00
0024 #define LAPB_EXTENDED       0x01
0025 
0026 #define LAPB_SLP        0x00
0027 #define LAPB_MLP        0x02
0028 
0029 #define LAPB_DTE        0x00
0030 #define LAPB_DCE        0x04
0031 
0032 struct lapb_register_struct {
0033     void (*connect_confirmation)(struct net_device *dev, int reason);
0034     void (*connect_indication)(struct net_device *dev, int reason);
0035     void (*disconnect_confirmation)(struct net_device *dev, int reason);
0036     void (*disconnect_indication)(struct net_device *dev, int reason);
0037     int  (*data_indication)(struct net_device *dev, struct sk_buff *skb);
0038     void (*data_transmit)(struct net_device *dev, struct sk_buff *skb);
0039 };
0040 
0041 struct lapb_parms_struct {
0042     unsigned int t1;
0043     unsigned int t1timer;
0044     unsigned int t2;
0045     unsigned int t2timer;
0046     unsigned int n2;
0047     unsigned int n2count;
0048     unsigned int window;
0049     unsigned int state;
0050     unsigned int mode;
0051 };
0052 
0053 extern int lapb_register(struct net_device *dev,
0054              const struct lapb_register_struct *callbacks);
0055 extern int lapb_unregister(struct net_device *dev);
0056 extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
0057 extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
0058 extern int lapb_connect_request(struct net_device *dev);
0059 extern int lapb_disconnect_request(struct net_device *dev);
0060 extern int lapb_data_request(struct net_device *dev, struct sk_buff *skb);
0061 extern int lapb_data_received(struct net_device *dev, struct sk_buff *skb);
0062 
0063 #endif