On Tue, Dec 05, 2000 at 02:40:47PM +0100, Christian Gennerat wrote:
> This oops happened several times
> 
> 
> irttp_data_request_Rbb400e5c(), No data, or not connected
> irnet: ppp_irnet_send(): IrTTP doesn't like this packet !!! (0xFFFFFF95)
> Warning: kfree_skb passed an skb still on a list (from c3071e5e).

        Ok, this one is easier. You are right, I left a bug in the
code. On the other hand, it never showed up in my heavy testing, so I
guess that your setup is different from mine. I did retest looking for
this precise event, and could not get it.
        I've attempted a fix for this problem. Could you test it ?

        Regards,

        Jean
diff -u -p linux/net/irda/irnet/oldies/irnet.h linux/net/irda/irnet/irnet.h
--- linux/net/irda/irnet/oldies/irnet.h Fri Dec  8 17:35:07 2000
+++ linux/net/irda/irnet/irnet.h        Fri Dec  8 18:29:34 2000
@@ -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
@@ -159,6 +159,12 @@
  *     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 - 8/12/00 - 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 !
  */
 
 /***************************** INCLUDES *****************************/
@@ -173,6 +179,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>
diff -u -p linux/net/irda/irnet/oldies/irnet_irda.h linux/net/irda/irnet/irnet_irda.h
--- linux/net/irda/irnet/oldies/irnet_irda.h    Fri Dec  8 17:35:07 2000
+++ linux/net/irda/irnet/irnet_irda.h   Fri Dec  8 18:10:40 2000
@@ -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 ************************/
diff -u -p linux/net/irda/irnet/oldies/irnet_irda.c linux/net/irda/irnet/irnet_irda.c
--- linux/net/irda/irnet/oldies/irnet_irda.c    Fri Dec  8 17:35:07 2000
+++ linux/net/irda/irnet/irnet_irda.c   Fri Dec  8 18:09:03 2000
@@ -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");
diff -u -p linux/net/irda/irnet/oldies/irnet_ppp.c linux/net/irda/irnet/irnet_ppp.c
--- linux/net/irda/irnet/oldies/irnet_ppp.c     Fri Dec  8 17:35:07 2000
+++ linux/net/irda/irnet/irnet_ppp.c    Fri Dec  8 18:33:46 2000
@@ -394,6 +394,9 @@ 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 = PPP_MRU;
+  ap->chan.hdrlen = 2 + TTP_MAX_HEADER;                /* for A/C + Max IrDA hdr */
   /* PPP parameters */
   ap->mru = PPP_MRU;
   ap->xaccm[0] = ~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;
     }

Reply via email to