starfire_firmware.pl
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #!/usr/bin/perl
  2. # This script can be used to generate a new starfire_firmware.h
  3. # from GFP_RX.DAT and GFP_TX.DAT, files included with the DDK
  4. # and also with the Novell drivers.
  5. open FW, "GFP_RX.DAT" || die;
  6. open FWH, ">starfire_firmware.h" || die;
  7. printf(FWH "static u32 firmware_rx[] = {n");
  8. $counter = 0;
  9. while ($foo = <FW>) {
  10.   chomp;
  11.   printf(FWH "  0x%s, 0x0000%s,n", substr($foo, 4, 8), substr($foo, 0, 4));
  12.   $counter++;
  13. }
  14. close FW;
  15. open FW, "GFP_TX.DAT" || die;
  16. printf(FWH "};t/* %d Rx instructions */n#define FIRMWARE_RX_SIZE %dnnstatic u32 firmware_tx[] = {n", $counter, $counter);
  17. $counter = 0;
  18. while ($foo = <FW>) {
  19.   chomp;
  20.   printf(FWH "  0x%s, 0x0000%s,n", substr($foo, 4, 8), substr($foo, 0, 4));
  21.   $counter++;
  22. }
  23. close FW;
  24. printf(FWH "};t/* %d Tx instructions */n#define FIRMWARE_TX_SIZE %dn", $counter, $counter);
  25. close(FWH);