[PATCH] 2.5.24: generic ATA PCI auto-dma tuning (4/5)

Bartlomiej Zolnierkiewicz (B.Zolnierkiewicz@elka.pw.edu.pl)
Tue, 25 Jun 2002 21:16:19 +0200 (MET DST)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-1903590565-1025032579=:27820
Content-Type: TEXT/PLAIN; charset=US-ASCII

- in ata-timing.h rework XFER_* defines

- convert alim15x3.c and hpt366.c to new scheme

- small fix for hpt34x.c

--
Bartlomiej Zolnierkiewicz

---559023410-1903590565-1025032579=:27820 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ata-hosts-10.diff" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.SOL.4.30.0206252116190.27820@mion.elka.pw.edu.pl> Content-Description: Content-Disposition: attachment; filename="ata-hosts-10.diff"

ZGlmZiAtdXIgbGludXgtYXRhLWhvc3RzLTkvZHJpdmVycy9pZGUvYWxpbTE1 eDMuYyBsaW51eC9kcml2ZXJzL2lkZS9hbGltMTV4My5jDQotLS0gbGludXgt YXRhLWhvc3RzLTkvZHJpdmVycy9pZGUvYWxpbTE1eDMuYwlNb24gSnVuIDI0 IDIyOjQwOjQwIDIwMDINCisrKyBsaW51eC9kcml2ZXJzL2lkZS9hbGltMTV4 My5jCU1vbiBKdW4gMjQgMjI6NDM6MjAgMjAwMg0KQEAgLTk5LDI0ICs5OSw2 IEBADQogCV9fcmVzdG9yZV9mbGFncyhmbGFncyk7DQogfQ0KIA0KLS8qIEZJ WE1FOiB1bmZvbGQgIC0tYmt6ICovDQotc3RhdGljIGJ5dGUgYWxpMTV4M19j YW5fdWx0cmEoc3RydWN0IGF0YV9kZXZpY2UgKmRyaXZlKQ0KLXsNCi0JaWYg KG01MjI5X3JldmlzaW9uIDw9IDB4MjApIHsNCi0JCXJldHVybiAwOw0KLQl9 IGVsc2UgaWYgKChtNTIyOV9yZXZpc2lvbiA8IDB4QzIpICYmDQotI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JiA4KSB8fCAoaWQtPmZpZWxkX3ZhbGlkICYgMikp IHsNCi1mYXN0X2F0YV9waW86DQotCQlvbiA9IDA7DQotCQl2ZXJib3NlID0g MDsNCi1ub19kbWFfc2V0Og0KLQkJaHB0M3h4X3R1bmVfY2hpcHNldChkcml2 ZSwgYXRhX2Jlc3RfcGlvX21vZGUoZHJpdmUpKTsNCi0JfQ0KLQl1ZG1hX2Vu YWJsZShkcml2ZSwgb24sIHZlcmJvc2UpOw0KLQ0KLQlyZXR1cm4gMDsNCi19 DQotDQogc3RhdGljIHZvaWQgaHB0MzY2X3VkbWFfaXJxX2xvc3Qoc3RydWN0 IGF0YV9kZXZpY2UgKmRyaXZlKQ0KIHsNCiAJc3RydWN0IHBjaV9kZXYgKmRl diA9IGRyaXZlLT5jaGFubmVsLT5wY2lfZGV2Ow0K ---559023410-1903590565-1025032579=:27820-- - 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/