Date: Tue, 30 Jan 2007 09:56:21 -0700 From: Scott Long <scottl@samsco.org> To: Andrew Gallatin <gallatin@cs.duke.edu> Cc: freebsd-current@freebsd.org Subject: Re: restoring PCI config space Message-ID: <45BF78B5.1050305@samsco.org> In-Reply-To: <17855.30388.764471.322562@grasshopper.cs.duke.edu> References: <17855.30388.764471.322562@grasshopper.cs.duke.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Andrew Gallatin wrote: > I need to write a watchdog handler for mxge(4). The catch is that if > the NIC resets due to a hardware error, it will reset its config space > (setting BAR to 0, disabling DMA, forgetting MSI addr/data, etc), so > the driver's watchdog handler needs to be able to restore it. How do > I do this properly on FreeBSD? > > Browsing around the source tree, I see that the pci function > pci_cfg_restore() seems to do exactly what I want, but it is private > to the pci code, and seems to be called from the bowels of the resume > path. Is there a clean way I can leverage pci_cfg_restore(), or > should I just save an extra copy of the device's PCI config space > myself? > > Thanks, > > Drew > I need to do the same thing, and I concluded that pci_cfg_restore needs to be exported out via a DEVMETHOD. It might also be useful to export a pci_cfg_save function. Scott
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45BF78B5.1050305>