starfire_firmware.pl 861 B

12345678910111213141516171819202122232425262728293031
  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 %d\n\nstatic 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 %d\n", $counter, $counter);
  25. close(FWH);