Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 60110
Collapse All | Expand All

(-)lirc-0.7.0pre7/ChangeLog (+7 lines)
Lines 1-3 Link Here
1
2004-07-25  psypete <psyphreak@phreaker.net>
2
	* drivers/Makefile.am, configure.in, setup.data:
3
	fixed hunk failures from streamzap-0.6.diff.
4
	* autogen.sh:
5
	added from lirc cvs HEAD. why don't developers ever include this with
6
	their source??? :P
7
1
2004-07-25  lirc  <lirc@k7>
8
2004-07-25  lirc  <lirc@k7>
2
9
3
	* doc/html-source/index.html, ANNOUNCE, configure.in, NEWS, setup.sh:
10
	* doc/html-source/index.html, ANNOUNCE, configure.in, NEWS, setup.sh:
(-)lirc-0.7.0pre7/README.STREAMZAP (+8 lines)
Line 0 Link Here
1
Run autogen.sh to finish generating the makefiles, etc for the Streamzap.
2
Then run setup.sh and pick the Streamzap driver from the USB Devices section
3
of the driver-picker.
4
You also might want to put your kernel's sources in /usr/src/linux to make
5
configuration a tad easier :)
6
Then edit configure.sh if you want, and run it to configure lirc.
7
Then run make && make install.
8
Don't forget to copy/edit/use the streamzap config file!
(-)lirc-0.7.0pre7/autogen.sh (+151 lines)
Line 0 Link Here
1
#!/bin/sh
2
# Run this to generate all the initial makefiles, etc.
3
# stolen from GtkEditor who stole it from GNOME.
4
5
srcdir=`pwd`
6
DIE=0
7
8
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
9
  echo
10
  echo "**Error**: You must have \`autoconf' installed to compile lirc."
11
  echo "Download the appropriate package for your distribution,"
12
  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
13
  DIE=1
14
}
15
16
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
17
  { (libtool --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=libtoolize; 
18
} ||
19
  { (glibtool --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize
20
; } ||
21
 {
22
    echo
23
    echo "**Error**: You must have \`libtool' installed to compile lirc."
24
    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2.tar.gz"
25
    echo "(or a newer version if it is available)"
26
    DIE=1
27
  }
28
}
29
30
grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
31
  grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
32
  (gettext --version) < /dev/null > /dev/null 2>&1 || {
33
    echo
34
    echo "**Error**: You must have \`gettext' installed to compile lirc."
35
    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
36
    echo "(or a newer version if it is available)"
37
    DIE=1
38
  }
39
}
40
41
(automake --version) < /dev/null > /dev/null 2>&1 || {
42
  echo
43
  echo "**Error**: You must have \`automake' installed to compile lirc."
44
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.4.tar.gz"
45
  echo "(or a newer version if it is available)"
46
  DIE=1
47
  NO_AUTOMAKE=yes
48
}
49
50
51
# if no automake, don't bother testing for aclocal
52
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
53
  echo
54
  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
55
  echo "installed doesn't appear recent enough."
56
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.4.tar.gz"
57
  echo "(or a newer version if it is available)"
58
  DIE=1
59
}
60
61
if test "$DIE" -eq 1; then
62
  exit 1
63
fi
64
65
#if test -z "$*"; then
66
#  echo "**Warning**: I am going to run \`configure' with no arguments."
67
#  echo "If you wish to pass any to it, please specify them on the"
68
#  echo \`$0\'" command line."
69
#  echo
70
#fi
71
72
case $CC in
73
xlc )
74
  am_opt=--include-deps;;
75
esac
76
77
# TW: all that happens for us at the moment is that aclocal, autoheader 
78
# automake and autoconf asre called in the top level directory
79
80
for coin in `find $srcdir -name configure.in -print`
81
do 
82
  dr=`dirname $coin`
83
  if test -f $dr/NO-AUTO-GEN; then
84
    echo skipping $dr -- flagged as no auto-gen
85
  else
86
    echo processing $dr
87
    macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
88
    ( cd $dr
89
      aclocalinclude="$ACLOCAL_FLAGS"
90
      for k in $macrodirs; do
91
        if test -d $k; then
92
          aclocalinclude="$aclocalinclude -I $k"
93
        ##else 
94
        ##  echo "**Warning**: No such directory \`$k'.  Ignored."
95
        fi
96
      done
97
      if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
98
        if grep "sed.*POTFILES" configure.in >/dev/null; then
99
          : do nothing -- we still have an old unmodified configure.in
100
        else
101
          echo "Creating $dr/aclocal.m4 ..."
102
          test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
103
          echo "Running gettextize...  Ignore non-fatal messages."
104
          echo "no" | gettextize --force --copy
105
          echo "Making $dr/aclocal.m4 writable ..."
106
          test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
107
        fi
108
      fi
109
      if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
110
        echo "Creating $dr/aclocal.m4 ..."
111
        test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
112
        echo "Running gettextize...  Ignore non-fatal messages."
113
        echo "no" | gettextize --force --copy
114
        echo "Making $dr/aclocal.m4 writable ..."
115
        test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
116
      fi
117
      if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
118
        echo "Running libtoolize..."
119
        $LIBTOOLIZE --force --copy
120
      fi
121
      echo "Running aclocal $aclocalinclude ..."
122
      aclocal $aclocalinclude
123
      if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
124
        echo "Running autoheader..."
125
        autoheader
126
      fi
127
      echo "Running automake --gnu $am_opt ..."
128
      automake --add-missing --gnu $am_opt
129
      echo "Running autoconf ..."
130
      autoconf
131
    )
132
  fi
133
done
134
135
echo "Creating setup-driver.sh ..."
136
./data2setup.sh > setup-driver.sh
137
138
# TW: we don't want autogen running configure for us -- there's far too
139
#     many options which need setting
140
141
# conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso
142
-c
143
#
144
#if test x$NOCONFIGURE = x; then
145
#  echo Running $srcdir/configure $conf_flags "$@" ...
146
#  $srcdir/configure $conf_flags "$@" \
147
#  && echo Now type \`make\' to compile $PKG_NAME
148
#else
149
#  echo Skipping configure process.
150
#fi
151
(-)lirc-0.7.0pre7/configure.in (-4 / +13 lines)
Lines 145-152 Link Here
145
  possible_drivers="${possible_drivers} (lirc_dev lirc_serial) \
145
  possible_drivers="${possible_drivers} (lirc_dev lirc_serial) \
146
	(lirc_dev lirc_sir) (lirc_dev lirc_parallel) (lirc_dev lirc_i2c) \
146
	(lirc_dev lirc_sir) (lirc_dev lirc_parallel) (lirc_dev lirc_i2c) \
147
	(lirc_dev lirc_gpio) (lirc_dev) (lirc_dev lirc_it87) \
147
	(lirc_dev lirc_gpio) (lirc_dev) (lirc_dev lirc_it87) \
148
	(lirc_dev lirc_bt829) (lirc_dev lirc_atiusb) \
148
 	(lirc_dev lirc_bt829) (lirc_dev lirc_atiusb) \
149
	(lirc_dev lirc_mceusb) (lirc_dev lirc_sasem)"
149
	(lirc_dev lirc_mceusb) (lirc_dev lirc_sasem) \
150
	(lirc_dev lirc_streamzap)"
150
fi
151
fi
151
152
152
AC_CHECK_LIB(caraca_client, caraca_init,
153
AC_CHECK_LIB(caraca_client, caraca_init,
Lines 197-204 Link Here
197
			  pctv, pixelview_bt878, pixelview_pak,
198
			  pctv, pixelview_bt878, pixelview_pak,
198
			  pixelview_pro, provideo, realmagic,
199
			  pixelview_pro, provideo, realmagic,
199
			  remotemaster, sa1100, sasem, serial, silitek,
200
			  remotemaster, sa1100, sasem, serial, silitek,
200
			  sir, slinke, tekram, tekram_bt829, tira,
201
			  sir, slinke, streamzap, tekram, tekram_bt829,
201
			  tvbox, udp, uirt2, uirt2_raw],
202
			  tira, tvbox, udp, uirt2, uirt2_raw],
202
driver=${withval},
203
driver=${withval},
203
driver="unset"
204
driver="unset"
204
)
205
)
Lines 294-299 Link Here
294
		;;
295
		;;
295
	lirc_dev-lirc_sir)
296
	lirc_dev-lirc_sir)
296
		;;
297
		;;
298
    lirc_dev-lirc_streamzap)
299
        ;;
297
	lirc_flyvideo)
300
	lirc_flyvideo)
298
		;;
301
		;;
299
	livedrive_midi)
302
	livedrive_midi)
Lines 758-763 Link Here
758
  HW_DEFAULT="hw_slinke"
761
  HW_DEFAULT="hw_slinke"
759
fi
762
fi
760
763
764
if test "$driver" = "streamzap"; then
765
  lirc_driver="lirc_dev lirc_streamzap"
766
  lircd_conf="streamzap/lircd.conf.streamzap"
767
fi
768
761
if test "$driver" = "tekram"; then
769
if test "$driver" = "tekram"; then
762
  lirc_driver="lirc_dev lirc_sir"
770
  lirc_driver="lirc_dev lirc_sir"
763
  AC_DEFINE(LIRC_SIR_TEKRAM)
771
  AC_DEFINE(LIRC_SIR_TEKRAM)
Lines 1048-1053 Link Here
1048
  drivers/lirc_dev/Makefile
1056
  drivers/lirc_dev/Makefile
1049
  drivers/lirc_it87/Makefile
1057
  drivers/lirc_it87/Makefile
1050
  drivers/lirc_bt829/Makefile
1058
  drivers/lirc_bt829/Makefile
1059
  drivers/lirc_streamzap/Makefile
1051
  drivers/lirc_atiusb/Makefile
1060
  drivers/lirc_atiusb/Makefile
1052
  drivers/lirc_mceusb/Makefile
1061
  drivers/lirc_mceusb/Makefile
1053
  drivers/lirc_sasem/Makefile
1062
  drivers/lirc_sasem/Makefile
(-)lirc-0.7.0pre7/daemons/receive.c (-1 / +1 lines)
Lines 55-61 Link Here
55
		{
55
		{
56
			lirc_t data;
56
			lirc_t data;
57
			
57
			
58
			data=hw.readdata(2*maxusec<50000 ? 50000:2*maxusec);
58
			data=hw.readdata(2*maxusec<500000 ? 500000:2*maxusec);
59
			if(!data)
59
			if(!data)
60
			{
60
			{
61
				return 0;
61
				return 0;
(-)lirc-0.7.0pre7/drivers/Makefile.am (-1 / +1 lines)
Lines 8-14 Link Here
8
EXTRA_DIST = lirc.h kcompat.h Makefile.kernel Makefile.common
8
EXTRA_DIST = lirc.h kcompat.h Makefile.kernel Makefile.common
9
9
10
DIST_SUBDIRS = lirc_serial lirc_parallel lirc_i2c lirc_sir lirc_dev lirc_gpio \
10
DIST_SUBDIRS = lirc_serial lirc_parallel lirc_i2c lirc_sir lirc_dev lirc_gpio \
11
	lirc_it87 lirc_bt829 lirc_atiusb lirc_mceusb lirc_sasem
11
	lirc_it87 lirc_bt829 lirc_atiusb lirc_mceusb lirc_sasem lirc_streamzap
12
SUBDIRS = @lirc_driver@
12
SUBDIRS = @lirc_driver@
13
13
14
CLEANFILES = *~
14
CLEANFILES = *~
(-)lirc-0.7.0pre7/drivers/lirc_dev/lirc_dev.c (-40 / +87 lines)
Lines 91-96 Link Here
91
	struct semaphore *t_notify2;
91
	struct semaphore *t_notify2;
92
	int shutdown;
92
	int shutdown;
93
	long jiffies_to_wait;
93
	long jiffies_to_wait;
94
	int force_unregister;
94
95
95
#ifdef LIRC_HAVE_DEVFS
96
#ifdef LIRC_HAVE_DEVFS
96
	devfs_handle_t devfs_handle;
97
	devfs_handle_t devfs_handle;
Lines 99-105 Link Here
99
100
100
DECLARE_MUTEX(plugin_lock);
101
DECLARE_MUTEX(plugin_lock);
101
102
102
static struct irctl irctls[MAX_IRCTL_DEVICES];
103
static struct irctl *irctls[MAX_IRCTL_DEVICES];
103
static struct file_operations fops;
104
static struct file_operations fops;
104
105
105
106
Lines 116-121 Link Here
116
	ir->t_notify2 = NULL;
117
	ir->t_notify2 = NULL;
117
	ir->shutdown = 0;
118
	ir->shutdown = 0;
118
	ir->jiffies_to_wait = 0;
119
	ir->jiffies_to_wait = 0;
120
	ir->force_unregister = 0;
119
121
120
	ir->open = 0;
122
	ir->open = 0;
121
}
123
}
Lines 234-240 Link Here
234
236
235
	if (MAX_IRCTL_DEVICES <= p->minor) {
237
	if (MAX_IRCTL_DEVICES <= p->minor) {
236
		printk("lirc_dev: lirc_register_plugin:"
238
		printk("lirc_dev: lirc_register_plugin:"
237
		       "\" minor\" must be between 0 and %d (%d)!\n",
239
		       " \"minor\" must be between 0 and %d (%d)!\n",
238
		       MAX_IRCTL_DEVICES-1, p->minor);
240
		       MAX_IRCTL_DEVICES-1, p->minor);
239
		return -EBADRQC;
241
		return -EBADRQC;
240
	}
242
	}
Lines 276-289 Link Here
276
		}
278
		}
277
	}
279
	}
278
280
279
	down_interruptible(&plugin_lock);
281
	down(&plugin_lock);
280
282
281
	minor = p->minor;
283
	minor = p->minor;
282
284
283
	if (0 > minor) {
285
	if (0 > minor) {
284
		/* find first free slot for plugin */
286
		/* find first free slot for plugin */
285
		for (minor=0; minor<MAX_IRCTL_DEVICES; minor++)
287
		for (minor=0; minor<MAX_IRCTL_DEVICES; minor++)
286
			if (irctls[minor].p.minor == NOPLUG)
288
			if (irctls[minor] == NULL)
287
				break;
289
				break;
288
		if (MAX_IRCTL_DEVICES == minor) {
290
		if (MAX_IRCTL_DEVICES == minor) {
289
			printk("lirc_dev: lirc_register_plugin: "
291
			printk("lirc_dev: lirc_register_plugin: "
Lines 291-304 Link Here
291
			up(&plugin_lock);
293
			up(&plugin_lock);
292
			return -ENOMEM;
294
			return -ENOMEM;
293
		}
295
		}
294
	} else if (irctls[minor].p.minor != NOPLUG) {
296
	} else if (irctls[minor] != NULL) {
295
		printk("lirc_dev: lirc_register_plugin:"
297
		printk("lirc_dev: lirc_register_plugin:"
296
		       "minor (%d) just registered!\n", minor);
298
		       "minor (%d) just registered!\n", minor);
297
		up(&plugin_lock);
299
		up(&plugin_lock);
298
		return -EBUSY;
300
		return -EBUSY;
299
	}
301
	}
300
302
301
	ir = &irctls[minor];
303
	ir = irctls[minor] = kmalloc(sizeof(*ir), GFP_KERNEL);
304
#warning kmalloc may fail
305
	init_irctl(ir);
302
306
303
	if (p->sample_rate) {
307
	if (p->sample_rate) {
304
		ir->jiffies_to_wait = HZ / p->sample_rate;
308
		ir->jiffies_to_wait = HZ / p->sample_rate;
Lines 316-321 Link Here
316
		ir->buf = p->rbuf;
320
		ir->buf = p->rbuf;
317
	} else {
321
	} else {
318
		ir->buf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL);
322
		ir->buf = kmalloc(sizeof(struct lirc_buffer), GFP_KERNEL);
323
#warning kmalloc may fail
319
		lirc_buffer_init(ir->buf, bytes_in_key, BUFLEN/bytes_in_key);
324
		lirc_buffer_init(ir->buf, bytes_in_key, BUFLEN/bytes_in_key);
320
	}
325
	}
321
326
Lines 361-366 Link Here
361
/*
366
/*
362
 *
367
 *
363
 */
368
 */
369
static void irctl_free(struct irctl *ir);
370
static int do_irctl_plugin_close(struct irctl *ir);
371
364
int lirc_unregister_plugin(int minor)
372
int lirc_unregister_plugin(int minor)
365
{
373
{
366
	struct irctl *ir;
374
	struct irctl *ir;
Lines 369-384 Link Here
369
377
370
	if (minor < 0 || minor >= MAX_IRCTL_DEVICES) {
378
	if (minor < 0 || minor >= MAX_IRCTL_DEVICES) {
371
		printk("lirc_dev: lirc_unregister_plugin:"
379
		printk("lirc_dev: lirc_unregister_plugin:"
372
		       "\" minor\" must be between 0 and %d!\n",
380
		       " \"minor\" must be between 0 and %d!\n",
373
		       MAX_IRCTL_DEVICES-1);
381
		       MAX_IRCTL_DEVICES-1);
374
		return -EBADRQC;
382
		return -EBADRQC;
375
	}
383
	}
376
384
377
	ir = &irctls[minor];
385
	down(&plugin_lock);
378
386
379
	down_interruptible(&plugin_lock);
387
	ir = irctls[minor];
388
	irctls[minor] = NULL;
380
389
381
	if (ir->p.minor != minor) {
390
	if (!ir) {
382
		printk("lirc_dev: lirc_unregister_plugin:"
391
		printk("lirc_dev: lirc_unregister_plugin:"
383
		       "minor (%d) device not registered!", minor);
392
		       "minor (%d) device not registered!", minor);
384
		up(&plugin_lock);
393
		up(&plugin_lock);
Lines 388-395 Link Here
388
	if (ir->open) {
397
	if (ir->open) {
389
		printk("lirc_dev: lirc_unregister_plugin:"
398
		printk("lirc_dev: lirc_unregister_plugin:"
390
		       "plugin %s[%d] in use!", ir->p.name, ir->p.minor);
399
		       "plugin %s[%d] in use!", ir->p.name, ir->p.minor);
391
		up(&plugin_lock);
400
		if(ir->p.fops && ir->p.fops->release){
392
		return -EBUSY;
401
			/* we can't reliably force unregister in this case */
402
			up(&plugin_lock);
403
			return -EBUSY;
404
		} else {
405
			do_irctl_plugin_close(ir);
406
			ir->force_unregister=1;
407
			wake_up_all(&ir->buf->wait_poll);
408
		}
393
	}
409
	}
394
410
395
	/* end up polling thread */
411
	/* end up polling thread */
Lines 420-436 Link Here
420
#ifdef LIRC_HAVE_DEVFS
436
#ifdef LIRC_HAVE_DEVFS
421
	devfs_unregister(ir->devfs_handle);
437
	devfs_unregister(ir->devfs_handle);
422
#endif
438
#endif
439
440
	if(!ir->force_unregister)
441
		irctl_free(ir);
442
443
	up(&plugin_lock);
444
	return SUCCESS;
445
}
446
447
static void irctl_free(struct irctl *ir)
448
{
423
	if (ir->buf != ir->p.rbuf){
449
	if (ir->buf != ir->p.rbuf){
424
		lirc_buffer_free(ir->buf);
450
		lirc_buffer_free(ir->buf);
425
		kfree(ir->buf);
451
		kfree(ir->buf);
426
	}
452
	}
427
	ir->buf = NULL;
453
	ir->buf = NULL;
428
	init_irctl(ir);
429
	up(&plugin_lock);
430
454
431
	MOD_DEC_USE_COUNT;
455
	kfree(ir);
432
456
433
	return SUCCESS;
457
	MOD_DEC_USE_COUNT;
434
}
458
}
435
459
436
/*
460
/*
Lines 447-469 Link Here
447
		return -ENODEV;
471
		return -ENODEV;
448
	}
472
	}
449
473
450
	ir = &irctls[MINOR(inode->i_rdev)];
474
	if (down_interruptible(&plugin_lock)) return -ERESTARTSYS;
451
475
452
	dprintk(LOGHEAD "open called\n", ir->p.name, ir->p.minor);
476
	ir = irctls[MINOR(inode->i_rdev)];
453
477
454
	/* if the plugin has an open function use it instead */
478
	if(!ir){
455
	if(ir->p.fops && ir->p.fops->open)
456
		return ir->p.fops->open(inode, file);
457
458
	down_interruptible(&plugin_lock);
459
460
	if (ir->p.minor == NOPLUG) {
461
		up(&plugin_lock);
479
		up(&plugin_lock);
462
		dprintk(LOGHEAD "open result = -ENODEV\n",
480
		dprintk(LOGHEAD "open result = -ENODEV\n",
463
			ir->p.name, ir->p.minor);
481
			"NULL", MINOR(inode->i_rdev));
464
		return -ENODEV;
482
		return -ENODEV;
465
	}
483
	}
466
484
485
	dprintk(LOGHEAD "open called\n", ir->p.name, ir->p.minor);
486
487
	/* if the plugin has an open function use it instead */
488
	if(ir->p.fops && ir->p.fops->open){
489
		up(&plugin_lock);
490
		return ir->p.fops->open(inode, file);
491
	}
492
467
	if (ir->open) {
493
	if (ir->open) {
468
		up(&plugin_lock);
494
		up(&plugin_lock);
469
		dprintk(LOGHEAD "open result = -EBUSY\n",
495
		dprintk(LOGHEAD "open result = -EBUSY\n",
Lines 488-493 Link Here
488
		--ir->open;
514
		--ir->open;
489
		return retval;
515
		return retval;
490
	}
516
	}
517
	file->private_data = ir;
491
518
492
	dprintk(LOGHEAD "open result = %d\n", ir->p.name, ir->p.minor, SUCCESS);
519
	dprintk(LOGHEAD "open result = %d\n", ir->p.name, ir->p.minor, SUCCESS);
493
520
Lines 499-519 Link Here
499
 */
526
 */
500
static int irctl_close(struct inode *inode, struct file *file)
527
static int irctl_close(struct inode *inode, struct file *file)
501
{
528
{
502
	struct irctl *ir = &irctls[MINOR(inode->i_rdev)];
529
	struct irctl *ir = file->private_data;
503
530
	int retval;
504
	dprintk(LOGHEAD "close called\n", ir->p.name, ir->p.minor);
531
	dprintk(LOGHEAD "close called\n", ir->p.name, ir->p.minor);
532
533
	if(ir->force_unregister && !ir->open) {
534
		/* do_irctl_plugin_close got called already for
535
		 * simulating a close on the forced unregister */
536
		irctl_free(ir);
537
        return SUCCESS;
538
    }
505
 
539
 
506
	/* if the plugin has a close function use it instead */
540
	/* if the plugin has a close function use it instead */
507
	if(ir->p.fops && ir->p.fops->release)
541
	if(ir->p.fops && ir->p.fops->release)
508
		return ir->p.fops->release(inode, file);
542
		return ir->p.fops->release(inode, file);
509
543
510
	down_interruptible(&plugin_lock);
544
	if (down_interruptible(&plugin_lock)) return -ERESTARTSYS;
545
	retval = do_irctl_plugin_close(ir);
546
	up(&plugin_lock);
547
	return retval;
548
}
511
549
550
static int do_irctl_plugin_close(struct irctl *ir)
551
{
512
	--ir->open;
552
	--ir->open;
513
	ir->p.set_use_dec(ir->p.data);
553
	ir->p.set_use_dec(ir->p.data);
514
515
	up(&plugin_lock);
516
517
	return SUCCESS;
554
	return SUCCESS;
518
}
555
}
519
556
Lines 522-528 Link Here
522
 */
559
 */
523
static unsigned int irctl_poll(struct file *file, poll_table *wait)
560
static unsigned int irctl_poll(struct file *file, poll_table *wait)
524
{
561
{
525
	struct irctl *ir = &irctls[MINOR(file->f_dentry->d_inode->i_rdev)];
562
	struct irctl *ir = file->private_data;
563
564
	if(ir->force_unregister)
565
		return -ENODEV;
526
566
527
	dprintk(LOGHEAD "poll called\n", ir->p.name, ir->p.minor);
567
	dprintk(LOGHEAD "poll called\n", ir->p.name, ir->p.minor);
528
568
Lines 547-553 Link Here
547
{
587
{
548
	unsigned long mode;
588
	unsigned long mode;
549
	int result;
589
	int result;
550
	struct irctl *ir = &irctls[MINOR(inode->i_rdev)];
590
	struct irctl *ir = file->private_data;
591
592
	if(ir->force_unregister)
593
		return -ENODEV;
551
594
552
	dprintk(LOGHEAD "ioctl called (%u)\n",
595
	dprintk(LOGHEAD "ioctl called (%u)\n",
553
		ir->p.name, ir->p.minor, cmd);
596
		ir->p.name, ir->p.minor, cmd);
Lines 618-630 Link Here
618
			  size_t length, 
661
			  size_t length, 
619
			  loff_t *ppos)     
662
			  loff_t *ppos)     
620
{
663
{
621
	struct irctl *ir = &irctls[MINOR(file->f_dentry->d_inode->i_rdev)];
664
	struct irctl *ir = file->private_data;
622
	unsigned char buf[ir->buf->chunk_size];
665
	unsigned char buf[ir->buf->chunk_size];
623
	int ret=0, written=0;
666
	int ret=0, written=0;
624
	DECLARE_WAITQUEUE(wait, current);
667
	DECLARE_WAITQUEUE(wait, current);
625
668
626
	dprintk(LOGHEAD "read called\n", ir->p.name, ir->p.minor);
669
	dprintk(LOGHEAD "read called\n", ir->p.name, ir->p.minor);
627
670
671
	if(ir->force_unregister)
672
		return -ENODEV;
673
628
	/* if the plugin has a specific read function use it instead */
674
	/* if the plugin has a specific read function use it instead */
629
	if(ir->p.fops && ir->p.fops->read)
675
	if(ir->p.fops && ir->p.fops->read)
630
		return ir->p.fops->read(file, buffer, length, ppos);
676
		return ir->p.fops->read(file, buffer, length, ppos);
Lines 646-651 Link Here
646
	 * mode and 'copy_to_user' is happy, wait for data.
692
	 * mode and 'copy_to_user' is happy, wait for data.
647
	 */
693
	 */
648
	while (written < length && ret == 0) { 
694
	while (written < length && ret == 0) { 
695
		if (ir->force_unregister)
696
			break;
649
		if (lirc_buffer_empty(ir->buf)) {
697
		if (lirc_buffer_empty(ir->buf)) {
650
			/* According to the read(2) man page, 'written' can be
698
			/* According to the read(2) man page, 'written' can be
651
			 * returned as less than 'length', instead of blocking
699
			 * returned as less than 'length', instead of blocking
Lines 688-697 Link Here
688
static ssize_t irctl_write(struct file *file, const char *buffer,
736
static ssize_t irctl_write(struct file *file, const char *buffer,
689
			   size_t length, loff_t * ppos)
737
			   size_t length, loff_t * ppos)
690
{
738
{
691
	struct irctl *ir = &irctls[MINOR(file->f_dentry->d_inode->i_rdev)];
739
	struct irctl *ir = file->private_data;
692
740
693
	dprintk(LOGHEAD "read called\n", ir->p.name, ir->p.minor);
741
	dprintk(LOGHEAD "read called\n", ir->p.name, ir->p.minor);
694
742
743
	if(ir->force_unregister)
744
		return -ENODEV;
745
695
	/* if the plugin has a specific read function use it instead */
746
	/* if the plugin has a specific read function use it instead */
696
	if(ir->p.fops && ir->p.fops->write)
747
	if(ir->p.fops && ir->p.fops->write)
697
		return ir->p.fops->write(file, buffer, length, ppos);
748
		return ir->p.fops->write(file, buffer, length, ppos);
Lines 721-730 Link Here
721
{  	
772
{  	
722
	int i;
773
	int i;
723
774
724
	for (i=0; i < MAX_IRCTL_DEVICES; ++i) {
725
		init_irctl(&irctls[i]);	
726
	}
727
728
#ifndef LIRC_HAVE_DEVFS
775
#ifndef LIRC_HAVE_DEVFS
729
 	i = register_chrdev(IRCTL_DEV_MAJOR,
776
 	i = register_chrdev(IRCTL_DEV_MAJOR,
730
#else
777
#else
(-)lirc-0.7.0pre7/drivers/lirc_streamzap/Makefile.am (+48 lines)
Line 0 Link Here
1
## Process this file with automake to produce Makefile.in
2
3
## this is so that Automake includes the C compiling definitions, and
4
## includes the source files in the distribution.
5
EXTRA_PROGRAMS = automake_dummy
6
automake_dummy_SOURCES = lirc_streamzap.c
7
8
## there is no *just* object file support in automake.  This is close enough
9
module_DATA = lirc_streamzap.o
10
11
# where the kernel sources are located
12
KERNEL_LOCATION=@kerneldir@
13
14
# some magic for using linux kernel settings
15
# when compiling module(s)
16
CC           = @kernelcc@
17
MI_OBJS      = $(module_DATA)
18
EXTRA_CFLAGS = $(DEFS) $(DEFAULT_INCLUDES)
19
20
$(module_DATA): $(automake_dummy_SOURCES) $(top_srcdir)/config.h ../lirc.h
21
  ifndef MAKING_MODULES
22
	DIR=`pwd`; (cd $(KERNEL_LOCATION); make SUBDIRS=$$DIR obj-m=$(module_DATA) modules)
23
  endif
24
# the spaces above are necessary because automake otherwise will complain
25
# and even worse, it will delete the line
26
27
if SANDBOXED
28
else
29
install-exec-local: mkdev
30
uninstall-local: rmdev
31
endif
32
33
mkdev:
34
	test -c $(DESTDIR)$(devdir)/lirc || ($(mkinstalldirs) $(DESTDIR)$(devdir) && @mknod@ $(DESTDIR)$(devdir)/lirc c @lirc_major@ 0)
35
36
rmdev:
37
	-test -c $(DESTDIR)$(devdir)/lirc && $(RM) $(DESTDIR)$(devdir)/lirc
38
39
if SANDBOXED
40
else
41
install-data-local: install-moduleDATA
42
	-@depmod@ -a
43
endif
44
45
CLEANFILES = $(module_DATA) .$(module_DATA).flags *~
46
47
include $(KERNEL_LOCATION)/Rules.make
48
(-)lirc-0.7.0pre7/drivers/lirc_streamzap/lirc_streamzap.c (+449 lines)
Line 0 Link Here
1
/* lirc_streamzap - USB StreamZap remote driver
2
 * Alpha status, currently Works For Me(tm). Feedback welcome.
3
 * Version 0.06
4
 *
5
 * Copyright (C) 2002-2003 Adrian Dewhurst <sailor-lk@sailorfrag.net>
6
 *
7
 * This program is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 2 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
 */
21
22
#ifdef HAVE_CONFIG_H
23
# include <config.h>
24
#endif
25
26
#include <linux/config.h>
27
#ifdef CONFIG_SMP
28
# define __SMP__
29
#endif
30
31
#include <linux/version.h>
32
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
33
#error "*******************************************************"
34
#error "Sorry, this driver needs kernel version 2.4.0 or higher"
35
#error "*******************************************************"
36
#endif
37
38
#include <linux/module.h>
39
#include <linux/slab.h>
40
#include <linux/usb.h>
41
#include <linux/sched.h>
42
#include <linux/kmod.h>
43
#include <linux/errno.h>
44
45
#include "drivers/lirc.h"
46
#include "drivers/lirc_dev/lirc_dev.h"
47
48
#ifdef CONFIG_USB_DEBUG
49
static int debug = 1;
50
#else
51
static int debug;
52
#endif
53
static int minor = -1;
54
55
#undef dbg
56
#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg); } while (0)
57
58
#define DRIVER_VERSION "v0.06"
59
#define DRIVER_AUTHOR "Adrian Dewhurst, sailor-lk@sailorfrag.net"
60
#define DRIVER_DESC "lirc USB StreamZap Remote driver"
61
#define LIRC_DRIVER_NAME "lirc_streamzap"
62
#define USB_STREAMZAP_VENDOR_ID    0x0e9c
63
#define USB_STREAMZAP_PRODUCT_ID   0x0000
64
65
MODULE_PARM(debug, "i");
66
MODULE_PARM_DESC(debug, "Debug enabled or not");
67
MODULE_PARM(minor, "i");
68
MODULE_PARM_DESC(minor, "Preferred minor to use for LIRC device");
69
70
EXPORT_NO_SYMBOLS;
71
72
static struct usb_device_id streamzap_table [] = {
73
            { USB_DEVICE(USB_STREAMZAP_VENDOR_ID, USB_STREAMZAP_PRODUCT_ID) },
74
            { }                    /* Terminating entry */
75
};
76
77
MODULE_DEVICE_TABLE(usb, streamzap_table);
78
79
struct usb_streamzap {
80
    struct usb_device *udev;  /* usb device struct; NULL upon disconnect */
81
    struct lirc_plugin plugin; /* our lirc_dev device info */
82
    struct urb irq;           /* our interrupt URB */
83
84
    __u16 int_in_size;        /* size of interrupt buffer */
85
    unsigned char *int_in_buffer; /* URB interrupt buffer */
86
87
    unsigned char tmpbuf;     /* for tracking long codes between interrupts */
88
    unsigned char ign;
89
    struct lirc_buffer outbuf; /* kernel space -> user space buffer */
90
    spinlock_t interrupt_lock;
91
92
    unsigned int open_count;
93
94
    struct semaphore lock;   /* locks this structure */
95
};
96
97
/* USB functions */
98
static void streamzap_irq(struct urb *urb);
99
static void * streamzap_probe(struct usb_device *dev, unsigned intf, const struct usb_device_id *id);
100
static void streamzap_disconnect(struct usb_device *dev, void *data);
101
102
static struct usb_driver streamzap_driver = {
103
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 20)
104
    owner:       THIS_MODULE,
105
#endif
106
    name:        "lirc_streamzap",
107
    probe:       streamzap_probe,
108
    disconnect:  streamzap_disconnect,
109
    id_table:    streamzap_table,
110
};
111
112
/* LIRC functions */
113
static int streamzap_use_inc(void *data);
114
static void streamzap_use_dec(void *data);
115
116
static struct lirc_plugin streamzap_lirc_template = {
117
    minor: -1,  /* Fill this in */
118
    sample_rate: 0,
119
    code_length: 32,
120
    features: LIRC_CAN_REC_MODE2,
121
    data: NULL, /* Fill this in */
122
    rbuf: NULL, /* Fill this in */
123
    set_use_inc: streamzap_use_inc,
124
    set_use_dec: streamzap_use_dec,
125
};
126
127
/* USB */
128
static void * streamzap_probe(struct usb_device *dev, unsigned intf, const struct usb_device_id *id) {
129
    struct usb_interface *iface;
130
    struct usb_interface_descriptor *iface_desc;
131
    struct usb_endpoint_descriptor *endpoint;
132
    struct usb_streamzap *sz = NULL;
133
    int pipe;
134
    int result;
135
    char buf[63], name[128]="";
136
137
    /* Get the device */
138
    iface = &dev->actconfig->interface[intf];
139
    iface_desc = &iface->altsetting[iface->act_altsetting];
140
141
    /* Find out if we want it */
142
    if ((dev->descriptor.idVendor != USB_STREAMZAP_VENDOR_ID) ||
143
            (dev->descriptor.idProduct != USB_STREAMZAP_PRODUCT_ID)) {
144
        return NULL;
145
    }
146
147
    /* Find the endpoint */
148
    if (iface_desc->bNumEndpoints != 1) return NULL;
149
    endpoint = iface_desc->endpoint + 0;
150
    if ((endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK) != USB_DIR_IN) return NULL;
151
    if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) != USB_ENDPOINT_XFER_INT) return NULL;
152
    pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
153
154
    /* Allocate our device struct */
155
    if (!(sz = kmalloc(sizeof(*sz), GFP_KERNEL))) {
156
        err("Out of memory allocating streamzap device");
157
        return NULL;
158
    }
159
    memset(sz, 0, sizeof(*sz));
160
161
    /* Initialize locks and data */
162
    sz->udev = dev;
163
    init_MUTEX(&sz->lock);
164
    spin_lock_init(&sz->interrupt_lock);
165
166
    /* Allocate the URB buffer */
167
    sz->int_in_size = endpoint->wMaxPacketSize;
168
    if (!(sz->int_in_buffer = kmalloc(sz->int_in_size, GFP_KERNEL))) {
169
        err("Out of memory allocating streamzap interrupt buffer");
170
        goto error;
171
    }
172
    FILL_INT_URB(&sz->irq, dev, pipe, sz->int_in_buffer, sz->int_in_size, streamzap_irq, sz, endpoint->bInterval);
173
    dbg("buffer_size %hu, buffer %p, interval %hu", sz->int_in_size, sz->int_in_buffer, endpoint->bInterval);
174
175
    /* Allocate the lirc buffer */
176
    lirc_buffer_init(&sz->outbuf, 4 /* 32 bits/chunk */, 128 /* the default size of 16 is a bit small */);
177
178
    /* Set up the lirc plugin struct */
179
    memcpy(&sz->plugin, &streamzap_lirc_template, sizeof(struct lirc_plugin));
180
    sz->plugin.data = sz;
181
    sz->plugin.rbuf = &sz->outbuf;
182
    sz->plugin.minor = minor;
183
184
    /* Set up the plugin interface */
185
    dbg("Attempting to register plugin on minor %d", sz->plugin.minor);
186
    if ((result = lirc_register_plugin(&sz->plugin)) < 0) {
187
#if 0
188
        /* It might be just that the preferred minor is in use. Try again
189
         * without trying for a specific minor. */
190
        if (result == -EBUSY) {
191
            info("lirc_streamzap: usb%d:%d.%d: Preferred minor %d already in use. Trying another.", dev->bus->busnum, dev->devnum, intf, minor);
192
            sz->plugin.minor = -1;
193
            if ((result = lirc_register_plugin(&sz->plugin)) < 0) {
194
                goto error2;
195
            }
196
        } else {
197
            goto error2;
198
        }
199
#else
200
        goto error2;
201
#endif
202
    }
203
    sz->plugin.minor = result;
204
    dbg("Registered on minor %d", sz->plugin.minor);
205
206
    /* Grab the USB name string */
207
    if (dev->descriptor.iManufacturer && usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0) strcpy(name, buf);
208
    if (dev->descriptor.iProduct && usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0) sprintf(name, "%s %s", name, buf);
209
    info("lirc%d: %s on usb%d:%d.%d", sz->plugin.minor, name, dev->bus->busnum, dev->devnum, intf);
210
211
    goto exit;
212
213
error2:
214
    err("usb%d:%d.%d: Unable to register plugin with lirc_dev.", dev->bus->busnum, dev->devnum, intf);
215
    lirc_buffer_free(&sz->outbuf);
216
    kfree(sz->int_in_buffer);
217
error:
218
    kfree(sz);
219
    sz=NULL;
220
exit:
221
    return sz;
222
}
223
224
static void streamzap_disconnect(struct usb_device *udev, void *data)
225
{
226
    struct usb_streamzap *sz=(struct usb_streamzap *)data;
227
    int result, flags;
228
229
    dbg("Entering streamzap_disconnect");
230
231
    /* Stop everything else */
232
    sz->udev = NULL;
233
234
    down(&sz->lock);
235
    if (sz->open_count) {
236
        spin_lock_irqsave(&sz->interrupt_lock, flags);
237
        usb_unlink_urb(&sz->irq);
238
        spin_unlock_irqrestore(&sz->interrupt_lock, flags);
239
    }
240
241
    info("lirc%d: disconnected", sz->plugin.minor);
242
243
    if ((result = lirc_unregister_plugin(sz->plugin.minor))) {
244
        err("lirc_unregister_plugin(%d) failed: %d", sz->plugin.minor, result);
245
    }
246
    lirc_buffer_free(&sz->outbuf);
247
    kfree(sz->int_in_buffer);
248
    kfree(sz);
249
}
250
251
static inline void usb_streamzap_debug_data(const char *function, int size, const unsigned char *data)
252
{
253
        int i;
254
255
        if (!debug) return;
256
257
        printk(KERN_DEBUG __FILE__": %s: length %d, data ", function, size);
258
        for (i = 0; i < size; ++i) {
259
                printk("%.2x ", data[i]);
260
        }
261
        printk("\n");
262
}
263
264
static void streamzap_irq(struct urb *urb)
265
{
266
    struct usb_streamzap *sz=urb->context;
267
    unsigned long flags;
268
    unsigned int i=0;
269
    uint32_t tmp;
270
271
    if (urb->status) return;
272
    if (urb->actual_length == 0) return;
273
274
    if (!sz) {
275
        dbg("streamzap_irq called with no context");
276
        usb_unlink_urb(urb);
277
        return;
278
    }
279
280
    usb_streamzap_debug_data(__FUNCTION__, urb->actual_length, urb->transfer_buffer);
281
282
    spin_lock_irqsave(&sz->interrupt_lock, flags);
283
    /* I can't really explain how this works (StreamZap's request). It should
284
     * work properly though. */
285
#define check_buffer() if (lirc_buffer_full(&sz->outbuf)) { err("lirc%d: out of buffer space", sz->plugin.minor); goto out; }
286
    if (sz->tmpbuf) {
287
        if ((sz->tmpbuf & 0xf0) == 0xf0) {
288
            check_buffer();
289
            tmp = (sz->int_in_buffer[0] * 256) | 0x01000000;
290
            lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
291
292
            sz->ign = 1;
293
        } else {
294
            if (!sz->ign) {
295
                tmp = (((sz->tmpbuf & 0xf0) >> 4) * 256);
296
                tmp = (tmp ? tmp : 1) | 0x01000000;
297
                lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
298
            }
299
300
            check_buffer();
301
            tmp = sz->int_in_buffer[0] * 256;
302
            tmp = tmp ? tmp : 1;
303
            lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
304
305
            sz->ign = 0;
306
        }
307
308
        sz->tmpbuf = 0;
309
        i++;
310
    }
311
312
    for (; i < urb->actual_length; i++) {
313
        if ((sz->int_in_buffer[i] & 0xf0) == 0xf0 || (sz->int_in_buffer[i] & 0x0f) == 0x0f) {
314
            if (i+1 >= urb->actual_length) {
315
                sz->tmpbuf = sz->int_in_buffer[i];
316
                break;
317
            }
318
319
            if ((sz->int_in_buffer[i] & 0xf0) == 0xf0) {
320
                check_buffer();
321
                tmp = sz->int_in_buffer[i+1] * 256;
322
                tmp = (tmp ? tmp : 1) | 0x01000000;
323
                lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
324
325
                sz->ign = 1;
326
            } else {
327
                if (!sz->ign) {
328
                    check_buffer();
329
                    tmp = ((sz->int_in_buffer[i] & 0xf0) >> 4) * 256;
330
                    tmp = (tmp ? tmp : 1) | 0x01000000;
331
                    lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
332
                }
333
334
                check_buffer();
335
                tmp = sz->int_in_buffer[i+1] * 256;
336
                tmp = (tmp ? tmp : 1);
337
                lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
338
339
                sz->ign = 0;
340
            }
341
            i++;
342
        } else {
343
            check_buffer();
344
            tmp = ((sz->int_in_buffer[i] & 0xf0) >> 4) * 256;
345
            tmp = (tmp ? tmp : 1) | 0x01000000;
346
            lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
347
348
            check_buffer();
349
            tmp = (sz->int_in_buffer[i] & 0x0f) * 256;
350
            tmp = tmp ? tmp : 1;
351
            lirc_buffer_write_1(&sz->outbuf, (char *)&tmp);
352
        }
353
    }
354
#undef check_buffer
355
out:
356
    spin_unlock_irqrestore(&sz->interrupt_lock, flags);
357
    wake_up(&sz->outbuf.wait_poll);
358
}
359
360
361
/* LIRC */
362
static int streamzap_use_inc(void *data) {
363
    struct usb_streamzap *sz=(struct usb_streamzap *)data;
364
    int retval=0;
365
366
    dbg("Entering streamzap_use_inc for minor %d", sz->plugin.minor);
367
    MOD_INC_USE_COUNT;
368
    if (down_interruptible(&sz->lock)) {
369
        MOD_DEC_USE_COUNT;
370
        dbg("streamzap_use_inc for minor %d returns -ERESTARTSYS", sz->plugin.minor);
371
        return -ERESTARTSYS;
372
    }
373
374
    if (!sz->udev) {
375
        up(&sz->lock);
376
        return -ENODEV;
377
    }
378
379
    if (!sz->open_count++) {
380
        sz->irq.dev = sz->udev;
381
        if ((retval = usb_submit_urb(&sz->irq))) {
382
            info("streamzap_use_inc(minor %d): usb_submit_urb returned %d", sz->plugin.minor, retval);
383
            dbg("streamzap_use_inc for minor %d returns -EIO", sz->plugin.minor);
384
            retval = -EIO;
385
            goto fail;
386
        }
387
    }
388
    dbg("streamzap_use_inc for minor %d success (open_count %u)", sz->plugin.minor, sz->open_count);
389
    goto exit;
390
391
fail:
392
    MOD_DEC_USE_COUNT;
393
exit:
394
    up(&sz->lock);
395
    return retval;
396
}
397
398
static void streamzap_use_dec(void *data) {
399
    struct usb_streamzap *sz=(struct usb_streamzap *)data;
400
401
    dbg("Entering streamzap_use_dec for minor %d", sz->plugin.minor);
402
    down(&sz->lock);
403
    if (sz->open_count == 0) {
404
        info("streamzap_use_dec called when use count is 0!");
405
        return;
406
    }
407
408
    if (!--sz->open_count) usb_unlink_urb(&sz->irq);
409
410
    up(&sz->lock);
411
    MOD_DEC_USE_COUNT;
412
413
    dbg("Exiting streamzap_use_dec for minor %d (open_count %u)", sz->plugin.minor, sz->open_count);
414
}
415
416
/* Module functions */
417
static int __init streamzap_init(void)
418
{               
419
    int result;
420
421
    if (MAX_IRCTL_DEVICES < minor) {
422
        err("Parameter minor (%d) must be less than %d!",
423
                minor, MAX_IRCTL_DEVICES-1);
424
        return -EINVAL;
425
    }
426
427
    if ((result = usb_register(&streamzap_driver)) < 0) {
428
        err("usb_register failed. Error number %d", result);
429
        return -EINVAL;
430
    }
431
432
    info(DRIVER_AUTHOR " " DRIVER_VERSION);
433
    info(DRIVER_DESC);
434
435
    return 0;       
436
}
437
438
static void __exit streamzap_exit(void)
439
{       
440
    usb_deregister(&streamzap_driver);
441
    dbg("Exiting");
442
}       
443
444
module_init(streamzap_init);
445
module_exit(streamzap_exit);
446
447
MODULE_AUTHOR(DRIVER_AUTHOR);
448
MODULE_DESCRIPTION(DRIVER_DESC);
449
MODULE_LICENSE("GPL");
(-)lirc-0.7.0pre7/remotes/streamzap/lircd.conf.streamzap (+60 lines)
Line 0 Link Here
1
# brand:                       streamzap
2
# model no. of remote control: 
3
# devices being controlled by this remote:
4
#
5
6
begin remote
7
  name          streamzap
8
  bits          6
9
  flags         RC5
10
  eps           0
11
  aeps          384
12
13
  one           768   768
14
  zero          768   768
15
  plead         768
16
  pre_data_bits 8
17
  pre_data      0xA3
18
  gap           65280
19
  toggle_bit    2
20
21
22
      begin codes
23
          0                        0x00
24
          1                        0x01
25
          2                        0x02
26
          3                        0x03
27
          4                        0x04
28
          5                        0x05
29
          6                        0x06
30
          7                        0x07
31
          8                        0x08
32
          9                        0x09
33
          Power                    0x0A
34
          Mute                     0x0B
35
          ChUp                     0x0C
36
          VolUp                    0x0D
37
          ChDown                   0x0E
38
          VolDown                  0x0F
39
          Up                       0x10
40
          Left                     0x11
41
          OK                       0x12
42
          Right                    0x13
43
          Down                     0x14
44
          Menu                     0x15
45
          Exit                     0x16
46
          Play                     0x17
47
          Pause                    0x18
48
          Stop                     0x19
49
          TrackPrev                0x1A
50
          TrackNext                0x1B
51
          Record                   0x1C
52
          SeekBack                 0x1D
53
          SeekFw                   0x1E
54
          Red                      0x20
55
          Green                    0x21
56
          Yellow                   0x22
57
          Blue                     0x23
58
      end codes
59
60
end remote
(-)lirc-0.7.0pre7/setup.data (-2 / +2 lines)
Lines 99-104 Link Here
99
	atiusb: "ATI/NVidia/X10 RF Remote"
99
	atiusb: "ATI/NVidia/X10 RF Remote"
100
	sasem: "Dign HV5 HTPC IR/VFD Module"
100
	sasem: "Dign HV5 HTPC IR/VFD Module"
101
	tira: "Home Electronics Tira USB device"
101
	tira: "Home Electronics Tira USB device"
102
	streamzap: "StreamZap PC Remote (USB)"
102
	pcmak_usb: "PCMAK USB receiver"
103
	pcmak_usb: "PCMAK USB receiver"
103
	sasem: "Sasem OnAir Remocon-V"
104
	sasem: "Sasem OnAir Remocon-V"
104
	exaudio: "Sound Blaster Extigy USB sound card"
105
	exaudio: "Sound Blaster Extigy USB sound card"
Lines 125-131 Link Here
125
		hercules_smarttv_stereo it87 knc_one kworld leadtek_0007 \
126
		hercules_smarttv_stereo it87 knc_one kworld leadtek_0007 \
126
		leadtek_0010 livedrive_midi livedrive_seq mceusb \
127
		leadtek_0010 livedrive_midi livedrive_seq mceusb \
127
		mediafocusI none pixelview_bt878 pixelview_pak \
128
		mediafocusI none pixelview_bt878 pixelview_pak \
128
		pixelview_pro provideo sa1100 sasem tekram_bt829 tvbox udp
129
		pixelview_pro provideo sa1100 sasem streamzap tekram_bt829 tvbox udp
129
	none:
130
	none:
130
131
131
default_param: atiusb audio audio_alsa avermedia avermedia98 \
132
default_param: atiusb audio audio_alsa avermedia avermedia98 \
Lines 161-164 Link Here
161
162
162
default_param: pcmak_usb tira
163
default_param: pcmak_usb tira
163
	ttyUSB1:
164
	ttyUSB1:
164

Return to bug 60110