Exemplo n.º 1
0
void __init init_ht6560b (void)
{
	int t;
	
	if (check_region(HT_CONFIG_PORT,1)) {
		printk(KERN_ERR "ht6560b: PORT %#x ALREADY IN USE\n", HT_CONFIG_PORT);
	} else {
		if (try_to_init_ht6560b()) {
			request_region(HT_CONFIG_PORT, 1, ide_hwifs[0].name);
			ide_hwifs[0].chipset = ide_ht6560b;
			ide_hwifs[1].chipset = ide_ht6560b;
			ide_hwifs[0].selectproc = &ht6560b_selectproc;
			ide_hwifs[1].selectproc = &ht6560b_selectproc;
			ide_hwifs[0].tuneproc = &tune_ht6560b;
			ide_hwifs[1].tuneproc = &tune_ht6560b;
			ide_hwifs[0].serialized = 1;  /* is this needed? */
			ide_hwifs[1].serialized = 1;  /* is this needed? */
			ide_hwifs[0].mate = &ide_hwifs[1];
			ide_hwifs[1].mate = &ide_hwifs[0];
			ide_hwifs[1].channel = 1;
			
			/*
			 * Setting default configurations for drives
			 */
			t = (HT_CONFIG_DEFAULT << 8);
			t |= HT_TIMING_DEFAULT;
			ide_hwifs[0].drives[0].drive_data = t;
			ide_hwifs[0].drives[1].drive_data = t;
			t |= (HT_SECONDARY_IF << 8);
			ide_hwifs[1].drives[0].drive_data = t;
			ide_hwifs[1].drives[1].drive_data = t;
		} else
			printk(KERN_ERR "ht6560b: not found\n");
	}
}
Exemplo n.º 2
0
/* Can be called directly from ide.c. */
int __init ht6560b_init(void)
{
	ide_hwif_t *hwif, *mate;
	static u8 idx[4] = { 0, 1, 0xff, 0xff };
	int t;

	if (probe_ht6560b == 0)
		return -ENODEV;

	hwif = &ide_hwifs[0];
	mate = &ide_hwifs[1];

	if (!request_region(HT_CONFIG_PORT, 1, hwif->name)) {
		printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
			__FUNCTION__);
		return -ENODEV;
	}

	if (!try_to_init_ht6560b()) {
		printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__);
		goto release_region;
	}

	hwif->chipset = ide_ht6560b;
	hwif->selectproc = &ht6560b_selectproc;
	hwif->host_flags = IDE_HFLAG_ABUSE_PREFETCH;
	hwif->pio_mask = ATA_PIO5;
	hwif->set_pio_mode = &ht6560b_set_pio_mode;
	hwif->serialized = 1;	/* is this needed? */
	hwif->mate = mate;

	mate->chipset = ide_ht6560b;
	mate->selectproc = &ht6560b_selectproc;
	mate->host_flags = IDE_HFLAG_ABUSE_PREFETCH;
	mate->pio_mask = ATA_PIO5;
	mate->set_pio_mode = &ht6560b_set_pio_mode;
	mate->serialized = 1;	/* is this needed? */
	mate->mate = hwif;
	mate->channel = 1;

	/*
	 * Setting default configurations for drives
	 */
	t = (HT_CONFIG_DEFAULT << 8);
	t |= HT_TIMING_DEFAULT;
	hwif->drives[0].drive_data = t;
	hwif->drives[1].drive_data = t;

	t |= (HT_SECONDARY_IF << 8);
	mate->drives[0].drive_data = t;
	mate->drives[1].drive_data = t;

	ide_device_add(idx);

	return 0;

release_region:
	release_region(HT_CONFIG_PORT, 1);
	return -ENODEV;
}
Exemplo n.º 3
0
/* Can be called directly from ide.c. */
int __init ht6560b_init(void)
{
	ide_hwif_t *hwif, *mate;
	int t;

	hwif = &ide_hwifs[0];
	mate = &ide_hwifs[1];

	if (!request_region(HT_CONFIG_PORT, 1, hwif->name)) {
		printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
			__FUNCTION__);
		return -ENODEV;
	}

	if (!try_to_init_ht6560b()) {
		printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__);
		goto release_region;
	}

	hwif->chipset = ide_ht6560b;
	hwif->selectproc = &ht6560b_selectproc;
	hwif->tuneproc = &tune_ht6560b;
	hwif->serialized = 1;	/* is this needed? */
	hwif->mate = mate;

	mate->chipset = ide_ht6560b;
	mate->selectproc = &ht6560b_selectproc;
	mate->tuneproc = &tune_ht6560b;
	mate->serialized = 1;	/* is this needed? */
	mate->mate = hwif;
	mate->channel = 1;

	/*
	 * Setting default configurations for drives
	 */
	t = (HT_CONFIG_DEFAULT << 8);
	t |= HT_TIMING_DEFAULT;
	hwif->drives[0].drive_data = t;
	hwif->drives[1].drive_data = t;

	t |= (HT_SECONDARY_IF << 8);
	mate->drives[0].drive_data = t;
	mate->drives[1].drive_data = t;

	probe_hwif_init(hwif);
	probe_hwif_init(mate);

	create_proc_ide_interfaces();

	return 0;

release_region:
	release_region(HT_CONFIG_PORT, 1);
	return -ENODEV;
}
Exemplo n.º 4
0
void init_ht6560b (void)
{
	if (check_region(HT_SELECT_PORT,1)) {
		printk("\nht6560b: PORT 0x3e6 ALREADY IN USE\n");
	} else {
		if (try_to_init_ht6560b()) {
			request_region(HT_SELECT_PORT, 1, ide_hwifs[0].name);
			ide_hwifs[0].chipset = ide_ht6560b;
			ide_hwifs[1].chipset = ide_ht6560b;
			ide_hwifs[0].selectproc = &ht6560b_selectproc;
			ide_hwifs[1].selectproc = &ht6560b_selectproc;
			ide_hwifs[0].tuneproc = &tune_ht6560b;
			ide_hwifs[1].tuneproc = &tune_ht6560b;
			ide_hwifs[0].serialized = 1;
			ide_hwifs[1].serialized = 1;
		} else
			printk("\nht6560b: not found\n");
	}
}
Exemplo n.º 5
0
static int __init ht6560b_init(void)
{
	if (probe_ht6560b == 0)
		return -ENODEV;

	if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) {
		printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
			__func__);
		return -ENODEV;
	}

	if (!try_to_init_ht6560b()) {
		printk(KERN_NOTICE "%s: HBA not found\n", __func__);
		goto release_region;
	}

	return ide_legacy_device_add(&ht6560b_port_info, 0);

release_region:
	release_region(HT_CONFIG_PORT, 1);
	return -ENODEV;
}