Re: [Qemu-devel] Curious about this code in the ohci_service_td()

2012-02-19 Thread Peter Maydell
On 19 February 2012 07:56, Wei Yang wrote: > 2012/2/19 Peter Maydell : >> On 18 February 2012 16:19, Wei Yang wrote: >>> I am reading the code in ohci_service_td(). >>> >>> There is a calculation of the length of the buffer. >>> >>>        if ((td.cbp & 0xf000) != (td.be & 0xf000)) { >>>

Re: [Qemu-devel] Curious about this code in the ohci_service_td()

2012-02-18 Thread Wei Yang
2012/2/19 Peter Maydell : > On 18 February 2012 16:19, Wei Yang wrote: >> I am reading the code in ohci_service_td(). >> >> There is a calculation of the length of the buffer. >> >>        if ((td.cbp & 0xf000) != (td.be & 0xf000)) { >>            len = (td.be & 0xfff) + 0x1001 - (td.cbp &

Re: [Qemu-devel] Curious about this code in the ohci_service_td()

2012-02-18 Thread Peter Maydell
On 18 February 2012 16:19, Wei Yang wrote: > I am reading the code in ohci_service_td(). > > There is a calculation of the length of the buffer. > >        if ((td.cbp & 0xf000) != (td.be & 0xf000)) { >            len = (td.be & 0xfff) + 0x1001 - (td.cbp & 0xfff); >        } else { >      

[Qemu-devel] Curious about this code in the ohci_service_td()

2012-02-18 Thread Wei Yang
I am reading the code in ohci_service_td(). There is a calculation of the length of the buffer. if ((td.cbp & 0xf000) != (td.be & 0xf000)) { len = (td.be & 0xfff) + 0x1001 - (td.cbp & 0xfff); } else { len = (td.be - td.cbp) + 1; } I am curi