who knows
This commit is contained in:
parent
e92ce86f9d
commit
b5f9827220
20
i825xx.c
20
i825xx.c
@ -191,12 +191,12 @@ static unsigned short net_eeprom_read(struct i825xx_device_t *net_device, unsign
|
||||
|
||||
static void i825xx_poll(struct i825xx_device_t *i825xx_device) {
|
||||
unsigned short old_cur;
|
||||
unsigned int virt = (unsigned int)((unsigned int)i825xx_device->rx_desc_virt_base + ((8192 + 16) * (unsigned int)i825xx_device->rx_front));
|
||||
unsigned int virt = (unsigned int)((unsigned int)i825xx_device->rx_desc_virt_base + (8192 * (unsigned int)i825xx_device->rx_front));
|
||||
|
||||
kprintf("rx_front status %d phys 0x%p virt 0x%p", (unsigned int)i825xx_device->rx_descs[i825xx_device->rx_front]->status, i825xx_device->rx_descs[i825xx_device->rx_front]->address, virt);
|
||||
kprintf(" len 0x%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 *)i825xx_device->rx_desc_virt_base + ((8192 + 16) * i825xx_device->rx_front);
|
||||
unsigned char *pkt = (unsigned char *)i825xx_device->rx_desc_virt_base + (8192 * i825xx_device->rx_front);
|
||||
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)) {
|
||||
@ -254,8 +254,8 @@ static void i825xx_isr(struct regs *r) {
|
||||
int i825xx_send(struct i825xx_device_t *i825xx_device, char *packet, int len) {
|
||||
kprintf("SEND\n");
|
||||
|
||||
memcpy(i825xx_device->tx_desc_virt_base + ((8192 + 16) * i825xx_device->tx_front), packet, len);
|
||||
i825xx_device->tx_descs[i825xx_device->tx_front]->address = i825xx_device->tx_desc_phys_base + ((8192 + 16) * i825xx_device->tx_front);
|
||||
memcpy(i825xx_device->tx_desc_virt_base + (8192 * i825xx_device->tx_front), packet, len);
|
||||
i825xx_device->tx_descs[i825xx_device->tx_front]->address = i825xx_device->tx_desc_phys_base + (8192 * i825xx_device->tx_front);
|
||||
i825xx_device->tx_descs[i825xx_device->tx_front]->length = len;
|
||||
i825xx_device->tx_descs[i825xx_device->tx_front]->cmd = TX_DESC_CMD_EOP | TX_DESC_CMD_IFCS | TX_DESC_CMD_RS;
|
||||
i825xx_device->tx_descs[i825xx_device->tx_front]->sta = 0;
|
||||
@ -376,10 +376,10 @@ struct ether_t *init_i825xx(int count) {
|
||||
}
|
||||
|
||||
|
||||
i825xx_dev->rx_desc_phys_base = mem_alloc_pages((round_up_to_page(NUM_RX_DESCRIPTORS * (8192 + 16))) / PAGE_SIZE);
|
||||
i825xx_dev->rx_desc_virt_base = mem_pci_sbrk(round_up_to_page(NUM_RX_DESCRIPTORS * (8192 + 16)));
|
||||
i825xx_dev->rx_desc_phys_base = mem_alloc_pages((round_up_to_page(NUM_RX_DESCRIPTORS * 8192 )) / PAGE_SIZE);
|
||||
i825xx_dev->rx_desc_virt_base = mem_pci_sbrk(round_up_to_page(NUM_RX_DESCRIPTORS * 8192 ));
|
||||
|
||||
for (i = 0; i < (round_up_to_page(NUM_RX_DESCRIPTORS * (8192 + 16))) / PAGE_SIZE; i++) {
|
||||
for (i = 0; i < (round_up_to_page(NUM_RX_DESCRIPTORS * 8192 )) / PAGE_SIZE; i++) {
|
||||
mem_map_page(i825xx_dev->rx_desc_phys_base + (i * PAGE_SIZE), i825xx_dev->rx_desc_virt_base + (i * PAGE_SIZE), 3);
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ struct ether_t *init_i825xx(int count) {
|
||||
|
||||
for (i = 0; i < NUM_RX_DESCRIPTORS; i++) {
|
||||
i825xx_dev->rx_descs[i] = (struct i825xx_rx_desc_t *)(ptr + i * sizeof(struct i825xx_rx_desc_t));
|
||||
i825xx_dev->rx_descs[i]->address = i825xx_dev->rx_desc_phys_base + ((8192 + 16) * i);
|
||||
i825xx_dev->rx_descs[i]->address = i825xx_dev->rx_desc_phys_base + (8192 * i);
|
||||
i825xx_dev->rx_descs[i]->status = 0;
|
||||
}
|
||||
|
||||
@ -412,8 +412,8 @@ struct ether_t *init_i825xx(int count) {
|
||||
mem_map_page(pagestx + (i * PAGE_SIZE), ptr + (i * PAGE_SIZE), 3);
|
||||
}
|
||||
|
||||
i825xx_dev->tx_desc_phys_base = mem_alloc_pages((round_up_to_page(NUM_TX_DESCRIPTORS * (8192 + 16))) / PAGE_SIZE);
|
||||
i825xx_dev->tx_desc_virt_base = mem_pci_sbrk(round_up_to_page(NUM_TX_DESCRIPTORS * (8192 + 16)));
|
||||
i825xx_dev->tx_desc_phys_base = mem_alloc_pages((round_up_to_page(NUM_TX_DESCRIPTORS * 8192 )) / PAGE_SIZE);
|
||||
i825xx_dev->tx_desc_virt_base = mem_pci_sbrk(round_up_to_page(NUM_TX_DESCRIPTORS * 8192 ));
|
||||
|
||||
for (i = 0; i < (round_up_to_page(NUM_TX_DESCRIPTORS * (8192 + 16))) / PAGE_SIZE; i++) {
|
||||
mem_map_page(i825xx_dev->tx_desc_phys_base + (i * PAGE_SIZE), i825xx_dev->tx_desc_virt_base + (i * PAGE_SIZE), 3);
|
||||
|
Loading…
x
Reference in New Issue
Block a user