Lines Matching refs:dvbnet

1329 static int get_if(struct dvb_net *dvbnet)  argument
1334 if (!dvbnet->state[i])
1340 dvbnet->state[i]=1;
1344 static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) argument
1353 if ((if_num = get_if(dvbnet)) < 0)
1361 if (dvbnet->dvbdev->id)
1363 dvbnet->dvbdev->adapter->num, dvbnet->dvbdev->id, if_num);
1367 dvbnet->dvbdev->adapter->num, if_num);
1370 eth_hw_addr_set(net, dvbnet->dvbdev->adapter->proposed_mac);
1372 dvbnet->device[if_num] = net;
1376 priv->demux = dvbnet->demux;
1391 dvbnet->device[if_num] = NULL;
1400 static int dvb_net_remove_if(struct dvb_net *dvbnet, unsigned long num) argument
1402 struct net_device *net = dvbnet->device[num];
1405 if (!dvbnet->state[num])
1416 dvbnet->state[num]=0;
1417 dvbnet->device[num] = NULL;
1427 struct dvb_net *dvbnet = dvbdev->priv; local
1433 if (mutex_lock_interruptible(&dvbnet->ioctl_mutex))
1452 result=dvb_net_add_if(dvbnet, dvbnetif->pid, dvbnetif->feedtype);
1474 if (!dvbnet->state[if_num]) {
1479 netdev = dvbnet->device[if_num];
1496 ret = dvb_net_remove_if(dvbnet, (unsigned long) parg);
1518 result=dvb_net_add_if(dvbnet, dvbnetif->pid, DVB_NET_FEEDTYPE_MPE);
1540 if (!dvbnet->state[if_num]) {
1545 netdev = dvbnet->device[if_num];
1557 mutex_unlock(&dvbnet->ioctl_mutex);
1570 struct dvb_net *dvbnet = dvbdev->priv; local
1573 if (mutex_lock_interruptible(&dvbnet->remove_mutex))
1576 if (dvbnet->exit) {
1577 mutex_unlock(&dvbnet->remove_mutex);
1583 mutex_unlock(&dvbnet->remove_mutex);
1591 struct dvb_net *dvbnet = dvbdev->priv; local
1593 mutex_lock(&dvbnet->remove_mutex);
1597 if (dvbdev->users == 1 && dvbnet->exit == 1) {
1598 mutex_unlock(&dvbnet->remove_mutex);
1601 mutex_unlock(&dvbnet->remove_mutex);
1626 void dvb_net_release (struct dvb_net *dvbnet) argument
1630 mutex_lock(&dvbnet->remove_mutex);
1631 dvbnet->exit = 1;
1632 mutex_unlock(&dvbnet->remove_mutex);
1634 if (dvbnet->dvbdev->users < 1)
1635 wait_event(dvbnet->dvbdev->wait_queue,
1636 dvbnet->dvbdev->users == 1);
1638 dvb_unregister_device(dvbnet->dvbdev);
1641 if (!dvbnet->state[i])
1643 dvb_net_remove_if(dvbnet, i);
1649 int dvb_net_init (struct dvb_adapter *adap, struct dvb_net *dvbnet, argument
1654 mutex_init(&dvbnet->ioctl_mutex);
1655 mutex_init(&dvbnet->remove_mutex);
1656 dvbnet->demux = dmx;
1659 dvbnet->state[i] = 0;
1661 return dvb_register_device(adap, &dvbnet->dvbdev, &dvbdev_net,
1662 dvbnet, DVB_DEVICE_NET, 0);