^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * dvb_net.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2001 Ralph Metzler for convergence integrated media GmbH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * This program is free software; you can redistribute it and/or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * modify it under the terms of the GNU Lesser General Public License
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * as published by the Free Software Foundation; either version 2.1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * of the License, or (at your option) any later version.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * This program is distributed in the hope that it will be useful,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * but WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * GNU General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #ifndef _DVB_NET_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define _DVB_NET_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <linux/netdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/inetdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #include <linux/etherdevice.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <media/dvbdev.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define DVB_NET_DEVICES_MAX 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #ifdef CONFIG_DVB_NET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * struct dvb_net - describes a DVB network interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * @dvbdev: pointer to &struct dvb_device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * @device: array of pointers to &struct net_device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * @state: array of integers to each net device. A value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * different than zero means that the interface is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * in usage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) * @exit: flag to indicate when the device is being removed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * @demux: pointer to &struct dmx_demux.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * @ioctl_mutex: protect access to this struct.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * Currently, the core supports up to %DVB_NET_DEVICES_MAX (10) network
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct dvb_net {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct dvb_device *dvbdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) struct net_device *device[DVB_NET_DEVICES_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) int state[DVB_NET_DEVICES_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) unsigned int exit:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) struct dmx_demux *demux;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) struct mutex ioctl_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * dvb_net_init - nitializes a digital TV network device and registers it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * @adap: pointer to &struct dvb_adapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * @dvbnet: pointer to &struct dvb_net.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * @dmxdemux: pointer to &struct dmx_demux.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) int dvb_net_init(struct dvb_adapter *adap, struct dvb_net *dvbnet,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) struct dmx_demux *dmxdemux);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * dvb_net_release - releases a digital TV network device and unregisters it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) * @dvbnet: pointer to &struct dvb_net.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) void dvb_net_release(struct dvb_net *dvbnet);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct dvb_net {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) struct dvb_device *dvbdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) static inline void dvb_net_release(struct dvb_net *dvbnet)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) static inline int dvb_net_init(struct dvb_adapter *adap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) struct dvb_net *dvbnet, struct dmx_demux *dmx)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) #endif /* ifdef CONFIG_DVB_NET */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) #endif