Commit 6febdedc authored by Ben Laughton's avatar Ben Laughton
Browse files

Fixed bug where callback to read data would not be removed, causing PPP to...

Fixed bug where callback to read data would not be removed, causing PPP to block heavily in certain situations.

Version 1.21. Tagged as 'PPP-1_21'
parent c38c2ccc
......@@ -6,6 +6,15 @@ Owner: Ben Laughton
Project(s): Daytona, NC, Desktop machines.
*******************************************************************************
===============================================================================
Version: 1_21
Date: 1998-05-12
Name: Ben Laughton
CVS tag: PPP-1_21
Fixed bug in dual serial version where PPP could block heavily if you
got unlucky with the data transfer rate (ie. compression is a factor).
===============================================================================
Version: 1_20
Date: 1998-04-28
......
......@@ -5,8 +5,8 @@
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
Module_MajorVersion SETS "1.20"
Module_Version SETA 120
Module_MajorVersion SETS "1.21"
Module_Version SETA 121
Module_MinorVersion SETS ""
Module_Date SETS "28 Apr 1998"
Module_Date SETS "12 May 1998"
END
/* (1.20)
/* (1.21)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.20
#define Module_MajorVersion_CMHG 1.21
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Apr 1998
#define Module_Date_CMHG 12 May 1998
#define Module_MajorVersion "1.20"
#define Module_Version 120
#define Module_MajorVersion "1.21"
#define Module_Version 121
#define Module_MinorVersion ""
#define Module_Date "28 Apr 1998"
#define Module_Date "12 May 1998"
......@@ -20,6 +20,12 @@
* Idle timer was mistakenly being incremented twice in hangup check handler.
* Removed reliance on Dialler for hangup check if dialler option is used on
* command line.
*
* 1998-05-12: BAL
* Fixed bug in dual serial poll_handler: call to remove callback was passing
* address of handler function rather than veneer routine. This call would
* obviously fail silently, but any pending callback would still go off. This
* was resulting in PPP blocking heavily in certain situations.
*/
#include <stdlib.h>
#include <stdio.h>
......@@ -384,77 +390,6 @@ _kernel_oserror *poll_handler(_kernel_swi_regs *r, void *pw)
#else
#if 0
_kernel_oserror *poll_handler(_kernel_swi_regs *r, void *pw)
{
char buffer[256], *p=buffer;
int bytes, bytes_not_done;
_kernel_irqs_on ();
callback_pending = 0; /* no callbacks waiting */
NOT_USED(pw);
NOT_USED(r);
/* Read amount of data in serial input buffer */
_swix (OS_Args, _INR (0, 1) | _OUT (2), 2, serial_in, &bytes);
if (bytes > 0)
{
if (bytes > sizeof (buffer))
bytes = sizeof (buffer);
/* Read data from serial input buffer */
_swix (OS_GBPB, _INR (0, 3) | _OUT (3),
4, serial_in, buffer, bytes, &bytes_not_done);
bytes -= bytes_not_done;
}
while (bytes)
{
p = buffer;
while (bytes)
{
pppinput(*p, 0);
bytes--;
p++;
}
_swix (OS_Args, _INR (0, 1) | _OUT (2), 2, serial_in, &bytes);
if (bytes > 0)
{
/* If there is more data to read and a DeviceRxDataPresent upcall
* occurred while this function was executing then an upcall will
* have been added. This is no longer necessary as the data it
* informed us about is just about to be read anyway, so remove the
* upcall.
*/
if (callback_pending)
{
_swix (OS_RemoveCallBack, _INR (0, 1), poll_handler, pw);
callback_pending = 0;
}
if (bytes > sizeof (buffer))
bytes = sizeof (buffer);
_swix (OS_GBPB, _INR (0, 3) | _OUT (3),
4, serial_in, buffer, bytes, &bytes_not_done);
bytes -= bytes_not_done;
}
}
return NULL;
}
#endif
_kernel_oserror *poll_handler(_kernel_swi_regs *r, void *pw)
{
......@@ -521,7 +456,7 @@ _kernel_oserror *poll_handler(_kernel_swi_regs *r, void *pw)
if (callback_pending)
{
pdebug ((LOG_DEBUG, "about to remove callback"));
_swix (OS_RemoveCallBack, _INR (0, 1), poll_handler, pw);
_swix (OS_RemoveCallBack, _INR (0, 1), poll_entry, pw);
/* atomic update of callback pending flag */
interrupt_status = splhi ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment