More sonarlint work
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#include <86box/network.h>
|
||||
#include <86box/net_3c501.h>
|
||||
#include <86box/bswap.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
/* Maximum number of times we report a link down to the guest (failure to send frame) */
|
||||
#define ELNK_MAX_LINKDOWN_REPORTED 3
|
||||
@@ -192,7 +193,7 @@ typedef struct ELNK_INTR_STAT {
|
||||
uint8_t unused : 5;
|
||||
} EL_INTR_STAT;
|
||||
|
||||
typedef struct {
|
||||
typedef struct threec501_t {
|
||||
uint32_t base_address;
|
||||
int base_irq;
|
||||
uint32_t bios_addr;
|
||||
@@ -390,6 +391,7 @@ padr_bcast(threec501_t *dev, const uint8_t *buf)
|
||||
static uint8_t aBCAST[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
struct ether_header *hdr = (struct ether_header *) buf;
|
||||
int result = (dev->RcvCmd.adr_match == EL_ADRM_BCAST) && !memcmp(hdr->ether_dhost, aBCAST, 6);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -401,6 +403,7 @@ padr_mcast(threec501_t *dev, const uint8_t *buf)
|
||||
{
|
||||
struct ether_header *hdr = (struct ether_header *) buf;
|
||||
int result = (dev->RcvCmd.adr_match == EL_ADRM_MCAST) && ETHER_IS_MULTICAST(hdr->ether_dhost);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -692,7 +695,6 @@ elnkAsyncTransmit(threec501_t *dev)
|
||||
#ifdef ENABLE_3COM501_LOG
|
||||
threec501_log("3Com501: illegal giant frame (%u bytes) -> signalling error\n", cb);
|
||||
#endif
|
||||
;
|
||||
}
|
||||
} else {
|
||||
/* Signal a transmit error pretending there was a collision. */
|
||||
@@ -921,6 +923,9 @@ threec501_read(uint16_t addr, void *priv)
|
||||
retval = dev->abPacketBuf[ELNK_GP(dev)];
|
||||
dev->uGPBufPtr = (dev->uGPBufPtr + 1) & ELNK_GP_MASK;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
elnkUpdateIrq(dev);
|
||||
@@ -1007,6 +1012,9 @@ threec501_write(uint16_t addr, uint8_t value, void *priv)
|
||||
dev->abPacketBuf[ELNK_GP(dev)] = value;
|
||||
dev->uGPBufPtr = (dev->uGPBufPtr + 1) & ELNK_GP_MASK;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_3COM501_LOG
|
||||
@@ -1068,7 +1076,7 @@ elnkR3TimerRestore(void *priv)
|
||||
}
|
||||
|
||||
static void *
|
||||
threec501_nic_init(const device_t *info)
|
||||
threec501_nic_init(UNUSED(const device_t *info))
|
||||
{
|
||||
uint32_t mac;
|
||||
threec501_t *dev;
|
||||
|
||||
Reference in New Issue
Block a user