Yilun, I was looking at the tx side a bit and think the padding function could be moved into the pkt/phy function. The pky/phy function already is looking for the eop's so reuse it and remove the search for eop and exchange the loops that do char moving and padding to mem* functions. The logic is something like. if (tb == tb_end - 1 && !eop_inserted) { *pb = PKT_EOP;
p_eop = pb; ... dst_pb = &br->phy_buf[aligned_len]; size_t s = pb - p_eop + 1; /* move EOP and bytes after EOP to the end of aligned size */ memmove(dst_pb - s, p_eop, s); /* fill the hole with PHY_IDLEs */ memset(p_eop, PHY_IDLE, aligned_len - br->phy_len); /* update the phy data length */ Tom On 8/18/20 1:36 AM, Xu Yilun wrote: > On Mon, Aug 17, 2020 at 10:12:52AM +0100, Lee Jones wrote: >> On Mon, 17 Aug 2020, Xu Yilun wrote: >> >>> Hi Brown & jones: >>> >>> I tried to refacor the regmap code and add comments in this patchset. I >>> made big changes to the rx flow and remove some tricky parts in it. >>> >>> Would it be more understandable than last version? I'm expecting your >>> comments on it when you have time, thanks in advance. >> Just resubmit please. We can review the code itself. > Ok. I'll rebase it to 5.9-rc1 and resubmit it. > > Thanks, > Yilun > >> -- >> Lee Jones [李琼斯] >> Senior Technical Lead - Developer Services >> Linaro.org │ Open source software for Arm SoCs >> Follow Linaro: Facebook | Twitter | Blog