summaryrefslogtreecommitdiff
path: root/com32/lib/pci/scan.c
Commit message (Collapse)AuthorAgeFilesLines
* com32: Handle broken modules.aliasErwan Velu2015-12-061-0/+8
| | | | | | | | When parsing the modules.alias, we shall report it as broken if we cannot find any valid line in it. This patch simply count the number of valid lines and report a missing modules.alias if no valid lines are found.
* com32/lib/pci/scan.c: Fix free_pci_domain()Henri Roosen2012-03-121-3/+3
| | | | | free_pci_domain is releasing the memory too early; should be out of the for loops, because in the loop the memory is still dereferenced.
* Use <dprintf.h> instead of an ad hoc definitionH. Peter Anvin2011-06-271-6/+1
| | | | | | | Instead of using ad hoc definitions of dprintf, dprintf2, vdprintf and vdprintf2, use <dprintf.h> everywhere possible. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* lib: make chrreplace reachable for com32 modulesErwan Velu2011-03-181-10/+1
| | | | | chr_replace was only used in pci/scan.c but this could be useful for other modules like hdt ;)
* com32: single instance of skipspace()Erwan Velu2011-02-071-9/+1
| | | | no need to keep several versions of it.
* Replacing strncpy by strlcpyErwan Velu2010-06-221-4/+4
| | | | | As reported by hpa, strlcpy is safer and could prevent some bugs. So I replaced all strncpy by strlcpy calls.
* pci: replace '-' by '_' in modules namesErwan Velu2009-12-041-1/+14
| | | | | | | | | Impact: avoid kernel modules duplication In modules.pcimap, kernel modules name are featuring '_' or '-' whereas modules.alias is only using '_'. To avoid kernel modules duplication, let's rename all '-' by '_' to match what modules.alias provides This avoid stupid duplications like "a-b" & "a_b" whereas they are in fact the same kernel module
* pci: using zfopen instead of fopenErwan Velu2009-11-101-5/+6
| | | | | | | Impact: allow to open gzipped files This commit allow people using gzipped files (pci.ids/modules.pcimap/modules.alias)
* pci: Removing useless initialisationErwan Velu2009-11-091-3/+0
| | | | | | Impact: None The kernel module count is set to zero when the dev_info is allocated.
* pci: Prevent kernel modules to be listed twiceErwan Velu2009-11-091-4/+32
| | | | | | | | | | | Impact: Prevent duplicated modules If both get_module_name_from_pcimap() & get_module_name_from_alias() are called, we didn't checked if the module we are detecting already got detected. This leads to a situation where modules got listed twice. This patch add a test to insure that we aren't adding an already detected module.
* Merge commit 'hpa/master' into for-erwanPierre-Alexandre Meyer2009-08-041-356/+369
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: com32/cmenu/libmenu/com32io.h com32/gplinclude/dmi/dmi.h com32/gplinclude/dmi/dmi_base_board.h com32/gplinclude/dmi/dmi_memory.h com32/gplinclude/dmi/dmi_system.h com32/gpllib/dmi/dmi.c com32/gpllib/dmi/dmi_memory.c com32/include/sys/pci.h com32/lib/pci/scan.c com32/modules/Makefile Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
| * Run Nindent on com32/lib/pci/scan.cH. Peter Anvin2009-05-291-448/+473
| | | | | | | | | | | | | | | | | | Automatically reformat com32/lib/pci/scan.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | pci: prevent modules.alias to destroy modules.pcimap contentErwan Velu2009-04-271-2/+4
| | | | | | | | | | | | | | Impact: multiple get_module_name_from_* corrupt result Prior to that commit, calling both get_module_name_from_pcimap and get_module_name_from_alias were reporting unknown modules.
* | pci: Adding get_module_name_from_alias()Erwan Velu2009-04-271-0/+125
|/ | | | | | | Impact: Users can now use modules.alias to find kernel modules get_module_name_from_alias() parses modules.alias to find the appropriate kernel modules required by the local pci devices.
* pci: Using for_each_pci_func3Erwan Velu2009-04-151-3/+2
| | | | | | Impact: cleaning code Using for_each_pci_func3 instead of for_each_pci_func + pci_mkaddr
* PCI: Fixing freeze when detecting many PCI devicesErwan Velu2009-04-141-22/+11
| | | | | | | | | Impact: Prevent hard freeze when having many PCI devices A user reported that calling gather_additional_pci_config() when many PCI devices exists on a host could lead to a complete freeze. This patch remove some useless code and use for_each_pci_func() instead. This prevent useless memory allocation.
* pci: Rename get_module_name_from_pci_idssyslinux-3.74-pre13syslinux-3.74-pre12Erwan Velu2009-03-291-1/+1
| | | | | | | | | Impact: none Rename get_module_name_from_pci_ids to get_module_name_from_pcimap since the module names are read from the modules.pcimap and not pci.ids file. Signed-off-by: Sebastian Herbszt (herbszt@gmx.de)
* pci: Check if configuration type is PCI_CFG_NONEErwan Velu2009-03-231-0/+7
| | | | | | Impact: prevent from grabbing configuration when PCI is PCI_CFG_NONE Signed-off-by: Sebastian Herbszt (herbszt@gmx.de)
* pci: Remove "(void)cfgtype"Erwan Velu2009-03-231-2/+0
| | | | | | | Impact: none Remove useless "(void)cfgtype" Signed-off-by: Sebastian Herbszt (herbszt@gmx.de)
* hdt: Adding PCI latencyErwan Velu2009-03-141-0/+1
| | | | Adding the pci latency information
* hdt: irq have to be in dev_infoErwan Velu2009-03-141-1/+7
| | | | Moving irq stuff to the dev_info structure to keep coherent
* hdt: Adding legacy IRQ stuffErwan Velu2009-03-131-1/+28
| | | | | | | | In the cli mode, the pci context feature the following : pci> show irq Under cli, "pci> show device <x>" display the IRQ when device features one. The menu mode behave the same way.
* PCI: flexible modules.pcimap & pci.ids pathsErwan Velu2009-03-111-6/+6
| | | | | | While detecting the pci names, class name & kernel modules, it's better to let the user choosing the path instead of the harcoded value "/" is not always the wanted path
* hdt: PCI: Adding categoryErwan Velu2009-02-261-1/+4
|
* hdt: We have to iterate & copy the vendor name to all matching pci devices ↵Erwan Velu2009-02-251-4/+13
| | | | as all pci devices might not have a matching vendor/product id. This will help us having the proper vendor device with an unknown product.
* hdt: Adding more defined values for pci components Enabling mulitple kernel ↵Erwan Velu2009-02-251-21/+26
| | | | modules per pci device Updating pcitest
* hdt: Returning ENOPCIIDS and ENOMODULESPCIMAP when pci.ids and ↵Erwan Velu2009-02-251-3/+3
| | | | modules.pcidmap files are missing
* hdt: Improving performances by not computing product ids when the vendor ↵Erwan Velu2009-02-251-30/+25
| | | | | | doesn't exist on the local system. Removing useless break() that prevent other com32 module to load
* hdt: Improving detection speed by skipping uncessary linesErwan Velu2009-02-251-0/+13
|
* hdt: No need to only copy vendor nameErwan Velu2009-02-251-8/+6
|
* hdt: Performance optimisations : avoiding hex_to_int in pci_domain loopsErwan Velu2009-02-251-14/+29
|
* hdt: Adding get_class_name_from_pci_ids to grab class name from the pciidsErwan Velu2009-02-251-0/+87
|
* pci: fix pci_scan()Sebastian Herbszt2008-08-121-2/+4
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pci: cosmetic fixesSebastian Herbszt2008-08-121-34/+34
| | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pci: revamp the PCI system to have a hierarchial formatH. Peter Anvin2008-08-121-179/+183
| | | | | | | | Create the concept of a PCI domain, as a hierarcy of busses, devices and functions. This avoids large static-sized arrays and allows for geographical addressing of devices. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pci: store device addressH. Peter Anvin2008-08-011-3/+7
| | | | | | | When scanning PCI devices, store the device address for reference. Based on a patch by Sebastian Herbszt. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pci: fix off-by-one error and introduce MAX_PCI_FUNCSebastian Herbszt2008-06-131-7/+7
| | | | | | | | | | | | | | | | | | | | | | | In include/sys/pci.h we have #define MAX_PCI_BUSES 255 and struct pci_bus_list { struct pci_bus pci_bus[MAX_PCI_BUSES]; uint8_t count; }; And in lib/pci/scan.c for (bus = 0; bus <= MAX_PCI_BUSES; bus++) { pci_bus_list->pci_bus[bus].pci_device_count = 0; Fix possible overflows and introduce MAX_PCI_FUNC. - Sebastian
* PCI detection code doesn't corrupt memory anymore (2nd try)Erwan2008-03-201-22/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From : Erwan Velu <erwan.velu@free.fr> This patch fixes the pci detection stuff demo'd in pcitest.c32 - Fix a wrong type in malloc - Incorrect use of strdup - Replacing strncpy by strnlcpy (thx hpa) This two fixes makes pcitest.c32 working far better, no more crash when running it twice. I'd like to thank Sebastian Herbszt for its reports and tests. This patch was made for 3.62-pre16 but applies fine on 3.63-pre1. Signed-off-by:Erwan Velu <erwan.velu@free.fr> -------------------------------------------------------------------------------- Les opinions et prises de position emises par le signataire du present message lui sont propres et ne sauraient engager la responsabilite de la societe SEANODES. Ce message ainsi que les eventuelles pieces jointes constituent une correspondance privee et confidentielle a l'attention exclusive du destinataire designe ci-dessus. Si vous n'etes pas le destinataire du present message ou une personne susceptible de pouvoir le lui delivrer, il vous est signifie que toute divulgation, distribution ou copie de cette transmission est strictement interdite. Si vous avez recu ce message par erreur, nous vous remercions d'en informer l'expediteur par telephone ou de lui retourner le present message, puis d'effacer immediatement ce message de votre systeme. The views and opinions expressed by the author of this message are personal. SEANODES shall assume no liability, express or implied for such message. This e-mail and any attachments is a confidential correspondence intended only for use of the individual or entity named above. If you are not the intended recipient or the agent responsible for delivering the message to the intended recipient, you are hereby notified that any disclosure, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender by phone or by replying this message, and then delete this message from your system.
* Whitespace cleanup...syslinux-3.62-pre11H. Peter Anvin2008-02-191-10/+10
|
* Clean up some of the new PCI code from Erwan Velu.syslinux-3.52-pre7H. Peter Anvin2007-08-161-79/+86
| | | | | | | More needs to be done; the code has console I/O at the library level, which isn't good. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Improving PCI collected informationsErwan Velu2007-08-161-6/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch - add a new pci_dev_info structure : It contains additional informations about the pci devices like the product/vendor name and the associated linux kernel module - add a get_name_from_pci_ids() function in pci/scan.c This function reads a pci.ids file from the boot device. Then it assign for each pci device, its vendor/product name. You just have to put this file in the root directory of your isolinux/pxelinux (i.e the root directory of your tfptboot server if you are using pxelinux). - add a get_module_name_from_pci_ids() function in pci/scan.c This function reads a modules.pcimap file from the boot device. Then it assign for each pci_device its linux kernel module. You just have to put this file in the root directory of your isolinux/pxelinux (i.e the root directory of your tfptboot server if you are using pxelinux). - Add a call to get_name_from_pci_ids() into the pcitest COM32 module - Add a call to get_module_name_from_pci_ids() into the pcitest COM32 module - Fixing typedef struct { ... } s_pci...; by struct pci... {}; - Improving comments - Fixing the memory allocation to prevent leaks With this patch, pcitest.c32 act like lspci plus a bonus by displaying the linux kernel module assiocated to each pci device. Signed-off-by:Erwan Velu <erwan.velu@free.fr> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Move the PCI-scanning code into the library proper.H. Peter Anvin2007-04-031-0/+165