xmac port code update

This commit is contained in:
lzh 2024-05-20 18:04:25 +08:00 committed by Rbb666
parent 7d7a53ebc1
commit b764055018
2 changed files with 6 additions and 30 deletions

View File

@ -756,14 +756,12 @@ void FXmacErrorHandler(void *arg, u8 direction, u32 error_word)
if (error_word & FXMAC_RXSR_RXOVR_MASK)
{
LOG_I("Receive over run.");
FXmacRecvHandler(instance_p);
SetupRxBds(instance_p, rxring);
FXmacRecvHandler(arg);
}
if (error_word & FXMAC_RXSR_BUFFNA_MASK)
{
LOG_I("Receive buffer not available.");
FXmacRecvHandler(arg);
SetupRxBds(instance_p, rxring);
}
break;
case FXMAC_SEND:
@ -1001,8 +999,7 @@ static void FxmacOsIntrHandler(s32 vector, void *args)
static void FXmacSetupIsr(FXmacOs *instance_p)
{
rt_uint32_t cpu_id = rt_hw_cpu_id();
/* Setup callbacks */
FXmacSetHandler(&instance_p->instance, FXMAC_HANDLER_DMARECV, FXmacRecvSemaphoreHandler, instance_p);
FXmacSetHandler(&instance_p->instance, FXMAC_HANDLER_ERROR, FXmacErrorHandler, instance_p);
@ -1222,34 +1219,18 @@ FError FXmacOsTx(FXmacOs *instance_p, void *tx_buf)
{
FXmacBdRing *txring;
FError ret;
u32 n_pbufs;
struct pbuf *p;
struct pbuf *q;
FASSERT(instance_p != NULL);
if (tx_buf == NULL)
{
LOG_E("tx_buf is null.");
return FREERTOS_XMAC_PARAM_ERROR;
}
FASSERT(tx_buf != NULL);
p = tx_buf;
txring = &(FXMAC_GET_TXRING(instance_p->instance));
for (q = p, n_pbufs = 0; q != NULL; q = q->next)
{
n_pbufs++;
}
FXmacProcessSentBds(instance_p, txring);
/* check if space is available to send */
if (txring->free_cnt < n_pbufs)
{
FXmacProcessSentBds(instance_p, txring);
}
if (IsTxSpaceAvailable(instance_p))
{
FXmacOsOutput(instance_p, p);
ret = FT_SUCCESS;
ret = FXmacOsOutput(instance_p, p);
}
else
{
@ -1406,8 +1387,6 @@ rt_err_t rt_xmac_tx(rt_device_t dev, struct pbuf *p)
return -RT_ENOMEM;
}
#if RT_LWIP_ETH_PAD_SIZE
pbuf_header(p, -RT_LWIP_ETH_PAD_SIZE); /* reclaim the padding word */
#endif
@ -1431,7 +1410,6 @@ struct pbuf *rt_xmac_rx(rt_device_t dev)
FXmacOs *pOsMac;
struct eth_device *pXmacParent;
struct pbuf *p;
rt_base_t level;
pXmacParent = rt_container_of(dev, struct eth_device, parent);
if (NULL == pXmacParent)
@ -1445,10 +1423,8 @@ struct pbuf *rt_xmac_rx(rt_device_t dev)
return RT_NULL;
}
level = rt_hw_interrupt_disable();
FXmacRecvHandler(pOsMac);
p = FXmacOsRx(pOsMac);
rt_hw_interrupt_enable(level);
return p;
}

View File

@ -19,6 +19,6 @@ def clone_repository(branch, commit_hash):
if __name__ == "__main__":
branch_to_clone = "master"
commit_to_clone = "cd15b23000d0c52968dc322b6d99025195bbf446"
commit_to_clone = "588db75e0ca38c0559563303d4ab8cbabab0e3ec"
clone_repository(branch_to_clone, commit_to_clone)