Commit Graph

36 Commits

Author SHA1 Message Date
likewise
5f35f4bb3b Reverted back to David Haas' patch of pbuf_chain() from 1.34. 2003-04-01 09:35:20 +00:00
likewise
4c3512c0a2 Replaced pbuf.c 1.34 pbuf_take() change by simpler alternative. 2003-03-31 23:28:54 +00:00
davidhaas
82a32be1d6 Fixed issue in pbuf_take(): old pbuf of type PBUF_REF was being referenced
after being freed. Also, it was not being freed if it had been the first
buffer in chain. It still needs to be freed then.
2003-03-31 21:32:30 +00:00
davidhaas
9f3511231a Fix pbuf_chain() to update tot_len of last buffer in first chain properly.
Previous code skipped it.

Made comments in pbuf_header() more general (header can be increased or
decreased).
2003-03-31 20:45:08 +00:00
likewise
6da25968e0 pbuf_header() now only moves payload pointer upwards for PBUF_ROM/REF. 2003-03-31 18:48:52 +00:00
likewise
a70f478ef1 Fixed pbuf_dechain() assertion. Removed old documentation from pbuf.h. 2003-03-31 11:39:48 +00:00
likewise
6c147709b6 Documentation changes. Added missing trailing newlines to debug messages. 2003-03-31 10:32:35 +00:00
likewise
e6cc785fff Fixed missing variable. 2003-03-31 08:34:02 +00:00
likewise
c50f80da92 Corrected more pbuf.c functions to comply with pbuf->ref and ->tot_len invariant. 2003-03-30 22:24:10 +00:00
davidhaas
c4ff244c4e Fixed minor compile issues. 2003-03-28 19:45:37 +00:00
likewise
002998cf49 Fixed bugs #2968 (ref count) and #2670 (total length).
Name of pbuf_unref() falsely suggests to undo pbuf_ref(), renamed to pbuf_take().
2003-03-28 08:49:05 +00:00
likewise
7dea6dc834 pbuf_realloc() did not update ->tot_len in a chain. Fixed dealloc of REF/ROMs. 2003-03-26 13:50:03 +00:00
likewise
fd0d94af44 Fixing bug #1903 with a new pbuf_realloc() that respects mixed-type chains. 2003-03-26 13:30:38 +00:00
likewise
fa34d51b7e Added documentation and comments. 2003-03-25 12:59:42 +00:00
likewise
80b961df60 Lots of clearing up comments and use of new debugging features. 2003-03-24 15:15:18 +00:00
likewise
e062b70da8 Retry with PBUF_RAM if PBUF_POOL allocation failed. 2003-03-24 13:27:12 +00:00
likewise
07058652c1 Added tracing debug messages. 2003-03-24 12:58:01 +00:00
likewise
20667e5163 Added debug levels for some serious errors (out of memory). 2003-03-24 10:29:03 +00:00
davidhaas
96f2e162ef Fixed memory leak caused by my last pbuf_ref change. 2003-03-21 23:01:20 +00:00
davidhaas
32d9f25a6f Fixed up and made work a PBUF_REF type. Most of the code uses this now
instead of PBUF_ROM. This addition allows support of copy-on-demand where the
lower layers can call pbuf_unref() which tests for any PBUF_REF buffers and
replaces them with PBUF_POOL buffers. This is now used
everywhere. pbuf_unref() is called in ARP queueing and in the coldfire
driver, which puts frames on a DMA queue and frees them later.

Along with this change pbuf_free() now goes through the entire chain of
buffers and tests all the ref counters, not just the first one. Generally now
pbuf_ref_chain() should be called and not pbuf_ref(). This change was made
because it is possible for the head of the pbuf chain to have a different
count than the payload pbuf which might have been passed by the application.
2003-03-19 22:14:49 +00:00
jani
d390ca7056 cleaned up opt.h a bit, added more option defaults ad changed SYS_LIGHTWEIGHT_PROT to be a 0/1 define.The same for COMPAT_SOCKET 2003-02-24 10:49:05 +00:00
jani
18df3961e9 byte-order handling functions are in inet.c now and the uperrcase counterparts are gone. opt.h has all the
configurable items debug does not need to be directly included.
2003-02-21 16:43:46 +00:00
davidhaas
de29a0818e By request: moved lightweight protection to macros. 2003-02-12 22:00:18 +00:00
davidhaas
dd2fa15e8a Add the following features and bugfixes:
Added select() functionality to sockets library.
Support for errno in sockets library.
Byte ordering fixes.
basic lwip_ioctl(), FIONREAD, get/setsockopt() etc. support

- added additional argument to netif_add to pass state pointer so that the
if_init function has access to context information before
the interface is added, without accessing globals.

- added netif_remove()

- to conserve cpu load the tcpip_tcp_timer should only be active
when tcbs that need it exist.

- pass length of available data to callbacks for NETCONN_EVT_RCV events

- added tcpip_link_input(), a hack to allow processing of PPP
packets in tcpip_thread() context. This saves threads and context
switches.

- renamed incompatible ASSERT() macro to LWIP_ASSERT() to avoid name
collision.

- changed a bunch of %d's to %u's in format strings for unsigned values.

- added ip_frag to lwip_stats.

- changed IP_REASS_MAXAGE and IP_REASS_TMO defaults to more realistic
values.

- added sys_timeout_remove() function to cancel timeouts (needed by PPP
amongst other things).

- tolerate NULL returns from sys_arch_timeouts() since some threads might
not need to use or have timeouts.

- added sys_sem_wait_timeout()

- moved mem_malloc() function to end of mem.c to work around tasking
compiler bug.

- automatically bind to local tcp port if 0.

- allow customization of port ranges for automatic local bindings.

- corrected various typos, spelling errors, etc..

Thanks to Marc Boucher for many of these changes.
2003-02-06 22:18:56 +00:00
davidhaas
98fbb855fb Added lightweight protection. In coldfire this is implemented by disabling
interrupts. In unixsim this is implemented by using a mutex. Uses #define
SYS_LIGHTWEIGHT_PROT to enable. It is enabled in coldfire by default, but
disabled in unixsim.

Fixes bug 2005 if you enable SYS_LIGHTWEIGHT_PROT. So the bug is closed.
2003-02-04 22:52:22 +00:00
likewise
faa9191191 Added commented about the signedness of pbuf_header() argument. 2003-01-30 12:38:03 +00:00
likewise
cc4df7100d Updated lwIP module copyright years to include 2003. Committers must check theirs. 2003-01-08 10:09:39 +00:00
jani
156d2c866f sizeof(u8_t) is 1 at temperatures > 0 K 2002-12-19 09:04:58 +00:00
jani
ef68392388 renamed (hopefully everywhere) stats to lwip_stats.closes bug #1901 2002-12-18 12:49:01 +00:00
jani
c0a8ef6f6f Use C style comments.In debug stataments cast various struct pointers to void* to
avoid printf warnings.misc warnings in etharp.
2002-12-17 09:41:16 +00:00
kieranm
96610c9c20 Fixed compiler warning - DEBUGF statement with too many arguments 2002-12-05 09:38:25 +00:00
jani
8210edfeea fix pbuf_alloc for layer PBUF_LINK 2002-11-22 08:32:31 +00:00
likewise
1b798ed6d3 Added PBUF_REF (payload external, copied on queueing). 2002-11-18 09:51:48 +00:00
jani
f2fbcdf00a typo fixes.The unterminated comment already got two bugreports so it was time. 2002-11-18 07:36:29 +00:00
likewise
ad55cb6733 Added pbuf_ref_chain() which increases ref count of all pbufs in a chain. 2002-11-11 11:22:49 +00:00
likewise
f06e955072 Initial revision 2002-10-19 12:59:30 +00:00