Conflict resolution.
This commit is contained in:
@@ -373,7 +373,7 @@ elnkR3HardReset(threec501_t *dev)
|
||||
static __inline int
|
||||
padr_match(threec501_t *dev, const uint8_t *buf)
|
||||
{
|
||||
const struct ether_header *hdr = (struct ether_header *) buf;
|
||||
const struct ether_header *hdr = (const struct ether_header *) buf;
|
||||
int result;
|
||||
|
||||
/* Checks own + broadcast as well as own + multicast. */
|
||||
@@ -389,7 +389,7 @@ static __inline int
|
||||
padr_bcast(threec501_t *dev, const uint8_t *buf)
|
||||
{
|
||||
static uint8_t aBCAST[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
const struct ether_header *hdr = (struct ether_header *) buf;
|
||||
const struct ether_header *hdr = (const struct ether_header *) buf;
|
||||
int result = (dev->RcvCmd.adr_match == EL_ADRM_BCAST) && !memcmp(hdr->ether_dhost, aBCAST, 6);
|
||||
|
||||
return result;
|
||||
@@ -401,8 +401,8 @@ padr_bcast(threec501_t *dev, const uint8_t *buf)
|
||||
static __inline int
|
||||
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);
|
||||
const struct ether_header *hdr = (const struct ether_header *) buf;
|
||||
int result = (dev->RcvCmd.adr_match == EL_ADRM_MCAST) && ETHER_IS_MULTICAST(hdr->ether_dhost);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ mcast_index(const void *dst)
|
||||
uint32_t crc = 0xffffffffL;
|
||||
int carry;
|
||||
uint8_t b;
|
||||
const uint8_t *ep = (uint8_t *) dst;
|
||||
const uint8_t *ep = (const uint8_t *) dst;
|
||||
|
||||
for (int8_t i = 6; --i >= 0;) {
|
||||
b = *ep++;
|
||||
|
||||
@@ -812,7 +812,7 @@ static void
|
||||
nic_rom_init(nic_t *dev, char *s)
|
||||
{
|
||||
uint32_t temp;
|
||||
FILE *f;
|
||||
FILE *fp;
|
||||
|
||||
if (s == NULL)
|
||||
return;
|
||||
@@ -820,10 +820,10 @@ nic_rom_init(nic_t *dev, char *s)
|
||||
if (dev->bios_addr == 0)
|
||||
return;
|
||||
|
||||
if ((f = rom_fopen(s, "rb")) != NULL) {
|
||||
fseek(f, 0L, SEEK_END);
|
||||
temp = ftell(f);
|
||||
fclose(f);
|
||||
if ((fp = rom_fopen(s, "rb")) != NULL) {
|
||||
fseek(fp, 0L, SEEK_END);
|
||||
temp = ftell(fp);
|
||||
fclose(fp);
|
||||
dev->bios_size = 0x10000;
|
||||
if (temp <= 0x8000)
|
||||
dev->bios_size = 0x8000;
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <86box/network.h>
|
||||
#include <86box/net_pcnet.h>
|
||||
#include <86box/bswap.h>
|
||||
#include <86box/plat_fallthrough.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
/* PCI info. */
|
||||
@@ -748,7 +749,7 @@ static const uint32_t crctab[256] =
|
||||
static __inline int
|
||||
padr_match(nic_t *dev, const uint8_t *buf, UNUSED(int size))
|
||||
{
|
||||
const struct ether_header *hdr = (struct ether_header *) buf;
|
||||
const struct ether_header *hdr = (const struct ether_header *) buf;
|
||||
int result;
|
||||
uint8_t padr[6];
|
||||
|
||||
@@ -774,7 +775,7 @@ static __inline int
|
||||
padr_bcast(nic_t *dev, const uint8_t *buf, UNUSED(size_t size))
|
||||
{
|
||||
static uint8_t aBCAST[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
const struct ether_header *hdr = (struct ether_header *) buf;
|
||||
const struct ether_header *hdr = (const struct ether_header *) buf;
|
||||
int result = !CSR_DRCVBC(dev) && !memcmp(hdr->ether_dhost, aBCAST, 6);
|
||||
|
||||
pcnet_log(3, "%s: padr_bcast result=%d\n", dev->name, result);
|
||||
@@ -785,7 +786,7 @@ padr_bcast(nic_t *dev, const uint8_t *buf, UNUSED(size_t size))
|
||||
static int
|
||||
ladr_match(nic_t *dev, const uint8_t *buf, UNUSED(size_t size))
|
||||
{
|
||||
const struct ether_header *hdr = (struct ether_header *) buf;
|
||||
const struct ether_header *hdr = (const struct ether_header *) buf;
|
||||
|
||||
if ((hdr->ether_dhost[0] & 0x01) && ((uint64_t *) &dev->aCSR[8])[0] != 0LL) {
|
||||
int index;
|
||||
@@ -1998,7 +1999,7 @@ pcnet_bcr_writew(nic_t *dev, uint16_t rap, uint16_t val)
|
||||
break;
|
||||
}
|
||||
dev->aCSR[58] = val;
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
case BCR_LNKST:
|
||||
case BCR_LED1:
|
||||
case BCR_LED2:
|
||||
|
||||
@@ -722,7 +722,7 @@ network_card_has_config(int card)
|
||||
}
|
||||
|
||||
/* UI */
|
||||
char *
|
||||
const char *
|
||||
network_card_get_internal_name(int card)
|
||||
{
|
||||
return device_get_internal_name(net_cards[card]);
|
||||
@@ -735,7 +735,7 @@ network_card_get_from_internal_name(char *s)
|
||||
int c = 0;
|
||||
|
||||
while (net_cards[c] != NULL) {
|
||||
if (!strcmp((char *) net_cards[c]->internal_name, s))
|
||||
if (!strcmp(net_cards[c]->internal_name, s))
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user