summaryrefslogtreecommitdiff
path: root/platform-intel.c
Commit message (Collapse)AuthorAge
* Remove lots of unnecessary white space.NeilBrown2013-06-19
| | | | | | | Now that I am using white-space mode in Emacs I can see all of this, and I don't like it :-) Signed-off-by: NeilBrown <neilb@suse.de>
* platform-intel: canonicalize_file_name() is not portableJohn Spencer2013-02-10
| | | | | | | | | | | | | this is a GLIBC specific feature and should not be used. according to its manpage: "The call canonicalize_file_name(path) is equivalent to the call realpath(path, NULL)." thus, we use realpath so it works everywhere. Signed-off-by: John Spencer <maillist-mdadm@barfooze.de> Signed-off-by: NeilBrown <neilb@suse.de>
* platform-intel - cache 'intel_devices' for a few seconds.NeilBrown2013-01-07
| | | | | | | | | find_intel_devices() has take a little while to run as it scans some directory tree, and the result isn't likely to change often. So cache the value and only discard it after 10 seconds. Signed-off-by: NeilBrown <neilb@suse.de>
* Replace a lot of leading spaces with tabs.NeilBrown2012-10-10
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Remove scattered checks for malloc success.NeilBrown2012-07-09
| | | | | | | | | | | | | | malloc should never fail, and if it does it is unlikely that anything else useful can be done. Best approach is to abort and let some super-daemon restart. So define xmalloc, xcalloc, xrealloc, xstrdup which don't fail but just print a message and exit. Then use those removing all the tests for failure. Also replace all "malloc;memset" sequences with 'xcalloc'. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: reading of UEFI variables needs an updateHawrylewicz Czarnowski, Przemyslaw2011-03-28
| | | | | | | | | | Content of EFI variable is stored in "data" file. Moreover size of data provided by given variable can be initially validated by reading value of "size" file. Function read_efi_variable() has been introduced to simplify the code. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: remove OEM table from detection of OROM and EFI.Hawrylewicz Czarnowski, Przemyslaw2011-03-28
| | | | | | | | OEM table does not suit our needs so it cannot be used. This patch removes feature added in commit 8a0bf4f378c8b. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* platform_intel: support EFI SCU OEM variableLabun, Marcin2011-03-20
| | | | | | | | | RstScuV and RstScuO variable names are supported. First try reading from RstScuV, when it fails try RstScuO. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Tested-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* platfrom_intel: find OROM based on Intel AHCI and SAS driver device idLabun, Marcin2011-03-14
| | | | | | | | | | | We use PCI device id exposed by AHCI and ISCU drivers (SAS controller) to find OROM version table. In this way there is no need to maintain AHCI and ISCU device id list in mdadm. The consequence is that the OROM properties can be found by mdadm when AHCI or SAS drivers are loaded in the system. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* platform_intel: support for OROM OEM capabilitiesLabun, Marcin2011-03-10
| | | | | | | Scan memory to match $VER and $OEM. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* read platform capabilities from EFILabun, Marcin2011-03-10
| | | | | | | | | | If operating system is installed using efi, IMSM platform capabilities are not available via option ROM, but are stored as efi variables. New mechanism has been introduced to obtain capabilities by variables. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Some guid manipulation utilities has been added.Labun, Marcin2011-03-10
| | | | | | | It will be used for reading efi variables with capabilities. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Platform-intel: support for OROM SAS and AHCI controllerLabun, Marcin2011-03-10
| | | | | Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* probe_roms: allow to probe expansion ROMs using vendor and device id.Labun, Marcin2011-03-10
| | | | | | | | | Adds data offset to PCI expansion ROM Data Structure in resource describing Expansion ROMs. This allows AHCI OROM scanning function to identify AHCI OROM by device id 0x2822 and vendor id 0x8086. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm platform: support for Intel(R) SAS controller.Labun Marcin2011-01-26
| | | | | | | | | This patch adds platform support for SAS controller(s) built in Intel(R) Patsburg chipset. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Compile with -Wextra by defaultNeilBrown2010-08-05
| | | | | | This produced lots of warning, some of which pointed to actual bugs. Signed-off-by: NeilBrown <neilb@suse.de>
* Fix for buffer overflow defect.Artur Wojcik2009-12-10
| | | | | | | | Array index of 'path' may be out of bounds. Array 'path' of size 256 may use index value(s) 0..284. Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Fix for buffer overflow error.Artur Wojcik2009-12-10
| | | | | | | | Array index of 'device' may be out of bounds. Array 'device' of size 40 may use index value(s) 0..43. Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Fix for buffer overflow defect in 'link'.Artur Wojcik2009-12-10
| | | | | | | | Potential buffer overflow of 'link' caused by user input may occur, due to non null-terminated string 'link'. Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Add a missing 'closedir'.NeilBrown2009-09-11
| | | | | | Thanks to David Binderman for finding and reporting it. Signed-off-by: NeilBrown <neilb@suse.de>
* platform: relax rom scanning alignment for ahci platformsDan Williams2009-07-31
| | | | | | | | | | | | | | | | The PCI-3.0 Firmware specification allows for option-roms to have 512-byte alignment rather than 2048-byte. As there does not appear to be a reliable method to detect a PCI-3.0 compliant BIOS from userspace we allow the imsm platform detection code to presume that a system modern enough to have an Intel AHCI controller does not have dangerous/legacy ISA regions in the option-ROM memory space. An environment variable to disable this behaviour, IMSM_SAFE_OROM_SCAN, is added in case this presumption is ever proven wrong. Reported-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: provide a simulated option-rom for regression testsDan Williams2009-02-23
| | | | | | | | | | | IMSM_NO_PLATFORM turns off checks that should be tested, so provide a IMSM_TEST_OROM variable to allow testing the orom constraints in the mdadm regression suite. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: sysfs support routines for determining device connectivityDan Williams2008-12-08
| | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: detect option-rom capabilitiesDan Williams2008-12-08
The option-rom advertises its capabilities in a data structure located in the platform ROM region 0xc0000-0xf0000. Attempt to detect the option-rom and limit array creation to the platform's capabilities. Signed-off-by: Dan Williams <dan.j.williams@intel.com>