Esempio n. 1
0
File: hd.c Progetto: trbhoang/Vinix
static void reset_controller(void)
{
    int i;

    outb(4, HD_CMD);
    for (i = 0; i < 1000; i++) nop();
    outb(0, HD_CMD);
    for (i = 0; i < 10000 && drive_busy(); i++); /* nothing */
    if (drive_busy())
	printk("HD-controller still busy\n\r");
    if ((i = inb(HD_STATUS)) & ERR_STAT)
	printk("HD-controller reset failed: %02x\n\r");
}
Esempio n. 2
0
static void reset_controller(void)
{
	int	i;

	outb(4,HD_CMD);
	for(i = 0; i < 1000; i++) nop();
	outb(hd_info[0].ctl & 0x0f ,HD_CMD);
	if (drive_busy())
		printk("HD-controller still busy\n\r");
	if ((i = inb(HD_ERROR)) != 1)
		printk("HD-controller reset failed: %02x\n\r",i);
}
Esempio n. 3
0
static void reset_controller(void)
{
	int	i;

	outb_p(4,HD_CMD);
	for(i = 0; i < 1000; i++) barrier();
	outb_p(hd_info[0].ctl & 0x0f,HD_CMD);
	for(i = 0; i < 1000; i++) barrier();
	if (drive_busy())
		printk("hd: controller still busy\n");
	else if ((hd_error = inb(HD_ERROR)) != 1)
		printk("hd: controller reset failed: %02x\n",hd_error);
}