Samuel Ortiz | 1 Oct 2007 01:21

[PATCH] IrDA: Oops fix for ksdazzle

Hi Dave,

This is the last remaining patch for IrDA, against net-2.6.24.

It fixes a kernel oops triggered by the ksdazzle SIR driver.
We need more space for input frames, and 2048 should be plenty of it.

Signed-off-by: Alex Villacís Lasso <a_villacis <at> palosanto.com>
Signed-off-by: Samuel Ortiz <samuel <at> sortiz.org>

---
 drivers/net/irda/ksdazzle-sir.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Index: net-2.6.24-quilt/drivers/net/irda/ksdazzle-sir.c
===================================================================
--- net-2.6.24-quilt.orig/drivers/net/irda/ksdazzle-sir.c	2007-10-01 01:53:56.000000000 +0300
+++ net-2.6.24-quilt/drivers/net/irda/ksdazzle-sir.c	2007-10-01 01:53:58.000000000 +0300
 <at>  <at>  -1,7 +1,7  <at>  <at> 
 /*****************************************************************************
 *
 * Filename:      ksdazzle.c
-* Version:       0.1.1
+* Version:       0.1.2
 * Description:   Irda KingSun Dazzle USB Dongle
 * Status:        Experimental
 * Author:        Alex Villacís Lasso <a_villacis <at> palosanto.com>
 <at>  <at>  -113,6 +113,7  <at>  <at> 
 #define KINGSUN_REQ_SEND 0x09

(Continue reading)

David Miller | 8 Oct 2007 10:07
Favicon

Re: [PATCH] IrDA: Oops fix for ksdazzle

From: Samuel Ortiz <samuel@...>
Date: Mon, 1 Oct 2007 02:21:38 +0300

> Hi Dave,
> 
> This is the last remaining patch for IrDA, against net-2.6.24.
> 
> It fixes a kernel oops triggered by the ksdazzle SIR driver.
> We need more space for input frames, and 2048 should be plenty of it.
> 
> Signed-off-by: Alex Villacís Lasso <a_villacis@...>
> Signed-off-by: Samuel Ortiz <samuel@...>

Applied, thanks!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Da Feng | 9 Oct 2007 14:23
Picon
Favicon

do you have a product for infrared local area network?

I suppose there may be a product like an 3G mobile microcell station. Which can be put on the ceiling, and proxying infrared signals between both indviduals and internet. This can be achieved by something like an ominidirectional camera. I know this kind of camera, so I guess whether there is such a product.
http://www.cis.upenn.edu/~kostas/omni.html
If there isn't one, can we build one?

Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
irda-users mailing list
irda-users@...
http://lists.sourceforge.net/lists/listinfo/irda-users
linux babu | 10 Oct 2007 08:45
Picon

Help required in usb-irda dongle

Hi all,
Iam new to linux Irda subsystem, i have an usb-irda dongle, iam analysing the code in linux i have  few questions can anyone help me
1) how an application ftp protocol can Transmit data to Irda device, where does irda stack come into picture, whether is it
Application Ftp, tcp, ip,       usb irda driver,usb bridge Then where does irda stack come into picture.
2) when iam transmitting data from Irda device to host from usb-driver who will take data whether it is Irda stack or Ip layer iam getting
confused at this part.can any one can explain please.
3)where ican get documents on Irda protocol.
4) will irda stack supports linux-2.6.11 kernel.

Thanks in advance,
Babu

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
irda-users mailing list
irda-users@...
http://lists.sourceforge.net/lists/listinfo/irda-users
linux babu | 10 Oct 2007 13:45
Picon

Re: Help required in usb-irda dongle

Hi all  and thanks for your Immediate response,
1) I like to know are there any sniffers to trace my irda packet.
2) Does skbuff(socket buffer) has a  any pointer to irda entity.
3) What are SIR,MIR and FIR modes in Irda where can i get details about these modes. can i get any chipset details in open regarding these modes.
Thanks in advance,
With regards,
Babu


On 10/10/07, linux babu <linuxsrbabu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi all,
Iam new to linux Irda subsystem, i have an usb-irda dongle, iam analysing the code in linux i have  few questions can anyone help me
1) how an application ftp protocol can Transmit data to Irda device, where does irda stack come into picture, whether is it
Application Ftp, tcp, ip,       usb irda driver,usb bridge Then where does irda stack come into picture.
2) when iam transmitting data from Irda device to host from usb-driver who will take data whether it is Irda stack or Ip layer iam getting
confused at this part.can any one can explain please.
3)where ican get documents on Irda protocol.
4) will irda stack supports linux-2.6.11 kernel.

Thanks in advance,
Babu

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
irda-users mailing list
irda-users@...
http://lists.sourceforge.net/lists/listinfo/irda-users
Picon
Favicon

Re: Help required in usb-irda dongle

linux babu wrote:
> Hi all  and thanks for your Immediate response,
> 1) I like to know are there any sniffers to trace my irda packet.

See irdadump in irda-utils package. Also ethereal (wireshark) and 
tcpdump might come in handy.

> 2) Does skbuff(socket buffer) has a  any pointer to irda entity.
> 3) What are SIR,MIR and FIR modes in Irda where can i get details about 
> these modes. can i get any chipset details in open regarding these modes.

Chipset details are found in the chip datasheet. Information on SIR, MIR 
and FIR modes can be found via google.

--

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar <at> cetrtapot.si
Http: www.cetrtapot.si

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
irda-users mailing list
irda-users <at> lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/irda-users
Samuel Abels | 11 Oct 2007 00:51

STIR421X: Couldn't upload patch

Hi,

Trying to use my new USB dongle the following message is from the
syslog:

[   61.698355] IRDA-USB found at address 2, Vendor: 66f, Product: 4210
[   61.699551] irda_usb_parse_endpoints(), And our endpoints are : in=02, out=01 (512), int=00
[   61.709826] irda_usb_init_qos(), dongle says speed=0x17F, size=0x20, window=0x8, bofs=0x80, turn=0x4
[   61.709898] IrDA: Registered device irda0
[   61.760841] STIR421X: Couldn't upload patch
[   61.814141] irda-usb: probe of 7-2:1.0 failed with error -2

I have appended some hardware/kernel information below.

Any idea what is going on?

-Samuel

$ uname -a
Linux knip 2.6.22-14-generic #1 SMP Wed Oct 10 06:00:47 GMT 2007 i686 GNU/Linux

$ lsmod | grep ir
irda_usb               21892  0 
irda                  202300  1 irda_usb
crc_ccitt               3072  1 irda
usbcore               138248  8 hci_usb,irda_usb,usbhid,usb_storage,libusual,ehci_hcd,uhci_hcd

$ sudo lsusb -v -d 066f:
Bus 007 Device 002: ID 066f:4210 SigmaTel, Inc. STIr4210 IrDA Bridge
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x066f SigmaTel, Inc.
  idProduct          0x4210 STIr4210 IrDA Bridge
  bcdDevice           10.02
  iManufacturer           1 SigmaTel, Inc.
  iProduct                2 STIr42xx      
  iSerial                 3 0002F1080DF2C01A
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 USB IrDA Config
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      2 IRDA Bridge
      bInterfaceProtocol      0 
      iInterface              5 SigmaTel IrDA Interface
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
Picon
Favicon

irlap leaks?

Hi
I'm experiencing quite large slab leaks when running simple script 
(attached in [1]). I have mcs7780 USB IrDA device. I've managed to debug 
the kernel and found out that the hashbin_* functions might leak.

After nearly 5000 iterations of the [1] script the main consumer of 
size-64 slab is found at c02a72af:
# head -qn20 slab_allocators-200710111* | grep c02a72af
size-64: 113 c02a72af
size-64: 213 c02a72af
size-64: 313 c02a72af
size-64: 413 c02a72af
size-64: 513 c02a72af
size-64: 613 c02a72af
size-64: 713 c02a72af
size-64: 813 c02a72af
size-64: 913 c02a72af
size-64: 1013 c02a72af
size-64: 1113 c02a72af
size-64: 1213 c02a72af
size-64: 1313 c02a72af
size-64: 1413 c02a72af
size-64: 1513 c02a72af
size-64: 1613 c02a72af
size-64: 1713 c02a72af
size-64: 1813 c02a72af
size-64: 1913 c02a72af
size-64: 2013 c02a72af
size-64: 2113 c02a72af
size-64: 2213 c02a72af
size-64: 2313 c02a72af
size-64: 2413 c02a72af
size-64: 2513 c02a72af
size-64: 2613 c02a72af
size-64: 2713 c02a72af
size-64: 2813 c02a72af
size-64: 2913 c02a72af
size-64: 3013 c02a72af
size-64: 3113 c02a72af
size-64: 3213 c02a72af
size-64: 3313 c02a72af
size-64: 3413 c02a72af
size-64: 3513 c02a72af
size-64: 3613 c02a72af
size-64: 3713 c02a72af
size-64: 3813 c02a72af
size-64: 3913 c02a72af
size-64: 4013 c02a72af
size-64: 4113 c02a72af
size-64: 4213 c02a72af
size-64: 4313 c02a72af
size-64: 4413 c02a72af
size-64: 4513 c02a72af
size-64: 4613 c02a72af
size-64: 4713 c02a72af
size-64: 4813 c02a72af

# grep -A 2 -B 2 c02a72 /usr/src/linux/System.map
c02a7199 t dequeue_first
c02a71e0 t dequeue_general
c02a7226 T hashbin_new
c02a7253 T hashbin_delete
c02a734d T hashbin_insert
c02a745e T hashbin_remove_first

Other top slab consumers include these allocators whose numbers went up 
(I've removed the constant allocators from the list):
dentry: 26680 c015cc6c
size-64: 4813 c02a72af
buffer_head: 1988 c016cba8
radix_tree_node: 1633 c01cd6ca
ext3_inode_cache: 1612 c018d1af
filp: 858 c014e662

The 'buffer_head' is also interested:
# grep -A 2 -B 2 c016cb /boot/System.map
c016ca3f T try_to_free_buffers
c016cad2 T block_sync_page
c016cb03 T sys_bdflush
c016cb61 t recalc_bh_state
c016cb98 T alloc_buffer_head
c016cbed T free_buffer_head
c016cc38 t buffer_exit_cpu
c016cc90 t buffer_cpu_notify

Let me stress out that if I comment out the call to irlap_open() in the 
mcs7780 driver that allocates new irlap instance (in mcs_net_open()), 
the *leaks are gone*!

Can anyone give me some insight to this matter?

# uname -a
Linux prudencia 2.6.23-gentoo #4 PREEMPT Thu Oct 11 16:04:49 CEST 2007 
i686 Intel(R) Pentium(R) III Mobile CPU 1200MHz GenuineIntel GNU/Linux

# grep IRDA /usr/src/linux/.config
CONFIG_IRDA=y
# CONFIG_IRDA_ULTRA is not set
# CONFIG_IRDA_CACHE_LAST_LSAP is not set
CONFIG_IRDA_FAST_RR=y
CONFIG_IRDA_DEBUG=y
# CONFIG_USB_IRDA is not set

[1] My test script:
--->8----
#!/bin/sh

[ ! -d /mnt/memtest ] && mkdir -p /mnt/memtest
cnt=0
max=100

S=`grep Slab /proc/meminfo`
D=`date +"%Y%m%d%H%M%S"`
echo "$D :: iter $cnt :: $S" > /mnt/memtest/meminfo
cat /proc/slabinfo > /mnt/memtest/slabinfo-${D}
sort -rnk2 /proc/slab_allocators > /mnt/memtest/slab_allocators-${D}

while [ 1 ]; do
	/sbin/ifconfig irda0 down
	#sleep 1
	/sbin/ifconfig irda0 up
	#sleep 1
	
	#D=`date +"meminfo-%Y%m%d%H%M%S"`
	#cat /proc/meminfo > /mnt/memtest/$D
	#grep Slab /mnt/memtest/$D
	S=`grep Slab /proc/meminfo`
	if [ $cnt -eq $max ]; then
		D=`date +"%Y%m%d%H%M%S"`
		echo "$D :: iter $cnt :: $S" >> /mnt/memtest/meminfo
		cat /proc/slabinfo > /mnt/memtest/slabinfo-${D}
		sort -rnk2 /proc/slab_allocators > /mnt/memtest/slab_allocators-${D}
		let "max = $max + 100"
	fi
	echo "iter $cnt :: $S"
	let "cnt = $cnt + 1"
done
--->8----

Thanks,
Hinko

--

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar <at> cetrtapot.si
Http: www.cetrtapot.si

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
irda-users mailing list
irda-users <at> lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/irda-users
Picon
Favicon

Re: irlap leaks?

hinko.kocevar <at> cetrtapot.si wrote:
> 
> # grep IRDA /usr/src/linux/.config
> CONFIG_IRDA=y
> # CONFIG_IRDA_ULTRA is not set
> # CONFIG_IRDA_CACHE_LAST_LSAP is not set
> CONFIG_IRDA_FAST_RR=y
> CONFIG_IRDA_DEBUG=y
> # CONFIG_USB_IRDA is not set
> 

Grepped the wrong config here. Should read:
# grep IRDA /usr/src/linux/.config
CONFIG_IRDA=y
# CONFIG_IRDA_ULTRA is not set
CONFIG_IRDA_CACHE_LAST_LSAP=y
CONFIG_IRDA_FAST_RR=y
CONFIG_IRDA_DEBUG=y
# CONFIG_USB_IRDA is not set

--

-- 
ČETRTA POT, d.o.o., Kranj
Planina 3
4000 Kranj
Slovenia, Europe
Tel. +386 (0) 4 280 66 03
E-mail: hinko.kocevar <at> cetrtapot.si
Http: www.cetrtapot.si

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
irda-users mailing list
irda-users <at> lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/irda-users
Oliver Neukum | 12 Oct 2007 10:53

[PATCH]race between open and disconnect in irda-usb

Hi,

it seems to me that irda_usb_net_open() must set self->netopen
under spinlock or disconnect() may fail to kill all URBs, if it is called
while an interface is opened.

Signed-off-by: Oliver Neukum <oneukum@...>

	Regards
		Oliver

----

--- a/drivers/net/irda/irda-usb.c	2007-10-11 17:24:35.000000000 +0200
+++ b/drivers/net/irda/irda-usb.c	2007-10-11 17:30:30.000000000 +0200
 <at>  <at>  -1168,6 +1168,7  <at>  <at>  static int stir421x_patch_device(struct 
 static int irda_usb_net_open(struct net_device *netdev)
 {
 	struct irda_usb_cb *self;
+	unsigned long flags;
 	char	hwname[16];
 	int i;
 	
 <at>  <at>  -1177,13 +1178,16  <at>  <at>  static int irda_usb_net_open(struct net_
 	self = (struct irda_usb_cb *) netdev->priv;
 	IRDA_ASSERT(self != NULL, return -1;);

+	spin_lock_irqsave(&self->lock, flags);
 	/* Can only open the device if it's there */
 	if(!self->present) {
+		spin_unlock_irqrestore(&self->lock, flags);
 		IRDA_WARNING("%s(), device not present!\n", __FUNCTION__);
 		return -1;
 	}

 	if(self->needspatch) {
+		spin_unlock_irqrestore(&self->lock, flags);
 		IRDA_WARNING("%s(), device needs patch\n", __FUNCTION__) ;
 		return -EIO ;
 	}
 <at>  <at>  -1198,6 +1202,7  <at>  <at>  static int irda_usb_net_open(struct net_
 	/* To do *before* submitting Rx urbs and starting net Tx queue
 	 * Jean II */
 	self->netopen = 1;
+	spin_unlock_irqrestore(&self->lock, flags);

 	/* 
 	 * Now that everything should be initialized properly,

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

Gmane