Revision 40545f84 hw/ne2000.c

b/hw/ne2000.c
246 246
static void ne2000_ioport_write(void *opaque, uint32_t addr, uint32_t val)
247 247
{
248 248
    NE2000State *s = opaque;
249
    int offset, page;
249
    int offset, page, index;
250 250

  
251 251
    addr &= 0xf;
252 252
#ifdef DEBUG_NE2000
......
264 264
                ne2000_update_irq(s);
265 265
            }
266 266
            if (val & E8390_TRANS) {
267
                qemu_send_packet(s->nd, s->mem + (s->tpsr << 8), s->tcnt);
267
                index = (s->tpsr << 8);
268
                /* XXX: next 2 lines are a hack to make netware 3.11 work */ 
269
                if (index >= NE2000_PMEM_END)
270
                    index -= NE2000_PMEM_SIZE;
271
                /* fail safe: check range on the transmitted length  */
272
                if (index + s->tcnt <= NE2000_PMEM_END) {
273
                    qemu_send_packet(s->nd, s->mem + index, s->tcnt);
274
                }
268 275
                /* signal end of transfert */
269 276
                s->tsr = ENTSR_PTX;
270 277
                s->isr |= ENISR_TX;
278
                s->cmd &= ~E8390_TRANS; 
271 279
                ne2000_update_irq(s);
272 280
            }
273 281
        }

Also available in: Unified diff