Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / media / dvb_net.h
blob4a921ea96091c1cfa169925a71913f3ae6c91458
1 /*
2 * dvb_net.h
4 * Copyright (C) 2001 Ralph Metzler for convergence integrated media GmbH
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #ifndef _DVB_NET_H_
19 #define _DVB_NET_H_
21 #include <linux/module.h>
23 #include <media/dvbdev.h>
25 struct net_device;
27 #define DVB_NET_DEVICES_MAX 10
29 #ifdef CONFIG_DVB_NET
31 /**
32 * struct dvb_net - describes a DVB network interface
34 * @dvbdev: pointer to &struct dvb_device.
35 * @device: array of pointers to &struct net_device.
36 * @state: array of integers to each net device. A value
37 * different than zero means that the interface is
38 * in usage.
39 * @exit: flag to indicate when the device is being removed.
40 * @demux: pointer to &struct dmx_demux.
41 * @ioctl_mutex: protect access to this struct.
42 * @remove_mutex: mutex that avoids a race condition between a callback
43 * called when the hardware is disconnected and the
44 * file_operations of dvb_net.
46 * Currently, the core supports up to %DVB_NET_DEVICES_MAX (10) network
47 * devices.
50 struct dvb_net {
51 struct dvb_device *dvbdev;
52 struct net_device *device[DVB_NET_DEVICES_MAX];
53 int state[DVB_NET_DEVICES_MAX];
54 unsigned int exit:1;
55 struct dmx_demux *demux;
56 struct mutex ioctl_mutex;
57 struct mutex remove_mutex;
60 /**
61 * dvb_net_init - nitializes a digital TV network device and registers it.
63 * @adap: pointer to &struct dvb_adapter.
64 * @dvbnet: pointer to &struct dvb_net.
65 * @dmxdemux: pointer to &struct dmx_demux.
67 int dvb_net_init(struct dvb_adapter *adap, struct dvb_net *dvbnet,
68 struct dmx_demux *dmxdemux);
70 /**
71 * dvb_net_release - releases a digital TV network device and unregisters it.
73 * @dvbnet: pointer to &struct dvb_net.
75 void dvb_net_release(struct dvb_net *dvbnet);
77 #else
79 struct dvb_net {
80 struct dvb_device *dvbdev;
83 static inline void dvb_net_release(struct dvb_net *dvbnet)
87 static inline int dvb_net_init(struct dvb_adapter *adap,
88 struct dvb_net *dvbnet, struct dmx_demux *dmx)
90 return 0;
93 #endif /* ifdef CONFIG_DVB_NET */
95 #endif