Re: [PATCH] IDE TCQ #4

Martin Schewe (m@xsms.de)
Tue, 30 Apr 2002 21:58:44 +0200


--DBIVS5p969aUjpLe
Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm"
Content-Disposition: inline

--uAKRQypu60I7Lcqm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> [...]
>=20
> #!/usr/bin/perl
>=20
> # bit 1 (TCQ) and 14 (word is valid) must be set to indicate tcq support
> $mask =3D (1 << 1) | (1 << 14);
>=20
> # bit 15 must be cleared too
> $bits =3D $mask | (1 << 15);
>=20
> # mail me the results!
> $addr =3D "linux-tcq\@kernel.dk";
>=20
> foreach $i (</proc/ide/ide*>) {
> foreach $d (<$i/hd*>) {
> @words =3D split(/\s/,`cat $d/identify`);
> $w83 =3D hex($words[83]);
> if (!(($w83 & $bits) ^ $mask)) {
> $model =3D `cat $d/model`;
> push(@goodies, $model);
> chomp($model);
> print "$d ($model) supports TCQ\n";
> }
> }
> }
>=20
> 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

--uAKRQypu60I7Lcqm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=tcq_support

#!/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);
}

--uAKRQypu60I7Lcqm--

--DBIVS5p969aUjpLe
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Weitere Infos: siehe http://www.gnupg.org

iD8DBQE8zvdzvFdT+uCkj6sRAsVzAJ4pf9iCW5P3mQduCeOxXP92z1ca7ACgqCAj
3WhceQ0Vqgrao/HdlR0klTc=
=XiIg
-----END PGP SIGNATURE-----

--DBIVS5p969aUjpLe--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/