Lines Matching refs:config

257 } config = {0};  variable
324 static void log_ultrastor_abort(register struct ultrastor_config *config, in log_ultrastor_abort() argument
336 if (! (config->mscp_free & (1 << i))) in log_ultrastor_abort()
337 fmt[21 + i*2] = '0' + config->mscp[i].target_id; in log_ultrastor_abort()
343 printk(fmt, command, &config->mscp[command], config->mscp_free); in log_ultrastor_abort()
370 if (config.bios_segment) in ultrastor_14f_detect()
378 config.port_address = PORT_OVERRIDE; in ultrastor_14f_detect()
382 config.port_address = ultrastor_ports_14f[i]; in ultrastor_14f_detect()
386 printk("US14F: detect: testing port address %03X\n", config.port_address); in ultrastor_14f_detect()
389 in_byte = inb(U14F_PRODUCT_ID(config.port_address)); in ultrastor_14f_detect()
395 printk("US14F: detect: no adapter at port %03X\n", config.port_address); in ultrastor_14f_detect()
401 release_region(config.port_address, 0x0c); in ultrastor_14f_detect()
405 in_byte = inb(U14F_PRODUCT_ID(config.port_address) + 1); in ultrastor_14f_detect()
412 printk("US14F: detect: no adapter at port %03X\n", config.port_address); in ultrastor_14f_detect()
418 release_region(config.port_address, 0x0c); in ultrastor_14f_detect()
437 config.port_address); in ultrastor_14f_detect()
442 outb(ultrastor_bus_reset ? 0xc2 : 0x82, LCL_DOORBELL_MASK(config.port_address)); in ultrastor_14f_detect()
449 *(char *)&config_1 = inb(CONFIG(config.port_address + 0)); in ultrastor_14f_detect()
450 *(char *)&config_2 = inb(CONFIG(config.port_address + 1)); in ultrastor_14f_detect()
451 config.bios_segment = bios_segment_table[config_1.bios_segment]; in ultrastor_14f_detect()
452 config.doorbell_address = config.port_address; in ultrastor_14f_detect()
453 config.ogm_address = config.port_address + 0x8; in ultrastor_14f_detect()
454 config.icm_address = config.port_address + 0xC; in ultrastor_14f_detect()
455 config.interrupt = interrupt_table_14f[config_1.interrupt]; in ultrastor_14f_detect()
456 config.ha_scsi_id = config_2.ha_scsi_id; in ultrastor_14f_detect()
457 config.heads = mapping_table[config_2.mapping_mode].heads; in ultrastor_14f_detect()
458 config.sectors = mapping_table[config_2.mapping_mode].sectors; in ultrastor_14f_detect()
459 config.bios_drive_number = config_2.bios_drive_number; in ultrastor_14f_detect()
460 config.subversion = (version_byte & 0x0F); in ultrastor_14f_detect()
461 if (config.subversion == U34F) in ultrastor_14f_detect()
462 config.dma_channel = 0; in ultrastor_14f_detect()
464 config.dma_channel = dma_channel_table_14f[config_1.dma_channel]; in ultrastor_14f_detect()
466 if (!config.bios_segment) { in ultrastor_14f_detect()
474 if (config.subversion != U34F) in ultrastor_14f_detect()
475 if (!config.dma_channel || !(config_2.tfr_port & 0x2)) { in ultrastor_14f_detect()
495 config.port_address, config.bios_segment, config.interrupt, in ultrastor_14f_detect()
496 config.dma_channel, config.ha_scsi_id, config.subversion); in ultrastor_14f_detect()
498 tpnt->this_id = config.ha_scsi_id; in ultrastor_14f_detect()
499 tpnt->unchecked_isa_dma = (config.subversion != U34F); in ultrastor_14f_detect()
502 config.mscp_free = ~0; in ultrastor_14f_detect()
505 if (request_irq(config.interrupt, do_ultrastor_interrupt, 0, "Ultrastor", NULL)) { in ultrastor_14f_detect()
507 config.interrupt); in ultrastor_14f_detect()
510 if (config.dma_channel && request_dma(config.dma_channel,"Ultrastor")) { in ultrastor_14f_detect()
512 config.dma_channel); in ultrastor_14f_detect()
513 free_irq(config.interrupt, NULL); in ultrastor_14f_detect()
522 release_region(config.port_address, 0x0c); in ultrastor_14f_detect()
546 config.revision = inb(addr+3); in ultrastor_24f_detect()
547 config.slot = i; in ultrastor_24f_detect()
559 config.bios_segment = bios_segment_table[config_1 & 7]; in ultrastor_24f_detect()
563 config.interrupt = 15; in ultrastor_24f_detect()
566 config.interrupt = 14; in ultrastor_24f_detect()
569 config.interrupt = 11; in ultrastor_24f_detect()
572 config.interrupt = 10; in ultrastor_24f_detect()
578 if (request_irq(config.interrupt, do_ultrastor_interrupt, 0, "Ultrastor", NULL)) in ultrastor_24f_detect()
581 config.interrupt); in ultrastor_24f_detect()
586 config.port_address = addr; in ultrastor_24f_detect()
587 config.doorbell_address = addr + 12; in ultrastor_24f_detect()
588 config.ogm_address = addr + 0x17; in ultrastor_24f_detect()
589 config.icm_address = addr + 0x1C; in ultrastor_24f_detect()
591 config.ha_scsi_id = config_2 & 7; in ultrastor_24f_detect()
592 config.heads = mapping_table[(config_2 >> 3) & 3].heads; in ultrastor_24f_detect()
593 config.sectors = mapping_table[(config_2 >> 3) & 3].sectors; in ultrastor_24f_detect()
600 config.port_address, config.bios_segment, in ultrastor_24f_detect()
601 config.interrupt, config.ha_scsi_id); in ultrastor_24f_detect()
603 tpnt->this_id = config.ha_scsi_id; in ultrastor_24f_detect()
610 free_irq(config.interrupt, do_ultrastor_interrupt); in ultrastor_24f_detect()
614 shpnt->irq = config.interrupt; in ultrastor_24f_detect()
615 shpnt->dma_channel = config.dma_channel; in ultrastor_24f_detect()
616 shpnt->io_port = config.port_address; in ultrastor_24f_detect()
619 config.mscp_free = ~0; in ultrastor_24f_detect()
646 if (config.slot) in ultrastor_info()
648 config.slot, config.interrupt); in ultrastor_info()
649 else if (config.subversion) in ultrastor_info()
651 config.port_address, (int)config.bios_segment, in ultrastor_info()
652 config.interrupt); in ultrastor_info()
655 config.port_address, (int)config.bios_segment, in ultrastor_info()
656 config.interrupt, config.dma_channel); in ultrastor_info()
691 if ((config.mscp_free & ((1U << ULTRASTOR_MAX_CMDS) - 1)) == 0) in ultrastor_queuecommand()
693 mscp_index = find_and_clear_bit_16(&config.mscp_free); in ultrastor_queuecommand()
696 if (xchgb(0xff, &config.aborted[mscp_index]) != 0) in ultrastor_queuecommand()
702 my_mscp = &config.mscp[mscp_index]; in ultrastor_queuecommand()
749 if (config.slot) in ultrastor_queuecommand()
750 while (inb(config.ogm_address - 1) != 0 && in ultrastor_queuecommand()
751 config.aborted[mscp_index] == 0xff) barrier(); in ultrastor_queuecommand()
755 while ((inb(LCL_DOORBELL_INTR(config.doorbell_address)) & in ultrastor_queuecommand()
756 (config.slot ? 2 : 1)) in ultrastor_queuecommand()
757 && config.aborted[mscp_index] == 0xff) barrier(); in ultrastor_queuecommand()
765 if (inb(LCL_DOORBELL_INTR(config.doorbell_address)) & in ultrastor_queuecommand()
766 (config.slot ? 2 : 1)) in ultrastor_queuecommand()
772 status = xchgb(0, &config.aborted[mscp_index]); in ultrastor_queuecommand()
779 log_ultrastor_abort(&config, mscp_index); in ultrastor_queuecommand()
785 set_bit(mscp_index, &config.mscp_free); in ultrastor_queuecommand()
798 outl(virt_to_bus(my_mscp), config.ogm_address); in ultrastor_queuecommand()
801 if (config.slot) { in ultrastor_queuecommand()
803 outb(1, config.ogm_address - 1); in ultrastor_queuecommand()
804 outb(0x2, LCL_DOORBELL_INTR(config.doorbell_address)); in ultrastor_queuecommand()
806 outb(0x1, LCL_DOORBELL_INTR(config.doorbell_address)); in ultrastor_queuecommand()
844 if(config.slot) in ultrastor_abort()
851 mscp_index = ((struct mscp *)SCpnt->host_scribble) - config.mscp; in ultrastor_abort()
856 if (config.slot) in ultrastor_abort()
858 int port0 = (config.slot << 12) | 0xc80; in ultrastor_abort()
883 if (config.slot ? inb(config.icm_address - 1) == 2 : in ultrastor_abort()
884 (inb(SYS_DOORBELL_INTR(config.doorbell_address)) & 1)) in ultrastor_abort()
897 old_aborted = xchgb(DID_ABORT, &config.aborted[mscp_index]); in ultrastor_abort()
906 if (config.slot && inb(config.ogm_address - 1) == 0) in ultrastor_abort()
912 outl(virt_to_bus(&config.mscp[mscp_index]), config.ogm_address); in ultrastor_abort()
914 outb(0x80, config.ogm_address - 1); in ultrastor_abort()
915 outb(0x2, LCL_DOORBELL_INTR(config.doorbell_address)); in ultrastor_abort()
917 log_ultrastor_abort(&config, mscp_index); in ultrastor_abort()
925 log_ultrastor_abort(&config, mscp_index); in ultrastor_abort()
939 if (config.mscp[mscp_index].SCint != SCpnt) in ultrastor_abort()
941 config.mscp[mscp_index].SCint, SCpnt); in ultrastor_abort()
943 if (config.mscp[mscp_index].SCint == 0) in ultrastor_abort()
946 if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort"); in ultrastor_abort()
947 config.mscp[mscp_index].SCint = 0; in ultrastor_abort()
948 done = config.mscp[mscp_index].done; in ultrastor_abort()
949 config.mscp[mscp_index].done = 0; in ultrastor_abort()
966 if(config.slot) in ultrastor_reset()
974 outb(0xc0, LCL_DOORBELL_INTR(config.doorbell_address)); in ultrastor_reset()
975 if (config.slot) in ultrastor_reset()
977 outb(0, config.ogm_address - 1); in ultrastor_reset()
978 outb(0, config.icm_address - 1); in ultrastor_reset()
982 if (config.mscp_busy && config.mscp->done && config.mscp->SCint) in ultrastor_reset()
984 config.mscp->SCint->result = DID_RESET << 16; in ultrastor_reset()
985 config.mscp->done(config.mscp->SCint); in ultrastor_reset()
987 config.mscp->SCint = 0; in ultrastor_reset()
991 if (! (config.mscp_free & (1 << i)) && in ultrastor_reset()
992 config.mscp[i].done && config.mscp[i].SCint) in ultrastor_reset()
994 config.mscp[i].SCint->result = DID_RESET << 16; in ultrastor_reset()
995 config.mscp[i].done(config.mscp[i].SCint); in ultrastor_reset()
996 config.mscp[i].done = 0; in ultrastor_reset()
998 config.mscp[i].SCint = 0; in ultrastor_reset()
1005 memset((unsigned char *)config.aborted, 0, sizeof config.aborted); in ultrastor_reset()
1007 config.mscp_busy = 0; in ultrastor_reset()
1009 config.mscp_free = ~0; in ultrastor_reset()
1020 unsigned int s = config.heads * config.sectors; in ultrastor_biosparam()
1022 dkinfo[0] = config.heads; in ultrastor_biosparam()
1023 dkinfo[1] = config.sectors; in ultrastor_biosparam()
1043 mscp = &config.mscp[0]; in ultrastor_interrupt()
1045 mscp = (struct mscp *)bus_to_virt(inl(config.icm_address)); in ultrastor_interrupt()
1046 mscp_index = mscp - config.mscp; in ultrastor_interrupt()
1057 if (config.slot) { in ultrastor_interrupt()
1058 unsigned char icm_status = inb(config.icm_address - 1); in ultrastor_interrupt()
1066 outb(2, SYS_DOORBELL_INTR(config.doorbell_address)); in ultrastor_interrupt()
1067 outb(0, config.icm_address - 1); in ultrastor_interrupt()
1082 outb(1, SYS_DOORBELL_INTR(config.doorbell_address)); in ultrastor_interrupt()
1094 config.mscp_busy = FALSE; in ultrastor_interrupt()
1096 set_bit(mscp_index, &config.mscp_free); in ultrastor_interrupt()
1098 config.aborted[mscp_index] = 0; in ultrastor_interrupt()
1134 config.mscp_busy = FALSE; in ultrastor_interrupt()
1136 set_bit(mscp_index, &config.mscp_free); in ultrastor_interrupt()
1140 if (config.aborted[mscp_index]) in ultrastor_interrupt()
1142 mscp_index, (unsigned int) mscp, config.aborted[mscp_index]); in ultrastor_interrupt()
1144 config.aborted[mscp_index] = 0; in ultrastor_interrupt()
1151 if (config.slot ? inb(config.icm_address - 1) : in ultrastor_interrupt()
1152 (inb(SYS_DOORBELL_INTR(config.doorbell_address)) & 1)) in ultrastor_interrupt()