}
}
} else if (host >= p->RIONumHosts) {
- return EINVAL;
+ return -EINVAL;
} else {
if ( p->RIOHosts[host].Flags == RC_RUNNING ) {
WWORD(p->RIOHosts[host].ParmMapP->timer , value);
sizeof(SpecialRupCmd)) == COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD copy failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
CmdBlkP = RIOGetCmdBlk();
if ( !CmdBlkP ) {
rio_dprintk (RIO_DEBUG_CTRL, "SPECIAL_RUP_CMD GetCmdBlk failed\n");
- return ENXIO;
+ return -ENXIO;
}
CmdBlkP->Packet = SpecialRupCmd.Packet;
if ( SpecialRupCmd.Host >= p->RIONumHosts )
return rio_RIODebugMemory(RIO_DEBUG_CTRL, arg);
else
#endif
- return EPERM;
+ return -EPERM;
case RIO_ALL_MODEM:
rio_dprintk (RIO_DEBUG_CTRL, "RIO_ALL_MODEM\n");
p->RIOError.Error = IOCTL_COMMAND_UNKNOWN;
- return EINVAL;
+ return -EINVAL;
case RIO_GET_TABLE:
/*
TOTAL_MAP_ENTRIES*sizeof(struct Map)) == COPYFAIL) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_GET_TABLE copy failed\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
{
if ( !su ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_PUT_TABLE !Root\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if ( copyin((int)arg, (caddr_t)&p->RIOConnectTable[0],
TOTAL_MAP_ENTRIES*sizeof(struct Map) ) == COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_PUT_TABLE copy failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
/*
***********************************
{
rio_dprintk (RIO_DEBUG_CTRL, "RIO_GET_BINDINGS !Root\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if (copyout((caddr_t) p->RIOBindTab, (int)arg,
(sizeof(ulong) * MAX_RTA_BINDINGS)) == COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_GET_BINDINGS copy failed\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return 0;
{
rio_dprintk (RIO_DEBUG_CTRL, "RIO_PUT_BINDINGS !Root\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if (copyin((int)arg, (caddr_t)&p->RIOBindTab[0],
(sizeof(ulong) * MAX_RTA_BINDINGS))==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_PUT_BINDINGS copy failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return 0;
if ( !su ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_BIND_RTA !Root\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
for (Entry = 0; Entry < MAX_RTA_BINDINGS; Entry++) {
if ((EmptySlot == -1) && (p->RIOBindTab[Entry] == 0L))
if ((port < 0) || (port > 511)) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_RESUME: Bad port number %d\n", port);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
PortP = p->RIOPortp[port];
if (!PortP->Mapped) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_RESUME: Port %d not mapped\n", port);
p->RIOError.Error = PORT_NOT_MAPPED_INTO_SYSTEM;
- return EINVAL;
+ return -EINVAL;
}
if (!(PortP->State & (RIO_LOPEN | RIO_MOPEN))) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_RESUME: Port %d not open\n", port);
- return EINVAL;
+ return -EINVAL;
}
rio_spin_lock_irqsave(&PortP->portSem, flags);
RIO_FAIL) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_RESUME failed\n");
rio_spin_unlock_irqrestore(&PortP->portSem, flags);
- return EBUSY;
+ return -EBUSY;
}
else {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_RESUME: Port %d resumed\n", port);
if ( !su ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_ASSIGN_RTA !Root\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if (copyin((int)arg, (caddr_t)&MapEnt, sizeof(MapEnt))
== COPYFAIL) {
rio_dprintk (RIO_DEBUG_CTRL, "Copy from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return RIOAssignRta(p, &MapEnt);
if ( !su ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_CHANGE_NAME !Root\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if (copyin((int)arg, (caddr_t)&MapEnt, sizeof(MapEnt))
== COPYFAIL) {
rio_dprintk (RIO_DEBUG_CTRL, "Copy from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return RIOChangeName(p, &MapEnt);
if ( !su ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_DELETE_RTA !Root\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if (copyin((int)arg, (caddr_t)&MapEnt, sizeof(MapEnt))
== COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "Copy from data space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return RIODeleteRta(p, &MapEnt);
if (copyout((caddr_t)&p->RIORtaDisCons,(int)arg,
sizeof(uint))==COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return 0;
case RIO_LAST_ERROR:
if (copyout((caddr_t)&p->RIOError, (int)arg,
sizeof(struct Error)) ==COPYFAIL )
- return EFAULT;
+ return -EFAULT;
return 0;
case RIO_GET_LOG:
RIOGetLog(arg);
return 0;
#else
- return EINVAL;
+ return -EINVAL;
#endif
case RIO_GET_MODTYPE:
sizeof(uint)) == COPYFAIL )
{
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
rio_dprintk (RIO_DEBUG_CTRL, "Get module type for port %d\n", port);
if ( port < 0 || port > 511 )
{
rio_dprintk (RIO_DEBUG_CTRL, "RIO_GET_MODTYPE: Bad port number %d\n", port);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
PortP = (p->RIOPortp[port]);
if (!PortP->Mapped)
{
rio_dprintk (RIO_DEBUG_CTRL, "RIO_GET_MODTYPE: Port %d not mapped\n", port);
p->RIOError.Error = PORT_NOT_MAPPED_INTO_SYSTEM;
- return EINVAL;
+ return -EINVAL;
}
/*
** Return module type of port
if (copyout((caddr_t)&port, (int)arg,
sizeof(uint)) == COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return(0);
/*
if (copyout((caddr_t)&p->RIOBootMode, (int)arg,
sizeof(p->RIOBootMode)) == COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return(0);
== COPYFAIL ) {
p->RIOError.Error = COPYIN_FAILED;
rio_dprintk (RIO_DEBUG_CTRL, "EFAULT");
- return EFAULT;
+ return -EFAULT;
}
if ( PortSetup.From > PortSetup.To ||
PortSetup.To >= RIO_PORTS ) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
rio_dprintk (RIO_DEBUG_CTRL, "ENXIO");
- return ENXIO;
+ return -ENXIO;
}
if ( PortSetup.XpCps > p->RIOConf.MaxXpCps ||
PortSetup.XpCps < p->RIOConf.MinXpCps ) {
p->RIOError.Error = XPRINT_CPS_OUT_OF_RANGE;
rio_dprintk (RIO_DEBUG_CTRL, "EINVAL");
- return EINVAL;
+ return -EINVAL;
}
if ( !p->RIOPortp ) {
cprintf("No p->RIOPortp array!\n");
rio_dprintk (RIO_DEBUG_CTRL, "No p->RIOPortp array!\n");
- return EIO;
+ return -EIO;
}
rio_dprintk (RIO_DEBUG_CTRL, "entering loop (%d %d)!\n", PortSetup.From, PortSetup.To);
for (loop=PortSetup.From; loop<=PortSetup.To; loop++) {
if (copyin((int)arg, (caddr_t)&PortSetup, sizeof(PortSetup))
== COPYFAIL ) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( PortSetup.From >= RIO_PORTS ) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
port = PortSetup.To = PortSetup.From;
if ( copyout((caddr_t)&PortSetup,(int)arg,sizeof(PortSetup))
==COPYFAIL ) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
if (copyin( (int)arg, (caddr_t)&PortParams,
sizeof(struct PortParams)) == COPYFAIL) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if (PortParams.Port >= RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
PortP = (p->RIOPortp[PortParams.Port]);
PortParams.Config = PortP->Config;
if (copyout((caddr_t)&PortParams, (int)arg,
sizeof(struct PortParams)) == COPYFAIL ) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
if (copyin((int)arg, (caddr_t)&PortTty, sizeof(struct PortTty))
== COPYFAIL) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( PortTty.port >= RIO_PORTS ) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
rio_dprintk (RIO_DEBUG_CTRL, "Port %d\n", PortTty.port);
if (copyout((caddr_t)&PortTty, (int)arg,
sizeof(struct PortTty)) == COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
if (copyin((int)arg, (caddr_t)&PortTty,
sizeof(struct PortTty)) == COPYFAIL) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
rio_dprintk (RIO_DEBUG_CTRL, "Set port %d tty\n", PortTty.port);
if (PortTty.port >= (ushort) RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
PortP = (p->RIOPortp[PortTty.port]);
#if 0
if ( copyin((int)arg, (caddr_t)&PortParams, sizeof(PortParams))
== COPYFAIL ) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if (PortParams.Port >= (ushort) RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
PortP = (p->RIOPortp[PortParams.Port]);
rio_spin_lock_irqsave(&PortP->portSem, flags);
if ( copyin((int)arg, (caddr_t)&portStats,
sizeof(struct portStats)) == COPYFAIL ) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( portStats.port >= RIO_PORTS ) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
PortP = (p->RIOPortp[portStats.port]);
portStats.gather = PortP->statsGather;
if ( copyout((caddr_t)&portStats, (int)arg,
sizeof(struct portStats)) == COPYFAIL ) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_RESET_PORT_STATS\n");
if ( port >= RIO_PORTS ) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
PortP = (p->RIOPortp[port]);
rio_spin_lock_irqsave(&PortP->portSem, flags);
if ( copyin( (int)arg, (caddr_t)&portStats,
sizeof(struct portStats)) == COPYFAIL ) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( portStats.port >= RIO_PORTS ) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
PortP = (p->RIOPortp[portStats.port]);
rio_spin_lock_irqsave(&PortP->portSem, flags);
sizeof(struct DbInf)*(num+1))==COPYFAIL) {
rio_dprintk (RIO_DEBUG_CTRL, "ReadLevels Copy failed\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
rio_dprintk (RIO_DEBUG_CTRL, "%d levels to copied\n",num);
return retval;
if (copyout((caddr_t)&p->RIOConf, (int)arg,
sizeof(struct Conf)) ==COPYFAIL ) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_SET_CONFIG\n");
if ( !su ) {
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if ( copyin((int)arg, (caddr_t)&p->RIOConf, sizeof(struct Conf) )
==COPYFAIL ) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
/*
** move a few value around
case RIO_START_POLLER:
rio_dprintk (RIO_DEBUG_CTRL, "RIO_START_POLLER\n");
- return EINVAL;
+ return -EINVAL;
case RIO_STOP_POLLER:
rio_dprintk (RIO_DEBUG_CTRL, "RIO_STOP_POLLER\n");
if ( !su ) {
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
p->RIOPolling = NOT_POLLING;
return retval;
if ( copyin( (int)arg, (caddr_t)&DebugCtrl, sizeof(DebugCtrl) )
==COPYFAIL ) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( DebugCtrl.SysPort == NO_PORT ) {
if ( cmd == RIO_SETDEBUG ) {
if ( !su ) {
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
p->rio_debug = DebugCtrl.Debug;
p->RIODebugWait = DebugCtrl.Wait;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_SET/GET DEBUG: bad port number %d\n",
DebugCtrl.SysPort);
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
}
}
rio_dprintk (RIO_DEBUG_CTRL, "RIO_SET/GET DEBUG: bad port number %d\n",
DebugCtrl.SysPort);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
else if ( cmd == RIO_SETDEBUG ) {
if ( !su ) {
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
rio_spin_lock_irqsave(&PortP->portSem, flags);
p->RIOPortp[DebugCtrl.SysPort]->Debug = DebugCtrl.Debug;
sizeof(DebugCtrl))==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_GETDEBUG: Bad copy to user space\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
}
return retval;
{
rio_dprintk (RIO_DEBUG_CTRL, "RIO_VERSID: Bad copy to user space (host=%d)\n", Host);
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
(int)arg, MAX_VERSION_LEN ) == COPYFAIL ) {
rio_dprint(RIO_DEBUG_CTRL, ("RIO_VERSID: Bad copy to user space\n",Host));
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
**
sizeof(p->RIONumHosts) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_NUM_HOSTS: Bad copy to user space\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
if ( !su ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_FOAD: Not super user\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
p->RIOHalted = 1;
p->RIOSystemUp = 0;
if ( !su ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Not super user\n");
p->RIOError.Error = NOT_SUPER_USER;
- return EPERM;
+ return -EPERM;
}
if ( copyin((int)arg, (caddr_t)&DownLoad,
sizeof(DownLoad) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
rio_dprintk (RIO_DEBUG_CTRL, "Copied in download code for product code 0x%x\n",
DownLoad.ProductCode);
rio_dprintk (RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Bad product code %d passed\n",
DownLoad.ProductCode);
p->RIOError.Error = NO_SUCH_PRODUCT;
- return ENXIO;
+ return -ENXIO;
}
/*
** do something!
rio_dprintk (RIO_DEBUG_CTRL,
"RIO_HOST_REQ: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
/*
** Fetch the parmmap
(int)arg, sizeof(PARM_MAP) )==COPYFAIL ) {
p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_PARMS: Copy out to user space failed\n");
- return EFAULT;
+ return -EFAULT;
}
}
return retval;
sizeof(HostReq) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_REQ: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( HostReq.HostNum >= p->RIONumHosts ) {
p->RIOError.Error = HOST_NUMBER_OUT_OF_RANGE;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_REQ: Illegal host number %d\n",
HostReq.HostNum);
- return ENXIO;
+ return -ENXIO;
}
rio_dprintk (RIO_DEBUG_CTRL, "Request for host %d\n", HostReq.HostNum);
(int)HostReq.HostP,sizeof(struct Host) ) == COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_REQ: Bad copy to user space\n");
- return EFAULT;
+ return -EFAULT;
}
return retval;
sizeof(HostDpRam) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( HostDpRam.HostNum >= p->RIONumHosts ) {
p->RIOError.Error = HOST_NUMBER_OUT_OF_RANGE;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Illegal host number %d\n",
HostDpRam.HostNum);
- return ENXIO;
+ return -ENXIO;
}
rio_dprintk (RIO_DEBUG_CTRL, "Request for host %d\n", HostDpRam.HostNum);
sizeof(struct DpRam) ) == COPYFAIL ) {
p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Bad copy to user space\n");
- return EFAULT;
+ return -EFAULT;
}
}
else if (copyout((caddr_t)p->RIOHosts[HostDpRam.HostNum].Caddr,
sizeof(struct DpRam) ) == COPYFAIL ) {
p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_DPRAM: Bad copy to user space\n");
- return EFAULT;
+ return -EFAULT;
}
return retval;
if ( (int)arg < 0 || (int)arg > 511 ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_SET_BUSY: Bad port number %d\n",(int)arg);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
rio_spin_lock_irqsave(&PortP->portSem, flags);
p->RIOPortp[(int)arg]->State |= RIO_BUSY;
sizeof(PortReq) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_PORT: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if (PortReq.SysPort >= RIO_PORTS) { /* SysPort is unsigned */
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_PORT: Illegal port number %d\n",
PortReq.SysPort);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
rio_dprintk (RIO_DEBUG_CTRL, "Request for port %d\n", PortReq.SysPort);
if (copyout((caddr_t)p->RIOPortp[PortReq.SysPort],
sizeof(struct Port) ) == COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_PORT: Bad copy to user space\n");
- return EFAULT;
+ return -EFAULT;
}
return retval;
sizeof(RupReq) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_RUP: Copy in from user space failed\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if (RupReq.HostNum >= p->RIONumHosts) { /* host is unsigned */
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_RUP: Illegal host number %d\n",
RupReq.HostNum);
p->RIOError.Error = HOST_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
if ( RupReq.RupNum >= MAX_RUP+LINKS_PER_UNIT ) { /* eek! */
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_RUP: Illegal rup number %d\n",
RupReq.RupNum);
p->RIOError.Error = RUP_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
HostP = &p->RIOHosts[RupReq.HostNum];
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_RUP: Host %d not running\n",
RupReq.HostNum);
p->RIOError.Error = HOST_NOT_RUNNING;
- return EIO;
+ return -EIO;
}
rio_dprintk (RIO_DEBUG_CTRL, "Request for rup %d from host %d\n",
RupReq.RupNum,RupReq.HostNum);
(int)RupReq.RupP,sizeof(struct RUP) ) == COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_RUP: Bad copy to user space\n");
- return EFAULT;
+ return -EFAULT;
}
return retval;
sizeof(LpbReq) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_LPB: Bad copy from user space\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if (LpbReq.Host >= p->RIONumHosts) { /* host is unsigned */
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_LPB: Illegal host number %d\n",
LpbReq.Host);
p->RIOError.Error = HOST_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
if ( LpbReq.Link >= LINKS_PER_UNIT ) { /* eek! */
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_LPB: Illegal link number %d\n",
LpbReq.Link);
p->RIOError.Error = LINK_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
HostP = &p->RIOHosts[LpbReq.Host];
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_LPB: Host %d not running\n",
LpbReq.Host );
p->RIOError.Error = HOST_NOT_RUNNING;
- return EIO;
+ return -EIO;
}
rio_dprintk (RIO_DEBUG_CTRL, "Request for lpb %d from host %d\n",
LpbReq.Link, LpbReq.Host);
(int)LpbReq.LpbP,sizeof(struct LPB) ) == COPYFAIL) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_HOST_LPB: Bad copy to user space\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return retval;
case RIO_SIGNALS_ON:
if ( p->RIOSignalProcess ) {
p->RIOError.Error = SIGNALS_ALREADY_SET;
- return EBUSY;
+ return -EBUSY;
}
p->RIOSignalProcess = getpid();
p->RIOPrintDisabled = DONT_PRINT;
case RIO_SIGNALS_OFF:
if ( p->RIOSignalProcess != getpid() ) {
p->RIOError.Error = NOT_RECEIVING_PROCESS;
- return EPERM;
+ return -EPERM;
}
rio_dprintk (RIO_DEBUG_CTRL, "Clear signal process to zero\n");
p->RIOSignalProcess = 0;
if ( port < 0 || port > 511 ) {
rio_dprintk (RIO_DEBUG_CTRL, "Baud rate mapping: Bad port number %d\n", port);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
rio_spin_lock_irqsave(&PortP->portSem, flags);
switch( cmd )
case RIO_STREAM_INFO:
rio_dprintk (RIO_DEBUG_CTRL, "RIO_STREAM_INFO\n");
- return EINVAL;
+ return -EINVAL;
case RIO_SEND_PACKET:
rio_dprintk (RIO_DEBUG_CTRL, "RIO_SEND_PACKET\n");
sizeof(SendPack) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_SEND_PACKET: Bad copy from user space\n");
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
if ( SendPack.PortNum >= 128 ) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return ENXIO;
+ return -ENXIO;
}
PortP = p->RIOPortp[SendPack.PortNum];
if ( !can_add_transmit(&PacketP,PortP) ) {
p->RIOError.Error = UNIT_IS_IN_USE;
rio_spin_unlock_irqrestore( &PortP->portSem , flags);
- return ENOSPC;
+ return -ENOSPC;
}
for ( loop=0; loop<(ushort)(SendPack.Len & 127); loop++ )
sizeof(p->RIONoMessage) )==COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_WHAT_MESG: Bad copy to user space\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return 0;
if (copyin((int)arg, (caddr_t)&SubCmd,
sizeof(struct SubCmdStruct)) == COPYFAIL) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
rio_dprintk (RIO_DEBUG_CTRL, "RIO_MEM_DUMP host %d rup %d addr %x\n",
SubCmd.Host, SubCmd.Rup, SubCmd.Addr);
if (SubCmd.Rup >= MAX_RUP+LINKS_PER_UNIT ) {
p->RIOError.Error = RUP_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
if (SubCmd.Host >= p->RIONumHosts ) {
p->RIOError.Error = HOST_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
port = p->RIOHosts[SubCmd.Host].
if ( RIOPreemptiveCmd(p, PortP, MEMDUMP ) == RIO_FAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_MEM_DUMP failed\n");
rio_spin_unlock_irqrestore( &PortP->portSem , flags);
- return EBUSY;
+ return -EBUSY;
}
else
PortP->State |= RIO_BUSY;
MEMDUMP_SIZE) == COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_MEM_DUMP copy failed\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return 0;
case RIO_TICK:
if ((int)arg < 0 || (int)arg >= p->RIONumHosts)
- return EINVAL;
+ return -EINVAL;
rio_dprintk (RIO_DEBUG_CTRL, "Set interrupt for host %d\n", (int)arg);
WBYTE(p->RIOHosts[(int)arg].SetInt , 0xff);
return 0;
case RIO_TOCK:
if ((int)arg < 0 || (int)arg >= p->RIONumHosts)
- return EINVAL;
+ return -EINVAL;
rio_dprintk (RIO_DEBUG_CTRL, "Clear interrupt for host %d\n", (int)arg);
WBYTE((p->RIOHosts[(int)arg].ResetInt) , 0xff);
return 0;
if (copyout((caddr_t)&p->RIOReadCheck,(int)arg,
sizeof(uint))== COPYFAIL) {
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return 0;
if (copyin((int)arg, (caddr_t)&SubCmd,
sizeof(struct SubCmdStruct)) == COPYFAIL) {
p->RIOError.Error = COPYIN_FAILED;
- return EFAULT;
+ return -EFAULT;
}
rio_dprintk (RIO_DEBUG_CTRL, "RIO_READ_REGISTER host %d rup %d port %d reg %x\n",
SubCmd.Host, SubCmd.Rup, SubCmd.Port, SubCmd.Addr);
rio_dprintk (RIO_DEBUG_CTRL, "Baud rate mapping: Bad port number %d\n",
SubCmd.Port);
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
if (SubCmd.Rup >= MAX_RUP+LINKS_PER_UNIT ) {
p->RIOError.Error = RUP_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
if (SubCmd.Host >= p->RIONumHosts ) {
p->RIOError.Error = HOST_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
port = p->RIOHosts[SubCmd.Host].
if (RIOPreemptiveCmd(p, PortP, READ_REGISTER) == RIO_FAIL) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_READ_REGISTER failed\n");
rio_spin_unlock_irqrestore( &PortP->portSem , flags);
- return EBUSY;
+ return -EBUSY;
}
else
PortP->State |= RIO_BUSY;
sizeof(uint)) == COPYFAIL ) {
rio_dprintk (RIO_DEBUG_CTRL, "RIO_READ_REGISTER copy failed\n");
p->RIOError.Error = COPYOUT_FAILED;
- return EFAULT;
+ return -EFAULT;
}
return 0;
/*
return (int)arg;
}
rio_dprintk (RIO_DEBUG_CTRL, "MAKE Device is called\n");
- return EINVAL;
+ return -EINVAL;
}
/*
** rio_minor: given a dev_t from a stat() call, return
p->RIOError.Error = IOCTL_COMMAND_UNKNOWN;
func_exit ();
- return EINVAL;
+ return -EINVAL;
}
/*
rio_dprintk (RIO_DEBUG_TABLE, "RIONewTable: entering(1)\n");
if ( p->RIOSystemUp ) { /* (1) */
p->RIOError.Error = HOST_HAS_ALREADY_BEEN_BOOTED;
- return EBUSY;
+ return -EBUSY;
}
p->RIOError.Error = NOTHING_WRONG_AT_ALL;
if ( *cptr<' ' || *cptr>'~' ) {
p->RIOError.Error = BAD_CHARACTER_IN_NAME;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
cptr++;
}
rio_dprintk (RIO_DEBUG_TABLE, "%s pretending to be empty but isn't\n",MapP->Name);
p->RIOError.Error = TABLE_ENTRY_ISNT_PROPERLY_NULL;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
rio_dprintk (RIO_DEBUG_TABLE, "!RIO: Daemon: test (3) passes\n");
continue;
MapP->Name);
p->RIOError.Error = ZERO_RTA_ID;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
if ( MapP->ID > MAX_RUP ) {
rio_dprintk (RIO_DEBUG_TABLE, "RIO: RTA %s has been allocated an illegal ID %d\n",
MapP->Name, MapP->ID);
p->RIOError.Error = ID_NUMBER_OUT_OF_RANGE;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
for ( SubEnt=0; SubEnt<Entry; SubEnt++ ) {
if ( MapP->HostUniqueNum ==
p->RIOError.Error = DUPLICATED_RTA_ID;
p->RIOError.Entry = Entry;
p->RIOError.Other = SubEnt;
- return ENXIO;
+ return -ENXIO;
}
/*
** If the RtaUniqueNum is the same, it may be looking at both
p->RIOError.Error = DUPLICATE_UNIQUE_NUMBER;
p->RIOError.Entry = Entry;
p->RIOError.Other = SubEnt;
- return ENXIO;
+ return -ENXIO;
}
}
rio_dprintk (RIO_DEBUG_TABLE, "RIONewTable: entering(7a)\n");
(int)MapP->SysPort,MapP->Name, PORTS_PER_RTA);
p->RIOError.Error = TTY_NUMBER_OUT_OF_RANGE;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
rio_dprintk (RIO_DEBUG_TABLE, "RIONewTable: entering(7b)\n");
/* (7b) */
(int)MapP->SysPort, MapP->Name);
p->RIOError.Error = TTY_NUMBER_OUT_OF_RANGE;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
for ( SubEnt=0; SubEnt<Entry; SubEnt++ ) {
if ( p->RIOConnectTable[SubEnt].Flags & RTA16_SECOND_SLOT )
p->RIOError.Error = TTY_NUMBER_IN_USE;
p->RIOError.Entry = Entry;
p->RIOError.Other = SubEnt;
- return ENXIO;
+ return -ENXIO;
}
rio_dprintk (RIO_DEBUG_TABLE, "RIONewTable: entering(9)\n");
if (RIOStrCmp(MapP->Name,
p->RIOError.Error = NAME_USED_TWICE;
p->RIOError.Entry = Entry;
p->RIOError.Other = SubEnt;
- return ENXIO;
+ return -ENXIO;
}
}
}
MapP->Name);
p->RIOError.Error = HOST_ID_NOT_ZERO;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
if ( MapP->SysPort != NO_PORT ) {
rio_dprintk (RIO_DEBUG_TABLE, "RIO: HOST %s has been allocated port numbers!\n",
MapP->Name);
p->RIOError.Error = HOST_SYSPORT_BAD;
p->RIOError.Entry = Entry;
- return ENXIO;
+ return -ENXIO;
}
}
}
rio_dprintk (RIO_DEBUG_TABLE, "Entry is in use and cannot be deleted!\n");
p->RIOError.Error = UNIT_IS_IN_USE;
rio_spin_unlock_irqrestore( &HostP->HostLock, lock_flags);
- return EBUSY;
+ return -EBUSY;
}
}
/*
rio_dprintk (RIO_DEBUG_TABLE, "Couldn't find entry to be deleted\n");
p->RIOError.Error = COULDNT_FIND_ENTRY;
- return ENXIO;
+ return -ENXIO;
}
int RIOAssignRta( struct rio_info *p, struct Map *MapP )
{
rio_dprintk (RIO_DEBUG_TABLE, "Bad ID in map entry!\n");
p->RIOError.Error = ID_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
if (MapP->RtaUniqueNum == 0)
{
rio_dprintk (RIO_DEBUG_TABLE, "Rta Unique number zero!\n");
p->RIOError.Error = RTA_UNIQUE_NUMBER_ZERO;
- return EINVAL;
+ return -EINVAL;
}
if ( (MapP->SysPort != NO_PORT) && (MapP->SysPort % PORTS_PER_RTA) )
{
rio_dprintk (RIO_DEBUG_TABLE, "Port %d not multiple of %d!\n",(int)MapP->SysPort,PORTS_PER_RTA);
p->RIOError.Error = TTY_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
if ( (MapP->SysPort != NO_PORT) && (MapP->SysPort >= RIO_PORTS) )
{
rio_dprintk (RIO_DEBUG_TABLE, "Port %d not valid!\n",(int)MapP->SysPort);
p->RIOError.Error = TTY_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
/*
{
rio_dprintk (RIO_DEBUG_TABLE, "Name entry contains non-printing characters!\n");
p->RIOError.Error = BAD_CHARACTER_IN_NAME;
- return EINVAL;
+ return -EINVAL;
}
sptr++;
}
if ( (p->RIOHosts[host].Flags & RUN_STATE) != RC_RUNNING )
{
p->RIOError.Error = HOST_NOT_RUNNING;
- return ENXIO;
+ return -ENXIO;
}
/*
if (RIOFindFreeID(p, &p->RIOHosts[host], &nNewID, NULL) != 0)
{
p->RIOError.Error = COULDNT_FIND_ENTRY;
- return EBUSY;
+ return -EBUSY;
}
MapP->ID = (ushort)nNewID + 1;
rio_dprintk (RIO_DEBUG_TABLE, "Allocated ID %d for this new RTA.\n", MapP->ID);
if (unit == MAX_RUP)
{
p->RIOError.Error = COULDNT_FIND_ENTRY;
- return EBUSY;
+ return -EBUSY;
}
HostMapP->Flags |= RTA16_SECOND_SLOT;
HostMapP->ID2 = MapP->ID2 = p->RIOHosts[host].Mapping[unit].ID;
{
rio_dprintk (RIO_DEBUG_TABLE, "Map table slot for ID %d is already in use.\n", MapP->ID);
p->RIOError.Error = ID_ALREADY_IN_USE;
- return EBUSY;
+ return -EBUSY;
}
/*
}
p->RIOError.Error = UNKNOWN_HOST_NUMBER;
rio_dprintk (RIO_DEBUG_TABLE, "Unknown host %x\n", MapP->HostUniqueNum);
- return ENXIO;
+ return -ENXIO;
}
if ( MapP->ID > MAX_RUP ) {
rio_dprintk (RIO_DEBUG_TABLE, "Bad ID in map entry!\n");
p->RIOError.Error = ID_NUMBER_OUT_OF_RANGE;
- return EINVAL;
+ return -EINVAL;
}
MapP->Name[MAX_NAME_LEN-1] = '\0';
if ( *sptr<' ' || *sptr>'~' ) {
rio_dprintk (RIO_DEBUG_TABLE, "Name entry contains non-printing characters!\n");
p->RIOError.Error = BAD_CHARACTER_IN_NAME;
- return EINVAL;
+ return -EINVAL;
}
sptr++;
}
if ( MapP->HostUniqueNum == p->RIOHosts[host].UniqueNum ) {
if ( (p->RIOHosts[host].Flags & RUN_STATE) != RC_RUNNING ) {
p->RIOError.Error = HOST_NOT_RUNNING;
- return ENXIO;
+ return -ENXIO;
}
if ( MapP->ID==0 ) {
CCOPY( MapP->Name, p->RIOHosts[host].Name, MAX_NAME_LEN );
if ( HostMapP->RtaUniqueNum != MapP->RtaUniqueNum ) {
p->RIOError.Error = RTA_NUMBER_WRONG;
- return ENXIO;
+ return -ENXIO;
}
CCOPY( MapP->Name, HostMapP->Name, MAX_NAME_LEN );
return 0;
}
p->RIOError.Error = UNKNOWN_HOST_NUMBER;
rio_dprintk (RIO_DEBUG_TABLE, "Unknown host %x\n", MapP->HostUniqueNum);
- return ENXIO;
+ return -ENXIO;
}