Re: [PATCH] IDE TCQ #4

Martin Schewe
2002-04-30T19:58:50Z

[-- Attachment #1.1: Type: text/plain, Size: 1142 bytes --]

Hi,

On Tue, Apr 16, 2002 at 12:25:10PM +0200, Jens Axboe wrote:

> Mark Hahn wrote this little script to detect support for TCQ, modified
> by me to not use the hdX symlinks.
>
> [...]
>
> #!/usr/bin/perl
>
> # bit 1 (TCQ) and 14 (word is valid) must be set to indicate tcq support
> $mask = (1 << 1) | (1 << 14);
>
> # bit 15 must be cleared too
> $bits = $mask | (1 << 15);
>
> # mail me the results!
> $addr = "linux-tcq\@kernel.dk";
>
> foreach $i (</proc/ide/ide*>) {
> foreach $d (<$i/hd*>) {
> @words = split(/\s/,`cat $d/identify`);
> $w83 = hex($words[83]);
> if (!(($w83 & $bits) ^ $mask)) {
> $model = `cat $d/model`;
> push(@goodies, $model);
> chomp($model);
> print "$d ($model) supports TCQ\n";
> }
> }
> }
>
> if ($addr && $#goodies) {

$#goodies refers to the last index of the array and scalar @goodies to
the actual number of elements. So you probably got only mails from
people having more than two drives supporting TCQ... :)

> open(M, "| mail -s TCQ-report $addr");
> print M @goodies;
> close(M);
> }

Fixed version attached.

Martin

[-- Attachment #1.2: tcq_support --]
[-- Type: text/plain, Size: 613 bytes --]

#!/usr/bin/perl

# bit 1 (TCQ) and 14 (word is valid) must be set to indicate tcq support
$mask = (1 << 1) | (1 << 14);

# bit 15 must be cleared too
$bits = $mask | (1 << 15);

# mail me the results!
$addr = "linux-tcq\@kernel.dk";

foreach $i (</proc/ide/ide*>) {
foreach $d (<$i/hd*>) {
@words = split(/\s/,`cat $d/identify`);
$w83 = hex($words[83]);
if (!(($w83 & $bits) ^ $mask)) {
$model = `cat $d/model`;
push(@goodies, $model);
chomp($model);
print "$d ($model) supports TCQ\n";
}
}
}

if ($addr && @goodies) {
open(M, "| mail -s TCQ-report $addr");
print M @goodies;
close(M);
}

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]