Andrew "ruskie" Levstik | 11 Dec 2005 18:03

smsc-ircc2 on a dell latitude cpi a366st

I'm having problem getting this to work on my latitude cpi a366st laptop.
I'm running:

Linux 2.6.13 hand built vanilla

The chip reported by the smsc-ircc2 driver is:
found SMC SuperIO Chip (devid=0x09 rev=01 base=0x03f0): FDC37N958FR
Revision higher than expected

The BIOS is configured to set the irda to com4 so ttyS3.
dmesg | grep "ttyS3" returns the following:
ttyS3 at I/O 0x2e8 (irq = 3) is a 16550A

Someone please help...

--

-- 
Andrew "ruskie" Levstik
Source Mage GNU/Linux Games grimoire guru

Key id = 9A5117F8
Key fingerprint = 6731 FEF2 99A8 4672 5962  69AB 3DAF DA67 9A51 17F8

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
Didier Donzé | 12 Dec 2005 14:25
Picon

Fwd: error inserting irda

Hi!
I want to use irda on my notebook! I activated all the stuff in the kernel and when i want to load the module irda, i get this:

juliaroberts:~# modprobe irda
FATAL: Error inserting irda (/lib/modules/2.6.13/kernel/net/irda/irda.ko): Unknown symbol in module, or unknown parameter (see dmesg)

and dmesg gives:
...
irda: Unknown symbol crc_ccitt_table

I googled a lot, but found nothing...

juliaroberts:~# uname -a
Linux juliaroberts 2.6.13 #1 SMP Wed Nov 2 00:22:03 CET 2005 i686 GNU/Linux

juliaroberts:~# setserial -g -a /dev/ttyS*
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

/dev/ttyS1, Line 1, UART: undefined, Port: 0x02f8, IRQ: 3
        Baud_base: 921600, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

/dev/ttyS2, Line 2, UART: unknown, Port: 0x03e8, IRQ: 4
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal skip_test

/dev/ttyS3, Line 3, UART: unknown, Port: 0x02e8, IRQ: 3
        Baud_base: 115200, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal

Has anybody any idea? Thank you!

Didier

Nick Fedchik | 12 Dec 2005 15:10
Picon

Re: Fwd: error inserting irda

> juliaroberts:~# modprobe irda
> FATAL: Error inserting irda (/lib/modules/2.6.13/kernel/net/irda/irda.ko):
> Unknown symbol in module, or unknown parameter (see dmesg)
>
> and dmesg gives:
> ...
> irda: Unknown symbol crc_ccitt_table
Looks like You use vanilla kernel, so check Your .config at
#
# Library routines
#
CONFIG_CRC_CCITT=m
CONFIG_CRC32=y
CONFIG_LIBCRC32C=m
...

Pre-load crc-ccitt module or recompile kernel with build-in CRC routines

--

-- 
Best Regards, 
Nick Fedchik

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Andrew "ruskie" Levstik | 18 Dec 2005 16:27

Re: smsc-ircc2 on a dell latitude cpi a366st

Andrew "ruskie" Levstik wrote :

> I'm having problem getting this to work on my latitude cpi a366st laptop.
> I'm running:
> 
> Linux 2.6.13 hand built vanilla
> 
> The chip reported by the smsc-ircc2 driver is:
> found SMC SuperIO Chip (devid=0x09 rev=01 base=0x03f0): FDC37N958FR
> Revision higher than expected
> 
> The BIOS is configured to set the irda to com4 so ttyS3.
> dmesg | grep "ttyS3" returns the following:
> ttyS3 at I/O 0x2e8 (irq = 3) is a 16550A
> 
> Someone please help...
> 

After a weeks worth of googling I have found the following...

setserial /dev/ttyS3 uart none
modprobe smsc_ircc2
irattach irda0 -s
ifconfig irda0 up

And irdadump is showing output from my cell phone...

--

-- 
Andrew "ruskie" Levstik
Source Mage GNU/Linux Games grimoire guru

Hacker FAQ: http://www.plethora.net/%7eseebs/faqs/hacker.html

Key id = 9A5117F8
Key fingerprint = 6731 FEF2 99A8 4672 5962  69AB 3DAF DA67 9A51 17F8

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
Louis-Benoit JOURDAIN | 22 Dec 2005 12:57
Picon

can't get irda to work on a TECRA M1

Hi,

I'm using:
>uname -a
Linux louve 2.6.9-gentoo-r1 #7 Fri Nov 18 15:02:07 CET 2005 i686
Intel(R) Pentium(R) M processor 1400MHz GenuineIntel GNU/Linux

in modules.conf, I have:
alias irda0 smsc_ircc2

I run the following commands in this order:
- smcinit -v -f 0x0130 -s 0x2f8 -d1 -i3
- modprobe smsc_ircc2

That loads the driver correctly:
Dec 21 11:37:00 louve kernel: NET: Registered protocol family 23
Dec 21 11:37:00 louve kernel: found SMC SuperIO Chip (devid=0x5a
rev=00 base=0x002e): LPC47N227
Dec 21 11:37:00 louve kernel: smsc_superio_flat(): fir: 0x130, sir:
0x2f8, dma: 01, irq: 3, mode: 0x8a
Dec 21 11:37:00 louve kernel: SMsC IrDA Controller found
Dec 21 11:37:00 louve kernel:  IrCC version 2.0, firport 0x130,
sirport 0x2f8 dma=1, irq=3
Dec 21 11:37:00 louve kernel: No transceiver found. Defaulting to Fast
pin select
Dec 21 11:37:00 louve kernel: IrDA: Registered device irda0

And I can see the interface is configured:
>/sbin/ifconfig irda0
irda0     Link encap:IrLAP  HWaddr 65:64:08:04
         NOARP  MTU:2048  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:8
         RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
         Interrupt:3 Base address:0x130

Now, I irattach irda0:
Dec 21 11:38:56 louve irattach: executing: '/sbin/modprobe irda0'
Dec 21 11:38:56 louve irattach: executing: 'echo louve >
/proc/sys/net/irda/devname'
Dec 21 11:38:56 louve irattach: executing: 'echo 1 >
/proc/sys/net/irda/discovery'
Dec 21 11:38:56 louve irattach: Starting device irda0

I can see the interface is up:
>/sbin/ifconfig irda0
irda0     Link encap:IrLAP  HWaddr 65:64:08:04
         UP RUNNING NOARP  MTU:2048  Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:8
         RX bytes:0 (0.0 b)  TX bytes:30 (30.0 b)
         Interrupt:3 Base address:0x130

setserial says:
>setserial /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
>setserial /dev/ttyS1
/dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3

But, irdadump reports nothing. It looks like it's not configured properly.
I put my phone in front of the irda receiver, nothing is being filtered.

Should irdadump report something?

Then, I load the drivers for ircomm_tty (in modules.conf, I have:
alias tty-ldisc-11 irtty
alias char-major-161 ircomm_tty)

and I try to sync my pilot by irda on /dev/ircomm0, it doesn't work.

The smcinit page says the sir port is supposed to be on 0x3f8.
Whenever I configure the port with smcinit to 0x3f8 and then I try to
load the module smsc_ircc2, it fails with:
Dec 21 11:23:09 louve kernel: NET: Registered protocol family 23
Dec 21 11:23:09 louve kernel: found SMC SuperIO Chip (devid=0x5a
rev=00 base=0x002e): LPC47N227
Dec 21 11:23:09 louve kernel: smsc_superio_flat(): fir: 0x130, sir:
0x3f8, dma: 01, irq: 3, mode: 0x8a
Dec 21 11:23:09 louve kernel: smsc_ircc_present: can't get sir_base of 0x3f8

So I think my ports are good.

Any idea what is going wrong with my settings?

Thanks a lot in advance,

LB

--
LB, lb@... -- http://www.jourdain.org

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
d binderman | 22 Dec 2005 19:35
Picon
Favicon

net/irda/irnet/irnet_irda.c:699: warning: array subscript out of range


Hello there,

I recently tried out a non standard version of the GNU C compiler on the
2.6.14.4 Linux kernel. The compiler said

net/irda/irnet/irnet_irda.c:699: warning: array subscript out of range

The source code is

      self->rname[NICKNAME_MAX_LEN + 1] = '\0';

but

>find net -name \*.h -print | xargs fgrep rname | more
net/irda/irnet/irnet.h:  char                   rname[NICKNAME_MAX_LEN + 1];

Here is an untested patch to shut up the compiler.

--- net/irda/irnet/irnet_irda.c.sav	2005-12-22 15:15:55.000000000 +0000
+++ net/irda/irnet/irnet_irda.c	2005-12-22 15:16:15.000000000 +0000
 <at>  <at>  -696,7 +696,7  <at>  <at> 
	{
	  /* Yes !!! Get it.. */
	  strlcpy(self->rname, discoveries[i].info, sizeof(self->rname));
-	  self->rname[NICKNAME_MAX_LEN + 1] = '\0';
+	  self->rname[ sizeof( self->rname) - 1 ] = '\0';
	  DEBUG(IRDA_SERV_INFO, "Device 0x%08x is in fact ``%s''.\n",
		self->daddr, self->rname);
	  kfree(discoveries);

Regards

David Binderman

_________________________________________________________________
The new MSN Search Toolbar now includes Desktop search! 
http://toolbar.msn.co.uk/

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Rudolf Marek | 23 Dec 2005 23:07
Picon
Picon

[PATCH2.6] nsc-ircc to platform device + suspend/resume redo

Hello all,

I have never been able to get the nsc-ircc driver working after
resume. As the result I developed a patch that convert driver
to platform_driver stuff plus it adds a working resume for me.

The patch is not yet to be included. What I want is some test/comment
from nsc-ircc users/irda developers.

I know it works for SIR transfers up to 115K.  I dont have any faster device
so I cant test it...

Please can someone do some tests with the patch?

I would like to know if I need to call .._change_speed
even when the device was down to provide some defined state
of those registers, I'm setting speed to 9600.

Good would be if someone can comment the progranm logic.

The patch was a bit inspired by smsc irda driver. If all will
go well I will prepare more cleaner patch for inclusion.

The patch is against 2.6.15-rc6

Thank you,
Regards
Rudolf
diff -Naur a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
--- a/drivers/net/irda/nsc-ircc.c	2005-12-19 01:36:54.000000000 +0100
+++ b/drivers/net/irda/nsc-ircc.c	2005-12-23 22:31:58.000000000 +0100
 <at>  <at>  -57,10 +57,9  <at>  <at> 
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <asm/byteorder.h>
+#include <linux/platform_device.h>  

 #include <linux/pm.h>
-#include <linux/pm_legacy.h>
-
 #include <net/irda/wrapper.h>
 #include <net/irda/irda.h>
 #include <net/irda/irda_device.h>
 <at>  <at>  -70,6 +69,21  <at>  <at> 
 #define CHIP_IO_EXTENT 8
 #define BROKEN_DONGLE_ID

+/* Power Management */
+
+#define NSC_IRCC_DRIVER_NAME                  "nsc-ircc"
+static int nsc_ircc_suspend(struct platform_device *dev, pm_message_t state);
+static int nsc_ircc_resume(struct platform_device *dev);
+
+static struct platform_driver nsc_ircc_driver = {
+	.suspend	= nsc_ircc_suspend,
+	.resume		= nsc_ircc_resume,
+	.driver		= {
+		.name	= NSC_IRCC_DRIVER_NAME,
+	},
+};
+
+
 static char *driver_name = "nsc-ircc";

 /* Module parameters */
 <at>  <at>  -129,7 +143,7  <at>  <at> 
 /* Some prototypes */
 static int  nsc_ircc_open(int i, chipio_t *info);
 static int  nsc_ircc_close(struct nsc_ircc_cb *self);
-static int  nsc_ircc_setup(chipio_t *info);
+static int  nsc_ircc_setup(chipio_t *info, int inte);
 static void nsc_ircc_pio_receive(struct nsc_ircc_cb *self);
 static int  nsc_ircc_dma_receive(struct nsc_ircc_cb *self); 
 static int  nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase);
 <at>  <at>  -158,12 +172,20  <at>  <at> 
 {
 	chipio_t info;
 	nsc_chip_t *chip;
-	int ret = -ENODEV;
+	int ret;
 	int cfg_base;
 	int cfg, id;
 	int reg;
 	int i = 0;
-
+        
+	ret = platform_driver_register(&nsc_ircc_driver);                                          
+        if (ret) {                                                                                  
+                IRDA_ERROR("%s, Can't register driver!\n", driver_name);                            
+                return ret;                                                                         
+        }
+	
+	ret = -ENODEV;
+	
 	/* Probe for all the NSC chipsets we know about */
 	for (chip=chips; chip->name ; chip++) {
 		IRDA_DEBUG(2, "%s(), Probing for %s ...\n", __FUNCTION__,
 <at>  <at>  -213,7 +235,8  <at>  <at> 
 		} 
 		
 	}
-
+	if (ret)                                                                                    
+                platform_driver_unregister(&nsc_ircc_driver);
 	return ret;
 }

 <at>  <at>  -227,12 +250,11  <at>  <at> 
 {
 	int i;

-	pm_unregister_all(nsc_ircc_pmproc);
-
 	for (i=0; i < 4; i++) {
 		if (dev_self[i])
 			nsc_ircc_close(dev_self[i]);
 	}
+	platform_driver_unregister(&nsc_ircc_driver); 
 }

 /*
 <at>  <at>  -254,7 +276,7  <at>  <at> 
 	IRDA_MESSAGE("%s, Found chip at base=0x%03x\n", driver_name,
 		     info->cfg_base);

-	if ((nsc_ircc_setup(info)) == -1)
+	if ((nsc_ircc_setup(info, 1)) == -1)
 		return -1;

 	IRDA_MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name);
 <at>  <at>  -363,12 +385,18  <at>  <at> 
 	
 	self->io.dongle_id = dongle_id;
 	nsc_ircc_init_dongle_interface(self->io.fir_base, dongle_id);
-
-        pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, nsc_ircc_pmproc);
-        if (pmdev)
-                pmdev->data = self;
+	
+	self->pldev = platform_device_register_simple(NSC_IRCC_DRIVER_NAME,
+						      self->index, NULL, 0);
+	if (IS_ERR(self->pldev)) {
+		err = PTR_ERR(self->pldev);
+		goto out5;
+	}
+	platform_set_drvdata(self->pldev, self);

 	return 0;
+ out5: 
+	unregister_netdev(dev);
  out4:
 	dma_free_coherent(NULL, self->tx_buff.truesize,
 			  self->tx_buff.head, self->tx_buff_dma);
 <at>  <at>  -399,6 +427,8  <at>  <at> 

         iobase = self->io.fir_base;

+	platform_device_unregister(self->pldev);  
+	
 	/* Remove netdevice */
 	unregister_netdev(self->netdev);

 <at>  <at>  -812,7 +842,7  <at>  <at> 
  *    Returns non-negative on success.
  *
  */
-static int nsc_ircc_setup(chipio_t *info)
+static int nsc_ircc_setup(chipio_t *info, int inte)
 {
 	int version;
 	int iobase = info->fir_base;
 <at>  <at>  -860,7 +890,8  <at>  <at> 

 	/* Enable receive interrupts */
 	switch_bank(iobase, BANK0);
-	outb(IER_RXHDL_IE, iobase+IER);
+	if (inte)
+	    outb(IER_RXHDL_IE, iobase+IER);

 	return 0;
 }
 <at>  <at>  -2161,47 +2192,85  <at>  <at> 
 	return &self->stats;
 }

-static void nsc_ircc_suspend(struct nsc_ircc_cb *self)
+static int nsc_ircc_suspend(struct platform_device *dev, pm_message_t state)
 {
-	IRDA_MESSAGE("%s, Suspending\n", driver_name);
+    	struct nsc_ircc_cb *self = platform_get_drvdata(dev);
+	int bank;
+	unsigned long flags;
+	int iobase = self->io.fir_base; 
+	if (!self->io.suspended) {
+		IRDA_DEBUG(1, "%s, Suspending\n", driver_name);
+
+		rtnl_lock();
+		if (netif_running(self->netdev)) {
+			netif_device_detach(self->netdev);
+			spin_lock_irqsave(&self->lock, flags);
+			/* Save current bank */
+			bank = inb(iobase+BSR);
+
+			/* Disable interrupts */
+			switch_bank(iobase, BANK0);
+			outb(0, iobase+IER);

-	if (self->io.suspended)
-		return;
+			/* Restore bank register */
+			outb(bank, iobase+BSR);

-	nsc_ircc_net_close(self->netdev);
+			spin_unlock_irqrestore(&self->lock, flags);
+			free_irq(self->io.irq, self->netdev);
+			disable_dma(self->io.dma);
+		}
+		self->io.suspended = 1;
+		rtnl_unlock();
+	}

-	self->io.suspended = 1;
+	return 0;
 }

-static void nsc_ircc_wakeup(struct nsc_ircc_cb *self)
+static int nsc_ircc_resume(struct platform_device *dev)
 {
-	if (!self->io.suspended)
-		return;
-
-	nsc_ircc_setup(&self->io);
-	nsc_ircc_net_open(self->netdev);
-	
-	IRDA_MESSAGE("%s, Waking up\n", driver_name);
+	struct nsc_ircc_cb *self = platform_get_drvdata(dev);
+	int iobase = self->io.fir_base; 
+	unsigned long flags;

-	self->io.suspended = 0;
-}
+	if (self->io.suspended) {
+		IRDA_DEBUG(1, "%s, Waking up\n", driver_name);
+		rtnl_lock();
+		nsc_ircc_setup(&self->io, 0);
+		nsc_ircc_init_dongle_interface(self->io.fir_base, self->io.dongle_id);
+		if (netif_running(self->netdev)) {
+            	    if (request_irq(self->io.irq, nsc_ircc_interrupt, 0,                                   
+                            self->netdev->name, self->netdev)) {
+		    	IRDA_WARNING("%s, unable to allocate irq=%d\n",
+			     driver_name, self->io.irq);
+		
+				/*
+				 * Don't fail resume process, just kill this
+				 * network interface
+				 */
+				unregister_netdevice(self->netdev);
+		    } else {
+				printk("tady1 %d\n",self->io.speed);
+				spin_lock_irqsave(&self->lock, flags);
+				nsc_ircc_change_speed(self, self->io.speed);
+				spin_unlock_irqrestore(&self->lock, flags);
+				netif_device_attach(self->netdev);
+		    }

-static int nsc_ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data)
-{
-        struct nsc_ircc_cb *self = (struct nsc_ircc_cb*) dev->data;
-        if (self) {
-                switch (rqst) {
-                case PM_SUSPEND:
-                        nsc_ircc_suspend(self);
-                        break;
-                case PM_RESUME:
-                        nsc_ircc_wakeup(self);
-                        break;
-                }
-        }
+		} else {
+				printk("tady2 %d\n",self->io.speed);
+				spin_lock_irqsave(&self->lock, flags);
+				nsc_ircc_change_speed(self, 9600);
+				spin_unlock_irqrestore(&self->lock, flags);
+		}
+		self->io.suspended = 0;
+		rtnl_unlock();
+	}
 	return 0;
 }

+
+
+
 MODULE_AUTHOR("Dag Brattli <dagb@...>");
 MODULE_DESCRIPTION("NSC IrDA Device Driver");
 MODULE_LICENSE("GPL");
diff -Naur a/drivers/net/irda/nsc-ircc.h b/drivers/net/irda/nsc-ircc.h
--- a/drivers/net/irda/nsc-ircc.h	2005-12-19 01:36:54.000000000 +0100
+++ b/drivers/net/irda/nsc-ircc.h	2005-12-23 17:21:59.000000000 +0100
 <at>  <at>  -269,7 +269,7  <at>  <at> 
 	__u32 new_speed;
 	int index;                 /* Instance index */

-        struct pm_dev *dev;
+        struct platform_device *pldev;
 };

 static inline void switch_bank(int iobase, int bank)

Gmane