PCnet: Allow more then two TMDs (Jan Kiszka)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4225 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2008-04-20 10:59:29 +00:00
parent b305b5ba18
commit 9bd0d29401

View File

@ -1249,15 +1249,14 @@ static void pcnet_transmit(PCNetState *s)
#endif #endif
if (GET_FIELD(tmd.status, TMDS, STP)) { if (GET_FIELD(tmd.status, TMDS, STP)) {
s->xmit_pos = 0; s->xmit_pos = 0;
if (!GET_FIELD(tmd.status, TMDS, ENP)) {
int bcnt = 4096 - GET_FIELD(tmd.length, TMDL, BCNT);
s->phys_mem_read(s->dma_opaque, PHYSADDR(s, tmd.tbadr),
s->buffer, bcnt, CSR_BSWP(s));
s->xmit_pos += bcnt;
}
xmit_cxda = PHYSADDR(s,CSR_CXDA(s)); xmit_cxda = PHYSADDR(s,CSR_CXDA(s));
} }
if (GET_FIELD(tmd.status, TMDS, ENP) && (s->xmit_pos >= 0)) { if (!GET_FIELD(tmd.status, TMDS, ENP)) {
int bcnt = 4096 - GET_FIELD(tmd.length, TMDL, BCNT);
s->phys_mem_read(s->dma_opaque, PHYSADDR(s, tmd.tbadr),
s->buffer + s->xmit_pos, bcnt, CSR_BSWP(s));
s->xmit_pos += bcnt;
} else if (s->xmit_pos >= 0) {
int bcnt = 4096 - GET_FIELD(tmd.length, TMDL, BCNT); int bcnt = 4096 - GET_FIELD(tmd.length, TMDL, BCNT);
s->phys_mem_read(s->dma_opaque, PHYSADDR(s, tmd.tbadr), s->phys_mem_read(s->dma_opaque, PHYSADDR(s, tmd.tbadr),
s->buffer + s->xmit_pos, bcnt, CSR_BSWP(s)); s->buffer + s->xmit_pos, bcnt, CSR_BSWP(s));