kernels/linux-2.4.0/drivers/scsi/cpqfcTSinit.c
/* "Release" the Host Bus Adapter...
   disable interrupts, stop the HBA, release the interrupt,
   and free all resources */
"Release" the Host Bus Adapter
disable interrupts, stop the HBA, release the interrupt,
and free all resources
" Release " the Host Bus Adapter disable interrupts stop the HBA release the interrupt and free all resources
int cpqfcTS_release(struct Scsi_Host *HostAdapter)
{
  CPQFCHBA *cpqfcHBAdata = (CPQFCHBA *)HostAdapter->hostdata; 
  ENTER("cpqfcTS_release");
  DEBUG_PCI( printk(" cpqfcTS: delete timer...\n"));
  del_timer( &cpqfcHBAdata->cpqfcTStimer);  
  DEBUG_PCI( printk(" disable hardware, destroy queues, free mem\n"));
  cpqfcHBAdata->fcChip.ResetTachyon( cpqfcHBAdata, CLEAR_FCPORTS);
  if( cpqfcHBAdata->worker_thread ) 
  {
    DECLARE_MUTEX_LOCKED(sem);  
    cpqfcHBAdata->notify_wt = &sem;
    DEBUG_PCI( printk(" killing kernel thread\n"));
    send_sig( SIGKILL, cpqfcHBAdata->worker_thread, 1);
    down( &sem);
    cpqfcHBAdata->notify_wt = NULL;
  }
  DEBUG_PCI( printk(" cpqfcTS: freeing resources...\n"));
  free_irq( HostAdapter->irq, HostAdapter);
  scsi_unregister( HostAdapter);
  release_region( cpqfcHBAdata->fcChip.Registers.IOBaseL, 0xff);
  release_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff);
  LEAVE("cpqfcTS_release");
  return 0;
}
int cpqfcTS_release ( struct Scsi_Host * HostAdapter ) { CPQFCHBA * cpqfcHBAdata = ( CPQFCHBA * ) HostAdapter -> hostdata ; ENTER ( " " ) ; DEBUG_PCI ( printk ( " \n " ) ) ; del_timer ( & cpqfcHBAdata -> cpqfcTStimer ) ; DEBUG_PCI ( printk ( " \n " ) ) ; cpqfcHBAdata -> fcChip . ResetTachyon ( cpqfcHBAdata , CLEAR_FCPORTS ) ; if ( cpqfcHBAdata -> worker_thread ) { DECLARE_MUTEX_LOCKED ( sem ) ; cpqfcHBAdata -> notify_wt = & sem ; DEBUG_PCI ( printk ( " \n " ) ) ; send_sig ( SIGKILL , cpqfcHBAdata -> worker_thread , 1 ) ; down ( & sem ) ; cpqfcHBAdata -> notify_wt = NULL ; } DEBUG_PCI ( printk ( " \n " ) ) ; free_irq ( HostAdapter -> irq , HostAdapter ) ; scsi_unregister ( HostAdapter ) ; release_region ( cpqfcHBAdata -> fcChip . Registers . IOBaseL , 0xff ) ; release_region ( cpqfcHBAdata -> fcChip . Registers . IOBaseU , 0xff ) ; LEAVE ( " " ) ; return 0 ; }
"Release" the Host Bus Adapter...
disable interrupts, stop the HBA, release the interrupt,
and free all resources
" Release " the Host Bus Adapter ... disable interrupts stop the HBA release the interrupt and free all resources
// disable the hardware... // kill kernel thread // (only if exists) // synchronize thread kill // free Linux resources /* we get "vfree: bad address" executing this - need to investigate... 
  if( (void*)((unsigned long)cpqfcHBAdata->fcChip.Registers.MemBase) !=
      cpqfcHBAdata->fcChip.Registers.ReMapMemBase)
    vfree( cpqfcHBAdata->fcChip.Registers.ReMapMemBase);
*/