diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-09-22 19:49:27 -0400 |
---|---|---|
committer | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-09-22 19:49:27 -0400 |
commit | f056878332a91ed984a116bad4e7d49aefff9e6e (patch) | |
tree | 572f4757c8e7811d45e0be0c2ae529c78fb63441 /Documentation/dvb/get_dvb_firmware | |
parent | 3961f7c3cf247eee5df7fabadc7a40f2deeb98f3 (diff) | |
parent | 7fa07729e439a6184bd824746d06a49cca553f15 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/power/wm97xx_battery.c
Diffstat (limited to 'Documentation/dvb/get_dvb_firmware')
-rw-r--r-- | Documentation/dvb/get_dvb_firmware | 88 |
1 files changed, 87 insertions, 1 deletions
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index a52adfc9a57f..14b7b5a3bcb9 100644 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
@@ -25,7 +25,8 @@ use IO::Handle; | |||
25 | "tda10046lifeview", "av7110", "dec2000t", "dec2540t", | 25 | "tda10046lifeview", "av7110", "dec2000t", "dec2540t", |
26 | "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", | 26 | "dec3000s", "vp7041", "dibusb", "nxt2002", "nxt2004", |
27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", | 27 | "or51211", "or51132_qam", "or51132_vsb", "bluebird", |
28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2" ); | 28 | "opera1", "cx231xx", "cx18", "cx23885", "pvrusb2", "mpc718", |
29 | "af9015"); | ||
29 | 30 | ||
30 | # Check args | 31 | # Check args |
31 | syntax() if (scalar(@ARGV) != 1); | 32 | syntax() if (scalar(@ARGV) != 1); |
@@ -381,6 +382,57 @@ sub cx18 { | |||
381 | $allfiles; | 382 | $allfiles; |
382 | } | 383 | } |
383 | 384 | ||
385 | sub mpc718 { | ||
386 | my $archive = 'Yuan MPC718 TV Tuner Card 2.13.10.1016.zip'; | ||
387 | my $url = "ftp://ftp.work.acer-euro.com/desktop/aspire_idea510/vista/Drivers/$archive"; | ||
388 | my $fwfile = "dvb-cx18-mpc718-mt352.fw"; | ||
389 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); | ||
390 | |||
391 | checkstandard(); | ||
392 | wgetfile($archive, $url); | ||
393 | unzip($archive, $tmpdir); | ||
394 | |||
395 | my $sourcefile = "$tmpdir/Yuan MPC718 TV Tuner Card 2.13.10.1016/mpc718_32bit/yuanrap.sys"; | ||
396 | my $found = 0; | ||
397 | |||
398 | open IN, '<', $sourcefile or die "Couldn't open $sourcefile to extract $fwfile data\n"; | ||
399 | binmode IN; | ||
400 | open OUT, '>', $fwfile; | ||
401 | binmode OUT; | ||
402 | { | ||
403 | # Block scope because we change the line terminator variable $/ | ||
404 | my $prevlen = 0; | ||
405 | my $currlen; | ||
406 | |||
407 | # Buried in the data segment are 3 runs of almost identical | ||
408 | # register-value pairs that end in 0x5d 0x01 which is a "TUNER GO" | ||
409 | # command for the MT352. | ||
410 | # Pull out the middle run (because it's easy) of register-value | ||
411 | # pairs to make the "firmware" file. | ||
412 | |||
413 | local $/ = "\x5d\x01"; # MT352 "TUNER GO" | ||
414 | |||
415 | while (<IN>) { | ||
416 | $currlen = length($_); | ||
417 | if ($prevlen == $currlen && $currlen <= 64) { | ||
418 | chop; chop; # Get rid of "TUNER GO" | ||
419 | s/^\0\0//; # get rid of leading 00 00 if it's there | ||
420 | printf OUT "$_"; | ||
421 | $found = 1; | ||
422 | last; | ||
423 | } | ||
424 | $prevlen = $currlen; | ||
425 | } | ||
426 | } | ||
427 | close OUT; | ||
428 | close IN; | ||
429 | if (!$found) { | ||
430 | unlink $fwfile; | ||
431 | die "Couldn't find valid register-value sequence in $sourcefile for $fwfile\n"; | ||
432 | } | ||
433 | $fwfile; | ||
434 | } | ||
435 | |||
384 | sub cx23885 { | 436 | sub cx23885 { |
385 | my $url = "http://linuxtv.org/downloads/firmware/"; | 437 | my $url = "http://linuxtv.org/downloads/firmware/"; |
386 | 438 | ||
@@ -463,6 +515,40 @@ sub bluebird { | |||
463 | $outfile; | 515 | $outfile; |
464 | } | 516 | } |
465 | 517 | ||
518 | sub af9015 { | ||
519 | my $sourcefile = "download.ashx?file=57"; | ||
520 | my $url = "http://www.ite.com.tw/EN/Services/$sourcefile"; | ||
521 | my $hash = "ff5b096ed47c080870eacdab2de33ad6"; | ||
522 | my $outfile = "dvb-usb-af9015.fw"; | ||
523 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); | ||
524 | my $fwoffset = 0x22708; | ||
525 | my $fwlength = 18225; | ||
526 | my ($chunklength, $buf, $rcount); | ||
527 | |||
528 | checkstandard(); | ||
529 | |||
530 | wgetfile($sourcefile, $url); | ||
531 | unzip($sourcefile, $tmpdir); | ||
532 | verify("$tmpdir/Driver/Files/AF15BDA.sys", $hash); | ||
533 | |||
534 | open INFILE, '<', "$tmpdir/Driver/Files/AF15BDA.sys"; | ||
535 | open OUTFILE, '>', $outfile; | ||
536 | |||
537 | sysseek(INFILE, $fwoffset, SEEK_SET); | ||
538 | while($fwlength > 0) { | ||
539 | $chunklength = 55; | ||
540 | $chunklength = $fwlength if ($chunklength > $fwlength); | ||
541 | $rcount = sysread(INFILE, $buf, $chunklength); | ||
542 | die "Ran out of data\n" if ($rcount != $chunklength); | ||
543 | syswrite(OUTFILE, $buf); | ||
544 | sysread(INFILE, $buf, 8); | ||
545 | $fwlength -= $rcount + 8; | ||
546 | } | ||
547 | |||
548 | close OUTFILE; | ||
549 | close INFILE; | ||
550 | } | ||
551 | |||
466 | # --------------------------------------------------------------- | 552 | # --------------------------------------------------------------- |
467 | # Utilities | 553 | # Utilities |
468 | 554 | ||