rem: KPrintF( "Vendor: %s, Product: %03lx, Revision: %lx, Serial: %08lx\n", card->m_ID.m_Vendor, card->m_ID.m_ProductID, card->m_ID.m_Revision, card->m_SerialNumber );
context: AddCards( UBYTE              rd_data_port_value,           struct ISAPNPBase* res ){  UBYTE csn = 0;  while( TRUE )  {    struct ISAPNP_Card* card;    // Move all cards (without a CSN) to the isolate state and the card    // in config state to the sleep state.      SetPnPReg( PNPISA_REG_WAKE, 0, res );      // Set port to read from      SetPnPReg( PNPISA_REG_SET_RD_DATA_PORT, rd_data_port_value, res );    res->m_RegReadData = rd_data_port_value;    card = PNPISA_AllocCard( res );    if( card == NULL )    {      break;    }    if( ReadSerialIdentifier( card, res ) )    {      KPrintF( "Vendor: %s, Product: %03lx, Revision: %lx, Serial: %08lx\n",               card->m_ID.m_Vendor, card->m_ID.m_ProductID, card->m_ID.m_Revision, card->m_SerialNumber );      // Assign a CSN to the card and move it to the config state      ++csn;      SetPnPReg( PNPISA_REG_CARD_SELECT_NUMBER, csn, res );      // Read the resource data            if( ReadResourceData( card, res ) )      {        card->m_CSN = csn;              AddTail( &res->m_Cards, (struct Node*) card );      }      else      {        PNPISA_FreeCard( card, res );      }    }    else    {      PNPISA_FreeCard( card, res );      break;    }  }  return csn;}