Example #1
0
void
scsi_unregister(struct Scsi_Host * sh){
    struct Scsi_Host * shpnt;
    
    if(scsi_hostlist == sh)
	scsi_hostlist = sh->next;
    else {
	shpnt = scsi_hostlist;
	while(shpnt->next != sh) shpnt = shpnt->next;
	shpnt->next = shpnt->next->next;
    }
    
    /* If we are removing the last host registered, it is safe to reuse
     * its host number (this avoids "holes" at boot time) (DB) 
     * It is also safe to reuse those of numbers directly below which have
     * been released earlier (to avoid some holes in numbering).
     */
    if(sh->host_no == max_scsi_hosts - 1) {
	while(--max_scsi_hosts >= next_scsi_host) {
	    shpnt = scsi_hostlist;
	    while(shpnt && shpnt->host_no != max_scsi_hosts - 1)
		shpnt = shpnt->next;
	    if(shpnt)
		break;
	}
    }
    next_scsi_host--;
    scsi_init_free((char *) sh, sizeof(struct Scsi_Host) + sh->extra_bytes);
}
Example #2
0
void cleanup_module( void)
{
    scsi_unregister_module(MODULE_SCSI_DEV, &sg_template);
    unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");

    if(scsi_generics != NULL) {
        scsi_init_free((char *) scsi_generics,
                       (sg_template.dev_noticed + SG_EXTRA_DEVS)
                       * sizeof(struct scsi_generic));
    }
    sg_template.dev_max = 0;
#ifdef SG_BIG_BUFF
    if(big_buff != NULL)
        scsi_init_free(big_buff, SG_BIG_BUFF);
#endif
}
Example #3
0
int atari_scsi_release (struct Scsi_Host *sh)
{
	if (IS_A_TT())
		remove_isr (IRQ_TT_MFP_SCSI, scsi_tt_intr, NULL);
	if (atari_dma_buffer)
		scsi_init_free (atari_dma_buffer, STRAM_BUFFER_SIZE);
	return 1;
}