[ltp] Re: [Linux-IrDA] [PATCH] nsc-ircc

Tom Grydeland linux-thinkpad@www.bm-soft.com
Tue, 27 Feb 2001 22:59:12 +0100 (MET)


On Tue, 27 Feb 2001, Dag Brattli wrote:

> Hi,
> 
> Looks good to me, but I don't have access to NSC chips anymore,
> so I cannot test it. Maybe some more people could test this patch 
> before we ship it to Linus?

I tried this with an otherwise unpatched 2.2.18.

I realise you're talking about 2.4.x kernels, while I'm looking at the
backported 2.2.x stuff, but maybe this will tell you something anyway.

(with this kernel, I got SIR to work previously the same day.)

Before, I could not even load the nsc-ircc module:

---------------------------------------------------
Feb 25 08:33:44 ska kernel: nsc-ircc, Wrong chip version 0c 
Feb 25 02:33:44 ska irattach: + /lib/modules/2.2.18/misc/nsc-ircc.o: init_module: Device or resource busy
Feb 25 02:33:44 ska irattach: + irda: Device or resource busy
Feb 25 02:33:44 ska irattach: Trying to load module irda0 exited with status 1
Feb 25 02:33:44 ska irattach: executing: 'echo 1 > /proc/sys/net/irda/discovery'
Feb 25 02:33:45 ska irattach: Starting device irda0
Feb 25 08:33:45 ska kernel: nsc-ircc, Wrong chip version 0c 
Feb 25 08:33:45 ska insmod: /lib/modules/2.2.18/misc/nsc-ircc.o: init_module: Device or resource busy
Feb 25 02:33:45 ska irattach: executing: 'echo ska > /proc/sys/net/irda/devname'
---------------------------------------------------

The patch applied cleanly to a 2.2.x kernel but it would not compile
cleanly -- I had to remove this piece of it to get it to compile:

@@ -277,15 +277,14 @@
         self->io.fifo_size = 32;
        
        /* Reserve the ioports that we need */
-       ret = check_region(self->io.fir_base, self->io.fir_ext);
-       if (ret < 0) { 
-               WARNING(__FUNCTION__ "(), can't get iobase of 0x%03x\n",
+       ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name);
+       if (ret == NULL) { 
+               WARNING(__FUNCTION__ "(), Request for io region at 0x%03x was re
fused\n",
                        self->io.fir_base);
                dev_self[i] = NULL;
                kfree(self);
-               return -ENODEV;
+               return -EBUSY;
        }
-       request_region(self->io.fir_base, self->io.fir_ext, driver_name);
 
        /* Initialize QoS for this device */
        irda_init_max_qos_capabilies(&self->qos);


After applying the patch, I was able to load the module, but I was not
seeing any traffic on the link (irdadump was not showing any traffic,
and the Palm did not react to anything), but this might be a resource
allocation problem (my fault) on the thinkpad.

---------------------------------------------------
Feb 27 04:51:43 ska kernel: IrDA (tm) Protocols for Linux-2.2 (Dag Brattli) 
Feb 27 04:51:43 ska kernel: nsc-ircc, Found chip at io base 0x02e 
Feb 27 04:51:43 ska kernel: nsc-ircc, Driver loaded (Dag Brattli) 
Feb 27 04:51:43 ska kernel: IrDA: Registered device irda0 
Feb 27 04:51:43 ska kernel: nsc-ircc, Using dongle: IBM31T1100 or Temic TFDS6000/TFDS6500 
Feb 27 04:52:06 ska irattach: executing: '/sbin/modprobe irda0'
Feb 27 04:52:06 ska irattach: executing: 'echo 1 > /proc/sys/net/irda/discovery'
Feb 27 04:52:06 ska irattach: Starting device irda0
Feb 27 04:52:06 ska kernel: nsc-ircc, Request for irq 4 was refused 
Feb 27 04:52:06 ska irattach: executing: 'echo ska > /proc/sys/net/irda/devname'
---------------------------------------------------

I'm not sure I believe the 'Request for irq 4 was refused' message --
IRQ 4 was registered as in use by irda at this point.

HOWEVER, after having stopped trying FIR, I killed irattach and was going to
try SIR again.  Now, setserial was no longer able to correctly identify
the UART of the IR port:

Feb 27 10:12:45 ska kernel: ttyS02 at 0x03e8 (irq = 4) is a 8250 

and when I tried (using tpctl) to disable the IR port, the machine
froze.  According to Till Straumann, this has been a problem with the
nsc-ircc driver previously, and it seems this patch does not fix it
entirely.

> -- Dag

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>



----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html