RIOT-OS/RIOT — pull request #2237 by fnack (2014-12-30 16:05:24+00:00)
Title: drivers/cc110x: Allow packet sizes up to 255 bytes

This PR extends the current cc110x driver implementation to allow packet sizes up to 255 bytes (maximum for Variable Packet Length Mode) and adapts the netdev receive mechanism to handle packet reception not in the interrupt but in the event handling thread.

Both, the RX and the TX FIFO of the cc110x can only store 64 bytes. Therefore, for packet sizes > 64 bytes consecutively reading/pushing bytes is necessary.

For transmission of packets > 64 bytes the TX FIFO is filled with the first 64 bytes and afterwards the remaining bytes are consecutively pushed to the TX FIFO when space is available until all the bytes are transmitted (necessary because a TXFIFO underflow would result in a corrupted packet).

For reception of a packet, two interrupts are used. The first interrupt is triggered, when the RX FIFO is filled with more than 4 bytes (RX FIFO threshold, packets with less bytes are not valid). Subsequently, the available bytes in the RXFIFO are consecutively read until the whole packet is received. This is necessary to avoid a RX FIFO overflow. The second interrupt is triggered when the cc110x signals that the whole packet was received. This results in reading the remaining two status bytes in the RXFIFO. Afterwards the packet either gets dropped (CRC wrong) or gets processed further.

The PR is depending on #2163 (introduction of event handler pid member variable in netdev_t).