Fixed bug 3522808, fixed problem with STM32 MAC driver checksum offload.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4156 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2012-05-01 16:53:58 +00:00
parent d317bf915a
commit 8ed6a8d9e3
9 changed files with 23 additions and 18 deletions

View File

@ -288,7 +288,7 @@ void mac_lld_stop(MACDriver *macp) {
* *
* @notapi * @notapi
*/ */
msg_t max_lld_get_transmit_descriptor(MACDriver *macp, msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
MACTransmitDescriptor *tdp) { MACTransmitDescriptor *tdp) {
EMACDescriptor *edp; EMACDescriptor *edp;
@ -378,7 +378,7 @@ void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp) {
* *
* @notapi * @notapi
*/ */
msg_t max_lld_get_receive_descriptor(MACDriver *macp, msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp) { MACReceiveDescriptor *rdp) {
unsigned n; unsigned n;
EMACDescriptor *edp; EMACDescriptor *edp;

View File

@ -227,13 +227,13 @@ extern "C" {
void mac_lld_init(void); void mac_lld_init(void);
void mac_lld_start(MACDriver *macp); void mac_lld_start(MACDriver *macp);
void mac_lld_stop(MACDriver *macp); void mac_lld_stop(MACDriver *macp);
msg_t max_lld_get_transmit_descriptor(MACDriver *macp, msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
MACTransmitDescriptor *tdp); MACTransmitDescriptor *tdp);
size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp, size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp,
uint8_t *buf, uint8_t *buf,
size_t size); size_t size);
void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp); void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp);
msg_t max_lld_get_receive_descriptor(MACDriver *macp, msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp); MACReceiveDescriptor *rdp);
size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp, size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
uint8_t *buf, uint8_t *buf,

View File

@ -384,7 +384,7 @@ void mac_lld_stop(MACDriver *macp) {
* *
* @notapi * @notapi
*/ */
msg_t max_lld_get_transmit_descriptor(MACDriver *macp, msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
MACTransmitDescriptor *tdp) { MACTransmitDescriptor *tdp) {
stm32_eth_tx_descriptor_t *tdes; stm32_eth_tx_descriptor_t *tdes;
@ -493,7 +493,7 @@ void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp) {
* *
* @notapi * @notapi
*/ */
msg_t max_lld_get_receive_descriptor(MACDriver *macp, msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp) { MACReceiveDescriptor *rdp) {
stm32_eth_rx_descriptor_t *rdes; stm32_eth_rx_descriptor_t *rdes;
@ -505,12 +505,12 @@ msg_t max_lld_get_receive_descriptor(MACDriver *macp,
/* Iterates through received frames until a valid one is found, invalid /* Iterates through received frames until a valid one is found, invalid
frames are discarded.*/ frames are discarded.*/
while (!(rdes->rdes0 & STM32_RDES0_OWN)) { while (!(rdes->rdes0 & STM32_RDES0_OWN)) {
if (!(rdes->rdes0 & (STM32_RDES0_AFM | STM32_RDES0_ES if (!(rdes->rdes0 & (STM32_RDES0_AFM | STM32_RDES0_ES))
#if STM32_IP_CHECKSUM_OFFLOAD #if STM32_IP_CHECKSUM_OFFLOAD
| STM32_RDES0_IPHCE | STM32_RDES0_PCE && !(rdes->rdes0 & STM32_RDES0_FT & (STM32_RDES0_IPHCE |
STM32_RDES0_PCE))
#endif #endif
)) && (rdes->rdes0 & STM32_RDES0_FS) && && (rdes->rdes0 & STM32_RDES0_FS) && (rdes->rdes0 & STM32_RDES0_LS)) {
(rdes->rdes0 & STM32_RDES0_LS)) {
/* Found a valid one.*/ /* Found a valid one.*/
rdp->offset = 0; rdp->offset = 0;
rdp->size = ((rdes->rdes0 & STM32_RDES0_FL_MASK) >> 16) - 4; rdp->size = ((rdes->rdes0 & STM32_RDES0_FL_MASK) >> 16) - 4;

View File

@ -323,13 +323,13 @@ extern "C" {
void mac_lld_init(void); void mac_lld_init(void);
void mac_lld_start(MACDriver *macp); void mac_lld_start(MACDriver *macp);
void mac_lld_stop(MACDriver *macp); void mac_lld_stop(MACDriver *macp);
msg_t max_lld_get_transmit_descriptor(MACDriver *macp, msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
MACTransmitDescriptor *tdp); MACTransmitDescriptor *tdp);
size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp, size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp,
uint8_t *buf, uint8_t *buf,
size_t size); size_t size);
void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp); void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp);
msg_t max_lld_get_receive_descriptor(MACDriver *macp, msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp); MACReceiveDescriptor *rdp);
size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp, size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
uint8_t *buf, uint8_t *buf,

View File

@ -153,7 +153,7 @@ msg_t macWaitTransmitDescriptor(MACDriver *macp,
chDbgAssert(macp->state == MAC_ACTIVE, "macWaitTransmitDescriptor(), #1", chDbgAssert(macp->state == MAC_ACTIVE, "macWaitTransmitDescriptor(), #1",
"not active"); "not active");
while (((msg = max_lld_get_transmit_descriptor(macp, tdp)) != RDY_OK) && while (((msg = mac_lld_get_transmit_descriptor(macp, tdp)) != RDY_OK) &&
(time > 0)) { (time > 0)) {
chSysLock(); chSysLock();
systime_t now = chTimeNow(); systime_t now = chTimeNow();
@ -211,7 +211,7 @@ msg_t macWaitReceiveDescriptor(MACDriver *macp,
chDbgAssert(macp->state == MAC_ACTIVE, "macWaitReceiveDescriptor(), #1", chDbgAssert(macp->state == MAC_ACTIVE, "macWaitReceiveDescriptor(), #1",
"not active"); "not active");
while (((msg = max_lld_get_receive_descriptor(macp, rdp)) != RDY_OK) && while (((msg = mac_lld_get_receive_descriptor(macp, rdp)) != RDY_OK) &&
(time > 0)) { (time > 0)) {
chSysLock(); chSysLock();
systime_t now = chTimeNow(); systime_t now = chTimeNow();

View File

@ -104,7 +104,7 @@ void mac_lld_stop(MACDriver *macp) {
* *
* @notapi * @notapi
*/ */
msg_t max_lld_get_transmit_descriptor(MACDriver *macp, msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
MACTransmitDescriptor *tdp) { MACTransmitDescriptor *tdp) {
return RDY_OK; return RDY_OK;
@ -154,7 +154,7 @@ void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp) {
* *
* @notapi * @notapi
*/ */
msg_t max_lld_get_receive_descriptor(MACDriver *macp, msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp) { MACReceiveDescriptor *rdp) {
return RDY_TIMEOUT; return RDY_TIMEOUT;

View File

@ -135,13 +135,13 @@ extern "C" {
void mac_lld_init(void); void mac_lld_init(void);
void mac_lld_start(MACDriver *macp); void mac_lld_start(MACDriver *macp);
void mac_lld_stop(MACDriver *macp); void mac_lld_stop(MACDriver *macp);
msg_t max_lld_get_transmit_descriptor(MACDriver *macp, msg_t mac_lld_get_transmit_descriptor(MACDriver *macp,
MACTransmitDescriptor *tdp); MACTransmitDescriptor *tdp);
size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp, size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp,
uint8_t *buf, uint8_t *buf,
size_t size); size_t size);
void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp); void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp);
msg_t max_lld_get_receive_descriptor(MACDriver *macp, msg_t mac_lld_get_receive_descriptor(MACDriver *macp,
MACReceiveDescriptor *rdp); MACReceiveDescriptor *rdp);
size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp, size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
uint8_t *buf, uint8_t *buf,

View File

@ -79,6 +79,8 @@
***************************************************************************** *****************************************************************************
*** 2.5.0 *** *** 2.5.0 ***
- FIX: Fixed MAC driver functions with invalid name (bug 3522808)(backported
to 2.2.10 and 2.4.1).
- FIX: Fixed code coverage crashes with Linux/gcc-4.4.5 (bug 3522301) - FIX: Fixed code coverage crashes with Linux/gcc-4.4.5 (bug 3522301)
(backported to 2.4.1). (backported to 2.4.1).
- FIX: Fixed macro dmaWaitCompletion() fails to compile in STM32 HAL (bug - FIX: Fixed macro dmaWaitCompletion() fails to compile in STM32 HAL (bug

View File

@ -236,6 +236,7 @@ static const USBEndpointConfig ep1config = {
0x0040, 0x0040,
0x0000, 0x0000,
NULL, NULL,
NULL,
NULL NULL
}; };
@ -250,6 +251,7 @@ static const USBEndpointConfig ep2config = {
0x0010, 0x0010,
0x0000, 0x0000,
NULL, NULL,
NULL,
NULL NULL
}; };
@ -264,6 +266,7 @@ static const USBEndpointConfig ep3config = {
0x0000, 0x0000,
0x0040, 0x0040,
NULL, NULL,
NULL,
NULL NULL
}; };