diff options
Diffstat (limited to 'Documentation/dvb/get_dvb_firmware')
| -rw-r--r-- | Documentation/dvb/get_dvb_firmware | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index a52adfc9a57f..3d1b0ab70c8e 100644 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
| @@ -25,7 +25,7 @@ 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 | 29 | ||
| 30 | # Check args | 30 | # Check args |
| 31 | syntax() if (scalar(@ARGV) != 1); | 31 | syntax() if (scalar(@ARGV) != 1); |
| @@ -381,6 +381,57 @@ sub cx18 { | |||
| 381 | $allfiles; | 381 | $allfiles; |
| 382 | } | 382 | } |
| 383 | 383 | ||
| 384 | sub mpc718 { | ||
| 385 | my $archive = 'Yuan MPC718 TV Tuner Card 2.13.10.1016.zip'; | ||
| 386 | my $url = "ftp://ftp.work.acer-euro.com/desktop/aspire_idea510/vista/Drivers/$archive"; | ||
| 387 | my $fwfile = "dvb-cx18-mpc718-mt352.fw"; | ||
| 388 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); | ||
| 389 | |||
| 390 | checkstandard(); | ||
| 391 | wgetfile($archive, $url); | ||
| 392 | unzip($archive, $tmpdir); | ||
| 393 | |||
| 394 | my $sourcefile = "$tmpdir/Yuan MPC718 TV Tuner Card 2.13.10.1016/mpc718_32bit/yuanrap.sys"; | ||
| 395 | my $found = 0; | ||
| 396 | |||
| 397 | open IN, '<', $sourcefile or die "Couldn't open $sourcefile to extract $fwfile data\n"; | ||
| 398 | binmode IN; | ||
| 399 | open OUT, '>', $fwfile; | ||
| 400 | binmode OUT; | ||
| 401 | { | ||
| 402 | # Block scope because we change the line terminator variable $/ | ||
| 403 | my $prevlen = 0; | ||
| 404 | my $currlen; | ||
| 405 | |||
| 406 | # Buried in the data segment are 3 runs of almost identical | ||
| 407 | # register-value pairs that end in 0x5d 0x01 which is a "TUNER GO" | ||
| 408 | # command for the MT352. | ||
| 409 | # Pull out the middle run (because it's easy) of register-value | ||
| 410 | # pairs to make the "firmware" file. | ||
| 411 | |||
| 412 | local $/ = "\x5d\x01"; # MT352 "TUNER GO" | ||
| 413 | |||
| 414 | while (<IN>) { | ||
| 415 | $currlen = length($_); | ||
| 416 | if ($prevlen == $currlen && $currlen <= 64) { | ||
| 417 | chop; chop; # Get rid of "TUNER GO" | ||
| 418 | s/^\0\0//; # get rid of leading 00 00 if it's there | ||
| 419 | printf OUT "$_"; | ||
| 420 | $found = 1; | ||
| 421 | last; | ||
| 422 | } | ||
| 423 | $prevlen = $currlen; | ||
| 424 | } | ||
| 425 | } | ||
| 426 | close OUT; | ||
| 427 | close IN; | ||
| 428 | if (!$found) { | ||
| 429 | unlink $fwfile; | ||
| 430 | die "Couldn't find valid register-value sequence in $sourcefile for $fwfile\n"; | ||
| 431 | } | ||
| 432 | $fwfile; | ||
| 433 | } | ||
| 434 | |||
| 384 | sub cx23885 { | 435 | sub cx23885 { |
| 385 | my $url = "http://linuxtv.org/downloads/firmware/"; | 436 | my $url = "http://linuxtv.org/downloads/firmware/"; |
| 386 | 437 | ||
