diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2011-02-05 08:07:39 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:12 -0400 |
commit | e68044e2351ee937997c1e014fbbbe1c97b935cf (patch) | |
tree | c724115a2c4621d4d29e6c2b9a51c887ad2d12f5 /drivers/media/dvb/firewire | |
parent | 7ee40aadabd59b6cab60835f0ef9cdbe385df438 (diff) |
[media] firedtv: remove obsolete ieee1394 backend code
drivers/ieee1394/ has been removed in Linux 2.6.37. The corresponding
backend code in firedtv is no longer built in now and can be deleted.
Firedtv continues to work with drivers/firewire/.
Also, fix a Kconfig menu comment: Removal of CONFIG_IEEE1394 made the
"Supported FireWire (IEEE 1394) Adapters" comment disappear; bring it back
with corrected dependency.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Reviewed-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/firewire')
-rw-r--r-- | drivers/media/dvb/firewire/Kconfig | 8 | ||||
-rw-r--r-- | drivers/media/dvb/firewire/Makefile | 5 | ||||
-rw-r--r-- | drivers/media/dvb/firewire/firedtv-1394.c | 300 | ||||
-rw-r--r-- | drivers/media/dvb/firewire/firedtv-dvb.c | 5 | ||||
-rw-r--r-- | drivers/media/dvb/firewire/firedtv.h | 14 |
5 files changed, 2 insertions, 330 deletions
diff --git a/drivers/media/dvb/firewire/Kconfig b/drivers/media/dvb/firewire/Kconfig index 4afa29256df1..f3e9448c3955 100644 --- a/drivers/media/dvb/firewire/Kconfig +++ b/drivers/media/dvb/firewire/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_FIREDTV | 1 | config DVB_FIREDTV |
2 | tristate "FireDTV and FloppyDTV" | 2 | tristate "FireDTV and FloppyDTV" |
3 | depends on DVB_CORE && (FIREWIRE || IEEE1394) | 3 | depends on DVB_CORE && FIREWIRE |
4 | help | 4 | help |
5 | Support for DVB receivers from Digital Everywhere | 5 | Support for DVB receivers from Digital Everywhere |
6 | which are connected via IEEE 1394 (FireWire). | 6 | which are connected via IEEE 1394 (FireWire). |
@@ -13,12 +13,6 @@ config DVB_FIREDTV | |||
13 | 13 | ||
14 | if DVB_FIREDTV | 14 | if DVB_FIREDTV |
15 | 15 | ||
16 | config DVB_FIREDTV_FIREWIRE | ||
17 | def_bool FIREWIRE = y || (FIREWIRE = m && DVB_FIREDTV = m) | ||
18 | |||
19 | config DVB_FIREDTV_IEEE1394 | ||
20 | def_bool IEEE1394 = y || (IEEE1394 = m && DVB_FIREDTV = m) | ||
21 | |||
22 | config DVB_FIREDTV_INPUT | 16 | config DVB_FIREDTV_INPUT |
23 | def_bool INPUT = y || (INPUT = m && DVB_FIREDTV = m) | 17 | def_bool INPUT = y || (INPUT = m && DVB_FIREDTV = m) |
24 | 18 | ||
diff --git a/drivers/media/dvb/firewire/Makefile b/drivers/media/dvb/firewire/Makefile index da84203d51c6..357b3aab186b 100644 --- a/drivers/media/dvb/firewire/Makefile +++ b/drivers/media/dvb/firewire/Makefile | |||
@@ -1,9 +1,6 @@ | |||
1 | obj-$(CONFIG_DVB_FIREDTV) += firedtv.o | 1 | obj-$(CONFIG_DVB_FIREDTV) += firedtv.o |
2 | 2 | ||
3 | firedtv-y := firedtv-avc.o firedtv-ci.o firedtv-dvb.o firedtv-fe.o | 3 | firedtv-y := firedtv-avc.o firedtv-ci.o firedtv-dvb.o firedtv-fe.o firedtv-fw.o |
4 | firedtv-$(CONFIG_DVB_FIREDTV_FIREWIRE) += firedtv-fw.o | ||
5 | firedtv-$(CONFIG_DVB_FIREDTV_IEEE1394) += firedtv-1394.o | ||
6 | firedtv-$(CONFIG_DVB_FIREDTV_INPUT) += firedtv-rc.o | 4 | firedtv-$(CONFIG_DVB_FIREDTV_INPUT) += firedtv-rc.o |
7 | 5 | ||
8 | ccflags-y += -Idrivers/media/dvb/dvb-core | 6 | ccflags-y += -Idrivers/media/dvb/dvb-core |
9 | ccflags-$(CONFIG_DVB_FIREDTV_IEEE1394) += -Idrivers/ieee1394 | ||
diff --git a/drivers/media/dvb/firewire/firedtv-1394.c b/drivers/media/dvb/firewire/firedtv-1394.c deleted file mode 100644 index b34ca7afb0e6..000000000000 --- a/drivers/media/dvb/firewire/firedtv-1394.c +++ /dev/null | |||
@@ -1,300 +0,0 @@ | |||
1 | /* | ||
2 | * FireDTV driver -- ieee1394 I/O backend | ||
3 | * | ||
4 | * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com> | ||
5 | * Copyright (C) 2007-2008 Ben Backx <ben@bbackx.com> | ||
6 | * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation; either version 2 of | ||
11 | * the License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #include <linux/device.h> | ||
15 | #include <linux/errno.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/slab.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/types.h> | ||
21 | |||
22 | #include <dma.h> | ||
23 | #include <csr1212.h> | ||
24 | #include <highlevel.h> | ||
25 | #include <hosts.h> | ||
26 | #include <ieee1394.h> | ||
27 | #include <iso.h> | ||
28 | #include <nodemgr.h> | ||
29 | |||
30 | #include <dvb_demux.h> | ||
31 | |||
32 | #include "firedtv.h" | ||
33 | |||
34 | static LIST_HEAD(node_list); | ||
35 | static DEFINE_SPINLOCK(node_list_lock); | ||
36 | |||
37 | #define CIP_HEADER_SIZE 8 | ||
38 | #define MPEG2_TS_HEADER_SIZE 4 | ||
39 | #define MPEG2_TS_SOURCE_PACKET_SIZE (4 + 188) | ||
40 | |||
41 | static void rawiso_activity_cb(struct hpsb_iso *iso) | ||
42 | { | ||
43 | struct firedtv *f, *fdtv = NULL; | ||
44 | unsigned int i, num, packet; | ||
45 | unsigned char *buf; | ||
46 | unsigned long flags; | ||
47 | int count; | ||
48 | |||
49 | spin_lock_irqsave(&node_list_lock, flags); | ||
50 | list_for_each_entry(f, &node_list, list) | ||
51 | if (f->backend_data == iso) { | ||
52 | fdtv = f; | ||
53 | break; | ||
54 | } | ||
55 | spin_unlock_irqrestore(&node_list_lock, flags); | ||
56 | |||
57 | packet = iso->first_packet; | ||
58 | num = hpsb_iso_n_ready(iso); | ||
59 | |||
60 | if (!fdtv) { | ||
61 | pr_err("received at unknown iso channel\n"); | ||
62 | goto out; | ||
63 | } | ||
64 | |||
65 | for (i = 0; i < num; i++, packet = (packet + 1) % iso->buf_packets) { | ||
66 | buf = dma_region_i(&iso->data_buf, unsigned char, | ||
67 | iso->infos[packet].offset + CIP_HEADER_SIZE); | ||
68 | count = (iso->infos[packet].len - CIP_HEADER_SIZE) / | ||
69 | MPEG2_TS_SOURCE_PACKET_SIZE; | ||
70 | |||
71 | /* ignore empty packet */ | ||
72 | if (iso->infos[packet].len <= CIP_HEADER_SIZE) | ||
73 | continue; | ||
74 | |||
75 | while (count--) { | ||
76 | if (buf[MPEG2_TS_HEADER_SIZE] == 0x47) | ||
77 | dvb_dmx_swfilter_packets(&fdtv->demux, | ||
78 | &buf[MPEG2_TS_HEADER_SIZE], 1); | ||
79 | else | ||
80 | dev_err(fdtv->device, | ||
81 | "skipping invalid packet\n"); | ||
82 | buf += MPEG2_TS_SOURCE_PACKET_SIZE; | ||
83 | } | ||
84 | } | ||
85 | out: | ||
86 | hpsb_iso_recv_release_packets(iso, num); | ||
87 | } | ||
88 | |||
89 | static inline struct node_entry *node_of(struct firedtv *fdtv) | ||
90 | { | ||
91 | return container_of(fdtv->device, struct unit_directory, device)->ne; | ||
92 | } | ||
93 | |||
94 | static int node_lock(struct firedtv *fdtv, u64 addr, void *data) | ||
95 | { | ||
96 | quadlet_t *d = data; | ||
97 | int ret; | ||
98 | |||
99 | ret = hpsb_node_lock(node_of(fdtv), addr, | ||
100 | EXTCODE_COMPARE_SWAP, &d[1], d[0]); | ||
101 | d[0] = d[1]; | ||
102 | |||
103 | return ret; | ||
104 | } | ||
105 | |||
106 | static int node_read(struct firedtv *fdtv, u64 addr, void *data) | ||
107 | { | ||
108 | return hpsb_node_read(node_of(fdtv), addr, data, 4); | ||
109 | } | ||
110 | |||
111 | static int node_write(struct firedtv *fdtv, u64 addr, void *data, size_t len) | ||
112 | { | ||
113 | return hpsb_node_write(node_of(fdtv), addr, data, len); | ||
114 | } | ||
115 | |||
116 | #define FDTV_ISO_BUFFER_PACKETS 256 | ||
117 | #define FDTV_ISO_BUFFER_SIZE (FDTV_ISO_BUFFER_PACKETS * 200) | ||
118 | |||
119 | static int start_iso(struct firedtv *fdtv) | ||
120 | { | ||
121 | struct hpsb_iso *iso_handle; | ||
122 | int ret; | ||
123 | |||
124 | iso_handle = hpsb_iso_recv_init(node_of(fdtv)->host, | ||
125 | FDTV_ISO_BUFFER_SIZE, FDTV_ISO_BUFFER_PACKETS, | ||
126 | fdtv->isochannel, HPSB_ISO_DMA_DEFAULT, | ||
127 | -1, /* stat.config.irq_interval */ | ||
128 | rawiso_activity_cb); | ||
129 | if (iso_handle == NULL) { | ||
130 | dev_err(fdtv->device, "cannot initialize iso receive\n"); | ||
131 | return -ENOMEM; | ||
132 | } | ||
133 | fdtv->backend_data = iso_handle; | ||
134 | |||
135 | ret = hpsb_iso_recv_start(iso_handle, -1, -1, 0); | ||
136 | if (ret != 0) { | ||
137 | dev_err(fdtv->device, "cannot start iso receive\n"); | ||
138 | hpsb_iso_shutdown(iso_handle); | ||
139 | fdtv->backend_data = NULL; | ||
140 | } | ||
141 | return ret; | ||
142 | } | ||
143 | |||
144 | static void stop_iso(struct firedtv *fdtv) | ||
145 | { | ||
146 | struct hpsb_iso *iso_handle = fdtv->backend_data; | ||
147 | |||
148 | if (iso_handle != NULL) { | ||
149 | hpsb_iso_stop(iso_handle); | ||
150 | hpsb_iso_shutdown(iso_handle); | ||
151 | } | ||
152 | fdtv->backend_data = NULL; | ||
153 | } | ||
154 | |||
155 | static const struct firedtv_backend fdtv_1394_backend = { | ||
156 | .lock = node_lock, | ||
157 | .read = node_read, | ||
158 | .write = node_write, | ||
159 | .start_iso = start_iso, | ||
160 | .stop_iso = stop_iso, | ||
161 | }; | ||
162 | |||
163 | static void fcp_request(struct hpsb_host *host, int nodeid, int direction, | ||
164 | int cts, u8 *data, size_t length) | ||
165 | { | ||
166 | struct firedtv *f, *fdtv = NULL; | ||
167 | unsigned long flags; | ||
168 | int su; | ||
169 | |||
170 | if (length == 0 || (data[0] & 0xf0) != 0) | ||
171 | return; | ||
172 | |||
173 | su = data[1] & 0x7; | ||
174 | |||
175 | spin_lock_irqsave(&node_list_lock, flags); | ||
176 | list_for_each_entry(f, &node_list, list) | ||
177 | if (node_of(f)->host == host && | ||
178 | node_of(f)->nodeid == nodeid && | ||
179 | (f->subunit == su || (f->subunit == 0 && su == 0x7))) { | ||
180 | fdtv = f; | ||
181 | break; | ||
182 | } | ||
183 | spin_unlock_irqrestore(&node_list_lock, flags); | ||
184 | |||
185 | if (fdtv) | ||
186 | avc_recv(fdtv, data, length); | ||
187 | } | ||
188 | |||
189 | static int node_probe(struct device *dev) | ||
190 | { | ||
191 | struct unit_directory *ud = | ||
192 | container_of(dev, struct unit_directory, device); | ||
193 | struct firedtv *fdtv; | ||
194 | int kv_len, err; | ||
195 | void *kv_str; | ||
196 | |||
197 | if (ud->model_name_kv) { | ||
198 | kv_len = (ud->model_name_kv->value.leaf.len - 2) * 4; | ||
199 | kv_str = CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(ud->model_name_kv); | ||
200 | } else { | ||
201 | kv_len = 0; | ||
202 | kv_str = NULL; | ||
203 | } | ||
204 | fdtv = fdtv_alloc(dev, &fdtv_1394_backend, kv_str, kv_len); | ||
205 | if (!fdtv) | ||
206 | return -ENOMEM; | ||
207 | |||
208 | /* | ||
209 | * Work around a bug in udev's path_id script: Use the fw-host's dev | ||
210 | * instead of the unit directory's dev as parent of the input device. | ||
211 | */ | ||
212 | err = fdtv_register_rc(fdtv, dev->parent->parent); | ||
213 | if (err) | ||
214 | goto fail_free; | ||
215 | |||
216 | spin_lock_irq(&node_list_lock); | ||
217 | list_add_tail(&fdtv->list, &node_list); | ||
218 | spin_unlock_irq(&node_list_lock); | ||
219 | |||
220 | err = avc_identify_subunit(fdtv); | ||
221 | if (err) | ||
222 | goto fail; | ||
223 | |||
224 | err = fdtv_dvb_register(fdtv); | ||
225 | if (err) | ||
226 | goto fail; | ||
227 | |||
228 | avc_register_remote_control(fdtv); | ||
229 | |||
230 | return 0; | ||
231 | fail: | ||
232 | spin_lock_irq(&node_list_lock); | ||
233 | list_del(&fdtv->list); | ||
234 | spin_unlock_irq(&node_list_lock); | ||
235 | fdtv_unregister_rc(fdtv); | ||
236 | fail_free: | ||
237 | kfree(fdtv); | ||
238 | |||
239 | return err; | ||
240 | } | ||
241 | |||
242 | static int node_remove(struct device *dev) | ||
243 | { | ||
244 | struct firedtv *fdtv = dev_get_drvdata(dev); | ||
245 | |||
246 | fdtv_dvb_unregister(fdtv); | ||
247 | |||
248 | spin_lock_irq(&node_list_lock); | ||
249 | list_del(&fdtv->list); | ||
250 | spin_unlock_irq(&node_list_lock); | ||
251 | |||
252 | fdtv_unregister_rc(fdtv); | ||
253 | kfree(fdtv); | ||
254 | |||
255 | return 0; | ||
256 | } | ||
257 | |||
258 | static int node_update(struct unit_directory *ud) | ||
259 | { | ||
260 | struct firedtv *fdtv = dev_get_drvdata(&ud->device); | ||
261 | |||
262 | if (fdtv->isochannel >= 0) | ||
263 | cmp_establish_pp_connection(fdtv, fdtv->subunit, | ||
264 | fdtv->isochannel); | ||
265 | return 0; | ||
266 | } | ||
267 | |||
268 | static struct hpsb_protocol_driver fdtv_driver = { | ||
269 | .name = "firedtv", | ||
270 | .id_table = fdtv_id_table, | ||
271 | .update = node_update, | ||
272 | .driver = { | ||
273 | .probe = node_probe, | ||
274 | .remove = node_remove, | ||
275 | }, | ||
276 | }; | ||
277 | |||
278 | static struct hpsb_highlevel fdtv_highlevel = { | ||
279 | .name = "firedtv", | ||
280 | .fcp_request = fcp_request, | ||
281 | }; | ||
282 | |||
283 | int __init fdtv_1394_init(void) | ||
284 | { | ||
285 | int ret; | ||
286 | |||
287 | hpsb_register_highlevel(&fdtv_highlevel); | ||
288 | ret = hpsb_register_protocol(&fdtv_driver); | ||
289 | if (ret) { | ||
290 | printk(KERN_ERR "firedtv: failed to register protocol\n"); | ||
291 | hpsb_unregister_highlevel(&fdtv_highlevel); | ||
292 | } | ||
293 | return ret; | ||
294 | } | ||
295 | |||
296 | void __exit fdtv_1394_exit(void) | ||
297 | { | ||
298 | hpsb_unregister_protocol(&fdtv_driver); | ||
299 | hpsb_unregister_highlevel(&fdtv_highlevel); | ||
300 | } | ||
diff --git a/drivers/media/dvb/firewire/firedtv-dvb.c b/drivers/media/dvb/firewire/firedtv-dvb.c index 079e8c5b0475..86349db75250 100644 --- a/drivers/media/dvb/firewire/firedtv-dvb.c +++ b/drivers/media/dvb/firewire/firedtv-dvb.c | |||
@@ -351,16 +351,11 @@ static int __init fdtv_init(void) | |||
351 | if (ret < 0) | 351 | if (ret < 0) |
352 | return ret; | 352 | return ret; |
353 | 353 | ||
354 | ret = fdtv_1394_init(); | ||
355 | if (ret < 0) | ||
356 | fdtv_fw_exit(); | ||
357 | |||
358 | return ret; | 354 | return ret; |
359 | } | 355 | } |
360 | 356 | ||
361 | static void __exit fdtv_exit(void) | 357 | static void __exit fdtv_exit(void) |
362 | { | 358 | { |
363 | fdtv_1394_exit(); | ||
364 | fdtv_fw_exit(); | 359 | fdtv_fw_exit(); |
365 | } | 360 | } |
366 | 361 | ||
diff --git a/drivers/media/dvb/firewire/firedtv.h b/drivers/media/dvb/firewire/firedtv.h index 78cc28f36914..4a87049c9132 100644 --- a/drivers/media/dvb/firewire/firedtv.h +++ b/drivers/media/dvb/firewire/firedtv.h | |||
@@ -118,15 +118,6 @@ struct firedtv { | |||
118 | u8 avc_data[512]; | 118 | u8 avc_data[512]; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | /* firedtv-1394.c */ | ||
122 | #ifdef CONFIG_DVB_FIREDTV_IEEE1394 | ||
123 | int fdtv_1394_init(void); | ||
124 | void fdtv_1394_exit(void); | ||
125 | #else | ||
126 | static inline int fdtv_1394_init(void) { return 0; } | ||
127 | static inline void fdtv_1394_exit(void) {} | ||
128 | #endif | ||
129 | |||
130 | /* firedtv-avc.c */ | 121 | /* firedtv-avc.c */ |
131 | int avc_recv(struct firedtv *fdtv, void *data, size_t length); | 122 | int avc_recv(struct firedtv *fdtv, void *data, size_t length); |
132 | int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat); | 123 | int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat); |
@@ -170,13 +161,8 @@ extern const struct ieee1394_device_id fdtv_id_table[]; | |||
170 | void fdtv_frontend_init(struct firedtv *fdtv); | 161 | void fdtv_frontend_init(struct firedtv *fdtv); |
171 | 162 | ||
172 | /* firedtv-fw.c */ | 163 | /* firedtv-fw.c */ |
173 | #ifdef CONFIG_DVB_FIREDTV_FIREWIRE | ||
174 | int fdtv_fw_init(void); | 164 | int fdtv_fw_init(void); |
175 | void fdtv_fw_exit(void); | 165 | void fdtv_fw_exit(void); |
176 | #else | ||
177 | static inline int fdtv_fw_init(void) { return 0; } | ||
178 | static inline void fdtv_fw_exit(void) {} | ||
179 | #endif | ||
180 | 166 | ||
181 | /* firedtv-rc.c */ | 167 | /* firedtv-rc.c */ |
182 | #ifdef CONFIG_DVB_FIREDTV_INPUT | 168 | #ifdef CONFIG_DVB_FIREDTV_INPUT |