From: Ben Gras Date: Mon, 12 Feb 2007 13:35:33 +0000 (+0000) Subject: set 'w_testing' during w_identify(). this means 0-tolerance to X-Git-Tag: v3.1.3~80 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=1ff8616378346c247b6772a15985d13e0165b0b5;p=minix.git set 'w_testing' during w_identify(). this means 0-tolerance to timeouts, and an ATA_IDENTIFY timeout will cause the ATAPI_IDENTIFY to be skipped, making the cd probe a lot faster. --- diff --git a/drivers/at_wini/at_wini.c b/drivers/at_wini/at_wini.c index 3111a928c..9e454d030 100644 --- a/drivers/at_wini/at_wini.c +++ b/drivers/at_wini/at_wini.c @@ -814,6 +814,9 @@ PRIVATE int w_identify() cmd.ldh = wn->ldhpref; cmd.command = ATA_IDENTIFY; + /* In testing mode, a drive will get ignored at the first timeout. */ + w_testing = 1; + /* Execute *_IDENTIFY with configured *_IDENTIFY timeout. */ prev_wakeup = wakeup_ticks; wakeup_ticks = w_identify_wakeup_ticks; @@ -831,6 +834,7 @@ PRIVATE int w_identify() { printf("%s: not an ATA device?\n", w_name()); wakeup_ticks = prev_wakeup; + w_testing = 0; return ERR; } #endif @@ -999,6 +1003,7 @@ PRIVATE int w_identify() */ if (wn->lcylinders == 0) { wakeup_ticks = prev_wakeup; + w_testing = 0; return(ERR); } /* no BIOS parameters */ wn->pcylinders = wn->lcylinders; @@ -1007,8 +1012,9 @@ PRIVATE int w_identify() size = (u32_t) wn->pcylinders * wn->pheads * wn->psectors; } - /* Restore wakeup_ticks. */ + /* Restore wakeup_ticks and unset testing mode. */ wakeup_ticks = prev_wakeup; + w_testing = 0; /* Size of the whole drive */ wn->part[0].dv_size = mul64u(size, SECTOR_SIZE);