linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Hunold (LinuxTV.org CVS maintainer)  <hunold@convergence.de>
To: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 13/17] More updates for the dvb core
Date: Tue, 15 Jul 2003 14:20:58 +0200	[thread overview]
Message-ID: <10582716581043@convergence.de> (raw)
In-Reply-To: <10582716571753@convergence.de>

diff -uNrwB --new-file linux-2.6.0-test1.work/drivers/media/dvb/dvb-core/dvb_demux.c linux-2.6.0-test1.patch/drivers/media/dvb/dvb-core/dvb_demux.c
--- linux-2.6.0-test1.work/drivers/media/dvb/dvb-core/dvb_demux.c	2003-07-15 10:59:30.000000000 +0200
+++ linux-2.6.0-test1.patch/drivers/media/dvb/dvb-core/dvb_demux.c	2003-07-04 11:46:12.000000000 +0200
@@ -403,13 +404,16 @@
 {
 	int p = 0,i, j;
 	
+	spin_lock(&demux->lock);
+
 	if ((i = demux->tsbufp)) {
 		if (count < (j=188-i)) {
 			memcpy(&demux->tsbuf[i], buf, count);
 			demux->tsbufp += count;
-			return;
+			goto bailout;
 		}
 		memcpy(&demux->tsbuf[i], buf, j);
+		if (demux->tsbuf[0] == 0x47)
 		dvb_dmx_swfilter_packet(demux, demux->tsbuf);
 		demux->tsbufp = 0;
 		p += j;
@@ -424,11 +428,14 @@
 				i = count-p;
 				memcpy(demux->tsbuf, buf+p, i);
 				demux->tsbufp=i;
-				return;
+				goto bailout;
 			}
 		} else 
 			p++;
 	}
+
+bailout:
+	spin_unlock(&demux->lock);
 }
 
 
@@ -1030,9 +1051,11 @@
 
 	if (down_interruptible (&dvbdemux->mutex))
 		return -ERESTARTSYS;
-
 	dvb_dmx_swfilter(dvbdemux, buf, count);
 	up(&dvbdemux->mutex);
+
+	if (signal_pending(current))
+		return -EINTR;
 	return count;
 }
 
diff -uNrwB --new-file linux-2.6.0-test1.work/drivers/media/dvb/dvb-core/dvb_net.c linux-2.6.0-test1.patch/drivers/media/dvb/dvb-core/dvb_net.c
--- linux-2.6.0-test1.work/drivers/media/dvb/dvb-core/dvb_net.c	2003-07-15 10:59:32.000000000 +0200
+++ linux-2.6.0-test1.patch/drivers/media/dvb/dvb-core/dvb_net.c	2003-06-29 10:21:16.000000000 +0200
@@ -57,7 +57,8 @@
 #define RX_MODE_MULTI 1
 #define RX_MODE_ALL_MULTI 2
 #define RX_MODE_PROMISC 3
-	struct work_struct wq;
+	struct work_struct set_multicast_list_wq;
+	struct work_struct restart_net_feed_wq;
 };
 
 
@@ -354,7 +361,7 @@
 }
 
 
-static void tq_set_multicast_list (void *data)
+static void wq_set_multicast_list (void *data)
 {
 	struct net_device *dev = data;
 	struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv;
@@ -393,7 +400,7 @@
 static void dvb_net_set_multicast_list (struct net_device *dev)
 {
 	struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv;
-	schedule_work(&priv->wq);
+	schedule_work(&priv->set_multicast_list_wq);
 }
 
 
@@ -404,16 +411,28 @@
 	return 0;
 }
 
-static int dvb_net_set_mac(struct net_device *dev, void *p)
-{
-	struct sockaddr *addr=p;
 
-	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+static void wq_restart_net_feed (void *data)
+{
+	struct net_device *dev = data;
 
 	if (netif_running(dev)) {
 		dvb_net_feed_stop(dev);
 		dvb_net_feed_start(dev);
 	}
+}
+
+
+static int dvb_net_set_mac (struct net_device *dev, void *p)
+{
+	struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv;
+	struct sockaddr *addr=p;
+
+	memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+
+	if (netif_running(dev))
+		schedule_work(&priv->restart_net_feed_wq);
+
 	return 0;
 }
 
@@ -493,10 +514,8 @@
 	net=&dvbnet->device[if_num];
 	demux=dvbnet->demux;
 	
-	net->base_addr = 0;
-	net->irq       = 0;
-	net->dma       = 0;
-	net->mem_start = 0;
+	memset(net, 0, sizeof(struct net_device));
+
         memcpy(net->name, "dvb0_0", 7);
 	net->name[3]   = dvbnet->dvbdev->adapter->num + '0';
 	net->name[5]   = if_num + '0';
@@ -514,7 +533,8 @@
         priv->pid = pid;
 	priv->rx_mode = RX_MODE_UNI;
 
-	INIT_WORK(&priv->wq, tq_set_multicast_list, net);
+	INIT_WORK(&priv->set_multicast_list_wq, wq_set_multicast_list, net);
+	INIT_WORK(&priv->restart_net_feed_wq, wq_restart_net_feed, net);
 
         net->base_addr = pid;
                 
@@ -536,6 +556,7 @@
 		return -EBUSY;
 
 	dvb_net_stop(&dvbnet->device[num]);
+	flush_scheduled_work();
 	kfree(priv);
         unregister_netdev(&dvbnet->device[num]);
 	dvbnet->state[num]=0;


  reply	other threads:[~2003-07-15 12:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-15 12:20 [PATCH 1/17] Update the saa7146 driver core Michael Hunold
2003-07-15 12:20 ` [PATCH 2/17] Various small fixes in dvb-core Michael Hunold
2003-07-15 12:20   ` [PATCH 3/17] Major dvb net code cleanup, many fixes Michael Hunold
2003-07-15 12:20     ` [PATCH 4/17] Update dvb frontend drivers Michael Hunold
2003-07-15 12:20       ` [PATCH 5/17] Add Zarlink MT312 DVB-T frontend driver Michael Hunold
2003-07-15 12:20         ` [PATCH 6/17] Update the DVB budget drivers Michael Hunold
2003-07-15 12:20           ` [PATCH 7/17] Update the DVB av7110 driver Michael Hunold
2003-07-15 12:20             ` [PATCH 8/17] Update firmware of " Michael Hunold
2003-07-15 12:20               ` [PATCH 9/17] More saa7146 driver core updates Michael Hunold
2003-07-15 12:20                 ` [PATCH 10/17] Various kconfig and Makefile updates Michael Hunold
2003-07-15 12:20                   ` [PATCH 11/17] Add a driver for the Technisat Skystar2 DVB card Michael Hunold
2003-07-15 12:20                     ` [PATCH 12/17] Add two drivers for Hexium frame grabber cards Michael Hunold
2003-07-15 12:20                       ` Michael Hunold [this message]
2003-07-15 12:20                         ` [PATCH 14/17] Add TDA14500x DVB-T frontend driver Michael Hunold
2003-07-15 12:21                           ` [PATCH 15/17] Update various other frontend drivers Michael Hunold
2003-07-15 12:21                             ` [PATCH 16/17] Update the av7110 DVB driver Michael Hunold
2003-07-16  1:28                     ` [PATCH 11/17] Add a driver for the Technisat Skystar2 DVB card Greg KH
2003-07-16  7:41                       ` Michael Hunold
2003-07-16 16:37                         ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10582716581043@convergence.de \
    --to=hunold@convergence.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).