[PATCH] Update to the Compaq cpqarray driver...

White, Charles (Charles.White@COMPAQ.com)
Tue, 9 Oct 2001 11:17:01 -0500


This is a multi-part message in MIME format.

------_=_NextPart_001_01C150DD.D3E62FC6
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This patch is for 2.4.10-ac8.

This changes the driver to use the new 2.4 kernel PCI APIs. This changes
how all our cards are detected.=20
This adds some new IOCTLs for adding/deleting volumes while the driver
is online.=20
It have added code to request/release the io-region used by our cards.

It has a small fix to the flush on unload. =20

<<cpqarray_2.4.20D_for_2.4.10ac8.patch>>=20

------_=_NextPart_001_01C150DD.D3E62FC6
Content-Type: application/octet-stream;
name="cpqarray_2.4.20D_for_2.4.10ac8.patch"
Content-Transfer-Encoding: base64
Content-Description: cpqarray_2.4.20D_for_2.4.10ac8.patch
Content-Disposition: attachment;
filename="cpqarray_2.4.20D_for_2.4.10ac8.patch"

ZGlmZiAtdXJOIGxpbnV4LTIuNC4xMC1hYzgub3JpZy9kcml2ZXJzL2Jsb2NrL2NwcWFycmF5LmMg
bGludXgtMi40LjEwLWFjOGNwcWFycmF5MjQyMC9kcml2ZXJzL2Jsb2NrL2NwcWFycmF5LmMKLS0t
IGxpbnV4LTIuNC4xMC1hYzgub3JpZy9kcml2ZXJzL2Jsb2NrL2NwcWFycmF5LmMJVHVlIFNlcCAx
OCAxNjoxMDo0MyAyMDAxCisrKyBsaW51eC0yLjQuMTAtYWM4Y3BxYXJyYXkyNDIwL2RyaXZlcnMv
YmxvY2svY3BxYXJyYXkuYwlNb24gT2N0ICA4IDA5OjU1OjE5IDIwMDEKQEAgLTQxLDEzICs0MSwx
MyBAQAogCiAjZGVmaW5lIFNNQVJUMl9EUklWRVJfVkVSU0lPTihtYWosbWluLHN1Ym1pbikgKCht
YWo8PDE2KXwobWluPDw4KXwoc3VibWluKSkKIAotI2RlZmluZSBEUklWRVJfTkFNRSAiQ29tcGFx
IFNNQVJUMiBEcml2ZXIgKHYgMi40LjUpI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kczsKKyAgICAgICAg
ICAgICAgICAgICAgICAgIGRyaXZlcl9nZW8uc2VjdG9ycyA9IGhiYVtjdGxyXS0+ZHJ2W2Rza10u
c2VjdG9yczsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRyaXZlcl9nZW8uY3lsaW5kZXJzID0g
aGJhW2N0bHJdLT5kcnZbZHNrXS5jeWxpbmRlcnM7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsK
KyAgICAgICAgICAgICAgICAgICAgICAgIGRyaXZlcl9nZW8uaGVhZHMgPSAweGZmOworICAgICAg
ICAgICAgICAgICAgICAgICAgZHJpdmVyX2dlby5zZWN0b3JzID0gMHgzZjsKKyAgICAgICAgICAg
ICAgICAgICAgICAgIGRyaXZlcl9nZW8uY3lsaW5kZXJzID0gaGJhW2N0bHJdLT5kcnZbZHNrXS5u
cl9ibGtzIC8gKDB4ZmYqMHgzZik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAg
IGRyaXZlcl9nZW8uc3RhcnQ9CisgICAgICAgICAgICAgICAgICAgICAgICBoYmFbY3Rscl0tPmhk
W01JTk9SKGlub2RlLT5pX3JkZXYpXS5zdGFydF9zZWN0OworICAgICAgICAgICAgICAgIGlmIChj
b3B5X3RvX3VzZXIoKHZvaWQgKikgYXJnLCAmZHJpdmVyX2dlbywKKyAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgc2l6ZW9mKCBzdHJ1Y3QgaGRfZ2VvbWV0cnkpKSkKKyAgICAgICAgICAg
ICAgICAgICAgICAgIHJldHVybiAgLUVGQVVMVDsKKyAgICAgICAgICAgICAgICByZXR1cm4oMCk7
CisJfQorCWNhc2UgSERJT19HRVRHRU9fQklHOgorICAgICAgICB7CisJCXN0cnVjdCBoZF9iaWdf
Z2VvbWV0cnkgZHJpdmVyX2dlbzsKKyAgICAgICAgICAgICAgICBpZiAoaGJhW2N0bHJdLT5kcnZb
ZHNrXS5jeWxpbmRlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRyaXZlcl9nZW8uaGVh
ZHMgPSBoYmFbY3Rscl0tPmRydltkc2tdLmhlYWRzOworICAgICAgICAgICAgICAgICAgICAgICAg
ZHJpdmVyX2dlby5zZWN0b3JzID0gaGJhW2N0bHJdLT5kcnZbZHNrXS5zZWN0b3JzOworICAgICAg
ICAgICAgICAgICAgICAgICAgZHJpdmVyX2dlby5jeWxpbmRlcnMgPSBoYmFbY3Rscl0tPmRydltk
c2tdLmN5bGluZGVyczsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAg
ICAgICAgICAgZHJpdmVyX2dlby5oZWFkcyA9IDB4ZmY7CisgICAgICAgICAgICAgICAgICAgICAg
ICBkcml2ZXJfZ2VvLnNlY3RvcnMgPSAweDNmOworICAgICAgICAgICAgICAgICAgICAgICAgZHJp
dmVyX2dlby5jeWxpbmRlcnMgPSBoYmFbY3Rscl0tPmRydltkc2tdLm5yX2Jsa3MgLyAoMHhmZiow
eDNmKTsKKyAgICAgICAgICAgICAgCX0KKwkgICAgICAJZHJpdmVyX2dlby5zdGFydD0gCisJCQlo
YmFbY3Rscl0tPmhkW01JTk9SKGlub2RlLT5pX3JkZXYpXS5zdGFydF9zZWN0OworCQlpZiAoY29w
eV90b191c2VyKCh2b2lkICopIGFyZywgJmRyaXZlcl9nZW8sICAKKwkJCQlzaXplb2YoIHN0cnVj
dCBoZF9iaWdfZ2VvbWV0cnkpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAgLUVG
QVVMVDsKKyAgICAgICAgICAgICAgICByZXR1cm4oMCk7CisgICAgICAgIH0KIAljYXNlIElEQUdF
VERSVklORk86CiAJCXJldHVybiBjb3B5X3RvX3VzZXIoJmlvLT5jLmRydiwmaGJhW2N0bHJdLT5k
cnZbZHNrXSxzaXplb2YoZHJ2X2luZm9fdCkpOwogCWNhc2UgQkxLR0VUU0laRToKLQkJcmV0dXJu
IHB1dF91c2VyKGlkYVsoY3Rscjw8Q1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mhpZ2hlc3RfbHVuID0gbG9nX3VuaXQ7CiAJCQkJaW5mb19w
LT5waHlzX2RyaXZlcyA9CiAJCQkJICAgIHNlbnNlX2NvbmZpZ19idWYtPmN0bHJfcGh5c19kcnY7
CiAJCQkJaW5mb19wLT5kcnZfYXNzaWduX21hcApAQCAtMTkxMiwzICsyMjQxLDI2IEBACiAJcmV0
dXJuOwogCiB9CisKK3N0YXRpYyB2b2lkIF9fZXhpdCBjbGVhbnVwX2NwcWFycmF5X21vZHVsZSh2
b2lkKQoreworICAgICAgICBpbnQgaTsKKworICAgICAgICBwY2lfdW5yZWdpc3Rlcl9kcml2ZXIo
JmNwcWFycmF5X3BjaV9kcml2ZXIpOworICAgICAgICAvKiBkb3VibGUgY2hlY2sgdGhhdCBhbGwg
Y29udHJvbGxlciBlbnRyeXMgaGF2ZSBiZWVuIHJlbW92ZWQgKi8KKyAgICAgICAgZm9yIChpPTA7
IGk8IE1BWF9DVExSOyBpKyspCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoaGJhW2ld
ICE9IE5VTEwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcHJp
bnRrKEtFUk5fV0FSTklORyAiY3BxYXJyYXk6IGhhZCB0byByZW1vdmUiCisgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBjb250cm9sbGVyICVkXG4iLCBpKTsKKyAgICAg
ICAgICAgICAgICAgICAgICAgIGNwcWFycmF5X3JlbW92ZV9vbmVfZWlzYShpKTsKKyAgICAgICAg
ICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmVtb3ZlX3Byb2NfZW50cnkoImNwcWFycmF5
IiwgcHJvY19yb290X2RyaXZlcik7Cit9CisKKworbW9kdWxlX2luaXQoaW5pdF9jcHFhcnJheV9t
b2R1bGUpOworbW9kdWxlX2V4aXQoY2xlYW51cF9jcHFhcnJheV9tb2R1bGUpOworCmRpZmYgLXVy
TiBsaW51eC0yLj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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/