Fixed Autoconfig-Bug, improved interrupthandling multiple package support
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -113,6 +113,8 @@ ENC_BOARDID EQU 123 ;ZII-IDE-LAN-CP
|
||||
XDEF _enc624j6l_IntServer
|
||||
XDEF _enc624j6l_EnableInterrupt
|
||||
XDEF _enc624j6l_DisableInterrupt
|
||||
XDEF _enc624j6l_EnableGlobalInterrupt
|
||||
XDEF _enc624j6l_DisableGlobalInterrupt
|
||||
|
||||
;
|
||||
; System includes
|
||||
@@ -1414,6 +1416,45 @@ _enc624j6l_EnableInterrupt:
|
||||
moveq #0,d0
|
||||
bra.s .rts
|
||||
|
||||
;---------------------------------------------------------------------------------------
|
||||
;
|
||||
; Enable Global Hardware Interrupt
|
||||
;
|
||||
; In: A0 - Board base address
|
||||
;
|
||||
; Out:
|
||||
; D0 <= 0 - failure
|
||||
; 1 - OK
|
||||
;
|
||||
; Notes: assumes that init() was called before
|
||||
;
|
||||
_enc624j6l_EnableGlobalInterrupt:
|
||||
move #EIE_INTIE,d0
|
||||
SETREG EIE,a0,d0
|
||||
moveq #1,d0
|
||||
.rts
|
||||
rts
|
||||
|
||||
;---------------------------------------------------------------------------------------
|
||||
;
|
||||
; Disable Global Hardware Interrupt
|
||||
;
|
||||
; In: A0 - Board base address
|
||||
;
|
||||
; Out:
|
||||
; D0 <= 0 - failure
|
||||
; 1 - OK
|
||||
;
|
||||
; Notes: assumes that init() was called before
|
||||
;
|
||||
_enc624j6l_DisableGlobalInterrupt:
|
||||
move #EIE_INTIE,d0
|
||||
CLRREG EIE,a0,d0
|
||||
moveq #1,d0
|
||||
.rts
|
||||
rts
|
||||
|
||||
|
||||
|
||||
;---------------------------------------------------------------------------------------
|
||||
;
|
||||
|
||||
@@ -237,6 +237,25 @@ ASM SAVEDS int enc624j6l_EnableInterrupt( ASMR(a0) void *board ASMREG(a0)
|
||||
*/
|
||||
ASM SAVEDS int enc624j6l_DisableInterrupt( ASMR(a0) void *board ASMREG(a0) );
|
||||
|
||||
/*
|
||||
Purpose: enable global HW interrupt flag on the LAN-Chip
|
||||
|
||||
input: board - mmapped board base address
|
||||
|
||||
|
||||
notes:
|
||||
*/
|
||||
ASM SAVEDS void enc624j6l_EnableGlobalInterrupt( ASMR(a0) void *board ASMREG(a0) );
|
||||
|
||||
|
||||
/*
|
||||
Purpose: disable global HW interrupt flag on the LAN-Chip
|
||||
|
||||
input: board - mmapped board base address
|
||||
|
||||
notes:
|
||||
*/
|
||||
ASM SAVEDS void enc624j6l_DisableGlobalInterrupt( ASMR(a0) void *board ASMREG(a0) );
|
||||
|
||||
/*
|
||||
Purpose: interrupt service routine ( after EnableInterrupt() )
|
||||
|
||||
Binary file not shown.
@@ -439,6 +439,22 @@ GLOBAL REGARGS LONG hw_recv_pending(struct PLIPBase *pb)
|
||||
return (LONG)num;
|
||||
}
|
||||
|
||||
GLOBAL REGARGS void hw_enable_global_int(struct PLIPBase *pb){
|
||||
#ifdef PROTO_ENC624NET
|
||||
struct HWBase *hwb = &pb->pb_HWBase;
|
||||
enc624j6l_EnableGlobalInterrupt( BOARD );
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBAL REGARGS void hw_disable_global_int(struct PLIPBase *pb){
|
||||
#ifdef PROTO_ENC624NET
|
||||
struct HWBase *hwb = &pb->pb_HWBase;
|
||||
enc624j6l_DisableGlobalInterrupt( BOARD );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* important: don't call this without enc28j60_has_recv() > 0 check */
|
||||
GLOBAL REGARGS BOOL hw_recv_frame(struct PLIPBase *pb, struct HWFrame *frame)
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -56,5 +56,7 @@ GLOBAL REGARGS BOOL hw_recv_frame(struct PLIPBase *pb, struct HWFrame *frame);
|
||||
GLOBAL REGARGS void hw_config_init(struct PLIPBase *pb);
|
||||
GLOBAL REGARGS void hw_config_update(struct PLIPBase *pb, struct TemplateConfig *cfg);
|
||||
GLOBAL REGARGS void hw_config_dump(struct PLIPBase *pb);
|
||||
GLOBAL REGARGS void hw_enable_global_int(struct PLIPBase *pb);
|
||||
GLOBAL REGARGS void hw_disable_global_int(struct PLIPBase *pb);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
libsize equ 728
|
||||
Binary file not shown.
Binary file not shown.
+28
-20
@@ -52,6 +52,7 @@ typedef enum { AW_OK, AW_BUFFER_ERROR, AW_ERROR } AW_RESULT;
|
||||
** definitions
|
||||
*/
|
||||
#define SINGLE_RW 1
|
||||
#define MAX_READ_PACKAGE 128
|
||||
|
||||
|
||||
/*E*/
|
||||
@@ -350,7 +351,7 @@ PRIVATE REGARGS BOOL read_frame(struct IOSana2Req *req, struct HWFrame *frame)
|
||||
/*F*/ PRIVATE REGARGS VOID doreadreqs(BASEPTR)
|
||||
{
|
||||
LONG datasize;
|
||||
struct IOSana2Req *got;
|
||||
struct IOSana2Req *got, *got2;
|
||||
ULONG pkttyp = 0; /* just to avoid warning with opt build, irrelevant otherwise */
|
||||
BOOL rv;
|
||||
struct HWFrame *frame = pb->pb_Frame;
|
||||
@@ -387,12 +388,12 @@ PRIVATE REGARGS BOOL read_frame(struct IOSana2Req *req, struct HWFrame *frame)
|
||||
d(("packet %08lx, size %ld received\n",pkttyp,datasize));
|
||||
|
||||
ObtainSemaphore(&pb->pb_ReadListSem);
|
||||
|
||||
/* traverse the list of read-requests */
|
||||
for(got = (struct IOSana2Req *)pb->pb_ReadList.lh_Head;
|
||||
got->ios2_Req.io_Message.mn_Node.ln_Succ;
|
||||
got = (struct IOSana2Req *)got->ios2_Req.io_Message.mn_Node.ln_Succ )
|
||||
{
|
||||
|
||||
/* traverse the list of read-requests */
|
||||
for(got = (struct IOSana2Req *) pb->pb_ReadList.lh_Head;
|
||||
got2 = (struct IOSana2Req *) got->ios2_Req.io_Message.mn_Node.ln_Succ;
|
||||
got = got2 )
|
||||
{
|
||||
/* check if this one requests for the new packet we got */
|
||||
if (got->ios2_PacketType == pkttyp )
|
||||
{
|
||||
@@ -685,7 +686,7 @@ PRIVATE REGARGS BOOL read_frame(struct IOSana2Req *req, struct HWFrame *frame)
|
||||
ULONG recv=0, portsigmask, recvsigmask, wmask,specialmask;
|
||||
LONG haverec;
|
||||
BOOL running;
|
||||
struct IOSana2Req *wr;
|
||||
struct IOSana2Req *wr;
|
||||
|
||||
/* Ok, we are fine and will tell this mother personally :-) */
|
||||
pb->pb_Startup->ss_Error = 0;
|
||||
@@ -708,33 +709,40 @@ PRIVATE REGARGS BOOL read_frame(struct IOSana2Req *req, struct HWFrame *frame)
|
||||
|
||||
/* send packets if any */
|
||||
d2(("*+ do_write\n"));
|
||||
wr = (struct IOSana2Req *)pb->pb_WriteList.lh_Head;
|
||||
wr = (struct IOSana2Req *)pb->pb_WriteList.lh_Head;
|
||||
if( wr->ios2_Req.io_Message.mn_Node.ln_Succ )
|
||||
{
|
||||
dowritereqs(pb);
|
||||
}
|
||||
}
|
||||
d2(("*- do_write\n"));
|
||||
|
||||
/* if no recv is pending then wait for incoming signals */
|
||||
haverec = hw_recv_pending(pb);
|
||||
if( !haverec )
|
||||
{
|
||||
haverec = hw_recv_pending(pb);
|
||||
recv = 0;
|
||||
if( !haverec )
|
||||
{
|
||||
d2(("**> wait\n"));
|
||||
hw_enable_global_int(pb);
|
||||
recv = Wait(wmask);
|
||||
d2(("**> wait: got 0x%08lx\n", recv));
|
||||
haverec = hw_recv_pending(pb);
|
||||
}
|
||||
hw_disable_global_int(pb);
|
||||
|
||||
/*allow only a certain number of packets to be serverd per interrupt*/
|
||||
if(haverec>MAX_READ_PACKAGE)
|
||||
haverec = MAX_READ_PACKAGE;
|
||||
|
||||
/* accept pending receive and start reading */
|
||||
if( haverec )
|
||||
while( haverec-- )
|
||||
{
|
||||
d2(("*+ do_read\n"));
|
||||
doreadreqs(pb);
|
||||
d2(("*- do_read\n"));
|
||||
}
|
||||
|
||||
if( recv & specialmask )
|
||||
{
|
||||
if( recv & specialmask )
|
||||
{
|
||||
/* handle SANA-II send requests */
|
||||
if (recv & portsigmask)
|
||||
{
|
||||
@@ -748,8 +756,8 @@ PRIVATE REGARGS BOOL read_frame(struct IOSana2Req *req, struct HWFrame *frame)
|
||||
d(("received break signal\n"));
|
||||
running = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /*main loop of server task*/
|
||||
}
|
||||
else
|
||||
d(("init() failed\n"));
|
||||
@@ -757,9 +765,9 @@ PRIVATE REGARGS BOOL read_frame(struct IOSana2Req *req, struct HWFrame *frame)
|
||||
d(("--- server exit main loop ---\n"));
|
||||
cleanup(pb);
|
||||
|
||||
/* Exec will enable it's scheduler after we're dead. */
|
||||
/* Exec will enable it's scheduler after we're dead. */
|
||||
Forbid();
|
||||
/* signal mother we're done */
|
||||
/* signal mother we're done */
|
||||
if (pb->pb_ServerStoppedSigMask)
|
||||
Signal(pb->pb_Task, pb->pb_ServerStoppedSigMask);
|
||||
pb->pb_Flags |= PLIPF_SERVERSTOPPED;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user