IrDA net-2.6 fixes
Subsystems (2)
PATCH 5/5 irda parameters warning fixes.
In reply to Samuel OrtizThis patch fixes:
CHECK /home/kernel/src/net/irda/parameters.c/home/kernel/src/net/irda/parameters.c:466:2: warning: Using plain integer as NULL pointer /home/kernel/src/net/irda/parameters.c:520:2: warning: Using plain integer as NULL pointer /home/kernel/src/net/irda/parameters.c:573:2: warning: Using plain integer as NULL pointer
From: Richard Knutsson <[email protected]>
--- net/irda/parameters.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/irda/parameters.c +3 -3
@@ -463,7 +463,7 @@int n =0 ; IRDA_ASSERT(buf != NULL, return ret;); - IRDA_ASSERT(info != 0, return ret;); + IRDA_ASSERT(info != NULL, return ret;); pi_minor = pi & info->pi_mask; pi_major = pi >> info->pi_major_offset;
@@ -517,7 +517,7 @@int n =0 ; IRDA_ASSERT(buf != NULL, return ret;); - IRDA_ASSERT(info != 0, return ret;); + IRDA_ASSERT(info != NULL, return ret;); pi_minor = buf[n] & info->pi_mask; pi_major = buf[n] >> info->pi_major_offset;
@@ -570,7 +570,7 @@int n =0 ; IRDA_ASSERT(buf != NULL, return ret;); - IRDA_ASSERT(info != 0, return ret;); + IRDA_ASSERT(info != NULL, return ret;);/* * Parse all parameters. Each parameter must be at least two bytes
Re: [PATCH 1/5] [IrDA] Race between open and disconnect in irda-usb
In reply to Samuel OrtizFrom: Samuel Ortiz <[email protected]>
Date: Mon, 17 Dec 2007 00:46:49 +0100
Quoted 7 lines
It seems to me that
irda_usb_net_open()must setself->netopenunder spinlock ordisconnect()may fail to kill all URBs, if it is called while an interface is opened.From: Oliver Neukum <[email protected]>
Signed-off-by Oliver Neukum <[email protected]>Signed-off-by Samuel Ortiz <[email protected]>
Applied, thanks.
David Miller
AppliedRe: [PATCH 2/5] [IrDA] mcs7780 needs to free allocated rx buffer
In reply to a message not in the archiveFrom: Samuel Ortiz <[email protected]>
Date: Mon, 17 Dec 2007 00:46:50 +0100
Quoted 6 lines
While testing the mcs7780 based IrDA USB dongle I've stumbled upon memory leak in
mcs_net_close(). Patch below fixes it.From: Hinko Kocevar <[email protected]>
Signed-off-by Hinko Kocevar <[email protected]>Signed-off-by Samuel Ortiz <[email protected]>
Applied.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
David Miller
AppliedRe: [PATCH 3/5] [IrDA] irlmp_unregister_link needs to free lsaps
In reply to a message not in the archiveFrom: Samuel Ortiz <[email protected]>
Date: Mon, 17 Dec 2007 00:46:51 +0100
Quoted 6 lines
While testing the mcs7780 based IrDA USB dongle I've stumbled upon memory leak in
irlmp_unregister_link(). Hashbin for lsaps is created inirlmp_register_linkand should probably be freed inirlmp_unregister_link().Signed-off-by Hinko Kocevar <[email protected]>Signed-off-by Samuel Ortiz <[email protected]>
Applied.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
David Miller
AppliedRe: [PATCH 4/5] [IrDA] stir4200 fixes
In reply to a message not in the archiveFrom: Samuel Ortiz <[email protected]>
Date: Mon, 17 Dec 2007 00:46:52 +0100
Quoted 5 lines
The attached patch observes the stir4200 fifo size and will clear the fifo, if the size is increasing, while it should be transmitting bytes
From: Olaf Hartmann <[email protected]>
Signed-off-by Samuel Ortiz <[email protected]>
Applied.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
David Miller
AppliedRe: [PATCH 5/5] [IrDA] irda parameters warning fixes.
In reply to a message not in the archiveFrom: Samuel Ortiz <[email protected]>
Date: Mon, 17 Dec 2007 00:46:53 +0100
Quoted 10 lines
This patch fixes:
CHECK/home/kernel/src/net/irda/parameters.c/home/kernel/src/net/irda/parameters.c:466:2: warning: Using plain integer as NULL pointer/home/kernel/src/net/irda/parameters.c:520:2: warning: Using plain integer as NULL pointer/home/kernel/src/net/irda/parameters.c:573:2: warning: Using plain integer as NULL pointerFrom: Richard Knutsson <[email protected]>
Signed-off-by Richard Knutsson <[email protected]>Signed-off-by Samuel Ortiz <[email protected]>Cc Andrew Morton <akpm-de/[email protected]>
Applied.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
cover IrDA net-2.6 fixes
Hi Dave,
Here goes a batch of 5 IrDA patches against your latest net-2.6 tree.
Cheers,
Samuel.
Signature · 6 lines
------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
PATCH 1/5 Race between open and disconnect in irda-usb
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.
From: Oliver Neukum <[email protected]>
--- drivers/net/irda/irda-usb.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/irda/irda-usb.c +5 -0
@@ -1168,6 +1168,7 @@static int irda_usb_net_open (struct net_device *netdev) {struct irda_usb_cb *self; +unsigned long flags;char hwname[16 ];int i;
@@ -1177,13 +1178,16 @@ 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 ; }
@@ -1198,6 +1202,7 @@/* 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,
Signature · 6 lines
------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
PATCH 2/5 mcs7780 needs to free allocated rx buffer
In reply to Samuel OrtizWhile testing the mcs7780 based IrDA USB dongle I've stumbled upon memory leak in mcs_net_close(). Patch below fixes it.
From: Hinko Kocevar <[email protected]>
--- drivers/net/irda/mcs7780.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/irda/mcs7780.c +2 -0
@@ -677,6 +677,8 @@/* Stop transmit processing */ netif_stop_queue (netdev); +kfree_skb (mcs->rx_buff.skb); +/* kill and free the receive and transmit URBs */ usb_kill_urb (mcs->rx_urb);usb_free_urb (mcs->rx_urb);
Signature · 6 lines
------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
PATCH 3/5 irlmp_unregister_link needs to free lsaps
In reply to Samuel OrtizWhile testing the mcs7780 based IrDA USB dongle I've stumbled upon memory leak in irlmp_unregister_link(). Hashbin for lsaps is created in irlmp_register_link and should probably be freed in irlmp_unregister_link().
--- net/irda/irlmp.c | 1 + 1 file changed, 1 insertion(+)
net/irda/irlmp.c +1 -0
@@ -353,6 +353,7 @@/* Final cleanup */ del_timer (&link->idle_timer); link->magic =0 ; +hashbin_delete (link->lsaps, (FREE_FUNC ) __irlmp_close_lsap);kfree (link); } }
Signature · 6 lines
------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
PATCH 4/5 stir4200 fixes
In reply to Samuel OrtizThe attached patch observes the stir4200 fifo size and will clear the fifo, if the size is increasing, while it should be transmitting bytes
From: Olaf Hartmann <[email protected]>
--- drivers/net/irda/stir4200.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/irda/stir4200.c +6 -4
@@ -142,9 +142,6 @@ };enum StirFifoCtlMask { -FIFOCTL_EOF =0x80 , -FIFOCTL_UNDER =0x40 , -FIFOCTL_OVER =0x20 ,FIFOCTL_DIR =0x10 ,FIFOCTL_CLR =0x08 ,FIFOCTL_EMPTY =0x04 ,
@@ -594,9 +591,10 @@ {int err;unsigned long count, status; +unsigned long prev_count =0x1fff ;/* Read FIFO status and count */ -for (;;) { +for (;; prev_count = count) { err =read_reg (stir,REG_FIFOCTL , stir->fifo_status,FIFO_REGS_SIZE );if (unlikely (err !=FIFO_REGS_SIZE )) {
@@ -629,6 +627,10 @@if (space >=0 &&STIR_FIFO_SIZE -4 > space + count)return 0 ; +/* queue confused */ +if (prev_count < count) +break ; +/* estimate transfer time for remaining chars */ msleep ((count *8000 ) / stir->speed); }
Signature · 6 lines
------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace