Added the 3Com 3C503 Network card;
Several bug fixes; Preliminar addition of the SDL 2 renderer (does not yet work correctly in full screen mode); SCSI devices no longer have configurable LUN's (this matches the configurability of real SCSI devices); SCSI LUN's are now handed by the device's handler; Removed all unused strings; Removed some unused code files; Significantly rewrote the bus mouse emulation.
This commit is contained in:
35
src/network/net_dp8390.c
Normal file
35
src/network/net_dp8390.c
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <time.h>
|
||||
#define HAVE_STDARG_H
|
||||
|
||||
/*
|
||||
* Return the 6-bit index into the multicast
|
||||
* table. Stolen unashamedly from FreeBSD's if_ed.c
|
||||
*/
|
||||
int
|
||||
mcast_index(const void *dst)
|
||||
{
|
||||
#define POLYNOMIAL 0x04c11db6
|
||||
uint32_t crc = 0xffffffffL;
|
||||
int carry, i, j;
|
||||
uint8_t b;
|
||||
uint8_t *ep = (uint8_t *)dst;
|
||||
|
||||
for (i=6; --i>=0;) {
|
||||
b = *ep++;
|
||||
for (j = 8; --j >= 0;) {
|
||||
carry = ((crc & 0x80000000L) ? 1 : 0) ^ (b & 0x01);
|
||||
crc <<= 1;
|
||||
b >>= 1;
|
||||
if (carry)
|
||||
crc = ((crc ^ POLYNOMIAL) | carry);
|
||||
}
|
||||
}
|
||||
return(crc >> 26);
|
||||
#undef POLYNOMIAL
|
||||
}
|
||||
Reference in New Issue
Block a user