Merge branch 'master' into driverupdate2
# Conflicts: (taken: newer version) # Driver/baxnet/README.enc # Driver/baxnet/bin/enc624j6net.device # Driver/baxnet/bin/enc624j6net.device_68000 # Driver/baxnet/source/Makefile.enc # Driver/baxnet/source/device.c # Driver/baxnet/source/enc624j6net/enc624j6l.asm # Driver/baxnet/source/server.c # Driver/baxnet/source/version.h
This commit is contained in:
Executable → Regular
Executable → Regular
@@ -19,7 +19,7 @@
|
||||
#
|
||||
###############################################################################
|
||||
# debug = 1 will include string debugging for terminal/sushi/sashimi
|
||||
debug = 0
|
||||
debug = 1
|
||||
# compiler_vcc = 1 will trigger VBCC, else GCC
|
||||
compiler_vcc = 0
|
||||
|
||||
@@ -27,8 +27,8 @@ compiler_vcc = 0
|
||||
# prefix for system includes (ASM)
|
||||
# native AmigaOS compilation: set PREFX=GG: or PREFX=ADE:, depending on toolchain
|
||||
###############################################################################
|
||||
#PREFX = /opt/amigaos-68k/
|
||||
PREFX = gg:
|
||||
PREFX = /opt/amigaos-68k/
|
||||
#PREFX = gg:
|
||||
SYSINC = $(PREFX)os-include
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -18,10 +18,9 @@ _LVORawMayGetChar equ -$1fe
|
||||
;
|
||||
;
|
||||
;
|
||||
ifne DEBUG
|
||||
ifd DEBUG
|
||||
|
||||
; XREF _KPrintFa0a1
|
||||
; XREF _KPrintF
|
||||
XREF _KPrintF
|
||||
|
||||
WRITEDEBUG macro
|
||||
movem.l d0/d1/a0/a1,-(sp)
|
||||
@@ -51,7 +50,7 @@ WRITEDEBUG macro
|
||||
endif
|
||||
lea.l (\1),a0
|
||||
move.l sp,a1
|
||||
jsr _KPrintFa0a1
|
||||
jsr _KPrintF
|
||||
ifnb \2
|
||||
add.l #4,sp
|
||||
endif
|
||||
@@ -80,7 +79,7 @@ WRITEDEBUG macro
|
||||
endm
|
||||
else
|
||||
WRITEDEBUG macro
|
||||
;
|
||||
nop
|
||||
endm
|
||||
endc
|
||||
|
||||
@@ -117,7 +116,7 @@ WRITEOUT macro
|
||||
ifd DEBUG
|
||||
move.l \1,a0
|
||||
move.l sp,a1
|
||||
jsr _KPrintFa0a1
|
||||
jsr _KPrintF
|
||||
endif
|
||||
move.l \1,d1
|
||||
move.l sp,d2
|
||||
|
||||
Executable → Regular
@@ -239,9 +239,8 @@ ASM SAVEDS int enc624j6l_SetOnline( ASMR(a0) void *board ASMREG(a0) );
|
||||
>=0 - OK
|
||||
*/
|
||||
ASM SAVEDS int enc624j6l_bc_mc_filter(
|
||||
ASMR(a0) void *board ASMREG(a0),
|
||||
ASMR(d1) unsigned long flags ASMREG(d1),
|
||||
ASMR(a1) unsigned short *mc_hashes ASMREG(a1));
|
||||
ASMR(a0) void *board ASMREG(a0),
|
||||
ASMR(d1) unsigned long flags ASMREG(d1) );
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -30,7 +30,6 @@ extern const BYTE DeviceName[];
|
||||
/* use generic board fields in current unit */
|
||||
#define duh_online du_hwl0
|
||||
#define duh_BASE du_hwp0
|
||||
#define duh_RefCount du_hwl1
|
||||
|
||||
#define HW_INTERVALDEF 100000L
|
||||
|
||||
@@ -106,7 +105,7 @@ ASM SAVEDS LONG hw_Find_Boards( ASMR(a0) DEVBASEP ASMREG(a0) )
|
||||
|
||||
/* bring board to sane state (i.e. perform soft reset) */
|
||||
/* if( boardbase < (APTR)0x40000000 ) */ /* debug only */
|
||||
enc624j6l_CheckBoard( boardbase );
|
||||
enc624j6l_CheckBoard( boardbase );
|
||||
}
|
||||
ret = i;
|
||||
D(("%ld boards found\n",ret));
|
||||
@@ -120,33 +119,7 @@ ASM SAVEDS LONG hw_Find_Boards( ASMR(a0) DEVBASEP ASMREG(a0) )
|
||||
ASM SAVEDS LONG hw_AllocBoard( ASMR(a0) DEVBASEP ASMREG(a0),
|
||||
ASMR(d0) ULONG unit ASMREG(d0) )
|
||||
{
|
||||
#if 0
|
||||
LONG i;
|
||||
struct ConfigDev *cfg = (0);
|
||||
|
||||
if( unit > db->db_NBoards )
|
||||
return 0;
|
||||
|
||||
for( i=0 ; i < db->db_NBoards ; i++ )
|
||||
{
|
||||
cfg = FindConfigDev( cfg, ENC_MANUFACTURER, ENC_BOARD );
|
||||
if( !cfg )
|
||||
return 0;
|
||||
if( (APTR)cfg->cd_BoardAddr == db->db_Units[unit].duh_BASE )
|
||||
break;
|
||||
}
|
||||
|
||||
if( (APTR)cfg->cd_BoardAddr != db->db_Units[unit].duh_BASE )
|
||||
return 0;
|
||||
|
||||
if( db->db_Units[unit].duh_RefCount == 0 )
|
||||
{
|
||||
ObtainConfigBinding();
|
||||
|
||||
ReleaseConfigBinding();
|
||||
}
|
||||
db->db_Units[unit].duh_RefCount++;
|
||||
#endif
|
||||
/* is there a way to lock a ZII Board ? */
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -154,20 +127,6 @@ ASM SAVEDS LONG hw_AllocBoard( ASMR(a0) DEVBASEP ASMREG(a0),
|
||||
ASM SAVEDS LONG hw_ReleaseBoard( ASMR(a0) DEVBASEP ASMREG(a0),
|
||||
ASMR(d0) ULONG unit ASMREG(d0) )
|
||||
{
|
||||
#if 0
|
||||
if( unit > db->db_NBoards )
|
||||
return 0;
|
||||
|
||||
for( i=0 ; i < db->db_NBoards ; i++ )
|
||||
{
|
||||
cfg = FindConfigDev( cfg, ENC_MANUFACTURER, ENC_BOARD );
|
||||
if( !cfg )
|
||||
return 0;
|
||||
if( (APTR)cfg->cd_BoardAddr == db->db_Units[unit].duh_BASE )
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -468,143 +427,27 @@ ASM SAVEDS LONG hw_write_phy( ASMR(a0) DEVBASEP ASMREG(
|
||||
return enc624j6l_WritePHY( boardbase, reg, value );
|
||||
}
|
||||
|
||||
/*
|
||||
calculate CRC32 for MAC address hashing
|
||||
slow but relatively short (and can be adapted to other
|
||||
polynoms easily)
|
||||
*/
|
||||
ASM ULONG myhw_CRC32( ASMR(a0) UBYTE *buffer ASMREG(a0),
|
||||
ASMR(d0) ULONG nbytes ASMREG(d0) )
|
||||
{
|
||||
UWORD i,j;
|
||||
ULONG t,crc = 0xffffffff;
|
||||
ULONG poly = 0x04c11db7;
|
||||
|
||||
for( j = 0 ; j < nbytes ; j++ )
|
||||
{
|
||||
for( i = 0 ; i < 8 ; i++ )
|
||||
{
|
||||
t = crc>>31;
|
||||
crc <<= 1;
|
||||
if( ( t ^ ( buffer[j] >> i ) ) & 0x01 )
|
||||
crc ^= poly;
|
||||
}
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
#if 0
|
||||
ASM ULONG CMPgeMAC( ASMR(a0) UBYTE *cur ASMREG(a0),
|
||||
ASMR(a1) UBYTE *cmp ASMREG(a1) )
|
||||
{
|
||||
USHORT i;
|
||||
ULONG res = 1;
|
||||
|
||||
for( i = 0 ; i < 6 ; i++ )
|
||||
{
|
||||
if( cur[i] > cmp[i] )
|
||||
break;
|
||||
if( cur[i] < cmp[i] )
|
||||
{
|
||||
res = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
ASM ULONG CMPleMAC( ASMR(a0) UBYTE *cur ASMREG(a0),
|
||||
ASMR(a1) UBYTE *cmp ASMREG(a1) )
|
||||
{
|
||||
USHORT i;
|
||||
ULONG res = 1;
|
||||
|
||||
for( i = 0 ; i < 6 ; i++ )
|
||||
{
|
||||
if( cur[i] < cmp[i] )
|
||||
break;
|
||||
if( cur[i] > cmp[i] )
|
||||
{
|
||||
res = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
ASM void INCMAC( ASMR(a0) UBYTE *curmc ASMREG(a0) )
|
||||
{
|
||||
SHORT i;
|
||||
for( i=5 ; i >= 0 ; i-- )
|
||||
{
|
||||
curmc[i]++;
|
||||
if( curmc[i] != 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: implement Multicast hashing */
|
||||
ASM SAVEDS LONG hw_change_multicast( ASMR(a0) DEVBASEP ASMREG(a0),
|
||||
ASMR(d0) ULONG unit ASMREG(d0),
|
||||
ASMR(a1) struct List *mcastlist ASMREG(a1) )
|
||||
{
|
||||
APTR boardbase = db->db_Units[unit].duh_BASE;
|
||||
struct HWData *hwd = &db->db_hwdat;
|
||||
ULONG flags;
|
||||
ULONG crc,curhash;
|
||||
USHORT mc_hashes[4] = {0,0,0,0}; /* EHT1, EHT2, EHT3, EHT4 */
|
||||
USHORT *hash_tab;
|
||||
struct MCastEntry *mc;
|
||||
UBYTE *curmc;
|
||||
/* TODO: implement Multicast hashing */
|
||||
APTR boardbase = db->db_Units[unit].duh_BASE;
|
||||
ULONG flags;
|
||||
|
||||
flags = PIO_INIT_BROAD_CAST;
|
||||
|
||||
if( db->db_Units[0].du_Flags & DUF_PROMISC )
|
||||
flags |= PIO_INIT_PROMISC;
|
||||
|
||||
if( hwd->multicast ) /* accept ALL multicast ? (config option) */
|
||||
/* list non-empty ? (kludge right now, can be done more fine grained) */
|
||||
if( mcastlist->lh_Head->ln_Succ )
|
||||
flags |= PIO_INIT_MULTI_CAST;
|
||||
|
||||
/* list non-empty ? */
|
||||
hash_tab = NULL;
|
||||
if( mcastlist->lh_Head->ln_Succ )
|
||||
{
|
||||
/* flags |= PIO_INIT_MULTI_CAST; */ /* see above */
|
||||
hash_tab = mc_hashes;
|
||||
|
||||
for( mc = (struct MCastEntry *)mcastlist->lh_Head;
|
||||
mc->mce_Node.mln_Succ ;
|
||||
mc=(struct MCastEntry*)mc->mce_Node.mln_Succ )
|
||||
{
|
||||
curmc = mc->mce_start;
|
||||
while( CMPleMAC( curmc, mc->mce_stop ) )
|
||||
{
|
||||
D(("CMPleMAC %ld %02lx%02lx%02lx%02lx%02lx%02lx - %02lx%02lx%02lx%02lx%02lx%02lx\n",\
|
||||
CMPleMAC( curmc, mc->mce_stop ),\
|
||||
(ULONG)curmc[0],(ULONG)curmc[1],\
|
||||
(ULONG)curmc[2],(ULONG)curmc[3],\
|
||||
(ULONG)curmc[4],(ULONG)curmc[5],\
|
||||
(ULONG)mc->mce_stop[0],(ULONG)mc->mce_stop[1],\
|
||||
(ULONG)mc->mce_stop[2],(ULONG)mc->mce_stop[3],\
|
||||
(ULONG)mc->mce_stop[4],(ULONG)mc->mce_stop[5] \
|
||||
));
|
||||
|
||||
crc = myhw_CRC32( mc->mce_start, 6 );
|
||||
curhash = (crc & 0x1f800000)>>23; /* 2 bit reg, 4 bit hash pos in reg */
|
||||
mc_hashes[ ((curhash >> 4)&3) ] |= 1<<(curhash&0xf);
|
||||
INCMAC( curmc );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
D(("hw_change_multicast board %lx flags %lx hashtab %lx\n",(ULONG)boardbase,(ULONG)flags,(ULONG)hash_tab));
|
||||
|
||||
enc624j6l_bc_mc_filter(boardbase, flags, hash_tab );/* flags & (PIO_INIT_BROAD_CAST|PIO_INIT_MULTI_CAST) ); */
|
||||
enc624j6l_bc_mc_filter(boardbase, flags );/* flags & (PIO_INIT_BROAD_CAST|PIO_INIT_MULTI_CAST) ); */
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -651,7 +494,7 @@ void myhw_ControlInterrupts( DEVBASEP )
|
||||
hwd->hwd_Interrupt.is_Code = (void(*)())enc624j6l_IntServer_List;
|
||||
hwd->hwd_Interrupt.is_Data = &hwd->hwd_act_boards[0];
|
||||
hwd->hwd_Interrupt.is_Node.ln_Type = NT_INTERRUPT;
|
||||
hwd->hwd_Interrupt.is_Node.ln_Pri = 126; /* 51; */
|
||||
hwd->hwd_Interrupt.is_Node.ln_Pri = 51;
|
||||
hwd->hwd_Interrupt.is_Node.ln_Name = (char*)intname;
|
||||
AddIntServer( HW_INTSOURCE, &hwd->hwd_Interrupt );
|
||||
}
|
||||
|
||||
@@ -16,18 +16,11 @@ _LVORawIOInit equ -$1f8
|
||||
_LVORawMayGetChar equ -$1fe
|
||||
endc
|
||||
|
||||
; XDEF _KPrintF
|
||||
XDEF _KPrintFa0a1
|
||||
|
||||
;_KPrintF:
|
||||
rts
|
||||
move.l 4(sp),a0
|
||||
lea 8(sp),a1
|
||||
; fall through
|
||||
XDEF _KPrintF
|
||||
|
||||
;A0 = format
|
||||
;A1 = arguments
|
||||
_KPrintFa0a1:
|
||||
_KPrintF:
|
||||
; ifd DEBUG
|
||||
|
||||
movem.l d0-d2/a0-a3/a6,-(sp)
|
||||
|
||||
@@ -46,7 +46,7 @@ ASMDEFS1 = -DHW_DMA_TX=1
|
||||
###############################################################################
|
||||
# debug = 1 will include string debugging for terminal/sushi/sashimi
|
||||
# not enabled yet in SAS/C makefile
|
||||
#debug = 0
|
||||
debug = 0
|
||||
|
||||
###############################################################################
|
||||
# prefix for system includes (ASM)
|
||||
|
||||
Reference in New Issue
Block a user