Listing 1. Selecting Data Paths

/* APP_GetDataPath */
 Byte APP_GetDataPath (OBJ_PhysModType ioSlot, /* In: Slot ID 0-1 */
    OBJ_PhysModType portNumber) /* In: port 
                                   Number 0-7 */
{
  Byte rc = 0;
  switch(localIoCardTypeConfigured[ioSlot].cardType) {
     case CARD_OC3STM1IoType :
     case CARD_DS3IoType:  /* a card with
                              eight ports */
       rc = (ioSlot<<1) + (portNumber>>2) ;
       break;
     case CARD_OC12STM4IoType : /* a card with 
                                   four ports */
       rc = (ioSlot<<1) + portNumber  ;
       break;
     default:
       return(0);
       break;
  };
  return(rc);
} /* APP_GetDataPath */