Date: Thu, 17 Nov 2011 17:16:21 +0000 From: Nima Misaghian <nmisaghian@sandvine.com> To: Craig Rodrigues <rodrigc@crodrigues.org> Cc: "freebsd-current@freebsd.org" <freebsd-current@freebsd.org> Subject: RE: Adding disk firmware programming capability to camcontrol Message-ID: <0A3573FC36A1BE41AAA3DFF287C7968405688A@wtl-exch-2.sandvine.com> In-Reply-To: <CAG=rPVfzjZ=aJHVbcrR9r3u4iW3E4ra=0u%2B8-Q7zHAT3GUQTiA@mail.gmail.com> References: <20111028204706.GA57454@sandvine.com> <CAG=rPVfzjZ=aJHVbcrR9r3u4iW3E4ra=0u%2B8-Q7zHAT3GUQTiA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--_002_0A3573FC36A1BE41AAA3DFF287C7968405688Awtlexch2sandvinec_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have updated the patch according to feedbacks I received. The main modifi= cation was to warn the user and ask for confirmation before downloading a f= irmware image. A -y option has been added that suppresses the confirmation-= - the same as the one for the format command. The new patch is against HEAD and could be downloaded from: http://people.freebsd.org/~emaste/patches/fwdownload.diff Reviews/suggestions are greatly appreciated. Nima Misaghian=20 nmisaghian@sandvine.com > -----Original Message----- > From: crodr001@gmail.com [mailto:crodr001@gmail.com] On Behalf Of Craig > Rodrigues > Sent: Thursday, November 03, 2011 10:06 PM > To: Nima Misaghian > Cc: freebsd-current@freebsd.org > Subject: Re: Adding disk firmware programming capability to camcontrol >=20 > On Fri, Oct 28, 2011 at 1:47 PM, Nima Misaghian > <nmisaghian@sandvine.com> wrote: > > Hi, > > > > I have got code developed by Andre Albsmeier that is capable of > > programming firmware of hard drives from several vendors and =A0turned > > it into a camcontrol command. >=20 > +1 >=20 > I took a look at your patch and it looks great. I have worked on a > storage product before where there > was a requirement to reprogram the firmware of hard drives. On tha > product, > proprietary Windows tools had to be used. It would have been nice to > be able to use camcontrol in FreeBSD. >=20 > I think the patch is fine in its current form. Very few "regular > users" need to reprogram hard drive firmware. > It is a special administrative operation. >=20 > -- > Craig Rodrigues > rodrigc@crodrigues.org --_002_0A3573FC36A1BE41AAA3DFF287C7968405688Awtlexch2sandvinec_ Content-Type: application/octet-stream; name="fwdownload.diff" Content-Description: fwdownload.diff Content-Disposition: attachment; filename="fwdownload.diff"; size=18521; creation-date="Thu, 17 Nov 2011 17:11:41 GMT"; modification-date="Thu, 17 Nov 2011 17:11:41 GMT" Content-Transfer-Encoding: base64 LS0tIG9sZC9jYW1jb250cm9sLmgJMjAxMS0xMS0xNyAxMTo1MTozMC4wMDAwMDAwMDAgLTA1MDAK KysrIG5ldy9jYW1jb250cm9sLmgJMjAxMS0xMS0xNyAxMTo1MTozMC4wMDAwMDAwMDAgLTA1MDAK QEAgLTQwLDYgKzQwLDggQEAKIAlpbnQgZ290OwogfTsKIAoraW50IGZ3ZG93bmxvYWQoc3RydWN0 IGNhbV9kZXZpY2UgKmRldmljZSwgaW50IGFyZ2MsIGNoYXIgKiphcmd2LAorCSAgICAgICBjaGFy ICpjb21iaW5lZG9wdCwgaW50IHZlcmJvc2UsIGludCByZXRyeV9jb3VudCwgaW50IHRpbWVvdXQp Owogdm9pZCBtb2RlX3NlbnNlKHN0cnVjdCBjYW1fZGV2aWNlICpkZXZpY2UsIGludCBtb2RlX3Bh Z2UsIGludCBwYWdlX2NvbnRyb2wsCiAJCWludCBkYmQsIGludCByZXRyeV9jb3VudCwgaW50IHRp bWVvdXQsIHVfaW50OF90ICpkYXRhLAogCQlpbnQgZGF0YWxlbik7CkBAIC00OSw4ICs1MSwxMSBA QAogCSAgICAgICBpbnQgZWRpdCwgaW50IGJpbmFyeSwgaW50IHJldHJ5X2NvdW50LCBpbnQgdGlt ZW91dCk7CiB2b2lkIG1vZGVfbGlzdChzdHJ1Y3QgY2FtX2RldmljZSAqZGV2aWNlLCBpbnQgcGFn ZV9jb250cm9sLCBpbnQgZGJkLAogCSAgICAgICBpbnQgcmV0cnlfY291bnQsIGludCB0aW1lb3V0 KTsKK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6ZTsK KwkJaW1nX3NpemUgLT0gcGt0X3NpemU7CisJfSB3aGlsZSghbGFzdF9wa3QpOworCWlmICgoY2Ni LT5jY2JfaC5zdGF0dXMgJiBDQU1fU1RBVFVTX01BU0spICE9IENBTV9SRVFfQ01QKSB7CisJCWlm ICh2ZXJib3NlKQorCQkJY2FtX2Vycm9yX3ByaW50KGNhbV9kZXYsIGNjYiwgQ0FNX0VTRl9BTEws CisJCQkgICAgQ0FNX0VQRl9BTEwsIHN0ZGVycik7CisJCWdvdG8gYmFpbG91dDsKKwl9CisJY2Ft X2ZyZWVjY2IoY2NiKTsKKwlyZXR1cm4gKDApOworYmFpbG91dDoKKwljYW1fZnJlZWNjYihjY2Ip OworCXJldHVybiAoMSk7Cit9CisKK2ludAorZndkb3dubG9hZChzdHJ1Y3QgY2FtX2RldmljZSAq ZGV2aWNlLCBpbnQgYXJnYywgY2hhciAqKmFyZ3YsCisgICAgY2hhciAqY29tYmluZWRvcHQsIGlu dCB2ZXJib3NlLCBpbnQgcmV0cnlfY291bnQsIGludCB0aW1lb3V0KQoreworCXN0cnVjdCBmd192 ZW5kb3IgKnZwOworCWNoYXIgKmZ3X2ltZ19wYXRoID0gTlVMTDsKKwljaGFyICpidWY7CisJaW50 IGltZ19zaXplOworCWludCBjOworCWludCBzaW1fbW9kZSA9IDA7CisJaW50IGNvbmZpcm1lZCA9 IDA7CisKKwl3aGlsZSAoKGMgPSBnZXRvcHQoYXJnYywgYXJndiwgY29tYmluZWRvcHQpKSAhPSAt MSkgeworCQlzd2l0Y2ggKGMpIHsKKwkJY2FzZSAncyc6CisJCQlzaW1fbW9kZSA9IDE7CisJCQlj b25maXJtZWQgPSAxOworCQkJYnJlYWs7CisJCWNhc2UgJ2YnOgorCQkJZndfaW1nX3BhdGggPSBv cHRhcmc7CisJCQlicmVhazsKKwkJY2FzZSAneSc6CisJCQljb25maXJtZWQgPSAxOworCQkJYnJl YWs7CisJCWRlZmF1bHQ6CisJCQlicmVhazsKKwkJfQor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_002_0A3573FC36A1BE41AAA3DFF287C7968405688Awtlexch2sandvinec_--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0A3573FC36A1BE41AAA3DFF287C7968405688A>