fix
This commit is contained in:
parent
5c7cc90483
commit
071fd576d2
28
i825xx.c
28
i825xx.c
@ -218,8 +218,8 @@ static void i825xx_poll(struct i825xx_device_t *i825xx_device) {
|
||||
if (desc->errors) {
|
||||
break;
|
||||
}
|
||||
kprintf("RCV!\n");
|
||||
ether_receive(i825xx_device->ether, pkt, pktlen);
|
||||
unsigned int virt = (unsigned int)((unsigned int)i825xx_device->rx_desc_virt_base + (8192 * (unsigned int)tail));
|
||||
ether_receive(i825xx_device->ether, virt, desc->length);
|
||||
|
||||
} while(0);
|
||||
|
||||
@ -227,7 +227,31 @@ static void i825xx_poll(struct i825xx_device_t *i825xx_device) {
|
||||
mmio_write(i825xx_device, REG_RDT, tail);
|
||||
}
|
||||
}
|
||||
/*
|
||||
unsigned int virt = (unsigned int)((unsigned int)i825xx_device->rx_desc_virt_base + (8192 * (unsigned int)i825xx_device->rx_front));
|
||||
|
||||
kprintf("length: %p\n", i825xx_device->rx_descs[i825xx_device->rx_front].length);
|
||||
|
||||
while(i825xx_device->rx_descs[i825xx_device->rx_front].status & RX_DESC_STATUS_DD) {
|
||||
unsigned char *pkt = (unsigned char *)virt;
|
||||
unsigned short pktlen = i825xx_device->rx_descs[i825xx_device->rx_front].length;
|
||||
|
||||
if(!(i825xx_device->rx_descs[i825xx_device->rx_front].status & RX_DESC_STATUS_EOP)) {
|
||||
kprintf("825xx - rx: no EOP support, dropping");
|
||||
} else if(i825xx_device->rx_descs[i825xx_device->rx_front].length < 60) {
|
||||
kprintf("825xx - rx: short packet (%d bytes)", i825xx_device->rx_descs[i825xx_device->rx_front].length);
|
||||
} else {
|
||||
kprintf("ETHER RECV\n");
|
||||
ether_receive(i825xx_device->ether, pkt, pktlen);
|
||||
}
|
||||
|
||||
i825xx_device->rx_descs[i825xx_device->rx_front].status = 0;
|
||||
old_cur = i825xx_device->rx_front;
|
||||
i825xx_device->rx_front = (i825xx_device->rx_front + 1) % NUM_RX_DESCRIPTORS;
|
||||
mmio_write(i825xx_device, REG_RDT, old_cur);
|
||||
}
|
||||
}
|
||||
*/
|
||||
static void i825xx_isr(struct regs *r) {
|
||||
struct i825xx_device_t *i825xx_device;
|
||||
int i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user