diff --git a/src/add-ons/kernel/drivers/network/Jamfile b/src/add-ons/kernel/drivers/network/Jamfile index 4aba0aed5e..b6eacff6c0 100644 --- a/src/add-ons/kernel/drivers/network/Jamfile +++ b/src/add-ons/kernel/drivers/network/Jamfile @@ -1,3 +1,4 @@ SubDir OBOS_TOP src add-ons kernel drivers net ; SubInclude OBOS_TOP src add-ons kernel drivers net stack ; +SubInclude OBOS_TOP src add-ons kernel drivers net sis900 ; diff --git a/src/add-ons/kernel/drivers/network/sis900/Jamfile b/src/add-ons/kernel/drivers/network/sis900/Jamfile new file mode 100644 index 0000000000..e8c543a939 --- /dev/null +++ b/src/add-ons/kernel/drivers/network/sis900/Jamfile @@ -0,0 +1,32 @@ +SubDir OBOS_TOP src add-ons kernel drivers net sis900 ; + +# set some additional defines +{ + local defines ; + + if $(DEBUG) { + defines += DEBUG ; + } + + defines = [ FDefines $(defines) ] ; + SubDirCcFlags $(defines) -Wall -Wno-multichar ; +} + +R5KernelAddon sis900 : [ FDirName kernel drivers net ] : + driver.c + device.c + interface.c + sis900.c + ; + +rule InstallSiS900 +{ + Depends $(<) : $(>) ; +} + +actions ignore InstallSiS900 +{ + cp $(>) /boot/home/config/add-ons/kernel/drivers/bin/ +} + +#InstallSiS900 install : sis900 ; diff --git a/src/add-ons/kernel/drivers/network/sis900/device.c b/src/add-ons/kernel/drivers/network/sis900/device.c index faa19afb01..afb85c3349 100644 --- a/src/add-ons/kernel/drivers/network/sis900/device.c +++ b/src/add-ons/kernel/drivers/network/sis900/device.c @@ -372,8 +372,6 @@ device_read(void *data, off_t pos, void *buffer, size_t *_length) status_t status; size_t size; int32 blockFlag; - thread_id threadID = find_thread(NULL); - int32 rxp, rxd; uint32 check; int16 current; @@ -393,7 +391,7 @@ device_read(void *data, off_t pos, void *buffer, size_t *_length) return B_ERROR; } - //TRACE(("current rx descr: %08x (last = %ld)\n", rxp = read32((uint32)info->registers + SiS900_MAC_Rx_DESCR),(info->rxLast+1) % NUM_Rx_DESCR)); + //TRACE(("current rx descr: %08x (last = %ld)\n", rxp = read32((uint32)info->registers + SiS900_MAC_Rx_DESCR), (info->rxLast+1) % NUM_Rx_DESCR)); // block until data is available (if blocking is allowed) if ((status = acquire_sem_etc(info->rxSem, 1, B_CAN_INTERRUPT | blockFlag, 0)) != B_NO_ERROR) { @@ -411,7 +409,7 @@ device_read(void *data, off_t pos, void *buffer, size_t *_length) TRACE(("ERROR: read: buffer %d still in use: %x\n", current, status)); atomic_and(&info->rxLock, 0); *_length = 0; - return; + return B_BUSY; } if (check & (SiS900_DESCR_Rx_ABORT | SiS900_DESCR_Rx_OVERRUN | @@ -457,7 +455,6 @@ device_write(void *data, off_t pos, const void *buffer, size_t *_length) status_t status; uint16 frameSize; int16 current; - thread_id threadID = find_thread(NULL); uint32 check; if (checkDeviceInfo(info = data) != B_OK) diff --git a/src/add-ons/kernel/drivers/network/sis900/driver.c b/src/add-ons/kernel/drivers/network/sis900/driver.c index 5ba6d2baa2..f32f65befe 100644 --- a/src/add-ons/kernel/drivers/network/sis900/driver.c +++ b/src/add-ons/kernel/drivers/network/sis900/driver.c @@ -77,7 +77,7 @@ init_driver(void) PCI_command, 2)); pciInfo[found++] = info; - dprintf(DEVICE_NAME ": revision = %lx\n", info->revision); + dprintf(DEVICE_NAME ": revision = %x\n", info->revision); info = malloc(sizeof(pci_info)); } diff --git a/src/add-ons/kernel/drivers/network/sis900/sis900.c b/src/add-ons/kernel/drivers/network/sis900/sis900.c index 2ff0061558..5eec509f4b 100644 --- a/src/add-ons/kernel/drivers/network/sis900/sis900.c +++ b/src/add-ons/kernel/drivers/network/sis900/sis900.c @@ -163,7 +163,7 @@ sis900_txInterrupt(struct sis_info *info) //dprintf("tx %d!\n",info->txInterruptIndex); if (status & (SiS900_DESCR_Tx_ABORT | SiS900_DESCR_Tx_UNDERRUN | SiS900_DESCR_Tx_OOW_COLLISION)) - dprintf("tx error: %x\n", status); + dprintf("tx error: %lx\n", status); else info->txDescriptor[info->txInterruptIndex].status = 0; @@ -196,7 +196,6 @@ sis900_interrupt(void *data) int32 handled = B_UNHANDLED_INTERRUPT; int16 worklimit = 20; uint32 intr; - uint32 i, j; cpu_status former; former = disable_interrupts(); @@ -336,7 +335,6 @@ status_t sis900_initPHYs(struct sis_info *info) { uint16 phy; - uint8 revision; // search for total of 32 possible MII PHY addresses for (phy = 0; phy < 32; phy++) { @@ -471,7 +469,7 @@ sis900_readMode(struct sis_info *info) uint16 status = mdio_status(info); if (!(status & MII_STATUS_LINK)) { - dprintf(DEVICE_NAME ": no link detected (status = %lx)\n", status); + dprintf(DEVICE_NAME ": no link detected (status = %x)\n", status); return 0; } @@ -520,8 +518,6 @@ void sis900_autoNegotiate(struct sis_info *info) { uint16 status = mdio_status(info); - int32 revision; - int32 mode; if ((status & MII_STATUS_LINK) == 0) { @@ -655,12 +651,11 @@ sis900_reset(struct sis_info *info) { uint32 address = (uint32)info->registers + SiS900_MAC_COMMAND; int16 tries = 1000; - status_t status; TRACE(("sis900 reset\n")); - //write32((uint32)info->registers + SiS900_MAC_INTR_MASK,0); - //write32((uint32)info->registers + SiS900_MAC_INTR_ENABLE,0); + //write32((uint32)info->registers + SiS900_MAC_INTR_MASK, 0); + //write32((uint32)info->registers + SiS900_MAC_INTR_ENABLE, 0); write32(address, SiS900_MAC_CMD_RESET);