src/dps8/dps8_cable.c
// cable_to_iom
//
// a peripheral is trying to attach a cable
//  to a IOM port [iomUnitIdx, chanNum, dev_code]
//  from their simh dev [devType, devUnitIdx]
//
// Verify that the port is unused; attach this end of the cable
cable_to_iom
a peripheral is trying to attach a cable
to a IOM port [iomUnitIdx, chanNum, dev_code]
from their simh dev [devType, devUnitIdx]

Verify that the port is unused; attach this end of the cable
cable_to_iom a peripheral is trying to attach a cable to a IOM port [ iomUnitIdx chanNum dev_code ] from their simh dev [ devType devUnitIdx ] Verify that the port is unused ; attach this end of the cable
static t_stat cable_to_iom (uint iomUnitIdx, int chanNum, int dev_code, 
                            devType devType, chanType ctype, 
                            uint devUnitIdx, DEVICE * devp, UNIT * unitp, 
                            iomCmd * iomCmd)
  {
    if (iomUnitIdx >= iom_dev . numunits)
      {
        sim_printf ("cable_to_iom: iomUnitIdx out of range <%u>\n", iomUnitIdx);
        return SCPE_ARG;
      }
    if (chanNum < 0 || chanNum >= MAX_CHANNELS)
      {
        sim_printf ("cable_to_iom: chanNum out of range <%d>\n", chanNum);
        return SCPE_ARG;
      }
    if (dev_code < 0 || dev_code >= N_DEV_CODES)
      {
        sim_printf ("cable_to_iom: dev_code out of range <%d>\n", dev_code);
        return SCPE_ARG;
      }
    struct device * d = 
      & cables -> cablesFromIomToDev [iomUnitIdx] . devices [chanNum] [dev_code];
    if (d -> type != DEVT_NONE)
      {
        sim_printf ("cable_to_iom: IOM socket in use: IOM unit number %d, channel number %d. (%o), device code %d. (%o)\n", iomUnitIdx, chanNum, chanNum, dev_code, dev_code);
        return SCPE_ARG;
      }
    d -> type = devType;
    d -> ctype = ctype;
    d -> devUnitIdx = devUnitIdx;
    d -> dev = devp;
    d -> board  = unitp;
    d -> iomCmd  = iomCmd;
    return SCPE_OK;
  }
static t_stat cable_to_iom ( uint iomUnitIdx , int chanNum , int dev_code , devType devType , chanType ctype , uint devUnitIdx , DEVICE * devp , UNIT * unitp , iomCmd * iomCmd ) { if ( iomUnitIdx >= iom_dev . numunits ) { sim_printf ( " \n " , iomUnitIdx ) ; return SCPE_ARG ; } if ( chanNum < 0 || chanNum >= MAX_CHANNELS ) { sim_printf ( " \n " , chanNum ) ; return SCPE_ARG ; } if ( dev_code < 0 || dev_code >= N_DEV_CODES ) { sim_printf ( " \n " , dev_code ) ; return SCPE_ARG ; } struct device * d = & cables -> cablesFromIomToDev [ iomUnitIdx ] . devices [ chanNum ] [ dev_code ] ; if ( d -> type != DEVT_NONE ) { sim_printf ( " \n " , iomUnitIdx , chanNum , chanNum , dev_code , dev_code ) ; return SCPE_ARG ; } d -> type = devType ; d -> ctype = ctype ; d -> devUnitIdx = devUnitIdx ; d -> dev = devp ; d -> board = unitp ; d -> iomCmd = iomCmd ; return SCPE_OK ; }
cable_to_iom
a peripheral is trying to attach a cable
to a IOM port [iomUnitIdx, chanNum, dev_code]
from their simh dev [devType, devUnitIdx]
cable_to_iom a peripheral is trying to attach a cable to a IOM port [ iomUnitIdx chanNum dev_code ] from their simh dev [ devType devUnitIdx ]