diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-12-03 21:03:28 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-03 21:03:28 -0500 |
commit | 2fde9901f6702ab82b5b2740fec9a7f9a80ddde4 (patch) | |
tree | 0ca92fabd4169095a50b43b8981d2a6c54f98531 /drivers/media/dvb | |
parent | f89c2b464558a21fd3be8d578b7d13e810fb6b8a (diff) | |
parent | 3b6efee9231e12fce09c94930bfc59f66f18d662 (diff) |
Merge branch 'master'
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-hw-filter.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 69 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_net.c | 31 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/a800.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dibusb-common.c | 18 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-init.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/cx22702.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/cx22702.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/nxt200x.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/ves1820.c | 14 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/Kconfig | 1 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_ca.c | 1 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-av.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-ci.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/ttpci-eeprom.c | 1 |
17 files changed, 74 insertions, 81 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-hw-filter.c b/drivers/media/dvb/b2c2/flexcop-hw-filter.c index 75cf237196eb..b386cc66c6b3 100644 --- a/drivers/media/dvb/b2c2/flexcop-hw-filter.c +++ b/drivers/media/dvb/b2c2/flexcop-hw-filter.c | |||
@@ -19,7 +19,7 @@ void flexcop_smc_ctrl(struct flexcop_device *fc, int onoff) | |||
19 | flexcop_set_ibi_value(ctrl_208,SMC_Enable_sig,onoff); | 19 | flexcop_set_ibi_value(ctrl_208,SMC_Enable_sig,onoff); |
20 | } | 20 | } |
21 | 21 | ||
22 | void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff) | 22 | static void flexcop_null_filter_ctrl(struct flexcop_device *fc, int onoff) |
23 | { | 23 | { |
24 | flexcop_set_ibi_value(ctrl_208,Null_filter_sig,onoff); | 24 | flexcop_set_ibi_value(ctrl_208,Null_filter_sig,onoff); |
25 | } | 25 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 2aa767f9bd7d..cb2e7d6ba283 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <linux/moduleparam.h> | 35 | #include <linux/moduleparam.h> |
36 | #include <linux/vmalloc.h> | 36 | #include <linux/vmalloc.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/rwsem.h> | 38 | #include <linux/spinlock.h> |
39 | #include <linux/sched.h> | 39 | #include <linux/sched.h> |
40 | 40 | ||
41 | #include "dvb_ca_en50221.h" | 41 | #include "dvb_ca_en50221.h" |
@@ -111,9 +111,6 @@ struct dvb_ca_slot { | |||
111 | /* size of the buffer to use when talking to the CAM */ | 111 | /* size of the buffer to use when talking to the CAM */ |
112 | int link_buf_size; | 112 | int link_buf_size; |
113 | 113 | ||
114 | /* semaphore for syncing access to slot structure */ | ||
115 | struct rw_semaphore sem; | ||
116 | |||
117 | /* buffer for incoming packets */ | 114 | /* buffer for incoming packets */ |
118 | struct dvb_ringbuffer rx_buffer; | 115 | struct dvb_ringbuffer rx_buffer; |
119 | 116 | ||
@@ -602,14 +599,11 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb | |||
602 | if (ebuf == NULL) { | 599 | if (ebuf == NULL) { |
603 | int buf_free; | 600 | int buf_free; |
604 | 601 | ||
605 | down_read(&ca->slot_info[slot].sem); | ||
606 | if (ca->slot_info[slot].rx_buffer.data == NULL) { | 602 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
607 | up_read(&ca->slot_info[slot].sem); | ||
608 | status = -EIO; | 603 | status = -EIO; |
609 | goto exit; | 604 | goto exit; |
610 | } | 605 | } |
611 | buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer); | 606 | buf_free = dvb_ringbuffer_free(&ca->slot_info[slot].rx_buffer); |
612 | up_read(&ca->slot_info[slot].sem); | ||
613 | 607 | ||
614 | if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) { | 608 | if (buf_free < (ca->slot_info[slot].link_buf_size + DVB_RINGBUFFER_PKTHDRSIZE)) { |
615 | status = -EAGAIN; | 609 | status = -EAGAIN; |
@@ -680,14 +674,11 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot, u8 * eb | |||
680 | 674 | ||
681 | /* OK, add it to the receive buffer, or copy into external buffer if supplied */ | 675 | /* OK, add it to the receive buffer, or copy into external buffer if supplied */ |
682 | if (ebuf == NULL) { | 676 | if (ebuf == NULL) { |
683 | down_read(&ca->slot_info[slot].sem); | ||
684 | if (ca->slot_info[slot].rx_buffer.data == NULL) { | 677 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
685 | up_read(&ca->slot_info[slot].sem); | ||
686 | status = -EIO; | 678 | status = -EIO; |
687 | goto exit; | 679 | goto exit; |
688 | } | 680 | } |
689 | dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read); | 681 | dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read); |
690 | up_read(&ca->slot_info[slot].sem); | ||
691 | } else { | 682 | } else { |
692 | memcpy(ebuf, buf, bytes_read); | 683 | memcpy(ebuf, buf, bytes_read); |
693 | } | 684 | } |
@@ -802,12 +793,8 @@ static int dvb_ca_en50221_slot_shutdown(struct dvb_ca_private *ca, int slot) | |||
802 | { | 793 | { |
803 | dprintk("%s\n", __FUNCTION__); | 794 | dprintk("%s\n", __FUNCTION__); |
804 | 795 | ||
805 | down_write(&ca->slot_info[slot].sem); | ||
806 | ca->pub->slot_shutdown(ca->pub, slot); | 796 | ca->pub->slot_shutdown(ca->pub, slot); |
807 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; | 797 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_NONE; |
808 | vfree(ca->slot_info[slot].rx_buffer.data); | ||
809 | ca->slot_info[slot].rx_buffer.data = NULL; | ||
810 | up_write(&ca->slot_info[slot].sem); | ||
811 | 798 | ||
812 | /* need to wake up all processes to check if they're now | 799 | /* need to wake up all processes to check if they're now |
813 | trying to write to a defunct CAM */ | 800 | trying to write to a defunct CAM */ |
@@ -893,7 +880,7 @@ void dvb_ca_en50221_frda_irq(struct dvb_ca_en50221 *pubca, int slot) | |||
893 | 880 | ||
894 | case DVB_CA_SLOTSTATE_RUNNING: | 881 | case DVB_CA_SLOTSTATE_RUNNING: |
895 | if (ca->open) | 882 | if (ca->open) |
896 | dvb_ca_en50221_read_data(ca, slot, NULL, 0); | 883 | dvb_ca_en50221_thread_wakeup(ca); |
897 | break; | 884 | break; |
898 | } | 885 | } |
899 | } | 886 | } |
@@ -1127,16 +1114,16 @@ static int dvb_ca_en50221_thread(void *data) | |||
1127 | break; | 1114 | break; |
1128 | } | 1115 | } |
1129 | 1116 | ||
1130 | rxbuf = vmalloc(RX_BUFFER_SIZE); | 1117 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
1131 | if (rxbuf == NULL) { | 1118 | rxbuf = vmalloc(RX_BUFFER_SIZE); |
1132 | printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num); | 1119 | if (rxbuf == NULL) { |
1133 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; | 1120 | printk("dvb_ca adapter %d: Unable to allocate CAM rx buffer :(\n", ca->dvbdev->adapter->num); |
1134 | dvb_ca_en50221_thread_update_delay(ca); | 1121 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_INVALID; |
1135 | break; | 1122 | dvb_ca_en50221_thread_update_delay(ca); |
1123 | break; | ||
1124 | } | ||
1125 | dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE); | ||
1136 | } | 1126 | } |
1137 | down_write(&ca->slot_info[slot].sem); | ||
1138 | dvb_ringbuffer_init(&ca->slot_info[slot].rx_buffer, rxbuf, RX_BUFFER_SIZE); | ||
1139 | up_write(&ca->slot_info[slot].sem); | ||
1140 | 1127 | ||
1141 | ca->pub->slot_ts_enable(ca->pub, slot); | 1128 | ca->pub->slot_ts_enable(ca->pub, slot); |
1142 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_RUNNING; | 1129 | ca->slot_info[slot].slot_state = DVB_CA_SLOTSTATE_RUNNING; |
@@ -1148,11 +1135,7 @@ static int dvb_ca_en50221_thread(void *data) | |||
1148 | if (!ca->open) | 1135 | if (!ca->open) |
1149 | continue; | 1136 | continue; |
1150 | 1137 | ||
1151 | // no need to poll if the CAM supports IRQs | 1138 | // poll slots for data |
1152 | if (ca->slot_info[slot].da_irq_supported) | ||
1153 | break; | ||
1154 | |||
1155 | // poll mode | ||
1156 | pktcount = 0; | 1139 | pktcount = 0; |
1157 | while ((status = dvb_ca_en50221_read_data(ca, slot, NULL, 0)) > 0) { | 1140 | while ((status = dvb_ca_en50221_read_data(ca, slot, NULL, 0)) > 0) { |
1158 | if (!ca->open) | 1141 | if (!ca->open) |
@@ -1367,12 +1350,13 @@ exit: | |||
1367 | /** | 1350 | /** |
1368 | * Condition for waking up in dvb_ca_en50221_io_read_condition | 1351 | * Condition for waking up in dvb_ca_en50221_io_read_condition |
1369 | */ | 1352 | */ |
1370 | static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *result, int *_slot) | 1353 | static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, |
1354 | int *result, int *_slot) | ||
1371 | { | 1355 | { |
1372 | int slot; | 1356 | int slot; |
1373 | int slot_count = 0; | 1357 | int slot_count = 0; |
1374 | int idx; | 1358 | int idx; |
1375 | int fraglen; | 1359 | size_t fraglen; |
1376 | int connection_id = -1; | 1360 | int connection_id = -1; |
1377 | int found = 0; | 1361 | int found = 0; |
1378 | u8 hdr[2]; | 1362 | u8 hdr[2]; |
@@ -1382,10 +1366,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *resu | |||
1382 | if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) | 1366 | if (ca->slot_info[slot].slot_state != DVB_CA_SLOTSTATE_RUNNING) |
1383 | goto nextslot; | 1367 | goto nextslot; |
1384 | 1368 | ||
1385 | down_read(&ca->slot_info[slot].sem); | ||
1386 | |||
1387 | if (ca->slot_info[slot].rx_buffer.data == NULL) { | 1369 | if (ca->slot_info[slot].rx_buffer.data == NULL) { |
1388 | up_read(&ca->slot_info[slot].sem); | ||
1389 | return 0; | 1370 | return 0; |
1390 | } | 1371 | } |
1391 | 1372 | ||
@@ -1403,10 +1384,7 @@ static int dvb_ca_en50221_io_read_condition(struct dvb_ca_private *ca, int *resu | |||
1403 | idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen); | 1384 | idx = dvb_ringbuffer_pkt_next(&ca->slot_info[slot].rx_buffer, idx, &fraglen); |
1404 | } | 1385 | } |
1405 | 1386 | ||
1406 | if (!found) | 1387 | nextslot: |
1407 | up_read(&ca->slot_info[slot].sem); | ||
1408 | |||
1409 | nextslot: | ||
1410 | slot = (slot + 1) % ca->slot_count; | 1388 | slot = (slot + 1) % ca->slot_count; |
1411 | slot_count++; | 1389 | slot_count++; |
1412 | } | 1390 | } |
@@ -1511,8 +1489,7 @@ static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user * buf, | |||
1511 | goto exit; | 1489 | goto exit; |
1512 | status = pktlen; | 1490 | status = pktlen; |
1513 | 1491 | ||
1514 | exit: | 1492 | exit: |
1515 | up_read(&ca->slot_info[slot].sem); | ||
1516 | return status; | 1493 | return status; |
1517 | } | 1494 | } |
1518 | 1495 | ||
@@ -1544,11 +1521,11 @@ static int dvb_ca_en50221_io_open(struct inode *inode, struct file *file) | |||
1544 | for (i = 0; i < ca->slot_count; i++) { | 1521 | for (i = 0; i < ca->slot_count; i++) { |
1545 | 1522 | ||
1546 | if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) { | 1523 | if (ca->slot_info[i].slot_state == DVB_CA_SLOTSTATE_RUNNING) { |
1547 | down_write(&ca->slot_info[i].sem); | ||
1548 | if (ca->slot_info[i].rx_buffer.data != NULL) { | 1524 | if (ca->slot_info[i].rx_buffer.data != NULL) { |
1525 | /* it is safe to call this here without locks because | ||
1526 | * ca->open == 0. Data is not read in this case */ | ||
1549 | dvb_ringbuffer_flush(&ca->slot_info[i].rx_buffer); | 1527 | dvb_ringbuffer_flush(&ca->slot_info[i].rx_buffer); |
1550 | } | 1528 | } |
1551 | up_write(&ca->slot_info[i].sem); | ||
1552 | } | 1529 | } |
1553 | } | 1530 | } |
1554 | 1531 | ||
@@ -1607,7 +1584,6 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait) | |||
1607 | dprintk("%s\n", __FUNCTION__); | 1584 | dprintk("%s\n", __FUNCTION__); |
1608 | 1585 | ||
1609 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { | 1586 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { |
1610 | up_read(&ca->slot_info[slot].sem); | ||
1611 | mask |= POLLIN; | 1587 | mask |= POLLIN; |
1612 | } | 1588 | } |
1613 | 1589 | ||
@@ -1619,7 +1595,6 @@ static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table * wait) | |||
1619 | poll_wait(file, &ca->wait_queue, wait); | 1595 | poll_wait(file, &ca->wait_queue, wait); |
1620 | 1596 | ||
1621 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { | 1597 | if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) { |
1622 | up_read(&ca->slot_info[slot].sem); | ||
1623 | mask |= POLLIN; | 1598 | mask |= POLLIN; |
1624 | } | 1599 | } |
1625 | 1600 | ||
@@ -1709,7 +1684,6 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, | |||
1709 | ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE; | 1684 | ca->slot_info[i].slot_state = DVB_CA_SLOTSTATE_NONE; |
1710 | atomic_set(&ca->slot_info[i].camchange_count, 0); | 1685 | atomic_set(&ca->slot_info[i].camchange_count, 0); |
1711 | ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; | 1686 | ca->slot_info[i].camchange_type = DVB_CA_EN50221_CAMCHANGE_REMOVED; |
1712 | init_rwsem(&ca->slot_info[i].sem); | ||
1713 | } | 1687 | } |
1714 | 1688 | ||
1715 | if (signal_pending(current)) { | 1689 | if (signal_pending(current)) { |
@@ -1729,7 +1703,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, | |||
1729 | ca->thread_pid = ret; | 1703 | ca->thread_pid = ret; |
1730 | return 0; | 1704 | return 0; |
1731 | 1705 | ||
1732 | error: | 1706 | error: |
1733 | if (ca != NULL) { | 1707 | if (ca != NULL) { |
1734 | if (ca->dvbdev != NULL) | 1708 | if (ca->dvbdev != NULL) |
1735 | dvb_unregister_device(ca->dvbdev); | 1709 | dvb_unregister_device(ca->dvbdev); |
@@ -1771,6 +1745,9 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca) | |||
1771 | 1745 | ||
1772 | for (i = 0; i < ca->slot_count; i++) { | 1746 | for (i = 0; i < ca->slot_count; i++) { |
1773 | dvb_ca_en50221_slot_shutdown(ca, i); | 1747 | dvb_ca_en50221_slot_shutdown(ca, i); |
1748 | if (ca->slot_info[i].rx_buffer.data != NULL) { | ||
1749 | vfree(ca->slot_info[i].rx_buffer.data); | ||
1750 | } | ||
1774 | } | 1751 | } |
1775 | kfree(ca->slot_info); | 1752 | kfree(ca->slot_info); |
1776 | dvb_unregister_device(ca->dvbdev); | 1753 | dvb_unregister_device(ca->dvbdev); |
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index 87935490bfb2..df536bd2e103 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c | |||
@@ -151,6 +151,8 @@ struct dvb_net_priv { | |||
151 | unsigned char ule_bridged; /* Whether the ULE_BRIDGED extension header was found. */ | 151 | unsigned char ule_bridged; /* Whether the ULE_BRIDGED extension header was found. */ |
152 | int ule_sndu_remain; /* Nr. of bytes still required for current ULE SNDU. */ | 152 | int ule_sndu_remain; /* Nr. of bytes still required for current ULE SNDU. */ |
153 | unsigned long ts_count; /* Current ts cell counter. */ | 153 | unsigned long ts_count; /* Current ts cell counter. */ |
154 | |||
155 | struct semaphore mutex; | ||
154 | }; | 156 | }; |
155 | 157 | ||
156 | 158 | ||
@@ -881,12 +883,13 @@ static int dvb_net_filter_sec_set(struct net_device *dev, | |||
881 | 883 | ||
882 | static int dvb_net_feed_start(struct net_device *dev) | 884 | static int dvb_net_feed_start(struct net_device *dev) |
883 | { | 885 | { |
884 | int ret, i; | 886 | int ret = 0, i; |
885 | struct dvb_net_priv *priv = dev->priv; | 887 | struct dvb_net_priv *priv = dev->priv; |
886 | struct dmx_demux *demux = priv->demux; | 888 | struct dmx_demux *demux = priv->demux; |
887 | unsigned char *mac = (unsigned char *) dev->dev_addr; | 889 | unsigned char *mac = (unsigned char *) dev->dev_addr; |
888 | 890 | ||
889 | dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); | 891 | dprintk("%s: rx_mode %i\n", __FUNCTION__, priv->rx_mode); |
892 | down(&priv->mutex); | ||
890 | if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) | 893 | if (priv->tsfeed || priv->secfeed || priv->secfilter || priv->multi_secfilter[0]) |
891 | printk("%s: BUG %d\n", __FUNCTION__, __LINE__); | 894 | printk("%s: BUG %d\n", __FUNCTION__, __LINE__); |
892 | 895 | ||
@@ -900,7 +903,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
900 | dvb_net_sec_callback); | 903 | dvb_net_sec_callback); |
901 | if (ret<0) { | 904 | if (ret<0) { |
902 | printk("%s: could not allocate section feed\n", dev->name); | 905 | printk("%s: could not allocate section feed\n", dev->name); |
903 | return ret; | 906 | goto error; |
904 | } | 907 | } |
905 | 908 | ||
906 | ret = priv->secfeed->set(priv->secfeed, priv->pid, 32768, 1); | 909 | ret = priv->secfeed->set(priv->secfeed, priv->pid, 32768, 1); |
@@ -909,7 +912,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
909 | printk("%s: could not set section feed\n", dev->name); | 912 | printk("%s: could not set section feed\n", dev->name); |
910 | priv->demux->release_section_feed(priv->demux, priv->secfeed); | 913 | priv->demux->release_section_feed(priv->demux, priv->secfeed); |
911 | priv->secfeed=NULL; | 914 | priv->secfeed=NULL; |
912 | return ret; | 915 | goto error; |
913 | } | 916 | } |
914 | 917 | ||
915 | if (priv->rx_mode != RX_MODE_PROMISC) { | 918 | if (priv->rx_mode != RX_MODE_PROMISC) { |
@@ -948,7 +951,7 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
948 | ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback); | 951 | ret = demux->allocate_ts_feed(demux, &priv->tsfeed, dvb_net_ts_callback); |
949 | if (ret < 0) { | 952 | if (ret < 0) { |
950 | printk("%s: could not allocate ts feed\n", dev->name); | 953 | printk("%s: could not allocate ts feed\n", dev->name); |
951 | return ret; | 954 | goto error; |
952 | } | 955 | } |
953 | 956 | ||
954 | /* Set netdevice pointer for ts decaps callback. */ | 957 | /* Set netdevice pointer for ts decaps callback. */ |
@@ -962,23 +965,26 @@ static int dvb_net_feed_start(struct net_device *dev) | |||
962 | printk("%s: could not set ts feed\n", dev->name); | 965 | printk("%s: could not set ts feed\n", dev->name); |
963 | priv->demux->release_ts_feed(priv->demux, priv->tsfeed); | 966 | priv->demux->release_ts_feed(priv->demux, priv->tsfeed); |
964 | priv->tsfeed = NULL; | 967 | priv->tsfeed = NULL; |
965 | return ret; | 968 | goto error; |
966 | } | 969 | } |
967 | 970 | ||
968 | dprintk("%s: start filtering\n", __FUNCTION__); | 971 | dprintk("%s: start filtering\n", __FUNCTION__); |
969 | priv->tsfeed->start_filtering(priv->tsfeed); | 972 | priv->tsfeed->start_filtering(priv->tsfeed); |
970 | } else | 973 | } else |
971 | return -EINVAL; | 974 | ret = -EINVAL; |
972 | 975 | ||
973 | return 0; | 976 | error: |
977 | up(&priv->mutex); | ||
978 | return ret; | ||
974 | } | 979 | } |
975 | 980 | ||
976 | static int dvb_net_feed_stop(struct net_device *dev) | 981 | static int dvb_net_feed_stop(struct net_device *dev) |
977 | { | 982 | { |
978 | struct dvb_net_priv *priv = dev->priv; | 983 | struct dvb_net_priv *priv = dev->priv; |
979 | int i; | 984 | int i, ret = 0; |
980 | 985 | ||
981 | dprintk("%s\n", __FUNCTION__); | 986 | dprintk("%s\n", __FUNCTION__); |
987 | down(&priv->mutex); | ||
982 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { | 988 | if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) { |
983 | if (priv->secfeed) { | 989 | if (priv->secfeed) { |
984 | if (priv->secfeed->is_filtering) { | 990 | if (priv->secfeed->is_filtering) { |
@@ -1019,8 +1025,9 @@ static int dvb_net_feed_stop(struct net_device *dev) | |||
1019 | else | 1025 | else |
1020 | printk("%s: no ts feed to stop\n", dev->name); | 1026 | printk("%s: no ts feed to stop\n", dev->name); |
1021 | } else | 1027 | } else |
1022 | return -EINVAL; | 1028 | ret = -EINVAL; |
1023 | return 0; | 1029 | up(&priv->mutex); |
1030 | return ret; | ||
1024 | } | 1031 | } |
1025 | 1032 | ||
1026 | 1033 | ||
@@ -1044,8 +1051,8 @@ static void wq_set_multicast_list (void *data) | |||
1044 | struct dvb_net_priv *priv = dev->priv; | 1051 | struct dvb_net_priv *priv = dev->priv; |
1045 | 1052 | ||
1046 | dvb_net_feed_stop(dev); | 1053 | dvb_net_feed_stop(dev); |
1047 | |||
1048 | priv->rx_mode = RX_MODE_UNI; | 1054 | priv->rx_mode = RX_MODE_UNI; |
1055 | spin_lock_bh(&dev->xmit_lock); | ||
1049 | 1056 | ||
1050 | if (dev->flags & IFF_PROMISC) { | 1057 | if (dev->flags & IFF_PROMISC) { |
1051 | dprintk("%s: promiscuous mode\n", dev->name); | 1058 | dprintk("%s: promiscuous mode\n", dev->name); |
@@ -1070,6 +1077,7 @@ static void wq_set_multicast_list (void *data) | |||
1070 | } | 1077 | } |
1071 | } | 1078 | } |
1072 | 1079 | ||
1080 | spin_unlock_bh(&dev->xmit_lock); | ||
1073 | dvb_net_feed_start(dev); | 1081 | dvb_net_feed_start(dev); |
1074 | } | 1082 | } |
1075 | 1083 | ||
@@ -1200,6 +1208,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype) | |||
1200 | 1208 | ||
1201 | INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); | 1209 | INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net); |
1202 | INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); | 1210 | INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net); |
1211 | init_MUTEX(&priv->mutex); | ||
1203 | 1212 | ||
1204 | net->base_addr = pid; | 1213 | net->base_addr = pid; |
1205 | 1214 | ||
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index 49f541d9a042..8c7beffb045f 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c | |||
@@ -65,7 +65,7 @@ static struct dvb_usb_rc_key a800_rc_keys[] = { | |||
65 | 65 | ||
66 | }; | 66 | }; |
67 | 67 | ||
68 | int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 68 | static int a800_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
69 | { | 69 | { |
70 | u8 key[5]; | 70 | u8 key[5]; |
71 | if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), | 71 | if (usb_control_msg(d->udev,usb_rcvctrlpipe(d->udev,0), |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index 00b946419b40..269d899da488 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -21,9 +21,9 @@ MODULE_LICENSE("GPL"); | |||
21 | int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) | 21 | int dibusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) |
22 | { | 22 | { |
23 | if (d->priv != NULL) { | 23 | if (d->priv != NULL) { |
24 | struct dib_fe_xfer_ops *ops = d->priv; | 24 | struct dibusb_state *st = d->priv; |
25 | if (ops->fifo_ctrl != NULL) | 25 | if (st->ops.fifo_ctrl != NULL) |
26 | if (ops->fifo_ctrl(d->fe,onoff)) { | 26 | if (st->ops.fifo_ctrl(d->fe,onoff)) { |
27 | err("error while controlling the fifo of the demod."); | 27 | err("error while controlling the fifo of the demod."); |
28 | return -ENODEV; | 28 | return -ENODEV; |
29 | } | 29 | } |
@@ -35,9 +35,9 @@ EXPORT_SYMBOL(dibusb_streaming_ctrl); | |||
35 | int dibusb_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) | 35 | int dibusb_pid_filter(struct dvb_usb_device *d, int index, u16 pid, int onoff) |
36 | { | 36 | { |
37 | if (d->priv != NULL) { | 37 | if (d->priv != NULL) { |
38 | struct dib_fe_xfer_ops *ops = d->priv; | 38 | struct dibusb_state *st = d->priv; |
39 | if (d->pid_filtering && ops->pid_ctrl != NULL) | 39 | if (st->ops.pid_ctrl != NULL) |
40 | ops->pid_ctrl(d->fe,index,pid,onoff); | 40 | st->ops.pid_ctrl(d->fe,index,pid,onoff); |
41 | } | 41 | } |
42 | return 0; | 42 | return 0; |
43 | } | 43 | } |
@@ -46,9 +46,9 @@ EXPORT_SYMBOL(dibusb_pid_filter); | |||
46 | int dibusb_pid_filter_ctrl(struct dvb_usb_device *d, int onoff) | 46 | int dibusb_pid_filter_ctrl(struct dvb_usb_device *d, int onoff) |
47 | { | 47 | { |
48 | if (d->priv != NULL) { | 48 | if (d->priv != NULL) { |
49 | struct dib_fe_xfer_ops *ops = d->priv; | 49 | struct dibusb_state *st = d->priv; |
50 | if (ops->pid_parse != NULL) | 50 | if (st->ops.pid_parse != NULL) |
51 | if (ops->pid_parse(d->fe,onoff) < 0) | 51 | if (st->ops.pid_parse(d->fe,onoff) < 0) |
52 | err("could not handle pid_parser"); | 52 | err("could not handle pid_parser"); |
53 | } | 53 | } |
54 | return 0; | 54 | return 0; |
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 74545f82eff1..f98e306a5759 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -148,7 +148,7 @@ static struct dvb_usb_rc_key digitv_rc_keys[] = { | |||
148 | }; | 148 | }; |
149 | 149 | ||
150 | /* TODO is it really the NEC protocol ? */ | 150 | /* TODO is it really the NEC protocol ? */ |
151 | int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 151 | static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
152 | { | 152 | { |
153 | u8 key[5]; | 153 | u8 key[5]; |
154 | 154 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index a902059812a2..dd8e0b94edba 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c | |||
@@ -23,7 +23,7 @@ module_param_named(disable_rc_polling, dvb_usb_disable_rc_polling, int, 0644); | |||
23 | MODULE_PARM_DESC(disable_rc_polling, "disable remote control polling (default: 0)."); | 23 | MODULE_PARM_DESC(disable_rc_polling, "disable remote control polling (default: 0)."); |
24 | 24 | ||
25 | /* general initialization functions */ | 25 | /* general initialization functions */ |
26 | int dvb_usb_exit(struct dvb_usb_device *d) | 26 | static int dvb_usb_exit(struct dvb_usb_device *d) |
27 | { | 27 | { |
28 | deb_info("state before exiting everything: %x\n",d->state); | 28 | deb_info("state before exiting everything: %x\n",d->state); |
29 | dvb_usb_remote_exit(d); | 29 | dvb_usb_remote_exit(d); |
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c index 9f639297a9f2..d9a8ede14b45 100644 --- a/drivers/media/dvb/frontends/cx22702.c +++ b/drivers/media/dvb/frontends/cx22702.c | |||
@@ -7,7 +7,7 @@ | |||
7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH | 7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH |
8 | Holger Waechtler <holger@convergence.de> | 8 | Holger Waechtler <holger@convergence.de> |
9 | 9 | ||
10 | Copyright (C) 2004 Steven Toth <steve@toth.demon.co.uk> | 10 | Copyright (C) 2004 Steven Toth <stoth@hauppauge.com> |
11 | 11 | ||
12 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
13 | it under the terms of the GNU General Public License as published by | 13 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/dvb/frontends/cx22702.h b/drivers/media/dvb/frontends/cx22702.h index 11f86806756e..1f250885d2ce 100644 --- a/drivers/media/dvb/frontends/cx22702.h +++ b/drivers/media/dvb/frontends/cx22702.h | |||
@@ -7,7 +7,7 @@ | |||
7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH | 7 | Copyright (C) 2001-2002 Convergence Integrated Media GmbH |
8 | Holger Waechtler <holger@convergence.de> | 8 | Holger Waechtler <holger@convergence.de> |
9 | 9 | ||
10 | Copyright (C) 2004 Steven Toth <steve@toth.demon.co.uk> | 10 | Copyright (C) 2004 Steven Toth <stoth@hauppauge.com> |
11 | 11 | ||
12 | This program is free software; you can redistribute it and/or modify | 12 | This program is free software; you can redistribute it and/or modify |
13 | it under the terms of the GNU General Public License as published by | 13 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/media/dvb/frontends/nxt200x.c b/drivers/media/dvb/frontends/nxt200x.c index bad0933eb714..84b62881cea7 100644 --- a/drivers/media/dvb/frontends/nxt200x.c +++ b/drivers/media/dvb/frontends/nxt200x.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <linux/init.h> | 44 | #include <linux/init.h> |
45 | #include <linux/module.h> | 45 | #include <linux/module.h> |
46 | #include <linux/moduleparam.h> | 46 | #include <linux/moduleparam.h> |
47 | #include <linux/slab.h> | ||
48 | #include <linux/string.h> | ||
47 | 49 | ||
48 | #include "dvb_frontend.h" | 50 | #include "dvb_frontend.h" |
49 | #include "dvb-pll.h" | 51 | #include "dvb-pll.h" |
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index c6d276618e86..ad8647a3c85e 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c | |||
@@ -140,25 +140,25 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) | |||
140 | /* yeuch! */ | 140 | /* yeuch! */ |
141 | fpxin = state->config->xin * 10; | 141 | fpxin = state->config->xin * 10; |
142 | fptmp = fpxin; do_div(fptmp, 123); | 142 | fptmp = fpxin; do_div(fptmp, 123); |
143 | if (symbolrate < fptmp); | 143 | if (symbolrate < fptmp) |
144 | SFIL = 1; | 144 | SFIL = 1; |
145 | fptmp = fpxin; do_div(fptmp, 160); | 145 | fptmp = fpxin; do_div(fptmp, 160); |
146 | if (symbolrate < fptmp); | 146 | if (symbolrate < fptmp) |
147 | SFIL = 0; | 147 | SFIL = 0; |
148 | fptmp = fpxin; do_div(fptmp, 246); | 148 | fptmp = fpxin; do_div(fptmp, 246); |
149 | if (symbolrate < fptmp); | 149 | if (symbolrate < fptmp) |
150 | SFIL = 1; | 150 | SFIL = 1; |
151 | fptmp = fpxin; do_div(fptmp, 320); | 151 | fptmp = fpxin; do_div(fptmp, 320); |
152 | if (symbolrate < fptmp); | 152 | if (symbolrate < fptmp) |
153 | SFIL = 0; | 153 | SFIL = 0; |
154 | fptmp = fpxin; do_div(fptmp, 492); | 154 | fptmp = fpxin; do_div(fptmp, 492); |
155 | if (symbolrate < fptmp); | 155 | if (symbolrate < fptmp) |
156 | SFIL = 1; | 156 | SFIL = 1; |
157 | fptmp = fpxin; do_div(fptmp, 640); | 157 | fptmp = fpxin; do_div(fptmp, 640); |
158 | if (symbolrate < fptmp); | 158 | if (symbolrate < fptmp) |
159 | SFIL = 0; | 159 | SFIL = 0; |
160 | fptmp = fpxin; do_div(fptmp, 984); | 160 | fptmp = fpxin; do_div(fptmp, 984); |
161 | if (symbolrate < fptmp); | 161 | if (symbolrate < fptmp) |
162 | SFIL = 1; | 162 | SFIL = 1; |
163 | 163 | ||
164 | fin = state->config->xin >> 4; | 164 | fin = state->config->xin >> 4; |
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index d8bf65877897..fa5034a9ecf5 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig | |||
@@ -81,6 +81,7 @@ config DVB_BUDGET_CI | |||
81 | tristate "Budget cards with onboard CI connector" | 81 | tristate "Budget cards with onboard CI connector" |
82 | depends on DVB_CORE && PCI | 82 | depends on DVB_CORE && PCI |
83 | select VIDEO_SAA7146 | 83 | select VIDEO_SAA7146 |
84 | select DVB_STV0297 | ||
84 | select DVB_STV0299 | 85 | select DVB_STV0299 |
85 | select DVB_TDA1004X | 86 | select DVB_TDA1004X |
86 | help | 87 | help |
diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c index c3801e328fe9..6079e8865d5b 100644 --- a/drivers/media/dvb/ttpci/av7110_ca.c +++ b/drivers/media/dvb/ttpci/av7110_ca.c | |||
@@ -40,6 +40,7 @@ | |||
40 | 40 | ||
41 | #include "av7110.h" | 41 | #include "av7110.h" |
42 | #include "av7110_hw.h" | 42 | #include "av7110_hw.h" |
43 | #include "av7110_ca.h" | ||
43 | 44 | ||
44 | 45 | ||
45 | void CI_handle(struct av7110 *av7110, u8 *data, u16 len) | 46 | void CI_handle(struct av7110 *av7110, u8 *data, u16 len) |
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index aa75dc03a0b3..9f51bae7194c 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c | |||
@@ -1020,6 +1020,8 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); | |||
1020 | 1020 | ||
1021 | static struct saa7146_extension budget_extension = { | 1021 | static struct saa7146_extension budget_extension = { |
1022 | .name = "budget_av", | 1022 | .name = "budget_av", |
1023 | .flags = SAA7146_I2C_SHORT_DELAY, | ||
1024 | |||
1023 | .pci_tbl = pci_tbl, | 1025 | .pci_tbl = pci_tbl, |
1024 | 1026 | ||
1025 | .module = THIS_MODULE, | 1027 | .module = THIS_MODULE, |
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 75fb92d60998..b9b3cd9c0369 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -1166,7 +1166,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); | |||
1166 | 1166 | ||
1167 | static struct saa7146_extension budget_extension = { | 1167 | static struct saa7146_extension budget_extension = { |
1168 | .name = "budget_ci dvb\0", | 1168 | .name = "budget_ci dvb\0", |
1169 | .flags = 0, | 1169 | .flags = SAA7146_I2C_SHORT_DELAY, |
1170 | 1170 | ||
1171 | .module = THIS_MODULE, | 1171 | .module = THIS_MODULE, |
1172 | .pci_tbl = &pci_tbl[0], | 1172 | .pci_tbl = &pci_tbl[0], |
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index 4fd8bbc47037..bc4ce7559cbe 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c | |||
@@ -738,7 +738,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); | |||
738 | 738 | ||
739 | static struct saa7146_extension budget_extension = { | 739 | static struct saa7146_extension budget_extension = { |
740 | .name = "budget dvb\0", | 740 | .name = "budget dvb\0", |
741 | .flags = 0, | 741 | .flags = SAA7146_I2C_SHORT_DELAY, |
742 | 742 | ||
743 | .module = THIS_MODULE, | 743 | .module = THIS_MODULE, |
744 | .pci_tbl = pci_tbl, | 744 | .pci_tbl = pci_tbl, |
diff --git a/drivers/media/dvb/ttpci/ttpci-eeprom.c b/drivers/media/dvb/ttpci/ttpci-eeprom.c index e9a8457b0727..ac79ef178c05 100644 --- a/drivers/media/dvb/ttpci/ttpci-eeprom.c +++ b/drivers/media/dvb/ttpci/ttpci-eeprom.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/string.h> | 37 | #include <linux/string.h> |
38 | #include <linux/i2c.h> | 38 | #include <linux/i2c.h> |
39 | 39 | ||
40 | #include "ttpci-eeprom.h" | ||
40 | 41 | ||
41 | #if 1 | 42 | #if 1 |
42 | #define dprintk(x...) do { printk(x); } while (0) | 43 | #define dprintk(x...) do { printk(x); } while (0) |