linux/drivers/char/mwave
Arnd Bergmann 613655fa39 drivers: autoconvert trivial BKL users to private mutex
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

These drivers do not seem to be under active
maintainance from my brief investigation. Apologies
to those maintainers that I have missed.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2010-10-05 15:01:04 +02:00
..
3780i.c [PATCH] mwave: interesting flags savings 2007-02-20 17:10:14 -08:00
3780i.h [PATCH] drivers/char/mwave/3780i.c: cleanups 2005-06-25 16:25:03 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mwavedd.c drivers: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:04 +02:00
mwavedd.h proper extern for mwave_s_mdd 2008-07-25 10:53:42 -07:00
mwavepub.h [PATCH] mwave: missing __user in ioctl struct declaration 2005-12-15 10:04:31 -08:00
README remove mentionings of devfs in documentation 2006-10-03 22:17:48 +02:00
smapi.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
smapi.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
tp3780i.c proper extern for mwave_s_mdd 2008-07-25 10:53:42 -07:00
tp3780i.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00

Module options
--------------

The mwave module takes the following options.  Note that these options
are not saved by the BIOS and so do not persist after unload and reload.

  mwave_debug=value, where value is bitwise OR of trace flags:
	0x0001 mwavedd api tracing
	0x0002 smapi api tracing
	0x0004 3780i tracing
	0x0008 tp3780i tracing

        Tracing only occurs if the driver has been compiled with the
        MW_TRACE macro #defined  (i.e. let EXTRA_CFLAGS += -DMW_TRACE
        in the Makefile).

  mwave_3780i_irq=5/7/10/11/15
	If the dsp irq has not been setup and stored in bios by the 
	thinkpad configuration utility then this parameter allows the
	irq used by the dsp to be configured.

  mwave_3780i_io=0x130/0x350/0x0070/0xDB0
	If the dsp io range has not been setup and stored in bios by the 
	thinkpad configuration utility then this parameter allows the
	io range used by the dsp to be configured.

  mwave_uart_irq=3/4
	If the mwave's uart irq has not been setup and stored in bios by the 
	thinkpad configuration utility then this parameter allows the
	irq used by the mwave uart to be configured.

  mwave_uart_io=0x3f8/0x2f8/0x3E8/0x2E8
	If the uart io range has not been setup and stored in bios by the 
	thinkpad configuration utility then this parameter allows the
	io range used by the mwave uart to be configured.

Example to enable the 3780i DSP using ttyS1 resources:
	
  insmod mwave mwave_3780i_irq=10 mwave_3780i_io=0x0130 mwave_uart_irq=3 mwave_uart_io=0x2f8

Accessing the driver
--------------------

You must also create a node for the driver:
  mkdir -p /dev/modems
  mknod --mode=660 /dev/modems/mwave c 10 219