OMAPDSS: VENC: fix NULL pointer dereference in DSS2 VENC sysfs debug attr on OMAP4
[zen-stable.git] / include / linux / concap.h
blob977acb3d1fb2ee81534b5906b3817f90455454ac
1 /* $Id: concap.h,v 1.3.2.2 2004/01/12 23:08:35 keil Exp $
3 * Copyright 1997 by Henner Eisen <eis@baty.hanse.de>
5 * This software may be used and distributed according to the terms
6 * of the GNU General Public License, incorporated herein by reference.
7 */
9 #ifndef _LINUX_CONCAP_H
10 #define _LINUX_CONCAP_H
12 #include <linux/skbuff.h>
13 #include <linux/netdevice.h>
15 /* Stuff to support encapsulation protocols genericly. The encapsulation
16 protocol is processed at the uppermost layer of the network interface.
18 Based on a ideas developed in a 'synchronous device' thread in the
19 linux-x25 mailing list contributed by Alan Cox, Thomasz Motylewski
20 and Jonathan Naylor.
22 For more documetation on this refer to Documentation/isdn/README.concap
25 struct concap_proto_ops;
26 struct concap_device_ops;
28 /* this manages all data needed by the encapsulation protocol
30 struct concap_proto{
31 struct net_device *net_dev; /* net device using our service */
32 struct concap_device_ops *dops; /* callbacks provided by device */
33 struct concap_proto_ops *pops; /* callbacks provided by us */
34 spinlock_t lock;
35 int flags;
36 void *proto_data; /* protocol specific private data, to
37 be accessed via *pops methods only*/
40 whatever
45 /* Operations to be supported by the net device. Called by the encapsulation
46 * protocol entity. No receive method is offered because the encapsulation
47 * protocol directly calls netif_rx().
49 struct concap_device_ops{
51 /* to request data is submitted by device*/
52 int (*data_req)(struct concap_proto *, struct sk_buff *);
54 /* Control methods must be set to NULL by devices which do not
55 support connection control.*/
56 /* to request a connection is set up */
57 int (*connect_req)(struct concap_proto *);
59 /* to request a connection is released */
60 int (*disconn_req)(struct concap_proto *);
63 /* Operations to be supported by the encapsulation protocol. Called by
64 * device driver.
66 struct concap_proto_ops{
68 /* create a new encapsulation protocol instance of same type */
69 struct concap_proto * (*proto_new) (void);
71 /* delete encapsulation protocol instance and free all its resources.
72 cprot may no loger be referenced after calling this */
73 void (*proto_del)(struct concap_proto *cprot);
75 /* initialize the protocol's data. To be called at interface startup
76 or when the device driver resets the interface. All services of the
77 encapsulation protocol may be used after this*/
78 int (*restart)(struct concap_proto *cprot,
79 struct net_device *ndev,
80 struct concap_device_ops *dops);
82 /* inactivate an encapsulation protocol instance. The encapsulation
83 protocol may not call any *dops methods after this. */
84 int (*close)(struct concap_proto *cprot);
86 /* process a frame handed down to us by upper layer */
87 int (*encap_and_xmit)(struct concap_proto *cprot, struct sk_buff *skb);
89 /* to be called for each data entity received from lower layer*/
90 int (*data_ind)(struct concap_proto *cprot, struct sk_buff *skb);
92 /* to be called when a connection was set up/down.
93 Protocols that don't process these primitives might fill in
94 dummy methods here */
95 int (*connect_ind)(struct concap_proto *cprot);
96 int (*disconn_ind)(struct concap_proto *cprot);
98 Some network device support functions, like net_header(), rebuild_header(),
99 and others, that depend solely on the encapsulation protocol, might
100 be provided here, too. The net device would just fill them in its
101 corresponding fields when it is opened.
105 /* dummy restart/close/connect/reset/disconn methods
107 extern int concap_nop(struct concap_proto *cprot);
109 /* dummy submit method
111 extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb);
112 #endif