[PATCH] lindent rio drivers
Run all rio files through indent -kr -i8 -bri0 -l255, as requested by Alan. rioboot.c and rioinit.c were skipped due to worrisome lindent warnings. Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
a941564458
commit
8d8706e2f8
@@ -52,8 +52,7 @@ static char *_board_h_sccs_ = "@(#)board.h 1.2";
|
|||||||
/*
|
/*
|
||||||
** The shape of the Host Control area, at offset 0x7C00, Write Only
|
** The shape of the Host Control area, at offset 0x7C00, Write Only
|
||||||
*/
|
*/
|
||||||
struct s_Ctrl
|
struct s_Ctrl {
|
||||||
{
|
|
||||||
BYTE DpCtl; /* 7C00 */
|
BYTE DpCtl; /* 7C00 */
|
||||||
BYTE Dp_Unused2_[127];
|
BYTE Dp_Unused2_[127];
|
||||||
BYTE DpIntSet; /* 7C80 */
|
BYTE DpIntSet; /* 7C80 */
|
||||||
@@ -67,8 +66,7 @@ struct s_Ctrl
|
|||||||
/*
|
/*
|
||||||
** The PROM data area on the host (0x7C00), Read Only
|
** The PROM data area on the host (0x7C00), Read Only
|
||||||
*/
|
*/
|
||||||
struct s_Prom
|
struct s_Prom {
|
||||||
{
|
|
||||||
WORD DpSlxCode[2];
|
WORD DpSlxCode[2];
|
||||||
WORD DpRev;
|
WORD DpRev;
|
||||||
WORD Dp_Unused6_;
|
WORD Dp_Unused6_;
|
||||||
@@ -83,8 +81,7 @@ struct s_Prom
|
|||||||
/*
|
/*
|
||||||
** Union of the Ctrl and Prom areas
|
** Union of the Ctrl and Prom areas
|
||||||
*/
|
*/
|
||||||
union u_CtrlProm /* This is the control/PROM area (0x7C00) */
|
union u_CtrlProm { /* This is the control/PROM area (0x7C00) */
|
||||||
{
|
|
||||||
struct s_Ctrl DpCtrl;
|
struct s_Ctrl DpCtrl;
|
||||||
struct s_Prom DpProm;
|
struct s_Prom DpProm;
|
||||||
};
|
};
|
||||||
@@ -92,22 +89,19 @@ union u_CtrlProm /* This is the control/PROM area (0x7C00) */
|
|||||||
/*
|
/*
|
||||||
** The top end of memory!
|
** The top end of memory!
|
||||||
*/
|
*/
|
||||||
struct s_ParmMapS /* Area containing Parm Map Pointer */
|
struct s_ParmMapS { /* Area containing Parm Map Pointer */
|
||||||
{
|
|
||||||
BYTE Dp_Unused8_[DP_PARMMAP_ADDR];
|
BYTE Dp_Unused8_[DP_PARMMAP_ADDR];
|
||||||
WORD DpParmMapAd;
|
WORD DpParmMapAd;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct s_StartUpS
|
struct s_StartUpS {
|
||||||
{
|
|
||||||
BYTE Dp_Unused9_[DP_STARTUP_ADDR];
|
BYTE Dp_Unused9_[DP_STARTUP_ADDR];
|
||||||
BYTE Dp_LongJump[0x4];
|
BYTE Dp_LongJump[0x4];
|
||||||
BYTE Dp_Unused10_[2];
|
BYTE Dp_Unused10_[2];
|
||||||
BYTE Dp_ShortJump[0x2];
|
BYTE Dp_ShortJump[0x2];
|
||||||
};
|
};
|
||||||
|
|
||||||
union u_Sram2ParmMap /* This is the top of memory (0x7E00-0x7FFF) */
|
union u_Sram2ParmMap { /* This is the top of memory (0x7E00-0x7FFF) */
|
||||||
{
|
|
||||||
BYTE DpSramMem[DP_SRAM2_SIZE];
|
BYTE DpSramMem[DP_SRAM2_SIZE];
|
||||||
struct s_ParmMapS DpParmMapS;
|
struct s_ParmMapS DpParmMapS;
|
||||||
struct s_StartUpS DpStartUpS;
|
struct s_StartUpS DpStartUpS;
|
||||||
@@ -116,8 +110,7 @@ union u_Sram2ParmMap /* This is the top of memory (0x7E00-0x7FFF) */
|
|||||||
/*
|
/*
|
||||||
** This is the DP RAM overlay.
|
** This is the DP RAM overlay.
|
||||||
*/
|
*/
|
||||||
struct DpRam
|
struct DpRam {
|
||||||
{
|
|
||||||
BYTE DpSram1[DP_SRAM1_SIZE]; /* 0000 - 7BFF */
|
BYTE DpSram1[DP_SRAM1_SIZE]; /* 0000 - 7BFF */
|
||||||
union u_CtrlProm DpCtrlProm; /* 7C00 - 7DFF */
|
union u_CtrlProm DpCtrlProm; /* 7C00 - 7DFF */
|
||||||
union u_Sram2ParmMap DpSram2ParmMap; /* 7E00 - 7FFF */
|
union u_Sram2ParmMap DpSram2ParmMap; /* 7E00 - 7FFF */
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_bootpkt_h_sccs = "@(#)bootpkt.h 1.1" ;
|
static char *_rio_bootpkt_h_sccs = "@(#)bootpkt.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -49,14 +49,13 @@ static char *_rio_bootpkt_h_sccs = "@(#)bootpkt.h 1.1" ;
|
|||||||
* Overlayed onto the Data fields of a regular
|
* Overlayed onto the Data fields of a regular
|
||||||
* Packet
|
* Packet
|
||||||
************************************************/
|
************************************************/
|
||||||
typedef struct BOOT_PKT BOOT_PKT ;
|
typedef struct BOOT_PKT BOOT_PKT;
|
||||||
struct BOOT_PKT {
|
struct BOOT_PKT {
|
||||||
short seq_num ;
|
short seq_num;
|
||||||
char data[10] ;
|
char data[10];
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -97,9 +97,8 @@
|
|||||||
|
|
||||||
#define MAX_RATE B2000
|
#define MAX_RATE B2000
|
||||||
|
|
||||||
struct baud_rate /* Tag for baud rates */
|
struct baud_rate { /* Tag for baud rates */
|
||||||
{
|
/* short host_rate, *//* As passed by the driver */
|
||||||
/* short host_rate,*/ /* As passed by the driver */
|
|
||||||
short divisor, /* The divisor */
|
short divisor, /* The divisor */
|
||||||
prescaler; /* The pre-scaler */
|
prescaler; /* The pre-scaler */
|
||||||
};
|
};
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_chan_h_sccs = "@(#)chan.h 1.1" ;
|
static char *_rio_chan_h_sccs = "@(#)chan.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -145,7 +145,7 @@
|
|||||||
#define ticr 0x45 /* Transmit Interrupting Channel Reg */
|
#define ticr 0x45 /* Transmit Interrupting Channel Reg */
|
||||||
#define micr 0x46 /* Modem Interrupting Channel Register */
|
#define micr 0x46 /* Modem Interrupting Channel Register */
|
||||||
|
|
||||||
#define gcr 0x4b /* Global configuration register*/
|
#define gcr 0x4b /* Global configuration register */
|
||||||
#define misr 0x4c /* Modem interrupt status register */
|
#define misr 0x4c /* Modem interrupt status register */
|
||||||
|
|
||||||
#define rbusr 0x59
|
#define rbusr 0x59
|
||||||
@@ -162,15 +162,15 @@
|
|||||||
#define tir 0x6a /* Transmit Interrupt Register */
|
#define tir 0x6a /* Transmit Interrupt Register */
|
||||||
#define rir 0x6b /* Receive Interrupt Register */
|
#define rir 0x6b /* Receive Interrupt Register */
|
||||||
#define msvr1 0x6c /* Modem Signal Value Register 1 */
|
#define msvr1 0x6c /* Modem Signal Value Register 1 */
|
||||||
#define msvr2 0x6d /* Modem Signal Value Register 2*/
|
#define msvr2 0x6d /* Modem Signal Value Register 2 */
|
||||||
#define psvr 0x6f /* Printer Signal Value Register*/
|
#define psvr 0x6f /* Printer Signal Value Register */
|
||||||
|
|
||||||
#define tbpr 0x72 /* Transmit Baud Rate Period Register */
|
#define tbpr 0x72 /* Transmit Baud Rate Period Register */
|
||||||
#define tcor 0x76 /* Transmit Clock Option Register */
|
#define tcor 0x76 /* Transmit Clock Option Register */
|
||||||
|
|
||||||
#define rbpr 0x78 /* Receive Baud Rate Period Register */
|
#define rbpr 0x78 /* Receive Baud Rate Period Register */
|
||||||
#define rber 0x7a /* Receive Baud Rate Extension Register */
|
#define rber 0x7a /* Receive Baud Rate Extension Register */
|
||||||
#define rcor 0x7c /* Receive Clock Option Register*/
|
#define rcor 0x7c /* Receive Clock Option Register */
|
||||||
#define ppr 0x7e /* Prescalar Period Register */
|
#define ppr 0x7e /* Prescalar Period Register */
|
||||||
|
|
||||||
/* Misc registers used for forcing the 1400 out of its reset woes */
|
/* Misc registers used for forcing the 1400 out of its reset woes */
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_cmd_h_sccs = "@(#)cmd.h 1.1" ;
|
static char *_rio_cmd_h_sccs = "@(#)cmd.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -81,4 +81,3 @@ static char *_rio_cmd_h_sccs = "@(#)cmd.h 1.1" ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -44,15 +44,14 @@ static char *_cmdblk_h_sccs_ = "@(#)cmdblk.h 1.2";
|
|||||||
** a rup.
|
** a rup.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct CmdBlk
|
struct CmdBlk {
|
||||||
{
|
|
||||||
struct CmdBlk *NextP; /* Pointer to next command block */
|
struct CmdBlk *NextP; /* Pointer to next command block */
|
||||||
struct PKT Packet; /* A packet, to copy to the rup */
|
struct PKT Packet; /* A packet, to copy to the rup */
|
||||||
/* The func to call to check if OK */
|
/* The func to call to check if OK */
|
||||||
int (*PreFuncP)(int, struct CmdBlk *);
|
int (*PreFuncP) (int, struct CmdBlk *);
|
||||||
int PreArg; /* The arg for the func */
|
int PreArg; /* The arg for the func */
|
||||||
/* The func to call when completed */
|
/* The func to call when completed */
|
||||||
int (*PostFuncP)(int, struct CmdBlk *);
|
int (*PostFuncP) (int, struct CmdBlk *);
|
||||||
int PostArg; /* The arg for the func */
|
int PostArg; /* The arg for the func */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -54,8 +54,7 @@ static char *_cmdpkt_h_sccs_ = "@(#)cmdpkt.h 1.2";
|
|||||||
** This structure overlays a PktCmd->CmdData structure, and so starts
|
** This structure overlays a PktCmd->CmdData structure, and so starts
|
||||||
** at Data[2] in the actual pkt!
|
** at Data[2] in the actual pkt!
|
||||||
*/
|
*/
|
||||||
struct BootSequence
|
struct BootSequence {
|
||||||
{
|
|
||||||
WORD NumPackets;
|
WORD NumPackets;
|
||||||
WORD LoadBase;
|
WORD LoadBase;
|
||||||
WORD CodeSize;
|
WORD CodeSize;
|
||||||
@@ -63,17 +62,14 @@ struct BootSequence
|
|||||||
|
|
||||||
#define BOOT_SEQUENCE_LEN 8
|
#define BOOT_SEQUENCE_LEN 8
|
||||||
|
|
||||||
struct SamTop
|
struct SamTop {
|
||||||
{
|
|
||||||
BYTE Unit;
|
BYTE Unit;
|
||||||
BYTE Link;
|
BYTE Link;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CmdHdr
|
struct CmdHdr {
|
||||||
{
|
|
||||||
BYTE PcCommand;
|
BYTE PcCommand;
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
BYTE PcPhbNum;
|
BYTE PcPhbNum;
|
||||||
BYTE PcLinkNum;
|
BYTE PcLinkNum;
|
||||||
BYTE PcIDNum;
|
BYTE PcIDNum;
|
||||||
@@ -81,28 +77,22 @@ struct CmdHdr
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct PktCmd
|
struct PktCmd {
|
||||||
{
|
union {
|
||||||
union
|
struct {
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct CmdHdr CmdHdr;
|
struct CmdHdr CmdHdr;
|
||||||
struct BootSequence PcBootSequence;
|
struct BootSequence PcBootSequence;
|
||||||
} S1;
|
} S1;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
WORD PcSequence;
|
WORD PcSequence;
|
||||||
BYTE PcBootData[RTA_BOOT_DATA_SIZE];
|
BYTE PcBootData[RTA_BOOT_DATA_SIZE];
|
||||||
} S2;
|
} S2;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
WORD __crud__;
|
WORD __crud__;
|
||||||
BYTE PcUniqNum[4]; /* this is really a uint. */
|
BYTE PcUniqNum[4]; /* this is really a uint. */
|
||||||
BYTE PcModuleTypes; /* what modules are fitted */
|
BYTE PcModuleTypes; /* what modules are fitted */
|
||||||
} S3;
|
} S3;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
struct CmdHdr CmdHdr;
|
struct CmdHdr CmdHdr;
|
||||||
BYTE __undefined__;
|
BYTE __undefined__;
|
||||||
BYTE PcModemStatus;
|
BYTE PcModemStatus;
|
||||||
@@ -111,57 +101,46 @@ struct PktCmd
|
|||||||
WORD PcSubAddr; /* Address for command */
|
WORD PcSubAddr; /* Address for command */
|
||||||
BYTE PcSubData[64]; /* Date area for command */
|
BYTE PcSubData[64]; /* Date area for command */
|
||||||
} S4;
|
} S4;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
struct CmdHdr CmdHdr;
|
struct CmdHdr CmdHdr;
|
||||||
BYTE PcCommandText[1];
|
BYTE PcCommandText[1];
|
||||||
BYTE __crud__[20];
|
BYTE __crud__[20];
|
||||||
BYTE PcIDNum2; /* It had to go somewhere! */
|
BYTE PcIDNum2; /* It had to go somewhere! */
|
||||||
} S5;
|
} S5;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
struct CmdHdr CmdHdr;
|
struct CmdHdr CmdHdr;
|
||||||
struct SamTop Topology[LINKS_PER_UNIT];
|
struct SamTop Topology[LINKS_PER_UNIT];
|
||||||
} S6;
|
} S6;
|
||||||
} U1;
|
} U1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PktCmd_M
|
struct PktCmd_M {
|
||||||
{
|
union {
|
||||||
union
|
struct {
|
||||||
{
|
struct {
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
uchar PcCommand;
|
uchar PcCommand;
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
uchar PcPhbNum;
|
uchar PcPhbNum;
|
||||||
uchar PcLinkNum;
|
uchar PcLinkNum;
|
||||||
uchar PcIDNum;
|
uchar PcIDNum;
|
||||||
} U0;
|
} U0;
|
||||||
} CmdHdr;
|
} CmdHdr;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
ushort NumPackets;
|
ushort NumPackets;
|
||||||
ushort LoadBase;
|
ushort LoadBase;
|
||||||
ushort CodeSize;
|
ushort CodeSize;
|
||||||
} PcBootSequence;
|
} PcBootSequence;
|
||||||
} S1;
|
} S1;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
ushort PcSequence;
|
ushort PcSequence;
|
||||||
uchar PcBootData[RTA_BOOT_DATA_SIZE];
|
uchar PcBootData[RTA_BOOT_DATA_SIZE];
|
||||||
} S2;
|
} S2;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
ushort __crud__;
|
ushort __crud__;
|
||||||
uchar PcUniqNum[4]; /* this is really a uint. */
|
uchar PcUniqNum[4]; /* this is really a uint. */
|
||||||
uchar PcModuleTypes; /* what modules are fitted */
|
uchar PcModuleTypes; /* what modules are fitted */
|
||||||
} S3;
|
} S3;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
ushort __cmd_hdr__;
|
ushort __cmd_hdr__;
|
||||||
uchar __undefined__;
|
uchar __undefined__;
|
||||||
uchar PcModemStatus;
|
uchar PcModemStatus;
|
||||||
@@ -170,15 +149,13 @@ struct PktCmd_M
|
|||||||
ushort PcSubAddr;
|
ushort PcSubAddr;
|
||||||
uchar PcSubData[64];
|
uchar PcSubData[64];
|
||||||
} S4;
|
} S4;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
ushort __cmd_hdr__;
|
ushort __cmd_hdr__;
|
||||||
uchar PcCommandText[1];
|
uchar PcCommandText[1];
|
||||||
uchar __crud__[20];
|
uchar __crud__[20];
|
||||||
uchar PcIDNum2; /* Tacked on end */
|
uchar PcIDNum2; /* Tacked on end */
|
||||||
} S5;
|
} S5;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
ushort __cmd_hdr__;
|
ushort __cmd_hdr__;
|
||||||
struct Top Topology[LINKS_PER_UNIT];
|
struct Top Topology[LINKS_PER_UNIT];
|
||||||
} S6;
|
} S6;
|
||||||
|
@@ -59,4 +59,3 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -44,15 +44,13 @@ static char *_daemon_h_sccs_ = "@(#)daemon.h 1.3";
|
|||||||
** structures used on /dev/rio
|
** structures used on /dev/rio
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct Error
|
struct Error {
|
||||||
{
|
|
||||||
uint Error;
|
uint Error;
|
||||||
uint Entry;
|
uint Entry;
|
||||||
uint Other;
|
uint Other;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DownLoad
|
struct DownLoad {
|
||||||
{
|
|
||||||
char *DataP;
|
char *DataP;
|
||||||
uint Count;
|
uint Count;
|
||||||
uint ProductCode;
|
uint ProductCode;
|
||||||
@@ -69,8 +67,7 @@ struct DownLoad
|
|||||||
#define MAX_XP_CTRL_LEN 16 /* ALSO IN PORT.H */
|
#define MAX_XP_CTRL_LEN 16 /* ALSO IN PORT.H */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct PortSetup
|
struct PortSetup {
|
||||||
{
|
|
||||||
uint From; /* Set/Clear XP & IXANY Control from this port.... */
|
uint From; /* Set/Clear XP & IXANY Control from this port.... */
|
||||||
uint To; /* .... to this port */
|
uint To; /* .... to this port */
|
||||||
uint XpCps; /* at this speed */
|
uint XpCps; /* at this speed */
|
||||||
@@ -83,28 +80,24 @@ struct PortSetup
|
|||||||
uchar Drain; /* close only when drained */
|
uchar Drain; /* close only when drained */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LpbReq
|
struct LpbReq {
|
||||||
{
|
|
||||||
uint Host;
|
uint Host;
|
||||||
uint Link;
|
uint Link;
|
||||||
struct LPB *LpbP;
|
struct LPB *LpbP;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RupReq
|
struct RupReq {
|
||||||
{
|
|
||||||
uint HostNum;
|
uint HostNum;
|
||||||
uint RupNum;
|
uint RupNum;
|
||||||
struct RUP *RupP;
|
struct RUP *RupP;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PortReq
|
struct PortReq {
|
||||||
{
|
|
||||||
uint SysPort;
|
uint SysPort;
|
||||||
struct Port *PortP;
|
struct Port *PortP;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StreamInfo
|
struct StreamInfo {
|
||||||
{
|
|
||||||
uint SysPort;
|
uint SysPort;
|
||||||
#if 0
|
#if 0
|
||||||
queue_t RQueue;
|
queue_t RQueue;
|
||||||
@@ -115,59 +108,50 @@ struct StreamInfo
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HostReq
|
struct HostReq {
|
||||||
{
|
|
||||||
uint HostNum;
|
uint HostNum;
|
||||||
struct Host *HostP;
|
struct Host *HostP;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HostDpRam
|
struct HostDpRam {
|
||||||
{
|
|
||||||
uint HostNum;
|
uint HostNum;
|
||||||
struct DpRam *DpRamP;
|
struct DpRam *DpRamP;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DebugCtrl
|
struct DebugCtrl {
|
||||||
{
|
|
||||||
uint SysPort;
|
uint SysPort;
|
||||||
uint Debug;
|
uint Debug;
|
||||||
uint Wait;
|
uint Wait;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MapInfo
|
struct MapInfo {
|
||||||
{
|
|
||||||
uint FirstPort; /* 8 ports, starting from this (tty) number */
|
uint FirstPort; /* 8 ports, starting from this (tty) number */
|
||||||
uint RtaUnique; /* reside on this RTA (unique number) */
|
uint RtaUnique; /* reside on this RTA (unique number) */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MapIn
|
struct MapIn {
|
||||||
{
|
|
||||||
uint NumEntries; /* How many port sets are we mapping? */
|
uint NumEntries; /* How many port sets are we mapping? */
|
||||||
struct MapInfo *MapInfoP; /* Pointer to (user space) info */
|
struct MapInfo *MapInfoP; /* Pointer to (user space) info */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SendPack
|
struct SendPack {
|
||||||
{
|
|
||||||
unsigned int PortNum;
|
unsigned int PortNum;
|
||||||
unsigned char Len;
|
unsigned char Len;
|
||||||
unsigned char Data[PKT_MAX_DATA_LEN];
|
unsigned char Data[PKT_MAX_DATA_LEN];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpecialRupCmd
|
struct SpecialRupCmd {
|
||||||
{
|
|
||||||
struct PKT Packet;
|
struct PKT Packet;
|
||||||
unsigned short Host;
|
unsigned short Host;
|
||||||
unsigned short RupNum;
|
unsigned short RupNum;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IdentifyRta
|
struct IdentifyRta {
|
||||||
{
|
|
||||||
ulong RtaUnique;
|
ulong RtaUnique;
|
||||||
uchar ID;
|
uchar ID;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct KillNeighbour
|
struct KillNeighbour {
|
||||||
{
|
|
||||||
ulong UniqueNum;
|
ulong UniqueNum;
|
||||||
uchar Link;
|
uchar Link;
|
||||||
};
|
};
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_defaults_h_sccs = "@(#)defaults.h 1.1" ;
|
static char *_rio_defaults_h_sccs = "@(#)defaults.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -56,4 +56,3 @@ static char *_rio_defaults_h_sccs = "@(#)defaults.h 1.1" ;
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_enable_h_sccs = "@(#)enable.h 1.1" ;
|
static char *_rio_enable_h_sccs = "@(#)enable.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -46,5 +46,3 @@ static char *_rio_enable_h_sccs = "@(#)enable.h 1.1" ;
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -80,6 +80,3 @@
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -41,114 +41,113 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_formpkt_h_sccs = "@(#)formpkt.h 1.1" ;
|
static char *_rio_formpkt_h_sccs = "@(#)formpkt.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct FORM_BOOT_PKT_1 FORM_BOOT_PKT_1 ;
|
typedef struct FORM_BOOT_PKT_1 FORM_BOOT_PKT_1;
|
||||||
struct FORM_BOOT_PKT_1 {
|
struct FORM_BOOT_PKT_1 {
|
||||||
ushort pkt_number ;
|
ushort pkt_number;
|
||||||
ushort pkt_total ;
|
ushort pkt_total;
|
||||||
ushort boot_top ;
|
ushort boot_top;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
typedef struct FORM_BOOT_PKT_2 FORM_BOOT_PKT_2 ;
|
typedef struct FORM_BOOT_PKT_2 FORM_BOOT_PKT_2;
|
||||||
struct FORM_BOOT_PKT_2 {
|
struct FORM_BOOT_PKT_2 {
|
||||||
ushort pkt_number ;
|
ushort pkt_number;
|
||||||
char boot_data[10] ;
|
char boot_data[10];
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct FORM_ATTACH_RTA FORM_ATTACH_RTA ;
|
typedef struct FORM_ATTACH_RTA FORM_ATTACH_RTA;
|
||||||
struct FORM_ATTACH_RTA {
|
struct FORM_ATTACH_RTA {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char booter_serial[4] ;
|
char booter_serial[4];
|
||||||
char booter_link ;
|
char booter_link;
|
||||||
char bootee_serial[4] ;
|
char bootee_serial[4];
|
||||||
char bootee_link ;
|
char bootee_link;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct FORM_BOOT_ID FORM_BOOT_ID ;
|
typedef struct FORM_BOOT_ID FORM_BOOT_ID;
|
||||||
struct FORM_BOOT_ID {
|
struct FORM_BOOT_ID {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char bootee_serial[4] ;
|
char bootee_serial[4];
|
||||||
char bootee_prod_id ;
|
char bootee_prod_id;
|
||||||
char bootee_link ;
|
char bootee_link;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct FORM_ROUTE_1 FORM_ROUTE_1 ;
|
typedef struct FORM_ROUTE_1 FORM_ROUTE_1;
|
||||||
struct FORM_ROUTE_1 {
|
struct FORM_ROUTE_1 {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char pkt_number ;
|
char pkt_number;
|
||||||
char total_in_sequence ;
|
char total_in_sequence;
|
||||||
char unit_id ;
|
char unit_id;
|
||||||
char host_unit_id ;
|
char host_unit_id;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
typedef struct FORM_ROUTE_2 FORM_ROUTE_2 ;
|
typedef struct FORM_ROUTE_2 FORM_ROUTE_2;
|
||||||
struct FORM_ROUTE_2 {
|
struct FORM_ROUTE_2 {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char pkt_number ;
|
char pkt_number;
|
||||||
char total_in_sequence ;
|
char total_in_sequence;
|
||||||
char route_data[9] ;
|
char route_data[9];
|
||||||
} ;
|
};
|
||||||
|
|
||||||
typedef struct FORM_ROUTE_REQ FORM_ROUTE_REQ ;
|
typedef struct FORM_ROUTE_REQ FORM_ROUTE_REQ;
|
||||||
struct FORM_ROUTE_REQ {
|
struct FORM_ROUTE_REQ {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char pkt_number ;
|
char pkt_number;
|
||||||
char total_in_sequence ;
|
char total_in_sequence;
|
||||||
char route_data[10] ;
|
char route_data[10];
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct FORM_ERROR FORM_ERROR ;
|
typedef struct FORM_ERROR FORM_ERROR;
|
||||||
struct FORM_ERROR {
|
struct FORM_ERROR {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char error_code ;
|
char error_code;
|
||||||
|
|
||||||
} ;
|
};
|
||||||
|
|
||||||
typedef struct FORM_STATUS FORM_STATUS ;
|
typedef struct FORM_STATUS FORM_STATUS;
|
||||||
struct FORM_STATUS {
|
struct FORM_STATUS {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char status_code ;
|
char status_code;
|
||||||
char last_packet_valid ;
|
char last_packet_valid;
|
||||||
char tx_buffer ;
|
char tx_buffer;
|
||||||
char rx_buffer ;
|
char rx_buffer;
|
||||||
char port_status ;
|
char port_status;
|
||||||
char phb_status ;
|
char phb_status;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct FORM_LINK_STATUS FORM_LINK_STATUS ;
|
typedef struct FORM_LINK_STATUS FORM_LINK_STATUS;
|
||||||
struct FORM_LINK_STATUS {
|
struct FORM_LINK_STATUS {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char status_code ;
|
char status_code;
|
||||||
char link_number ;
|
char link_number;
|
||||||
ushort rx_errors ;
|
ushort rx_errors;
|
||||||
ushort tx_errors ;
|
ushort tx_errors;
|
||||||
ushort csum_errors ;
|
ushort csum_errors;
|
||||||
ushort disconnects ;
|
ushort disconnects;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct FORM_PARTITION FORM_PARTITION ;
|
typedef struct FORM_PARTITION FORM_PARTITION;
|
||||||
struct FORM_PARTITION {
|
struct FORM_PARTITION {
|
||||||
char cmd_code ;
|
char cmd_code;
|
||||||
char status_code ;
|
char status_code;
|
||||||
char port_number ;
|
char port_number;
|
||||||
char tx_max ;
|
char tx_max;
|
||||||
char rx_max ;
|
char rx_max;
|
||||||
char rx_limit ;
|
char rx_limit;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -47,20 +47,19 @@ int RIOBootCodeHOST(struct rio_info *, register struct DownLoad *);
|
|||||||
int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *);
|
int RIOBootCodeUNKNOWN(struct rio_info *, struct DownLoad *);
|
||||||
void msec_timeout(struct Host *);
|
void msec_timeout(struct Host *);
|
||||||
int RIOBootRup(struct rio_info *, uint, struct Host *, struct PKT *);
|
int RIOBootRup(struct rio_info *, uint, struct Host *, struct PKT *);
|
||||||
int RIOBootOk(struct rio_info *,struct Host *, ulong);
|
int RIOBootOk(struct rio_info *, struct Host *, ulong);
|
||||||
int RIORtaBound(struct rio_info *, uint);
|
int RIORtaBound(struct rio_info *, uint);
|
||||||
void FillSlot(int, int, uint, struct Host *);
|
void FillSlot(int, int, uint, struct Host *);
|
||||||
|
|
||||||
/* riocmd.c */
|
/* riocmd.c */
|
||||||
int RIOFoadRta(struct Host *, struct Map *);
|
int RIOFoadRta(struct Host *, struct Map *);
|
||||||
int RIOZombieRta(struct Host *, struct Map *);
|
int RIOZombieRta(struct Host *, struct Map *);
|
||||||
int RIOCommandRta(struct rio_info *, uint, int (* func)( struct Host *,
|
int RIOCommandRta(struct rio_info *, uint, int (*func) (struct Host *, struct Map *));
|
||||||
struct Map *));
|
|
||||||
int RIOIdentifyRta(struct rio_info *, caddr_t);
|
int RIOIdentifyRta(struct rio_info *, caddr_t);
|
||||||
int RIOKillNeighbour(struct rio_info *, caddr_t);
|
int RIOKillNeighbour(struct rio_info *, caddr_t);
|
||||||
int RIOSuspendBootRta(struct Host *, int, int);
|
int RIOSuspendBootRta(struct Host *, int, int);
|
||||||
int RIOFoadWakeup(struct rio_info *);
|
int RIOFoadWakeup(struct rio_info *);
|
||||||
struct CmdBlk * RIOGetCmdBlk(void);
|
struct CmdBlk *RIOGetCmdBlk(void);
|
||||||
void RIOFreeCmdBlk(struct CmdBlk *);
|
void RIOFreeCmdBlk(struct CmdBlk *);
|
||||||
int RIOQueueCmdBlk(struct Host *, uint, struct CmdBlk *);
|
int RIOQueueCmdBlk(struct Host *, uint, struct CmdBlk *);
|
||||||
void RIOPollHostCommands(struct rio_info *, struct Host *);
|
void RIOPollHostCommands(struct rio_info *, struct Host *);
|
||||||
@@ -71,13 +70,13 @@ void ShowPacket(uint, struct PKT *);
|
|||||||
|
|
||||||
/* rioctrl.c */
|
/* rioctrl.c */
|
||||||
int copyin(int, caddr_t, int);
|
int copyin(int, caddr_t, int);
|
||||||
int riocontrol(struct rio_info *, dev_t,int,caddr_t,int);
|
int riocontrol(struct rio_info *, dev_t, int, caddr_t, int);
|
||||||
int RIOPreemptiveCmd(struct rio_info *,struct Port *,uchar);
|
int RIOPreemptiveCmd(struct rio_info *, struct Port *, uchar);
|
||||||
|
|
||||||
/* rioinit.c */
|
/* rioinit.c */
|
||||||
void rioinit(struct rio_info *, struct RioHostInfo *);
|
void rioinit(struct rio_info *, struct RioHostInfo *);
|
||||||
void RIOInitHosts(struct rio_info *, struct RioHostInfo *);
|
void RIOInitHosts(struct rio_info *, struct RioHostInfo *);
|
||||||
void RIOISAinit(struct rio_info *,int);
|
void RIOISAinit(struct rio_info *, int);
|
||||||
int RIODoAT(struct rio_info *, int, int);
|
int RIODoAT(struct rio_info *, int, int);
|
||||||
caddr_t RIOCheckForATCard(int);
|
caddr_t RIOCheckForATCard(int);
|
||||||
int RIOAssignAT(struct rio_info *, int, caddr_t, int);
|
int RIOAssignAT(struct rio_info *, int, caddr_t, int);
|
||||||
@@ -85,7 +84,7 @@ int RIOBoardTest(paddr_t, caddr_t, uchar, int);
|
|||||||
void RIOAllocDataStructs(struct rio_info *);
|
void RIOAllocDataStructs(struct rio_info *);
|
||||||
void RIOSetupDataStructs(struct rio_info *);
|
void RIOSetupDataStructs(struct rio_info *);
|
||||||
int RIODefaultName(struct rio_info *, struct Host *, uint);
|
int RIODefaultName(struct rio_info *, struct Host *, uint);
|
||||||
struct rioVersion * RIOVersid(void);
|
struct rioVersion *RIOVersid(void);
|
||||||
int RIOMapin(paddr_t, int, caddr_t *);
|
int RIOMapin(paddr_t, int, caddr_t *);
|
||||||
void RIOMapout(paddr_t, long, caddr_t);
|
void RIOMapout(paddr_t, long, caddr_t);
|
||||||
void RIOHostReset(uint, volatile struct DpRam *, uint);
|
void RIOHostReset(uint, volatile struct DpRam *, uint);
|
||||||
@@ -116,7 +115,7 @@ int RIOFindFreeID(struct rio_info *, struct Host *, uint *, uint *);
|
|||||||
|
|
||||||
/* riotty.c */
|
/* riotty.c */
|
||||||
|
|
||||||
int riotopen(struct tty_struct * tty, struct file * filp);
|
int riotopen(struct tty_struct *tty, struct file *filp);
|
||||||
int riotclose(void *ptr);
|
int riotclose(void *ptr);
|
||||||
int riotioctl(struct rio_info *, struct tty_struct *, register int, register caddr_t);
|
int riotioctl(struct rio_info *, struct tty_struct *, register int, register caddr_t);
|
||||||
void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg);
|
void ttyseth(struct Port *, struct ttystatics *, struct old_sgttyb *sg);
|
||||||
@@ -127,27 +126,27 @@ int RIOApel(struct rio_info *);
|
|||||||
int RIODeleteRta(struct rio_info *, struct Map *);
|
int RIODeleteRta(struct rio_info *, struct Map *);
|
||||||
int RIOAssignRta(struct rio_info *, struct Map *);
|
int RIOAssignRta(struct rio_info *, struct Map *);
|
||||||
int RIOReMapPorts(struct rio_info *, struct Host *, struct Map *);
|
int RIOReMapPorts(struct rio_info *, struct Host *, struct Map *);
|
||||||
int RIOChangeName(struct rio_info *, struct Map*);
|
int RIOChangeName(struct rio_info *, struct Map *);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* riodrvr.c */
|
/* riodrvr.c */
|
||||||
struct rio_info * rio_install(struct RioHostInfo *);
|
struct rio_info *rio_install(struct RioHostInfo *);
|
||||||
int rio_uninstall(register struct rio_info *);
|
int rio_uninstall(register struct rio_info *);
|
||||||
int rio_open(struct rio_info *, int, struct file *);
|
int rio_open(struct rio_info *, int, struct file *);
|
||||||
int rio_close(struct rio_info *, struct file *);
|
int rio_close(struct rio_info *, struct file *);
|
||||||
int rio_read(struct rio_info *, struct file *, char *, int);
|
int rio_read(struct rio_info *, struct file *, char *, int);
|
||||||
int rio_write(struct rio_info *, struct file * f, char *, int);
|
int rio_write(struct rio_info *, struct file *f, char *, int);
|
||||||
int rio_ioctl(struct rio_info *, struct file *, int, char *);
|
int rio_ioctl(struct rio_info *, struct file *, int, char *);
|
||||||
int rio_select(struct rio_info *, struct file * f, int, struct sel *);
|
int rio_select(struct rio_info *, struct file *f, int, struct sel *);
|
||||||
int rio_intr(char *);
|
int rio_intr(char *);
|
||||||
int rio_isr_thread(char *);
|
int rio_isr_thread(char *);
|
||||||
struct rio_info * rio_info_store( int cmd, struct rio_info * p);
|
struct rio_info *rio_info_store(int cmd, struct rio_info *p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int rio_pcicopy(char *src, char *dst, int n);
|
extern int rio_pcicopy(char *src, char *dst, int n);
|
||||||
extern int rio_minor (struct tty_struct *tty);
|
extern int rio_minor(struct tty_struct *tty);
|
||||||
extern int rio_ismodem (struct tty_struct *tty);
|
extern int rio_ismodem(struct tty_struct *tty);
|
||||||
|
|
||||||
extern void rio_start_card_running (struct Host * HostP);
|
extern void rio_start_card_running(struct Host *HostP);
|
||||||
|
|
||||||
#endif /* __func_h_def */
|
#endif /* __func_h_def */
|
||||||
|
@@ -49,8 +49,7 @@ static char *_host_h_sccs_ = "@(#)host.h 1.2";
|
|||||||
** Host data structure. This is used for the software equiv. of
|
** Host data structure. This is used for the software equiv. of
|
||||||
** the host.
|
** the host.
|
||||||
*/
|
*/
|
||||||
struct Host
|
struct Host {
|
||||||
{
|
|
||||||
uchar Type; /* RIO_EISA, RIO_MCA, ... */
|
uchar Type; /* RIO_EISA, RIO_MCA, ... */
|
||||||
uchar Ivec; /* POLLED or ivec number */
|
uchar Ivec; /* POLLED or ivec number */
|
||||||
uchar Mode; /* Control stuff */
|
uchar Mode; /* Control stuff */
|
||||||
@@ -65,8 +64,8 @@ struct Host
|
|||||||
/*struct lockb HostLock; *//* Lock structure for MPX */
|
/*struct lockb HostLock; *//* Lock structure for MPX */
|
||||||
uint WorkToBeDone; /* set to true each interrupt */
|
uint WorkToBeDone; /* set to true each interrupt */
|
||||||
uint InIntr; /* Being serviced? */
|
uint InIntr; /* Being serviced? */
|
||||||
uint IntSrvDone;/* host's interrupt has been serviced */
|
uint IntSrvDone; /* host's interrupt has been serviced */
|
||||||
int (*Copy)( caddr_t, caddr_t, int ); /* copy func */
|
int (*Copy) (caddr_t, caddr_t, int); /* copy func */
|
||||||
struct timer_list timer;
|
struct timer_list timer;
|
||||||
/*
|
/*
|
||||||
** I M P O R T A N T !
|
** I M P O R T A N T !
|
||||||
@@ -97,7 +96,7 @@ struct Host
|
|||||||
struct Map Mapping[MAX_RUP]; /* Mappings for host */
|
struct Map Mapping[MAX_RUP]; /* Mappings for host */
|
||||||
struct PHB *PhbP; /* Pointer to the PHB array */
|
struct PHB *PhbP; /* Pointer to the PHB array */
|
||||||
ushort *PhbNumP; /* Ptr to Number of PHB's */
|
ushort *PhbNumP; /* Ptr to Number of PHB's */
|
||||||
struct LPB *LinkStrP ; /* Link Structure Array */
|
struct LPB *LinkStrP; /* Link Structure Array */
|
||||||
struct RUP *RupP; /* Sixteen real rups here */
|
struct RUP *RupP; /* Sixteen real rups here */
|
||||||
struct PARM_MAP *ParmMapP; /* points to the parmmap */
|
struct PARM_MAP *ParmMapP; /* points to the parmmap */
|
||||||
uint ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */
|
uint ExtraUnits[MAX_EXTRA_UNITS]; /* unknown things */
|
||||||
@@ -107,9 +106,9 @@ struct Host
|
|||||||
** The first sixteen are the real Rup entries (above), the last four
|
** The first sixteen are the real Rup entries (above), the last four
|
||||||
** are the link RUPs.
|
** are the link RUPs.
|
||||||
*/
|
*/
|
||||||
struct UnixRup UnixRups[MAX_RUP+LINKS_PER_UNIT];
|
struct UnixRup UnixRups[MAX_RUP + LINKS_PER_UNIT];
|
||||||
int timeout_id; /* For calling 100 ms delays */
|
int timeout_id; /* For calling 100 ms delays */
|
||||||
int timeout_sem;/* For calling 100 ms delays */
|
int timeout_sem; /* For calling 100 ms delays */
|
||||||
long locks; /* long req'd for set_bit --RR */
|
long locks; /* long req'd for set_bit --RR */
|
||||||
char ____end_marker____;
|
char ____end_marker____;
|
||||||
};
|
};
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_hosthw_h_sccs = "@(#)hosthw.h 1.2" ;
|
static char *_rio_hosthw_h_sccs = "@(#)hosthw.h 1.2";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -53,5 +53,3 @@ static char *_rio_hosthw_h_sccs = "@(#)hosthw.h 1.2" ;
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -119,29 +119,29 @@
|
|||||||
#endif /* RTA */
|
#endif /* RTA */
|
||||||
|
|
||||||
struct LPB {
|
struct LPB {
|
||||||
WORD link_number ; /* Link Number */
|
WORD link_number; /* Link Number */
|
||||||
Channel_ptr in_ch ; /* Link In Channel */
|
Channel_ptr in_ch; /* Link In Channel */
|
||||||
Channel_ptr out_ch ; /* Link Out Channel */
|
Channel_ptr out_ch; /* Link Out Channel */
|
||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
uchar stat_led ; /* Port open leds */
|
uchar stat_led; /* Port open leds */
|
||||||
uchar led ; /* True, light led! */
|
uchar led; /* True, light led! */
|
||||||
#endif
|
#endif
|
||||||
BYTE attached_serial[4]; /* Attached serial number */
|
BYTE attached_serial[4]; /* Attached serial number */
|
||||||
BYTE attached_host_serial[4];
|
BYTE attached_host_serial[4];
|
||||||
/* Serial number of Host who
|
/* Serial number of Host who
|
||||||
booted the other end */
|
booted the other end */
|
||||||
WORD descheduled ; /* Currently Descheduled */
|
WORD descheduled; /* Currently Descheduled */
|
||||||
WORD state; /* Current state */
|
WORD state; /* Current state */
|
||||||
WORD send_poll ; /* Send a Poll Packet */
|
WORD send_poll; /* Send a Poll Packet */
|
||||||
Process_ptr ltt_p ; /* Process Descriptor */
|
Process_ptr ltt_p; /* Process Descriptor */
|
||||||
Process_ptr lrt_p ; /* Process Descriptor */
|
Process_ptr lrt_p; /* Process Descriptor */
|
||||||
WORD lrt_status ; /* Current lrt status */
|
WORD lrt_status; /* Current lrt status */
|
||||||
WORD ltt_status ; /* Current ltt status */
|
WORD ltt_status; /* Current ltt status */
|
||||||
WORD timeout ; /* Timeout value */
|
WORD timeout; /* Timeout value */
|
||||||
WORD topology; /* Topology bits */
|
WORD topology; /* Topology bits */
|
||||||
WORD mon_ltt ;
|
WORD mon_ltt;
|
||||||
WORD mon_lrt ;
|
WORD mon_lrt;
|
||||||
WORD WaitNoBoot ; /* Secs to hold off booting */
|
WORD WaitNoBoot; /* Secs to hold off booting */
|
||||||
PKT_ptr add_packet_list; /* Add packets to here */
|
PKT_ptr add_packet_list; /* Add packets to here */
|
||||||
PKT_ptr remove_packet_list; /* Send packets from here */
|
PKT_ptr remove_packet_list; /* Send packets from here */
|
||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
@@ -150,38 +150,38 @@ struct LPB {
|
|||||||
#else
|
#else
|
||||||
#define QBUFS_PER_REDIRECT (8 / PKTS_PER_BUFFER + 1)
|
#define QBUFS_PER_REDIRECT (8 / PKTS_PER_BUFFER + 1)
|
||||||
#endif
|
#endif
|
||||||
PKT_ptr_ptr rd_add ; /* Add a new Packet here */
|
PKT_ptr_ptr rd_add; /* Add a new Packet here */
|
||||||
Q_BUF_ptr rd_add_qb; /* Pointer to the add Q buf */
|
Q_BUF_ptr rd_add_qb; /* Pointer to the add Q buf */
|
||||||
PKT_ptr_ptr rd_add_st_qbb ; /* Pointer to start of the Q's buf */
|
PKT_ptr_ptr rd_add_st_qbb; /* Pointer to start of the Q's buf */
|
||||||
PKT_ptr_ptr rd_add_end_qbb ; /* Pointer to the end of the Q's buf */
|
PKT_ptr_ptr rd_add_end_qbb; /* Pointer to the end of the Q's buf */
|
||||||
PKT_ptr_ptr rd_remove ; /* Remove a Packet here */
|
PKT_ptr_ptr rd_remove; /* Remove a Packet here */
|
||||||
Q_BUF_ptr rd_remove_qb ; /* Pointer to the remove Q buf */
|
Q_BUF_ptr rd_remove_qb; /* Pointer to the remove Q buf */
|
||||||
PKT_ptr_ptr rd_remove_st_qbb ; /* Pointer to the start of the Q buf */
|
PKT_ptr_ptr rd_remove_st_qbb; /* Pointer to the start of the Q buf */
|
||||||
PKT_ptr_ptr rd_remove_end_qbb ; /* Pointer to the end of the Q buf */
|
PKT_ptr_ptr rd_remove_end_qbb; /* Pointer to the end of the Q buf */
|
||||||
ushort pkts_in_q ; /* Packets in queue */
|
ushort pkts_in_q; /* Packets in queue */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Channel_ptr lrt_fail_chan ; /* Lrt's failure channel */
|
Channel_ptr lrt_fail_chan; /* Lrt's failure channel */
|
||||||
Channel_ptr ltt_fail_chan ; /* Ltt's failure channel */
|
Channel_ptr ltt_fail_chan; /* Ltt's failure channel */
|
||||||
|
|
||||||
#if defined (HOST) || defined (INKERNEL)
|
#if defined (HOST) || defined (INKERNEL)
|
||||||
/* RUP structure for HOST to driver communications */
|
/* RUP structure for HOST to driver communications */
|
||||||
struct RUP rup ;
|
struct RUP rup;
|
||||||
#endif
|
#endif
|
||||||
struct RUP link_rup; /* RUP for the link (POLL,
|
struct RUP link_rup; /* RUP for the link (POLL,
|
||||||
topology etc.) */
|
topology etc.) */
|
||||||
WORD attached_link ; /* Number of attached link */
|
WORD attached_link; /* Number of attached link */
|
||||||
WORD csum_errors ; /* csum errors */
|
WORD csum_errors; /* csum errors */
|
||||||
WORD num_disconnects ; /* number of disconnects */
|
WORD num_disconnects; /* number of disconnects */
|
||||||
WORD num_sync_rcvd ; /* # sync's received */
|
WORD num_sync_rcvd; /* # sync's received */
|
||||||
WORD num_sync_rqst ; /* # sync requests */
|
WORD num_sync_rqst; /* # sync requests */
|
||||||
WORD num_tx ; /* Num pkts sent */
|
WORD num_tx; /* Num pkts sent */
|
||||||
WORD num_rx ; /* Num pkts received */
|
WORD num_rx; /* Num pkts received */
|
||||||
WORD module_attached; /* Module tpyes of attached */
|
WORD module_attached; /* Module tpyes of attached */
|
||||||
WORD led_timeout; /* LED timeout */
|
WORD led_timeout; /* LED timeout */
|
||||||
WORD first_port; /* First port to service */
|
WORD first_port; /* First port to service */
|
||||||
WORD last_port; /* Last port to service */
|
WORD last_port; /* Last port to service */
|
||||||
} ;
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -118,5 +118,3 @@ the definitions from Linux, and is incompatible... */
|
|||||||
#define RIO_B64000 0x12 /* 64000 baud */
|
#define RIO_B64000 0x12 /* 64000 baud */
|
||||||
#define RIO_B115200 0x13 /* 115200 baud */
|
#define RIO_B115200 0x13 /* 115200 baud */
|
||||||
#define RIO_B2000 0x14 /* 2000 baud */
|
#define RIO_B2000 0x14 /* 2000 baud */
|
||||||
|
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char *_rio_list_h_sccs = "@(#)list.h 1.9" ;
|
static char *_rio_list_h_sccs = "@(#)list.h 1.9";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_lrt_h_sccs = "@(#)lrt.h 1.1" ;
|
static char *_rio_lrt_h_sccs = "@(#)lrt.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -50,6 +50,3 @@ static char *_rio_lrt_h_sccs = "@(#)lrt.h 1.1" ;
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_ltt_h_sccs = "@(#)ltt.h 1.1" ;
|
static char *_rio_ltt_h_sccs = "@(#)ltt.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -50,6 +50,3 @@ static char *_rio_ltt_h_sccs = "@(#)ltt.h 1.1" ;
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_lttwake_h_sccs = "@(#)lttwake.h 1.1" ;
|
static char *_rio_lttwake_h_sccs = "@(#)lttwake.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -48,6 +48,3 @@ static char *_rio_lttwake_h_sccs = "@(#)lttwake.h 1.1" ;
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -46,8 +46,7 @@ static char *_map_h_sccs_ = "@(#)map.h 1.2";
|
|||||||
#define TOTAL_MAP_ENTRIES (MAX_MAP_ENTRY*RIO_SLOTS)
|
#define TOTAL_MAP_ENTRIES (MAX_MAP_ENTRY*RIO_SLOTS)
|
||||||
#define MAX_NAME_LEN 32
|
#define MAX_NAME_LEN 32
|
||||||
|
|
||||||
struct Map
|
struct Map {
|
||||||
{
|
|
||||||
uint HostUniqueNum; /* Supporting hosts unique number */
|
uint HostUniqueNum; /* Supporting hosts unique number */
|
||||||
uint RtaUniqueNum; /* Unique number */
|
uint RtaUniqueNum; /* Unique number */
|
||||||
/*
|
/*
|
||||||
|
@@ -42,8 +42,7 @@ static char *_param_h_sccs_ = "@(#)param.h 1.2";
|
|||||||
** the param command block, as used in OPEN and PARAM calls.
|
** the param command block, as used in OPEN and PARAM calls.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct phb_param
|
struct phb_param {
|
||||||
{
|
|
||||||
BYTE Cmd; /* It is very important that these line up */
|
BYTE Cmd; /* It is very important that these line up */
|
||||||
BYTE Cor1; /* with what is expected at the other end. */
|
BYTE Cor1; /* with what is expected at the other end. */
|
||||||
BYTE Cor2; /* to confirm that you've got it right, */
|
BYTE Cor2; /* to confirm that you've got it right, */
|
||||||
|
@@ -44,53 +44,50 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct PARM_MAP PARM_MAP ;
|
typedef struct PARM_MAP PARM_MAP;
|
||||||
|
|
||||||
struct PARM_MAP
|
struct PARM_MAP {
|
||||||
{
|
PHB_ptr phb_ptr; /* Pointer to the PHB array */
|
||||||
PHB_ptr phb_ptr ; /* Pointer to the PHB array */
|
WORD_ptr phb_num_ptr; /* Ptr to Number of PHB's */
|
||||||
WORD_ptr phb_num_ptr ; /* Ptr to Number of PHB's */
|
FREE_LIST_ptr free_list; /* Free List pointer */
|
||||||
FREE_LIST_ptr free_list; /* Free List pointer */
|
FREE_LIST_ptr free_list_end; /* Free List End pointer */
|
||||||
FREE_LIST_ptr free_list_end; /* Free List End pointer */
|
Q_BUF_ptr_ptr q_free_list_ptr; /* Ptr to Q_BUF variable */
|
||||||
Q_BUF_ptr_ptr q_free_list_ptr ; /* Ptr to Q_BUF variable */
|
BYTE_ptr unit_id_ptr; /* Unit Id */
|
||||||
BYTE_ptr unit_id_ptr ; /* Unit Id */
|
LPB_ptr link_str_ptr; /* Link Structure Array */
|
||||||
LPB_ptr link_str_ptr ; /* Link Structure Array */
|
BYTE_ptr bootloader_1; /* 1st Stage Boot Loader */
|
||||||
BYTE_ptr bootloader_1 ; /* 1st Stage Boot Loader */
|
BYTE_ptr bootloader_2; /* 2nd Stage Boot Loader */
|
||||||
BYTE_ptr bootloader_2 ; /* 2nd Stage Boot Loader */
|
WORD_ptr port_route_map_ptr; /* Port Route Map */
|
||||||
WORD_ptr port_route_map_ptr ; /* Port Route Map */
|
ROUTE_STR_ptr route_ptr; /* Unit Route Map */
|
||||||
ROUTE_STR_ptr route_ptr ; /* Unit Route Map */
|
NUMBER_ptr map_present; /* Route Map present */
|
||||||
NUMBER_ptr map_present ; /* Route Map present */
|
NUMBER pkt_num; /* Total number of packets */
|
||||||
NUMBER pkt_num ; /* Total number of packets */
|
NUMBER q_num; /* Total number of Q packets */
|
||||||
NUMBER q_num ; /* Total number of Q packets */
|
WORD buffers_per_port; /* Number of buffers per port */
|
||||||
WORD buffers_per_port ; /* Number of buffers per port */
|
WORD heap_size; /* Initial size of heap */
|
||||||
WORD heap_size ; /* Initial size of heap */
|
WORD heap_left; /* Current Heap left */
|
||||||
WORD heap_left ; /* Current Heap left */
|
WORD error; /* Error code */
|
||||||
WORD error ; /* Error code */
|
WORD tx_max; /* Max number of tx pkts per phb */
|
||||||
WORD tx_max; /* Max number of tx pkts per phb */
|
WORD rx_max; /* Max number of rx pkts per phb */
|
||||||
WORD rx_max; /* Max number of rx pkts per phb */
|
WORD rx_limit; /* For high / low watermarks */
|
||||||
WORD rx_limit; /* For high / low watermarks */
|
NUMBER links; /* Links to use */
|
||||||
NUMBER links ; /* Links to use */
|
NUMBER timer; /* Interrupts per second */
|
||||||
NUMBER timer ; /* Interrupts per second */
|
RUP_ptr rups; /* Pointer to the RUPs */
|
||||||
RUP_ptr rups ; /* Pointer to the RUPs */
|
WORD max_phb; /* Mostly for debugging */
|
||||||
WORD max_phb ; /* Mostly for debugging */
|
WORD living; /* Just increments!! */
|
||||||
WORD living ; /* Just increments!! */
|
WORD init_done; /* Initialisation over */
|
||||||
WORD init_done ; /* Initialisation over */
|
WORD booting_link;
|
||||||
WORD booting_link ;
|
WORD idle_count; /* Idle time counter */
|
||||||
WORD idle_count ; /* Idle time counter */
|
WORD busy_count; /* Busy counter */
|
||||||
WORD busy_count ; /* Busy counter */
|
WORD idle_control; /* Control Idle Process */
|
||||||
WORD idle_control ; /* Control Idle Process */
|
|
||||||
#if defined(HOST) || defined(INKERNEL)
|
#if defined(HOST) || defined(INKERNEL)
|
||||||
WORD tx_intr; /* TX interrupt pending */
|
WORD tx_intr; /* TX interrupt pending */
|
||||||
WORD rx_intr; /* RX interrupt pending */
|
WORD rx_intr; /* RX interrupt pending */
|
||||||
WORD rup_intr; /* RUP interrupt pending */
|
WORD rup_intr; /* RUP interrupt pending */
|
||||||
#endif
|
#endif
|
||||||
#if defined(RTA)
|
#if defined(RTA)
|
||||||
WORD dying_count; /* Count of processes dead */
|
WORD dying_count; /* Count of processes dead */
|
||||||
#endif
|
#endif
|
||||||
} ;
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -155,7 +155,7 @@
|
|||||||
#define rx_end u4.s1.rx_end_ptr_ptr
|
#define rx_end u4.s1.rx_end_ptr_ptr
|
||||||
#define rx_remove u4.s1.rx_remove_ptr_ptr
|
#define rx_remove u4.s1.rx_remove_ptr_ptr
|
||||||
#endif
|
#endif
|
||||||
typedef struct PHB PHB ;
|
typedef struct PHB PHB;
|
||||||
struct PHB {
|
struct PHB {
|
||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
ushort port;
|
ushort port;
|
||||||
@@ -163,28 +163,24 @@ struct PHB {
|
|||||||
#ifdef INKERNEL
|
#ifdef INKERNEL
|
||||||
WORD source;
|
WORD source;
|
||||||
#else
|
#else
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
ushort source; /* Complete source */
|
ushort source; /* Complete source */
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
unsigned char unit; /* Source unit */
|
unsigned char unit; /* Source unit */
|
||||||
unsigned char port; /* Source port */
|
unsigned char port; /* Source port */
|
||||||
} s2;
|
} s2;
|
||||||
} u2;
|
} u2;
|
||||||
#endif
|
#endif
|
||||||
WORD handshake ;
|
WORD handshake;
|
||||||
WORD status ;
|
WORD status;
|
||||||
NUMBER timeout ; /* Maximum of 1.9 seconds */
|
NUMBER timeout; /* Maximum of 1.9 seconds */
|
||||||
WORD link ; /* Send down this link */
|
WORD link; /* Send down this link */
|
||||||
#ifdef INKERNEL
|
#ifdef INKERNEL
|
||||||
WORD destination;
|
WORD destination;
|
||||||
#else
|
#else
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
ushort destination; /* Complete destination */
|
ushort destination; /* Complete destination */
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
unsigned char unit; /* Destination unit */
|
unsigned char unit; /* Destination unit */
|
||||||
unsigned char port; /* Destination port */
|
unsigned char port; /* Destination port */
|
||||||
} s1;
|
} s1;
|
||||||
@@ -193,39 +189,36 @@ struct PHB {
|
|||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
ushort tx_pkts_added;
|
ushort tx_pkts_added;
|
||||||
ushort tx_pkts_removed;
|
ushort tx_pkts_removed;
|
||||||
Q_BUF_ptr tx_q_start ; /* Start of the Q list chain */
|
Q_BUF_ptr tx_q_start; /* Start of the Q list chain */
|
||||||
short num_tx_q_bufs ; /* Number of Q buffers in the chain */
|
short num_tx_q_bufs; /* Number of Q buffers in the chain */
|
||||||
PKT_ptr_ptr tx_add ; /* Add a new Packet here */
|
PKT_ptr_ptr tx_add; /* Add a new Packet here */
|
||||||
Q_BUF_ptr tx_add_qb; /* Pointer to the add Q buf */
|
Q_BUF_ptr tx_add_qb; /* Pointer to the add Q buf */
|
||||||
PKT_ptr_ptr tx_add_st_qbb ; /* Pointer to start of the Q's buf */
|
PKT_ptr_ptr tx_add_st_qbb; /* Pointer to start of the Q's buf */
|
||||||
PKT_ptr_ptr tx_add_end_qbb ; /* Pointer to the end of the Q's buf */
|
PKT_ptr_ptr tx_add_end_qbb; /* Pointer to the end of the Q's buf */
|
||||||
PKT_ptr_ptr tx_remove ; /* Remove a Packet here */
|
PKT_ptr_ptr tx_remove; /* Remove a Packet here */
|
||||||
Q_BUF_ptr tx_remove_qb ; /* Pointer to the remove Q buf */
|
Q_BUF_ptr tx_remove_qb; /* Pointer to the remove Q buf */
|
||||||
PKT_ptr_ptr tx_remove_st_qbb ; /* Pointer to the start of the Q buf */
|
PKT_ptr_ptr tx_remove_st_qbb; /* Pointer to the start of the Q buf */
|
||||||
PKT_ptr_ptr tx_remove_end_qbb ; /* Pointer to the end of the Q buf */
|
PKT_ptr_ptr tx_remove_end_qbb; /* Pointer to the end of the Q buf */
|
||||||
#endif
|
#endif
|
||||||
#ifdef INKERNEL
|
#ifdef INKERNEL
|
||||||
PKT_ptr_ptr tx_start ;
|
PKT_ptr_ptr tx_start;
|
||||||
PKT_ptr_ptr tx_end ;
|
PKT_ptr_ptr tx_end;
|
||||||
PKT_ptr_ptr tx_add ;
|
PKT_ptr_ptr tx_add;
|
||||||
PKT_ptr_ptr tx_remove ;
|
PKT_ptr_ptr tx_remove;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HOST
|
#ifdef HOST
|
||||||
union
|
union {
|
||||||
{
|
struct {
|
||||||
struct
|
|
||||||
{
|
|
||||||
PKT_ptr_ptr tx_start_ptr_ptr;
|
PKT_ptr_ptr tx_start_ptr_ptr;
|
||||||
PKT_ptr_ptr tx_end_ptr_ptr;
|
PKT_ptr_ptr tx_end_ptr_ptr;
|
||||||
PKT_ptr_ptr tx_add_ptr_ptr;
|
PKT_ptr_ptr tx_add_ptr_ptr;
|
||||||
PKT_ptr_ptr tx_remove_ptr_ptr;
|
PKT_ptr_ptr tx_remove_ptr_ptr;
|
||||||
} s1;
|
} s1;
|
||||||
struct
|
struct {
|
||||||
{
|
ushort *tx_start_ptr;
|
||||||
ushort * tx_start_ptr;
|
ushort *tx_end_ptr;
|
||||||
ushort * tx_end_ptr;
|
ushort *tx_add_ptr;
|
||||||
ushort * tx_add_ptr;
|
ushort *tx_remove_ptr;
|
||||||
ushort * tx_remove_ptr;
|
|
||||||
} s2;
|
} s2;
|
||||||
} u3;
|
} u3;
|
||||||
#endif
|
#endif
|
||||||
@@ -233,39 +226,36 @@ struct PHB {
|
|||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
ushort rx_pkts_added;
|
ushort rx_pkts_added;
|
||||||
ushort rx_pkts_removed;
|
ushort rx_pkts_removed;
|
||||||
Q_BUF_ptr rx_q_start ; /* Start of the Q list chain */
|
Q_BUF_ptr rx_q_start; /* Start of the Q list chain */
|
||||||
short num_rx_q_bufs ; /* Number of Q buffers in the chain */
|
short num_rx_q_bufs; /* Number of Q buffers in the chain */
|
||||||
PKT_ptr_ptr rx_add ; /* Add a new Packet here */
|
PKT_ptr_ptr rx_add; /* Add a new Packet here */
|
||||||
Q_BUF_ptr rx_add_qb ; /* Pointer to the add Q buf */
|
Q_BUF_ptr rx_add_qb; /* Pointer to the add Q buf */
|
||||||
PKT_ptr_ptr rx_add_st_qbb ; /* Pointer to start of the Q's buf */
|
PKT_ptr_ptr rx_add_st_qbb; /* Pointer to start of the Q's buf */
|
||||||
PKT_ptr_ptr rx_add_end_qbb ; /* Pointer to the end of the Q's buf */
|
PKT_ptr_ptr rx_add_end_qbb; /* Pointer to the end of the Q's buf */
|
||||||
PKT_ptr_ptr rx_remove ; /* Remove a Packet here */
|
PKT_ptr_ptr rx_remove; /* Remove a Packet here */
|
||||||
Q_BUF_ptr rx_remove_qb ; /* Pointer to the remove Q buf */
|
Q_BUF_ptr rx_remove_qb; /* Pointer to the remove Q buf */
|
||||||
PKT_ptr_ptr rx_remove_st_qbb ; /* Pointer to the start of the Q buf */
|
PKT_ptr_ptr rx_remove_st_qbb; /* Pointer to the start of the Q buf */
|
||||||
PKT_ptr_ptr rx_remove_end_qbb ; /* Pointer to the end of the Q buf */
|
PKT_ptr_ptr rx_remove_end_qbb; /* Pointer to the end of the Q buf */
|
||||||
#endif
|
#endif
|
||||||
#ifdef INKERNEL
|
#ifdef INKERNEL
|
||||||
PKT_ptr_ptr rx_start ;
|
PKT_ptr_ptr rx_start;
|
||||||
PKT_ptr_ptr rx_end ;
|
PKT_ptr_ptr rx_end;
|
||||||
PKT_ptr_ptr rx_add ;
|
PKT_ptr_ptr rx_add;
|
||||||
PKT_ptr_ptr rx_remove ;
|
PKT_ptr_ptr rx_remove;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HOST
|
#ifdef HOST
|
||||||
union
|
union {
|
||||||
{
|
struct {
|
||||||
struct
|
|
||||||
{
|
|
||||||
PKT_ptr_ptr rx_start_ptr_ptr;
|
PKT_ptr_ptr rx_start_ptr_ptr;
|
||||||
PKT_ptr_ptr rx_end_ptr_ptr;
|
PKT_ptr_ptr rx_end_ptr_ptr;
|
||||||
PKT_ptr_ptr rx_add_ptr_ptr;
|
PKT_ptr_ptr rx_add_ptr_ptr;
|
||||||
PKT_ptr_ptr rx_remove_ptr_ptr;
|
PKT_ptr_ptr rx_remove_ptr_ptr;
|
||||||
} s1;
|
} s1;
|
||||||
struct
|
struct {
|
||||||
{
|
ushort *rx_start_ptr;
|
||||||
ushort * rx_start_ptr;
|
ushort *rx_end_ptr;
|
||||||
ushort * rx_end_ptr;
|
ushort *rx_add_ptr;
|
||||||
ushort * rx_add_ptr;
|
ushort *rx_remove_ptr;
|
||||||
ushort * rx_remove_ptr;
|
|
||||||
} s2;
|
} s2;
|
||||||
} u4;
|
} u4;
|
||||||
#endif
|
#endif
|
||||||
@@ -285,9 +275,8 @@ struct PHB {
|
|||||||
ushort MonitorTstate; /* TRUE if monitoring tstop */
|
ushort MonitorTstate; /* TRUE if monitoring tstop */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} ;
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -71,50 +71,42 @@
|
|||||||
|
|
||||||
struct PKT {
|
struct PKT {
|
||||||
#ifdef INKERNEL
|
#ifdef INKERNEL
|
||||||
BYTE dest_unit ; /* Destination Unit Id */
|
BYTE dest_unit; /* Destination Unit Id */
|
||||||
BYTE dest_port ; /* Destination POrt */
|
BYTE dest_port; /* Destination POrt */
|
||||||
BYTE src_unit ; /* Source Unit Id */
|
BYTE src_unit; /* Source Unit Id */
|
||||||
BYTE src_port ; /* Source POrt */
|
BYTE src_port; /* Source POrt */
|
||||||
#else
|
#else
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
ushort destination; /* Complete destination */
|
ushort destination; /* Complete destination */
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
unsigned char unit; /* Destination unit */
|
unsigned char unit; /* Destination unit */
|
||||||
unsigned char port; /* Destination port */
|
unsigned char port; /* Destination port */
|
||||||
} s1;
|
} s1;
|
||||||
} u1;
|
} u1;
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
ushort source; /* Complete source */
|
ushort source; /* Complete source */
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
unsigned char unit; /* Source unit */
|
unsigned char unit; /* Source unit */
|
||||||
unsigned char port; /* Source port */
|
unsigned char port; /* Source port */
|
||||||
} s2;
|
} s2;
|
||||||
} u2;
|
} u2;
|
||||||
#endif
|
#endif
|
||||||
#ifdef INKERNEL
|
#ifdef INKERNEL
|
||||||
BYTE len ;
|
BYTE len;
|
||||||
BYTE control;
|
BYTE control;
|
||||||
#else
|
#else
|
||||||
union
|
union {
|
||||||
{
|
|
||||||
ushort control;
|
ushort control;
|
||||||
struct
|
struct {
|
||||||
{
|
|
||||||
unsigned char len;
|
unsigned char len;
|
||||||
unsigned char control;
|
unsigned char control;
|
||||||
} s3;
|
} s3;
|
||||||
} u3;
|
} u3;
|
||||||
#endif
|
#endif
|
||||||
BYTE data[PKT_MAX_DATA_LEN] ;
|
BYTE data[PKT_MAX_DATA_LEN];
|
||||||
/* Actual data :-) */
|
/* Actual data :-) */
|
||||||
WORD csum ; /* C-SUM */
|
WORD csum; /* C-SUM */
|
||||||
} ;
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_poll_h_sccs = "@(#)poll.h 1.2" ;
|
static char *_rio_poll_h_sccs = "@(#)poll.h 1.2";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -71,6 +71,3 @@ static char *_rio_poll_h_sccs = "@(#)poll.h 1.2" ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -46,8 +46,7 @@ static char *_port_h_sccs_ = "@(#)port.h 1.3";
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
struct RIOStats
|
struct RIOStats {
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
** interrupt statistics
|
** interrupt statistics
|
||||||
*/
|
*/
|
||||||
@@ -91,8 +90,7 @@ struct RIOStats
|
|||||||
/*
|
/*
|
||||||
** Port data structure
|
** Port data structure
|
||||||
*/
|
*/
|
||||||
struct Port
|
struct Port {
|
||||||
{
|
|
||||||
struct gs_port gs;
|
struct gs_port gs;
|
||||||
int PortNum; /* RIO port no., 0-511 */
|
int PortNum; /* RIO port no., 0-511 */
|
||||||
struct Host *HostP;
|
struct Host *HostP;
|
||||||
@@ -177,8 +175,7 @@ struct Port
|
|||||||
/*
|
/*
|
||||||
** Transparent print stuff
|
** Transparent print stuff
|
||||||
*/
|
*/
|
||||||
struct Xprint
|
struct Xprint {
|
||||||
{
|
|
||||||
#ifndef MAX_XP_CTRL_LEN
|
#ifndef MAX_XP_CTRL_LEN
|
||||||
#define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */
|
#define MAX_XP_CTRL_LEN 16 /* ALSO IN DAEMON.H */
|
||||||
#endif
|
#endif
|
||||||
@@ -221,13 +218,12 @@ struct Port
|
|||||||
spinlock_t portSem; /* Lock using this sem */
|
spinlock_t portSem; /* Lock using this sem */
|
||||||
int MonitorTstate; /* Monitoring ? */
|
int MonitorTstate; /* Monitoring ? */
|
||||||
int timeout_id; /* For calling 100 ms delays */
|
int timeout_id; /* For calling 100 ms delays */
|
||||||
int timeout_sem;/* For calling 100 ms delays */
|
int timeout_sem; /* For calling 100 ms delays */
|
||||||
int firstOpen; /* First time open ? */
|
int firstOpen; /* First time open ? */
|
||||||
char * p; /* save the global struc here .. */
|
char *p; /* save the global struc here .. */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ModuleInfo
|
struct ModuleInfo {
|
||||||
{
|
|
||||||
char *Name;
|
char *Name;
|
||||||
uint Flags[4]; /* one per port on a module */
|
uint Flags[4]; /* one per port on a module */
|
||||||
};
|
};
|
||||||
|
@@ -23,15 +23,15 @@
|
|||||||
/*
|
/*
|
||||||
** boot.c
|
** boot.c
|
||||||
*/
|
*/
|
||||||
void init_boot( char *p, short stage);
|
void init_boot(char *p, short stage);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** disconct.c
|
** disconct.c
|
||||||
*/
|
*/
|
||||||
void kill_boot ( LPB *link );
|
void kill_boot(LPB * link);
|
||||||
void disconnected( LPB *link );
|
void disconnected(LPB * link);
|
||||||
short boot_3( LPB *link, PKT *pkt );
|
short boot_3(LPB * link, PKT * pkt);
|
||||||
short send_3_pkt( LPB *link, PKT *pkt);
|
short send_3_pkt(LPB * link, PKT * pkt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** error.c
|
** error.c
|
||||||
@@ -41,116 +41,116 @@ void du_error(void);
|
|||||||
/*
|
/*
|
||||||
** formpkt.c
|
** formpkt.c
|
||||||
*/
|
*/
|
||||||
ushort sum_it( PKT *pkt ) ;
|
ushort sum_it(PKT * pkt);
|
||||||
void form_rup_pkt( RUP *form_rup, PKT *pkt );
|
void form_rup_pkt(RUP * form_rup, PKT * pkt);
|
||||||
void form_poll_pkt ( int type, LPB *link, int node );
|
void form_poll_pkt(int type, LPB * link, int node);
|
||||||
void form_route_pkt ( int type, PKT *pkt, LPB *link );
|
void form_route_pkt(int type, PKT * pkt, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** idle.c
|
** idle.c
|
||||||
*/
|
*/
|
||||||
void idle( Process *idle_p );
|
void idle(Process * idle_p);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** init.c
|
** init.c
|
||||||
*/
|
*/
|
||||||
void general_init(void);
|
void general_init(void);
|
||||||
void mem_halt( int error);
|
void mem_halt(int error);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** linkinit.c
|
** linkinit.c
|
||||||
*/
|
*/
|
||||||
void initlink( u_short number, LPB *link);
|
void initlink(u_short number, LPB * link);
|
||||||
void runlink( LPB *link);
|
void runlink(LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** list.c
|
** list.c
|
||||||
*/
|
*/
|
||||||
PKT *get_free_start(void);
|
PKT *get_free_start(void);
|
||||||
void put_free_start( PKT *pkt);
|
void put_free_start(PKT * pkt);
|
||||||
|
|
||||||
#ifdef HOST
|
#ifdef HOST
|
||||||
int can_remove_transmit ( PKT **pkt, PKT *pointer );
|
int can_remove_transmit(PKT ** pkt, PKT * pointer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
int spl7 ( void );
|
int spl7(void);
|
||||||
int spl0 ( void );
|
int spl0(void);
|
||||||
Q_BUF *get_free_q( void );
|
Q_BUF *get_free_q(void);
|
||||||
PKT *get_free_end(void);
|
PKT *get_free_end(void);
|
||||||
int add_end( PKT *pkt, PHB *phb, int type);
|
int add_end(PKT * pkt, PHB * phb, int type);
|
||||||
unsigned short free_packets( PHB *phb, int type);
|
unsigned short free_packets(PHB * phb, int type);
|
||||||
int can_remove_start( PKT **pkt, PHB *phb, int type);
|
int can_remove_start(PKT ** pkt, PHB * phb, int type);
|
||||||
int can_add_start( PHB *phb, int type);
|
int can_add_start(PHB * phb, int type);
|
||||||
int can_add_end( PHB *phb, int type);
|
int can_add_end(PHB * phb, int type);
|
||||||
void put_free_end( PKT *pkt);
|
void put_free_end(PKT * pkt);
|
||||||
int remove_start( PKT **pkt, PHB *phb, int type);
|
int remove_start(PKT ** pkt, PHB * phb, int type);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Lrt.c
|
** Lrt.c
|
||||||
*/
|
*/
|
||||||
void lrt( Process *lrt_p, LPB *link );
|
void lrt(Process * lrt_p, LPB * link);
|
||||||
|
|
||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
void set_led_red ( LPB *link );
|
void set_led_red(LPB * link);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** ltt.c
|
** ltt.c
|
||||||
*/
|
*/
|
||||||
void ltt( Process *ltt_p, LPB *link, PHB *phb_ptr[] );
|
void ltt(Process * ltt_p, LPB * link, PHB * phb_ptr[]);
|
||||||
void send_poll ( LPB *link );
|
void send_poll(LPB * link);
|
||||||
void request_id ( LPB *link );
|
void request_id(LPB * link);
|
||||||
void send_topology_update ( LPB *link );
|
void send_topology_update(LPB * link);
|
||||||
void send_topology ( LPB *link );
|
void send_topology(LPB * link);
|
||||||
void supply_id ( LPB *link );
|
void supply_id(LPB * link);
|
||||||
|
|
||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
void redirect_queue ( LPB *link, ushort flush );
|
void redirect_queue(LPB * link, ushort flush);
|
||||||
int obtain_rup ( int rup_number, PKT **pkt_address, LPB *link );
|
int obtain_rup(int rup_number, PKT ** pkt_address, LPB * link);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef TESTING_PERF
|
#ifdef TESTING_PERF
|
||||||
int consume_cpu( void );
|
int consume_cpu(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** lttwake.c
|
** lttwake.c
|
||||||
*/
|
*/
|
||||||
#ifdef HOST
|
#ifdef HOST
|
||||||
void ltt_wakeup( Process *ltt_wakeup_p );
|
void ltt_wakeup(Process * ltt_wakeup_p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** mapgen.c
|
** mapgen.c
|
||||||
*/
|
*/
|
||||||
void generate_id_map( short mapping, ROUTE_STR route[] );
|
void generate_id_map(short mapping, ROUTE_STR route[]);
|
||||||
void gen_map( int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl );
|
void gen_map(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
|
||||||
void adjust_ttl( int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
|
void adjust_ttl(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
|
||||||
void init_sys_map(void);
|
void init_sys_map(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** mmu.c
|
** mmu.c
|
||||||
*/
|
*/
|
||||||
char *rio_malloc( unsigned int amount);
|
char *rio_malloc(unsigned int amount);
|
||||||
char *rio_calloc( unsigned int num, unsigned int size);
|
char *rio_calloc(unsigned int num, unsigned int size);
|
||||||
ERROR rio_mmu_init( uint total_mem );
|
ERROR rio_mmu_init(uint total_mem);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** partn.c
|
** partn.c
|
||||||
*/
|
*/
|
||||||
void partition_tx( struct PHB *phb, u_short tx_size, u_short rx_size, u_short rx_limit);
|
void partition_tx(struct PHB *phb, u_short tx_size, u_short rx_size, u_short rx_limit);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** poll.c
|
** poll.c
|
||||||
*/
|
*/
|
||||||
void tx_poll( Process *tx_poll_p);
|
void tx_poll(Process * tx_poll_p);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** process.c
|
** process.c
|
||||||
*/
|
*/
|
||||||
int get_proc_space( Process **pd, int **pws, int wssize);
|
int get_proc_space(Process ** pd, int **pws, int wssize);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** readrom.c
|
** readrom.c
|
||||||
@@ -160,12 +160,12 @@ void read_serial_number(char *buf);
|
|||||||
/*
|
/*
|
||||||
** rio.c
|
** rio.c
|
||||||
*/
|
*/
|
||||||
int main( void );
|
int main(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** route.c
|
** route.c
|
||||||
*/
|
*/
|
||||||
void route_update ( PKT *pkt, LPB *link);
|
void route_update(PKT * pkt, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** rtainit.c
|
** rtainit.c
|
||||||
@@ -177,68 +177,68 @@ void rta_init(ushort RtaType);
|
|||||||
/*
|
/*
|
||||||
** rupboot.c
|
** rupboot.c
|
||||||
*/
|
*/
|
||||||
void rup_boot( PKT *pkt, RUP *this_rup, LPB *link);
|
void rup_boot(PKT * pkt, RUP * this_rup, LPB * link);
|
||||||
|
|
||||||
#ifdef RTA
|
#ifdef RTA
|
||||||
void kill_your_neighbour( int link_to_kill );
|
void kill_your_neighbour(int link_to_kill);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** rupcmd.c
|
** rupcmd.c
|
||||||
*/
|
*/
|
||||||
void rup_command( PKT *pkt, struct RUP *this_rup, LPB *link);
|
void rup_command(PKT * pkt, struct RUP *this_rup, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** ruperr.c
|
** ruperr.c
|
||||||
*/
|
*/
|
||||||
void rup_error( PKT *pkt, RUP *this_rup, LPB *link );
|
void rup_error(PKT * pkt, RUP * this_rup, LPB * link);
|
||||||
void illegal_cmd( PKT *src_pkt );
|
void illegal_cmd(PKT * src_pkt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** ruppoll.c
|
** ruppoll.c
|
||||||
*/
|
*/
|
||||||
void rup_poll( PKT *pkt, RUP *this_rup, LPB *link );
|
void rup_poll(PKT * pkt, RUP * this_rup, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** ruppower.c
|
** ruppower.c
|
||||||
*/
|
*/
|
||||||
void rup_power( PKT *pkt, RUP *this_rup, LPB *link );
|
void rup_power(PKT * pkt, RUP * this_rup, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** ruprm.c
|
** ruprm.c
|
||||||
*/
|
*/
|
||||||
void rup_route_map( PKT *pkt, RUP *this_rup, LPB *link);
|
void rup_route_map(PKT * pkt, RUP * this_rup, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** rupstat.c
|
** rupstat.c
|
||||||
*/
|
*/
|
||||||
void rup_status( PKT *pkt, RUP *this_rup, LPB *link);
|
void rup_status(PKT * pkt, RUP * this_rup, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** rupsync.c
|
** rupsync.c
|
||||||
*/
|
*/
|
||||||
void rup_sync( PKT *pkt);
|
void rup_sync(PKT * pkt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** rxpkt.c
|
** rxpkt.c
|
||||||
*/
|
*/
|
||||||
ERROR rx_pkt( PKT_ptr_ptr pkt_address, LPB *link);
|
ERROR rx_pkt(PKT_ptr_ptr pkt_address, LPB * link);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** sendsts.c
|
** sendsts.c
|
||||||
*/
|
*/
|
||||||
void send_status( PKT *requesting_pkt, RUP *this_rup);
|
void send_status(PKT * requesting_pkt, RUP * this_rup);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** serial.c
|
** serial.c
|
||||||
*/
|
*/
|
||||||
void assign_serial ( char *ser_in, char *ser_out);
|
void assign_serial(char *ser_in, char *ser_out);
|
||||||
int cmp_serial ( char *ser_1, char *ser_2);
|
int cmp_serial(char *ser_1, char *ser_2);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** txpkt.c
|
** txpkt.c
|
||||||
*/
|
*/
|
||||||
ERROR tx_pkt( PKT *pkt, LPB *link);
|
ERROR tx_pkt(PKT * pkt, LPB * link);
|
||||||
short send_sync( LPB *link);
|
short send_sync(LPB * link);
|
||||||
|
|
||||||
#endif /* _prototypes_h */
|
#endif /* _prototypes_h */
|
||||||
|
@@ -115,5 +115,3 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_qbuf_h_sccs = "@(#)qbuf.h 1.1" ;
|
static char *_rio_qbuf_h_sccs = "@(#)qbuf.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -52,16 +52,15 @@ static char *_rio_qbuf_h_sccs = "@(#)qbuf.h 1.1" ;
|
|||||||
#define PKTS_PER_BUFFER (220 / PKT_LENGTH)
|
#define PKTS_PER_BUFFER (220 / PKT_LENGTH)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct Q_BUF Q_BUF ;
|
typedef struct Q_BUF Q_BUF;
|
||||||
struct Q_BUF {
|
struct Q_BUF {
|
||||||
Q_BUF_ptr next ;
|
Q_BUF_ptr next;
|
||||||
Q_BUF_ptr prev ;
|
Q_BUF_ptr prev;
|
||||||
PKT_ptr buf[PKTS_PER_BUFFER] ;
|
PKT_ptr buf[PKTS_PER_BUFFER];
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -216,8 +216,7 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
|
|||||||
#define RIO_PRI (PZERO+10)
|
#define RIO_PRI (PZERO+10)
|
||||||
#define RIO_CLOSE_PRI PZERO-1 /* uninterruptible sleeps for close */
|
#define RIO_CLOSE_PRI PZERO-1 /* uninterruptible sleeps for close */
|
||||||
|
|
||||||
typedef struct DbInf
|
typedef struct DbInf {
|
||||||
{
|
|
||||||
uint Flag;
|
uint Flag;
|
||||||
char Name[8];
|
char Name[8];
|
||||||
} DbInf;
|
} DbInf;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -131,27 +131,27 @@ struct vpd_prom {
|
|||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_RIO_OLDPCI
|
#ifdef CONFIG_RIO_OLDPCI
|
||||||
static inline void *rio_memcpy_toio (void *dummy, void *dest, void *source, int n)
|
static inline void *rio_memcpy_toio(void *dummy, void *dest, void *source, int n)
|
||||||
{
|
{
|
||||||
char *dst = dest;
|
char *dst = dest;
|
||||||
char *src = source;
|
char *src = source;
|
||||||
|
|
||||||
while (n--) {
|
while (n--) {
|
||||||
writeb (*src++, dst++);
|
writeb(*src++, dst++);
|
||||||
(void) readb (dummy);
|
(void) readb(dummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline void *rio_memcpy_fromio (void *dest, void *source, int n)
|
static inline void *rio_memcpy_fromio(void *dest, void *source, int n)
|
||||||
{
|
{
|
||||||
char *dst = dest;
|
char *dst = dest;
|
||||||
char *src = source;
|
char *src = source;
|
||||||
|
|
||||||
while (n--)
|
while (n--)
|
||||||
*dst++ = readb (src++);
|
*dst++ = readb(src++);
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
@@ -184,4 +184,3 @@ static inline void *rio_memcpy_fromio (void *dest, void *source, int n)
|
|||||||
#define func_exit()
|
#define func_exit()
|
||||||
#define func_enter2()
|
#define func_enter2()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -83,17 +83,16 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2";
|
|||||||
static struct IdentifyRta IdRta;
|
static struct IdentifyRta IdRta;
|
||||||
static struct KillNeighbour KillUnit;
|
static struct KillNeighbour KillUnit;
|
||||||
|
|
||||||
int
|
int RIOFoadRta(struct Host *HostP, struct Map *MapP)
|
||||||
RIOFoadRta(struct Host *HostP, struct Map *MapP)
|
|
||||||
{
|
{
|
||||||
struct CmdBlk *CmdBlkP;
|
struct CmdBlk *CmdBlkP;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "FOAD RTA\n");
|
rio_dprintk(RIO_DEBUG_CMD, "FOAD RTA\n");
|
||||||
|
|
||||||
CmdBlkP = RIOGetCmdBlk();
|
CmdBlkP = RIOGetCmdBlk();
|
||||||
|
|
||||||
if ( !CmdBlkP ) {
|
if (!CmdBlkP) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "FOAD RTA: GetCmdBlk failed\n");
|
rio_dprintk(RIO_DEBUG_CMD, "FOAD RTA: GetCmdBlk failed\n");
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,24 +106,23 @@ RIOFoadRta(struct Host *HostP, struct Map *MapP)
|
|||||||
CmdBlkP->Packet.data[2] = IFOAD_MAGIC & 0xFF;
|
CmdBlkP->Packet.data[2] = IFOAD_MAGIC & 0xFF;
|
||||||
CmdBlkP->Packet.data[3] = (IFOAD_MAGIC >> 8) & 0xFF;
|
CmdBlkP->Packet.data[3] = (IFOAD_MAGIC >> 8) & 0xFF;
|
||||||
|
|
||||||
if ( RIOQueueCmdBlk( HostP, MapP->ID-1, CmdBlkP) == RIO_FAIL ) {
|
if (RIOQueueCmdBlk(HostP, MapP->ID - 1, CmdBlkP) == RIO_FAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "FOAD RTA: Failed to queue foad command\n");
|
rio_dprintk(RIO_DEBUG_CMD, "FOAD RTA: Failed to queue foad command\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int RIOZombieRta(struct Host *HostP, struct Map *MapP)
|
||||||
RIOZombieRta(struct Host *HostP, struct Map *MapP)
|
|
||||||
{
|
{
|
||||||
struct CmdBlk *CmdBlkP;
|
struct CmdBlk *CmdBlkP;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "ZOMBIE RTA\n");
|
rio_dprintk(RIO_DEBUG_CMD, "ZOMBIE RTA\n");
|
||||||
|
|
||||||
CmdBlkP = RIOGetCmdBlk();
|
CmdBlkP = RIOGetCmdBlk();
|
||||||
|
|
||||||
if ( !CmdBlkP ) {
|
if (!CmdBlkP) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "ZOMBIE RTA: GetCmdBlk failed\n");
|
rio_dprintk(RIO_DEBUG_CMD, "ZOMBIE RTA: GetCmdBlk failed\n");
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,32 +136,30 @@ RIOZombieRta(struct Host *HostP, struct Map *MapP)
|
|||||||
CmdBlkP->Packet.data[2] = ZOMBIE_MAGIC & 0xFF;
|
CmdBlkP->Packet.data[2] = ZOMBIE_MAGIC & 0xFF;
|
||||||
CmdBlkP->Packet.data[3] = (ZOMBIE_MAGIC >> 8) & 0xFF;
|
CmdBlkP->Packet.data[3] = (ZOMBIE_MAGIC >> 8) & 0xFF;
|
||||||
|
|
||||||
if ( RIOQueueCmdBlk( HostP, MapP->ID-1, CmdBlkP) == RIO_FAIL ) {
|
if (RIOQueueCmdBlk(HostP, MapP->ID - 1, CmdBlkP) == RIO_FAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "ZOMBIE RTA: Failed to queue zombie command\n");
|
rio_dprintk(RIO_DEBUG_CMD, "ZOMBIE RTA: Failed to queue zombie command\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int RIOCommandRta(struct rio_info *p, uint RtaUnique, int (*func) (struct Host * HostP, struct Map * MapP))
|
||||||
RIOCommandRta(struct rio_info *p, uint RtaUnique,
|
|
||||||
int (* func)(struct Host *HostP, struct Map *MapP))
|
|
||||||
{
|
{
|
||||||
uint Host;
|
uint Host;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Command RTA 0x%x func 0x%x\n", RtaUnique, (int)func);
|
rio_dprintk(RIO_DEBUG_CMD, "Command RTA 0x%x func 0x%x\n", RtaUnique, (int) func);
|
||||||
|
|
||||||
if ( !RtaUnique )
|
if (!RtaUnique)
|
||||||
return(0);
|
return (0);
|
||||||
|
|
||||||
for ( Host = 0; Host < p->RIONumHosts; Host++ ) {
|
for (Host = 0; Host < p->RIONumHosts; Host++) {
|
||||||
uint Rta;
|
uint Rta;
|
||||||
struct Host *HostP = &p->RIOHosts[Host];
|
struct Host *HostP = &p->RIOHosts[Host];
|
||||||
|
|
||||||
for ( Rta = 0; Rta < RTAS_PER_HOST; Rta++ ) {
|
for (Rta = 0; Rta < RTAS_PER_HOST; Rta++) {
|
||||||
struct Map *MapP = &HostP->Mapping[Rta];
|
struct Map *MapP = &HostP->Mapping[Rta];
|
||||||
|
|
||||||
if ( MapP->RtaUniqueNum == RtaUnique ) {
|
if (MapP->RtaUniqueNum == RtaUnique) {
|
||||||
uint Link;
|
uint Link;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -173,12 +169,12 @@ RIOCommandRta(struct rio_info *p, uint RtaUnique,
|
|||||||
** route *somewhere*. We care not where - if its got
|
** route *somewhere*. We care not where - if its got
|
||||||
** any connections, we can get to it.
|
** any connections, we can get to it.
|
||||||
*/
|
*/
|
||||||
for ( Link = 0; Link < LINKS_PER_UNIT; Link++ ) {
|
for (Link = 0; Link < LINKS_PER_UNIT; Link++) {
|
||||||
if ( MapP->Topology[Link].Unit <= (uchar)MAX_RUP ) {
|
if (MapP->Topology[Link].Unit <= (uchar) MAX_RUP) {
|
||||||
/*
|
/*
|
||||||
** Its worth trying the operation...
|
** Its worth trying the operation...
|
||||||
*/
|
*/
|
||||||
return (*func)( HostP, MapP );
|
return (*func) (HostP, MapP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -188,25 +184,24 @@ RIOCommandRta(struct rio_info *p, uint RtaUnique,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int RIOIdentifyRta(struct rio_info *p, caddr_t arg)
|
||||||
RIOIdentifyRta(struct rio_info *p, caddr_t arg)
|
|
||||||
{
|
{
|
||||||
uint Host;
|
uint Host;
|
||||||
|
|
||||||
if ( copyin( (int)arg, (caddr_t)&IdRta, sizeof(IdRta) ) == COPYFAIL ) {
|
if (copyin((int) arg, (caddr_t) & IdRta, sizeof(IdRta)) == COPYFAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "RIO_IDENTIFY_RTA copy failed\n");
|
rio_dprintk(RIO_DEBUG_CMD, "RIO_IDENTIFY_RTA copy failed\n");
|
||||||
p->RIOError.Error = COPYIN_FAILED;
|
p->RIOError.Error = COPYIN_FAILED;
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( Host = 0 ; Host < p->RIONumHosts; Host++ ) {
|
for (Host = 0; Host < p->RIONumHosts; Host++) {
|
||||||
uint Rta;
|
uint Rta;
|
||||||
struct Host *HostP = &p->RIOHosts[Host];
|
struct Host *HostP = &p->RIOHosts[Host];
|
||||||
|
|
||||||
for ( Rta = 0; Rta < RTAS_PER_HOST; Rta++ ) {
|
for (Rta = 0; Rta < RTAS_PER_HOST; Rta++) {
|
||||||
struct Map *MapP = &HostP->Mapping[Rta];
|
struct Map *MapP = &HostP->Mapping[Rta];
|
||||||
|
|
||||||
if ( MapP->RtaUniqueNum == IdRta.RtaUnique ) {
|
if (MapP->RtaUniqueNum == IdRta.RtaUnique) {
|
||||||
uint Link;
|
uint Link;
|
||||||
/*
|
/*
|
||||||
** now, lets just check we have a route to it...
|
** now, lets just check we have a route to it...
|
||||||
@@ -215,19 +210,19 @@ RIOIdentifyRta(struct rio_info *p, caddr_t arg)
|
|||||||
** route *somewhere*. We care not where - if its got
|
** route *somewhere*. We care not where - if its got
|
||||||
** any connections, we can get to it.
|
** any connections, we can get to it.
|
||||||
*/
|
*/
|
||||||
for ( Link = 0; Link < LINKS_PER_UNIT; Link++ ) {
|
for (Link = 0; Link < LINKS_PER_UNIT; Link++) {
|
||||||
if ( MapP->Topology[Link].Unit <= (uchar)MAX_RUP ) {
|
if (MapP->Topology[Link].Unit <= (uchar) MAX_RUP) {
|
||||||
/*
|
/*
|
||||||
** Its worth trying the operation...
|
** Its worth trying the operation...
|
||||||
*/
|
*/
|
||||||
struct CmdBlk *CmdBlkP;
|
struct CmdBlk *CmdBlkP;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "IDENTIFY RTA\n");
|
rio_dprintk(RIO_DEBUG_CMD, "IDENTIFY RTA\n");
|
||||||
|
|
||||||
CmdBlkP = RIOGetCmdBlk();
|
CmdBlkP = RIOGetCmdBlk();
|
||||||
|
|
||||||
if ( !CmdBlkP ) {
|
if (!CmdBlkP) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "IDENTIFY RTA: GetCmdBlk failed\n");
|
rio_dprintk(RIO_DEBUG_CMD, "IDENTIFY RTA: GetCmdBlk failed\n");
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,8 +235,8 @@ RIOIdentifyRta(struct rio_info *p, caddr_t arg)
|
|||||||
CmdBlkP->Packet.data[1] = 0;
|
CmdBlkP->Packet.data[1] = 0;
|
||||||
CmdBlkP->Packet.data[2] = IdRta.ID;
|
CmdBlkP->Packet.data[2] = IdRta.ID;
|
||||||
|
|
||||||
if ( RIOQueueCmdBlk( HostP, MapP->ID-1, CmdBlkP) == RIO_FAIL ) {
|
if (RIOQueueCmdBlk(HostP, MapP->ID - 1, CmdBlkP) == RIO_FAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "IDENTIFY RTA: Failed to queue command\n");
|
rio_dprintk(RIO_DEBUG_CMD, "IDENTIFY RTA: Failed to queue command\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -254,29 +249,28 @@ RIOIdentifyRta(struct rio_info *p, caddr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int RIOKillNeighbour(struct rio_info *p, caddr_t arg)
|
||||||
RIOKillNeighbour(struct rio_info *p, caddr_t arg)
|
|
||||||
{
|
{
|
||||||
uint Host;
|
uint Host;
|
||||||
uint ID;
|
uint ID;
|
||||||
struct Host *HostP;
|
struct Host *HostP;
|
||||||
struct CmdBlk *CmdBlkP;
|
struct CmdBlk *CmdBlkP;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "KILL HOST NEIGHBOUR\n");
|
rio_dprintk(RIO_DEBUG_CMD, "KILL HOST NEIGHBOUR\n");
|
||||||
|
|
||||||
if ( copyin( (int)arg, (caddr_t)&KillUnit, sizeof(KillUnit) ) == COPYFAIL ) {
|
if (copyin((int) arg, (caddr_t) & KillUnit, sizeof(KillUnit)) == COPYFAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "RIO_KILL_NEIGHBOUR copy failed\n");
|
rio_dprintk(RIO_DEBUG_CMD, "RIO_KILL_NEIGHBOUR copy failed\n");
|
||||||
p->RIOError.Error = COPYIN_FAILED;
|
p->RIOError.Error = COPYIN_FAILED;
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( KillUnit.Link > 3 )
|
if (KillUnit.Link > 3)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
CmdBlkP = RIOGetCmdBlk();
|
CmdBlkP = RIOGetCmdBlk();
|
||||||
|
|
||||||
if ( !CmdBlkP ) {
|
if (!CmdBlkP) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "UFOAD: GetCmdBlk failed\n");
|
rio_dprintk(RIO_DEBUG_CMD, "UFOAD: GetCmdBlk failed\n");
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,45 +284,43 @@ RIOKillNeighbour(struct rio_info *p, caddr_t arg)
|
|||||||
CmdBlkP->Packet.data[2] = UFOAD_MAGIC & 0xFF;
|
CmdBlkP->Packet.data[2] = UFOAD_MAGIC & 0xFF;
|
||||||
CmdBlkP->Packet.data[3] = (UFOAD_MAGIC >> 8) & 0xFF;
|
CmdBlkP->Packet.data[3] = (UFOAD_MAGIC >> 8) & 0xFF;
|
||||||
|
|
||||||
for ( Host = 0; Host < p->RIONumHosts; Host++ ) {
|
for (Host = 0; Host < p->RIONumHosts; Host++) {
|
||||||
ID = 0;
|
ID = 0;
|
||||||
HostP = &p->RIOHosts[Host];
|
HostP = &p->RIOHosts[Host];
|
||||||
|
|
||||||
if ( HostP->UniqueNum == KillUnit.UniqueNum ) {
|
if (HostP->UniqueNum == KillUnit.UniqueNum) {
|
||||||
if ( RIOQueueCmdBlk( HostP, RTAS_PER_HOST+KillUnit.Link,
|
if (RIOQueueCmdBlk(HostP, RTAS_PER_HOST + KillUnit.Link, CmdBlkP) == RIO_FAIL) {
|
||||||
CmdBlkP) == RIO_FAIL ) {
|
rio_dprintk(RIO_DEBUG_CMD, "UFOAD: Failed queue command\n");
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "UFOAD: Failed queue command\n");
|
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( ID=0; ID < RTAS_PER_HOST; ID++ ) {
|
for (ID = 0; ID < RTAS_PER_HOST; ID++) {
|
||||||
if ( HostP->Mapping[ID].RtaUniqueNum == KillUnit.UniqueNum ) {
|
if (HostP->Mapping[ID].RtaUniqueNum == KillUnit.UniqueNum) {
|
||||||
CmdBlkP->Packet.dest_unit = ID+1;
|
CmdBlkP->Packet.dest_unit = ID + 1;
|
||||||
if ( RIOQueueCmdBlk( HostP, ID, CmdBlkP) == RIO_FAIL ) {
|
if (RIOQueueCmdBlk(HostP, ID, CmdBlkP) == RIO_FAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "UFOAD: Failed queue command\n");
|
rio_dprintk(RIO_DEBUG_CMD, "UFOAD: Failed queue command\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RIOFreeCmdBlk( CmdBlkP );
|
RIOFreeCmdBlk(CmdBlkP);
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int RIOSuspendBootRta(struct Host *HostP, int ID, int Link)
|
||||||
RIOSuspendBootRta(struct Host *HostP, int ID, int Link)
|
|
||||||
{
|
{
|
||||||
struct CmdBlk *CmdBlkP;
|
struct CmdBlk *CmdBlkP;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "SUSPEND BOOT ON RTA ID %d, link %c\n", ID, 'A' + Link);
|
rio_dprintk(RIO_DEBUG_CMD, "SUSPEND BOOT ON RTA ID %d, link %c\n", ID, 'A' + Link);
|
||||||
|
|
||||||
CmdBlkP = RIOGetCmdBlk();
|
CmdBlkP = RIOGetCmdBlk();
|
||||||
|
|
||||||
if ( !CmdBlkP ) {
|
if (!CmdBlkP) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "SUSPEND BOOT ON RTA: GetCmdBlk failed\n");
|
rio_dprintk(RIO_DEBUG_CMD, "SUSPEND BOOT ON RTA: GetCmdBlk failed\n");
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,21 +334,20 @@ RIOSuspendBootRta(struct Host *HostP, int ID, int Link)
|
|||||||
CmdBlkP->Packet.data[2] = IWAIT_MAGIC & 0xFF;
|
CmdBlkP->Packet.data[2] = IWAIT_MAGIC & 0xFF;
|
||||||
CmdBlkP->Packet.data[3] = (IWAIT_MAGIC >> 8) & 0xFF;
|
CmdBlkP->Packet.data[3] = (IWAIT_MAGIC >> 8) & 0xFF;
|
||||||
|
|
||||||
if ( RIOQueueCmdBlk( HostP, ID - 1, CmdBlkP) == RIO_FAIL ) {
|
if (RIOQueueCmdBlk(HostP, ID - 1, CmdBlkP) == RIO_FAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "SUSPEND BOOT ON RTA: Failed to queue iwait command\n");
|
rio_dprintk(RIO_DEBUG_CMD, "SUSPEND BOOT ON RTA: Failed to queue iwait command\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int RIOFoadWakeup(struct rio_info *p)
|
||||||
RIOFoadWakeup(struct rio_info *p)
|
|
||||||
{
|
{
|
||||||
int port;
|
int port;
|
||||||
register struct Port *PortP;
|
register struct Port *PortP;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
for ( port=0; port<RIO_PORTS; port++) {
|
for (port = 0; port < RIO_PORTS; port++) {
|
||||||
PortP = p->RIOPortp[port];
|
PortP = p->RIOPortp[port];
|
||||||
|
|
||||||
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
@@ -377,16 +368,15 @@ RIOFoadWakeup(struct rio_info *p)
|
|||||||
PortP->TxBufferOut = 0;
|
PortP->TxBufferOut = 0;
|
||||||
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
}
|
}
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Incoming command on the COMMAND_RUP to be processed.
|
** Incoming command on the COMMAND_RUP to be processed.
|
||||||
*/
|
*/
|
||||||
static int
|
static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
|
||||||
RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|
||||||
{
|
{
|
||||||
struct PktCmd *PktCmdP = (struct PktCmd *)PacketP->data;
|
struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data;
|
||||||
struct Port *PortP;
|
struct Port *PortP;
|
||||||
struct UnixRup *UnixRupP;
|
struct UnixRup *UnixRupP;
|
||||||
ushort SysPort;
|
ushort SysPort;
|
||||||
@@ -395,12 +385,12 @@ RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|||||||
ushort subCommand;
|
ushort subCommand;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
func_enter ();
|
func_enter();
|
||||||
|
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckHost( Host );
|
CheckHost(Host);
|
||||||
CheckHostP( HostP );
|
CheckHostP(HostP);
|
||||||
CheckPacketP( PacketP );
|
CheckPacketP(PacketP);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -411,88 +401,77 @@ RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|||||||
** we can use PhbNum to get the rup number for the appropriate 8 port
|
** we can use PhbNum to get the rup number for the appropriate 8 port
|
||||||
** block (for the first block, this should be equal to 'Rup').
|
** block (for the first block, this should be equal to 'Rup').
|
||||||
*/
|
*/
|
||||||
rup = RBYTE(PktCmdP->PhbNum) / (ushort)PORTS_PER_RTA;
|
rup = RBYTE(PktCmdP->PhbNum) / (ushort) PORTS_PER_RTA;
|
||||||
UnixRupP = &HostP->UnixRups[rup];
|
UnixRupP = &HostP->UnixRups[rup];
|
||||||
SysPort = UnixRupP->BaseSysPort +
|
SysPort = UnixRupP->BaseSysPort + (RBYTE(PktCmdP->PhbNum) % (ushort) PORTS_PER_RTA);
|
||||||
(RBYTE(PktCmdP->PhbNum) % (ushort)PORTS_PER_RTA);
|
rio_dprintk(RIO_DEBUG_CMD, "Command on rup %d, port %d\n", rup, SysPort);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Command on rup %d, port %d\n", rup, SysPort);
|
|
||||||
|
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckRup( rup );
|
CheckRup(rup);
|
||||||
CheckUnixRupP( UnixRupP );
|
CheckUnixRupP(UnixRupP);
|
||||||
#endif
|
#endif
|
||||||
if ( UnixRupP->BaseSysPort == NO_PORT ) {
|
if (UnixRupP->BaseSysPort == NO_PORT) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "OBSCURE ERROR!\n");
|
rio_dprintk(RIO_DEBUG_CMD, "OBSCURE ERROR!\n");
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Diagnostics follow. Please WRITE THESE DOWN and report them to Specialix Technical Support\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Diagnostics follow. Please WRITE THESE DOWN and report them to Specialix Technical Support\n");
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "CONTROL information: Host number %d, name ``%s''\n",
|
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: Host number %d, name ``%s''\n", HostP - p->RIOHosts, HostP->Name);
|
||||||
HostP-p->RIOHosts, HostP->Name );
|
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: Rup number 0x%x\n", rup);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "CONTROL information: Rup number 0x%x\n", rup);
|
|
||||||
|
|
||||||
if ( Rup >= (ushort)MAX_RUP ) {
|
if (Rup >= (ushort) MAX_RUP) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "CONTROL information: This is the RUP for RTA ``%s''\n",
|
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: This is the RUP for RTA ``%s''\n", HostP->Mapping[Rup].Name);
|
||||||
HostP->Mapping[Rup].Name);
|
|
||||||
} else
|
} else
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "CONTROL information: This is the RUP for link ``%c'' of host ``%s''\n",
|
rio_dprintk(RIO_DEBUG_CMD, "CONTROL information: This is the RUP for link ``%c'' of host ``%s''\n", ('A' + Rup - MAX_RUP), HostP->Name);
|
||||||
('A' + Rup - MAX_RUP), HostP->Name);
|
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Destination 0x%x:0x%x\n",
|
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Destination 0x%x:0x%x\n", PacketP->dest_unit, PacketP->dest_port);
|
||||||
PacketP->dest_unit, PacketP->dest_port );
|
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Source 0x%x:0x%x\n", PacketP->src_unit, PacketP->src_port);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Source 0x%x:0x%x\n",
|
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Length 0x%x (%d)\n", PacketP->len, PacketP->len);
|
||||||
PacketP->src_unit, PacketP->src_port );
|
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Length 0x%x (%d)\n", PacketP->len,PacketP->len );
|
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", PacketP->csum, PacketP->csum);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control);
|
rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", PacketP->csum, PacketP->csum );
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, "
|
|
||||||
"Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command );
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckSysPort( SysPort );
|
CheckSysPort(SysPort);
|
||||||
#endif
|
#endif
|
||||||
PortP = p->RIOPortp[ SysPort ];
|
PortP = p->RIOPortp[SysPort];
|
||||||
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
switch( RBYTE(PktCmdP->Command) ) {
|
switch (RBYTE(PktCmdP->Command)) {
|
||||||
case BREAK_RECEIVED:
|
case BREAK_RECEIVED:
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Received a break!\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Received a break!\n");
|
||||||
/* If the current line disc. is not multi-threading and
|
/* If the current line disc. is not multi-threading and
|
||||||
the current processor is not the default, reset rup_intr
|
the current processor is not the default, reset rup_intr
|
||||||
and return FALSE to ensure that the command packet is
|
and return FALSE to ensure that the command packet is
|
||||||
not freed. */
|
not freed. */
|
||||||
/* Call tmgr HANGUP HERE */
|
/* Call tmgr HANGUP HERE */
|
||||||
/* Fix this later when every thing works !!!! RAMRAJ */
|
/* Fix this later when every thing works !!!! RAMRAJ */
|
||||||
gs_got_break (&PortP->gs);
|
gs_got_break(&PortP->gs);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMPLETE:
|
case COMPLETE:
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Command complete on phb %d host %d\n",
|
rio_dprintk(RIO_DEBUG_CMD, "Command complete on phb %d host %d\n", RBYTE(PktCmdP->PhbNum), HostP - p->RIOHosts);
|
||||||
RBYTE(PktCmdP->PhbNum), HostP-p->RIOHosts);
|
|
||||||
subCommand = 1;
|
subCommand = 1;
|
||||||
switch (RBYTE(PktCmdP->SubCommand)) {
|
switch (RBYTE(PktCmdP->SubCommand)) {
|
||||||
case MEMDUMP :
|
case MEMDUMP:
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Memory dump cmd (0x%x) from addr 0x%x\n",
|
rio_dprintk(RIO_DEBUG_CMD, "Memory dump cmd (0x%x) from addr 0x%x\n", RBYTE(PktCmdP->SubCommand), RWORD(PktCmdP->SubAddr));
|
||||||
RBYTE(PktCmdP->SubCommand), RWORD(PktCmdP->SubAddr));
|
|
||||||
break;
|
break;
|
||||||
case READ_REGISTER :
|
case READ_REGISTER:
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Read register (0x%x)\n", RWORD(PktCmdP->SubAddr));
|
rio_dprintk(RIO_DEBUG_CMD, "Read register (0x%x)\n", RWORD(PktCmdP->SubAddr));
|
||||||
p->CdRegister = (RBYTE(PktCmdP->ModemStatus) & MSVR1_HOST);
|
p->CdRegister = (RBYTE(PktCmdP->ModemStatus) & MSVR1_HOST);
|
||||||
break;
|
break;
|
||||||
default :
|
default:
|
||||||
subCommand = 0;
|
subCommand = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (subCommand)
|
if (subCommand)
|
||||||
break;
|
break;
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "New status is 0x%x was 0x%x\n",
|
rio_dprintk(RIO_DEBUG_CMD, "New status is 0x%x was 0x%x\n", RBYTE(PktCmdP->PortStatus), PortP->PortState);
|
||||||
RBYTE(PktCmdP->PortStatus),PortP->PortState);
|
|
||||||
if (PortP->PortState != RBYTE(PktCmdP->PortStatus)) {
|
if (PortP->PortState != RBYTE(PktCmdP->PortStatus)) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Mark status & wakeup\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Mark status & wakeup\n");
|
||||||
PortP->PortState = RBYTE(PktCmdP->PortStatus);
|
PortP->PortState = RBYTE(PktCmdP->PortStatus);
|
||||||
/* What should we do here ...
|
/* What should we do here ...
|
||||||
wakeup( &PortP->PortState );
|
wakeup( &PortP->PortState );
|
||||||
*/
|
*/
|
||||||
} else
|
} else
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "No change\n");
|
rio_dprintk(RIO_DEBUG_CMD, "No change\n");
|
||||||
|
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case MODEM_STATUS:
|
case MODEM_STATUS:
|
||||||
@@ -502,21 +481,18 @@ RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|||||||
** it's a convenient place to put them!).
|
** it's a convenient place to put them!).
|
||||||
*/
|
*/
|
||||||
ReportedModemStatus = RBYTE(PktCmdP->ModemStatus);
|
ReportedModemStatus = RBYTE(PktCmdP->ModemStatus);
|
||||||
if ((PortP->ModemState & MSVR1_HOST) ==
|
if ((PortP->ModemState & MSVR1_HOST) == (ReportedModemStatus & MSVR1_HOST)) {
|
||||||
(ReportedModemStatus & MSVR1_HOST)) {
|
rio_dprintk(RIO_DEBUG_CMD, "Modem status unchanged 0x%x\n", PortP->ModemState);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Modem status unchanged 0x%x\n", PortP->ModemState);
|
|
||||||
/*
|
/*
|
||||||
** Update ModemState just in case tbusy or tstop states have
|
** Update ModemState just in case tbusy or tstop states have
|
||||||
** changed.
|
** changed.
|
||||||
*/
|
*/
|
||||||
PortP->ModemState = ReportedModemStatus;
|
PortP->ModemState = ReportedModemStatus;
|
||||||
}
|
} else {
|
||||||
else {
|
rio_dprintk(RIO_DEBUG_CMD, "Modem status change from 0x%x to 0x%x\n", PortP->ModemState, ReportedModemStatus);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Modem status change from 0x%x to 0x%x\n",
|
|
||||||
PortP->ModemState, ReportedModemStatus);
|
|
||||||
PortP->ModemState = ReportedModemStatus;
|
PortP->ModemState = ReportedModemStatus;
|
||||||
#ifdef MODEM_SUPPORT
|
#ifdef MODEM_SUPPORT
|
||||||
if ( PortP->Mapped ) {
|
if (PortP->Mapped) {
|
||||||
/***********************************************************\
|
/***********************************************************\
|
||||||
*************************************************************
|
*************************************************************
|
||||||
*** ***
|
*** ***
|
||||||
@@ -533,25 +509,24 @@ RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|||||||
if (PortP->gs.tty->termios == NULL)
|
if (PortP->gs.tty->termios == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(PortP->gs.tty->termios->c_cflag & CLOCAL) &&
|
if (!(PortP->gs.tty->termios->c_cflag & CLOCAL) && ((PortP->State & (RIO_MOPEN | RIO_WOPEN)))) {
|
||||||
((PortP->State & (RIO_MOPEN|RIO_WOPEN)))) {
|
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Is there a Carrier?\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Is there a Carrier?\n");
|
||||||
/*
|
/*
|
||||||
** Is there a carrier?
|
** Is there a carrier?
|
||||||
*/
|
*/
|
||||||
if ( PortP->ModemState & MSVR1_CD ) {
|
if (PortP->ModemState & MSVR1_CD) {
|
||||||
/*
|
/*
|
||||||
** Has carrier just appeared?
|
** Has carrier just appeared?
|
||||||
*/
|
*/
|
||||||
if (!(PortP->State & RIO_CARR_ON)) {
|
if (!(PortP->State & RIO_CARR_ON)) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Carrier just came up.\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Carrier just came up.\n");
|
||||||
PortP->State |= RIO_CARR_ON;
|
PortP->State |= RIO_CARR_ON;
|
||||||
/*
|
/*
|
||||||
** wakeup anyone in WOPEN
|
** wakeup anyone in WOPEN
|
||||||
*/
|
*/
|
||||||
if (PortP->State & (PORT_ISOPEN | RIO_WOPEN) )
|
if (PortP->State & (PORT_ISOPEN | RIO_WOPEN))
|
||||||
wake_up_interruptible (&PortP->gs.open_wait);
|
wake_up_interruptible(&PortP->gs.open_wait);
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
PortP->Stat.ModemOnCnt++;
|
PortP->Stat.ModemOnCnt++;
|
||||||
#endif
|
#endif
|
||||||
@@ -561,10 +536,10 @@ RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|||||||
** Has carrier just dropped?
|
** Has carrier just dropped?
|
||||||
*/
|
*/
|
||||||
if (PortP->State & RIO_CARR_ON) {
|
if (PortP->State & RIO_CARR_ON) {
|
||||||
if (PortP->State & (PORT_ISOPEN|RIO_WOPEN|RIO_MOPEN))
|
if (PortP->State & (PORT_ISOPEN | RIO_WOPEN | RIO_MOPEN))
|
||||||
tty_hangup (PortP->gs.tty);
|
tty_hangup(PortP->gs.tty);
|
||||||
PortP->State &= ~RIO_CARR_ON;
|
PortP->State &= ~RIO_CARR_ON;
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Carrirer just went down\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Carrirer just went down\n");
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
PortP->Stat.ModemOffCnt++;
|
PortP->Stat.ModemOffCnt++;
|
||||||
#endif
|
#endif
|
||||||
@@ -577,16 +552,16 @@ RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Unknown command %d on CMD_RUP of host %d\n",
|
rio_dprintk(RIO_DEBUG_CMD, "Unknown command %d on CMD_RUP of host %d\n", RBYTE(PktCmdP->Command), HostP - p->RIOHosts);
|
||||||
RBYTE(PktCmdP->Command),HostP-p->RIOHosts);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
|
|
||||||
func_exit ();
|
func_exit();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** The command mechanism:
|
** The command mechanism:
|
||||||
** Each rup has a chain of commands associated with it.
|
** Each rup has a chain of commands associated with it.
|
||||||
@@ -600,12 +575,11 @@ RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *PacketP)
|
|||||||
/*
|
/*
|
||||||
** Allocate an empty command block.
|
** Allocate an empty command block.
|
||||||
*/
|
*/
|
||||||
struct CmdBlk *
|
struct CmdBlk *RIOGetCmdBlk(void)
|
||||||
RIOGetCmdBlk(void)
|
|
||||||
{
|
{
|
||||||
struct CmdBlk *CmdBlkP;
|
struct CmdBlk *CmdBlkP;
|
||||||
|
|
||||||
CmdBlkP = (struct CmdBlk *)sysbrk(sizeof(struct CmdBlk));
|
CmdBlkP = (struct CmdBlk *) sysbrk(sizeof(struct CmdBlk));
|
||||||
if (CmdBlkP)
|
if (CmdBlkP)
|
||||||
bzero(CmdBlkP, sizeof(struct CmdBlk));
|
bzero(CmdBlkP, sizeof(struct CmdBlk));
|
||||||
|
|
||||||
@@ -615,31 +589,29 @@ RIOGetCmdBlk(void)
|
|||||||
/*
|
/*
|
||||||
** Return a block to the head of the free list.
|
** Return a block to the head of the free list.
|
||||||
*/
|
*/
|
||||||
void
|
void RIOFreeCmdBlk(struct CmdBlk *CmdBlkP)
|
||||||
RIOFreeCmdBlk(struct CmdBlk *CmdBlkP)
|
|
||||||
{
|
{
|
||||||
sysfree((void *)CmdBlkP, sizeof(struct CmdBlk));
|
sysfree((void *) CmdBlkP, sizeof(struct CmdBlk));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** attach a command block to the list of commands to be performed for
|
** attach a command block to the list of commands to be performed for
|
||||||
** a given rup.
|
** a given rup.
|
||||||
*/
|
*/
|
||||||
int
|
int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
|
||||||
RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
|
|
||||||
{
|
{
|
||||||
struct CmdBlk **Base;
|
struct CmdBlk **Base;
|
||||||
struct UnixRup *UnixRupP;
|
struct UnixRup *UnixRupP;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckHostP( HostP );
|
CheckHostP(HostP);
|
||||||
CheckRup( Rup );
|
CheckRup(Rup);
|
||||||
CheckCmdBlkP( CmdBlkP );
|
CheckCmdBlkP(CmdBlkP);
|
||||||
#endif
|
#endif
|
||||||
if ( Rup >= (ushort)(MAX_RUP+LINKS_PER_UNIT) ) {
|
if (Rup >= (ushort) (MAX_RUP + LINKS_PER_UNIT)) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Illegal rup number %d in RIOQueueCmdBlk\n",Rup);
|
rio_dprintk(RIO_DEBUG_CMD, "Illegal rup number %d in RIOQueueCmdBlk\n", Rup);
|
||||||
RIOFreeCmdBlk( CmdBlkP );
|
RIOFreeCmdBlk(CmdBlkP);
|
||||||
return RIO_FAIL;
|
return RIO_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -651,18 +623,14 @@ RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
|
|||||||
** If the RUP is currently inactive, then put the request
|
** If the RUP is currently inactive, then put the request
|
||||||
** straight on the RUP....
|
** straight on the RUP....
|
||||||
*/
|
*/
|
||||||
if ( (UnixRupP->CmdsWaitingP == NULL) && (UnixRupP->CmdPendingP == NULL) &&
|
if ((UnixRupP->CmdsWaitingP == NULL) && (UnixRupP->CmdPendingP == NULL) && (RWORD(UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE) && (CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP)
|
||||||
(RWORD(UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE ) &&
|
: TRUE)) {
|
||||||
(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP)(CmdBlkP->PreArg,CmdBlkP)
|
rio_dprintk(RIO_DEBUG_CMD, "RUP inactive-placing command straight on. Cmd byte is 0x%x\n", CmdBlkP->Packet.data[0]);
|
||||||
:TRUE)) {
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "RUP inactive-placing command straight on. Cmd byte is 0x%x\n",
|
|
||||||
CmdBlkP->Packet.data[0]);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Whammy! blat that pack!
|
** Whammy! blat that pack!
|
||||||
*/
|
*/
|
||||||
HostP->Copy( (caddr_t)&CmdBlkP->Packet,
|
HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT));
|
||||||
RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt ), sizeof(PKT) );
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** place command packet on the pending position.
|
** place command packet on the pending position.
|
||||||
@@ -672,33 +640,32 @@ RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
|
|||||||
/*
|
/*
|
||||||
** set the command register
|
** set the command register
|
||||||
*/
|
*/
|
||||||
WWORD(UnixRupP->RupP->txcontrol , TX_PACKET_READY);
|
WWORD(UnixRupP->RupP->txcontrol, TX_PACKET_READY);
|
||||||
|
|
||||||
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
||||||
|
|
||||||
return RIO_SUCCESS;
|
return RIO_SUCCESS;
|
||||||
}
|
}
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "RUP active - en-queing\n");
|
rio_dprintk(RIO_DEBUG_CMD, "RUP active - en-queing\n");
|
||||||
|
|
||||||
if ( UnixRupP->CmdsWaitingP != NULL)
|
if (UnixRupP->CmdsWaitingP != NULL)
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Rup active - command waiting\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Rup active - command waiting\n");
|
||||||
if ( UnixRupP->CmdPendingP != NULL )
|
if (UnixRupP->CmdPendingP != NULL)
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Rup active - command pending\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Rup active - command pending\n");
|
||||||
if ( RWORD(UnixRupP->RupP->txcontrol) != TX_RUP_INACTIVE )
|
if (RWORD(UnixRupP->RupP->txcontrol) != TX_RUP_INACTIVE)
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Rup active - command rup not ready\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Rup active - command rup not ready\n");
|
||||||
|
|
||||||
Base = &UnixRupP->CmdsWaitingP;
|
Base = &UnixRupP->CmdsWaitingP;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "First try to queue cmdblk 0x%x at 0x%x\n", (int)CmdBlkP,(int)Base);
|
rio_dprintk(RIO_DEBUG_CMD, "First try to queue cmdblk 0x%x at 0x%x\n", (int) CmdBlkP, (int) Base);
|
||||||
|
|
||||||
while ( *Base ) {
|
while (*Base) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Command cmdblk 0x%x here\n", (int)(*Base));
|
rio_dprintk(RIO_DEBUG_CMD, "Command cmdblk 0x%x here\n", (int) (*Base));
|
||||||
Base = &((*Base)->NextP);
|
Base = &((*Base)->NextP);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Now try to queue cmd cmdblk 0x%x at 0x%x\n",
|
rio_dprintk(RIO_DEBUG_CMD, "Now try to queue cmd cmdblk 0x%x at 0x%x\n", (int) CmdBlkP, (int) Base);
|
||||||
(int)CmdBlkP,(int)Base);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Will queue cmdblk 0x%x at 0x%x\n",(int)CmdBlkP,(int)Base);
|
rio_dprintk(RIO_DEBUG_CMD, "Will queue cmdblk 0x%x at 0x%x\n", (int) CmdBlkP, (int) Base);
|
||||||
|
|
||||||
*Base = CmdBlkP;
|
*Base = CmdBlkP;
|
||||||
|
|
||||||
@@ -713,8 +680,7 @@ RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
|
|||||||
** Here we go - if there is an empty rup, fill it!
|
** Here we go - if there is an empty rup, fill it!
|
||||||
** must be called at splrio() or higher.
|
** must be called at splrio() or higher.
|
||||||
*/
|
*/
|
||||||
void
|
void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
||||||
RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|
||||||
{
|
{
|
||||||
register struct CmdBlk *CmdBlkP;
|
register struct CmdBlk *CmdBlkP;
|
||||||
register struct UnixRup *UnixRupP;
|
register struct UnixRup *UnixRupP;
|
||||||
@@ -723,7 +689,7 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
|
||||||
Rup = MAX_RUP+LINKS_PER_UNIT;
|
Rup = MAX_RUP + LINKS_PER_UNIT;
|
||||||
|
|
||||||
do { /* do this loop for each RUP */
|
do { /* do this loop for each RUP */
|
||||||
/*
|
/*
|
||||||
@@ -736,20 +702,18 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
/*
|
/*
|
||||||
** First check for incoming commands:
|
** First check for incoming commands:
|
||||||
*/
|
*/
|
||||||
if ( RWORD(UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE ) {
|
if (RWORD(UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) {
|
||||||
int FreeMe;
|
int FreeMe;
|
||||||
|
|
||||||
PacketP =(PKT *)RIO_PTR(HostP->Caddr,RWORD(UnixRupP->RupP->rxpkt));
|
PacketP = (PKT *) RIO_PTR(HostP->Caddr, RWORD(UnixRupP->RupP->rxpkt));
|
||||||
|
|
||||||
ShowPacket( DBG_CMD, PacketP );
|
ShowPacket(DBG_CMD, PacketP);
|
||||||
|
|
||||||
switch ( RBYTE(PacketP->dest_port) ) {
|
switch (RBYTE(PacketP->dest_port)) {
|
||||||
case BOOT_RUP:
|
case BOOT_RUP:
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Incoming Boot %s packet '%x'\n",
|
rio_dprintk(RIO_DEBUG_CMD, "Incoming Boot %s packet '%x'\n", RBYTE(PacketP->len) & 0x80 ? "Command" : "Data", RBYTE(PacketP->data[0]));
|
||||||
RBYTE(PacketP->len) & 0x80 ? "Command":"Data",
|
|
||||||
RBYTE(PacketP->data[0]));
|
|
||||||
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
||||||
FreeMe= RIOBootRup(p, Rup,HostP,PacketP);
|
FreeMe = RIOBootRup(p, Rup, HostP, PacketP);
|
||||||
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
|
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -760,38 +724,35 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
** routine that uses the RUP lock.
|
** routine that uses the RUP lock.
|
||||||
*/
|
*/
|
||||||
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
||||||
FreeMe= RIOCommandRup(p, Rup,HostP,PacketP);
|
FreeMe = RIOCommandRup(p, Rup, HostP, PacketP);
|
||||||
if (PacketP->data[5] == MEMDUMP) {
|
if (PacketP->data[5] == MEMDUMP) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Memdump from 0x%x complete\n",
|
rio_dprintk(RIO_DEBUG_CMD, "Memdump from 0x%x complete\n", *(ushort *) & (PacketP->data[6]));
|
||||||
*(ushort *) &(PacketP->data[6]));
|
HostP->Copy((caddr_t) & (PacketP->data[8]), (caddr_t) p->RIOMemDump, 32);
|
||||||
HostP->Copy( (caddr_t)&(PacketP->data[8]),
|
|
||||||
(caddr_t)p->RIOMemDump, 32 );
|
|
||||||
}
|
}
|
||||||
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
|
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROUTE_RUP:
|
case ROUTE_RUP:
|
||||||
rio_spin_unlock_irqrestore( &UnixRupP->RupLock, flags);
|
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
||||||
FreeMe = RIORouteRup(p, Rup, HostP, PacketP );
|
FreeMe = RIORouteRup(p, Rup, HostP, PacketP);
|
||||||
rio_spin_lock_irqsave( &UnixRupP->RupLock, flags );
|
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Unknown RUP %d\n", RBYTE(PacketP->dest_port));
|
rio_dprintk(RIO_DEBUG_CMD, "Unknown RUP %d\n", RBYTE(PacketP->dest_port));
|
||||||
FreeMe = 1;
|
FreeMe = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( FreeMe ) {
|
if (FreeMe) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Free processed incoming command packet\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Free processed incoming command packet\n");
|
||||||
put_free_end(HostP,PacketP);
|
put_free_end(HostP, PacketP);
|
||||||
|
|
||||||
WWORD(UnixRupP->RupP->rxcontrol , RX_RUP_INACTIVE);
|
WWORD(UnixRupP->RupP->rxcontrol, RX_RUP_INACTIVE);
|
||||||
|
|
||||||
if ( RWORD(UnixRupP->RupP->handshake)==PHB_HANDSHAKE_SET ) {
|
if (RWORD(UnixRupP->RupP->handshake) == PHB_HANDSHAKE_SET) {
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Handshake rup %d\n",Rup);
|
rio_dprintk(RIO_DEBUG_CMD, "Handshake rup %d\n", Rup);
|
||||||
WWORD(UnixRupP->RupP->handshake,
|
WWORD(UnixRupP->RupP->handshake, PHB_HANDSHAKE_SET | PHB_HANDSHAKE_RESET);
|
||||||
PHB_HANDSHAKE_SET|PHB_HANDSHAKE_RESET);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -800,7 +761,7 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
** IF a command was running on the port,
|
** IF a command was running on the port,
|
||||||
** and it has completed, then tidy it up.
|
** and it has completed, then tidy it up.
|
||||||
*/
|
*/
|
||||||
if ( (CmdBlkP = UnixRupP->CmdPendingP) && /* ASSIGN! */
|
if ((CmdBlkP = UnixRupP->CmdPendingP) && /* ASSIGN! */
|
||||||
(RWORD(UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE)) {
|
(RWORD(UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE)) {
|
||||||
/*
|
/*
|
||||||
** we are idle.
|
** we are idle.
|
||||||
@@ -809,19 +770,17 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
** So, wakeup whoever is waiting for it (and tell them
|
** So, wakeup whoever is waiting for it (and tell them
|
||||||
** what happened).
|
** what happened).
|
||||||
*/
|
*/
|
||||||
if ( CmdBlkP->Packet.dest_port == BOOT_RUP )
|
if (CmdBlkP->Packet.dest_port == BOOT_RUP)
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Free Boot %s Command Block '%x'\n",
|
rio_dprintk(RIO_DEBUG_CMD, "Free Boot %s Command Block '%x'\n", CmdBlkP->Packet.len & 0x80 ? "Command" : "Data", CmdBlkP->Packet.data[0]);
|
||||||
CmdBlkP->Packet.len & 0x80 ? "Command":"Data",
|
|
||||||
CmdBlkP->Packet.data[0]);
|
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Command 0x%x completed\n",(int)CmdBlkP);
|
rio_dprintk(RIO_DEBUG_CMD, "Command 0x%x completed\n", (int) CmdBlkP);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Clear the Rup lock to prevent mutual exclusion.
|
** Clear the Rup lock to prevent mutual exclusion.
|
||||||
*/
|
*/
|
||||||
if ( CmdBlkP->PostFuncP ) {
|
if (CmdBlkP->PostFuncP) {
|
||||||
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
||||||
(*CmdBlkP->PostFuncP) (CmdBlkP->PostArg,CmdBlkP);
|
(*CmdBlkP->PostFuncP) (CmdBlkP->PostArg, CmdBlkP);
|
||||||
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
|
rio_spin_lock_irqsave(&UnixRupP->RupLock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -833,39 +792,34 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
/*
|
/*
|
||||||
** ....and return the command block to the freelist.
|
** ....and return the command block to the freelist.
|
||||||
*/
|
*/
|
||||||
RIOFreeCmdBlk( CmdBlkP );
|
RIOFreeCmdBlk(CmdBlkP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** If there is a command for this rup, and the rup
|
** If there is a command for this rup, and the rup
|
||||||
** is idle, then process the command
|
** is idle, then process the command
|
||||||
*/
|
*/
|
||||||
if ( (CmdBlkP = UnixRupP->CmdsWaitingP) && /* ASSIGN! */
|
if ((CmdBlkP = UnixRupP->CmdsWaitingP) && /* ASSIGN! */
|
||||||
(UnixRupP->CmdPendingP == NULL) &&
|
(UnixRupP->CmdPendingP == NULL) && (RWORD(UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE)) {
|
||||||
(RWORD(UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE)) {
|
|
||||||
/*
|
/*
|
||||||
** if the pre-function is non-zero, call it.
|
** if the pre-function is non-zero, call it.
|
||||||
** If it returns RIO_FAIL then don't
|
** If it returns RIO_FAIL then don't
|
||||||
** send this command yet!
|
** send this command yet!
|
||||||
*/
|
*/
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckCmdBlkP (CmdBlkP);
|
CheckCmdBlkP(CmdBlkP);
|
||||||
#endif
|
#endif
|
||||||
if ( !(CmdBlkP->PreFuncP ?
|
if (!(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) : TRUE)) {
|
||||||
(*CmdBlkP->PreFuncP)(CmdBlkP->PreArg, CmdBlkP) : TRUE)) {
|
rio_dprintk(RIO_DEBUG_CMD, "Not ready to start command 0x%x\n", (int) CmdBlkP);
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Not ready to start command 0x%x\n",(int)CmdBlkP);
|
} else {
|
||||||
}
|
rio_dprintk(RIO_DEBUG_CMD, "Start new command 0x%x Cmd byte is 0x%x\n", (int) CmdBlkP, CmdBlkP->Packet.data[0]);
|
||||||
else {
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Start new command 0x%x Cmd byte is 0x%x\n",
|
|
||||||
(int)CmdBlkP, CmdBlkP->Packet.data[0]);
|
|
||||||
/*
|
/*
|
||||||
** Whammy! blat that pack!
|
** Whammy! blat that pack!
|
||||||
*/
|
*/
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckPacketP ((PKT *)RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt));
|
CheckPacketP((PKT *) RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt));
|
||||||
#endif
|
#endif
|
||||||
HostP->Copy( (caddr_t)&CmdBlkP->Packet,
|
HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT));
|
||||||
RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** remove the command from the rup command queue...
|
** remove the command from the rup command queue...
|
||||||
@@ -880,7 +834,7 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
/*
|
/*
|
||||||
** set the command register
|
** set the command register
|
||||||
*/
|
*/
|
||||||
WWORD(UnixRupP->RupP->txcontrol,TX_PACKET_READY);
|
WWORD(UnixRupP->RupP->txcontrol, TX_PACKET_READY);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** the command block will be freed
|
** the command block will be freed
|
||||||
@@ -889,67 +843,64 @@ RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
|
||||||
} while ( Rup );
|
} while (Rup);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int RIOWFlushMark(int iPortP, struct CmdBlk *CmdBlkP)
|
||||||
RIOWFlushMark(int iPortP, struct CmdBlk *CmdBlkP)
|
|
||||||
{
|
{
|
||||||
struct Port * PortP = (struct Port *)iPortP;
|
struct Port *PortP = (struct Port *) iPortP;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckPortP( PortP );
|
CheckPortP(PortP);
|
||||||
#endif
|
#endif
|
||||||
PortP->WflushFlag++;
|
PortP->WflushFlag++;
|
||||||
PortP->MagicFlags |= MAGIC_FLUSH;
|
PortP->MagicFlags |= MAGIC_FLUSH;
|
||||||
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
return RIOUnUse( iPortP, CmdBlkP );
|
return RIOUnUse(iPortP, CmdBlkP);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int RIORFlushEnable(int iPortP, struct CmdBlk *CmdBlkP)
|
||||||
RIORFlushEnable(int iPortP, struct CmdBlk *CmdBlkP)
|
|
||||||
{
|
{
|
||||||
struct Port * PortP = (struct Port *)iPortP;
|
struct Port *PortP = (struct Port *) iPortP;
|
||||||
PKT *PacketP;
|
PKT *PacketP;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
|
|
||||||
while ( can_remove_receive(&PacketP, PortP) ) {
|
while (can_remove_receive(&PacketP, PortP)) {
|
||||||
remove_receive(PortP);
|
remove_receive(PortP);
|
||||||
ShowPacket(DBG_PROC, PacketP );
|
ShowPacket(DBG_PROC, PacketP);
|
||||||
put_free_end( PortP->HostP, PacketP );
|
put_free_end(PortP->HostP, PacketP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( RWORD(PortP->PhbP->handshake)==PHB_HANDSHAKE_SET ) {
|
if (RWORD(PortP->PhbP->handshake) == PHB_HANDSHAKE_SET) {
|
||||||
/*
|
/*
|
||||||
** MAGIC! (Basically, handshake the RX buffer, so that
|
** MAGIC! (Basically, handshake the RX buffer, so that
|
||||||
** the RTAs upstream can be re-enabled.)
|
** the RTAs upstream can be re-enabled.)
|
||||||
*/
|
*/
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Util: Set RX handshake bit\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Util: Set RX handshake bit\n");
|
||||||
WWORD(PortP->PhbP->handshake, PHB_HANDSHAKE_SET|PHB_HANDSHAKE_RESET);
|
WWORD(PortP->PhbP->handshake, PHB_HANDSHAKE_SET | PHB_HANDSHAKE_RESET);
|
||||||
}
|
}
|
||||||
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
return RIOUnUse( iPortP, CmdBlkP );
|
return RIOUnUse(iPortP, CmdBlkP);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int RIOUnUse(int iPortP, struct CmdBlk *CmdBlkP)
|
||||||
RIOUnUse(int iPortP, struct CmdBlk *CmdBlkP)
|
|
||||||
{
|
{
|
||||||
struct Port * PortP = (struct Port *)iPortP;
|
struct Port *PortP = (struct Port *) iPortP;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
|
|
||||||
#ifdef CHECK
|
#ifdef CHECK
|
||||||
CheckPortP( PortP );
|
CheckPortP(PortP);
|
||||||
#endif
|
#endif
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Decrement in use count for port\n");
|
rio_dprintk(RIO_DEBUG_CMD, "Decrement in use count for port\n");
|
||||||
|
|
||||||
if (PortP->InUse) {
|
if (PortP->InUse) {
|
||||||
if ( --PortP->InUse != NOT_INUSE ) {
|
if (--PortP->InUse != NOT_INUSE) {
|
||||||
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -977,8 +928,7 @@ RIOUnUse(int iPortP, struct CmdBlk *CmdBlkP)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void ShowPacket(uint Flags, struct PKT *PacketP)
|
||||||
ShowPacket(uint Flags, struct PKT *PacketP)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -51,7 +51,7 @@ struct rio_info {
|
|||||||
int RIOInstallAttempts; /* no. of rio-install() calls */
|
int RIOInstallAttempts; /* no. of rio-install() calls */
|
||||||
int RIOLastPCISearch; /* status of last search */
|
int RIOLastPCISearch; /* status of last search */
|
||||||
int RIONumHosts; /* Number of RIO Hosts */
|
int RIONumHosts; /* Number of RIO Hosts */
|
||||||
struct Host * RIOHosts; /* RIO Host values */
|
struct Host *RIOHosts; /* RIO Host values */
|
||||||
struct Port **RIOPortp; /* RIO port values */
|
struct Port **RIOPortp; /* RIO port values */
|
||||||
/*
|
/*
|
||||||
** 02.03.1999 ARG - ESIL 0820 fix
|
** 02.03.1999 ARG - ESIL 0820 fix
|
||||||
@@ -115,7 +115,7 @@ struct rio_info {
|
|||||||
struct Error RIOError; /* to Identify what went wrong */
|
struct Error RIOError; /* to Identify what went wrong */
|
||||||
struct Conf RIOConf; /* Configuration ??? */
|
struct Conf RIOConf; /* Configuration ??? */
|
||||||
struct ttystatics channel[RIO_PORTS]; /* channel information */
|
struct ttystatics channel[RIO_PORTS]; /* channel information */
|
||||||
char RIOBootPackets[1+(SIXTY_FOUR_K/RTA_BOOT_DATA_SIZE)]
|
char RIOBootPackets[1 + (SIXTY_FOUR_K / RTA_BOOT_DATA_SIZE)]
|
||||||
[RTA_BOOT_DATA_SIZE];
|
[RTA_BOOT_DATA_SIZE];
|
||||||
struct Map RIOConnectTable[TOTAL_MAP_ENTRIES];
|
struct Map RIOConnectTable[TOTAL_MAP_ENTRIES];
|
||||||
struct Map RIOSavedTable[TOTAL_MAP_ENTRIES];
|
struct Map RIOSavedTable[TOTAL_MAP_ENTRIES];
|
||||||
|
@@ -46,7 +46,7 @@ struct RioHostInfo {
|
|||||||
int bus; /* ISA/EISA/MCA/PCI */
|
int bus; /* ISA/EISA/MCA/PCI */
|
||||||
int mode; /* pointer to host mode - INTERRUPT / POLLED */
|
int mode; /* pointer to host mode - INTERRUPT / POLLED */
|
||||||
struct old_sgttyb
|
struct old_sgttyb
|
||||||
* Sg; /* pointer to default term characteristics */
|
*Sg; /* pointer to default term characteristics */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -88,12 +88,12 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
|
|||||||
static void RIOReceive(struct rio_info *, struct Port *);
|
static void RIOReceive(struct rio_info *, struct Port *);
|
||||||
|
|
||||||
|
|
||||||
static char *firstchars (char *p, int nch)
|
static char *firstchars(char *p, int nch)
|
||||||
{
|
{
|
||||||
static char buf[2][128];
|
static char buf[2][128];
|
||||||
static int t=0;
|
static int t = 0;
|
||||||
t = ! t;
|
t = !t;
|
||||||
memcpy (buf[t], p, nch);
|
memcpy(buf[t], p, nch);
|
||||||
buf[t][nch] = 0;
|
buf[t][nch] = 0;
|
||||||
return buf[t];
|
return buf[t];
|
||||||
}
|
}
|
||||||
@@ -101,26 +101,25 @@ static char *firstchars (char *p, int nch)
|
|||||||
|
|
||||||
#define INCR( P, I ) ((P) = (((P)+(I)) & p->RIOBufferMask))
|
#define INCR( P, I ) ((P) = (((P)+(I)) & p->RIOBufferMask))
|
||||||
/* Enable and start the transmission of packets */
|
/* Enable and start the transmission of packets */
|
||||||
void
|
void RIOTxEnable(en)
|
||||||
RIOTxEnable(en)
|
char *en;
|
||||||
char * en;
|
|
||||||
{
|
{
|
||||||
struct Port * PortP;
|
struct Port *PortP;
|
||||||
struct rio_info *p;
|
struct rio_info *p;
|
||||||
struct tty_struct* tty;
|
struct tty_struct *tty;
|
||||||
int c;
|
int c;
|
||||||
struct PKT * PacketP;
|
struct PKT *PacketP;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
PortP = (struct Port *)en;
|
PortP = (struct Port *) en;
|
||||||
p = (struct rio_info *)PortP->p;
|
p = (struct rio_info *) PortP->p;
|
||||||
tty = PortP->gs.tty;
|
tty = PortP->gs.tty;
|
||||||
|
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "tx port %d: %d chars queued.\n",
|
rio_dprintk(RIO_DEBUG_INTR, "tx port %d: %d chars queued.\n", PortP->PortNum, PortP->gs.xmit_cnt);
|
||||||
PortP->PortNum, PortP->gs.xmit_cnt);
|
|
||||||
|
|
||||||
if (!PortP->gs.xmit_cnt) return;
|
if (!PortP->gs.xmit_cnt)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
/* This routine is an order of magnitude simpler than the specialix
|
/* This routine is an order of magnitude simpler than the specialix
|
||||||
@@ -131,54 +130,49 @@ char * en;
|
|||||||
|
|
||||||
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
|
|
||||||
while (can_add_transmit( &PacketP, PortP )) {
|
while (can_add_transmit(&PacketP, PortP)) {
|
||||||
c = PortP->gs.xmit_cnt;
|
c = PortP->gs.xmit_cnt;
|
||||||
if (c > PKT_MAX_DATA_LEN) c = PKT_MAX_DATA_LEN;
|
if (c > PKT_MAX_DATA_LEN)
|
||||||
|
c = PKT_MAX_DATA_LEN;
|
||||||
|
|
||||||
/* Don't copy past the end of the source buffer */
|
/* Don't copy past the end of the source buffer */
|
||||||
if (c > SERIAL_XMIT_SIZE - PortP->gs.xmit_tail)
|
if (c > SERIAL_XMIT_SIZE - PortP->gs.xmit_tail)
|
||||||
c = SERIAL_XMIT_SIZE - PortP->gs.xmit_tail;
|
c = SERIAL_XMIT_SIZE - PortP->gs.xmit_tail;
|
||||||
|
|
||||||
{ int t;
|
{
|
||||||
t = (c > 10)?10:c;
|
int t;
|
||||||
|
t = (c > 10) ? 10 : c;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "rio: tx port %d: copying %d chars: %s - %s\n",
|
rio_dprintk(RIO_DEBUG_INTR, "rio: tx port %d: copying %d chars: %s - %s\n", PortP->PortNum, c, firstchars(PortP->gs.xmit_buf + PortP->gs.xmit_tail, t), firstchars(PortP->gs.xmit_buf + PortP->gs.xmit_tail + c - t, t));
|
||||||
PortP->PortNum, c,
|
|
||||||
firstchars (PortP->gs.xmit_buf + PortP->gs.xmit_tail , t),
|
|
||||||
firstchars (PortP->gs.xmit_buf + PortP->gs.xmit_tail + c-t, t));
|
|
||||||
}
|
}
|
||||||
/* If for one reason or another, we can't copy more data,
|
/* If for one reason or another, we can't copy more data,
|
||||||
we're done! */
|
we're done! */
|
||||||
if (c == 0) break;
|
if (c == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
rio_memcpy_toio (PortP->HostP->Caddr, (caddr_t)PacketP->data,
|
rio_memcpy_toio(PortP->HostP->Caddr, (caddr_t) PacketP->data, PortP->gs.xmit_buf + PortP->gs.xmit_tail, c);
|
||||||
PortP->gs.xmit_buf + PortP->gs.xmit_tail, c);
|
|
||||||
/* udelay (1); */
|
/* udelay (1); */
|
||||||
|
|
||||||
writeb (c, &(PacketP->len));
|
writeb(c, &(PacketP->len));
|
||||||
if (!( PortP->State & RIO_DELETED ) ) {
|
if (!(PortP->State & RIO_DELETED)) {
|
||||||
add_transmit ( PortP );
|
add_transmit(PortP);
|
||||||
/*
|
/*
|
||||||
** Count chars tx'd for port statistics reporting
|
** Count chars tx'd for port statistics reporting
|
||||||
*/
|
*/
|
||||||
if ( PortP->statsGather )
|
if (PortP->statsGather)
|
||||||
PortP->txchars += c;
|
PortP->txchars += c;
|
||||||
}
|
}
|
||||||
PortP->gs.xmit_tail = (PortP->gs.xmit_tail + c) & (SERIAL_XMIT_SIZE-1);
|
PortP->gs.xmit_tail = (PortP->gs.xmit_tail + c) & (SERIAL_XMIT_SIZE - 1);
|
||||||
PortP->gs.xmit_cnt -= c;
|
PortP->gs.xmit_cnt -= c;
|
||||||
}
|
}
|
||||||
|
|
||||||
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
|
|
||||||
if (PortP->gs.xmit_cnt <= (PortP->gs.wakeup_chars + 2*PKT_MAX_DATA_LEN)) {
|
if (PortP->gs.xmit_cnt <= (PortP->gs.wakeup_chars + 2 * PKT_MAX_DATA_LEN)) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Waking up.... ldisc:%d (%d/%d)....",
|
rio_dprintk(RIO_DEBUG_INTR, "Waking up.... ldisc:%d (%d/%d)....", (int) (PortP->gs.tty->flags & (1 << TTY_DO_WRITE_WAKEUP)), PortP->gs.wakeup_chars, PortP->gs.xmit_cnt);
|
||||||
(int)(PortP->gs.tty->flags & (1 << TTY_DO_WRITE_WAKEUP)),
|
if ((PortP->gs.tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && PortP->gs.tty->ldisc.write_wakeup)
|
||||||
PortP->gs.wakeup_chars, PortP->gs.xmit_cnt);
|
(PortP->gs.tty->ldisc.write_wakeup) (PortP->gs.tty);
|
||||||
if ((PortP->gs.tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
|
rio_dprintk(RIO_DEBUG_INTR, "(%d/%d)\n", PortP->gs.wakeup_chars, PortP->gs.xmit_cnt);
|
||||||
PortP->gs.tty->ldisc.write_wakeup)
|
|
||||||
(PortP->gs.tty->ldisc.write_wakeup)(PortP->gs.tty);
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "(%d/%d)\n",
|
|
||||||
PortP->gs.wakeup_chars, PortP->gs.xmit_cnt);
|
|
||||||
wake_up_interruptible(&PortP->gs.tty->write_wait);
|
wake_up_interruptible(&PortP->gs.tty->write_wait);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,38 +186,37 @@ char * en;
|
|||||||
static int RupIntr;
|
static int RupIntr;
|
||||||
static int RxIntr;
|
static int RxIntr;
|
||||||
static int TxIntr;
|
static int TxIntr;
|
||||||
void
|
void RIOServiceHost(p, HostP, From)
|
||||||
RIOServiceHost(p, HostP, From)
|
struct rio_info *p;
|
||||||
struct rio_info * p;
|
|
||||||
struct Host *HostP;
|
struct Host *HostP;
|
||||||
int From;
|
int From;
|
||||||
{
|
{
|
||||||
rio_spin_lock (&HostP->HostLock);
|
rio_spin_lock(&HostP->HostLock);
|
||||||
if ( (HostP->Flags & RUN_STATE) != RC_RUNNING ) {
|
if ((HostP->Flags & RUN_STATE) != RC_RUNNING) {
|
||||||
static int t =0;
|
static int t = 0;
|
||||||
rio_spin_unlock (&HostP->HostLock);
|
rio_spin_unlock(&HostP->HostLock);
|
||||||
if ((t++ % 200) == 0)
|
if ((t++ % 200) == 0)
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Interrupt but host not running. flags=%x.\n", (int)HostP->Flags);
|
rio_dprintk(RIO_DEBUG_INTR, "Interrupt but host not running. flags=%x.\n", (int) HostP->Flags);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rio_spin_unlock (&HostP->HostLock);
|
rio_spin_unlock(&HostP->HostLock);
|
||||||
|
|
||||||
if ( RWORD( HostP->ParmMapP->rup_intr ) ) {
|
if (RWORD(HostP->ParmMapP->rup_intr)) {
|
||||||
WWORD( HostP->ParmMapP->rup_intr , 0 );
|
WWORD(HostP->ParmMapP->rup_intr, 0);
|
||||||
p->RIORupCount++;
|
p->RIORupCount++;
|
||||||
RupIntr++;
|
RupIntr++;
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "rio: RUP interrupt on host %d\n", HostP-p->RIOHosts);
|
rio_dprintk(RIO_DEBUG_INTR, "rio: RUP interrupt on host %d\n", HostP - p->RIOHosts);
|
||||||
RIOPollHostCommands(p, HostP );
|
RIOPollHostCommands(p, HostP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( RWORD( HostP->ParmMapP->rx_intr ) ) {
|
if (RWORD(HostP->ParmMapP->rx_intr)) {
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
WWORD( HostP->ParmMapP->rx_intr , 0 );
|
WWORD(HostP->ParmMapP->rx_intr, 0);
|
||||||
p->RIORxCount++;
|
p->RIORxCount++;
|
||||||
RxIntr++;
|
RxIntr++;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "rio: RX interrupt on host %d\n", HostP-p->RIOHosts);
|
rio_dprintk(RIO_DEBUG_INTR, "rio: RX interrupt on host %d\n", HostP - p->RIOHosts);
|
||||||
/*
|
/*
|
||||||
** Loop through every port. If the port is mapped into
|
** Loop through every port. If the port is mapped into
|
||||||
** the system ( i.e. has /dev/ttyXXXX associated ) then it is
|
** the system ( i.e. has /dev/ttyXXXX associated ) then it is
|
||||||
@@ -231,8 +224,7 @@ int From;
|
|||||||
** hanging on its receive queue and stuff them on the free
|
** hanging on its receive queue and stuff them on the free
|
||||||
** list; check for commands on the way.
|
** list; check for commands on the way.
|
||||||
*/
|
*/
|
||||||
for ( port=p->RIOFirstPortsBooted;
|
for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) {
|
||||||
port<p->RIOLastPortsBooted+PORTS_PER_RTA; port++ ) {
|
|
||||||
struct Port *PortP = p->RIOPortp[port];
|
struct Port *PortP = p->RIOPortp[port];
|
||||||
struct tty_struct *ttyP;
|
struct tty_struct *ttyP;
|
||||||
struct PKT *PacketP;
|
struct PKT *PacketP;
|
||||||
@@ -242,7 +234,7 @@ int From;
|
|||||||
** has not been set up!
|
** has not been set up!
|
||||||
** Optimise: ports come in bundles of eight.
|
** Optimise: ports come in bundles of eight.
|
||||||
*/
|
*/
|
||||||
if ( !PortP->Mapped ) {
|
if (!PortP->Mapped) {
|
||||||
port += 7;
|
port += 7;
|
||||||
continue; /* with the next port */
|
continue; /* with the next port */
|
||||||
}
|
}
|
||||||
@@ -251,7 +243,7 @@ int From;
|
|||||||
** If the host board isn't THIS host board, check the next one.
|
** If the host board isn't THIS host board, check the next one.
|
||||||
** optimise: ports come in bundles of eight.
|
** optimise: ports come in bundles of eight.
|
||||||
*/
|
*/
|
||||||
if ( PortP->HostP != HostP ) {
|
if (PortP->HostP != HostP) {
|
||||||
port += 7;
|
port += 7;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -259,7 +251,7 @@ int From;
|
|||||||
/*
|
/*
|
||||||
** Let us see - is the port open? If not, then don't service it.
|
** Let us see - is the port open? If not, then don't service it.
|
||||||
*/
|
*/
|
||||||
if ( !( PortP->PortState & PORT_ISOPEN ) ) {
|
if (!(PortP->PortState & PORT_ISOPEN)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,7 +269,7 @@ int From;
|
|||||||
/*
|
/*
|
||||||
** Process received data if there is any.
|
** Process received data if there is any.
|
||||||
*/
|
*/
|
||||||
if ( can_remove_receive( &PacketP, PortP ) )
|
if (can_remove_receive(&PacketP, PortP))
|
||||||
RIOReceive(p, PortP);
|
RIOReceive(p, PortP);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -285,36 +277,33 @@ int From;
|
|||||||
** it's handshake bit is set, then we must clear the handshake,
|
** it's handshake bit is set, then we must clear the handshake,
|
||||||
** so that that downstream RTA is re-enabled.
|
** so that that downstream RTA is re-enabled.
|
||||||
*/
|
*/
|
||||||
if ( !can_remove_receive( &PacketP, PortP ) &&
|
if (!can_remove_receive(&PacketP, PortP) && (RWORD(PortP->PhbP->handshake) == PHB_HANDSHAKE_SET)) {
|
||||||
( RWORD( PortP->PhbP->handshake )==PHB_HANDSHAKE_SET ) ) {
|
|
||||||
/*
|
/*
|
||||||
** MAGIC! ( Basically, handshake the RX buffer, so that
|
** MAGIC! ( Basically, handshake the RX buffer, so that
|
||||||
** the RTAs upstream can be re-enabled. )
|
** the RTAs upstream can be re-enabled. )
|
||||||
*/
|
*/
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Set RX handshake bit\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Set RX handshake bit\n");
|
||||||
WWORD( PortP->PhbP->handshake,
|
WWORD(PortP->PhbP->handshake, PHB_HANDSHAKE_SET | PHB_HANDSHAKE_RESET);
|
||||||
PHB_HANDSHAKE_SET|PHB_HANDSHAKE_RESET );
|
|
||||||
}
|
}
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( RWORD( HostP->ParmMapP->tx_intr ) ) {
|
if (RWORD(HostP->ParmMapP->tx_intr)) {
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
WWORD( HostP->ParmMapP->tx_intr , 0);
|
WWORD(HostP->ParmMapP->tx_intr, 0);
|
||||||
|
|
||||||
p->RIOTxCount++;
|
p->RIOTxCount++;
|
||||||
TxIntr++;
|
TxIntr++;
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "rio: TX interrupt on host %d\n", HostP-p->RIOHosts);
|
rio_dprintk(RIO_DEBUG_INTR, "rio: TX interrupt on host %d\n", HostP - p->RIOHosts);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Loop through every port.
|
** Loop through every port.
|
||||||
** If the port is mapped into the system ( i.e. has /dev/ttyXXXX
|
** If the port is mapped into the system ( i.e. has /dev/ttyXXXX
|
||||||
** associated ) then it is worth checking.
|
** associated ) then it is worth checking.
|
||||||
*/
|
*/
|
||||||
for ( port=p->RIOFirstPortsBooted;
|
for (port = p->RIOFirstPortsBooted; port < p->RIOLastPortsBooted + PORTS_PER_RTA; port++) {
|
||||||
port<p->RIOLastPortsBooted+PORTS_PER_RTA; port++ ) {
|
|
||||||
struct Port *PortP = p->RIOPortp[port];
|
struct Port *PortP = p->RIOPortp[port];
|
||||||
struct tty_struct *ttyP;
|
struct tty_struct *ttyP;
|
||||||
struct PKT *PacketP;
|
struct PKT *PacketP;
|
||||||
@@ -323,7 +312,7 @@ int From;
|
|||||||
** not mapped in - most of the RIOPortp[] information
|
** not mapped in - most of the RIOPortp[] information
|
||||||
** has not been set up!
|
** has not been set up!
|
||||||
*/
|
*/
|
||||||
if ( !PortP->Mapped ) {
|
if (!PortP->Mapped) {
|
||||||
port += 7;
|
port += 7;
|
||||||
continue; /* with the next port */
|
continue; /* with the next port */
|
||||||
}
|
}
|
||||||
@@ -332,7 +321,7 @@ int From;
|
|||||||
** If the host board isn't running, then its data structures
|
** If the host board isn't running, then its data structures
|
||||||
** are no use to us - continue quietly.
|
** are no use to us - continue quietly.
|
||||||
*/
|
*/
|
||||||
if ( PortP->HostP != HostP ) {
|
if (PortP->HostP != HostP) {
|
||||||
port += 7;
|
port += 7;
|
||||||
continue; /* with the next port */
|
continue; /* with the next port */
|
||||||
}
|
}
|
||||||
@@ -340,11 +329,11 @@ int From;
|
|||||||
/*
|
/*
|
||||||
** Let us see - is the port open? If not, then don't service it.
|
** Let us see - is the port open? If not, then don't service it.
|
||||||
*/
|
*/
|
||||||
if ( !( PortP->PortState & PORT_ISOPEN ) ) {
|
if (!(PortP->PortState & PORT_ISOPEN)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "rio: Looking into port %d.\n", port);
|
rio_dprintk(RIO_DEBUG_INTR, "rio: Looking into port %d.\n", port);
|
||||||
/*
|
/*
|
||||||
** Lock the port before we begin working on it.
|
** Lock the port before we begin working on it.
|
||||||
*/
|
*/
|
||||||
@@ -354,8 +343,8 @@ int From;
|
|||||||
** If we can't add anything to the transmit queue, then
|
** If we can't add anything to the transmit queue, then
|
||||||
** we need do none of this processing.
|
** we need do none of this processing.
|
||||||
*/
|
*/
|
||||||
if ( !can_add_transmit( &PacketP, PortP ) ) {
|
if (!can_add_transmit(&PacketP, PortP)) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Can't add to port, so skipping.\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Can't add to port, so skipping.\n");
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -367,7 +356,7 @@ int From;
|
|||||||
ttyP = PortP->gs.tty;
|
ttyP = PortP->gs.tty;
|
||||||
/* If ttyP is NULL, the port is getting closed. Forget about it. */
|
/* If ttyP is NULL, the port is getting closed. Forget about it. */
|
||||||
if (!ttyP) {
|
if (!ttyP) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "no tty, so skipping.\n");
|
rio_dprintk(RIO_DEBUG_INTR, "no tty, so skipping.\n");
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -409,9 +398,9 @@ int From;
|
|||||||
*/
|
*/
|
||||||
/* For now don't handle RTA reboots. -- REW.
|
/* For now don't handle RTA reboots. -- REW.
|
||||||
Reenabled. Otherwise RTA reboots didn't work. Duh. -- REW */
|
Reenabled. Otherwise RTA reboots didn't work. Duh. -- REW */
|
||||||
if ( PortP->MagicFlags ) {
|
if (PortP->MagicFlags) {
|
||||||
#if 1
|
#if 1
|
||||||
if ( PortP->MagicFlags & MAGIC_REBOOT ) {
|
if (PortP->MagicFlags & MAGIC_REBOOT) {
|
||||||
/*
|
/*
|
||||||
** well, the RTA has been rebooted, and there is room
|
** well, the RTA has been rebooted, and there is room
|
||||||
** on its queue to add the open packet that is required.
|
** on its queue to add the open packet that is required.
|
||||||
@@ -427,10 +416,7 @@ int From;
|
|||||||
PortP->InUse = NOT_INUSE;
|
PortP->InUse = NOT_INUSE;
|
||||||
|
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
if ( RIOParam(PortP, OPEN, ((PortP->Cor2Copy &
|
if (RIOParam(PortP, OPEN, ((PortP->Cor2Copy & (COR2_RTSFLOW | COR2_CTSFLOW)) == (COR2_RTSFLOW | COR2_CTSFLOW)) ? TRUE : FALSE, DONT_SLEEP) == RIO_FAIL) {
|
||||||
(COR2_RTSFLOW|COR2_CTSFLOW ) )==
|
|
||||||
(COR2_RTSFLOW|COR2_CTSFLOW ) ) ?
|
|
||||||
TRUE : FALSE, DONT_SLEEP ) == RIO_FAIL ) {
|
|
||||||
continue; /* with next port */
|
continue; /* with next port */
|
||||||
}
|
}
|
||||||
rio_spin_lock(&PortP->portSem);
|
rio_spin_lock(&PortP->portSem);
|
||||||
@@ -442,88 +428,84 @@ int From;
|
|||||||
** As mentioned above, this is a tacky hack to cope
|
** As mentioned above, this is a tacky hack to cope
|
||||||
** with WFLUSH
|
** with WFLUSH
|
||||||
*/
|
*/
|
||||||
if ( PortP->WflushFlag ) {
|
if (PortP->WflushFlag) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Want to WFLUSH mark this port\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Want to WFLUSH mark this port\n");
|
||||||
|
|
||||||
if ( PortP->InUse )
|
if (PortP->InUse)
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "FAILS - PORT IS IN USE\n");
|
rio_dprintk(RIO_DEBUG_INTR, "FAILS - PORT IS IN USE\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
while ( PortP->WflushFlag &&
|
while (PortP->WflushFlag && can_add_transmit(&PacketP, PortP) && (PortP->InUse == NOT_INUSE)) {
|
||||||
can_add_transmit( &PacketP, PortP ) &&
|
|
||||||
( PortP->InUse == NOT_INUSE ) ) {
|
|
||||||
int p;
|
int p;
|
||||||
struct PktCmd *PktCmdP;
|
struct PktCmd *PktCmdP;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Add WFLUSH marker to data queue\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Add WFLUSH marker to data queue\n");
|
||||||
/*
|
/*
|
||||||
** make it look just like a WFLUSH command
|
** make it look just like a WFLUSH command
|
||||||
*/
|
*/
|
||||||
PktCmdP = ( struct PktCmd * )&PacketP->data[0];
|
PktCmdP = (struct PktCmd *) &PacketP->data[0];
|
||||||
|
|
||||||
WBYTE( PktCmdP->Command , WFLUSH );
|
WBYTE(PktCmdP->Command, WFLUSH);
|
||||||
|
|
||||||
p = PortP->HostPort % ( ushort )PORTS_PER_RTA;
|
p = PortP->HostPort % (ushort) PORTS_PER_RTA;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** If second block of ports for 16 port RTA, add 8
|
** If second block of ports for 16 port RTA, add 8
|
||||||
** to index 8-15.
|
** to index 8-15.
|
||||||
*/
|
*/
|
||||||
if ( PortP->SecondBlock )
|
if (PortP->SecondBlock)
|
||||||
p += PORTS_PER_RTA;
|
p += PORTS_PER_RTA;
|
||||||
|
|
||||||
WBYTE( PktCmdP->PhbNum, p );
|
WBYTE(PktCmdP->PhbNum, p);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** to make debuggery easier
|
** to make debuggery easier
|
||||||
*/
|
*/
|
||||||
WBYTE( PacketP->data[ 2], 'W' );
|
WBYTE(PacketP->data[2], 'W');
|
||||||
WBYTE( PacketP->data[ 3], 'F' );
|
WBYTE(PacketP->data[3], 'F');
|
||||||
WBYTE( PacketP->data[ 4], 'L' );
|
WBYTE(PacketP->data[4], 'L');
|
||||||
WBYTE( PacketP->data[ 5], 'U' );
|
WBYTE(PacketP->data[5], 'U');
|
||||||
WBYTE( PacketP->data[ 6], 'S' );
|
WBYTE(PacketP->data[6], 'S');
|
||||||
WBYTE( PacketP->data[ 7], 'H' );
|
WBYTE(PacketP->data[7], 'H');
|
||||||
WBYTE( PacketP->data[ 8], ' ' );
|
WBYTE(PacketP->data[8], ' ');
|
||||||
WBYTE( PacketP->data[ 9], '0'+PortP->WflushFlag );
|
WBYTE(PacketP->data[9], '0' + PortP->WflushFlag);
|
||||||
WBYTE( PacketP->data[10], ' ' );
|
WBYTE(PacketP->data[10], ' ');
|
||||||
WBYTE( PacketP->data[11], ' ' );
|
WBYTE(PacketP->data[11], ' ');
|
||||||
WBYTE( PacketP->data[12], '\0' );
|
WBYTE(PacketP->data[12], '\0');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** its two bytes long!
|
** its two bytes long!
|
||||||
*/
|
*/
|
||||||
WBYTE( PacketP->len , PKT_CMD_BIT | 2 );
|
WBYTE(PacketP->len, PKT_CMD_BIT | 2);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** queue it!
|
** queue it!
|
||||||
*/
|
*/
|
||||||
if ( !( PortP->State & RIO_DELETED ) ) {
|
if (!(PortP->State & RIO_DELETED)) {
|
||||||
add_transmit( PortP );
|
add_transmit(PortP);
|
||||||
/*
|
/*
|
||||||
** Count chars tx'd for port statistics reporting
|
** Count chars tx'd for port statistics reporting
|
||||||
*/
|
*/
|
||||||
if ( PortP->statsGather )
|
if (PortP->statsGather)
|
||||||
PortP->txchars += 2;
|
PortP->txchars += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( --( PortP->WflushFlag ) == 0 ) {
|
if (--(PortP->WflushFlag) == 0) {
|
||||||
PortP->MagicFlags &= ~MAGIC_FLUSH;
|
PortP->MagicFlags &= ~MAGIC_FLUSH;
|
||||||
}
|
}
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Wflush count now stands at %d\n",
|
rio_dprintk(RIO_DEBUG_INTR, "Wflush count now stands at %d\n", PortP->WflushFlag);
|
||||||
PortP->WflushFlag);
|
|
||||||
}
|
}
|
||||||
if ( PortP->MagicFlags & MORE_OUTPUT_EYGOR ) {
|
if (PortP->MagicFlags & MORE_OUTPUT_EYGOR) {
|
||||||
if ( PortP->MagicFlags & MAGIC_FLUSH ) {
|
if (PortP->MagicFlags & MAGIC_FLUSH) {
|
||||||
PortP->MagicFlags |= MORE_OUTPUT_EYGOR;
|
PortP->MagicFlags |= MORE_OUTPUT_EYGOR;
|
||||||
}
|
} else {
|
||||||
else {
|
if (!can_add_transmit(&PacketP, PortP)) {
|
||||||
if ( !can_add_transmit( &PacketP, PortP ) ) {
|
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
RIOTxEnable((char *)PortP);
|
RIOTxEnable((char *) PortP);
|
||||||
rio_spin_lock(&PortP->portSem);
|
rio_spin_lock(&PortP->portSem);
|
||||||
PortP->MagicFlags &= ~MORE_OUTPUT_EYGOR;
|
PortP->MagicFlags &= ~MORE_OUTPUT_EYGOR;
|
||||||
}
|
}
|
||||||
@@ -535,13 +517,13 @@ int From;
|
|||||||
** If we can't add anything to the transmit queue, then
|
** If we can't add anything to the transmit queue, then
|
||||||
** we need do none of the remaining processing.
|
** we need do none of the remaining processing.
|
||||||
*/
|
*/
|
||||||
if (!can_add_transmit( &PacketP, PortP ) ) {
|
if (!can_add_transmit(&PacketP, PortP)) {
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
rio_spin_unlock(&PortP->portSem);
|
rio_spin_unlock(&PortP->portSem);
|
||||||
RIOTxEnable((char *)PortP);
|
RIOTxEnable((char *) PortP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -551,18 +533,17 @@ int From;
|
|||||||
** NB: Called with the tty locked. The spl from the lockb( ) is passed.
|
** NB: Called with the tty locked. The spl from the lockb( ) is passed.
|
||||||
** we return the ttySpl level that we re-locked at.
|
** we return the ttySpl level that we re-locked at.
|
||||||
*/
|
*/
|
||||||
static void
|
static void RIOReceive(p, PortP)
|
||||||
RIOReceive(p, PortP)
|
struct rio_info *p;
|
||||||
struct rio_info * p;
|
struct Port *PortP;
|
||||||
struct Port * PortP;
|
|
||||||
{
|
{
|
||||||
struct tty_struct *TtyP;
|
struct tty_struct *TtyP;
|
||||||
register ushort transCount;
|
register ushort transCount;
|
||||||
struct PKT *PacketP;
|
struct PKT *PacketP;
|
||||||
register uint DataCnt;
|
register uint DataCnt;
|
||||||
uchar * ptr;
|
uchar *ptr;
|
||||||
unsigned char *buf;
|
unsigned char *buf;
|
||||||
int copied =0;
|
int copied = 0;
|
||||||
|
|
||||||
static int intCount, RxIntCnt;
|
static int intCount, RxIntCnt;
|
||||||
|
|
||||||
@@ -588,25 +569,21 @@ struct Port * PortP;
|
|||||||
|
|
||||||
TtyP = PortP->gs.tty;
|
TtyP = PortP->gs.tty;
|
||||||
if (!TtyP) {
|
if (!TtyP) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "RIOReceive: tty is null. \n");
|
rio_dprintk(RIO_DEBUG_INTR, "RIOReceive: tty is null. \n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PortP->State & RIO_THROTTLE_RX) {
|
if (PortP->State & RIO_THROTTLE_RX) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "RIOReceive: Throttled. Can't handle more input.\n");
|
rio_dprintk(RIO_DEBUG_INTR, "RIOReceive: Throttled. Can't handle more input.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( PortP->State & RIO_DELETED )
|
if (PortP->State & RIO_DELETED) {
|
||||||
{
|
while (can_remove_receive(&PacketP, PortP)) {
|
||||||
while ( can_remove_receive( &PacketP, PortP ) )
|
remove_receive(PortP);
|
||||||
{
|
put_free_end(PortP->HostP, PacketP);
|
||||||
remove_receive( PortP );
|
|
||||||
put_free_end( PortP->HostP, PacketP );
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
** loop, just so long as:
|
** loop, just so long as:
|
||||||
** i ) there's some data ( i.e. can_remove_receive )
|
** i ) there's some data ( i.e. can_remove_receive )
|
||||||
@@ -615,9 +592,8 @@ struct Port * PortP;
|
|||||||
** iv ) we haven't outstayed our welcome
|
** iv ) we haven't outstayed our welcome
|
||||||
*/
|
*/
|
||||||
transCount = 1;
|
transCount = 1;
|
||||||
while ( can_remove_receive(&PacketP, PortP)
|
while (can_remove_receive(&PacketP, PortP)
|
||||||
&& transCount)
|
&& transCount) {
|
||||||
{
|
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
PortP->Stat.RxIntCnt++;
|
PortP->Stat.RxIntCnt++;
|
||||||
#endif /* STATS */
|
#endif /* STATS */
|
||||||
@@ -626,21 +602,21 @@ struct Port * PortP;
|
|||||||
/*
|
/*
|
||||||
** check that it is not a command!
|
** check that it is not a command!
|
||||||
*/
|
*/
|
||||||
if ( PacketP->len & PKT_CMD_BIT ) {
|
if (PacketP->len & PKT_CMD_BIT) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "RIO: unexpected command packet received on PHB\n");
|
rio_dprintk(RIO_DEBUG_INTR, "RIO: unexpected command packet received on PHB\n");
|
||||||
/* rio_dprint(RIO_DEBUG_INTR, (" sysport = %d\n", p->RIOPortp->PortNum)); */
|
/* rio_dprint(RIO_DEBUG_INTR, (" sysport = %d\n", p->RIOPortp->PortNum)); */
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " dest_unit = %d\n", PacketP->dest_unit);
|
rio_dprintk(RIO_DEBUG_INTR, " dest_unit = %d\n", PacketP->dest_unit);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " dest_port = %d\n", PacketP->dest_port);
|
rio_dprintk(RIO_DEBUG_INTR, " dest_port = %d\n", PacketP->dest_port);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " src_unit = %d\n", PacketP->src_unit);
|
rio_dprintk(RIO_DEBUG_INTR, " src_unit = %d\n", PacketP->src_unit);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " src_port = %d\n", PacketP->src_port);
|
rio_dprintk(RIO_DEBUG_INTR, " src_port = %d\n", PacketP->src_port);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " len = %d\n", PacketP->len);
|
rio_dprintk(RIO_DEBUG_INTR, " len = %d\n", PacketP->len);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " control = %d\n", PacketP->control);
|
rio_dprintk(RIO_DEBUG_INTR, " control = %d\n", PacketP->control);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " csum = %d\n", PacketP->csum);
|
rio_dprintk(RIO_DEBUG_INTR, " csum = %d\n", PacketP->csum);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " data bytes: ");
|
rio_dprintk(RIO_DEBUG_INTR, " data bytes: ");
|
||||||
for ( DataCnt=0; DataCnt<PKT_MAX_DATA_LEN; DataCnt++ )
|
for (DataCnt = 0; DataCnt < PKT_MAX_DATA_LEN; DataCnt++)
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "%d\n", PacketP->data[DataCnt]);
|
rio_dprintk(RIO_DEBUG_INTR, "%d\n", PacketP->data[DataCnt]);
|
||||||
remove_receive( PortP );
|
remove_receive(PortP);
|
||||||
put_free_end( PortP->HostP, PacketP );
|
put_free_end(PortP->HostP, PacketP);
|
||||||
continue; /* with next packet */
|
continue; /* with next packet */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,8 +636,7 @@ struct Port * PortP;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
transCount = tty_buffer_request_room(TtyP, PacketP->len & PKT_LEN_MASK);
|
transCount = tty_buffer_request_room(TtyP, PacketP->len & PKT_LEN_MASK);
|
||||||
rio_dprintk (RIO_DEBUG_REC, "port %d: Copy %d bytes\n",
|
rio_dprintk(RIO_DEBUG_REC, "port %d: Copy %d bytes\n", PortP->PortNum, transCount);
|
||||||
PortP->PortNum, transCount);
|
|
||||||
/*
|
/*
|
||||||
** To use the following 'kkprintfs' for debugging - change the '#undef'
|
** To use the following 'kkprintfs' for debugging - change the '#undef'
|
||||||
** to '#define', (this is the only place ___DEBUG_IT___ occurs in the
|
** to '#define', (this is the only place ___DEBUG_IT___ occurs in the
|
||||||
@@ -669,18 +644,12 @@ struct Port * PortP;
|
|||||||
*/
|
*/
|
||||||
#undef ___DEBUG_IT___
|
#undef ___DEBUG_IT___
|
||||||
#ifdef ___DEBUG_IT___
|
#ifdef ___DEBUG_IT___
|
||||||
kkprintf("I:%d R:%d P:%d Q:%d C:%d F:%x ",
|
kkprintf("I:%d R:%d P:%d Q:%d C:%d F:%x ", intCount, RxIntCnt, PortP->PortNum, TtyP->rxqueue.count, transCount, TtyP->flags);
|
||||||
intCount,
|
|
||||||
RxIntCnt,
|
|
||||||
PortP->PortNum,
|
|
||||||
TtyP->rxqueue.count,
|
|
||||||
transCount,
|
|
||||||
TtyP->flags );
|
|
||||||
#endif
|
#endif
|
||||||
ptr = (uchar *) PacketP->data + PortP->RxDataStart;
|
ptr = (uchar *) PacketP->data + PortP->RxDataStart;
|
||||||
|
|
||||||
tty_prepare_flip_string(TtyP, &buf, transCount);
|
tty_prepare_flip_string(TtyP, &buf, transCount);
|
||||||
rio_memcpy_fromio (buf, ptr, transCount);
|
rio_memcpy_fromio(buf, ptr, transCount);
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
/*
|
/*
|
||||||
** keep a count for statistical purposes
|
** keep a count for statistical purposes
|
||||||
@@ -693,18 +662,17 @@ struct Port * PortP;
|
|||||||
|
|
||||||
|
|
||||||
#ifdef ___DEBUG_IT___
|
#ifdef ___DEBUG_IT___
|
||||||
kkprintf("T:%d L:%d\n", DataCnt, PacketP->len );
|
kkprintf("T:%d L:%d\n", DataCnt, PacketP->len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( PacketP->len == 0 )
|
if (PacketP->len == 0) {
|
||||||
{
|
|
||||||
/*
|
/*
|
||||||
** If we have emptied the packet, then we can
|
** If we have emptied the packet, then we can
|
||||||
** free it, and reset the start pointer for
|
** free it, and reset the start pointer for
|
||||||
** the next packet.
|
** the next packet.
|
||||||
*/
|
*/
|
||||||
remove_receive( PortP );
|
remove_receive(PortP);
|
||||||
put_free_end( PortP->HostP, PacketP );
|
put_free_end(PortP->HostP, PacketP);
|
||||||
PortP->RxDataStart = 0;
|
PortP->RxDataStart = 0;
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
/*
|
/*
|
||||||
@@ -716,8 +684,8 @@ struct Port * PortP;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (copied) {
|
if (copied) {
|
||||||
rio_dprintk (RIO_DEBUG_REC, "port %d: pushing tty flip buffer: %d total bytes copied.\n", PortP->PortNum, copied);
|
rio_dprintk(RIO_DEBUG_REC, "port %d: pushing tty flip buffer: %d total bytes copied.\n", PortP->PortNum, copied);
|
||||||
tty_flip_buffer_push (TtyP);
|
tty_flip_buffer_push(TtyP);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -728,9 +696,8 @@ struct Port * PortP;
|
|||||||
** The proc routine called by the line discipline to do the work for it.
|
** The proc routine called by the line discipline to do the work for it.
|
||||||
** The proc routine works hand in hand with the interrupt routine.
|
** The proc routine works hand in hand with the interrupt routine.
|
||||||
*/
|
*/
|
||||||
int
|
int riotproc(p, tp, cmd, port)
|
||||||
riotproc(p, tp, cmd, port)
|
struct rio_info *p;
|
||||||
struct rio_info * p;
|
|
||||||
register struct ttystatics *tp;
|
register struct ttystatics *tp;
|
||||||
int cmd;
|
int cmd;
|
||||||
int port;
|
int port;
|
||||||
@@ -741,26 +708,24 @@ int port;
|
|||||||
|
|
||||||
SysPort = port; /* Believe me, it works. */
|
SysPort = port; /* Believe me, it works. */
|
||||||
|
|
||||||
if ( SysPort < 0 || SysPort >= RIO_PORTS ) {
|
if (SysPort < 0 || SysPort >= RIO_PORTS) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Illegal port %d derived from TTY in riotproc()\n",SysPort);
|
rio_dprintk(RIO_DEBUG_INTR, "Illegal port %d derived from TTY in riotproc()\n", SysPort);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
PortP = p->RIOPortp[SysPort];
|
PortP = p->RIOPortp[SysPort];
|
||||||
|
|
||||||
if ((uint)PortP->PhbP < (uint)PortP->Caddr ||
|
if ((uint) PortP->PhbP < (uint) PortP->Caddr || (uint) PortP->PhbP >= (uint) PortP->Caddr + SIXTY_FOUR_K) {
|
||||||
(uint)PortP->PhbP >= (uint)PortP->Caddr+SIXTY_FOUR_K ) {
|
rio_dprintk(RIO_DEBUG_INTR, "RIO: NULL or BAD PhbP on sys port %d in proc routine\n", SysPort);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "RIO: NULL or BAD PhbP on sys port %d in proc routine\n",
|
rio_dprintk(RIO_DEBUG_INTR, " PortP = 0x%x\n", PortP);
|
||||||
SysPort);
|
rio_dprintk(RIO_DEBUG_INTR, " PortP->PhbP = 0x%x\n", PortP->PhbP);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " PortP = 0x%x\n",PortP);
|
rio_dprintk(RIO_DEBUG_INTR, " PortP->Caddr = 0x%x\n", PortP->PhbP);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " PortP->PhbP = 0x%x\n",PortP->PhbP);
|
rio_dprintk(RIO_DEBUG_INTR, " PortP->HostPort = 0x%x\n", PortP->HostPort);
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " PortP->Caddr = 0x%x\n",PortP->PhbP);
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, " PortP->HostPort = 0x%x\n",PortP->HostPort);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(cmd) {
|
switch (cmd) {
|
||||||
case T_WFLUSH:
|
case T_WFLUSH:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_WFLUSH\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_WFLUSH\n");
|
||||||
/*
|
/*
|
||||||
** Because of the spooky way the RIO works, we don't need
|
** Because of the spooky way the RIO works, we don't need
|
||||||
** to issue a flush command on any of the SET*F commands,
|
** to issue a flush command on any of the SET*F commands,
|
||||||
@@ -772,27 +737,24 @@ int port;
|
|||||||
** here we only issue a WFLUSH command if we are in the interrupt
|
** here we only issue a WFLUSH command if we are in the interrupt
|
||||||
** routine, or we aren't executing a SET*F command.
|
** routine, or we aren't executing a SET*F command.
|
||||||
*/
|
*/
|
||||||
if ( PortP->HostP->InIntr || !PortP->FlushCmdBodge ) {
|
if (PortP->HostP->InIntr || !PortP->FlushCmdBodge) {
|
||||||
/*
|
/*
|
||||||
** form a wflush packet - 1 byte long, no data
|
** form a wflush packet - 1 byte long, no data
|
||||||
*/
|
*/
|
||||||
if ( PortP->State & RIO_DELETED ) {
|
if (PortP->State & RIO_DELETED) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "WFLUSH on deleted RTA\n");
|
rio_dprintk(RIO_DEBUG_INTR, "WFLUSH on deleted RTA\n");
|
||||||
}
|
} else {
|
||||||
else {
|
if (RIOPreemptiveCmd(p, PortP, WFLUSH) == RIO_FAIL) {
|
||||||
if ( RIOPreemptiveCmd(p, PortP, WFLUSH ) == RIO_FAIL ) {
|
rio_dprintk(RIO_DEBUG_INTR, "T_WFLUSH Command failed\n");
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_WFLUSH Command failed\n");
|
} else
|
||||||
}
|
rio_dprintk(RIO_DEBUG_INTR, "T_WFLUSH Command\n");
|
||||||
else
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_WFLUSH Command\n");
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
** WFLUSH operation - flush the data!
|
** WFLUSH operation - flush the data!
|
||||||
*/
|
*/
|
||||||
PortP->TxBufferIn = PortP->TxBufferOut = 0;
|
PortP->TxBufferIn = PortP->TxBufferOut = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
rio_dprintk(RIO_DEBUG_INTR, "T_WFLUSH Command ignored\n");
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_WFLUSH Command ignored\n");
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
** sort out the line discipline
|
** sort out the line discipline
|
||||||
@@ -802,16 +764,15 @@ int port;
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case T_RESUME:
|
case T_RESUME:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_RESUME\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_RESUME\n");
|
||||||
/*
|
/*
|
||||||
** send pre-emptive resume packet
|
** send pre-emptive resume packet
|
||||||
*/
|
*/
|
||||||
if ( PortP->State & RIO_DELETED ) {
|
if (PortP->State & RIO_DELETED) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "RESUME on deleted RTA\n");
|
rio_dprintk(RIO_DEBUG_INTR, "RESUME on deleted RTA\n");
|
||||||
}
|
} else {
|
||||||
else {
|
if (RIOPreemptiveCmd(p, PortP, RESUME) == RIO_FAIL) {
|
||||||
if ( RIOPreemptiveCmd(p, PortP, RESUME ) == RIO_FAIL ) {
|
rio_dprintk(RIO_DEBUG_INTR, "T_RESUME Command failed\n");
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_RESUME Command failed\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -822,7 +783,7 @@ int port;
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case T_TIME:
|
case T_TIME:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_TIME\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_TIME\n");
|
||||||
/*
|
/*
|
||||||
** T_TIME is called when xDLY is set in oflags and
|
** T_TIME is called when xDLY is set in oflags and
|
||||||
** the line discipline timeout has expired. It's
|
** the line discipline timeout has expired. It's
|
||||||
@@ -833,27 +794,26 @@ int port;
|
|||||||
** Fall through and re-start output
|
** Fall through and re-start output
|
||||||
*/
|
*/
|
||||||
case T_OUTPUT:
|
case T_OUTPUT:
|
||||||
start:
|
start:
|
||||||
if ( PortP->MagicFlags & MAGIC_FLUSH ) {
|
if (PortP->MagicFlags & MAGIC_FLUSH) {
|
||||||
PortP->MagicFlags |= MORE_OUTPUT_EYGOR;
|
PortP->MagicFlags |= MORE_OUTPUT_EYGOR;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
RIOTxEnable((char *)PortP);
|
RIOTxEnable((char *) PortP);
|
||||||
PortP->MagicFlags &= ~MORE_OUTPUT_EYGOR;
|
PortP->MagicFlags &= ~MORE_OUTPUT_EYGOR;
|
||||||
/*rio_dprint(RIO_DEBUG_INTR, PortP,DBG_PROC,"T_OUTPUT finished\n");*/
|
/*rio_dprint(RIO_DEBUG_INTR, PortP,DBG_PROC,"T_OUTPUT finished\n"); */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_SUSPEND:
|
case T_SUSPEND:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_SUSPEND\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_SUSPEND\n");
|
||||||
/*
|
/*
|
||||||
** send a suspend pre-emptive packet.
|
** send a suspend pre-emptive packet.
|
||||||
*/
|
*/
|
||||||
if ( PortP->State & RIO_DELETED ) {
|
if (PortP->State & RIO_DELETED) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "SUSPEND deleted RTA\n");
|
rio_dprintk(RIO_DEBUG_INTR, "SUSPEND deleted RTA\n");
|
||||||
}
|
} else {
|
||||||
else {
|
if (RIOPreemptiveCmd(p, PortP, SUSPEND) == RIO_FAIL) {
|
||||||
if ( RIOPreemptiveCmd(p, PortP, SUSPEND ) == RIO_FAIL ) {
|
rio_dprintk(RIO_DEBUG_INTR, "T_SUSPEND Command failed\n");
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_SUSPEND Command failed\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -862,38 +822,37 @@ start:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case T_BLOCK:
|
case T_BLOCK:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_BLOCK\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_BLOCK\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_RFLUSH:
|
case T_RFLUSH:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_RFLUSH\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_RFLUSH\n");
|
||||||
if ( PortP->State & RIO_DELETED ) {
|
if (PortP->State & RIO_DELETED) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "RFLUSH on deleted RTA\n");
|
rio_dprintk(RIO_DEBUG_INTR, "RFLUSH on deleted RTA\n");
|
||||||
PortP->RxDataStart = 0;
|
PortP->RxDataStart = 0;
|
||||||
}
|
} else {
|
||||||
else {
|
if (RIOPreemptiveCmd(p, PortP, RFLUSH) == RIO_FAIL) {
|
||||||
if ( RIOPreemptiveCmd( p, PortP, RFLUSH ) == RIO_FAIL ) {
|
rio_dprintk(RIO_DEBUG_INTR, "T_RFLUSH Command failed\n");
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_RFLUSH Command failed\n");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
PortP->RxDataStart = 0;
|
PortP->RxDataStart = 0;
|
||||||
while ( can_remove_receive(&PacketP, PortP) ) {
|
while (can_remove_receive(&PacketP, PortP)) {
|
||||||
remove_receive(PortP);
|
remove_receive(PortP);
|
||||||
ShowPacket(DBG_PROC, PacketP );
|
ShowPacket(DBG_PROC, PacketP);
|
||||||
put_free_end(PortP->HostP, PacketP );
|
put_free_end(PortP->HostP, PacketP);
|
||||||
}
|
}
|
||||||
if ( PortP->PhbP->handshake == PHB_HANDSHAKE_SET ) {
|
if (PortP->PhbP->handshake == PHB_HANDSHAKE_SET) {
|
||||||
/*
|
/*
|
||||||
** MAGIC!
|
** MAGIC!
|
||||||
*/
|
*/
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Set receive handshake bit\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Set receive handshake bit\n");
|
||||||
PortP->PhbP->handshake |= PHB_HANDSHAKE_RESET;
|
PortP->PhbP->handshake |= PHB_HANDSHAKE_RESET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case T_UNBLOCK:
|
case T_UNBLOCK:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_UNBLOCK\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_UNBLOCK\n");
|
||||||
/*
|
/*
|
||||||
** If there is any data to receive set a timeout to service it.
|
** If there is any data to receive set a timeout to service it.
|
||||||
*/
|
*/
|
||||||
@@ -901,7 +860,7 @@ start:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case T_BREAK:
|
case T_BREAK:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "T_BREAK\n");
|
rio_dprintk(RIO_DEBUG_INTR, "T_BREAK\n");
|
||||||
/*
|
/*
|
||||||
** Send a break command. For Sys V
|
** Send a break command. For Sys V
|
||||||
** this is a timed break, so we
|
** this is a timed break, so we
|
||||||
@@ -910,13 +869,11 @@ start:
|
|||||||
/*
|
/*
|
||||||
** Build a BREAK command
|
** Build a BREAK command
|
||||||
*/
|
*/
|
||||||
if ( PortP->State & RIO_DELETED ) {
|
if (PortP->State & RIO_DELETED) {
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "BREAK on deleted RTA\n");
|
rio_dprintk(RIO_DEBUG_INTR, "BREAK on deleted RTA\n");
|
||||||
}
|
} else {
|
||||||
else {
|
if (RIOShortCommand(PortP, SBREAK, 2, p->RIOConf.BreakInterval) == RIO_FAIL) {
|
||||||
if (RIOShortCommand(PortP,SBREAK,2,
|
rio_dprintk(RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n");
|
||||||
p->RIOConf.BreakInterval)==RIO_FAIL) {
|
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -926,23 +883,23 @@ start:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case T_INPUT:
|
case T_INPUT:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Proc T_INPUT called - I don't know what to do!\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Proc T_INPUT called - I don't know what to do!\n");
|
||||||
break;
|
break;
|
||||||
case T_PARM:
|
case T_PARM:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Proc T_PARM called - I don't know what to do!\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Proc T_PARM called - I don't know what to do!\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_SWTCH:
|
case T_SWTCH:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Proc T_SWTCH called - I don't know what to do!\n");
|
rio_dprintk(RIO_DEBUG_INTR, "Proc T_SWTCH called - I don't know what to do!\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
rio_dprintk (RIO_DEBUG_INTR, "Proc UNKNOWN command %d\n",cmd);
|
rio_dprintk(RIO_DEBUG_INTR, "Proc UNKNOWN command %d\n", cmd);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
** T_OUTPUT returns without passing through this point!
|
** T_OUTPUT returns without passing through this point!
|
||||||
*/
|
*/
|
||||||
/*rio_dprint(RIO_DEBUG_INTR, PortP,DBG_PROC,"riotproc done\n");*/
|
/*rio_dprint(RIO_DEBUG_INTR, PortP,DBG_PROC,"riotproc done\n"); */
|
||||||
return(0);
|
return (0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -157,8 +157,7 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
|
|||||||
** NB. for MPX
|
** NB. for MPX
|
||||||
** tty lock must NOT have been previously acquired.
|
** tty lock must NOT have been previously acquired.
|
||||||
*/
|
*/
|
||||||
int
|
int RIOParam(PortP, cmd, Modem, SleepFlag)
|
||||||
RIOParam(PortP, cmd, Modem, SleepFlag)
|
|
||||||
struct Port *PortP;
|
struct Port *PortP;
|
||||||
int cmd;
|
int cmd;
|
||||||
int Modem;
|
int Modem;
|
||||||
@@ -169,27 +168,26 @@ int SleepFlag;
|
|||||||
register struct phb_param *phb_param_ptr;
|
register struct phb_param *phb_param_ptr;
|
||||||
PKT *PacketP;
|
PKT *PacketP;
|
||||||
int res;
|
int res;
|
||||||
uchar Cor1=0, Cor2=0, Cor4=0, Cor5=0;
|
uchar Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0;
|
||||||
uchar TxXon=0, TxXoff=0, RxXon=0, RxXoff=0;
|
uchar TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0;
|
||||||
uchar LNext=0, TxBaud=0, RxBaud=0;
|
uchar LNext = 0, TxBaud = 0, RxBaud = 0;
|
||||||
int retries = 0xff;
|
int retries = 0xff;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
func_enter ();
|
func_enter();
|
||||||
|
|
||||||
TtyP = PortP->gs.tty;
|
TtyP = PortP->gs.tty;
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "RIOParam: Port:%d cmd:%d Modem:%d SleepFlag:%d Mapped: %d, tty=%p\n",
|
rio_dprintk(RIO_DEBUG_PARAM, "RIOParam: Port:%d cmd:%d Modem:%d SleepFlag:%d Mapped: %d, tty=%p\n", PortP->PortNum, cmd, Modem, SleepFlag, PortP->Mapped, TtyP);
|
||||||
PortP->PortNum, cmd, Modem, SleepFlag, PortP->Mapped, TtyP);
|
|
||||||
|
|
||||||
if (!TtyP) {
|
if (!TtyP) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Can't call rioparam with null tty.\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Can't call rioparam with null tty.\n");
|
||||||
|
|
||||||
func_exit ();
|
func_exit();
|
||||||
|
|
||||||
return RIO_FAIL;
|
return RIO_FAIL;
|
||||||
}
|
}
|
||||||
rio_spin_lock_irqsave(&PortP->portSem, flags );
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
|
|
||||||
if (cmd == OPEN) {
|
if (cmd == OPEN) {
|
||||||
/*
|
/*
|
||||||
@@ -207,9 +205,8 @@ int SleepFlag;
|
|||||||
for (i = 0; i < NCC + 5; i++)
|
for (i = 0; i < NCC + 5; i++)
|
||||||
PortP->StoredTty.cc[i] = TtyP->tm.c_cc[i];
|
PortP->StoredTty.cc[i] = TtyP->tm.c_cc[i];
|
||||||
PortP->FirstOpen = 0;
|
PortP->FirstOpen = 0;
|
||||||
}
|
} else if (PortP->Store || PortP->Lock) {
|
||||||
else if (PortP->Store || PortP->Lock) {
|
rio_dprintk(RIO_DEBUG_PARAM, "OPEN: Restoring stored/locked params\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "OPEN: Restoring stored/locked params\n");
|
|
||||||
TtyP->tm.c_iflag = PortP->StoredTty.iflag;
|
TtyP->tm.c_iflag = PortP->StoredTty.iflag;
|
||||||
TtyP->tm.c_oflag = PortP->StoredTty.oflag;
|
TtyP->tm.c_oflag = PortP->StoredTty.oflag;
|
||||||
TtyP->tm.c_cflag = PortP->StoredTty.cflag;
|
TtyP->tm.c_cflag = PortP->StoredTty.cflag;
|
||||||
@@ -224,209 +221,201 @@ int SleepFlag;
|
|||||||
/*
|
/*
|
||||||
** wait for space
|
** wait for space
|
||||||
*/
|
*/
|
||||||
while ( !(res=can_add_transmit(&PacketP,PortP)) ||
|
while (!(res = can_add_transmit(&PacketP, PortP)) || (PortP->InUse != NOT_INUSE)) {
|
||||||
(PortP->InUse != NOT_INUSE) ) {
|
if (retries-- <= 0) {
|
||||||
if (retries -- <= 0) {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( PortP->InUse != NOT_INUSE ) {
|
if (PortP->InUse != NOT_INUSE) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Port IN_USE for pre-emptive command\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Port IN_USE for pre-emptive command\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !res ) {
|
if (!res) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Port has no space on transmit queue\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Port has no space on transmit queue\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( SleepFlag != OK_TO_SLEEP ) {
|
if (SleepFlag != OK_TO_SLEEP) {
|
||||||
rio_spin_unlock_irqrestore( &PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
func_exit();
|
func_exit();
|
||||||
|
|
||||||
return RIO_FAIL;
|
return RIO_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "wait for can_add_transmit\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "wait for can_add_transmit\n");
|
||||||
rio_spin_unlock_irqrestore( &PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
retval = RIODelay(PortP, HUNDRED_MS);
|
retval = RIODelay(PortP, HUNDRED_MS);
|
||||||
rio_spin_lock_irqsave( &PortP->portSem, flags);
|
rio_spin_lock_irqsave(&PortP->portSem, flags);
|
||||||
if (retval == RIO_FAIL) {
|
if (retval == RIO_FAIL) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "wait for can_add_transmit broken by signal\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "wait for can_add_transmit broken by signal\n");
|
||||||
rio_spin_unlock_irqrestore( &PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
pseterr(EINTR);
|
pseterr(EINTR);
|
||||||
func_exit();
|
func_exit();
|
||||||
|
|
||||||
return RIO_FAIL;
|
return RIO_FAIL;
|
||||||
}
|
}
|
||||||
if ( PortP->State & RIO_DELETED ) {
|
if (PortP->State & RIO_DELETED) {
|
||||||
rio_spin_unlock_irqrestore( &PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
func_exit ();
|
func_exit();
|
||||||
|
|
||||||
return RIO_SUCCESS;
|
return RIO_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
rio_spin_unlock_irqrestore( &PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
func_exit ();
|
func_exit();
|
||||||
|
|
||||||
return RIO_FAIL;
|
return RIO_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n",res);
|
rio_dprintk(RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n", res);
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Packet is 0x%x\n",(int) PacketP);
|
rio_dprintk(RIO_DEBUG_PARAM, "Packet is 0x%x\n", (int) PacketP);
|
||||||
|
|
||||||
phb_param_ptr = (struct phb_param *)PacketP->data;
|
phb_param_ptr = (struct phb_param *) PacketP->data;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
** COR 1
|
** COR 1
|
||||||
*/
|
*/
|
||||||
if ( TtyP->tm.c_iflag & INPCK ) {
|
if (TtyP->tm.c_iflag & INPCK) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Parity checking on input enabled\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Parity checking on input enabled\n");
|
||||||
Cor1 |= COR1_INPCK;
|
Cor1 |= COR1_INPCK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch ( TtyP->termios->c_cflag & CSIZE ) {
|
switch (TtyP->termios->c_cflag & CSIZE) {
|
||||||
case CS5:
|
case CS5:
|
||||||
{
|
{
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "5 bit data\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "5 bit data\n");
|
||||||
Cor1 |= COR1_5BITS;
|
Cor1 |= COR1_5BITS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CS6:
|
case CS6:
|
||||||
{
|
{
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "6 bit data\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "6 bit data\n");
|
||||||
Cor1 |= COR1_6BITS;
|
Cor1 |= COR1_6BITS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CS7:
|
case CS7:
|
||||||
{
|
{
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "7 bit data\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "7 bit data\n");
|
||||||
Cor1 |= COR1_7BITS;
|
Cor1 |= COR1_7BITS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CS8:
|
case CS8:
|
||||||
{
|
{
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "8 bit data\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "8 bit data\n");
|
||||||
Cor1 |= COR1_8BITS;
|
Cor1 |= COR1_8BITS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_cflag & CSTOPB ) {
|
if (TtyP->termios->c_cflag & CSTOPB) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "2 stop bits\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "2 stop bits\n");
|
||||||
Cor1 |= COR1_2STOP;
|
Cor1 |= COR1_2STOP;
|
||||||
}
|
} else {
|
||||||
else {
|
rio_dprintk(RIO_DEBUG_PARAM, "1 stop bit\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "1 stop bit\n");
|
|
||||||
Cor1 |= COR1_1STOP;
|
Cor1 |= COR1_1STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_cflag & PARENB ) {
|
if (TtyP->termios->c_cflag & PARENB) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable parity\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable parity\n");
|
||||||
Cor1 |= COR1_NORMAL;
|
Cor1 |= COR1_NORMAL;
|
||||||
}
|
} else {
|
||||||
else {
|
rio_dprintk(RIO_DEBUG_PARAM, "Disable parity\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Disable parity\n");
|
|
||||||
Cor1 |= COR1_NOP;
|
Cor1 |= COR1_NOP;
|
||||||
}
|
}
|
||||||
if ( TtyP->termios->c_cflag & PARODD ) {
|
if (TtyP->termios->c_cflag & PARODD) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Odd parity\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Odd parity\n");
|
||||||
Cor1 |= COR1_ODD;
|
Cor1 |= COR1_ODD;
|
||||||
}
|
} else {
|
||||||
else {
|
rio_dprintk(RIO_DEBUG_PARAM, "Even parity\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Even parity\n");
|
|
||||||
Cor1 |= COR1_EVEN;
|
Cor1 |= COR1_EVEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** COR 2
|
** COR 2
|
||||||
*/
|
*/
|
||||||
if ( TtyP->termios->c_iflag & IXON ) {
|
if (TtyP->termios->c_iflag & IXON) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable start/stop output control\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable start/stop output control\n");
|
||||||
Cor2 |= COR2_IXON;
|
Cor2 |= COR2_IXON;
|
||||||
}
|
} else {
|
||||||
else {
|
if (PortP->Config & RIO_IXON) {
|
||||||
if ( PortP->Config & RIO_IXON ) {
|
rio_dprintk(RIO_DEBUG_PARAM, "Force enable start/stop output control\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Force enable start/stop output control\n");
|
|
||||||
Cor2 |= COR2_IXON;
|
Cor2 |= COR2_IXON;
|
||||||
}
|
} else
|
||||||
else
|
rio_dprintk(RIO_DEBUG_PARAM, "IXON has been disabled.\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "IXON has been disabled.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TtyP->termios->c_iflag & IXANY) {
|
if (TtyP->termios->c_iflag & IXANY) {
|
||||||
if ( PortP->Config & RIO_IXANY ) {
|
if (PortP->Config & RIO_IXANY) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable any key to restart output\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable any key to restart output\n");
|
||||||
Cor2 |= COR2_IXANY;
|
Cor2 |= COR2_IXANY;
|
||||||
}
|
} else
|
||||||
else
|
rio_dprintk(RIO_DEBUG_PARAM, "IXANY has been disabled due to sanity reasons.\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "IXANY has been disabled due to sanity reasons.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_iflag & IXOFF ) {
|
if (TtyP->termios->c_iflag & IXOFF) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable start/stop input control 2\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable start/stop input control 2\n");
|
||||||
Cor2 |= COR2_IXOFF;
|
Cor2 |= COR2_IXOFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_cflag & HUPCL ) {
|
if (TtyP->termios->c_cflag & HUPCL) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Hangup on last close\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Hangup on last close\n");
|
||||||
Cor2 |= COR2_HUPCL;
|
Cor2 |= COR2_HUPCL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( C_CRTSCTS (TtyP)) {
|
if (C_CRTSCTS(TtyP)) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Rx hardware flow control enabled\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Rx hardware flow control enabled\n");
|
||||||
Cor2 |= COR2_CTSFLOW;
|
Cor2 |= COR2_CTSFLOW;
|
||||||
Cor2 |= COR2_RTSFLOW;
|
Cor2 |= COR2_RTSFLOW;
|
||||||
} else {
|
} else {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Rx hardware flow control disabled\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Rx hardware flow control disabled\n");
|
||||||
Cor2 &= ~COR2_CTSFLOW;
|
Cor2 &= ~COR2_CTSFLOW;
|
||||||
Cor2 &= ~COR2_RTSFLOW;
|
Cor2 &= ~COR2_RTSFLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( TtyP->termios->c_cflag & CLOCAL ) {
|
if (TtyP->termios->c_cflag & CLOCAL) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Local line\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Local line\n");
|
||||||
}
|
} else {
|
||||||
else {
|
rio_dprintk(RIO_DEBUG_PARAM, "Possible Modem line\n");
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Possible Modem line\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** COR 4 (there is no COR 3)
|
** COR 4 (there is no COR 3)
|
||||||
*/
|
*/
|
||||||
if ( TtyP->termios->c_iflag & IGNBRK ) {
|
if (TtyP->termios->c_iflag & IGNBRK) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Ignore break condition\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Ignore break condition\n");
|
||||||
Cor4 |= COR4_IGNBRK;
|
Cor4 |= COR4_IGNBRK;
|
||||||
}
|
}
|
||||||
if ( !(TtyP->termios->c_iflag & BRKINT) ) {
|
if (!(TtyP->termios->c_iflag & BRKINT)) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Break generates NULL condition\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Break generates NULL condition\n");
|
||||||
Cor4 |= COR4_NBRKINT;
|
Cor4 |= COR4_NBRKINT;
|
||||||
} else {
|
} else {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Interrupt on break condition\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Interrupt on break condition\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_iflag & INLCR ) {
|
if (TtyP->termios->c_iflag & INLCR) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Map newline to carriage return on input\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Map newline to carriage return on input\n");
|
||||||
Cor4 |= COR4_INLCR;
|
Cor4 |= COR4_INLCR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_iflag & IGNCR ) {
|
if (TtyP->termios->c_iflag & IGNCR) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Ignore carriage return on input\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Ignore carriage return on input\n");
|
||||||
Cor4 |= COR4_IGNCR;
|
Cor4 |= COR4_IGNCR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_iflag & ICRNL ) {
|
if (TtyP->termios->c_iflag & ICRNL) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Map carriage return to newline on input\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Map carriage return to newline on input\n");
|
||||||
Cor4 |= COR4_ICRNL;
|
Cor4 |= COR4_ICRNL;
|
||||||
}
|
}
|
||||||
if ( TtyP->termios->c_iflag & IGNPAR ) {
|
if (TtyP->termios->c_iflag & IGNPAR) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Ignore characters with parity errors\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Ignore characters with parity errors\n");
|
||||||
Cor4 |= COR4_IGNPAR;
|
Cor4 |= COR4_IGNPAR;
|
||||||
}
|
}
|
||||||
if ( TtyP->termios->c_iflag & PARMRK ) {
|
if (TtyP->termios->c_iflag & PARMRK) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Mark parity errors\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Mark parity errors\n");
|
||||||
Cor4 |= COR4_PARMRK;
|
Cor4 |= COR4_PARMRK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,26 +444,26 @@ int SleepFlag;
|
|||||||
/*
|
/*
|
||||||
** Could set LNE here if you wanted LNext processing. SVR4 will use it.
|
** Could set LNE here if you wanted LNext processing. SVR4 will use it.
|
||||||
*/
|
*/
|
||||||
if ( TtyP->termios->c_iflag & ISTRIP ) {
|
if (TtyP->termios->c_iflag & ISTRIP) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Strip input characters\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Strip input characters\n");
|
||||||
if (! (PortP->State & RIO_TRIAD_MODE)) {
|
if (!(PortP->State & RIO_TRIAD_MODE)) {
|
||||||
Cor5 |= COR5_ISTRIP;
|
Cor5 |= COR5_ISTRIP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( TtyP->termios->c_oflag & ONLCR ) {
|
if (TtyP->termios->c_oflag & ONLCR) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Map newline to carriage-return, newline on output\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Map newline to carriage-return, newline on output\n");
|
||||||
if ( PortP->CookMode == COOK_MEDIUM )
|
if (PortP->CookMode == COOK_MEDIUM)
|
||||||
Cor5 |= COR5_ONLCR;
|
Cor5 |= COR5_ONLCR;
|
||||||
}
|
}
|
||||||
if ( TtyP->termios->c_oflag & OCRNL ) {
|
if (TtyP->termios->c_oflag & OCRNL) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Map carriage return to newline on output\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Map carriage return to newline on output\n");
|
||||||
if ( PortP->CookMode == COOK_MEDIUM )
|
if (PortP->CookMode == COOK_MEDIUM)
|
||||||
Cor5 |= COR5_OCRNL;
|
Cor5 |= COR5_OCRNL;
|
||||||
}
|
}
|
||||||
if ( ( TtyP->termios->c_oflag & TABDLY) == TAB3 ) {
|
if ((TtyP->termios->c_oflag & TABDLY) == TAB3) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Tab delay 3 set\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Tab delay 3 set\n");
|
||||||
if ( PortP->CookMode == COOK_MEDIUM )
|
if (PortP->CookMode == COOK_MEDIUM)
|
||||||
Cor5 |= COR5_TAB3;
|
Cor5 |= COR5_TAB3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,99 +482,112 @@ int SleepFlag;
|
|||||||
/*
|
/*
|
||||||
** Baud rate bytes
|
** Baud rate bytes
|
||||||
*/
|
*/
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Mapping of rx/tx baud %x (%x)\n",
|
rio_dprintk(RIO_DEBUG_PARAM, "Mapping of rx/tx baud %x (%x)\n", TtyP->termios->c_cflag, CBAUD);
|
||||||
TtyP->termios->c_cflag, CBAUD);
|
|
||||||
|
|
||||||
switch (TtyP->termios->c_cflag & CBAUD) {
|
switch (TtyP->termios->c_cflag & CBAUD) {
|
||||||
#define e(b) case B ## b : RxBaud = TxBaud = RIO_B ## b ;break
|
#define e(b) case B ## b : RxBaud = TxBaud = RIO_B ## b ;break
|
||||||
e(50);e(75);e(110);e(134);e(150);e(200);e(300);e(600);e(1200);
|
e(50);
|
||||||
e(1800);e(2400);e(4800);e(9600);e(19200);e(38400);e(57600);
|
e(75);
|
||||||
|
e(110);
|
||||||
|
e(134);
|
||||||
|
e(150);
|
||||||
|
e(200);
|
||||||
|
e(300);
|
||||||
|
e(600);
|
||||||
|
e(1200);
|
||||||
|
e(1800);
|
||||||
|
e(2400);
|
||||||
|
e(4800);
|
||||||
|
e(9600);
|
||||||
|
e(19200);
|
||||||
|
e(38400);
|
||||||
|
e(57600);
|
||||||
e(115200); /* e(230400);e(460800); e(921600); */
|
e(115200); /* e(230400);e(460800); e(921600); */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX MIssing conversion table. XXX */
|
/* XXX MIssing conversion table. XXX */
|
||||||
/* (TtyP->termios->c_cflag & V_CBAUD); */
|
/* (TtyP->termios->c_cflag & V_CBAUD); */
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "tx baud 0x%x, rx baud 0x%x\n", TxBaud, RxBaud);
|
rio_dprintk(RIO_DEBUG_PARAM, "tx baud 0x%x, rx baud 0x%x\n", TxBaud, RxBaud);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Leftovers
|
** Leftovers
|
||||||
*/
|
*/
|
||||||
if ( TtyP->termios->c_cflag & CREAD )
|
if (TtyP->termios->c_cflag & CREAD)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable receiver\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable receiver\n");
|
||||||
#ifdef RCV1EN
|
#ifdef RCV1EN
|
||||||
if ( TtyP->termios->c_cflag & RCV1EN )
|
if (TtyP->termios->c_cflag & RCV1EN)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "RCV1EN (?)\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "RCV1EN (?)\n");
|
||||||
#endif
|
#endif
|
||||||
#ifdef XMT1EN
|
#ifdef XMT1EN
|
||||||
if ( TtyP->termios->c_cflag & XMT1EN )
|
if (TtyP->termios->c_cflag & XMT1EN)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "XMT1EN (?)\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "XMT1EN (?)\n");
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 0
|
||||||
if ( TtyP->termios->c_cflag & LOBLK )
|
if (TtyP->termios->c_cflag & LOBLK)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "LOBLK - JCL output blocks when not current\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "LOBLK - JCL output blocks when not current\n");
|
||||||
#endif
|
#endif
|
||||||
if ( TtyP->termios->c_lflag & ISIG )
|
if (TtyP->termios->c_lflag & ISIG)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Input character signal generating enabled\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Input character signal generating enabled\n");
|
||||||
if ( TtyP->termios->c_lflag & ICANON )
|
if (TtyP->termios->c_lflag & ICANON)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Canonical input: erase and kill enabled\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Canonical input: erase and kill enabled\n");
|
||||||
if ( TtyP->termios->c_lflag & XCASE )
|
if (TtyP->termios->c_lflag & XCASE)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Canonical upper/lower presentation\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Canonical upper/lower presentation\n");
|
||||||
if ( TtyP->termios->c_lflag & ECHO )
|
if (TtyP->termios->c_lflag & ECHO)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable input echo\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable input echo\n");
|
||||||
if ( TtyP->termios->c_lflag & ECHOE )
|
if (TtyP->termios->c_lflag & ECHOE)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable echo erase\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable echo erase\n");
|
||||||
if ( TtyP->termios->c_lflag & ECHOK )
|
if (TtyP->termios->c_lflag & ECHOK)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable echo kill\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable echo kill\n");
|
||||||
if ( TtyP->termios->c_lflag & ECHONL )
|
if (TtyP->termios->c_lflag & ECHONL)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable echo newline\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable echo newline\n");
|
||||||
if ( TtyP->termios->c_lflag & NOFLSH )
|
if (TtyP->termios->c_lflag & NOFLSH)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Disable flush after interrupt or quit\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Disable flush after interrupt or quit\n");
|
||||||
#ifdef TOSTOP
|
#ifdef TOSTOP
|
||||||
if ( TtyP->termios->c_lflag & TOSTOP )
|
if (TtyP->termios->c_lflag & TOSTOP)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Send SIGTTOU for background output\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Send SIGTTOU for background output\n");
|
||||||
#endif
|
#endif
|
||||||
#ifdef XCLUDE
|
#ifdef XCLUDE
|
||||||
if ( TtyP->termios->c_lflag & XCLUDE )
|
if (TtyP->termios->c_lflag & XCLUDE)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Exclusive use of this line\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Exclusive use of this line\n");
|
||||||
#endif
|
#endif
|
||||||
if ( TtyP->termios->c_iflag & IUCLC )
|
if (TtyP->termios->c_iflag & IUCLC)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Map uppercase to lowercase on input\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Map uppercase to lowercase on input\n");
|
||||||
if ( TtyP->termios->c_oflag & OPOST )
|
if (TtyP->termios->c_oflag & OPOST)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Enable output post-processing\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Enable output post-processing\n");
|
||||||
if ( TtyP->termios->c_oflag & OLCUC )
|
if (TtyP->termios->c_oflag & OLCUC)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Map lowercase to uppercase on output\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Map lowercase to uppercase on output\n");
|
||||||
if ( TtyP->termios->c_oflag & ONOCR )
|
if (TtyP->termios->c_oflag & ONOCR)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "No carriage return output at column 0\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "No carriage return output at column 0\n");
|
||||||
if ( TtyP->termios->c_oflag & ONLRET )
|
if (TtyP->termios->c_oflag & ONLRET)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Newline performs carriage return function\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Newline performs carriage return function\n");
|
||||||
if ( TtyP->termios->c_oflag & OFILL )
|
if (TtyP->termios->c_oflag & OFILL)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Use fill characters for delay\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Use fill characters for delay\n");
|
||||||
if ( TtyP->termios->c_oflag & OFDEL )
|
if (TtyP->termios->c_oflag & OFDEL)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Fill character is DEL\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Fill character is DEL\n");
|
||||||
if ( TtyP->termios->c_oflag & NLDLY )
|
if (TtyP->termios->c_oflag & NLDLY)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Newline delay set\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Newline delay set\n");
|
||||||
if ( TtyP->termios->c_oflag & CRDLY )
|
if (TtyP->termios->c_oflag & CRDLY)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Carriage return delay set\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Carriage return delay set\n");
|
||||||
if ( TtyP->termios->c_oflag & TABDLY )
|
if (TtyP->termios->c_oflag & TABDLY)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Tab delay set\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Tab delay set\n");
|
||||||
#if 0
|
#if 0
|
||||||
if ( TtyP->termios->c_oflag & BSDLY )
|
if (TtyP->termios->c_oflag & BSDLY)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Back-space delay set\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Back-space delay set\n");
|
||||||
if ( TtyP->termios->c_oflag & VTDLY )
|
if (TtyP->termios->c_oflag & VTDLY)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Vertical tab delay set\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Vertical tab delay set\n");
|
||||||
if ( TtyP->termios->c_oflag & FFDLY )
|
if (TtyP->termios->c_oflag & FFDLY)
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "Form-feed delay set\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "Form-feed delay set\n");
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
** These things are kind of useful in a later life!
|
** These things are kind of useful in a later life!
|
||||||
*/
|
*/
|
||||||
PortP->Cor2Copy = Cor2;
|
PortP->Cor2Copy = Cor2;
|
||||||
|
|
||||||
if ( PortP->State & RIO_DELETED ) {
|
if (PortP->State & RIO_DELETED) {
|
||||||
rio_spin_unlock_irqrestore( &PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
func_exit ();
|
func_exit();
|
||||||
|
|
||||||
return RIO_FAIL;
|
return RIO_FAIL;
|
||||||
}
|
}
|
||||||
@@ -609,7 +611,7 @@ int SleepFlag;
|
|||||||
/*
|
/*
|
||||||
** Set the length/command field
|
** Set the length/command field
|
||||||
*/
|
*/
|
||||||
WBYTE(PacketP->len , 12 | PKT_CMD_BIT);
|
WBYTE(PacketP->len, 12 | PKT_CMD_BIT);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** The packet is formed - now, whack it off
|
** The packet is formed - now, whack it off
|
||||||
@@ -622,13 +624,13 @@ int SleepFlag;
|
|||||||
if (PortP->statsGather)
|
if (PortP->statsGather)
|
||||||
PortP->txchars += 12;
|
PortP->txchars += 12;
|
||||||
|
|
||||||
rio_spin_unlock_irqrestore( &PortP->portSem, flags);
|
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "add_transmit returned.\n");
|
rio_dprintk(RIO_DEBUG_PARAM, "add_transmit returned.\n");
|
||||||
/*
|
/*
|
||||||
** job done.
|
** job done.
|
||||||
*/
|
*/
|
||||||
func_exit ();
|
func_exit();
|
||||||
|
|
||||||
return RIO_SUCCESS;
|
return RIO_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -638,16 +640,15 @@ int SleepFlag;
|
|||||||
** We can add another packet to a transmit queue if the packet pointer pointed
|
** We can add another packet to a transmit queue if the packet pointer pointed
|
||||||
** to by the TxAdd pointer has PKT_IN_USE clear in its address.
|
** to by the TxAdd pointer has PKT_IN_USE clear in its address.
|
||||||
*/
|
*/
|
||||||
int
|
int can_add_transmit(PktP, PortP)
|
||||||
can_add_transmit(PktP, PortP)
|
|
||||||
PKT **PktP;
|
PKT **PktP;
|
||||||
struct Port *PortP;
|
struct Port *PortP;
|
||||||
{
|
{
|
||||||
register PKT *tp;
|
register PKT *tp;
|
||||||
|
|
||||||
*PktP = tp = (PKT *)RIO_PTR(PortP->Caddr,RWORD(*PortP->TxAdd));
|
*PktP = tp = (PKT *) RIO_PTR(PortP->Caddr, RWORD(*PortP->TxAdd));
|
||||||
|
|
||||||
return !((uint)tp & PKT_IN_USE);
|
return !((uint) tp & PKT_IN_USE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -655,25 +656,22 @@ struct Port *PortP;
|
|||||||
** and then move the TxAdd pointer along one position to point to the next
|
** and then move the TxAdd pointer along one position to point to the next
|
||||||
** packet pointer. You must wrap the pointer from the end back to the start.
|
** packet pointer. You must wrap the pointer from the end back to the start.
|
||||||
*/
|
*/
|
||||||
void
|
void add_transmit(PortP)
|
||||||
add_transmit(PortP)
|
|
||||||
struct Port *PortP;
|
struct Port *PortP;
|
||||||
{
|
{
|
||||||
if (RWORD(*PortP->TxAdd) & PKT_IN_USE) {
|
if (RWORD(*PortP->TxAdd) & PKT_IN_USE) {
|
||||||
rio_dprintk (RIO_DEBUG_PARAM, "add_transmit: Packet has been stolen!");
|
rio_dprintk(RIO_DEBUG_PARAM, "add_transmit: Packet has been stolen!");
|
||||||
}
|
}
|
||||||
WWORD( *(ushort *)PortP->TxAdd, RWORD(*PortP->TxAdd) | PKT_IN_USE);
|
WWORD(*(ushort *) PortP->TxAdd, RWORD(*PortP->TxAdd) | PKT_IN_USE);
|
||||||
PortP->TxAdd = (PortP->TxAdd == PortP->TxEnd) ? PortP->TxStart :
|
PortP->TxAdd = (PortP->TxAdd == PortP->TxEnd) ? PortP->TxStart : PortP->TxAdd + 1;
|
||||||
PortP->TxAdd + 1;
|
WWORD(PortP->PhbP->tx_add, RIO_OFF(PortP->Caddr, PortP->TxAdd));
|
||||||
WWORD( PortP->PhbP->tx_add , RIO_OFF(PortP->Caddr,PortP->TxAdd) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************
|
/****************************************
|
||||||
* Put a packet onto the end of the
|
* Put a packet onto the end of the
|
||||||
* free list
|
* free list
|
||||||
****************************************/
|
****************************************/
|
||||||
void
|
void put_free_end(HostP, PktP)
|
||||||
put_free_end(HostP, PktP)
|
|
||||||
struct Host *HostP;
|
struct Host *HostP;
|
||||||
PKT *PktP;
|
PKT *PktP;
|
||||||
{
|
{
|
||||||
@@ -688,24 +686,23 @@ PKT *PktP;
|
|||||||
*
|
*
|
||||||
************************************************/
|
************************************************/
|
||||||
|
|
||||||
rio_dprintk (RIO_DEBUG_PFE, "put_free_end(PktP=%x)\n",(int)PktP);
|
rio_dprintk(RIO_DEBUG_PFE, "put_free_end(PktP=%x)\n", (int) PktP);
|
||||||
|
|
||||||
if ((old_end=RWORD(HostP->ParmMapP->free_list_end)) != TPNULL) {
|
if ((old_end = RWORD(HostP->ParmMapP->free_list_end)) != TPNULL) {
|
||||||
new_end = RIO_OFF(HostP->Caddr,PktP);
|
new_end = RIO_OFF(HostP->Caddr, PktP);
|
||||||
tmp_pointer = (FREE_LIST *)RIO_PTR(HostP->Caddr,old_end);
|
tmp_pointer = (FREE_LIST *) RIO_PTR(HostP->Caddr, old_end);
|
||||||
WWORD(tmp_pointer->next , new_end );
|
WWORD(tmp_pointer->next, new_end);
|
||||||
WWORD(((FREE_LIST *)PktP)->prev , old_end);
|
WWORD(((FREE_LIST *) PktP)->prev, old_end);
|
||||||
WWORD(((FREE_LIST *)PktP)->next , TPNULL);
|
WWORD(((FREE_LIST *) PktP)->next, TPNULL);
|
||||||
WWORD(HostP->ParmMapP->free_list_end, new_end);
|
WWORD(HostP->ParmMapP->free_list_end, new_end);
|
||||||
|
} else { /* First packet on the free list this should never happen! */
|
||||||
|
rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n");
|
||||||
|
WWORD(HostP->ParmMapP->free_list_end, RIO_OFF(HostP->Caddr, PktP));
|
||||||
|
tmp_pointer = (FREE_LIST *) PktP;
|
||||||
|
WWORD(tmp_pointer->prev, TPNULL);
|
||||||
|
WWORD(tmp_pointer->next, TPNULL);
|
||||||
}
|
}
|
||||||
else { /* First packet on the free list this should never happen! */
|
rio_dprintk(RIO_DEBUG_CMD, "Before unlock: %p\n", &HostP->HostLock);
|
||||||
rio_dprintk (RIO_DEBUG_PFE, "put_free_end(): This should never happen\n");
|
|
||||||
WWORD(HostP->ParmMapP->free_list_end , RIO_OFF(HostP->Caddr,PktP));
|
|
||||||
tmp_pointer = (FREE_LIST *)PktP;
|
|
||||||
WWORD(tmp_pointer->prev , TPNULL);
|
|
||||||
WWORD(tmp_pointer->next , TPNULL);
|
|
||||||
}
|
|
||||||
rio_dprintk (RIO_DEBUG_CMD, "Before unlock: %p\n", &HostP->HostLock);
|
|
||||||
rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
|
rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -715,14 +712,12 @@ PKT *PktP;
|
|||||||
** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
|
** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
|
||||||
** then can_remove_receive() returns 0.
|
** then can_remove_receive() returns 0.
|
||||||
*/
|
*/
|
||||||
int
|
int can_remove_receive(PktP, PortP)
|
||||||
can_remove_receive(PktP, PortP)
|
|
||||||
PKT **PktP;
|
PKT **PktP;
|
||||||
struct Port *PortP;
|
struct Port *PortP;
|
||||||
{
|
{
|
||||||
if ( RWORD(*PortP->RxRemove) & PKT_IN_USE) {
|
if (RWORD(*PortP->RxRemove) & PKT_IN_USE) {
|
||||||
*PktP = (PKT *)RIO_PTR(PortP->Caddr,
|
*PktP = (PKT *) RIO_PTR(PortP->Caddr, RWORD(*PortP->RxRemove) & ~PKT_IN_USE);
|
||||||
RWORD(*PortP->RxRemove) & ~PKT_IN_USE);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -733,12 +728,10 @@ struct Port *PortP;
|
|||||||
** and then bump the pointers. Once the pointers get to the end, they must
|
** and then bump the pointers. Once the pointers get to the end, they must
|
||||||
** be wrapped back to the start.
|
** be wrapped back to the start.
|
||||||
*/
|
*/
|
||||||
void
|
void remove_receive(PortP)
|
||||||
remove_receive(PortP)
|
|
||||||
struct Port *PortP;
|
struct Port *PortP;
|
||||||
{
|
{
|
||||||
WWORD( *PortP->RxRemove, RWORD(*PortP->RxRemove) & ~PKT_IN_USE );
|
WWORD(*PortP->RxRemove, RWORD(*PortP->RxRemove) & ~PKT_IN_USE);
|
||||||
PortP->RxRemove = (PortP->RxRemove == PortP->RxEnd) ? PortP->RxStart :
|
PortP->RxRemove = (PortP->RxRemove == PortP->RxEnd) ? PortP->RxStart : PortP->RxRemove + 1;
|
||||||
PortP->RxRemove + 1;
|
WWORD(PortP->PhbP->rx_remove, RIO_OFF(PortP->Caddr, PortP->RxRemove));
|
||||||
WWORD( PortP->PhbP->rx_remove , RIO_OFF(PortP->Caddr, PortP->RxRemove) );
|
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* Yeah. We have copyright on this one. Sure. */
|
/* Yeah. We have copyright on this one. Sure. */
|
||||||
|
|
||||||
void rio_pcicopy( char *from, char *to, int amount)
|
void rio_pcicopy(char *from, char *to, int amount)
|
||||||
{
|
{
|
||||||
while ( amount-- )
|
while (amount--)
|
||||||
*to++ = *from++;
|
*to++ = *from++;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -47,8 +47,7 @@ static char *_riospace_h_sccs_ = "@(#)riospace.h 1.2";
|
|||||||
** In particular, it won't be able to see changes to RIO_SLOTS
|
** In particular, it won't be able to see changes to RIO_SLOTS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct Conf
|
struct Conf {
|
||||||
{
|
|
||||||
char Locator[24];
|
char Locator[24];
|
||||||
unsigned int StartupTime;
|
unsigned int StartupTime;
|
||||||
unsigned int SlowCook;
|
unsigned int SlowCook;
|
||||||
@@ -86,15 +85,13 @@ struct Conf
|
|||||||
/*
|
/*
|
||||||
** Board data structure. This is used for configuration info
|
** Board data structure. This is used for configuration info
|
||||||
*/
|
*/
|
||||||
struct Brd
|
struct Brd {
|
||||||
{
|
|
||||||
unsigned char Type; /* RIO_EISA, RIO_MCA, RIO_AT, RIO_EMPTY... */
|
unsigned char Type; /* RIO_EISA, RIO_MCA, RIO_AT, RIO_EMPTY... */
|
||||||
unsigned char Ivec; /* POLLED or ivec number */
|
unsigned char Ivec; /* POLLED or ivec number */
|
||||||
unsigned char Mode; /* Control stuff, see below */
|
unsigned char Mode; /* Control stuff, see below */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Board
|
struct Board {
|
||||||
{
|
|
||||||
char Locator[RIO_LOCATOR_LEN];
|
char Locator[RIO_LOCATOR_LEN];
|
||||||
int NumSlots;
|
int NumSlots;
|
||||||
struct Brd Boards[MAX_RIO_BOARDS];
|
struct Brd Boards[MAX_RIO_BOARDS];
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_riotime_h_sccs = "@(#)riotime.h 1.1" ;
|
static char *_rio_riotime_h_sccs = "@(#)riotime.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -97,16 +97,16 @@ typedef short NUMBER;
|
|||||||
typedef short *NUMBER_ptr;
|
typedef short *NUMBER_ptr;
|
||||||
typedef unsigned short *WORD_ptr;
|
typedef unsigned short *WORD_ptr;
|
||||||
typedef unsigned char *BYTE_ptr;
|
typedef unsigned char *BYTE_ptr;
|
||||||
typedef unsigned char uchar ;
|
typedef unsigned char uchar;
|
||||||
typedef unsigned short ushort ;
|
typedef unsigned short ushort;
|
||||||
typedef unsigned int uint ;
|
typedef unsigned int uint;
|
||||||
typedef unsigned long ulong ;
|
typedef unsigned long ulong;
|
||||||
typedef unsigned char u_char ;
|
typedef unsigned char u_char;
|
||||||
typedef unsigned short u_short ;
|
typedef unsigned short u_short;
|
||||||
typedef unsigned int u_int ;
|
typedef unsigned int u_int;
|
||||||
typedef unsigned long u_long ;
|
typedef unsigned long u_long;
|
||||||
typedef unsigned short ERROR ;
|
typedef unsigned short ERROR;
|
||||||
typedef unsigned long ID ;
|
typedef unsigned long ID;
|
||||||
typedef char *char_ptr;
|
typedef char *char_ptr;
|
||||||
typedef Channel *Channel_ptr;
|
typedef Channel *Channel_ptr;
|
||||||
typedef struct FREE_LIST *FREE_LIST_ptr;
|
typedef struct FREE_LIST *FREE_LIST_ptr;
|
||||||
@@ -132,4 +132,3 @@ typedef struct RUP RUP;
|
|||||||
#endif /* __riotypes__ */
|
#endif /* __riotypes__ */
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -60,8 +60,7 @@
|
|||||||
/* The PARM_MAP structure defines global values relating to the Host Card / RTA
|
/* The PARM_MAP structure defines global values relating to the Host Card / RTA
|
||||||
and is the main structure from which all other structures are referenced. */
|
and is the main structure from which all other structures are referenced. */
|
||||||
|
|
||||||
typedef struct _PARM_MAP
|
typedef struct _PARM_MAP {
|
||||||
{
|
|
||||||
_u16 phb_ptr; /* 0x00 Pointer to the PHB array */
|
_u16 phb_ptr; /* 0x00 Pointer to the PHB array */
|
||||||
_u16 phb_num_ptr; /* 0x02 Ptr to Number of PHB's */
|
_u16 phb_num_ptr; /* 0x02 Ptr to Number of PHB's */
|
||||||
_u16 free_list; /* 0x04 Free List pointer */
|
_u16 free_list; /* 0x04 Free List pointer */
|
||||||
@@ -184,8 +183,7 @@ typedef struct _PARM_MAP
|
|||||||
attached to the system and there is normally an array of MAX_RUPS (=16) structures
|
attached to the system and there is normally an array of MAX_RUPS (=16) structures
|
||||||
in a host card, defined by PARM_MAP->rup. */
|
in a host card, defined by PARM_MAP->rup. */
|
||||||
|
|
||||||
typedef struct _RUP
|
typedef struct _RUP {
|
||||||
{
|
|
||||||
_u16 txpkt; /* 0x00 Outgoing packet */
|
_u16 txpkt; /* 0x00 Outgoing packet */
|
||||||
_u16 rxpkt; /* 0x02 ncoming packet */
|
_u16 rxpkt; /* 0x02 ncoming packet */
|
||||||
_u16 link; /* 0x04 Which link to send packet down ? */
|
_u16 link; /* 0x04 Which link to send packet down ? */
|
||||||
@@ -234,8 +232,7 @@ typedef struct _RUP
|
|||||||
to the system and there is normally an array of MAX_PHBS (=128) structures
|
to the system and there is normally an array of MAX_PHBS (=128) structures
|
||||||
in a host card, defined by PARM_MAP->phb_ptr and PARM_MAP->phb_num_ptr. */
|
in a host card, defined by PARM_MAP->phb_ptr and PARM_MAP->phb_num_ptr. */
|
||||||
|
|
||||||
typedef struct _PHB
|
typedef struct _PHB {
|
||||||
{
|
|
||||||
_u16 source; /* 0x00 Location of the PHB in the host card */
|
_u16 source; /* 0x00 Location of the PHB in the host card */
|
||||||
_u16 handshake; /* 0x02 Used to manage receive packet flow control */
|
_u16 handshake; /* 0x02 Used to manage receive packet flow control */
|
||||||
_u16 status; /* 0x04 Internal port transmit/receive status */
|
_u16 status; /* 0x04 Internal port transmit/receive status */
|
||||||
@@ -291,13 +288,12 @@ typedef struct _PHB
|
|||||||
and there is normally an array of MAX_LINKS (=4) structures in a host card,
|
and there is normally an array of MAX_LINKS (=4) structures in a host card,
|
||||||
defined by PARM_MAP->link_str_ptr. */
|
defined by PARM_MAP->link_str_ptr. */
|
||||||
|
|
||||||
typedef struct _LPB
|
typedef struct _LPB {
|
||||||
{
|
|
||||||
_u16 link_number; /* 0x00 Link Number */
|
_u16 link_number; /* 0x00 Link Number */
|
||||||
_u16 in_ch; /* 0x02 Link In Channel */
|
_u16 in_ch; /* 0x02 Link In Channel */
|
||||||
_u16 out_ch; /* 0x04 Link Out Channel */
|
_u16 out_ch; /* 0x04 Link Out Channel */
|
||||||
_u8 attached_serial[4]; /* 0x06 Attached serial number */
|
_u8 attached_serial[4]; /* 0x06 Attached serial number */
|
||||||
_u8 attached_host_serial[4];/* 0x0A Serial number of Host who booted other end */
|
_u8 attached_host_serial[4]; /* 0x0A Serial number of Host who booted other end */
|
||||||
_u16 descheduled; /* 0x0E Currently Descheduled */
|
_u16 descheduled; /* 0x0E Currently Descheduled */
|
||||||
_u16 state; /* 0x10 Current state */
|
_u16 state; /* 0x10 Current state */
|
||||||
_u16 send_poll; /* 0x12 Send a Poll Packet */
|
_u16 send_poll; /* 0x12 Send a Poll Packet */
|
||||||
@@ -380,8 +376,7 @@ typedef struct _LPB
|
|||||||
|
|
||||||
/* Used to overlay packet headers when allocating/freeing packets from the free list */
|
/* Used to overlay packet headers when allocating/freeing packets from the free list */
|
||||||
|
|
||||||
typedef struct _FREE_LIST
|
typedef struct _FREE_LIST {
|
||||||
{
|
|
||||||
_u16 next; /* 0x00 offset of next list item */
|
_u16 next; /* 0x00 offset of next list item */
|
||||||
_u16 prev; /* 0x02 offset of previous list item */
|
_u16 prev; /* 0x02 offset of previous list item */
|
||||||
|
|
||||||
@@ -403,8 +398,7 @@ typedef struct _FREE_LIST
|
|||||||
|
|
||||||
#define PKT_MAX_DATA_LEN 72 /* Size of packet data */
|
#define PKT_MAX_DATA_LEN 72 /* Size of packet data */
|
||||||
|
|
||||||
typedef struct _PKT
|
typedef struct _PKT {
|
||||||
{
|
|
||||||
_u8 dest_unit; /* 0x00 Destination Unit Id */
|
_u8 dest_unit; /* 0x00 Destination Unit Id */
|
||||||
_u8 dest_port; /* 0x01 Destination Port */
|
_u8 dest_port; /* 0x01 Destination Port */
|
||||||
_u8 src_unit; /* 0x02 Source Unit Id */
|
_u8 src_unit; /* 0x02 Source Unit Id */
|
||||||
|
@@ -39,19 +39,19 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char *_rio_rom_h_sccs = "@(#)rom.h 1.1" ;
|
static char *_rio_rom_h_sccs = "@(#)rom.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct ROM ROM ;
|
typedef struct ROM ROM;
|
||||||
struct ROM {
|
struct ROM {
|
||||||
u_short slx ;
|
u_short slx;
|
||||||
char pcb_letter_rev ;
|
char pcb_letter_rev;
|
||||||
char pcb_number_rev ;
|
char pcb_number_rev;
|
||||||
char serial[4] ;
|
char serial[4];
|
||||||
char year ;
|
char year;
|
||||||
char week ;
|
char week;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -60,5 +60,3 @@ struct ROM {
|
|||||||
#define ROM_LENGTH 0x20
|
#define ROM_LENGTH 0x20
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
@@ -74,14 +74,14 @@ typedef struct COST_ROUTE COST_ROUTE;
|
|||||||
struct COST_ROUTE {
|
struct COST_ROUTE {
|
||||||
unsigned char cost; /* Cost down this link */
|
unsigned char cost; /* Cost down this link */
|
||||||
unsigned char route[NODE_BYTES]; /* Nodes thorough this route */
|
unsigned char route[NODE_BYTES]; /* Nodes thorough this route */
|
||||||
} ;
|
};
|
||||||
|
|
||||||
typedef struct ROUTE_STR ROUTE_STR ;
|
typedef struct ROUTE_STR ROUTE_STR;
|
||||||
struct ROUTE_STR {
|
struct ROUTE_STR {
|
||||||
COST_ROUTE cost_route[MAX_LINKS];
|
COST_ROUTE cost_route[MAX_LINKS];
|
||||||
/* cost / route for this link */
|
/* cost / route for this link */
|
||||||
ushort favoured; /* favoured link */
|
ushort favoured; /* favoured link */
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
#define NO_LINK (short) 5 /* Link unattached */
|
#define NO_LINK (short) 5 /* Link unattached */
|
||||||
@@ -105,4 +105,3 @@ struct ROUTE_STR {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_rtahw_h_sccs = "@(#)rtahw.h 1.5" ;
|
static char *_rio_rtahw_h_sccs = "@(#)rtahw.h 1.5";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -74,9 +74,8 @@ struct RUP {
|
|||||||
WORD status; /* Status */
|
WORD status; /* Status */
|
||||||
WORD txcontrol; /* Transmit control */
|
WORD txcontrol; /* Transmit control */
|
||||||
WORD rxcontrol; /* Receive control */
|
WORD rxcontrol; /* Receive control */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_rupstat_h_sccs = "@(#)rupstat.h 1.1" ;
|
static char *_rio_rupstat_h_sccs = "@(#)rupstat.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -48,4 +48,3 @@ static char *_rio_rupstat_h_sccs = "@(#)rupstat.h 1.1" ;
|
|||||||
#define STATUS_TOPOLOGY 2
|
#define STATUS_TOPOLOGY 2
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -60,15 +60,12 @@
|
|||||||
#define RX FALSE
|
#define RX FALSE
|
||||||
|
|
||||||
|
|
||||||
typedef struct FREE_LIST FREE_LIST ;
|
typedef struct FREE_LIST FREE_LIST;
|
||||||
struct FREE_LIST {
|
struct FREE_LIST {
|
||||||
FREE_LIST_ptr next ;
|
FREE_LIST_ptr next;
|
||||||
FREE_LIST_ptr prev ;
|
FREE_LIST_ptr prev;
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -43,7 +43,7 @@ typedef struct {
|
|||||||
unsigned int result; /* Result value */
|
unsigned int result; /* Result value */
|
||||||
unsigned int dataIn;
|
unsigned int dataIn;
|
||||||
unsigned int dataOut;
|
unsigned int dataOut;
|
||||||
}selftestStruct;
|
} selftestStruct;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** The different tests are identified by the following data values.
|
** The different tests are identified by the following data values.
|
||||||
|
@@ -37,27 +37,26 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_sysmap_h_sccs = "@(#)sysmap.h 1.1" ;
|
static char *_rio_sysmap_h_sccs = "@(#)sysmap.h 1.1";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SYSTEM_MAP_LEN 64 /* Len of System Map array */
|
#define SYSTEM_MAP_LEN 64 /* Len of System Map array */
|
||||||
|
|
||||||
|
|
||||||
typedef struct SYS_MAP SYS_MAP ;
|
typedef struct SYS_MAP SYS_MAP;
|
||||||
typedef struct SYS_MAP_LINK SYS_MAP_LINK ;
|
typedef struct SYS_MAP_LINK SYS_MAP_LINK;
|
||||||
|
|
||||||
struct SYS_MAP_LINK {
|
struct SYS_MAP_LINK {
|
||||||
short id ; /* Unit Id */
|
short id; /* Unit Id */
|
||||||
short link ; /* Id's Link */
|
short link; /* Id's Link */
|
||||||
short been_here ; /* Used by map_gen */
|
short been_here; /* Used by map_gen */
|
||||||
} ;
|
};
|
||||||
|
|
||||||
struct SYS_MAP {
|
struct SYS_MAP {
|
||||||
char serial_num[4] ;
|
char serial_num[4];
|
||||||
SYS_MAP_LINK link[4] ;
|
SYS_MAP_LINK link[4];
|
||||||
} ;
|
};
|
||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#ifdef SCCS_LABELS
|
#ifdef SCCS_LABELS
|
||||||
static char *_rio_defaults_h_sccs = "@(#)timeouts.h 1.3" ;
|
static char *_rio_defaults_h_sccs = "@(#)timeouts.h 1.3";
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -48,4 +48,3 @@ static char *_rio_defaults_h_sccs = "@(#)timeouts.h 1.3" ;
|
|||||||
|
|
||||||
|
|
||||||
/*********** end of file ***********/
|
/*********** end of file ***********/
|
||||||
|
|
||||||
|
@@ -40,8 +40,7 @@ static char *_top_h_sccs_ = "@(#)top.h 1.2";
|
|||||||
/*
|
/*
|
||||||
** Topology information
|
** Topology information
|
||||||
*/
|
*/
|
||||||
struct Top
|
struct Top {
|
||||||
{
|
|
||||||
uchar Unit;
|
uchar Unit;
|
||||||
uchar Link;
|
uchar Link;
|
||||||
};
|
};
|
||||||
|
@@ -41,8 +41,7 @@ static char *_unixrup_h_sccs_ = "@(#)unixrup.h 1.2";
|
|||||||
** UnixRup data structure. This contains pointers to actual RUPs on the
|
** UnixRup data structure. This contains pointers to actual RUPs on the
|
||||||
** host card, and all the command/boot control stuff.
|
** host card, and all the command/boot control stuff.
|
||||||
*/
|
*/
|
||||||
struct UnixRup
|
struct UnixRup {
|
||||||
{
|
|
||||||
struct CmdBlk *CmdsWaitingP; /* Commands waiting to be done */
|
struct CmdBlk *CmdsWaitingP; /* Commands waiting to be done */
|
||||||
struct CmdBlk *CmdPendingP; /* The command currently being sent */
|
struct CmdBlk *CmdPendingP; /* The command currently being sent */
|
||||||
struct RUP *RupP; /* the Rup to send it to */
|
struct RUP *RupP; /* the Rup to send it to */
|
||||||
@@ -50,7 +49,7 @@ struct UnixRup
|
|||||||
uint BaseSysPort; /* SysPort of first tty on this RTA */
|
uint BaseSysPort; /* SysPort of first tty on this RTA */
|
||||||
uint ModTypes; /* Modules on this RTA */
|
uint ModTypes; /* Modules on this RTA */
|
||||||
spinlock_t RupLock; /* Lock structure for MPX */
|
spinlock_t RupLock; /* Lock structure for MPX */
|
||||||
/* struct lockb RupLock; */ /* Lock structure for MPX */
|
/* struct lockb RupLock; *//* Lock structure for MPX */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __rio_unixrup_h__ */
|
#endif /* __rio_unixrup_h__ */
|
||||||
|
Reference in New Issue
Block a user