blob: 77b3c338506624992f9023eff7adc2a123dd3550 [file] [log] [blame]
Michael Krufky04910bd2008-02-03 23:46:16 -03001/*
2 * pvrusb2-dvb.c - linux-dvb api interface to the pvrusb2 driver.
3 *
4 * Copyright (C) 2007, 2008 Michael Krufky <mkrufky@linuxtv.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
Michael Krufkyd8abe972008-02-03 23:55:07 -030021#include <linux/kthread.h>
Mike Iselybb8ce9d2008-02-04 00:00:19 -030022#include <linux/freezer.h>
Andrea Righi27ac7922008-07-23 21:28:13 -070023#include <linux/mm.h>
Michael Krufky04910bd2008-02-03 23:46:16 -030024#include "dvbdev.h"
Michael Krufky485fcae2008-04-26 19:44:59 -030025#include "pvrusb2-debug.h"
Michael Krufky04910bd2008-02-03 23:46:16 -030026#include "pvrusb2-hdw-internal.h"
27#include "pvrusb2-hdw.h"
Mike Iselybb8ce9d2008-02-04 00:00:19 -030028#include "pvrusb2-io.h"
Michael Krufky04910bd2008-02-03 23:46:16 -030029#include "pvrusb2-dvb.h"
30
31DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
32
Mike Iselyceb43402008-02-06 04:24:51 -030033static int pvr2_dvb_feed_func(struct pvr2_dvb_adapter *adap)
Mike Iselybb8ce9d2008-02-04 00:00:19 -030034{
Mike Iselybb8ce9d2008-02-04 00:00:19 -030035 int ret;
36 unsigned int count;
37 struct pvr2_buffer *bp;
Mike Iselya36416d2008-02-06 06:59:48 -030038 struct pvr2_stream *stream;
Mike Iselybb8ce9d2008-02-04 00:00:19 -030039
Michael Krufky485fcae2008-04-26 19:44:59 -030040 pvr2_trace(PVR2_TRACE_DVB_FEED, "dvb feed thread started");
Mike Iselybb8ce9d2008-02-04 00:00:19 -030041 set_freezable();
42
Mike Iselya36416d2008-02-06 06:59:48 -030043 stream = adap->channel.stream->stream;
Mike Iselybb8ce9d2008-02-04 00:00:19 -030044
45 for (;;) {
Mike Iselya36416d2008-02-06 06:59:48 -030046 if (kthread_should_stop()) break;
Mike Iselybb8ce9d2008-02-04 00:00:19 -030047
48 /* Not sure about this... */
49 try_to_freeze();
50
Mike Iselya36416d2008-02-06 06:59:48 -030051 bp = pvr2_stream_get_ready_buffer(stream);
Mike Iselybb8ce9d2008-02-04 00:00:19 -030052 if (bp != NULL) {
53 count = pvr2_buffer_get_count(bp);
54 if (count) {
55 dvb_dmx_swfilter(
56 &adap->demux,
Mike Iselya36416d2008-02-06 06:59:48 -030057 adap->buffer_storage[
58 pvr2_buffer_get_id(bp)],
Mike Iselybb8ce9d2008-02-04 00:00:19 -030059 count);
60 } else {
61 ret = pvr2_buffer_get_status(bp);
Mike Iselya36416d2008-02-06 06:59:48 -030062 if (ret < 0) break;
Mike Iselybb8ce9d2008-02-04 00:00:19 -030063 }
64 ret = pvr2_buffer_queue(bp);
Mike Iselya36416d2008-02-06 06:59:48 -030065 if (ret < 0) break;
Mike Iselybb8ce9d2008-02-04 00:00:19 -030066
67 /* Since we know we did something to a buffer,
68 just go back and try again. No point in
69 blocking unless we really ran out of
70 buffers to process. */
71 continue;
72 }
73
74
Mike Isely07b80262008-03-30 20:36:31 -030075 /* Wait until more buffers become available or we're
76 told not to wait any longer. */
Mike Iselybb8ce9d2008-02-04 00:00:19 -030077 ret = wait_event_interruptible(
Mike Iselya36416d2008-02-06 06:59:48 -030078 adap->buffer_wait_data,
Mike Isely07b80262008-03-30 20:36:31 -030079 (pvr2_stream_get_ready_count(stream) > 0) ||
Mike Isely13e027a2008-04-07 02:57:13 -030080 kthread_should_stop());
Mike Iselya36416d2008-02-06 06:59:48 -030081 if (ret < 0) break;
Mike Iselybb8ce9d2008-02-04 00:00:19 -030082 }
83
Mike Iselybb8ce9d2008-02-04 00:00:19 -030084 /* If we get here and ret is < 0, then an error has occurred.
85 Probably would be a good idea to communicate that to DVB core... */
86
Michael Krufky485fcae2008-04-26 19:44:59 -030087 pvr2_trace(PVR2_TRACE_DVB_FEED, "dvb feed thread stopped");
Mike Iselybb8ce9d2008-02-04 00:00:19 -030088
Mike Iselyceb43402008-02-06 04:24:51 -030089 return 0;
90}
91
92static int pvr2_dvb_feed_thread(void *data)
93{
94 int stat = pvr2_dvb_feed_func(data);
Mike Iselybb8ce9d2008-02-04 00:00:19 -030095 /* from videobuf-dvb.c: */
96 while (!kthread_should_stop()) {
97 set_current_state(TASK_INTERRUPTIBLE);
98 schedule();
99 }
Mike Iselyceb43402008-02-06 04:24:51 -0300100 return stat;
Mike Iselybb8ce9d2008-02-04 00:00:19 -0300101}
102
Mike Iselya36416d2008-02-06 06:59:48 -0300103static void pvr2_dvb_notify(struct pvr2_dvb_adapter *adap)
Michael Krufkyd8abe972008-02-03 23:55:07 -0300104{
Mike Iselya36416d2008-02-06 06:59:48 -0300105 wake_up(&adap->buffer_wait_data);
106}
Michael Krufkyd8abe972008-02-03 23:55:07 -0300107
Mike Iselya36416d2008-02-06 06:59:48 -0300108static void pvr2_dvb_stream_end(struct pvr2_dvb_adapter *adap)
109{
110 unsigned int idx;
111 struct pvr2_stream *stream;
Michael Krufkyd8abe972008-02-03 23:55:07 -0300112
Mike Iselya36416d2008-02-06 06:59:48 -0300113 if (adap->thread) {
114 kthread_stop(adap->thread);
Michael Krufkyd8abe972008-02-03 23:55:07 -0300115 adap->thread = NULL;
116 }
117
Mike Iselya36416d2008-02-06 06:59:48 -0300118 if (adap->channel.stream) {
119 stream = adap->channel.stream->stream;
120 } else {
121 stream = NULL;
Michael Krufkyd8abe972008-02-03 23:55:07 -0300122 }
Mike Iselya36416d2008-02-06 06:59:48 -0300123 if (stream) {
124 pvr2_hdw_set_streaming(adap->channel.hdw, 0);
125 pvr2_stream_set_callback(stream, NULL, NULL);
126 pvr2_stream_kill(stream);
127 pvr2_stream_set_buffer_count(stream, 0);
128 pvr2_channel_claim_stream(&adap->channel, NULL);
129 }
130
131 if (adap->stream_run) {
132 for (idx = 0; idx < PVR2_DVB_BUFFER_COUNT; idx++) {
133 if (!(adap->buffer_storage[idx])) continue;
134 kfree(adap->buffer_storage[idx]);
Harvey Harrisona6a3a172008-04-28 16:50:03 -0700135 adap->buffer_storage[idx] = NULL;
Mike Iselya36416d2008-02-06 06:59:48 -0300136 }
137 adap->stream_run = 0;
138 }
139}
140
141static int pvr2_dvb_stream_do_start(struct pvr2_dvb_adapter *adap)
142{
143 struct pvr2_context *pvr = adap->channel.mc_head;
144 unsigned int idx;
145 int ret;
146 struct pvr2_buffer *bp;
Harvey Harrisona6a3a172008-04-28 16:50:03 -0700147 struct pvr2_stream *stream = NULL;
Mike Iselya36416d2008-02-06 06:59:48 -0300148
149 if (adap->stream_run) return -EIO;
150
151 ret = pvr2_channel_claim_stream(&adap->channel, &pvr->video_stream);
152 /* somebody else already has the stream */
153 if (ret < 0) return ret;
154
155 stream = adap->channel.stream->stream;
156
157 for (idx = 0; idx < PVR2_DVB_BUFFER_COUNT; idx++) {
158 adap->buffer_storage[idx] = kmalloc(PVR2_DVB_BUFFER_SIZE,
159 GFP_KERNEL);
160 if (!(adap->buffer_storage[idx])) return -ENOMEM;
161 }
162
163 pvr2_stream_set_callback(pvr->video_stream.stream,
164 (pvr2_stream_callback) pvr2_dvb_notify, adap);
165
166 ret = pvr2_stream_set_buffer_count(stream, PVR2_DVB_BUFFER_COUNT);
167 if (ret < 0) return ret;
168
169 for (idx = 0; idx < PVR2_DVB_BUFFER_COUNT; idx++) {
170 bp = pvr2_stream_get_buffer(stream, idx);
171 pvr2_buffer_set_buffer(bp,
172 adap->buffer_storage[idx],
173 PVR2_DVB_BUFFER_SIZE);
174 }
175
176 ret = pvr2_hdw_set_streaming(adap->channel.hdw, 1);
177 if (ret < 0) return ret;
178
Harvey Harrisona6a3a172008-04-28 16:50:03 -0700179 while ((bp = pvr2_stream_get_idle_buffer(stream)) != NULL) {
Mike Iselya36416d2008-02-06 06:59:48 -0300180 ret = pvr2_buffer_queue(bp);
181 if (ret < 0) return ret;
182 }
183
184 adap->thread = kthread_run(pvr2_dvb_feed_thread, adap, "pvrusb2-dvb");
185
186 if (IS_ERR(adap->thread)) {
187 ret = PTR_ERR(adap->thread);
188 adap->thread = NULL;
189 return ret;
190 }
191
192 adap->stream_run = !0;
193
194 return 0;
195}
196
197static int pvr2_dvb_stream_start(struct pvr2_dvb_adapter *adap)
198{
199 int ret = pvr2_dvb_stream_do_start(adap);
200 if (ret < 0) pvr2_dvb_stream_end(adap);
201 return ret;
202}
203
204static int pvr2_dvb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff)
205{
206 struct pvr2_dvb_adapter *adap = dvbdmxfeed->demux->priv;
207 int ret = 0;
208
209 if (adap == NULL) return -ENODEV;
210
211 mutex_lock(&adap->lock);
212 do {
213 if (onoff) {
214 if (!adap->feedcount) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300215 pvr2_trace(PVR2_TRACE_DVB_FEED,
216 "start feeding demux");
Mike Iselya36416d2008-02-06 06:59:48 -0300217 ret = pvr2_dvb_stream_start(adap);
218 if (ret < 0) break;
219 }
220 (adap->feedcount)++;
221 } else if (adap->feedcount > 0) {
222 (adap->feedcount)--;
223 if (!adap->feedcount) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300224 pvr2_trace(PVR2_TRACE_DVB_FEED,
225 "stop feeding demux");
Mike Iselya36416d2008-02-06 06:59:48 -0300226 pvr2_dvb_stream_end(adap);
227 }
228 }
229 } while (0);
Michael Krufkyd8abe972008-02-03 23:55:07 -0300230 mutex_unlock(&adap->lock);
231
232 return ret;
233}
234
Michael Krufky04910bd2008-02-03 23:46:16 -0300235static int pvr2_dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
236{
Michael Krufky485fcae2008-04-26 19:44:59 -0300237 pvr2_trace(PVR2_TRACE_DVB_FEED, "start pid: 0x%04x", dvbdmxfeed->pid);
Michael Krufkyd8abe972008-02-03 23:55:07 -0300238 return pvr2_dvb_ctrl_feed(dvbdmxfeed, 1);
Michael Krufky04910bd2008-02-03 23:46:16 -0300239}
240
241static int pvr2_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
242{
Michael Krufky485fcae2008-04-26 19:44:59 -0300243 pvr2_trace(PVR2_TRACE_DVB_FEED, "stop pid: 0x%04x", dvbdmxfeed->pid);
Michael Krufkyd8abe972008-02-03 23:55:07 -0300244 return pvr2_dvb_ctrl_feed(dvbdmxfeed, 0);
Michael Krufky04910bd2008-02-03 23:46:16 -0300245}
246
Michael Krufky99443ae2008-02-03 23:48:09 -0300247static int pvr2_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire)
248{
Mike Isely1cb03b72008-04-21 03:47:43 -0300249 struct pvr2_dvb_adapter *adap = fe->dvb->priv;
250 return pvr2_channel_limit_inputs(
251 &adap->channel,
252 (acquire ? (1 << PVR2_CVAL_INPUT_DTV) : 0));
Michael Krufky99443ae2008-02-03 23:48:09 -0300253}
254
Michael Krufky04910bd2008-02-03 23:46:16 -0300255static int pvr2_dvb_adapter_init(struct pvr2_dvb_adapter *adap)
256{
257 int ret;
258
259 ret = dvb_register_adapter(&adap->dvb_adap, "pvrusb2-dvb",
260 THIS_MODULE/*&hdw->usb_dev->owner*/,
Mike Iselya36416d2008-02-06 06:59:48 -0300261 &adap->channel.hdw->usb_dev->dev,
Michael Krufky04910bd2008-02-03 23:46:16 -0300262 adapter_nr);
263 if (ret < 0) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300264 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
265 "dvb_register_adapter failed: error %d", ret);
Michael Krufky04910bd2008-02-03 23:46:16 -0300266 goto err;
267 }
268 adap->dvb_adap.priv = adap;
269
270 adap->demux.dmx.capabilities = DMX_TS_FILTERING |
271 DMX_SECTION_FILTERING |
272 DMX_MEMORY_BASED_FILTERING;
273 adap->demux.priv = adap;
274 adap->demux.filternum = 256;
275 adap->demux.feednum = 256;
276 adap->demux.start_feed = pvr2_dvb_start_feed;
277 adap->demux.stop_feed = pvr2_dvb_stop_feed;
278 adap->demux.write_to_decoder = NULL;
279
280 ret = dvb_dmx_init(&adap->demux);
281 if (ret < 0) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300282 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
283 "dvb_dmx_init failed: error %d", ret);
Michael Krufky04910bd2008-02-03 23:46:16 -0300284 goto err_dmx;
285 }
286
287 adap->dmxdev.filternum = adap->demux.filternum;
288 adap->dmxdev.demux = &adap->demux.dmx;
289 adap->dmxdev.capabilities = 0;
290
291 ret = dvb_dmxdev_init(&adap->dmxdev, &adap->dvb_adap);
292 if (ret < 0) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300293 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
294 "dvb_dmxdev_init failed: error %d", ret);
Michael Krufky04910bd2008-02-03 23:46:16 -0300295 goto err_dmx_dev;
296 }
297
298 dvb_net_init(&adap->dvb_adap, &adap->dvb_net, &adap->demux.dmx);
299
Michael Krufky04910bd2008-02-03 23:46:16 -0300300 return 0;
301
302err_dmx_dev:
303 dvb_dmx_release(&adap->demux);
304err_dmx:
305 dvb_unregister_adapter(&adap->dvb_adap);
306err:
307 return ret;
308}
309
310static int pvr2_dvb_adapter_exit(struct pvr2_dvb_adapter *adap)
311{
Michael Krufky485fcae2008-04-26 19:44:59 -0300312 pvr2_trace(PVR2_TRACE_INFO, "unregistering DVB devices");
Mike Isely7dcc48f2008-02-09 15:55:54 -0300313 dvb_net_release(&adap->dvb_net);
314 adap->demux.dmx.close(&adap->demux.dmx);
315 dvb_dmxdev_release(&adap->dmxdev);
316 dvb_dmx_release(&adap->demux);
317 dvb_unregister_adapter(&adap->dvb_adap);
Michael Krufky04910bd2008-02-03 23:46:16 -0300318 return 0;
319}
320
321static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap)
322{
Mike Iselya36416d2008-02-06 06:59:48 -0300323 struct pvr2_hdw *hdw = adap->channel.hdw;
Michael Krufkybde316a2008-02-10 05:33:37 -0300324 struct pvr2_dvb_props *dvb_props = hdw->hdw_desc->dvb_props;
Mike Isely1cb03b72008-04-21 03:47:43 -0300325 int ret = 0;
Michael Krufky04910bd2008-02-03 23:46:16 -0300326
327 if (dvb_props == NULL) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300328 pvr2_trace(PVR2_TRACE_ERROR_LEGS, "fe_props not defined!");
Michael Krufky04910bd2008-02-03 23:46:16 -0300329 return -EINVAL;
330 }
331
Mike Isely1cb03b72008-04-21 03:47:43 -0300332 ret = pvr2_channel_limit_inputs(
333 &adap->channel,
334 (1 << PVR2_CVAL_INPUT_DTV));
335 if (ret) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300336 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
337 "failed to grab control of dtv input (code=%d)",
Mike Isely1cb03b72008-04-21 03:47:43 -0300338 ret);
Michael Krufkybde316a2008-02-10 05:33:37 -0300339 return ret;
Mike Isely1cb03b72008-04-21 03:47:43 -0300340 }
Michael Krufkybde316a2008-02-10 05:33:37 -0300341
Michael Krufky04910bd2008-02-03 23:46:16 -0300342 if (dvb_props->frontend_attach == NULL) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300343 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
344 "frontend_attach not defined!");
Mike Isely1cb03b72008-04-21 03:47:43 -0300345 ret = -EINVAL;
346 goto done;
Michael Krufky04910bd2008-02-03 23:46:16 -0300347 }
348
349 if ((dvb_props->frontend_attach(adap) == 0) && (adap->fe)) {
350
351 if (dvb_register_frontend(&adap->dvb_adap, adap->fe)) {
Michael Krufky485fcae2008-04-26 19:44:59 -0300352 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
353 "frontend registration failed!");
Michael Krufky04910bd2008-02-03 23:46:16 -0300354 dvb_frontend_detach(adap->fe);
355 adap->fe = NULL;
Mike Isely1cb03b72008-04-21 03:47:43 -0300356 ret = -ENODEV;
357 goto done;
Michael Krufky04910bd2008-02-03 23:46:16 -0300358 }
359
360 if (dvb_props->tuner_attach)
361 dvb_props->tuner_attach(adap);
362
363 if (adap->fe->ops.analog_ops.standby)
364 adap->fe->ops.analog_ops.standby(adap->fe);
365
Michael Krufky99443ae2008-02-03 23:48:09 -0300366 /* Ensure all frontends negotiate bus access */
367 adap->fe->ops.ts_bus_ctrl = pvr2_dvb_bus_ctrl;
368
Michael Krufky04910bd2008-02-03 23:46:16 -0300369 } else {
Michael Krufky485fcae2008-04-26 19:44:59 -0300370 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
371 "no frontend was attached!");
Mike Isely1cb03b72008-04-21 03:47:43 -0300372 ret = -ENODEV;
373 return ret;
Michael Krufky04910bd2008-02-03 23:46:16 -0300374 }
375
Mike Isely1cb03b72008-04-21 03:47:43 -0300376 done:
377 pvr2_channel_limit_inputs(&adap->channel, 0);
378 return ret;
Michael Krufky04910bd2008-02-03 23:46:16 -0300379}
380
381static int pvr2_dvb_frontend_exit(struct pvr2_dvb_adapter *adap)
382{
383 if (adap->fe != NULL) {
384 dvb_unregister_frontend(adap->fe);
385 dvb_frontend_detach(adap->fe);
386 }
387 return 0;
388}
389
Mike Iselyc5317b12008-02-09 19:47:07 -0300390static void pvr2_dvb_destroy(struct pvr2_dvb_adapter *adap)
Mike Isely891d99e2008-02-09 15:44:30 -0300391{
392 pvr2_dvb_stream_end(adap);
393 pvr2_dvb_frontend_exit(adap);
394 pvr2_dvb_adapter_exit(adap);
395 pvr2_channel_done(&adap->channel);
Mike Iselyc5317b12008-02-09 19:47:07 -0300396 kfree(adap);
Mike Isely891d99e2008-02-09 15:44:30 -0300397}
398
399static void pvr2_dvb_internal_check(struct pvr2_channel *chp)
400{
401 struct pvr2_dvb_adapter *adap;
402 adap = container_of(chp, struct pvr2_dvb_adapter, channel);
403 if (!adap->channel.mc_head->disconnect_flag) return;
Mike Iselyc5317b12008-02-09 19:47:07 -0300404 pvr2_dvb_destroy(adap);
Mike Isely891d99e2008-02-09 15:44:30 -0300405}
406
Mike Iselyc5317b12008-02-09 19:47:07 -0300407struct pvr2_dvb_adapter *pvr2_dvb_create(struct pvr2_context *pvr)
Michael Krufky04910bd2008-02-03 23:46:16 -0300408{
409 int ret = 0;
Mike Iselya36416d2008-02-06 06:59:48 -0300410 struct pvr2_dvb_adapter *adap;
Mike Isely129a2f52008-02-09 16:29:52 -0300411 if (!pvr->hdw->hdw_desc->dvb_props) {
412 /* Device lacks a digital interface so don't set up
413 the DVB side of the driver either. For now. */
Mike Iselye6d11862008-02-09 19:47:52 -0300414 return NULL;
Mike Isely129a2f52008-02-09 16:29:52 -0300415 }
Mike Iselyc5317b12008-02-09 19:47:07 -0300416 adap = kzalloc(sizeof(*adap), GFP_KERNEL);
417 if (!adap) return adap;
Mike Iselya36416d2008-02-06 06:59:48 -0300418 pvr2_channel_init(&adap->channel, pvr);
Mike Isely891d99e2008-02-09 15:44:30 -0300419 adap->channel.check_func = pvr2_dvb_internal_check;
Mike Iselya36416d2008-02-06 06:59:48 -0300420 init_waitqueue_head(&adap->buffer_wait_data);
Mike Iselyc5317b12008-02-09 19:47:07 -0300421 mutex_init(&adap->lock);
422 ret = pvr2_dvb_adapter_init(adap);
Mike Isely129a2f52008-02-09 16:29:52 -0300423 if (ret < 0) goto fail1;
Mike Iselyc5317b12008-02-09 19:47:07 -0300424 ret = pvr2_dvb_frontend_init(adap);
Mike Isely129a2f52008-02-09 16:29:52 -0300425 if (ret < 0) goto fail2;
Mike Iselyc5317b12008-02-09 19:47:07 -0300426 return adap;
Mike Isely129a2f52008-02-09 16:29:52 -0300427
428fail2:
429 pvr2_dvb_adapter_exit(adap);
430fail1:
Mike Isely891d99e2008-02-09 15:44:30 -0300431 pvr2_channel_done(&adap->channel);
Mike Iselyc5317b12008-02-09 19:47:07 -0300432 return NULL;
Michael Krufky04910bd2008-02-03 23:46:16 -0300433}
434