mirror of https://github.com/ARMmbed/mbed-os.git
[M487/NUC472] Fix tx frame length and remove GPL license
parent
401f09c479
commit
7bfa362492
|
|
@ -1,23 +1,18 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Nuvoton Technology Corp.
|
* Copyright (c) 2018 Nuvoton Technology Corp.
|
||||||
|
* Copyright (c) 2018 ARM Limited
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* project.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* GNU General Public License for more details.
|
* See the License for the specific language governing permissions and
|
||||||
*
|
* limitations under the License.
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*
|
*
|
||||||
* Description: M480 MAC driver source file
|
* Description: M480 MAC driver source file
|
||||||
*/
|
*/
|
||||||
|
|
@ -297,36 +292,6 @@ void EMAC_RX_IRQHandler(void)
|
||||||
if (nu_eth_txrx_cb != NULL) nu_eth_txrx_cb('R', nu_userData);
|
if (nu_eth_txrx_cb != NULL) nu_eth_txrx_cb('R', nu_userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void EMAC_RX_Action(void)
|
|
||||||
{
|
|
||||||
unsigned int cur_entry, status;
|
|
||||||
do {
|
|
||||||
|
|
||||||
cur_entry = EMAC->CRXDSA;
|
|
||||||
|
|
||||||
if ((cur_entry == (uint32_t)cur_rx_desc_ptr) && (!(m_status & EMAC_INTSTS_RDUIF_Msk))) // cur_entry may equal to cur_rx_desc_ptr if RDU occures
|
|
||||||
break;
|
|
||||||
status = cur_rx_desc_ptr->status1;
|
|
||||||
|
|
||||||
if(status & OWNERSHIP_EMAC)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (status & RXFD_RXGD) {
|
|
||||||
// Lwip will invoke osMutexWait for resource protection, so ethernetif_input can't be called in EMAC_RX_IRQHandler.
|
|
||||||
//ethernetif_input(status & 0xFFFF, cur_rx_desc_ptr->buf, cur_rx_desc_ptr->status2, (uint32_t)cur_rx_desc_ptr->next);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_rx_desc_ptr->status1 = OWNERSHIP_EMAC;
|
|
||||||
cur_rx_desc_ptr = cur_rx_desc_ptr->next;
|
|
||||||
|
|
||||||
} while (1);
|
|
||||||
|
|
||||||
ETH_TRIGGER_RX();
|
|
||||||
// eth_arch_tcpip_thread();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void numaker_eth_trigger_rx(void)
|
void numaker_eth_trigger_rx(void)
|
||||||
{
|
{
|
||||||
|
|
@ -349,8 +314,6 @@ int numaker_eth_get_rx_buf(uint16_t *len, uint8_t **buf)
|
||||||
*buf = cur_rx_desc_ptr->buf;
|
*buf = cur_rx_desc_ptr->buf;
|
||||||
*len = status & 0xFFFF;
|
*len = status & 0xFFFF;
|
||||||
}
|
}
|
||||||
// cur_rx_desc_ptr->status1 = OWNERSHIP_EMAC;
|
|
||||||
// cur_rx_desc_ptr = cur_rx_desc_ptr->next;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,18 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Nuvoton Technology Corp.
|
* Copyright (c) 2018 Nuvoton Technology Corp.
|
||||||
|
* Copyright (c) 2018 ARM Limited
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* project.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* GNU General Public License for more details.
|
* See the License for the specific language governing permissions and
|
||||||
*
|
* limitations under the License.
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*
|
*
|
||||||
* Description: M480 EMAC driver header file
|
* Description: M480 EMAC driver header file
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,18 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Nuvoton Technology Corp.
|
* Copyright (c) 2018 Nuvoton Technology Corp.
|
||||||
|
* Copyright (c) 2018 ARM Limited
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* project.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* GNU General Public License for more details.
|
* See the License for the specific language governing permissions and
|
||||||
*
|
* limitations under the License.
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*
|
*
|
||||||
* Description: NUC472 MAC driver source file
|
* Description: NUC472 MAC driver source file
|
||||||
*/
|
*/
|
||||||
|
|
@ -270,36 +265,6 @@ void EMAC_RX_IRQHandler(void)
|
||||||
if (nu_eth_txrx_cb != NULL) nu_eth_txrx_cb('R', nu_userData);
|
if (nu_eth_txrx_cb != NULL) nu_eth_txrx_cb('R', nu_userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void EMAC_RX_Action(void)
|
|
||||||
{
|
|
||||||
unsigned int cur_entry, status;
|
|
||||||
do {
|
|
||||||
|
|
||||||
cur_entry = EMAC->CRXDSA;
|
|
||||||
|
|
||||||
if ((cur_entry == (uint32_t)cur_rx_desc_ptr) && (!(m_status & EMAC_INTSTS_RDUIF_Msk))) // cur_entry may equal to cur_rx_desc_ptr if RDU occures
|
|
||||||
break;
|
|
||||||
status = cur_rx_desc_ptr->status1;
|
|
||||||
|
|
||||||
if(status & OWNERSHIP_EMAC)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (status & RXFD_RXGD) {
|
|
||||||
// Lwip will invoke osMutexWait for resource protection, so ethernetif_input can't be called in EMAC_RX_IRQHandler.
|
|
||||||
//ethernetif_input(status & 0xFFFF, cur_rx_desc_ptr->buf, cur_rx_desc_ptr->status2, (uint32_t)cur_rx_desc_ptr->next);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_rx_desc_ptr->status1 = OWNERSHIP_EMAC;
|
|
||||||
cur_rx_desc_ptr = cur_rx_desc_ptr->next;
|
|
||||||
|
|
||||||
} while (1);
|
|
||||||
|
|
||||||
ETH_TRIGGER_RX();
|
|
||||||
// eth_arch_tcpip_thread();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void numaker_eth_trigger_rx(void)
|
void numaker_eth_trigger_rx(void)
|
||||||
{
|
{
|
||||||
|
|
@ -322,9 +287,13 @@ int numaker_eth_get_rx_buf(uint16_t *len, uint8_t **buf)
|
||||||
*buf = cur_rx_desc_ptr->buf;
|
*buf = cur_rx_desc_ptr->buf;
|
||||||
*len = status & 0xFFFF;
|
*len = status & 0xFFFF;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void numaker_eth_rx_next(void)
|
||||||
|
{
|
||||||
cur_rx_desc_ptr->status1 = OWNERSHIP_EMAC;
|
cur_rx_desc_ptr->status1 = OWNERSHIP_EMAC;
|
||||||
cur_rx_desc_ptr = cur_rx_desc_ptr->next;
|
cur_rx_desc_ptr = cur_rx_desc_ptr->next;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EMAC_TX_IRQHandler(void)
|
void EMAC_TX_IRQHandler(void)
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,18 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Nuvoton Technology Corp.
|
* Copyright (c) 2018 Nuvoton Technology Corp.
|
||||||
|
* Copyright (c) 2018 ARM Limited
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* project.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* GNU General Public License for more details.
|
* See the License for the specific language governing permissions and
|
||||||
*
|
* limitations under the License.
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*
|
*
|
||||||
* Description: NUC472 EMAC driver header file
|
* Description: NUC472 EMAC driver header file
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,19 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Nuvoton Technology Corp.
|
* Copyright (c) 2018 Nuvoton Technology Corp.
|
||||||
|
* Copyright (c) 2018 ARM Limited
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* project.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* GNU General Public License for more details.
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*
|
*
|
||||||
* Description: NuMaker EMAC
|
* Description: NuMaker EMAC
|
||||||
*/
|
*/
|
||||||
|
|
@ -34,7 +30,7 @@
|
||||||
#include "netsocket/nsapi_types.h"
|
#include "netsocket/nsapi_types.h"
|
||||||
#include "mbed_shared_queues.h"
|
#include "mbed_shared_queues.h"
|
||||||
|
|
||||||
#define NU_TRACE
|
//#define NU_TRACE
|
||||||
|
|
||||||
#include "numaker_emac_config.h"
|
#include "numaker_emac_config.h"
|
||||||
#include "numaker_emac.h"
|
#include "numaker_emac.h"
|
||||||
|
|
@ -140,7 +136,6 @@ int NUMAKER_EMAC::low_level_input(emac_mem_buf_t **buf)
|
||||||
if ( numaker_eth_get_rx_buf(&len, &buffer) != 0) {
|
if ( numaker_eth_get_rx_buf(&len, &buffer) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
byteslefttocopy = len;
|
byteslefttocopy = len;
|
||||||
|
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
|
|
@ -156,10 +151,11 @@ int NUMAKER_EMAC::low_level_input(emac_mem_buf_t **buf)
|
||||||
NU_DEBUGF(("offset=[%d], bytes-to-copy[%d]\r\n",bufferoffset,byteslefttocopy));
|
NU_DEBUGF(("offset=[%d], bytes-to-copy[%d]\r\n",bufferoffset,byteslefttocopy));
|
||||||
/* Copy data in pbuf */
|
/* Copy data in pbuf */
|
||||||
memcpy(static_cast<uint8_t *>(memory_manager->get_ptr(q)) + payloadoffset, static_cast<uint8_t *>(buffer) + bufferoffset, byteslefttocopy);
|
memcpy(static_cast<uint8_t *>(memory_manager->get_ptr(q)) + payloadoffset, static_cast<uint8_t *>(buffer) + bufferoffset, byteslefttocopy);
|
||||||
|
|
||||||
bufferoffset = bufferoffset + byteslefttocopy;
|
bufferoffset = bufferoffset + byteslefttocopy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
numaker_eth_rx_next();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,7 +197,7 @@ void NUMAKER_EMAC::packet_rx()
|
||||||
NU_DEBUGF(("%s ... p=0x%x\r\n",__FUNCTION__,p));
|
NU_DEBUGF(("%s ... p=0x%x\r\n",__FUNCTION__,p));
|
||||||
emac_link_input_cb(p);
|
emac_link_input_cb(p);
|
||||||
}
|
}
|
||||||
// numaker_eth_rx_next();
|
numaker_eth_rx_next();
|
||||||
}
|
}
|
||||||
numaker_eth_trigger_rx();
|
numaker_eth_trigger_rx();
|
||||||
|
|
||||||
|
|
@ -265,7 +261,7 @@ bool NUMAKER_EMAC::link_out(emac_mem_buf_t *buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare transmit descriptors to give to DMA */
|
/* Prepare transmit descriptors to give to DMA */
|
||||||
numaker_eth_trigger_tx(byteslefttocopy, NULL);
|
numaker_eth_trigger_tx(framelength, NULL);
|
||||||
|
|
||||||
result = true;
|
result = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,17 @@
|
||||||
/*
|
/* Copyright (c) 2018 ARM Limited
|
||||||
* Copyright (c) 2018 Nuvoton Technology Corp.
|
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* project.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* GNU General Public License for more details.
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*
|
*
|
||||||
* Description: NuMaker EMAC Config header file
|
* Description: NuMaker EMAC Config header file
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,20 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018 Nuvoton Technology Corp.
|
* Copyright (c) 2018 Nuvoton Technology Corp.
|
||||||
|
* Copyright (c) 2018 ARM Limited
|
||||||
*
|
*
|
||||||
* See file CREDITS for list of people who contributed to this
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* project.
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* GNU General Public License for more details.
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* Description: NuMaker EMAC HAL header file
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
||||||
* MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
* Description: NUC472 EMAC driver header file
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef NUMAKER_ETH_HAL_
|
#ifndef NUMAKER_ETH_HAL_
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue