Date: Fri, 19 Aug 2016 19:53:49 +0900 From: YongHyeon PYUN <pyunyh@gmail.com> To: Hans Petter Selasky <hps@selasky.org> Cc: Pyun YongHyeon <yongari@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304439 - head/sys/dev/usb/net Message-ID: <20160819105349.GJ1186@michelle.fasterthan.co.kr> In-Reply-To: <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> <20160819092223.GG1186@michelle.fasterthan.co.kr> <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 19, 2016 at 12:39:58PM +0200, Hans Petter Selasky wrote: > On 08/19/16 11:22, YongHyeon PYUN wrote: > >On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: > >>On 08/19/16 10:55, YongHyeon PYUN wrote: > >>>I think the order is right but it was not tested on big-endian > >>>systems. > >> > >>Hi, > >> > >>I'm pretty sure the ifdef is wrong, because you write the fields one at > >>a time, using htole32(): > >> > >> txhdr.mss = 0; > >> txhdr.len = > >> htole32(AXGE_TXBYTES(m->m_pkthdr.len)); > >> > >>Big endian machines don't re-order variables like this. > >> > >>You should remove the #else part. > > > >Wouldn't USB stack pass txhdr structure without any > >modification? And controller want to see len (low 32bits address) > >first and then mss (high 32bits address). On big endian systems I > >guess this should be reversed in host memory layout. This is so > >confusing so I could be wrong. > > The USB stack passes TXHDR as-is and the host controller is byte > oriented, not 64-bit word oriented. That's why the layout is the same as > long as you assign per 32-bit field. > Ok, fixed in r304458. Thanks for pointing it out!
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160819105349.GJ1186>