read_frame was misuing the packet length in the following ways:
- returning non-zero even if buf_len is too short for the packet
- truncating the length to buf_len if len is too long then using the
truncated (i.e. wrong) length to index into the buffer
- memcpying too many bytes (used buf_len instead of real length)
This commit fixes all of this and adds some code to report
on packet length errors (to match with cc2538 driver).
- moved variable declaration to top of function in accordance with the
Contiki style guide
- made function flatter, reduced nesting to improve readability
phase_wait did not check whether queuebuf_new_from_packetbuf() returns NULL. This potentially causes send_packet to behave incorrectly; the proper packet would not be sent out (because queuebuf_to_packetbuf(NULL) is a no-op). Instead, whatever has been left in the packet buffer by its previous user will be sent out.
Up to now we were using the LibreOffice 4.3 ppa (ppa:libreoffice/libreoffice-4-4) to install doxygen. The LibreOffice Packaging team appear to have removed this ppa, resulting in our doxygen build failing.
This changes the ppa we use to LibreOffice 4.4.x.
The DNS resolver requires 1/4 sec clock resolution. The retro targets had a 1/2 sec clock resolution (optimized for the 1/2 sec TCP timer) resulting in DNS resolver timeouts being 0. Therefore the retro target clock resolution is now increased to 1/4 sec.
When a client sends a CoAP request with no block2 size,
the default one would be set to REST_MAX_CHUNK_SIZE.
However, this is not guaranteed to be a power of 2.
This can lead to clients receiving a bigger payload than expected as
part of the header, and ending up with duplicated content.
Setting the default to COAP_MAX_BLOCK_SIZE,
which is guaranteed to be a power of 2, fixes this.
Only odd addresses may be programmed to the ERXRDPT registers, so
initialize them to RX_BUF_END instead of RX_BUF_START.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
The Bit Field Set and Bit Field Clear commands are more efficient than
the Read Control Register + Write Control Register combination, so use
them whenever possible, i.e. for the ETH registers.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This only applies to half duplex, so the actual configuration of MACON4
does not need to be changed.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
The register 0x01 in bank 2, named MACON2 in the code, is actually
reserved, so its contents must not be changed.
This register has been marked as reserved from the revision B of the
data sheet in July 2006. The current revision of the data sheet is E,
and it is quite clear about this register.
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>