From be43ecc06bb364e60a1e4022bdc190011076c0dc Mon Sep 17 00:00:00 2001 From: Holger Waechtler Date: Mon, 3 Feb 2003 08:56:09 +0000 Subject: NET_GET_IF ioctl implementation contributed by --- linux/drivers/media/dvb/dvb-core/dvb_net.c | 15 +++++++++++++++ linux/include/linux/dvb/net.h | 1 + 2 files changed, 16 insertions(+) diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c index 0ee9a902d..ca6bc2eeb 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_net.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c @@ -483,6 +483,21 @@ int dvb_net_do_ioctl(struct inode *inode, struct file *file, dvbnetif->if_num=result; break; } + case NET_GET_IF: + { + struct net_device *netdev; + struct dvb_net_priv *priv_data; + struct dvb_net_if *dvbnetif=(struct dvb_net_if *)parg; + + if (dvbnetif->if_num >= dvbnet->dev_num || + !dvbnet->state[dvbnetif->if_num]) + return -EFAULT; + + netdev=(struct net_device*)&dvbnet->device[dvbnetif->if_num]; + priv_data=(struct dvb_net_priv*)netdev->priv; + dvbnetif->pid=priv_data->pid; + break; + } case NET_REMOVE_IF: return dvb_net_remove_if(dvbnet, (int) parg); default: diff --git a/linux/include/linux/dvb/net.h b/linux/include/linux/dvb/net.h index 419d44884..5bf03b81e 100644 --- a/linux/include/linux/dvb/net.h +++ b/linux/include/linux/dvb/net.h @@ -39,6 +39,7 @@ struct dvb_net_if { #define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if) #define NET_REMOVE_IF _IO('o', 53) +#define NET_GET_IF _IOWR('o', 54, struct dvb_net_if) #endif /*_DVBNET_H_*/ -- cgit v1.2.3