mm: Don't pin ZERO_PAGE in pin_user_pages()
[linux-block.git] / include / media / dvb_net.h
CommitLineData
1da177e4
LT
1/*
2 * dvb_net.h
3 *
4 * Copyright (C) 2001 Ralph Metzler for convergence integrated media GmbH
5 *
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.
10 *
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.
15 *
1da177e4
LT
16 */
17
18#ifndef _DVB_NET_H_
19#define _DVB_NET_H_
20
21#include <linux/module.h>
1da177e4 22
fada1935 23#include <media/dvbdev.h>
1da177e4 24
de163422
JK
25struct net_device;
26
1da177e4
LT
27#define DVB_NET_DEVICES_MAX 10
28
a34ff6cd
HPS
29#ifdef CONFIG_DVB_NET
30
b5b03a20
MCC
31/**
32 * struct dvb_net - describes a DVB network interface
33 *
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 *
43 * Currently, the core supports up to %DVB_NET_DEVICES_MAX (10) network
44 * devices.
45 */
46
1da177e4
LT
47struct dvb_net {
48 struct dvb_device *dvbdev;
49 struct net_device *device[DVB_NET_DEVICES_MAX];
50 int state[DVB_NET_DEVICES_MAX];
2c4d3364 51 unsigned int exit:1;
1da177e4 52 struct dmx_demux *demux;
30ad64b8 53 struct mutex ioctl_mutex;
1da177e4
LT
54};
55
b5b03a20
MCC
56/**
57 * dvb_net_init - nitializes a digital TV network device and registers it.
58 *
59 * @adap: pointer to &struct dvb_adapter.
60 * @dvbnet: pointer to &struct dvb_net.
61 * @dmxdemux: pointer to &struct dmx_demux.
62 */
63int dvb_net_init(struct dvb_adapter *adap, struct dvb_net *dvbnet,
64 struct dmx_demux *dmxdemux);
65
66/**
67 * dvb_net_release - releases a digital TV network device and unregisters it.
68 *
69 * @dvbnet: pointer to &struct dvb_net.
70 */
71void dvb_net_release(struct dvb_net *dvbnet);
1da177e4 72
fcc8e7d8 73#else
a34ff6cd
HPS
74
75struct dvb_net {
fcc8e7d8 76 struct dvb_device *dvbdev;
a34ff6cd
HPS
77};
78
79static inline void dvb_net_release(struct dvb_net *dvbnet)
80{
a34ff6cd
HPS
81}
82
83static inline int dvb_net_init(struct dvb_adapter *adap,
84 struct dvb_net *dvbnet, struct dmx_demux *dmx)
85{
a34ff6cd
HPS
86 return 0;
87}
88
fcc8e7d8 89#endif /* ifdef CONFIG_DVB_NET */
a34ff6cd
HPS
90
91#endif