Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
e9be31a3
Commit
e9be31a3
authored
Jul 16, 2003
by
Michael Hunold
Committed by
Linus Torvalds
Jul 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] More updates for the dvb core
parent
a03e1a2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
15 deletions
+36
-15
drivers/media/dvb/dvb-core/dvb_demux.c
drivers/media/dvb/dvb-core/dvb_demux.c
+11
-3
drivers/media/dvb/dvb-core/dvb_net.c
drivers/media/dvb/dvb-core/dvb_net.c
+25
-12
No files found.
drivers/media/dvb/dvb-core/dvb_demux.c
View file @
e9be31a3
...
...
@@ -403,13 +403,16 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
{
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 +427,14 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
i
=
count
-
p
;
memcpy
(
demux
->
tsbuf
,
buf
+
p
,
i
);
demux
->
tsbufp
=
i
;
return
;
goto
bailout
;
}
}
else
p
++
;
}
bailout:
spin_unlock
(
&
demux
->
lock
);
}
...
...
@@ -1030,9 +1036,11 @@ static int dvbdmx_write(struct dmx_demux *demux, const char *buf, size_t count)
if
(
down_interruptible
(
&
dvbdemux
->
mutex
))
return
-
ERESTARTSYS
;
dvb_dmx_swfilter
(
dvbdemux
,
buf
,
count
);
up
(
&
dvbdemux
->
mutex
);
if
(
signal_pending
(
current
))
return
-
EINTR
;
return
count
;
}
...
...
drivers/media/dvb/dvb-core/dvb_net.c
View file @
e9be31a3
...
...
@@ -57,7 +57,8 @@ struct dvb_net_priv {
#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 +355,7 @@ static int dvb_set_mc_filter (struct net_device *dev, struct dev_mc_list *mc)
}
static
void
t
q_set_multicast_list
(
void
*
data
)
static
void
w
q_set_multicast_list
(
void
*
data
)
{
struct
net_device
*
dev
=
data
;
struct
dvb_net_priv
*
priv
=
(
struct
dvb_net_priv
*
)
dev
->
priv
;
...
...
@@ -393,7 +394,7 @@ static void tq_set_multicast_list (void *data)
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 +405,28 @@ static int dvb_net_set_config(struct net_device *dev, struct ifmap *map)
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 +506,8 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid)
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 +525,8 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid)
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 +548,7 @@ static int dvb_net_remove_if(struct dvb_net *dvbnet, int num)
return
-
EBUSY
;
dvb_net_stop
(
&
dvbnet
->
device
[
num
]);
flush_scheduled_work
();
kfree
(
priv
);
unregister_netdev
(
&
dvbnet
->
device
[
num
]);
dvbnet
->
state
[
num
]
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment