From 48853da83fe80cad6952899d5909f9eb09d60560 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Thu, 24 Nov 2005 15:43:27 +0000 Subject: [PATCH] now also rom image files dumped have the hardware ID's and location in it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15121 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/drivers/graphics/matrox/driver.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/drivers/graphics/matrox/driver.c b/src/add-ons/kernel/drivers/graphics/matrox/driver.c index 68c792c848..d21a7a5f7c 100644 --- a/src/add-ons/kernel/drivers/graphics/matrox/driver.c +++ b/src/add-ons/kernel/drivers/graphics/matrox/driver.c @@ -131,9 +131,16 @@ static settings current_settings = { // see comments in mga.settings false, // greensync }; -static void dumprom (void *rom, size_t size) +static void dumprom (void *rom, size_t size, pci_info pcii) { - int fd = open ("/boot/home/" DRIVER_PREFIX ".rom", O_WRONLY | O_CREAT, 0666); + int fd; + char fname[64]; + + /* determine the romfile name: we need split-up per card in the system */ + sprintf (fname, "/boot/home/" DRIVER_PREFIX "." DEVICE_FORMAT ".rom", + pcii.vendor_id, pcii.device_id, pcii.bus, pcii.device, pcii.function); + + fd = open (fname, O_WRONLY | O_CREAT, 0666); if (fd < 0) return; write (fd, rom, size); close (fd); @@ -417,7 +424,7 @@ static status_t map_device(device_info *di) memcpy (si->rom_mirror, rom_temp, 32768); } - if (current_settings.dumprom) dumprom (si->rom_mirror, 32768); + if (current_settings.dumprom) dumprom (si->rom_mirror, 32768, di->pcii); /*disable ROM and delete the area*/ set_pci(PCI_rom_base,4,0);