rem: KPrintF( "OpenCAMDPort(%ld,%ld)\n", msg->PortNum, msg->V40Mode );
context: OpenCAMDPort( struct Hook*        hook,	      struct EMU10kxBase* EMU10kxBase,	      struct OpenMessage* msg ){  struct DriverBase*  AHIsubBase = (struct DriverBase*) EMU10kxBase;  struct EMU10kxData* dd;  BOOL in_use;  KPrintF( "OpenCAMDPort(%ld,%ld)\n", msg->PortNum, msg->V40Mode );  if( msg->PortNum >= EMU10kxBase->cards_found ||      EMU10kxBase->driverdatas[ msg->PortNum ] == NULL )  {    Req( "No valid EMU10kxData for CAMD port %ld.", msg->PortNum );    return FALSE;  }  dd = EMU10kxBase->driverdatas[ msg->PortNum ];    ObtainSemaphore( &EMU10kxBase->semaphore );  in_use = ( dd->camd_transmitfunc != NULL ||	     dd->camd_receivefunc != NULL );  if( !in_use )  {    dd->camd_v40          = msg->V40Mode;    dd->camd_transmitfunc = msg->TransmitFunc;    dd->camd_receivefunc  = msg->ReceiveFunc;  }  ReleaseSemaphore( &EMU10kxBase->semaphore );  if( in_use )  {    return FALSE;  }  emu10k1_irq_disable( &dd->card, INTE_MIDIRXENABLE );  emu10k1_irq_disable( &dd->card, INTE_MIDITXENABLE );  emu10k1_mpu_reset( &dd->card );  emu10k1_irq_enable( &dd->card, INTE_MIDIRXENABLE );  return TRUE;}