Fixes
This commit is contained in:
parent
a488f67a1f
commit
52b6a8061f
12
i825xx.c
12
i825xx.c
@ -192,11 +192,11 @@ static unsigned short net_eeprom_read(struct i825xx_device_t *net_device, unsign
|
||||
}
|
||||
|
||||
static void i825xx_poll(struct i825xx_device_t *i825xx_device) {
|
||||
while(i825xx_device->rx_descs[i825xx_device->rx_front].status & RX_DESC_STATUS_DD) {
|
||||
while(i825xx_device->rx_descs[i825xx_device->rx_front]->status & RX_DESC_STATUS_DD) {
|
||||
unsigned char *pkt = (unsigned char *)i825xx_device->rx_buff[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)) {
|
||||
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);
|
||||
@ -235,7 +235,7 @@ static void i825xx_isr(struct regs *r) {
|
||||
|
||||
|
||||
int i825xx_send(struct i825xx_device_t *i825xx_device, char *packet, int len) {
|
||||
i825xx_device->tx_descs[i825xx_device->tx_front]->addr = (unsigned long long)packet;
|
||||
i825xx_device->tx_descs[i825xx_device->tx_front]->address = (unsigned long long)packet;
|
||||
|
||||
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;
|
||||
@ -255,7 +255,7 @@ unsigned char i825xx_detect_eeprom(struct i825xx_device_t *net_dev) {
|
||||
unsigned char eeprom_exists = 0;
|
||||
mmio_write(net_dev, REG_EERD, 0x1);
|
||||
for (int i = 0; i < 1000 && !eeprom_exists;i++) {
|
||||
val = mmio_read(REG_EERD);
|
||||
val = mmio_read(net_dev, REG_EERD);
|
||||
if (val & 0x10) {
|
||||
eeprom_exists = 1;
|
||||
} else {
|
||||
@ -320,7 +320,7 @@ struct ether_t *init_i825xx(int count) {
|
||||
|
||||
if (mem_base_mac_32[0] != 0) {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
mac[i] = mem_base_mac_8[i];
|
||||
ether_dev->mac[i] = mem_base_mac_8[i];
|
||||
}
|
||||
} else {
|
||||
free(i825xx_dev);
|
||||
@ -335,7 +335,7 @@ struct ether_t *init_i825xx(int count) {
|
||||
i825xx_dev->rx_buff = (struct i825xx_rx_desc_t *)ptr;
|
||||
|
||||
for (i=0;i<(NUM_RX_DESCRIPTORS * sizeof(struct i825xx_rx_desc_t) + 16) / PAGE_SIZE;i++) {
|
||||
mem_map_page(pagesrx + (i * PAGE_SIZE), (char *)i825xx_dev->rx_desc + (i * PAGE_SIZE), 3);
|
||||
mem_map_page(pagesrx + (i * PAGE_SIZE), (char *)i825xx_dev->rx_buff + (i * PAGE_SIZE), 3);
|
||||
}
|
||||
|
||||
for (i = 0; i < NUM_RX_DESCRIPTORS; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user