Commit 554b7c80 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] Yet more rio cleaning (2 of 2)

- Remove more unused headers
- Remove various typedefs
- Correct type of PaddrP (physical addresses should be ulong)
- Kill use of bcopy
- More printk cleanups
- Kill true/false
- Clean up direct access to pci BARs
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 57c2d60e
...@@ -33,38 +33,6 @@ ...@@ -33,38 +33,6 @@
#ifndef __rio_rio_h__ #ifndef __rio_rio_h__
#define __rio_rio_h__ #define __rio_rio_h__
#ifdef SCCS_LABELS
static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
#endif
/*
** 30.09.1998 ARG -
** Introduced driver version and host card type strings
*/
#define RIO_DRV_STR "Specialix RIO Driver"
#define RIO_AT_HOST_STR "ISA"
#define RIO_PCI_HOST_STR "PCI"
/*
** rio_info_store() commands (arbitary values) :
*/
#define RIO_INFO_PUT 0xA4B3C2D1
#define RIO_INFO_GET 0xF1E2D3C4
/*
** anything that I couldn't cram in somewhere else
*/
/*
#ifndef RIODEBUG
#define debug
#else
#define debug rioprint
#endif
*/
/* /*
** Maximum numbers of things ** Maximum numbers of things
*/ */
...@@ -101,9 +69,8 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3"; ...@@ -101,9 +69,8 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
/* /*
** Flag values returned by functions ** Flag values returned by functions
*/ */
#define RIO_FAIL -1 #define RIO_FAIL -1
#define RIO_SUCCESS 0
#define COPYFAIL -1 /* copy[in|out] failed */
/* /*
** SysPort value for something that hasn't any ports ** SysPort value for something that hasn't any ports
...@@ -142,30 +109,8 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3"; ...@@ -142,30 +109,8 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
/* /*
** Generally useful constants ** Generally useful constants
*/ */
#define HALF_A_SECOND ((HZ)>>1)
#define A_SECOND (HZ) #define HUNDRED_MS ((HZ/10)?(HZ/10):1)
#define HUNDRED_HZ ((HZ/100)?(HZ/100):1)
#define FIFTY_HZ ((HZ/50)?(HZ/50):1)
#define TWENTY_HZ ((HZ/20)?(HZ/20):1)
#define TEN_HZ ((HZ/10)?(HZ/10):1)
#define FIVE_HZ ((HZ/5)?(HZ/5):1)
#define HUNDRED_MS TEN_HZ
#define FIFTY_MS TWENTY_HZ
#define TWENTY_MS FIFTY_HZ
#define TEN_MS HUNDRED_HZ
#define TWO_SECONDS ((A_SECOND)*2)
#define FIVE_SECONDS ((A_SECOND)*5)
#define TEN_SECONDS ((A_SECOND)*10)
#define FIFTEEN_SECONDS ((A_SECOND)*15)
#define TWENTY_SECONDS ((A_SECOND)*20)
#define HALF_A_MINUTE (A_MINUTE>>1)
#define A_MINUTE (A_SECOND*60)
#define FIVE_MINUTES (A_MINUTE*5)
#define QUARTER_HOUR (A_MINUTE*15)
#define HALF_HOUR (A_MINUTE*30)
#define HOUR (A_MINUTE*60)
#define SIXTEEN_MEG 0x1000000
#define ONE_MEG 0x100000 #define ONE_MEG 0x100000
#define SIXTY_FOUR_K 0x10000 #define SIXTY_FOUR_K 0x10000
...@@ -173,8 +118,6 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3"; ...@@ -173,8 +118,6 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
#define RIO_EISA_MEM_SIZE SIXTY_FOUR_K #define RIO_EISA_MEM_SIZE SIXTY_FOUR_K
#define RIO_MCA_MEM_SIZE SIXTY_FOUR_K #define RIO_MCA_MEM_SIZE SIXTY_FOUR_K
#define POLL_VECTOR 0x100
#define COOK_WELL 0 #define COOK_WELL 0
#define COOK_MEDIUM 1 #define COOK_MEDIUM 1
#define COOK_RAW 2 #define COOK_RAW 2
...@@ -193,62 +136,19 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3"; ...@@ -193,62 +136,19 @@ static char *_rio_h_sccs_ = "@(#)rio.h 1.3";
** How to convert from various different device number formats: ** How to convert from various different device number formats:
** DEV is a dev number, as passed to open, close etc - NOT a minor ** DEV is a dev number, as passed to open, close etc - NOT a minor
** number! ** number!
** **/
** Note: LynxOS only gives us 8 bits for the device minor number,
** so all this crap here to deal with 'modem' bits etc. is
** just a load of irrelevant old bunkum!
** This however does not stop us needing to define a value
** for RIO_MODEMOFFSET which is required by the 'riomkdev'
** utility in the New Config Utilities suite.
*/
/* 0-511: direct 512-1023: modem */
#define RIO_MODEMOFFSET 0x200 /* doesn't mean anything */
#define RIO_MODEM_MASK 0x1FF #define RIO_MODEM_MASK 0x1FF
#define RIO_MODEM_BIT 0x200 #define RIO_MODEM_BIT 0x200
#define RIO_UNMODEM(DEV) (MINOR(DEV) & RIO_MODEM_MASK) #define RIO_UNMODEM(DEV) (MINOR(DEV) & RIO_MODEM_MASK)
#define RIO_ISMODEM(DEV) (MINOR(DEV) & RIO_MODEM_BIT) #define RIO_ISMODEM(DEV) (MINOR(DEV) & RIO_MODEM_BIT)
#define RIO_PORT(DEV,FIRST_MAJ) ( (MAJOR(DEV) - FIRST_MAJ) * PORTS_PER_HOST) \ #define RIO_PORT(DEV,FIRST_MAJ) ( (MAJOR(DEV) - FIRST_MAJ) * PORTS_PER_HOST) \
+ MINOR(DEV) + MINOR(DEV)
#define CSUM(pkt_ptr) (((u16 *)(pkt_ptr))[0] + ((u16 *)(pkt_ptr))[1] + \
#define splrio spltty ((u16 *)(pkt_ptr))[2] + ((u16 *)(pkt_ptr))[3] + \
((u16 *)(pkt_ptr))[4] + ((u16 *)(pkt_ptr))[5] + \
#define RIO_IPL 5 ((u16 *)(pkt_ptr))[6] + ((u16 *)(pkt_ptr))[7] + \
#define RIO_PRI (PZERO+10) ((u16 *)(pkt_ptr))[8] + ((u16 *)(pkt_ptr))[9] )
#define RIO_CLOSE_PRI PZERO-1 /* uninterruptible sleeps for close */
typedef struct DbInf {
uint Flag;
char Name[8];
} DbInf;
#ifndef TRUE
#define TRUE (1==1)
#endif
#ifndef FALSE
#define FALSE (!TRUE)
#endif
#define CSUM(pkt_ptr) (((ushort *)(pkt_ptr))[0] + ((ushort *)(pkt_ptr))[1] + \
((ushort *)(pkt_ptr))[2] + ((ushort *)(pkt_ptr))[3] + \
((ushort *)(pkt_ptr))[4] + ((ushort *)(pkt_ptr))[5] + \
((ushort *)(pkt_ptr))[6] + ((ushort *)(pkt_ptr))[7] + \
((ushort *)(pkt_ptr))[8] + ((ushort *)(pkt_ptr))[9] )
/*
** This happy little macro copies SIZE bytes of data from FROM to TO
** quite well. SIZE must be a constant.
*/
#define CCOPY( FROM, TO, SIZE ) { *(struct s { char data[SIZE]; } *)(TO) = *(struct s *)(FROM); }
/*
** increment a buffer pointer modulo the size of the buffer...
*/
#define BUMP( P, I ) ((P) = (((P)+(I)) & RIOBufferMask))
#define INIT_PACKET( PK, PP ) \
{ \
*((uint *)PK) = PP->PacketInfo; \
}
#define RIO_LINK_ENABLE 0x80FF /* FF is a hack, mainly for Mips, to */ #define RIO_LINK_ENABLE 0x80FF /* FF is a hack, mainly for Mips, to */
/* prevent a really stupid race condition. */ /* prevent a really stupid race condition. */
...@@ -267,27 +167,42 @@ typedef struct DbInf { ...@@ -267,27 +167,42 @@ typedef struct DbInf {
#define DISCONNECT 0 #define DISCONNECT 0
#define CONNECT 1 #define CONNECT 1
/* ------ Control Codes ------ */
/* #define CONTROL '^'
** Machine types - these must NOT overlap with product codes 0-15 #define IFOAD ( CONTROL + 1 )
*/ #define IDENTIFY ( CONTROL + 2 )
#define RIO_MIPS_R3230 31 #define ZOMBIE ( CONTROL + 3 )
#define RIO_MIPS_R4030 32 #define UFOAD ( CONTROL + 4 )
#define IWAIT ( CONTROL + 5 )
#define IFOAD_MAGIC 0xF0AD /* of course */
#define ZOMBIE_MAGIC (~0xDEAD) /* not dead -> zombie */
#define UFOAD_MAGIC 0xD1E /* kill-your-neighbour */
#define IWAIT_MAGIC 0xB1DE /* Bide your time */
/* ------ Error Codes ------ */
#define E_NO_ERROR ((ushort) 0)
/* ------ Free Lists ------ */
#define RIO_IO_UNKNOWN -2 struct rio_free_list {
u16 next;
u16 prev;
};
#undef MODERN /* NULL for card side linked lists */
#define ERROR( E ) do { u.u_error = E; return OPENFAIL } while ( 0 ) #define TPNULL ((ushort)(0x8000))
/* 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. */
#define PKT_IN_USE 0x1
/* Defines for MPX line discipline routines */ /* ------ Topology ------ */
#define DIST_LINESW_OPEN 0x01 struct Top {
#define DIST_LINESW_CLOSE 0x02 u8 Unit;
#define DIST_LINESW_READ 0x04 u8 Link;
#define DIST_LINESW_WRITE 0x08 };
#define DIST_LINESW_IOCTL 0x10
#define DIST_LINESW_INPUT 0x20
#define DIST_LINESW_OUTPUT 0x40
#define DIST_LINESW_MDMINT 0x80
#endif /* __rio_h__ */ #endif /* __rio_h__ */
...@@ -57,15 +57,12 @@ ...@@ -57,15 +57,12 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "linux_compat.h" #include "linux_compat.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -78,17 +75,13 @@ ...@@ -78,17 +75,13 @@
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
#include "param.h" #include "param.h"
#include "list.h"
#include "sam.h"
#include "protsts.h" #include "protsts.h"
#include "rioboard.h" #include "rioboard.h"
...@@ -350,27 +343,9 @@ int rio_minor(struct tty_struct *tty) ...@@ -350,27 +343,9 @@ int rio_minor(struct tty_struct *tty)
return tty->index + (tty->driver == rio_driver) ? 0 : 256; return tty->index + (tty->driver == rio_driver) ? 0 : 256;
} }
int rio_ismodem(struct tty_struct *tty)
{
return 1;
}
static int rio_set_real_termios(void *ptr) static int rio_set_real_termios(void *ptr)
{ {
int rv, modem; return RIOParam((struct Port *) ptr, CONFIG, 1, 1);
struct tty_struct *tty;
func_enter();
tty = ((struct Port *) ptr)->gs.tty;
modem = rio_ismodem(tty);
rv = RIOParam((struct Port *) ptr, CONFIG, modem, 1);
func_exit();
return rv;
} }
...@@ -973,7 +948,6 @@ static int __init rio_init(void) ...@@ -973,7 +948,6 @@ static int __init rio_init(void)
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
unsigned int tint;
unsigned short tshort; unsigned short tshort;
#endif #endif
...@@ -998,6 +972,8 @@ static int __init rio_init(void) ...@@ -998,6 +972,8 @@ static int __init rio_init(void)
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
/* First look for the JET devices: */ /* First look for the JET devices: */
while ((pdev = pci_get_device(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, pdev))) { while ((pdev = pci_get_device(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, pdev))) {
u32 tint;
if (pci_enable_device(pdev)) if (pci_enable_device(pdev))
continue; continue;
...@@ -1008,7 +984,6 @@ static int __init rio_init(void) ...@@ -1008,7 +984,6 @@ static int __init rio_init(void)
Also, reading a non-aligned dword doesn't work. So we read the Also, reading a non-aligned dword doesn't work. So we read the
whole dword at 0x2c and extract the word at 0x2e (SUBSYSTEM_ID) whole dword at 0x2c and extract the word at 0x2e (SUBSYSTEM_ID)
ourselves */ ourselves */
/* I don't know why the define doesn't work, constant 0x2c does --REW */
pci_read_config_dword(pdev, 0x2c, &tint); pci_read_config_dword(pdev, 0x2c, &tint);
tshort = (tint >> 16) & 0xffff; tshort = (tint >> 16) & 0xffff;
rio_dprintk(RIO_DEBUG_PROBE, "Got a specialix card: %x.\n", tint); rio_dprintk(RIO_DEBUG_PROBE, "Got a specialix card: %x.\n", tint);
...@@ -1018,10 +993,8 @@ static int __init rio_init(void) ...@@ -1018,10 +993,8 @@ static int __init rio_init(void)
} }
rio_dprintk(RIO_DEBUG_PROBE, "cp1\n"); rio_dprintk(RIO_DEBUG_PROBE, "cp1\n");
pci_read_config_dword(pdev, PCI_BASE_ADDRESS_2, &tint);
hp = &p->RIOHosts[p->RIONumHosts]; hp = &p->RIOHosts[p->RIONumHosts];
hp->PaddrP = tint & PCI_BASE_ADDRESS_MEM_MASK; hp->PaddrP = pci_resource_start(pdev, 2);
hp->Ivec = pdev->irq; hp->Ivec = pdev->irq;
if (((1 << hp->Ivec) & rio_irqmask) == 0) if (((1 << hp->Ivec) & rio_irqmask) == 0)
hp->Ivec = 0; hp->Ivec = 0;
...@@ -1035,7 +1008,7 @@ static int __init rio_init(void) ...@@ -1035,7 +1008,7 @@ static int __init rio_init(void)
rio_start_card_running(hp); rio_start_card_running(hp);
rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr);
if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == RIO_SUCCESS) { if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == 0) {
rio_dprintk(RIO_DEBUG_INIT, "Done RIOBoardTest\n"); rio_dprintk(RIO_DEBUG_INIT, "Done RIOBoardTest\n");
writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt);
p->RIOHosts[p->RIONumHosts].UniqueNum = p->RIOHosts[p->RIONumHosts].UniqueNum =
...@@ -1044,7 +1017,7 @@ static int __init rio_init(void) ...@@ -1044,7 +1017,7 @@ static int __init rio_init(void)
rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
fix_rio_pci(pdev); fix_rio_pci(pdev);
p->RIOLastPCISearch = RIO_SUCCESS; p->RIOLastPCISearch = 0;
p->RIONumHosts++; p->RIONumHosts++;
found++; found++;
} else { } else {
...@@ -1067,10 +1040,8 @@ static int __init rio_init(void) ...@@ -1067,10 +1040,8 @@ static int __init rio_init(void)
continue; continue;
#ifdef CONFIG_RIO_OLDPCI #ifdef CONFIG_RIO_OLDPCI
pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &tint);
hp = &p->RIOHosts[p->RIONumHosts]; hp = &p->RIOHosts[p->RIONumHosts];
hp->PaddrP = tint & PCI_BASE_ADDRESS_MEM_MASK; hp->PaddrP = pci_resource_start(pdev, 0);
hp->Ivec = pdev->irq; hp->Ivec = pdev->irq;
if (((1 << hp->Ivec) & rio_irqmask) == 0) if (((1 << hp->Ivec) & rio_irqmask) == 0)
hp->Ivec = 0; hp->Ivec = 0;
...@@ -1088,14 +1059,14 @@ static int __init rio_init(void) ...@@ -1088,14 +1059,14 @@ static int __init rio_init(void)
rio_reset_interrupt(hp); rio_reset_interrupt(hp);
rio_start_card_running(hp); rio_start_card_running(hp);
rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr);
if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == RIO_SUCCESS) { if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == 0) {
writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt);
p->RIOHosts[p->RIONumHosts].UniqueNum = p->RIOHosts[p->RIONumHosts].UniqueNum =
((readb(&p->RIOHosts[p->RIONumHosts].Unique[0]) & 0xFF) << 0) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[0]) & 0xFF) << 0) |
((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24); ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24);
rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
p->RIOLastPCISearch = RIO_SUCCESS; p->RIOLastPCISearch = 0;
p->RIONumHosts++; p->RIONumHosts++;
found++; found++;
} else { } else {
...@@ -1129,7 +1100,7 @@ static int __init rio_init(void) ...@@ -1129,7 +1100,7 @@ static int __init rio_init(void)
okboard = 0; okboard = 0;
if ((strncmp(vpdp->identifier, RIO_ISA_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA2_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA3_IDENT, 16) == 0)) { if ((strncmp(vpdp->identifier, RIO_ISA_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA2_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA3_IDENT, 16) == 0)) {
/* Board is present... */ /* Board is present... */
if (RIOBoardTest(hp->PaddrP, hp->Caddr, RIO_AT, 0) == RIO_SUCCESS) { if (RIOBoardTest(hp->PaddrP, hp->Caddr, RIO_AT, 0) == 0) {
/* ... and feeling fine!!!! */ /* ... and feeling fine!!!! */
rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum);
if (RIOAssignAT(p, hp->PaddrP, hp->Caddr, 0)) { if (RIOAssignAT(p, hp->PaddrP, hp->Caddr, 0)) {
...@@ -1231,24 +1202,3 @@ static void __exit rio_exit(void) ...@@ -1231,24 +1202,3 @@ static void __exit rio_exit(void)
module_init(rio_init); module_init(rio_init);
module_exit(rio_exit); module_exit(rio_exit);
/*
* Anybody who knows why this doesn't work for me, please tell me -- REW.
* Snatched from scsi.c (fixed one spelling error):
* Overrides for Emacs so that we follow Linus' tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
* adjust the settings for this buffer only. This must remain at the end
* of the file.
* ---------------------------------------------------------------------------
* Local Variables:
* c-indent-level: 4
* c-brace-imaginary-offset: 0
* c-brace-offset: -4
* c-argdecl-indent: 4
* c-label-offset: -4
* c-continued-statement-offset: 4
* c-continued-brace-offset: 0
* indent-tabs-mode: nil
* tab-width: 8
* End:
*/
...@@ -47,15 +47,12 @@ ...@@ -47,15 +47,12 @@
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -68,7 +65,6 @@ ...@@ -68,7 +65,6 @@
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
...@@ -386,7 +382,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp) ...@@ -386,7 +382,7 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
*/ */
offset = (p->RIOConf.HostLoadBase - 2) - 0x7FFC; offset = (p->RIOConf.HostLoadBase - 2) - 0x7FFC;
writeb(NFIX(((ushort) (~offset) >> (ushort) 12) & 0xF), DestP); writeb(NFIX(((unsigned short) (~offset) >> (unsigned short) 12) & 0xF), DestP);
writeb(PFIX((offset >> 8) & 0xF), DestP + 1); writeb(PFIX((offset >> 8) & 0xF), DestP + 1);
writeb(PFIX((offset >> 4) & 0xF), DestP + 2); writeb(PFIX((offset >> 4) & 0xF), DestP + 2);
writeb(JUMP(offset & 0xF), DestP + 3); writeb(JUMP(offset & 0xF), DestP + 3);
...@@ -515,10 +511,10 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp) ...@@ -515,10 +511,10 @@ int RIOBootCodeHOST(struct rio_info *p, struct DownLoad *rbp)
** 32 bit pointers for the driver in ioremap space. ** 32 bit pointers for the driver in ioremap space.
*/ */
HostP->ParmMapP = ParmMapP; HostP->ParmMapP = ParmMapP;
HostP->PhbP = (PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr)); HostP->PhbP = (struct PHB *) RIO_PTR(Cad, readw(&ParmMapP->phb_ptr));
HostP->RupP = (RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups)); HostP->RupP = (struct RUP *) RIO_PTR(Cad, readw(&ParmMapP->rups));
HostP->PhbNumP = (ushort *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr)); HostP->PhbNumP = (unsigned short *) RIO_PTR(Cad, readw(&ParmMapP->phb_num_ptr));
HostP->LinkStrP = (LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr)); HostP->LinkStrP = (struct LPB *) RIO_PTR(Cad, readw(&ParmMapP->link_str_ptr));
/* /*
** point the UnixRups at the real Rups ** point the UnixRups at the real Rups
...@@ -639,7 +635,7 @@ int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct ...@@ -639,7 +635,7 @@ int RIOBootRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct
/* /*
** Fill in the default info on the command block ** Fill in the default info on the command block
*/ */
CmdBlkP->Packet.dest_unit = Rup < (ushort) MAX_RUP ? Rup : 0; CmdBlkP->Packet.dest_unit = Rup < (unsigned short) MAX_RUP ? Rup : 0;
CmdBlkP->Packet.dest_port = BOOT_RUP; CmdBlkP->Packet.dest_port = BOOT_RUP;
CmdBlkP->Packet.src_unit = 0; CmdBlkP->Packet.src_unit = 0;
CmdBlkP->Packet.src_port = BOOT_RUP; CmdBlkP->Packet.src_port = BOOT_RUP;
...@@ -748,7 +744,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -748,7 +744,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
*/ */
RtaType = GetUnitType(RtaUniq); RtaType = GetUnitType(RtaUniq);
if (Rup >= (ushort) MAX_RUP) if (Rup >= (unsigned short) MAX_RUP)
rio_dprintk(RIO_DEBUG_BOOT, "RIO: Host %s has booted an RTA(%d) on link %c\n", HostP->Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A'); rio_dprintk(RIO_DEBUG_BOOT, "RIO: Host %s has booted an RTA(%d) on link %c\n", HostP->Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A');
else else
rio_dprintk(RIO_DEBUG_BOOT, "RIO: RTA %s has booted an RTA(%d) on link %c\n", HostP->Mapping[Rup].Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A'); rio_dprintk(RIO_DEBUG_BOOT, "RIO: RTA %s has booted an RTA(%d) on link %c\n", HostP->Mapping[Rup].Name, 8 * RtaType, readb(&PktCmdP->LinkNum) + 'A');
...@@ -757,7 +753,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -757,7 +753,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
if (RtaUniq == 0x00000000 || RtaUniq == 0xffffffff) { if (RtaUniq == 0x00000000 || RtaUniq == 0xffffffff) {
rio_dprintk(RIO_DEBUG_BOOT, "Illegal RTA Uniq Number\n"); rio_dprintk(RIO_DEBUG_BOOT, "Illegal RTA Uniq Number\n");
return TRUE; return 1;
} }
/* /*
...@@ -785,7 +781,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -785,7 +781,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
*/ */
writew(30, &HostP->LinkStrP[MyLink].WaitNoBoot); writew(30, &HostP->LinkStrP[MyLink].WaitNoBoot);
rio_dprintk(RIO_DEBUG_BOOT, "RTA %x not owned - suspend booting down link %c on unit %x\n", RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum); rio_dprintk(RIO_DEBUG_BOOT, "RTA %x not owned - suspend booting down link %c on unit %x\n", RtaUniq, 'A' + MyLink, HostP->Mapping[Rup].RtaUniqueNum);
return TRUE; return 1;
} }
/* /*
...@@ -826,7 +822,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -826,7 +822,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given IDs %d+%d\n", entry + 1, entry2 + 1); rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given IDs %d+%d\n", entry + 1, entry2 + 1);
else else
rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given ID %d\n", entry + 1); rio_dprintk(RIO_DEBUG_BOOT, "RTA will be given ID %d\n", entry + 1);
return TRUE; return 1;
} }
} }
...@@ -868,7 +864,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -868,7 +864,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
rio_dprintk(RIO_DEBUG_BOOT, "Found previous tentative slot (%d)\n", entry); rio_dprintk(RIO_DEBUG_BOOT, "Found previous tentative slot (%d)\n", entry);
if (!p->RIONoMessage) if (!p->RIONoMessage)
printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A'); printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A');
return TRUE; return 1;
} }
} }
...@@ -961,13 +957,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -961,13 +957,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
if (RtaType == TYPE_RTA16) { if (RtaType == TYPE_RTA16) {
if (RIOFindFreeID(p, HostP, &entry, &entry2) == 0) { if (RIOFindFreeID(p, HostP, &entry, &entry2) == 0) {
RIODefaultName(p, HostP, entry); RIODefaultName(p, HostP, entry);
FillSlot(entry, entry2, RtaUniq, HostP); rio_fill_host_slot(entry, entry2, RtaUniq, HostP);
EmptySlot = 0; EmptySlot = 0;
} }
} else { } else {
if (RIOFindFreeID(p, HostP, &entry, NULL) == 0) { if (RIOFindFreeID(p, HostP, &entry, NULL) == 0) {
RIODefaultName(p, HostP, entry); RIODefaultName(p, HostP, entry);
FillSlot(entry, 0, RtaUniq, HostP); rio_fill_host_slot(entry, 0, RtaUniq, HostP);
EmptySlot = 0; EmptySlot = 0;
} }
} }
...@@ -1023,7 +1019,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -1023,7 +1019,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
} else if (!p->RIONoMessage) } else if (!p->RIONoMessage)
printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A'); printk("RTA connected to %s '%s' (%c) not configured.\n", MyType, MyName, MyLink + 'A');
RIOSetChange(p); RIOSetChange(p);
return TRUE; return 1;
} }
/* /*
...@@ -1038,7 +1034,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -1038,7 +1034,7 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
/* /*
** already got it! ** already got it!
*/ */
return TRUE; return 1;
} }
} }
/* /*
...@@ -1046,13 +1042,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int ...@@ -1046,13 +1042,13 @@ static int RIOBootComplete(struct rio_info *p, struct Host *HostP, unsigned int
*/ */
if (HostP->NumExtraBooted < MAX_EXTRA_UNITS) if (HostP->NumExtraBooted < MAX_EXTRA_UNITS)
HostP->ExtraUnits[HostP->NumExtraBooted++] = RtaUniq; HostP->ExtraUnits[HostP->NumExtraBooted++] = RtaUniq;
return TRUE; return 1;
} }
/* /*
** If the RTA or its host appears in the RIOBindTab[] structure then ** If the RTA or its host appears in the RIOBindTab[] structure then
** we mustn't boot the RTA and should return FALSE. ** we mustn't boot the RTA and should return 0.
** This operation is slightly different from the other drivers for RIO ** This operation is slightly different from the other drivers for RIO
** in that this is designed to work with the new utilities ** in that this is designed to work with the new utilities
** not config.rio and is FAR SIMPLER. ** not config.rio and is FAR SIMPLER.
...@@ -1080,38 +1076,38 @@ int RIOBootOk(struct rio_info *p, struct Host *HostP, unsigned long RtaUniq) ...@@ -1080,38 +1076,38 @@ int RIOBootOk(struct rio_info *p, struct Host *HostP, unsigned long RtaUniq)
** slots tentative, and the second one RTA_SECOND_SLOT as well. ** slots tentative, and the second one RTA_SECOND_SLOT as well.
*/ */
void FillSlot(int entry, int entry2, unsigned int RtaUniq, struct Host *HostP) void rio_fill_host_slot(int entry, int entry2, unsigned int rta_uniq, struct Host *host)
{ {
int link; int link;
rio_dprintk(RIO_DEBUG_BOOT, "FillSlot(%d, %d, 0x%x...)\n", entry, entry2, RtaUniq); rio_dprintk(RIO_DEBUG_BOOT, "rio_fill_host_slot(%d, %d, 0x%x...)\n", entry, entry2, rta_uniq);
HostP->Mapping[entry].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE); host->Mapping[entry].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE);
HostP->Mapping[entry].SysPort = NO_PORT; host->Mapping[entry].SysPort = NO_PORT;
HostP->Mapping[entry].RtaUniqueNum = RtaUniq; host->Mapping[entry].RtaUniqueNum = rta_uniq;
HostP->Mapping[entry].HostUniqueNum = HostP->UniqueNum; host->Mapping[entry].HostUniqueNum = host->UniqueNum;
HostP->Mapping[entry].ID = entry + 1; host->Mapping[entry].ID = entry + 1;
HostP->Mapping[entry].ID2 = 0; host->Mapping[entry].ID2 = 0;
if (entry2) { if (entry2) {
HostP->Mapping[entry2].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE | RTA16_SECOND_SLOT); host->Mapping[entry2].Flags = (RTA_BOOTED | RTA_NEWBOOT | SLOT_TENTATIVE | RTA16_SECOND_SLOT);
HostP->Mapping[entry2].SysPort = NO_PORT; host->Mapping[entry2].SysPort = NO_PORT;
HostP->Mapping[entry2].RtaUniqueNum = RtaUniq; host->Mapping[entry2].RtaUniqueNum = rta_uniq;
HostP->Mapping[entry2].HostUniqueNum = HostP->UniqueNum; host->Mapping[entry2].HostUniqueNum = host->UniqueNum;
HostP->Mapping[entry2].Name[0] = '\0'; host->Mapping[entry2].Name[0] = '\0';
HostP->Mapping[entry2].ID = entry2 + 1; host->Mapping[entry2].ID = entry2 + 1;
HostP->Mapping[entry2].ID2 = entry + 1; host->Mapping[entry2].ID2 = entry + 1;
HostP->Mapping[entry].ID2 = entry2 + 1; host->Mapping[entry].ID2 = entry2 + 1;
} }
/* /*
** Must set these up, so that utilities show ** Must set these up, so that utilities show
** topology of 16 port RTAs correctly ** topology of 16 port RTAs correctly
*/ */
for (link = 0; link < LINKS_PER_UNIT; link++) { for (link = 0; link < LINKS_PER_UNIT; link++) {
HostP->Mapping[entry].Topology[link].Unit = ROUTE_DISCONNECT; host->Mapping[entry].Topology[link].Unit = ROUTE_DISCONNECT;
HostP->Mapping[entry].Topology[link].Link = NO_LINK; host->Mapping[entry].Topology[link].Link = NO_LINK;
if (entry2) { if (entry2) {
HostP->Mapping[entry2].Topology[link].Unit = ROUTE_DISCONNECT; host->Mapping[entry2].Topology[link].Unit = ROUTE_DISCONNECT;
HostP->Mapping[entry2].Topology[link].Link = NO_LINK; host->Mapping[entry2].Topology[link].Link = NO_LINK;
} }
} }
} }
...@@ -51,15 +51,12 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2"; ...@@ -51,15 +51,12 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2";
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -72,12 +69,10 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2"; ...@@ -72,12 +69,10 @@ static char *_riocmd_c_sccs_ = "@(#)riocmd.c 1.2";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
...@@ -148,7 +143,7 @@ int RIOCommandRta(struct rio_info *p, unsigned long RtaUnique, int (*func) (stru ...@@ -148,7 +143,7 @@ int RIOCommandRta(struct rio_info *p, unsigned long RtaUnique, int (*func) (stru
{ {
unsigned int Host; unsigned int Host;
rio_dprintk(RIO_DEBUG_CMD, "Command RTA 0x%lx func 0x%p\n", RtaUnique, func); rio_dprintk(RIO_DEBUG_CMD, "Command RTA 0x%lx func %p\n", RtaUnique, func);
if (!RtaUnique) if (!RtaUnique)
return (0); return (0);
...@@ -375,7 +370,7 @@ int RIOFoadWakeup(struct rio_info *p) ...@@ -375,7 +370,7 @@ int RIOFoadWakeup(struct rio_info *p)
/* /*
** Incoming command on the COMMAND_RUP to be processed. ** Incoming command on the COMMAND_RUP to be processed.
*/ */
static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, struct PKT * PacketP)
{ {
struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data;
struct Port *PortP; struct Port *PortP;
...@@ -418,7 +413,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * ...@@ -418,7 +413,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control); rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Control 0x%x (%d)\n", PacketP->control, PacketP->control);
rio_dprintk(RIO_DEBUG_CMD, "PACKET information: Check 0x%x (%d)\n", PacketP->csum, PacketP->csum); 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); rio_dprintk(RIO_DEBUG_CMD, "COMMAND information: Host Port Number 0x%x, " "Command Code 0x%x\n", PktCmdP->PhbNum, PktCmdP->Command);
return TRUE; return 1;
} }
PortP = p->RIOPortp[SysPort]; PortP = p->RIOPortp[SysPort];
rio_spin_lock_irqsave(&PortP->portSem, flags); rio_spin_lock_irqsave(&PortP->portSem, flags);
...@@ -427,7 +422,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * ...@@ -427,7 +422,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *
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 0 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 */
...@@ -541,7 +536,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * ...@@ -541,7 +536,7 @@ static int RIOCommandRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT *
func_exit(); func_exit();
return TRUE; return 1;
} }
/* /*
...@@ -600,13 +595,13 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP) ...@@ -600,13 +595,13 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
** straight on the RUP.... ** straight on the RUP....
*/ */
if ((UnixRupP->CmdsWaitingP == NULL) && (UnixRupP->CmdPendingP == NULL) && (readw(&UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE) && (CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) if ((UnixRupP->CmdsWaitingP == NULL) && (UnixRupP->CmdPendingP == NULL) && (readw(&UnixRupP->RupP->txcontrol) == TX_RUP_INACTIVE) && (CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP)
: TRUE)) { : 1)) {
rio_dprintk(RIO_DEBUG_CMD, "RUP inactive-placing command straight on. Cmd byte is 0x%x\n", CmdBlkP->Packet.data[0]); 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, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT)); HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT));
/* /*
** place command packet on the pending position. ** place command packet on the pending position.
...@@ -620,7 +615,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP) ...@@ -620,7 +615,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags); rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
return RIO_SUCCESS; return 0;
} }
rio_dprintk(RIO_DEBUG_CMD, "RUP active - en-queing\n"); rio_dprintk(RIO_DEBUG_CMD, "RUP active - en-queing\n");
...@@ -633,15 +628,15 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP) ...@@ -633,15 +628,15 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
Base = &UnixRupP->CmdsWaitingP; Base = &UnixRupP->CmdsWaitingP;
rio_dprintk(RIO_DEBUG_CMD, "First try to queue cmdblk 0x%p at 0x%p\n", CmdBlkP, Base); rio_dprintk(RIO_DEBUG_CMD, "First try to queue cmdblk %p at %p\n", CmdBlkP, Base);
while (*Base) { while (*Base) {
rio_dprintk(RIO_DEBUG_CMD, "Command cmdblk 0x%p here\n", *Base); rio_dprintk(RIO_DEBUG_CMD, "Command cmdblk %p here\n", *Base);
Base = &((*Base)->NextP); Base = &((*Base)->NextP);
rio_dprintk(RIO_DEBUG_CMD, "Now try to queue cmd cmdblk 0x%p at 0x%p\n", CmdBlkP, Base); rio_dprintk(RIO_DEBUG_CMD, "Now try to queue cmd cmdblk %p at %p\n", CmdBlkP, Base);
} }
rio_dprintk(RIO_DEBUG_CMD, "Will queue cmdblk 0x%p at 0x%p\n", CmdBlkP, Base); rio_dprintk(RIO_DEBUG_CMD, "Will queue cmdblk %p at %p\n", CmdBlkP, Base);
*Base = CmdBlkP; *Base = CmdBlkP;
...@@ -649,7 +644,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP) ...@@ -649,7 +644,7 @@ int RIOQueueCmdBlk(struct Host *HostP, uint Rup, struct CmdBlk *CmdBlkP)
rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags); rio_spin_unlock_irqrestore(&UnixRupP->RupLock, flags);
return RIO_SUCCESS; return 0;
} }
/* /*
...@@ -681,9 +676,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP) ...@@ -681,9 +676,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
if (readw(&UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) { if (readw(&UnixRupP->RupP->rxcontrol) != RX_RUP_INACTIVE) {
int FreeMe; int FreeMe;
PacketP = (PKT *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt)); PacketP = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&UnixRupP->RupP->rxpkt));
ShowPacket(DBG_CMD, PacketP);
switch (readb(&PacketP->dest_port)) { switch (readb(&PacketP->dest_port)) {
case BOOT_RUP: case BOOT_RUP:
...@@ -749,7 +742,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP) ...@@ -749,7 +742,7 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
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", CmdBlkP->Packet.len & 0x80 ? "Command" : "Data", CmdBlkP->Packet.data[0]); rio_dprintk(RIO_DEBUG_CMD, "Free Boot %s Command Block '%x'\n", CmdBlkP->Packet.len & 0x80 ? "Command" : "Data", CmdBlkP->Packet.data[0]);
rio_dprintk(RIO_DEBUG_CMD, "Command 0x%p completed\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CMD, "Command %p completed\n", CmdBlkP);
/* /*
** Clear the Rup lock to prevent mutual exclusion. ** Clear the Rup lock to prevent mutual exclusion.
...@@ -782,14 +775,14 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP) ...@@ -782,14 +775,14 @@ void RIOPollHostCommands(struct rio_info *p, struct Host *HostP)
** If it returns RIO_FAIL then don't ** If it returns RIO_FAIL then don't
** send this command yet! ** send this command yet!
*/ */
if (!(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) : TRUE)) { if (!(CmdBlkP->PreFuncP ? (*CmdBlkP->PreFuncP) (CmdBlkP->PreArg, CmdBlkP) : 1)) {
rio_dprintk(RIO_DEBUG_CMD, "Not ready to start command 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CMD, "Not ready to start command %p\n", CmdBlkP);
} else { } else {
rio_dprintk(RIO_DEBUG_CMD, "Start new command 0x%p Cmd byte is 0x%x\n", CmdBlkP, CmdBlkP->Packet.data[0]); rio_dprintk(RIO_DEBUG_CMD, "Start new command %p Cmd byte is 0x%x\n", CmdBlkP, CmdBlkP->Packet.data[0]);
/* /*
** Whammy! blat that pack! ** Whammy! blat that pack!
*/ */
HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(PKT)); HostP->Copy((caddr_t) & CmdBlkP->Packet, RIO_PTR(HostP->Caddr, UnixRupP->RupP->txpkt), sizeof(struct PKT));
/* /*
** remove the command from the rup command queue... ** remove the command from the rup command queue...
...@@ -831,14 +824,13 @@ int RIOWFlushMark(unsigned long iPortP, struct CmdBlk *CmdBlkP) ...@@ -831,14 +824,13 @@ int RIOWFlushMark(unsigned long iPortP, struct CmdBlk *CmdBlkP)
int RIORFlushEnable(unsigned long iPortP, struct CmdBlk *CmdBlkP) int RIORFlushEnable(unsigned long iPortP, struct CmdBlk *CmdBlkP)
{ {
struct Port *PortP = (struct Port *) iPortP; struct Port *PortP = (struct Port *) iPortP;
PKT *PacketP; struct 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);
put_free_end(PortP->HostP, PacketP); put_free_end(PortP->HostP, PacketP);
} }
...@@ -892,10 +884,6 @@ int RIOUnUse(unsigned long iPortP, struct CmdBlk *CmdBlkP) ...@@ -892,10 +884,6 @@ int RIOUnUse(unsigned long iPortP, struct CmdBlk *CmdBlkP)
return 0; return 0;
} }
void ShowPacket(uint Flags, struct PKT *PacketP)
{
}
/* /*
** **
** How to use this file: ** How to use this file:
......
...@@ -51,15 +51,12 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3"; ...@@ -51,15 +51,12 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3";
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -72,12 +69,10 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3"; ...@@ -72,12 +69,10 @@ static char *_rioctrl_c_sccs_ = "@(#)rioctrl.c 1.3";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
...@@ -144,7 +139,7 @@ int su; ...@@ -144,7 +139,7 @@ int su;
ushort loop; ushort loop;
int Entry; int Entry;
struct Port *PortP; struct Port *PortP;
PKT *PacketP; struct PKT *PacketP;
int retval = 0; int retval = 0;
unsigned long flags; unsigned long flags;
...@@ -154,7 +149,7 @@ int su; ...@@ -154,7 +149,7 @@ int su;
Host = 0; Host = 0;
PortP = NULL; PortP = NULL;
rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: 0x%p\n", cmd, arg); rio_dprintk(RIO_DEBUG_CTRL, "control ioctl cmd: 0x%x arg: %p\n", cmd, arg);
switch (cmd) { switch (cmd) {
/* /*
...@@ -572,8 +567,8 @@ int su; ...@@ -572,8 +567,8 @@ int su;
PortSetup.Store = p->RIOPortp[port]->Store; PortSetup.Store = p->RIOPortp[port]->Store;
PortSetup.Lock = p->RIOPortp[port]->Lock; PortSetup.Lock = p->RIOPortp[port]->Lock;
PortSetup.XpCps = p->RIOPortp[port]->Xprint.XpCps; PortSetup.XpCps = p->RIOPortp[port]->Xprint.XpCps;
bcopy(p->RIOPortp[port]->Xprint.XpOn, PortSetup.XpOn, MAX_XP_CTRL_LEN); memcpy(PortSetup.XpOn, p->RIOPortp[port]->Xprint.XpOn, MAX_XP_CTRL_LEN);
bcopy(p->RIOPortp[port]->Xprint.XpOff, PortSetup.XpOff, MAX_XP_CTRL_LEN); memcpy(PortSetup.XpOff, p->RIOPortp[port]->Xprint.XpOff, MAX_XP_CTRL_LEN);
PortSetup.XpOn[MAX_XP_CTRL_LEN - 1] = '\0'; PortSetup.XpOn[MAX_XP_CTRL_LEN - 1] = '\0';
PortSetup.XpOff[MAX_XP_CTRL_LEN - 1] = '\0'; PortSetup.XpOff[MAX_XP_CTRL_LEN - 1] = '\0';
...@@ -1404,7 +1399,7 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd) ...@@ -1404,7 +1399,7 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
return RIO_FAIL; return RIO_FAIL;
} }
rio_dprintk(RIO_DEBUG_CTRL, "Command blk 0x%p - InUse now %d\n", CmdBlkP, PortP->InUse); rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n", CmdBlkP, PortP->InUse);
PktCmdP = (struct PktCmd_M *) &CmdBlkP->Packet.data[0]; PktCmdP = (struct PktCmd_M *) &CmdBlkP->Packet.data[0];
...@@ -1430,38 +1425,38 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd) ...@@ -1430,38 +1425,38 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
switch (Cmd) { switch (Cmd) {
case MEMDUMP: case MEMDUMP:
rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk 0x%p (addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr); rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p (addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr);
PktCmdP->SubCommand = MEMDUMP; PktCmdP->SubCommand = MEMDUMP;
PktCmdP->SubAddr = SubCmd.Addr; PktCmdP->SubAddr = SubCmd.Addr;
break; break;
case FCLOSE: case FCLOSE:
rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n", CmdBlkP);
break; break;
case READ_REGISTER: case READ_REGISTER:
rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) command blk 0x%p\n", (int) SubCmd.Addr, CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) command blk %p\n", (int) SubCmd.Addr, CmdBlkP);
PktCmdP->SubCommand = READ_REGISTER; PktCmdP->SubCommand = READ_REGISTER;
PktCmdP->SubAddr = SubCmd.Addr; PktCmdP->SubAddr = SubCmd.Addr;
break; break;
case RESUME: case RESUME:
rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n", CmdBlkP);
break; break;
case RFLUSH: case RFLUSH:
rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n", CmdBlkP);
CmdBlkP->PostFuncP = RIORFlushEnable; CmdBlkP->PostFuncP = RIORFlushEnable;
break; break;
case SUSPEND: case SUSPEND:
rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n", CmdBlkP);
break; break;
case MGET: case MGET:
rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n", CmdBlkP);
break; break;
case MSET: case MSET:
case MBIC: case MBIC:
case MBIS: case MBIS:
CmdBlkP->Packet.data[4] = (char) PortP->ModemLines; CmdBlkP->Packet.data[4] = (char) PortP->ModemLines;
rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command blk 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command blk %p\n", CmdBlkP);
break; break;
case WFLUSH: case WFLUSH:
...@@ -1475,7 +1470,7 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd) ...@@ -1475,7 +1470,7 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
RIOFreeCmdBlk(CmdBlkP); RIOFreeCmdBlk(CmdBlkP);
return (RIO_FAIL); return (RIO_FAIL);
} else { } else {
rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command blk 0x%p\n", CmdBlkP); rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command blk %p\n", CmdBlkP);
CmdBlkP->PostFuncP = RIOWFlushMark; CmdBlkP->PostFuncP = RIOWFlushMark;
} }
break; break;
......
...@@ -51,15 +51,12 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; ...@@ -51,15 +51,12 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
#include "linux_compat.h" #include "linux_compat.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -72,19 +69,17 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3"; ...@@ -72,19 +69,17 @@ static char *_rioinit_c_sccs_ = "@(#)rioinit.c 1.3";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
#include "rio_linux.h" #include "rio_linux.h"
int RIOPCIinit(struct rio_info *p, int Mode); int RIOPCIinit(struct rio_info *p, int Mode);
static int RIOScrub(int, BYTE *, int); static int RIOScrub(int, u8 *, int);
/** /**
...@@ -156,7 +151,7 @@ static u8 val[] = { ...@@ -156,7 +151,7 @@ static u8 val[] = {
** RAM test a board. ** RAM test a board.
** Nothing too complicated, just enough to check it out. ** Nothing too complicated, just enough to check it out.
*/ */
int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) int RIOBoardTest(unsigned long paddr, caddr_t caddr, unsigned char type, int slot)
{ {
struct DpRam *DpRam = (struct DpRam *)caddr; struct DpRam *DpRam = (struct DpRam *)caddr;
char *ram[4]; char *ram[4];
...@@ -164,7 +159,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) ...@@ -164,7 +159,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
int op, bank; int op, bank;
int nbanks; int nbanks;
rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Reset host type=%d, DpRam=0x%p, slot=%d\n", rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Reset host type=%d, DpRam=%p, slot=%d\n",
type, DpRam, slot); type, DpRam, slot);
RIOHostReset(type, DpRam, slot); RIOHostReset(type, DpRam, slot);
...@@ -193,10 +188,10 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) ...@@ -193,10 +188,10 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
if (nbanks == 3) { if (nbanks == 3) {
rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Memory: 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x)\n", rio_dprintk (RIO_DEBUG_INIT, "RIO-init: Memory: %p(0x%x), %p(0x%x), %p(0x%x)\n",
ram[0], size[0], ram[1], size[1], ram[2], size[2]); ram[0], size[0], ram[1], size[1], ram[2], size[2]);
} else { } else {
rio_dprintk (RIO_DEBUG_INIT, "RIO-init: 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x), 0x%p(0x%x)\n", rio_dprintk (RIO_DEBUG_INIT, "RIO-init: %p(0x%x), %p(0x%x), %p(0x%x), %p(0x%x)\n",
ram[0], size[0], ram[1], size[1], ram[2], size[2], ram[3], size[3]); ram[0], size[0], ram[1], size[1], ram[2], size[2], ram[3], size[3]);
} }
...@@ -207,7 +202,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) ...@@ -207,7 +202,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
*/ */
for (op=0; op<TEST_END; op++) { for (op=0; op<TEST_END; op++) {
for (bank=0; bank<nbanks; bank++) { for (bank=0; bank<nbanks; bank++) {
if (RIOScrub(op, (BYTE *)ram[bank], size[bank]) == RIO_FAIL) { if (RIOScrub(op, (u8 *)ram[bank], size[bank]) == RIO_FAIL) {
rio_dprintk (RIO_DEBUG_INIT, "RIO-init: RIOScrub band %d, op %d failed\n", rio_dprintk (RIO_DEBUG_INIT, "RIO-init: RIOScrub band %d, op %d failed\n",
bank, op); bank, op);
return RIO_FAIL; return RIO_FAIL;
...@@ -216,7 +211,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) ...@@ -216,7 +211,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
} }
rio_dprintk (RIO_DEBUG_INIT, "Test completed\n"); rio_dprintk (RIO_DEBUG_INIT, "Test completed\n");
return RIO_SUCCESS; return 0;
} }
...@@ -232,7 +227,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot) ...@@ -232,7 +227,7 @@ int RIOBoardTest(paddr_t paddr, caddr_t caddr, unsigned char type, int slot)
** to check that the data from the previous phase was retained. ** to check that the data from the previous phase was retained.
*/ */
static int RIOScrub(int op, BYTE *ram, int size) static int RIOScrub(int op, u8 *ram, int size)
{ {
int off; int off;
unsigned char oldbyte; unsigned char oldbyte;
...@@ -364,7 +359,7 @@ static int RIOScrub(int op, BYTE *ram, int size) ...@@ -364,7 +359,7 @@ static int RIOScrub(int op, BYTE *ram, int size)
} }
writew(newword, ram + off); writew(newword, ram + off);
} }
return RIO_SUCCESS; return 0;
} }
......
...@@ -54,15 +54,12 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2"; ...@@ -54,15 +54,12 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -75,12 +72,10 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2"; ...@@ -75,12 +72,10 @@ static char *_riointr_c_sccs_ = "@(#)riointr.c 1.2";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
...@@ -396,7 +391,6 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From) ...@@ -396,7 +391,6 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, 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 (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
...@@ -413,13 +407,12 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From) ...@@ -413,13 +407,12 @@ void RIOServiceHost(struct rio_info *p, struct Host *HostP, 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 & (COR2_RTSFLOW | COR2_CTSFLOW)) == (COR2_RTSFLOW | COR2_CTSFLOW)) ? TRUE : FALSE, DONT_SLEEP) == RIO_FAIL) { if (RIOParam(PortP, OPEN, ((PortP->Cor2Copy & (COR2_RTSFLOW | COR2_CTSFLOW)) == (COR2_RTSFLOW | COR2_CTSFLOW)) ? 1 : 0, DONT_SLEEP) == RIO_FAIL) {
continue; /* with next port */ continue; /* with next port */
} }
rio_spin_lock(&PortP->portSem); rio_spin_lock(&PortP->portSem);
PortP->MagicFlags &= ~MAGIC_REBOOT; PortP->MagicFlags &= ~MAGIC_REBOOT;
} }
#endif
/* /*
** As mentioned above, this is a tacky hack to cope ** As mentioned above, this is a tacky hack to cope
......
...@@ -52,15 +52,12 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3"; ...@@ -52,15 +52,12 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -73,17 +70,13 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3"; ...@@ -73,17 +70,13 @@ static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
#include "param.h" #include "param.h"
#include "list.h"
#include "sam.h"
...@@ -162,7 +155,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) ...@@ -162,7 +155,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
struct tty_struct *TtyP; struct tty_struct *TtyP;
int retval; int retval;
struct phb_param *phb_param_ptr; struct phb_param *phb_param_ptr;
PKT *PacketP; struct PKT *PacketP;
int res; int res;
u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0; u8 Cor1 = 0, Cor2 = 0, Cor4 = 0, Cor5 = 0;
u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0; u8 TxXon = 0, TxXoff = 0, RxXon = 0, RxXoff = 0;
...@@ -228,7 +221,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) ...@@ -228,7 +221,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
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 0;
} }
} }
...@@ -240,7 +233,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) ...@@ -240,7 +233,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
} }
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%p\n", PacketP); rio_dprintk(RIO_DEBUG_PARAM, "Packet is %p\n", PacketP);
phb_param_ptr = (struct phb_param *) PacketP->data; phb_param_ptr = (struct phb_param *) PacketP->data;
...@@ -579,7 +572,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) ...@@ -579,7 +572,7 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag)
*/ */
func_exit(); func_exit();
return RIO_SUCCESS; return 0;
} }
...@@ -587,11 +580,11 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, int SleepFlag) ...@@ -587,11 +580,11 @@ int RIOParam(struct Port *PortP, int cmd, int Modem, 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 can_add_transmit(PKT **PktP, struct Port *PortP) int can_add_transmit(struct PKT **PktP, struct Port *PortP)
{ {
PKT *tp; struct PKT *tp;
*PktP = tp = (PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd)); *PktP = tp = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->TxAdd));
return !((unsigned long) tp & PKT_IN_USE); return !((unsigned long) tp & PKT_IN_USE);
} }
...@@ -615,10 +608,10 @@ void add_transmit(struct Port *PortP) ...@@ -615,10 +608,10 @@ void add_transmit(struct Port *PortP)
* Put a packet onto the end of the * Put a packet onto the end of the
* free list * free list
****************************************/ ****************************************/
void put_free_end(struct Host *HostP, PKT *PktP) void put_free_end(struct Host *HostP, struct PKT *PktP)
{ {
FREE_LIST *tmp_pointer; struct rio_free_list *tmp_pointer;
ushort old_end, new_end; unsigned short old_end, new_end;
unsigned long flags; unsigned long flags;
rio_spin_lock_irqsave(&HostP->HostLock, flags); rio_spin_lock_irqsave(&HostP->HostLock, flags);
...@@ -632,15 +625,15 @@ void put_free_end(struct Host *HostP, PKT *PktP) ...@@ -632,15 +625,15 @@ void put_free_end(struct Host *HostP, PKT *PktP)
if ((old_end = readw(&HostP->ParmMapP->free_list_end)) != TPNULL) { if ((old_end = readw(&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 = (struct rio_free_list *) RIO_PTR(HostP->Caddr, old_end);
writew(new_end, &tmp_pointer->next); writew(new_end, &tmp_pointer->next);
writew(old_end, &((FREE_LIST *) PktP)->prev); writew(old_end, &((struct rio_free_list *) PktP)->prev);
writew(TPNULL, &((FREE_LIST *) PktP)->next); writew(TPNULL, &((struct rio_free_list *) PktP)->next);
writew(new_end, &HostP->ParmMapP->free_list_end); writew(new_end, &HostP->ParmMapP->free_list_end);
} else { /* First packet on the free list this should never happen! */ } else { /* First packet on the free list this should never happen! */
rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n"); rio_dprintk(RIO_DEBUG_PFE, "put_free_end(): This should never happen\n");
writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end); writew(RIO_OFF(HostP->Caddr, PktP), &HostP->ParmMapP->free_list_end);
tmp_pointer = (FREE_LIST *) PktP; tmp_pointer = (struct rio_free_list *) PktP;
writew(TPNULL, &tmp_pointer->prev); writew(TPNULL, &tmp_pointer->prev);
writew(TPNULL, &tmp_pointer->next); writew(TPNULL, &tmp_pointer->next);
} }
...@@ -654,10 +647,10 @@ void put_free_end(struct Host *HostP, PKT *PktP) ...@@ -654,10 +647,10 @@ void put_free_end(struct Host *HostP, 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 can_remove_receive(PKT **PktP, struct Port *PortP) int can_remove_receive(struct PKT **PktP, struct Port *PortP)
{ {
if (readw(PortP->RxRemove) & PKT_IN_USE) { if (readw(PortP->RxRemove) & PKT_IN_USE) {
*PktP = (PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE); *PktP = (struct PKT *) RIO_PTR(PortP->Caddr, readw(PortP->RxRemove) & ~PKT_IN_USE);
return 1; return 1;
} }
return 0; return 0;
......
...@@ -50,15 +50,12 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3"; ...@@ -50,15 +50,12 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3";
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -71,29 +68,25 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3"; ...@@ -71,29 +68,25 @@ static char *_rioroute_c_sccs_ = "@(#)rioroute.c 1.3";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
#include "param.h" #include "param.h"
#include "list.h"
#include "sam.h"
static int RIOCheckIsolated(struct rio_info *, struct Host *, uint); static int RIOCheckIsolated(struct rio_info *, struct Host *, unsigned int);
static int RIOIsolate(struct rio_info *, struct Host *, uint); static int RIOIsolate(struct rio_info *, struct Host *, unsigned int);
static int RIOCheck(struct Host *, uint); static int RIOCheck(struct Host *, unsigned int);
static void RIOConCon(struct rio_info *, struct Host *, uint, uint, uint, uint, int); static void RIOConCon(struct rio_info *, struct Host *, unsigned int, unsigned int, unsigned int, unsigned int, int);
/* /*
** Incoming on the ROUTE_RUP ** Incoming on the ROUTE_RUP
** I wrote this while I was tired. Forgive me. ** I wrote this while I was tired. Forgive me.
*/ */
int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT * PacketP)
{ {
struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data; struct PktCmd *PktCmdP = (struct PktCmd *) PacketP->data;
struct PktCmd_M *PktReplyP; struct PktCmd_M *PktReplyP;
...@@ -104,10 +97,10 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -104,10 +97,10 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
int ThisLink, ThisLinkMin, ThisLinkMax; int ThisLink, ThisLinkMin, ThisLinkMax;
int port; int port;
int Mod, Mod1, Mod2; int Mod, Mod1, Mod2;
ushort RtaType; unsigned short RtaType;
uint RtaUniq; unsigned int RtaUniq;
uint ThisUnit, ThisUnit2; /* 2 ids to accommodate 16 port RTA */ unsigned int ThisUnit, ThisUnit2; /* 2 ids to accommodate 16 port RTA */
uint OldUnit, NewUnit, OldLink, NewLink; unsigned int OldUnit, NewUnit, OldLink, NewLink;
char *MyType, *MyName; char *MyType, *MyName;
int Lies; int Lies;
unsigned long flags; unsigned long flags;
...@@ -125,7 +118,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -125,7 +118,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
** from an RTA then we need to fill in the Mapping structure's ** from an RTA then we need to fill in the Mapping structure's
** Topology array for the unit. ** Topology array for the unit.
*/ */
if (Rup >= (ushort) MAX_RUP) { if (Rup >= (unsigned short) MAX_RUP) {
ThisUnit = HOST_ID; ThisUnit = HOST_ID;
TopP = HostP->Topology; TopP = HostP->Topology;
MyType = "Host"; MyType = "Host";
...@@ -151,7 +144,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -151,7 +144,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
** it won't lie about network interconnect, total disconnects ** it won't lie about network interconnect, total disconnects
** and no-IDs. (or at least, it doesn't *matter* if it does) ** and no-IDs. (or at least, it doesn't *matter* if it does)
*/ */
if (readb(&PktCmdP->RouteTopology[ThisLink].Unit) > (ushort) MAX_RUP) if (readb(&PktCmdP->RouteTopology[ThisLink].Unit) > (unsigned short) MAX_RUP)
continue; continue;
for (NewLink = ThisLinkMin; NewLink < ThisLink; NewLink++) { for (NewLink = ThisLinkMin; NewLink < ThisLink; NewLink++) {
...@@ -168,7 +161,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -168,7 +161,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
'A' + readb(&PktCmdP->RouteTopology[0].Link), 'A' + readb(&PktCmdP->RouteTopology[0].Link),
readb(&PktCmdP->RouteTopology[1].Unit), readb(&PktCmdP->RouteTopology[1].Unit),
'A' + readb(&PktCmdP->RouteTopology[1].Link), readb(&PktCmdP->RouteTopology[2].Unit), 'A' + readb(&PktCmdP->RouteTopology[2].Link), readb(&PktCmdP->RouteTopology[3].Unit), 'A' + readb(&PktCmdP->RouteTopology[3].Link)); 'A' + readb(&PktCmdP->RouteTopology[1].Link), readb(&PktCmdP->RouteTopology[2].Unit), 'A' + readb(&PktCmdP->RouteTopology[2].Link), readb(&PktCmdP->RouteTopology[3].Unit), 'A' + readb(&PktCmdP->RouteTopology[3].Link));
return TRUE; return 1;
} }
/* /*
...@@ -258,7 +251,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -258,7 +251,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
RIOCheckIsolated(p, HostP, OldUnit); RIOCheckIsolated(p, HostP, OldUnit);
} }
} }
return TRUE; return 1;
} }
/* /*
...@@ -266,7 +259,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -266,7 +259,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
*/ */
if (readb(&PktCmdP->Command) != ROUTE_REQUEST) { if (readb(&PktCmdP->Command) != ROUTE_REQUEST) {
rio_dprintk(RIO_DEBUG_ROUTE, "Unknown command %d received on rup %d host %p ROUTE_RUP\n", readb(&PktCmdP->Command), Rup, HostP); rio_dprintk(RIO_DEBUG_ROUTE, "Unknown command %d received on rup %d host %p ROUTE_RUP\n", readb(&PktCmdP->Command), Rup, HostP);
return TRUE; return 1;
} }
RtaUniq = (readb(&PktCmdP->UniqNum[0])) + (readb(&PktCmdP->UniqNum[1]) << 8) + (readb(&PktCmdP->UniqNum[2]) << 16) + (readb(&PktCmdP->UniqNum[3]) << 24); RtaUniq = (readb(&PktCmdP->UniqNum[0])) + (readb(&PktCmdP->UniqNum[1]) << 8) + (readb(&PktCmdP->UniqNum[2]) << 16) + (readb(&PktCmdP->UniqNum[3]) << 24);
...@@ -292,10 +285,6 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -292,10 +285,6 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
rio_dprintk(RIO_DEBUG_ROUTE, "Module types are %s (ports 0-3) and %s (ports 4-7)\n", p->RIOModuleTypes[Mod1].Name, p->RIOModuleTypes[Mod2].Name); rio_dprintk(RIO_DEBUG_ROUTE, "Module types are %s (ports 0-3) and %s (ports 4-7)\n", p->RIOModuleTypes[Mod1].Name, p->RIOModuleTypes[Mod2].Name);
} }
if (RtaUniq == 0xffffffff) {
ShowPacket(DBG_SPECIAL, PacketP);
}
/* /*
** try to unhook a command block from the command free list. ** try to unhook a command block from the command free list.
*/ */
...@@ -320,7 +309,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -320,7 +309,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
PktReplyP->Command = ROUTE_FOAD; PktReplyP->Command = ROUTE_FOAD;
HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7); HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7);
RIOQueueCmdBlk(HostP, Rup, CmdBlkP); RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
return TRUE; return 1;
} }
/* /*
...@@ -354,7 +343,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -354,7 +343,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
PktReplyP->Command = ROUTE_FOAD; PktReplyP->Command = ROUTE_FOAD;
HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7); HostP->Copy("RT_FOAD", PktReplyP->CommandText, 7);
RIOQueueCmdBlk(HostP, Rup, CmdBlkP); RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
return TRUE; return 1;
} }
/* /*
...@@ -447,7 +436,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -447,7 +436,7 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
/* /*
** Job done, get on with the interrupts! ** Job done, get on with the interrupts!
*/ */
return TRUE; return 1;
} }
} }
/* /*
...@@ -491,28 +480,25 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP) ...@@ -491,28 +480,25 @@ int RIORouteRup(struct rio_info *p, uint Rup, struct Host *HostP, PKT * PacketP)
if (RtaType == TYPE_RTA16) { if (RtaType == TYPE_RTA16) {
if (RIOFindFreeID(p, HostP, &ThisUnit, &ThisUnit2) == 0) { if (RIOFindFreeID(p, HostP, &ThisUnit, &ThisUnit2) == 0) {
RIODefaultName(p, HostP, ThisUnit); RIODefaultName(p, HostP, ThisUnit);
FillSlot(ThisUnit, ThisUnit2, RtaUniq, HostP); rio_fill_host_slot(ThisUnit, ThisUnit2, RtaUniq, HostP);
} }
} else { } else {
if (RIOFindFreeID(p, HostP, &ThisUnit, NULL) == 0) { if (RIOFindFreeID(p, HostP, &ThisUnit, NULL) == 0) {
RIODefaultName(p, HostP, ThisUnit); RIODefaultName(p, HostP, ThisUnit);
FillSlot(ThisUnit, 0, RtaUniq, HostP); rio_fill_host_slot(ThisUnit, 0, RtaUniq, HostP);
} }
} }
PktReplyP->Command = ROUTE_USED; PktReplyP->Command = ROUTE_USED;
HostP->Copy("RT_USED", PktReplyP->CommandText, 7); HostP->Copy("RT_USED", PktReplyP->CommandText, 7);
} }
RIOQueueCmdBlk(HostP, Rup, CmdBlkP); RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
return TRUE; return 1;
} }
void RIOFixPhbs(p, HostP, unit) void RIOFixPhbs(struct rio_info *p, struct Host *HostP, unsigned int unit)
struct rio_info *p;
struct Host *HostP;
uint unit;
{ {
ushort link, port; unsigned short link, port;
struct Port *PortP; struct Port *PortP;
unsigned long flags; unsigned long flags;
int PortN = HostP->Mapping[unit].SysPort; int PortN = HostP->Mapping[unit].SysPort;
...@@ -520,7 +506,7 @@ uint unit; ...@@ -520,7 +506,7 @@ uint unit;
rio_dprintk(RIO_DEBUG_ROUTE, "RIOFixPhbs unit %d sysport %d\n", unit, PortN); rio_dprintk(RIO_DEBUG_ROUTE, "RIOFixPhbs unit %d sysport %d\n", unit, PortN);
if (PortN != -1) { if (PortN != -1) {
ushort dest_unit = HostP->Mapping[unit].ID2; unsigned short dest_unit = HostP->Mapping[unit].ID2;
/* /*
** Get the link number used for the 1st 8 phbs on this unit. ** Get the link number used for the 1st 8 phbs on this unit.
...@@ -530,9 +516,9 @@ uint unit; ...@@ -530,9 +516,9 @@ uint unit;
link = readw(&PortP->PhbP->link); link = readw(&PortP->PhbP->link);
for (port = 0; port < PORTS_PER_RTA; port++, PortN++) { for (port = 0; port < PORTS_PER_RTA; port++, PortN++) {
ushort dest_port = port + 8; unsigned short dest_port = port + 8;
WORD *TxPktP; u16 *TxPktP;
PKT *Pkt; struct PKT *Pkt;
PortP = p->RIOPortp[PortN]; PortP = p->RIOPortp[PortN];
...@@ -569,12 +555,12 @@ uint unit; ...@@ -569,12 +555,12 @@ uint unit;
** card. This needs to be translated into a 32 bit pointer ** card. This needs to be translated into a 32 bit pointer
** so it can be accessed from the driver. ** so it can be accessed from the driver.
*/ */
Pkt = (PKT *) RIO_PTR(HostP->Caddr, readw(TxPktP)); Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(TxPktP));
/* /*
** If the packet is used, reset it. ** If the packet is used, reset it.
*/ */
Pkt = (PKT *) ((unsigned long) Pkt & ~PKT_IN_USE); Pkt = (struct PKT *) ((unsigned long) Pkt & ~PKT_IN_USE);
writeb(dest_unit, &Pkt->dest_unit); writeb(dest_unit, &Pkt->dest_unit);
writeb(dest_port, &Pkt->dest_port); writeb(dest_port, &Pkt->dest_port);
} }
...@@ -603,10 +589,7 @@ uint unit; ...@@ -603,10 +589,7 @@ uint unit;
** the world about it. This is done to ensure that the configurator ** the world about it. This is done to ensure that the configurator
** only gets up-to-date information about what is going on. ** only gets up-to-date information about what is going on.
*/ */
static int RIOCheckIsolated(p, HostP, UnitId) static int RIOCheckIsolated(struct rio_info *p, struct Host *HostP, unsigned int UnitId)
struct rio_info *p;
struct Host *HostP;
uint UnitId;
{ {
unsigned long flags; unsigned long flags;
rio_spin_lock_irqsave(&HostP->HostLock, flags); rio_spin_lock_irqsave(&HostP->HostLock, flags);
...@@ -628,12 +611,9 @@ uint UnitId; ...@@ -628,12 +611,9 @@ uint UnitId;
** all the units attached to it. This will mean that the entire ** all the units attached to it. This will mean that the entire
** subnet will re-introduce itself. ** subnet will re-introduce itself.
*/ */
static int RIOIsolate(p, HostP, UnitId) static int RIOIsolate(struct rio_info *p, struct Host *HostP, unsigned int UnitId)
struct rio_info *p;
struct Host *HostP;
uint UnitId;
{ {
uint link, unit; unsigned int link, unit;
UnitId--; /* this trick relies on the Unit Id being UNSIGNED! */ UnitId--; /* this trick relies on the Unit Id being UNSIGNED! */
...@@ -658,9 +638,7 @@ uint UnitId; ...@@ -658,9 +638,7 @@ uint UnitId;
return 1; return 1;
} }
static int RIOCheck(HostP, UnitId) static int RIOCheck(struct Host *HostP, unsigned int UnitId)
struct Host *HostP;
uint UnitId;
{ {
unsigned char link; unsigned char link;
...@@ -714,8 +692,7 @@ uint UnitId; ...@@ -714,8 +692,7 @@ uint UnitId;
** Returns the type of unit (host, 16/8 port RTA) ** Returns the type of unit (host, 16/8 port RTA)
*/ */
uint GetUnitType(Uniq) unsigned int GetUnitType(unsigned int Uniq)
uint Uniq;
{ {
switch ((Uniq >> 28) & 0xf) { switch ((Uniq >> 28) & 0xf) {
case RIO_AT: case RIO_AT:
...@@ -736,8 +713,7 @@ uint Uniq; ...@@ -736,8 +713,7 @@ uint Uniq;
} }
} }
int RIOSetChange(p) int RIOSetChange(struct rio_info *p)
struct rio_info *p;
{ {
if (p->RIOQuickCheck != NOT_CHANGED) if (p->RIOQuickCheck != NOT_CHANGED)
return (0); return (0);
...@@ -751,14 +727,13 @@ struct rio_info *p; ...@@ -751,14 +727,13 @@ struct rio_info *p;
return (0); return (0);
} }
static void RIOConCon(p, HostP, FromId, FromLink, ToId, ToLink, Change) static void RIOConCon(struct rio_info *p,
struct rio_info *p; struct Host *HostP,
struct Host *HostP; unsigned int FromId,
uint FromId; unsigned int FromLink,
uint FromLink; unsigned int ToId,
uint ToId; unsigned int ToLink,
uint ToLink; int Change)
int Change;
{ {
char *FromName; char *FromName;
char *FromType; char *FromType;
...@@ -912,7 +887,8 @@ static int RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit) ...@@ -912,7 +887,8 @@ static int RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit)
** This function scans the given host table for either one ** This function scans the given host table for either one
** or two free unit ID's. ** or two free unit ID's.
*/ */
int RIOFindFreeID(struct rio_info *p, struct Host *HostP, uint * pID1, uint * pID2)
int RIOFindFreeID(struct rio_info *p, struct Host *HostP, unsigned int * pID1, unsigned int * pID2)
{ {
int unit, tempID; int unit, tempID;
......
...@@ -53,15 +53,12 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2"; ...@@ -53,15 +53,12 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2";
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -74,17 +71,13 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2"; ...@@ -74,17 +71,13 @@ static char *_riotable_c_sccs_ = "@(#)riotable.c 1.2";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
#include "param.h" #include "param.h"
#include "list.h"
#include "sam.h"
#include "protsts.h" #include "protsts.h"
/* /*
...@@ -136,7 +129,7 @@ int RIONewTable(struct rio_info *p) ...@@ -136,7 +129,7 @@ int RIONewTable(struct rio_info *p)
cptr = MapP->Name; /* (2) */ cptr = MapP->Name; /* (2) */
cptr[MAX_NAME_LEN - 1] = '\0'; cptr[MAX_NAME_LEN - 1] = '\0';
if (cptr[0] == '\0') { if (cptr[0] == '\0') {
bcopy(MapP->RtaUniqueNum ? "RTA NN" : "HOST NN", MapP->Name, 8); memcpy(MapP->Name, MapP->RtaUniqueNum ? "RTA NN" : "HOST NN", 8);
MapP->Name[5] = '0' + Entry / 10; MapP->Name[5] = '0' + Entry / 10;
MapP->Name[6] = '0' + Entry % 10; MapP->Name[6] = '0' + Entry % 10;
} }
...@@ -325,7 +318,7 @@ int RIONewTable(struct rio_info *p) ...@@ -325,7 +318,7 @@ int RIONewTable(struct rio_info *p)
*/ */
if (MapP->ID == 0) { if (MapP->ID == 0) {
rio_dprintk(RIO_DEBUG_TABLE, "Host entry found. Name %s\n", MapP->Name); rio_dprintk(RIO_DEBUG_TABLE, "Host entry found. Name %s\n", MapP->Name);
bcopy(MapP->Name, HostP->Name, MAX_NAME_LEN); memcpy(HostP->Name, MapP->Name, MAX_NAME_LEN);
continue; continue;
} }
...@@ -369,7 +362,7 @@ int RIONewTable(struct rio_info *p) ...@@ -369,7 +362,7 @@ int RIONewTable(struct rio_info *p)
} }
} }
if (!p->RIOHosts[Host].Name[0]) { if (!p->RIOHosts[Host].Name[0]) {
bcopy("HOST 1", p->RIOHosts[Host].Name, 7); memcpy(p->RIOHosts[Host].Name, "HOST 1", 7);
p->RIOHosts[Host].Name[5] += Host; p->RIOHosts[Host].Name[5] += Host;
} }
/* /*
...@@ -397,7 +390,7 @@ int RIONewTable(struct rio_info *p) ...@@ -397,7 +390,7 @@ int RIONewTable(struct rio_info *p)
*/ */
if (Host1 != Host) { if (Host1 != Host) {
rio_dprintk(RIO_DEBUG_TABLE, "Default name %s already used\n", p->RIOHosts[Host].Name); rio_dprintk(RIO_DEBUG_TABLE, "Default name %s already used\n", p->RIOHosts[Host].Name);
bcopy("HOST 1", p->RIOHosts[Host].Name, 7); memcpy(p->RIOHosts[Host].Name, "HOST 1", 7);
p->RIOHosts[Host].Name[5] += Host1; p->RIOHosts[Host].Name[5] += Host1;
} }
rio_dprintk(RIO_DEBUG_TABLE, "Assigning default name %s\n", p->RIOHosts[Host].Name); rio_dprintk(RIO_DEBUG_TABLE, "Assigning default name %s\n", p->RIOHosts[Host].Name);
...@@ -440,7 +433,7 @@ int RIOApel(struct rio_info *p) ...@@ -440,7 +433,7 @@ int RIOApel(struct rio_info *p)
MapP->SysPort = NO_PORT; MapP->SysPort = NO_PORT;
for (link = 0; link < LINKS_PER_UNIT; link++) for (link = 0; link < LINKS_PER_UNIT; link++)
MapP->Topology[link] = HostP->Topology[link]; MapP->Topology[link] = HostP->Topology[link];
bcopy(HostP->Name, MapP->Name, MAX_NAME_LEN); memcpy(MapP->Name, HostP->Name, MAX_NAME_LEN);
for (Rup = 0; Rup < MAX_RUP; Rup++) { for (Rup = 0; Rup < MAX_RUP; Rup++) {
if (HostP->Mapping[Rup].Flags & (SLOT_IN_USE | SLOT_TENTATIVE)) { if (HostP->Mapping[Rup].Flags & (SLOT_IN_USE | SLOT_TENTATIVE)) {
p->RIOConnectTable[Next] = HostP->Mapping[Rup]; p->RIOConnectTable[Next] = HostP->Mapping[Rup];
...@@ -539,10 +532,10 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP) ...@@ -539,10 +532,10 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP)
** the phb to port mappings in RIORouteRup. ** the phb to port mappings in RIORouteRup.
*/ */
if (PortP->SecondBlock) { if (PortP->SecondBlock) {
ushort dest_unit = HostMapP->ID; u16 dest_unit = HostMapP->ID;
ushort dest_port = port - SysPort; u16 dest_port = port - SysPort;
u16 *TxPktP; u16 *TxPktP;
PKT *Pkt; struct PKT *Pkt;
for (TxPktP = PortP->TxStart; TxPktP <= PortP->TxEnd; TxPktP++) { for (TxPktP = PortP->TxStart; TxPktP <= PortP->TxEnd; TxPktP++) {
/* /*
...@@ -552,7 +545,7 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP) ...@@ -552,7 +545,7 @@ int RIODeleteRta(struct rio_info *p, struct Map *MapP)
** a 32 bit pointer so it can be ** a 32 bit pointer so it can be
** accessed from the driver. ** accessed from the driver.
*/ */
Pkt = (PKT *) RIO_PTR(HostP->Caddr, readw(&*TxPktP)); Pkt = (struct PKT *) RIO_PTR(HostP->Caddr, readw(&*TxPktP));
rio_dprintk(RIO_DEBUG_TABLE, "Tx packet (%x) destination: Old %x:%x New %x:%x\n", *TxPktP, Pkt->dest_unit, Pkt->dest_port, dest_unit, dest_port); rio_dprintk(RIO_DEBUG_TABLE, "Tx packet (%x) destination: Old %x:%x New %x:%x\n", *TxPktP, Pkt->dest_unit, Pkt->dest_port, dest_unit, dest_port);
writew(dest_unit, &Pkt->dest_unit); writew(dest_unit, &Pkt->dest_unit);
writew(dest_port, &Pkt->dest_port); writew(dest_port, &Pkt->dest_port);
...@@ -600,7 +593,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP) ...@@ -600,7 +593,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
rio_dprintk(RIO_DEBUG_TABLE, "Assign entry on host %x, rta %x, ID %d, Sysport %d\n", MapP->HostUniqueNum, MapP->RtaUniqueNum, MapP->ID, (int) MapP->SysPort); rio_dprintk(RIO_DEBUG_TABLE, "Assign entry on host %x, rta %x, ID %d, Sysport %d\n", MapP->HostUniqueNum, MapP->RtaUniqueNum, MapP->ID, (int) MapP->SysPort);
if ((MapP->ID != (ushort) - 1) && ((int) MapP->ID < (int) 1 || (int) MapP->ID > MAX_RUP)) { if ((MapP->ID != (u16) - 1) && ((int) MapP->ID < (int) 1 || (int) MapP->ID > MAX_RUP)) {
rio_dprintk(RIO_DEBUG_TABLE, "Bad ID in map entry!\n"); rio_dprintk(RIO_DEBUG_TABLE, "Bad ID in map entry!\n");
p->RIOError.Error = ID_NUMBER_OUT_OF_RANGE; p->RIOError.Error = ID_NUMBER_OUT_OF_RANGE;
return -EINVAL; return -EINVAL;
...@@ -646,7 +639,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP) ...@@ -646,7 +639,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
** Now we have a host we need to allocate an ID ** Now we have a host we need to allocate an ID
** if the entry does not already have one. ** if the entry does not already have one.
*/ */
if (MapP->ID == (ushort) - 1) { if (MapP->ID == (u16) - 1) {
int nNewID; int nNewID;
rio_dprintk(RIO_DEBUG_TABLE, "Attempting to get a new ID for rta \"%s\"\n", MapP->Name); rio_dprintk(RIO_DEBUG_TABLE, "Attempting to get a new ID for rta \"%s\"\n", MapP->Name);
...@@ -665,7 +658,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP) ...@@ -665,7 +658,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
p->RIOError.Error = COULDNT_FIND_ENTRY; p->RIOError.Error = COULDNT_FIND_ENTRY;
return -EBUSY; return -EBUSY;
} }
MapP->ID = (ushort) nNewID + 1; MapP->ID = (u16) nNewID + 1;
rio_dprintk(RIO_DEBUG_TABLE, "Allocated ID %d for this new RTA.\n", MapP->ID); rio_dprintk(RIO_DEBUG_TABLE, "Allocated ID %d for this new RTA.\n", MapP->ID);
HostMapP = &p->RIOHosts[host].Mapping[nNewID]; HostMapP = &p->RIOHosts[host].Mapping[nNewID];
HostMapP->RtaUniqueNum = MapP->RtaUniqueNum; HostMapP->RtaUniqueNum = MapP->RtaUniqueNum;
...@@ -706,7 +699,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP) ...@@ -706,7 +699,7 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
*/ */
HostMapP->SysPort = MapP->SysPort; HostMapP->SysPort = MapP->SysPort;
if ((MapP->Flags & RTA16_SECOND_SLOT) == 0) if ((MapP->Flags & RTA16_SECOND_SLOT) == 0)
CCOPY(MapP->Name, HostMapP->Name, MAX_NAME_LEN); memcpy(HostMapP->Name, MapP->Name, MAX_NAME_LEN);
HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED; HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED;
#ifdef NEED_TO_FIX #ifdef NEED_TO_FIX
RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID - 1]); RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID - 1]);
...@@ -743,10 +736,10 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP) ...@@ -743,10 +736,10 @@ int RIOAssignRta(struct rio_info *p, struct Map *MapP)
int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP) int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP)
{ {
struct Port *PortP; struct Port *PortP;
uint SubEnt; unsigned int SubEnt;
uint HostPort; unsigned int HostPort;
uint SysPort; unsigned int SysPort;
ushort RtaType; u16 RtaType;
unsigned long flags; unsigned long flags;
rio_dprintk(RIO_DEBUG_TABLE, "Mapping sysport %d to id %d\n", (int) HostMapP->SysPort, HostMapP->ID); rio_dprintk(RIO_DEBUG_TABLE, "Mapping sysport %d to id %d\n", (int) HostMapP->SysPort, HostMapP->ID);
...@@ -808,10 +801,10 @@ int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP) ...@@ -808,10 +801,10 @@ int RIOReMapPorts(struct rio_info *p, struct Host *HostP, struct Map *HostMapP)
PortP->RupNum = HostMapP->ID - 1; PortP->RupNum = HostMapP->ID - 1;
if (HostMapP->Flags & RTA16_SECOND_SLOT) { if (HostMapP->Flags & RTA16_SECOND_SLOT) {
PortP->ID2 = HostMapP->ID2 - 1; PortP->ID2 = HostMapP->ID2 - 1;
PortP->SecondBlock = TRUE; PortP->SecondBlock = 1;
} else { } else {
PortP->ID2 = 0; PortP->ID2 = 0;
PortP->SecondBlock = FALSE; PortP->SecondBlock = 0;
} }
PortP->RtaUniqueNum = HostMapP->RtaUniqueNum; PortP->RtaUniqueNum = HostMapP->RtaUniqueNum;
...@@ -931,7 +924,7 @@ int RIOChangeName(struct rio_info *p, struct Map *MapP) ...@@ -931,7 +924,7 @@ int RIOChangeName(struct rio_info *p, struct Map *MapP)
return -ENXIO; return -ENXIO;
} }
if (MapP->ID == 0) { if (MapP->ID == 0) {
CCOPY(MapP->Name, p->RIOHosts[host].Name, MAX_NAME_LEN); memcpy(p->RIOHosts[host].Name, MapP->Name, MAX_NAME_LEN);
return 0; return 0;
} }
...@@ -941,7 +934,7 @@ int RIOChangeName(struct rio_info *p, struct Map *MapP) ...@@ -941,7 +934,7 @@ int RIOChangeName(struct rio_info *p, struct Map *MapP)
p->RIOError.Error = RTA_NUMBER_WRONG; p->RIOError.Error = RTA_NUMBER_WRONG;
return -ENXIO; return -ENXIO;
} }
CCOPY(MapP->Name, HostMapP->Name, MAX_NAME_LEN); memcpy(HostMapP->Name, MapP->Name, MAX_NAME_LEN);
return 0; return 0;
} }
} }
......
...@@ -56,15 +56,12 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3"; ...@@ -56,15 +56,12 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3";
#include "linux_compat.h" #include "linux_compat.h"
#include "rio_linux.h" #include "rio_linux.h"
#include "typdef.h"
#include "pkt.h" #include "pkt.h"
#include "daemon.h" #include "daemon.h"
#include "rio.h" #include "rio.h"
#include "riospace.h" #include "riospace.h"
#include "top.h"
#include "cmdpkt.h" #include "cmdpkt.h"
#include "map.h" #include "map.h"
#include "riotypes.h"
#include "rup.h" #include "rup.h"
#include "port.h" #include "port.h"
#include "riodrvr.h" #include "riodrvr.h"
...@@ -77,58 +74,18 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3"; ...@@ -77,58 +74,18 @@ static char *_riotty_c_sccs_ = "@(#)riotty.c 1.3";
#include "unixrup.h" #include "unixrup.h"
#include "board.h" #include "board.h"
#include "host.h" #include "host.h"
#include "error.h"
#include "phb.h" #include "phb.h"
#include "link.h" #include "link.h"
#include "cmdblk.h" #include "cmdblk.h"
#include "route.h" #include "route.h"
#include "control.h"
#include "cirrus.h" #include "cirrus.h"
#include "rioioctl.h" #include "rioioctl.h"
#include "param.h" #include "param.h"
#include "list.h"
#include "sam.h"
static void RIOClearUp(struct Port *PortP); static void RIOClearUp(struct Port *PortP);
int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg);
extern int conv_vb[]; /* now defined in ttymgr.c */
extern int conv_bv[]; /* now defined in ttymgr.c */
/*
** 16.09.1998 ARG - Fix to build riotty.k.o for Modular Kernel Support
**
** ep.def.h is necessary for Modular Kernel Support
** DO NOT place any kernel 'extern's after this line
** or this source file will not build riotty.k.o
*/
#ifdef uLYNX
#include <ep.def.h>
#endif
#ifdef NEED_THIS2 /* Below belongs in func.h */
static struct old_sgttyb default_sg = { int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg);
B19200, B19200, /* input and output speed */
'H' - '@', /* erase char */
-1, /* 2nd erase char */
'U' - '@', /* kill char */
ECHO | CRMOD, /* mode */
'C' - '@', /* interrupt character */
'\\' - '@', /* quit char */
'Q' - '@', /* start char */
'S' - '@', /* stop char */
'D' - '@', /* EOF */
-1, /* brk */
(LCRTBS | LCRTERA | LCRTKIL | LCTLECH), /* local mode word */
'Z' - '@', /* process stop */
'Y' - '@', /* delayed stop */
'R' - '@', /* reprint line */
'O' - '@', /* flush output */
'W' - '@', /* word erase */
'V' - '@' /* literal next char */
};
#endif
extern struct rio_info *p; extern struct rio_info *p;
...@@ -137,7 +94,6 @@ extern struct rio_info *p; ...@@ -137,7 +94,6 @@ extern struct rio_info *p;
int riotopen(struct tty_struct *tty, struct file *filp) int riotopen(struct tty_struct *tty, struct file *filp)
{ {
unsigned int SysPort; unsigned int SysPort;
int Modem;
int repeat_this = 250; int repeat_this = 250;
struct Port *PortP; /* pointer to the port structure */ struct Port *PortP; /* pointer to the port structure */
unsigned long flags; unsigned long flags;
...@@ -151,7 +107,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -151,7 +107,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
tty->driver_data = NULL; tty->driver_data = NULL;
SysPort = rio_minor(tty); SysPort = rio_minor(tty);
Modem = rio_ismodem(tty);
if (p->RIOFailed) { if (p->RIOFailed) {
rio_dprintk(RIO_DEBUG_TTY, "System initialisation failed\n"); rio_dprintk(RIO_DEBUG_TTY, "System initialisation failed\n");
...@@ -159,7 +114,7 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -159,7 +114,7 @@ int riotopen(struct tty_struct *tty, struct file *filp)
return -ENXIO; return -ENXIO;
} }
rio_dprintk(RIO_DEBUG_TTY, "port open SysPort %d (%s) (mapped:%d)\n", SysPort, Modem ? "Modem" : "tty", p->RIOPortp[SysPort]->Mapped); rio_dprintk(RIO_DEBUG_TTY, "port open SysPort %d (mapped:%d)\n", SysPort, p->RIOPortp[SysPort]->Mapped);
/* /*
** Validate that we have received a legitimate request. ** Validate that we have received a legitimate request.
...@@ -305,15 +260,12 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -305,15 +260,12 @@ int riotopen(struct tty_struct *tty, struct file *filp)
/* PortP->gs.xmit_cnt = 0; */ /* PortP->gs.xmit_cnt = 0; */
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
#ifdef NEED_THIS
ttyseth(PortP, tp, (struct old_sgttyb *) &default_sg);
#endif
/* Someone explain to me why this delay/config is /* Someone explain to me why this delay/config is
here. If I read the docs correctly the "open" here. If I read the docs correctly the "open"
command piggybacks the parameters immediately. command piggybacks the parameters immediately.
-- REW */ -- REW */
RIOParam(PortP, OPEN, Modem, OK_TO_SLEEP); /* Open the port */ RIOParam(PortP, OPEN, 1, OK_TO_SLEEP); /* Open the port */
rio_spin_lock_irqsave(&PortP->portSem, flags); rio_spin_lock_irqsave(&PortP->portSem, flags);
/* /*
...@@ -321,20 +273,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -321,20 +273,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
*/ */
while (!(PortP->PortState & PORT_ISOPEN) && !p->RIOHalted) { while (!(PortP->PortState & PORT_ISOPEN) && !p->RIOHalted) {
rio_dprintk(RIO_DEBUG_TTY, "Waiting for PORT_ISOPEN-currently %x\n", PortP->PortState); rio_dprintk(RIO_DEBUG_TTY, "Waiting for PORT_ISOPEN-currently %x\n", PortP->PortState);
/*
** 15.10.1998 ARG - ESIL 0759
** (Part) fix for port being trashed when opened whilst RTA "disconnected"
** Take out the limited wait - now wait for ever or until user
** bangs us out.
**
if (repeat_this -- <= 0) {
rio_dprint(RIO_DEBUG_TTY, ("Waiting for open to finish timed out.\n"));
RIOPreemptiveCmd(p, PortP, FCLOSE );
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
return -EINTR;
}
**
*/
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) { if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
rio_dprintk(RIO_DEBUG_TTY, "Waiting for open to finish broken by signal\n"); rio_dprintk(RIO_DEBUG_TTY, "Waiting for open to finish broken by signal\n");
...@@ -354,8 +292,6 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -354,8 +292,6 @@ int riotopen(struct tty_struct *tty, struct file *filp)
} }
rio_dprintk(RIO_DEBUG_TTY, "PORT_ISOPEN found\n"); rio_dprintk(RIO_DEBUG_TTY, "PORT_ISOPEN found\n");
} }
#ifdef MODEM_SUPPORT
if (Modem) {
rio_dprintk(RIO_DEBUG_TTY, "Modem - test for carrier\n"); rio_dprintk(RIO_DEBUG_TTY, "Modem - test for carrier\n");
/* /*
** ACTION ** ACTION
...@@ -371,21 +307,18 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -371,21 +307,18 @@ int riotopen(struct tty_struct *tty, struct file *filp)
PortP->State |= RIO_CARR_ON; PortP->State |= RIO_CARR_ON;
wake_up_interruptible(&PortP->gs.open_wait); wake_up_interruptible(&PortP->gs.open_wait);
} else { /* no carrier - wait for DCD */ } else { /* no carrier - wait for DCD */
/* /*
while (!(PortP->gs.tty->termios->c_state & CARR_ON) && while (!(PortP->gs.tty->termios->c_state & CARR_ON) &&
!(filp->f_flags & O_NONBLOCK) && !p->RIOHalted ) !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted )
*/ */
while (!(PortP->State & RIO_CARR_ON) && !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted) { while (!(PortP->State & RIO_CARR_ON) && !(filp->f_flags & O_NONBLOCK) && !p->RIOHalted) {
rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr on\n", SysPort); rio_dprintk(RIO_DEBUG_TTY, "open(%d) sleeping for carr on\n", SysPort);
/* /*
PortP->gs.tty->termios->c_state |= WOPEN; PortP->gs.tty->termios->c_state |= WOPEN;
*/ */
PortP->State |= RIO_WOPEN; PortP->State |= RIO_WOPEN;
rio_spin_unlock_irqrestore(&PortP->portSem, flags); rio_spin_unlock_irqrestore(&PortP->portSem, flags);
if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
{
/* /*
** ACTION: verify that this is a good thing ** ACTION: verify that this is a good thing
** to do here. -- ??? ** to do here. -- ???
...@@ -408,20 +341,9 @@ int riotopen(struct tty_struct *tty, struct file *filp) ...@@ -408,20 +341,9 @@ int riotopen(struct tty_struct *tty, struct file *filp)
goto bombout; goto bombout;
rio_dprintk(RIO_DEBUG_TTY, "Setting RIO_MOPEN\n"); rio_dprintk(RIO_DEBUG_TTY, "Setting RIO_MOPEN\n");
PortP->State |= RIO_MOPEN; PortP->State |= RIO_MOPEN;
} else
#endif
{
/*
** ACTION
** Direct line open - force carrier (will probably mean
** that sleeping Modem line fubar)
*/
PortP->State |= RIO_LOPEN;
}
if (p->RIOHalted) { if (p->RIOHalted)
goto bombout; goto bombout;
}
rio_dprintk(RIO_DEBUG_TTY, "high level open done\n"); rio_dprintk(RIO_DEBUG_TTY, "high level open done\n");
...@@ -453,23 +375,21 @@ int riotclose(void *ptr) ...@@ -453,23 +375,21 @@ int riotclose(void *ptr)
unsigned long end_time; unsigned long end_time;
struct tty_struct *tty; struct tty_struct *tty;
unsigned long flags; unsigned long flags;
int Modem;
int rv = 0; int rv = 0;
rio_dprintk(RIO_DEBUG_TTY, "port close SysPort %d\n", PortP->PortNum); rio_dprintk(RIO_DEBUG_TTY, "port close SysPort %d\n", PortP->PortNum);
/* PortP = p->RIOPortp[SysPort]; */ /* PortP = p->RIOPortp[SysPort]; */
rio_dprintk(RIO_DEBUG_TTY, "Port is at address 0x%p\n", PortP); rio_dprintk(RIO_DEBUG_TTY, "Port is at address %p\n", PortP);
/* tp = PortP->TtyP; *//* Get tty */ /* tp = PortP->TtyP; *//* Get tty */
tty = PortP->gs.tty; tty = PortP->gs.tty;
rio_dprintk(RIO_DEBUG_TTY, "TTY is at address 0x%p\n", tty); rio_dprintk(RIO_DEBUG_TTY, "TTY is at address %p\n", tty);
if (PortP->gs.closing_wait) if (PortP->gs.closing_wait)
end_time = jiffies + PortP->gs.closing_wait; end_time = jiffies + PortP->gs.closing_wait;
else else
end_time = jiffies + MAX_SCHEDULE_TIMEOUT; end_time = jiffies + MAX_SCHEDULE_TIMEOUT;
Modem = rio_ismodem(tty);
rio_spin_lock_irqsave(&PortP->portSem, flags); rio_spin_lock_irqsave(&PortP->portSem, flags);
/* /*
...@@ -493,7 +413,7 @@ int riotclose(void *ptr) ...@@ -493,7 +413,7 @@ int riotclose(void *ptr)
/* /*
** clear the open bits for this device ** clear the open bits for this device
*/ */
PortP->State &= (Modem ? ~RIO_MOPEN : ~RIO_LOPEN); PortP->State &= ~RIO_MOPEN;
PortP->State &= ~RIO_CARR_ON; PortP->State &= ~RIO_CARR_ON;
PortP->ModemState &= ~MSVR1_CD; PortP->ModemState &= ~MSVR1_CD;
/* /*
...@@ -613,7 +533,7 @@ int riotclose(void *ptr) ...@@ -613,7 +533,7 @@ int riotclose(void *ptr)
if (PortP->statsGather) if (PortP->statsGather)
PortP->closes++; PortP->closes++;
close_end: close_end:
/* XXX: Why would a "DELETED" flag be reset here? I'd have /* XXX: Why would a "DELETED" flag be reset here? I'd have
thought that a "deleted" flag means that the port was thought that a "deleted" flag means that the port was
permanently gone, but here we can make it reappear by it permanently gone, but here we can make it reappear by it
...@@ -629,8 +549,7 @@ int riotclose(void *ptr) ...@@ -629,8 +549,7 @@ int riotclose(void *ptr)
static void RIOClearUp(PortP) static void RIOClearUp(struct Port *PortP)
struct Port *PortP;
{ {
rio_dprintk(RIO_DEBUG_TTY, "RIOHalted set\n"); rio_dprintk(RIO_DEBUG_TTY, "RIOHalted set\n");
PortP->Config = 0; /* Direct semaphore */ PortP->Config = 0; /* Direct semaphore */
...@@ -657,7 +576,7 @@ struct Port *PortP; ...@@ -657,7 +576,7 @@ struct Port *PortP;
*/ */
int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg) int RIOShortCommand(struct rio_info *p, struct Port *PortP, int command, int len, int arg)
{ {
PKT *PacketP; struct PKT *PacketP;
int retries = 20; /* at 10 per second -> 2 seconds */ int retries = 20; /* at 10 per second -> 2 seconds */
unsigned long flags; unsigned long flags;
......
/****************************************************************************
******* *******
******* R I O T Y P E S
******* *******
****************************************************************************
Author : Jon Brawn
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _riotypes_h
#define _riotypes_h 1
#ifdef SCCS_LABELS
#ifndef lint
/* static char *_rio_riotypes_h_sccs = "@(#)riotypes.h 1.10"; */
#endif
#endif
typedef u16 char_ptr;
typedef u16 Channel_ptr;
typedef u16 FREE_LIST_ptr_ptr;
typedef u16 FREE_LIST_ptr;
typedef u16 LPB_ptr;
typedef u16 Process_ptr;
typedef u16 PHB_ptr;
typedef u16 PKT_ptr;
typedef u16 Q_BUF_ptr;
typedef u16 Q_BUF_ptr_ptr;
typedef u16 ROUTE_STR_ptr;
typedef u16 RUP_ptr;
typedef u16 short_ptr;
typedef u16 u_short_ptr;
typedef u16 ushort_ptr;
#endif /* __riotypes__ */
/*********** end of file ***********/
/****************************************************************************
******* *******
******* R O M
******* *******
****************************************************************************
Author : Ian Nandhra
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _rom_h
#define _rom_h 1
#ifndef lint
#ifdef SCCS
static char *_rio_rom_h_sccs = "@(#)rom.h 1.1";
#endif
#endif
typedef struct ROM ROM;
struct ROM {
u_short slx;
char pcb_letter_rev;
char pcb_number_rev;
char serial[4];
char year;
char week;
};
#endif
#define HOST_ROM (ROM *) 0x7c00
#define RTA_ROM (ROM *) 0x7801
#define ROM_LENGTH 0x20
/*********** end of file ***********/
/****************************************************************************
******* *******
******* S A M . H
******* *******
****************************************************************************
Author : Ian Nandhra
Date :
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Version : 0.01
Mods
----------------------------------------------------------------------------
Date By Description
----------------------------------------------------------------------------
***************************************************************************/
#ifndef _sam_h
#define _sam_h 1
#ifdef SCCS_LABELS
#ifndef lint
/* static char *_rio_sam_h_sccs = "@(#)sam.h 1.3"; */
#endif
#endif
#define NUM_FREE_LIST_UNITS 500
#ifndef FALSE
#define FALSE (short) 0x00
#endif
#ifndef TRUE
#define TRUE (short) !FALSE
#endif
#define TX TRUE
#define RX FALSE
typedef struct FREE_LIST FREE_LIST;
struct FREE_LIST {
FREE_LIST_ptr next;
FREE_LIST_ptr prev;
};
#endif
/*********** end of file ***********/
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : space.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:19
** Retrieved : 11/6/98 11:34:22
**
** ident @(#)space.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_space_h__
#define __rio_space_h__
#ifdef SCCS_LABELS
static char *_space_h_sccs_ = "@(#)space.h 1.2";
#endif
extern int rio_cntls;
extern int rio_bases[];
extern int rio_limits[];
extern int rio_vects[];
#endif /* __rio_space_h__ */
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : top.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:19
** Retrieved : 11/6/98 11:34:22
**
** ident @(#)top.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_top_h__
#define __rio_top_h__
#ifdef SCCS_LABELS
static char *_top_h_sccs_ = "@(#)top.h 1.2";
#endif
/*
** Topology information
*/
struct Top {
u8 Unit;
u8 Link;
};
#endif /* __rio_top_h__ */
/*
** -----------------------------------------------------------------------------
**
** Perle Specialix driver for Linux
** Ported from existing RIO Driver for SCO sources.
*
* (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Module : typdef.h
** SID : 1.2
** Last Modified : 11/6/98 11:34:20
** Retrieved : 11/6/98 11:34:22
**
** ident @(#)typdef.h 1.2
**
** -----------------------------------------------------------------------------
*/
#ifndef __rio_typdef_h__
#define __rio_typdef_h__
/*
** IT IS REALLY, REALLY, IMPORTANT THAT BYTES ARE UNSIGNED!
**
** These types are ONLY to be used for refering to data structures
** on the RIO Host card!
*/
typedef u8 BYTE;
typedef u16 WORD;
typedef u32 DWORD;
typedef u16 RIOP;
/*
** 27.01.199 ARG - mods to compile 'newutils' on LyxnOS -
** These #defines are for the benefit of the 'libfuncs' library
** only. They are not necessarily correct type mappings and
** are here only to make the source compile.
*/
/* typedef unsigned int uint; */
typedef unsigned long ulong_t;
typedef unsigned short ushort_t;
typedef unsigned char uchar_t;
typedef unsigned char queue_t;
typedef unsigned char mblk_t;
typedef unsigned long paddr_t;
#define TPNULL ((ushort)(0x8000))
/*
** RIO structures defined in other include files.
*/
typedef struct PKT PKT;
typedef struct LPB LPB;
typedef struct RUP RUP;
typedef struct Port Port;
typedef struct DpRam DpRam;
#endif /* __rio_typdef_h__ */
...@@ -45,9 +45,9 @@ struct UnixRup { ...@@ -45,9 +45,9 @@ 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 */
uint Id; /* Id number */ unsigned int Id; /* Id number */
uint BaseSysPort; /* SysPort of first tty on this RTA */ unsigned int BaseSysPort; /* SysPort of first tty on this RTA */
uint ModTypes; /* Modules on this RTA */ unsigned int 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 */
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment