patch-2.4.2-irda3 (misc fixes)
Subsystems (3)
PATCH 1/1 patch-2.4.2-irda3 (misc fixes)
Linus,
These are various irda patches to fix various bit of the stack. Please apply to your latest Linux-2.4.2 code. Changes:
o Fix Ultra sockets on SMP kernel
o Remove OBEX mask and minor cleanups
o IrNET update
All thanks to Jean Tourrilhes
-- Dag
net/irda/af_irda.c renamed from net/irda/af_irda.j1.c +3 -0
@@ -2311,6 +2311,9 @@ static struct proto_ops SOCKOPS_WRAPPED(SOCKOPS_WRAP (irda_stream,PF_IRDA );SOCKOPS_WRAP (irda_seqpacket,PF_IRDA );SOCKOPS_WRAP (irda_dgram,PF_IRDA ); +#ifdef CONFIG_IRDA_ULTRA +SOCKOPS_WRAP (irda_ultra,PF_IRDA ); +#endif /* CONFIG_IRDA_ULTRA */ /* * Function irda_device_event (this, event, ptr)
net/irda/irias_object.c renamed from net/irda/irias_object.d6.c +1 -1
@@ -34,7 +34,7 @@ hashbin_t *objects = NULL;/* * Used when a missing value needs to be returned */ -struct ias_value missing = {IAS_MISSING ,0 ,0 ,0 }; +struct ias_value missing = {IAS_MISSING ,0 ,0 ,0 , {0 }};/* * Function strdup (str)
net/irda/af_irda.c renamed from net/irda/af_irda.d6.c +0 -10
@@ -776,7 +776,6 @@ static int irda_bind(struct socket *sockstruct sock *sk = sock->sk;struct sockaddr_irda *addr = (struct sockaddr_irda *) uaddr;struct irda_sock *self; -__u16 hints =0 ;int err;IRDA_DEBUG (2 , __FUNCTION__"()\n" );
@@ -821,15 +820,6 @@ static int irda_bind(struct socket *sock self->stsap_sel, IAS_KERNEL_ATTR);irias_insert_object (self->ias_obj); -#if 1 /* Will be removed in near future */ - -/* Fill in some default hint bits values */ -if (strncmp (addr->sir_name,"OBEX" ,4 ) ==0 ) - hints =irlmp_service_to_hint (S_OBEX ); - -if (hints) - self->skey =irlmp_register_service (hints); -#endif return 0 ; }
drivers/net/irda/toshoboe.c +1 -1
@@ -896,7 +898,7 @@ toshoboe_gotosleep (struct toshoboe_cb */*FIXME: can't sleep here wait one second */ while ((i--) && (self->txpending)) -mdelay (100 ); +udelay (100 );toshoboe_stopchip (self);toshoboe_disablebm (self);
net/irda/af_irda.c +1 -1
@@ -439,7 +439,7 @@ static void irda_selective_discovery_ind* We were waiting for a node to be discovered, but nothing has come up * so far. Wake up the user and tell him that we failed... */ -static void irda_discovery_timeout (u_long priv) +static void irda_discovery_timeout (u_long priv) {struct irda_sock *self;
net/irda/irlap.c +0 -7
@@ -859,13 +868,6 @@ void irlap_flush_all_queues(struct irlap/* Free sliding window buffered packets */ while ((skb =skb_dequeue (&self->wx_list)) !=NULL )dev_kfree_skb (skb); - -#ifdef CONFIG_IRDA_RECYCLE_RR -if (self->recycle_rr_skb) { -dev_kfree_skb (self->recycle_rr_skb); - self->recycle_rr_skb =NULL ; - } -#endif }/*
Documentation/Configure.help renamed from Documentation/Configure.j1.help +11 -0
@@ -16811,6 +16811,17 @@ CONFIG_IRLAN to another Linux machine running the IrLAN protocol for ad-hoc networking! +IrNET Protocol +CONFIG_IRNET + Say Y here if you want to build support for the IrNET protocol. If + you want to compile it as a module (irnet.o), say M here and read + Documentation/modules.txt. IrNET is a PPP driver, so you will also + need a working PPP subsystem (driver, daemon and config)... + + IrNET is an alternate way to tranfer TCP/IP traffic over IrDA. It + uses synchronous PPP over a set of point to point IrDA sockets. You + can use it between Linux machine or with W2k. + IrCOMM Protocol CONFIG_IRCOMM Say Y here if you want to build support for the IrCOMM protocol. If
net/irda/irnet/irnet.h renamed from net/irda/irnet/irnet.j1.h +13 -3
@@ -5,7 +5,7 @@* * This file contains definitions and declarations global to the IrNET module, * all grouped in one place... -* This file is a private header, so other modules don't want to know +* This file is a *private* header, so other modules don't want to know * what's in there... * * Note : as most part of the Linux kernel, this module is available
@@ -59,8 +59,6 @@* o Connection retries (may be too hard to do) * o Check pppd persist mode * o User space deamon (to automatically handle incomming requests) -* o A registered device number (comming, waiting from an answer) -* o Final integration in Linux-IrDA (up to Dag) * * The setup is not currently the most easy, but this should get much * better when everything will get integrated...
@@ -159,6 +157,17 @@* o Add IRNET_NOANSWER_FROM event (mostly to help support) * o Release flow control in disconnect_indication * o Block packets while connecting (speed up connections) +* +* v5 - 11/01/01 - Jean II +* o Init self->max_header_size, just in case... +* o Set up ap->chan.hdrlen, to get zero copy on tx side working. +* o avoid tx->ttp->flow->ppp->tx->... loop, by checking flow state +* Thanks to Christian Gennerat for finding this bug ! +* --- +* o Declare the proper MTU/MRU that we can support +* (but PPP doesn't read the MTU value :-() +* o Declare hashbin HB_NOLOCK instead of HB_LOCAL to avoid +* disabling and enabling irq twice */ /***************************** INCLUDES *****************************/
@@ -173,6 +182,7 @@#include <linux/netdevice.h> #include <linux/poll.h> #include <asm/uaccess.h> +#include <linux/config.h> #include <linux/ppp_defs.h> #include <linux/if_ppp.h>
net/irda/irnet/irnet_irda.h renamed from net/irda/irnet/irnet_irda.j1.h +1 -1
@@ -13,8 +13,8 @@#define IRNET_IRDA_H /***************************** INCLUDES *****************************/ +/* Please add other headers in irnet.h */ -#include <linux/config.h> #include "irnet.h" /* Module global include */ /************************ CONSTANTS & MACROS ************************/
net/irda/irnet/irnet_irda.c renamed from net/irda/irnet/irnet_irda.j1.c +7 -2
@@ -1039,6 +1039,7 @@ irnet_flow_indication(void * instance, LOCAL_FLOW flow) {irnet_socket * self = (irnet_socket *) instance; +LOCAL_FLOW oldflow = self->tx_flow;DENTER (IRDA_TCB_TRACE ,"(self=0x%X, flow=%d)\n" , (unsigned int ) self, flow);
@@ -1050,7 +1051,11 @@ irnet_flow_indication(void * instance, {case FLOW_START :DEBUG (IRDA_CB_INFO ,"IrTTP wants us to start again\n" ); -ppp_output_wakeup (&self->chan); +/* Check if we really need to wake up PPP */ +if (oldflow ==FLOW_STOP ) +ppp_output_wakeup (&self->chan); +else +DEBUG (IRDA_CB_INFO ,"But we were already transmitting !!!\n" );break ;case FLOW_STOP :DEBUG (IRDA_CB_INFO ,"IrTTP wants us to slow down\n" );
@@ -1426,7 +1431,7 @@ irda_irnet_init(void)memset (&irnet_server,0 ,sizeof (struct irnet_root ));/* Setup start of irnet instance list */ - irnet_server.list =hashbin_new (HB_LOCAL ); + irnet_server.list =hashbin_new (HB_NOLOCK );DABORT (irnet_server.list ==NULL , -ENOMEM ,MODULE_ERROR ,"Can't allocate hashbin!\n" );/* Init spinlock for instance list */
net/irda/irnet/irnet_ppp.c renamed from net/irda/irnet/irnet_ppp.j1.c +6 -6
@@ -394,8 +394,11 @@ dev_irnet_open(struct inode * inode,/* PPP channel setup */ ap->ppp_open =0 ; ap->chan.private = ap; + ap->chan.ops = &irnet_ppp_ops; + ap->chan.mtu = (2048 -TTP_MAX_HEADER -2 -PPP_HDRLEN ); + ap->chan.hdrlen =2 +TTP_MAX_HEADER ;/* for A/C + Max IrDA hdr */ /* PPP parameters */ - ap->mru =PPP_MRU ; + ap->mru = (2048 -TTP_MAX_HEADER -2 -PPP_HDRLEN ); ap->xaccm[0 ] = ~0U ; ap->xaccm[3 ] =0x60000000U ; ap->raccm = ~0U ;
@@ -568,10 +571,7 @@ dev_irnet_ioctl(struct inode * inode,if ((val ==N_SYNC_PPP ) || (val ==N_PPP )) {DEBUG (FS_INFO ,"Entering PPP discipline.\n" ); -/* PPP channel setup */ - ap->chan.private = ap; - ap->chan.ops = &irnet_ppp_ops; - ap->chan.mtu =PPP_MRU ; +/* PPP channel setup (ap->chan in configued in dev_irnet_open())*/ err =ppp_register_channel (&ap->chan);if (err ==0 ) {
@@ -769,7 +769,7 @@ irnet_prepare_skb(irnet_socket * ap,/* prepend address/control fields if necessary */ if (needaddr) { -skb_push (skb,2 ); +skb_push (skb,2 ); skb->data[0 ] =PPP_ALLSTATIONS ; skb->data[1 ] =PPP_UI ; }