bk://kernel.bkbits.net/gregkh/linux/pci-2.6 greg@kroah.com|ChangeSet|20040430222722|45725 greg # This is a BitKeeper generated diff -Nru style patch. # # drivers/pci/hotplug/cpqphp_core.c # 2004/04/25 07:39:40-07:00 eike-hotplug@sf-tec.de +11 -13 # Compaq PCI Hotplug: some final fixes for cpqphp_core.c # # drivers/pci/hotplug/cpqphp_core.c # 2004/04/25 07:39:40-07:00 eike-hotplug@sf-tec.de +3 -13 # Compaq PCI Hotplug: remove useless NULL checks from cpqphp_core.c # # drivers/pci/hotplug/cpqphp_core.c # 2004/04/25 07:39:41-07:00 eike-hotplug@sf-tec.de +31 -26 # Compaq PCI Hotplug: use goto for error handling # # drivers/pci/hotplug/cpqphp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +150 -126 # Compaq PCI Hotplug: more coding style fixes # # drivers/pci/hotplug/cpqphp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +4 -3 # Compaq PCI Hotplug: use new style of module parameters # # drivers/pci/hotplug/cpqphp_core.c # 2004/04/24 19:02:14-07:00 eike-hotplug@sf-tec.de +33 -97 # Compaq PCI Hotplug: remove useless NULL checks # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/28 14:53:59-07:00 eike-hotplug@sf-tec.de +1 -20 # Compaq PCI Hotplug: remove useless NULL checks from cpqphp_ctrl.c # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/28 14:53:59-07:00 eike-hotplug@sf-tec.de +18 -22 # Compaq PCI Hotplug: kill useless kmalloc casts # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/25 10:47:46-07:00 eike-hotplug@sf-tec.de +1 -1 # Compaq PCI Hotplug: fix missing braces # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/25 10:47:46-07:00 eike-hotplug@sf-tec.de +14 -15 # Compaq PCI Hotplug: coding style fixes for cpqphp_ctrl.c # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/25 10:47:46-07:00 eike-hotplug@sf-tec.de +29 -41 # Compaq PCI Hotplug: use goto for error handling in cpqphp_ctrl.c # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/27 16:18:21-07:00 eike-hotplug@sf-tec.de +349 -391 # Compaq PCI Hotplug: fix C++ style comments # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/25 07:27:27-07:00 eike-hotplug@sf-tec.de +38 -99 # Compaq PCI Hotplug: split up hardware_test # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/23 14:20:26-07:00 eike-hotplug@sf-tec.de +132 -0 # Compaq PCI Hotplug: move huge inline function out of header file # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/24 19:02:14-07:00 eike-hotplug@sf-tec.de +1 -6 # Compaq PCI Hotplug: remove useless NULL checks # # drivers/pci/hotplug/cpqphp_ctrl.c # 2004/04/24 12:46:59-07:00 eike-hotplug@sf-tec.de +203 -180 # Compaq PCI Hotplug: coding style fixes # # drivers/pci/hotplug/cpqphp.h # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +1 -5 # Compaq PCI Hotplug: use new style of module parameters # # drivers/pci/hotplug/cpqphp.h # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +0 -133 # Compaq PCI Hotplug: move huge inline function out of header file # # drivers/pci/hotplug/cpqphp.h # 2004/04/24 19:02:14-07:00 eike-hotplug@sf-tec.de +0 -48 # Compaq PCI Hotplug: remove useless NULL checks # # drivers/pci/hotplug/cpqphp_pci.c # 2004/04/30 07:24:17-07:00 greg@kroah.com +1 -1 # PCI Hotplug: fix stupid build bugs caused by previous patches. # # Doesn't anyone build their patches anymore before sending them out... # # drivers/pci/hotplug/cpqphp.h # 2004/04/24 14:27:44-07:00 eike-hotplug@sf-tec.de +25 -29 # Compaq PCI Hotplug: coding style fixes # # drivers/pci/hotplug/cpqphp_pci.c # 2004/04/27 16:26:12-07:00 eike-hotplug@sf-tec.de +20 -14 # PCI Hotplug: Remove type magic from kmalloc # # drivers/pci/hotplug/cpqphp_pci.c # 2004/04/24 12:40:14-07:00 eike-hotplug@sf-tec.de +25 -21 # Compaq PCI Hotplug: coding style fixes # # ChangeSet # 2004/05/01 21:36:29-07:00 akpm@osdl.org # [PATCH] PCI Hotplug: pciehp-linkage-fix.patch # # This fixes allyesconfig # # drivers/pci/hotplug/pciehp_core.c # 2004/05/01 18:59:19-07:00 akpm@osdl.org +5 -5 # PCI Hotplug: pciehp-linkage-fix.patch # # ChangeSet # 2004/04/30 16:36:58-07:00 akpm@bix.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into bix.(none):/usr/src/bk-pci # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/30 16:36:55-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp.h # 2004/04/30 16:36:55-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/pciehp_hpc.c # 2004/04/30 16:36:55-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/30 15:27:22-07:00 greg@kroah.com # PCI Hotplug: fix build error due to previous patches. # # drivers/pci/hotplug/shpchp_core.c # 2004/04/30 08:26:54-07:00 greg@kroah.com +1 -1 # PCI Hotplug: fix build error due to previous patches. # # ChangeSet # 2004/04/30 15:25:10-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: remove some useless casts # # Remove a useless cast: pci_add_new_bus returns a struct pci_bus*, so no need # to cast. # # drivers/pci/hotplug/shpchp_pci.c # 2004/04/23 15:39:10-07:00 eike-hotplug@sf-tec.de +1 -1 # SHPC PCI Hotplug: remove some useless casts # # ChangeSet # 2004/04/30 15:24:49-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: more coding style fixes # # A big bunch of coding style fixes for shpchp_ctrl.c and shpchp_pci.c # # Eike # # drivers/pci/hotplug/shpchp_pci.c # 2004/04/23 15:39:10-07:00 eike-hotplug@sf-tec.de +119 -70 # SHPC PCI Hotplug: more coding style fixes # # drivers/pci/hotplug/shpchp_ctrl.c # 2004/04/27 17:24:01-07:00 eike-hotplug@sf-tec.de +13 -12 # SHPC PCI Hotplug: more coding style fixes # # ChangeSet # 2004/04/30 15:24:15-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: kill useless NULL checks # # drivers/pci/hotplug/shpchp_core.c # 2004/04/29 13:18:25-07:00 eike-hotplug@sf-tec.de +3 -32 # SHPC PCI Hotplug: kill useless NULL checks # # ChangeSet # 2004/04/30 15:23:43-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: codingstyle fixes # # Some small coding style fixes for shpchp_core.c. # # drivers/pci/hotplug/shpchp_core.c # 2004/04/29 13:18:25-07:00 eike-hotplug@sf-tec.de +5 -5 # SHPC PCI Hotplug: codingstyle fixes # # ChangeSet # 2004/04/30 15:23:11-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: use goto for error handling # # Convert shpchp_core.c::init_slots to use goto for error handling. # # drivers/pci/hotplug/shpchp_core.c # 2004/04/29 13:18:25-07:00 eike-hotplug@sf-tec.de +24 -29 # SHPC PCI Hotplug: use goto for error handling # # ChangeSet # 2004/04/30 15:22:36-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: fix cleanup_slots to use a release function # # shpchp is the only driver which does not use a release function for the slot # struct. This adds one and does some minor coding style fixes. Also no one # cares about the return value of cleanup_slots (which is always 0 anyway) so # we can make the function void. # # drivers/pci/hotplug/shpchp_core.c # 2004/04/29 13:35:38-07:00 eike-hotplug@sf-tec.de +23 -15 # SHPC PCI Hotplug: fix cleanup_slots to use a release function # # ChangeSet # 2004/04/30 15:21:59-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: kill hardware_test # # shpchp_core.c::hardware_test is empty. If we remove it we tell the user that # hardware tests are not supported at all. # # drivers/pci/hotplug/shpchp_core.c # 2004/04/29 13:19:43-07:00 eike-hotplug@sf-tec.de +0 -9 # SHPC PCI Hotplug: kill hardware_test # # ChangeSet # 2004/04/30 15:04:50-07:00 eike-hotplug@sf-tec.de # [PATCH] SHPC PCI Hotplug: use new style of module parameters # # Convert shpchp_core.c to use new style of module handling. # # Eike # # drivers/pci/hotplug/shpchp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +4 -3 # SHPC PCI Hotplug: use new style of module parameters # # ChangeSet # 2004/04/30 15:04:23-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: codingstyle fixes for rpaphp_pci.c # # Some coding style fixes for rpaphp_pci.c. # # drivers/pci/hotplug/rpaphp_pci.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +15 -16 # RPA PCI Hotplug: codingstyle fixes for rpaphp_pci.c # # ChangeSet # 2004/04/30 15:03:58-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: use goto for error handling in rpaphp_slot.c # # Convert rpaphp_slot.c::alloc_slot_struct to use goto for error handling. Also # some small coding style fixes. # # drivers/pci/hotplug/rpaphp_slot.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +32 -32 # RPA PCI Hotplug: use goto for error handling in rpaphp_slot.c # # ChangeSet # 2004/04/30 15:03:27-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: remove useless NULL checks from rpaphp_core.c # # Remove two useless NULL checks from rpaphp_core.c # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/29 12:44:44-07:00 eike-hotplug@sf-tec.de +2 -8 # RPA PCI Hotplug: remove useless NULL checks from rpaphp_core.c # # ChangeSet # 2004/04/30 15:02:53-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: fix up init_slots in rpaphp_core.c # # rpaphp_core.c::init_slots is not more than a for loop and is called only from # one place, this inlines the important 3 lines. Als add some __init and __exit. # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +4 -14 # RPA PCI Hotplug: fix up init_slots in rpaphp_core.c # # ChangeSet # 2004/04/30 15:02:20-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: codingstyle fixes for rpaphp_core.c # # Some coding style fixes for rpaphp_core.c: # -s/return(foo)/return foo/ # -some whitespace fixes # -document function in proper way # # Eike # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +14 -13 # RPA PCI Hotplug: codingstyle fixes for rpaphp_core.c # # ChangeSet # 2004/04/30 15:01:47-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: kill get_cur_bus_speed from rpaphp_core.c # # The get_cur_bus_speed function of rpaphp does nothing that the PCI Hotplug Core # would not do by itself if this function does not exist, so just kill it. # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +0 -14 # RPA PCI Hotplug: kill get_cur_bus_speed from rpaphp_core.c # # ChangeSet # 2004/04/30 15:01:13-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: use new style of module parameters # # The debug parameter of rpaphp is only used as a boolean so we can scan the # commandline of it like a boolean parameter. # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +1 -1 # RPA PCI Hotplug: use new style of module parameters # # ChangeSet # 2004/04/30 15:00:38-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: codingstyle fixes for pciehp_pci.c # # This is a bunch of coding style fixes (wrap long lines, whitspacing etc.) for # pciehp_pci.c # # drivers/pci/hotplug/pciehp_pci.c # 2004/04/23 15:39:19-07:00 eike-hotplug@sf-tec.de +119 -72 # PCI Express Hotplug: codingstyle fixes for pciehp_pci.c # # ChangeSet # 2004/04/30 15:00:01-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: kill more useless casts # # This patch does two things: # -remove casts of pointers which are void* or already the correct type for the # target # -if we dereferenced a struct member and copied this to it's own variable use # this and don't dereference the member again # # drivers/pci/hotplug/pciehp_pci.c # 2004/04/23 15:39:19-07:00 eike-hotplug@sf-tec.de +1 -1 # PCI Express Hotplug: kill more useless casts # # drivers/pci/hotplug/pciehp_hpc.c # 2004/04/29 11:01:21-07:00 eike-hotplug@sf-tec.de +41 -41 # PCI Express Hotplug: kill more useless casts # # ChangeSet # 2004/04/30 14:52:21-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: mark global variables static # # Don't know why, but it looks like a good idea to mark this global variables # static. # # drivers/pci/hotplug/pciehp_core.c # 2004/04/29 11:10:54-07:00 eike-hotplug@sf-tec.de +5 -5 # PCI Express Hotplug: mark global variables static # # ChangeSet # 2004/04/30 14:52:02-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: some cleanups # # Some coding style fixes and small cleanups for pciehp_core.c: # -wrap long lines # -kill spaces before opening braces of functions # -remove code duplication where both parts of an if statement do exactly the # same # -kill some useless comments # -kill an unneeded initialisation # # drivers/pci/hotplug/pciehp_core.c # 2004/04/29 11:10:54-07:00 eike-hotplug@sf-tec.de +34 -32 # PCI Express Hotplug: some cleanups # # ChangeSet # 2004/04/30 14:51:30-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: remove useless kmalloc casts # # The result of kmalloc does not need to be casted to any other pointer type. # Also use kmalloc(*foo) instead of kmalloc(type_of_foo) and wrap some long # lines. # # drivers/pci/hotplug/pciehp_core.c # 2004/04/29 11:10:54-07:00 eike-hotplug@sf-tec.de +14 -8 # PCI Express Hotplug: remove useless kmalloc casts # # ChangeSet # 2004/04/30 14:50:55-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: codingstyle fixes for pciehp.h # # Some small coding style fixes and a typo fix for pciehp.h # # drivers/pci/hotplug/pciehp.h # 2004/04/29 11:07:54-07:00 eike-hotplug@sf-tec.de +11 -11 # PCI Express Hotplug: codingstyle fixes for pciehp.h # # ChangeSet # 2004/04/30 14:50:28-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: use goto for error handling # # This changes pciehp_core.c::init_slots to use goto for error hanling. Also a # missing magic missed by previous patches is killed. # # drivers/pci/hotplug/pciehp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +21 -24 # PCI Express Hotplug: use goto for error handling # # ChangeSet # 2004/04/30 14:49:55-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: remove useless NULL checks from cpqphp_ctrl.c # # Remove useless NULL checks from cpqphp_ctrl.c. Under normal circumstances # there is no chance for any of this functions to get called with a NULL # argument. If we are in such trouble that we get a NULL pointer don't hide it, # just oops. # # ChangeSet # 2004/04/30 14:49:21-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: kill hardware_test # # The hardware_test function of the PCI Express Hotplug driver is empty. It's # better to completely kill this to tell the user hardware tests are not # supported by this driver. # # drivers/pci/hotplug/pciehp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +0 -7 # PCI Express Hotplug: kill hardware_test # # ChangeSet # 2004/04/30 14:48:46-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: kill useless kmalloc casts # # This patch removes the cast of kmalloc's results to the target pointer type. # Also it fixes kmalloc to use sizeof(*foo) instead of sizeof(type_of_foo) as # suggested by Matthew Wilcox. Also removes a few useless checks if a pointer # is NULL before calling kfree: kfree checks this itself. # # ChangeSet # 2004/04/30 14:48:11-07:00 eike-hotplug@sf-tec.de # [PATCH] RPA PCI Hotplug: Remove useless NULL checks # # Remove useless NULL checks and magic numbers from rpaphp. If one of these # ever becomes invalid we are in serious trouble anyway. # # drivers/pci/hotplug/rpaphp_slot.c # 2004/04/28 22:41:20-07:00 eike-hotplug@sf-tec.de +2 -5 # RPA PCI Hotplug: Remove useless NULL checks # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/28 22:41:20-07:00 eike-hotplug@sf-tec.de +6 -29 # RPA PCI Hotplug: Remove useless NULL checks # # drivers/pci/hotplug/rpaphp.h # 2004/04/28 22:41:20-07:00 eike-hotplug@sf-tec.de +0 -3 # RPA PCI Hotplug: Remove useless NULL checks # # ChangeSet # 2004/04/30 14:47:34-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: remove useless NULL checks # # Remove useless NULL checks and magic numbers from PCI Express Hotplug, also # some minimal coding style fixes. # # drivers/pci/hotplug/pciehp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +21 -51 # PCI Express Hotplug: remove useless NULL checks # # drivers/pci/hotplug/pciehp.h # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +2 -41 # PCI Express Hotplug: remove useless NULL checks # # ChangeSet # 2004/04/30 14:24:30-07:00 greg@kroah.com # PCI Hotplug: fix stupid build bugs caused by previous patches. # # Doesn't anyone build their patches anymore before sending them out... # # drivers/pci/hotplug/cpci_hotplug_core.c # 2004/04/30 07:24:17-07:00 greg@kroah.com +0 -4 # PCI Hotplug: fix stupid build bugs caused by previous patches. # # Doesn't anyone build their patches anymore before sending them out... # # ChangeSet # 2004/04/30 14:18:56-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: fix missing braces # # Fix missing braces. It does not change the code but makes it easier to read. # # ChangeSet # 2004/04/30 14:18:21-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: use new style of module parameters # # This converts PCI Express Hotplug to the new style of module parameter # handling. # # drivers/pci/hotplug/pciehp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +4 -3 # PCI Express Hotplug: use new style of module parameters # # drivers/pci/hotplug/pciehp.h # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +1 -5 # PCI Express Hotplug: use new style of module parameters # # ChangeSet # 2004/04/30 14:17:48-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Move an often used while loop to an inline function # # Walking through a pci_resource list and freeing all members is done a lot of # times in unload functions. This patch moves this to an inline function in # pciehp_core.c, pciehp_pci.c, shpchp_core.c and shpchp_pci.c. This shrinks the # code a lot (some 200 lines) and makes it much easier to read. Also adds some # __exit. # # drivers/pci/hotplug/shpchp_pci.c # 2004/04/23 15:39:10-07:00 eike-hotplug@sf-tec.de +55 -117 # PCI Hotplug: Move an often used while loop to an inline function # # drivers/pci/hotplug/shpchp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +20 -60 # PCI Hotplug: Move an often used while loop to an inline function # # drivers/pci/hotplug/pciehp_pci.c # 2004/04/23 15:39:19-07:00 eike-hotplug@sf-tec.de +57 -117 # PCI Hotplug: Move an often used while loop to an inline function # # drivers/pci/hotplug/pciehp_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +20 -60 # PCI Hotplug: Move an often used while loop to an inline function # # ChangeSet # 2004/04/30 14:17:13-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug Core: use new style of module parameters # # Convert PCI Hotplug Core to new style of module parameter handling. # # drivers/pci/hotplug/pci_hotplug_core.c # 2004/04/21 09:59:30-07:00 eike-hotplug@sf-tec.de +3 -6 # PCI Hotplug Core: use new style of module parameters # # ChangeSet # 2004/04/30 14:16:40-07:00 eike-hotplug@sf-tec.de # [PATCH] [BUGFIX] shpchp_pci.c: fix missing braces after if # # Add missing braces around if statement, if not we will try to add devices # for an empty slot. # # drivers/pci/hotplug/shpchp_pci.c # 2004/04/23 15:39:10-07:00 eike-hotplug@sf-tec.de +3 -2 # [BUGFIX] shpchp_pci.c: fix missing braces after if # # ChangeSet # 2004/04/30 14:16:10-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Remove type magic from kmalloc # # This patch removes the cast of kmalloc's results to the target pointer type. # Also it fixes kmalloc to use sizeof(*foo) instead of sizeof(type_of_foo) as # suggested by Matthew Wilcox. Also removes a few useless checks if a pointer # is NULL before calling kfree: kfree checks this itself. # # drivers/pci/hotplug/shpchp_ctrl.c # 2004/04/27 16:29:27-07:00 eike-hotplug@sf-tec.de +19 -22 # PCI Hotplug: Remove type magic from kmalloc # # ChangeSet # 2004/04/30 14:15:38-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: some final fixes for cpqphp_core.c # # Final small fixes for cpqphp_core.c: # -use better error handling in one_time_init # -small coding style fixes # -the name of the driver is not "pci_hotplug" # -add an __exit for unload_cpqphp # -changes enough to increment version, isn't it? # # ChangeSet # 2004/04/30 14:15:05-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: coding style fixes for cpqphp_ctrl.c # # Some coding style fixes I missed last time. # # ChangeSet # 2004/04/30 14:14:30-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: use goto for error handling in cpqphp_ctrl.c # # Change cpqphp_ctrl.c to use goto for error handling. # # ChangeSet # 2004/04/30 14:13:57-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: fix C++ style comments # # This is not C++! Fix comments from C++ style to C style, removing some useless # ones (e.g. no need to tell up and down protect a critical section). # # ChangeSet # 2004/04/30 14:13:24-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: remove useless NULL checks from cpqphp_core.c # # Remove some useless NULL checks in cpqphp_core.c # # ChangeSet # 2004/04/30 14:12:50-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: use goto for error handling # # Convert ctrl_slot_setup to use goto for error handling and fix some minor # coding style things. # # ChangeSet # 2004/04/30 14:12:23-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: split up hardware_test # # This puts the LED shifting used as "hardware test" in a function to make # cpqhp_hardware_test much smaller and easier to read. Also changes some # comments from C++ to C style. # # ChangeSet # 2004/04/30 14:11:54-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: more coding style fixes # # Fix a lot of coding style issues in Compaq PCI hotplug: # -spaces before opening brace of functions # -much too much C++ style comments # -wrap long lines # -remove some comments where the code does not really need to be explained # # Eike # # ChangeSet # 2004/04/30 14:11:19-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: use new style of module parameters # # Convert Compaq PCI Hotplug driver to use the new style of module parameters. # # ChangeSet # 2004/04/30 14:10:45-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: move huge inline function out of header file # # set_controller_speed is implemented in cpqphp.h but only used in cpqphp_ctrl.c # and it's much too big to be defined in a header file. This patch moves it to # cpqphp_ctrl.c. Also the inline attribute is removed, this function is called # from 2 places and to big to be an inline. # # ChangeSet # 2004/04/30 14:10:12-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: remove useless NULL checks # # Remove some useless NULL and magic checks from Compaq PCI Hotplug driver. # If one of this pointers is invalid we are in bad trouble anyway. # # ChangeSet # 2004/04/30 14:09:35-07:00 eike-hotplug@sf-tec.de # [PATCH] Compaq PCI Hotplug: coding style fixes # # The usual coding style fixes, this time for cpqphp_ctrl.c and cpqphp.c. # # ChangeSet # 2004/04/29 16:14:39-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: splut pciehp_ctrl.c::configure_new_function # # configure_new_function is way too big (>600 lines). Split it in 2 functions, # one for the new functions and one for bridges. And split out a small piece # from the bridge function which is used twice to it's own function. # # Patch is huge because of the identation changes but does nothing than the # split and some minor coding style changes. # # drivers/pci/hotplug/pciehp_ctrl.c # 2004/04/24 03:03:36-07:00 eike-hotplug@sf-tec.de +435 -417 # PCI Express Hotplug: splut pciehp_ctrl.c::configure_new_function # # ChangeSet # 2004/04/29 16:14:14-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: remove useless kmalloc casts # # The result of kmalloc does not need to be casted, it is a void * which can be # assigned to any pointer variable. Also avoid code duplication in one if # statement. # # drivers/pci/hotplug/pciehp_ctrl.c # 2004/04/24 02:48:25-07:00 eike-hotplug@sf-tec.de +18 -12 # PCI Express Hotplug: remove useless kmalloc casts # # ChangeSet # 2004/04/29 16:13:41-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Express Hotplug: fix coding style # # drivers/pci/hotplug/pciehp_ctrl.c # 2004/04/24 02:24:45-07:00 eike-hotplug@sf-tec.de +117 -120 # PCI Express Hotplug: fix coding style # # ChangeSet # 2004/04/29 16:04:49-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug skeleton: final cleanups # # Some final fixes for the skeleton driver: # -spaces before opening brace # -add a better example for hardware_test function # -remove a "int retval" in a void function # -some more coding style changes # -changed enough stuff: increase version number # -fix a typo in a comment # # drivers/pci/hotplug/pcihp_skeleton.c # 2004/04/23 18:22:46-07:00 eike-hotplug@sf-tec.de +25 -22 # PCI Hotplug skeleton: final cleanups # # ChangeSet # 2004/04/29 16:04:00-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug skeleton: use goto for error handling # # Convert PCI hotplug skeleton driver to use goto for error handling in # init_slots to avoid code duplication. # # drivers/pci/hotplug/pcihp_skeleton.c # 2004/04/23 18:19:36-07:00 eike-hotplug@sf-tec.de +19 -22 # PCI Hotplug skeleton: use goto for error handling # # ChangeSet # 2004/04/29 16:03:26-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug skeleton: mark functions __init/__exit # # Add __init and __exit to some functions only called from __init/__exit context. # # drivers/pci/hotplug/pcihp_skeleton.c # 2004/04/23 18:15:14-07:00 eike-hotplug@sf-tec.de +4 -4 # PCI Hotplug skeleton: mark functions __init/__exit # # ChangeSet # 2004/04/29 16:02:44-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug skeleton: fix codingstyle # # Coding style fixes for pcihp_skeleton.c: remove spaces before opening braces # and change a comment in function hardware_test to make clearer that the # functions purpose is not to tell the user there are no tests. # # drivers/pci/hotplug/pcihp_skeleton.c # 2004/04/23 18:10:52-07:00 eike-hotplug@sf-tec.de +25 -26 # PCI Hotplug skeleton: fix codingstyle # # ChangeSet # 2004/04/29 16:02:12-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug skeleton: remove useless NULL checks # # This one removes all the useless NULL checks including slot_paranoia_check, # get_slot and the magic number from the PCI hotplug skeleton driver. Also some # lines containing only a single tab are fixed. # # drivers/pci/hotplug/pcihp_skeleton.c # 2004/04/23 18:05:03-07:00 eike-hotplug@sf-tec.de +17 -82 # PCI Hotplug skeleton: remove useless NULL checks # # ChangeSet # 2004/04/29 16:01:34-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug skeleton: use new style of module parameters # # Convert the PCI hotplug skeleton driver to use new style of module parameter # handling. # # drivers/pci/hotplug/pcihp_skeleton.c # 2004/04/23 17:40:13-07:00 eike-hotplug@sf-tec.de +3 -6 # PCI Hotplug skeleton: use new style of module parameters # # ChangeSet # 2004/04/29 15:55:39-07:00 akpm@bix.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/04/29 15:55:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/probe.c # 2004/04/29 15:55:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/29 15:54:53-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/04/29 15:54:50-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/29 15:52:30-07:00 eike-hotplug@sf-tec.de # [PATCH] ACPI PCI Hotplug: add a BUG() where one should be # # If there is a condition with the comment "should never happen" it is a good # place for a BUG() if it is ever reached. # # drivers/pci/hotplug/acpiphp_glue.c # 2004/04/21 09:59:29-07:00 eike-hotplug@sf-tec.de +2 -1 # ACPI PCI Hotplug: add a BUG() where one should be # # ChangeSet # 2004/04/29 15:51:57-07:00 eike-hotplug@sf-tec.de # [PATCH] ACPI PCI Hotplug: coding style fixes # # Some minor coding style fixes: # -space before opening brace of function # -wrap some long lines # -change some identations from spaces to tabs # # drivers/pci/hotplug/acpiphp_glue.c # 2004/04/21 09:59:29-07:00 eike-hotplug@sf-tec.de +5 -5 # ACPI PCI Hotplug: coding style fixes # # ChangeSet # 2004/04/29 15:51:27-07:00 eike-hotplug@sf-tec.de # [PATCH] ACPI PCI Hotplug: use goto for error handling # # This one fixes another space before an opening brace I missed before and # optimizes the error paths in init_slots a bit more. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/23 16:46:02-07:00 eike-hotplug@sf-tec.de +7 -6 # ACPI PCI Hotplug: use goto for error handling # # ChangeSet # 2004/04/29 15:50:56-07:00 eike-hotplug@sf-tec.de # [PATCH] ACPI PCI Hotplug: kill magic number # # The magic slot number was only another type of checking the validity of a # pointer. These checks are all gone so magic can follow them. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/23 16:39:58-07:00 eike-hotplug@sf-tec.de +0 -1 # ACPI PCI Hotplug: kill magic number # # drivers/pci/hotplug/acpiphp.h # 2004/04/23 16:39:49-07:00 eike-hotplug@sf-tec.de +0 -2 # ACPI PCI Hotplug: kill magic number # # ChangeSet # 2004/04/29 15:50:22-07:00 eike-hotplug@sf-tec.de # [PATCH] ACPI PCI Hotplug: use new style of module parameters # # This one converts acpiphp_core.c to use the new interface for module # parameters. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/23 11:02:59-07:00 eike-hotplug@sf-tec.de +2 -1 # ACPI PCI Hotplug: use new style of module parameters # # ChangeSet # 2004/04/29 15:01:10-07:00 eike-hotplug@sf-tec.de # [PATCH] CompactPCI Hotplug ZT5550: use new style of module parameters # # Convert the driver to use new interface for module parameters, Also fix the # driver name used in debug messages. # # Eike # # drivers/pci/hotplug/cpcihp_zt5550.c # 2004/04/29 08:00:35-07:00 eike-hotplug@sf-tec.de +3 -6 # [PATCH] CompactPCI Hotplug ZT5550: use new style of module parameters # # Convert the driver to use new interface for module parameters, Also fix the # driver name used in debug messages. # # Eike # # ChangeSet # 2004/04/29 14:59:12-07:00 eike-hotplug@sf-tec.de # [PATCH] CompactPCI Hotplug: kill magic number # # slot->magic is not used anymore since slot_paranoia_check is dead, so just kill # it. # # drivers/pci/hotplug/cpci_hotplug_core.c # 2004/04/29 07:58:20-07:00 eike-hotplug@sf-tec.de +0 -1 # [PATCH] CompactPCI Hotplug: kill magic number # # slot->magic is not used anymore since slot_paranoia_check is dead, so just kill # it. # # drivers/pci/hotplug/cpci_hotplug.h # 2004/04/29 07:58:20-07:00 eike-hotplug@sf-tec.de +0 -2 # [PATCH] CompactPCI Hotplug: kill magic number # # slot->magic is not used anymore since slot_paranoia_check is dead, so just kill # it. # # ChangeSet # 2004/04/29 14:53:25-07:00 eike-hotplug@sf-tec.de # [PATCH] CompactPCI Hotplug: remove unneeded funtion for parameter handling # # A special function for handling the parameters in non-module case is not # needed, the MODULE_* makros handle this also for compiled in situations. # # drivers/pci/hotplug/cpcihp_generic.c # 2004/04/29 07:53:02-07:00 eike-hotplug@sf-tec.de +0 -67 # [PATCH] CompactPCI Hotplug: remove unneeded funtion for parameter handling # # A special function for handling the parameters in non-module case is not # needed, the MODULE_* makros handle this also for compiled in situations. # # ChangeSet # 2004/04/29 14:26:03-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Clean up acpiphp_core.c: remove 3 get_* functions # # If we remove this 3 get_* functions the pci hotplug core will do the same # thing for us. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/18 10:13:31-07:00 eike-hotplug@sf-tec.de +2 -43 # PCI Hotplug: Clean up acpiphp_core.c: remove 3 get_* functions # # ChangeSet # 2004/04/29 14:25:28-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Clean up acpiphp_core.c: return # # Fix 2 very ugly return constructs. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/18 09:19:25-07:00 eike-hotplug@sf-tec.de +1 -7 # PCI Hotplug: Clean up acpiphp_core.c: return # # ChangeSet # 2004/04/29 14:25:00-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Clean up acpiphp_core.c: use goto for error handling # # This one converts the error handling in init_slots to use gotos to avoid code # duplication. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/18 09:17:59-07:00 eike-hotplug@sf-tec.de +15 -16 # PCI Hotplug: Clean up acpiphp_core.c: use goto for error handling # # ChangeSet # 2004/04/29 14:24:32-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Clean up acpiphp_core.c: kill hardware_test # # The function hardware_test only tells that there are no tests. If we just # kill it the file "test" in the slot's directory will not show up which # means pretty much the same. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/18 09:12:27-07:00 eike-hotplug@sf-tec.de +0 -20 # PCI Hotplug: Clean up acpiphp_core.c: kill hardware_test # # ChangeSet # 2004/04/29 14:24:01-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Clean up acpiphp_core.c: coding style # # This patch kills the space before the opening brace in function # declarations. It also beautifies some ugly return statements. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/18 09:11:50-07:00 eike-hotplug@sf-tec.de +20 -37 # PCI Hotplug: Clean up acpiphp_core.c: coding style # # ChangeSet # 2004/04/29 14:23:32-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Clean up acpiphp_core.c: slot_paranoia_check # # Matthew Wilcox wrote: # > On Thu, Apr 22, 2004 at 01:18:23PM +0200, Rolf Eike Beer wrote: # > > slot_paranoia_check is only another kind of checking everything for NULL. # > > Removing this leads to function get_slot is reduced to a simple cast, so # > > this function can be killed also. # > # > Since private is void *, you don't even need the casts. # > # > > static int enable_slot (struct hotplug_slot *hotplug_slot) # > > { # > > - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); # > > + struct slot *slot = (struct slot *)hotplug_slot->private; # > # > struct slot *slot = hotplug_slot->private; # > # > is enough. # # Fixed. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/18 09:04:56-07:00 eike-hotplug@sf-tec.de +8 -48 # PCI Hotplug: Clean up acpiphp_core.c: slot_paranoia_check # # ChangeSet # 2004/04/29 14:23:01-07:00 eike-hotplug@sf-tec.de # [PATCH] PCI Hotplug: Clean up acpiphp_core.c: null checks # # If the "struct hotplug_struct *" parameter to any function in # hotplug_slots_ops is ever NULL something bogus is going on. In this case we # should just oops and not hide the bug. This also fixes the driver name used in # debug messages. # # drivers/pci/hotplug/acpiphp_core.c # 2004/04/18 08:36:18-07:00 eike-hotplug@sf-tec.de +1 -35 # PCI Hotplug: Clean up acpiphp_core.c: null checks # # ChangeSet # 2004/04/29 14:07:10-07:00 johnrose@austin.ibm.com # [PATCH] PCI Hotplug: RPA DLPAR remove slot, return code fix # # drivers/pci/hotplug/rpadlpar_core.c # 2004/04/19 08:44:43-07:00 johnrose@austin.ibm.com +10 -10 # PCI Hotplug: RPA DLPAR remove slot, return code fix # # ChangeSet # 2004/04/29 14:01:19-07:00 lxiep@us.ibm.com # [PATCH] PCI Hotplug: rpaphp: set eeh option (enabled ) prior to any i/o to newly added IOA # # Attached patch fix the problem I have found during DLPAR I/O slots # testing on our new hardware. rpaphp needs to set eeh-option(eanbled) # for newly added IOA prior to performing PCI config(pci_setup_device), # otherwise the pci_dev of the IOA will have invalid base address # information. # # Linas Vepstas impleted eeh changes. # # drivers/pci/hotplug/rpaphp_pci.c # 2004/04/21 07:35:49-07:00 lxiep@us.ibm.com +3 -1 # PCI Hotplug: rpaphp: set eeh option (enabled ) prior to any i/o to newly added IOA # # ChangeSet # 2004/04/29 13:17:35-07:00 jochen@jochen.org # [PATCH] PCI: message cleanup in PCI probe # # The messages read: # # PCI: Address space collision on region 8 of bridge 0000:00:1f.0 [1180:11bf] # PCI: Ignoring BAR0-3 of IDE controller 0000:00:1f.1 # Transparent bridge - 0000:00:1e.0 # PCI: Using IRQ router PIIX/ICH [8086/24cc] at 0000:00:1f.0 # PCI: Found IRQ 11 for device 0000:00:1f.1 # # The following patch adds "PCI: " in front of the message and KERN_INFO as well. # Compile&boot tested. # # Jochen # # drivers/pci/probe.c # 2004/04/18 04:57:06-07:00 jochen@jochen.org +1 -1 # PCI: message cleanup in PCI probe # # ChangeSet # 2004/04/29 13:16:38-07:00 jochen@jochen.org # [PATCH] PCI: I'm moving # # Can you please feed the following patch to Andrew? # # CREDITS # 2004/04/18 04:49:42-07:00 jochen@jochen.org +2 -2 # PCI: I'm moving # # ChangeSet # 2004/04/29 13:15:55-07:00 dsaxena@plexity.net # [PATCH] PCI: pci.ids update from sf.net + add IXP4xx to pci_ids.h # # include/linux/pci_ids.h # 2004/04/15 10:48:16-07:00 dsaxena@plexity.net +1 -0 # PCI: pci.ids update from sf.net + add IXP4xx to pci_ids.h # # drivers/pci/pci.ids # 2004/04/15 10:51:41-07:00 dsaxena@plexity.net +1248 -225 # PCI: pci.ids update from sf.net + add IXP4xx to pci_ids.h # # ChangeSet # 2004/04/27 01:18:13-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # arch/ia64/Kconfig # 2004/04/27 01:18:10-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/25 22:59:41-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/04/25 22:59:38-07:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/04/25 22:59:38-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/21 22:04:39-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # arch/arm/Kconfig # 2004/04/21 22:04:36-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/04/19 19:39:21-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp_core.c # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp.h # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/pciehp_hpc.c # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/x86_64/Kconfig # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/ia64/Kconfig # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/04/19 19:39:17-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/31 19:18:44-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/03/31 19:18:41-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/31 12:50:28-08:00 akpm@bix.(none) # Merge # # drivers/pci/hotplug/pciehp_hpc.c # 2004/03/31 12:50:27-08:00 akpm@bix.(none) +0 -0 # SCCS merged # # ChangeSet # 2004/03/29 18:01:08-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # arch/arm/Kconfig # 2004/03/29 18:01:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/27 02:23:03-08:00 akpm@bix.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/03/27 02:23:00-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/probe.c # 2004/03/27 02:23:00-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/26 12:19:23-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/03/26 12:19:20-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/ia64/Kconfig # 2004/03/26 12:19:20-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/03/26 12:19:20-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/24 02:42:26-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # arch/i386/Kconfig # 2004/03/24 02:42:24-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/19 15:25:33-08:00 akpm@bix.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into bix.(none):/usr/src/bk-pci # # drivers/pci/hotplug/rpaphp_core.c # 2004/03/19 15:25:30-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/19 10:07:30-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # arch/i386/Kconfig # 2004/03/19 10:07:27-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/03/19 10:07:27-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/x86_64/Kconfig # 2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/x86_64/Kconfig # 2004/03/12 00:53:36-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/16 20:23:12-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/03/16 20:22:53-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/16 12:49:12-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # drivers/pci/hotplug/rpaphp_core.c # 2004/03/16 12:49:00-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/ia64/Kconfig # 2004/03/16 12:49:00-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/03/16 12:49:00-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/15 22:43:11-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/03/15 22:42:57-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/base/Makefile # 2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/ia64/Kconfig # 2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/03/15 22:42:56-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/14 14:12:57-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # drivers/pci/probe.c # 2004/03/14 14:12:50-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/03/14 14:12:50-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/12 10:48:16-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # arch/ia64/Kconfig # 2004/03/12 10:48:01-08:00 akpm@bix.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/03/12 10:48:01-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/12 00:53:55-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-pci # # ChangeSet # 2004/03/10 21:02:04-08:00 akpm@mnm.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into mnm.(none):/usr/src/bk-pci # # drivers/pci/hotplug/rpaphp_core.c # 2004/03/10 21:01:55-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp.h # 2004/03/10 21:01:55-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/06 12:59:56-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # arch/i386/Kconfig # 2004/03/06 12:59:50-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/05 18:42:06-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/03/05 18:41:59-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/03/02 22:20:54-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # drivers/pci/hotplug/rpaphp_core.c # 2004/03/02 22:20:47-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp.h # 2004/03/02 22:20:47-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/Kconfig # 2004/03/02 22:20:47-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/28 17:44:24-08:00 akpm@mnm.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into mnm.(none):/usr/src/bk-pci # # drivers/pci/hotplug/rpaphp_core.c # 2004/02/28 17:44:17-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp.h # 2004/02/28 17:44:17-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/Kconfig # 2004/02/28 17:44:17-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/28 17:42:40-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # drivers/pci/hotplug/rpaphp_core.c # 2004/02/28 17:42:34-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp.h # 2004/02/28 17:42:33-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/Kconfig # 2004/02/28 17:42:33-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/ia64/Kconfig # 2004/02/28 17:42:33-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/27 13:07:48-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/02/27 13:07:41-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/pci/hotplug/rpaphp_core.c # 2004/02/27 13:07:41-08:00 akpm@mnm.(none) +0 -1 # Auto merged # # drivers/pci/hotplug/rpaphp.h # 2004/02/27 13:07:41-08:00 akpm@mnm.(none) +0 -1 # Auto merged # # ChangeSet # 2004/02/26 12:37:26-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # drivers/pci/hotplug/Kconfig # 2004/02/26 12:37:19-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/02/26 12:37:19-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/25 11:57:36-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/02/25 11:57:29-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/x86_64/Kconfig # 2004/02/25 11:57:29-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/02/25 11:57:29-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/24 13:27:08-08:00 akpm@mnm.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into mnm.(none):/usr/src/bk-pci # # drivers/pci/probe.c # 2004/02/24 13:27:01-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/24 13:25:22-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # arch/i386/Kconfig # 2004/02/24 13:25:16-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/23 20:32:00-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # arch/arm/Kconfig # 2004/02/23 20:31:53-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/20 18:55:32-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # arch/arm/Kconfig # 2004/02/20 18:55:26-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/20 13:59:53-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/02/20 13:59:47-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/x86_64/Kconfig # 2004/02/20 13:59:47-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/ia64/Kconfig # 2004/02/20 13:59:46-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/02/20 13:59:46-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/02/20 13:59:46-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/19 23:12:37-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # include/linux/pci_ids.h # 2004/02/19 23:12:30-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/02/19 23:12:30-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/19 20:56:02-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # drivers/pci/probe.c # 2004/02/19 20:55:56-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/x86_64/Kconfig # 2004/02/19 20:55:56-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/ia64/Kconfig # 2004/02/19 20:55:55-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/i386/Kconfig # 2004/02/19 20:55:55-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # arch/arm/Kconfig # 2004/02/19 20:55:55-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/18 18:56:37-08:00 akpm@mnm.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into mnm.(none):/usr/src/bk-pci # # arch/x86_64/Kconfig # 2004/02/18 18:56:30-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/09 18:07:41-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # drivers/pci/probe.c # 2004/02/09 18:07:35-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/base/Makefile # 2004/02/09 18:07:35-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/04 12:10:06-08:00 akpm@mnm.(none) # Merge mnm.(none):/usr/src/bk25 into mnm.(none):/usr/src/bk-pci # # drivers/pci/probe.c # 2004/02/04 12:09:59-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # drivers/base/Makefile # 2004/02/04 12:09:59-08:00 akpm@mnm.(none) +0 -0 # Auto merged # # ChangeSet # 2004/02/02 22:26:26-08:00 akpm@mnm.(none) # Merge bk://kernel.bkbits.net/gregkh/linux/pci-2.6 # into mnm.(none):/usr/src/bk-pci # # drivers/pci/probe.c # 2004/02/02 22:26:19-08:00 akpm@mnm.(none) +0 -0 # Auto merged # diff -Nru a/CREDITS b/CREDITS --- a/CREDITS Tue May 4 22:16:06 2004 +++ b/CREDITS Tue May 4 22:16:06 2004 @@ -1284,8 +1284,8 @@ D: National Language Support D: Linux Internationalization Project D: German Localization for Linux and GNU software -S: Helenenstrasse 18 -S: 65183 Wiesbaden +S: Kriemhildring 12a +S: 65795 Hattersheim am Main S: Germany N: Christoph Hellwig diff -Nru a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h --- a/drivers/pci/hotplug/acpiphp.h Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/acpiphp.h Tue May 4 22:16:06 2004 @@ -47,7 +47,6 @@ #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) -#define SLOT_MAGIC 0x67267322 /* name size which is used for entries in pcihpfs */ #define SLOT_NAME_SIZE KOBJ_NAME_LEN /* {_SUN} */ @@ -59,7 +58,6 @@ * struct slot - slot information for each *physical* slot */ struct slot { - u32 magic; u8 number; struct hotplug_slot *hotplug_slot; struct list_head slot_list; diff -Nru a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c --- a/drivers/pci/hotplug/acpiphp_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/acpiphp_core.c Tue May 4 22:16:06 2004 @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -43,11 +44,7 @@ static LIST_HEAD(slot_list); -#if !defined(CONFIG_HOTPLUG_PCI_ACPI_MODULE) - #define MY_NAME "acpiphp" -#else - #define MY_NAME THIS_MODULE->name -#endif +#define MY_NAME "acpiphp" static int debug; int acpiphp_debug; @@ -62,72 +59,28 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "i"); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); +module_param(debug, bool, 644); static int enable_slot (struct hotplug_slot *slot); static int disable_slot (struct hotplug_slot *slot); static int set_attention_status (struct hotplug_slot *slot, u8 value); -static int hardware_test (struct hotplug_slot *slot, u32 value); static int get_power_status (struct hotplug_slot *slot, u8 *value); -static int get_attention_status (struct hotplug_slot *slot, u8 *value); static int get_address (struct hotplug_slot *slot, u32 *value); static int get_latch_status (struct hotplug_slot *slot, u8 *value); static int get_adapter_status (struct hotplug_slot *slot, u8 *value); -static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value); -static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value); static struct hotplug_slot_ops acpi_hotplug_slot_ops = { .owner = THIS_MODULE, .enable_slot = enable_slot, .disable_slot = disable_slot, .set_attention_status = set_attention_status, - .hardware_test = hardware_test, .get_power_status = get_power_status, - .get_attention_status = get_attention_status, .get_latch_status = get_latch_status, .get_adapter_status = get_adapter_status, .get_address = get_address, - .get_max_bus_speed = get_max_bus_speed, - .get_cur_bus_speed = get_cur_bus_speed, }; - -/* Inline functions to check the sanity of a pointer that is passed to us */ -static inline int slot_paranoia_check (struct slot *slot, const char *function) -{ - if (!slot) { - dbg("%s - slot == NULL\n", function); - return -1; - } - if (slot->magic != SLOT_MAGIC) { - dbg("%s - bad magic number for slot\n", function); - return -1; - } - if (!slot->hotplug_slot) { - dbg("%s - slot->hotplug_slot == NULL!\n", function); - return -1; - } - return 0; -} - - -static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function) -{ - struct slot *slot; - - if (!hotplug_slot) { - dbg("%s - hotplug_slot == NULL\n", function); - return NULL; - } - - slot = (struct slot *)hotplug_slot->private; - if (slot_paranoia_check(slot, function)) - return NULL; - return slot; -} - - /** * enable_slot - power on and enable a slot * @hotplug_slot: slot to enable @@ -135,20 +88,14 @@ * Actual tasks are done in acpiphp_enable_slot() * */ -static int enable_slot (struct hotplug_slot *hotplug_slot) +static int enable_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* enable the specified slot */ - retval = acpiphp_enable_slot(slot->acpi_slot); - - return retval; + return acpiphp_enable_slot(slot->acpi_slot); } @@ -159,20 +106,14 @@ * Actual tasks are done in acpiphp_disable_slot() * */ -static int disable_slot (struct hotplug_slot *hotplug_slot) +static int disable_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* disable the specified slot */ - retval = acpiphp_disable_slot(slot->acpi_slot); - - return retval; + return acpiphp_disable_slot(slot->acpi_slot); } @@ -184,10 +125,8 @@ * attention status LED. * */ -static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) +static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) { - int retval = 0; - dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); switch (status) { @@ -203,33 +142,9 @@ break; } - return retval; -} - - -/** - * hardware_test - hardware test - * - * We have nothing to do for now... - * - */ -static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value) -{ - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; - - dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - - err("No hardware tests are defined for this driver\n"); - retval = -ENODEV; - - return retval; + return 0; } - /** * get_power_status - get power status of a slot * @hotplug_slot: slot to get status @@ -239,41 +154,17 @@ * In that case, the value returned may not be reliable. * */ -static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); *value = acpiphp_get_power_status(slot->acpi_slot); - return retval; -} - - -/** - * get_attention_status - get attention LED status - * - * TBD: - * ACPI doesn't provide any formal means to access attention LED status. - * - */ -static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value) -{ - int retval = 0; - - dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - - *value = hotplug_slot->info->attention_status; - - return retval; + return 0; } - /** * get_latch_status - get latch status of a slot * @hotplug_slot: slot to get status @@ -283,19 +174,15 @@ * Instead, we fake latch status from _STA * */ -static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); *value = acpiphp_get_latch_status(slot->acpi_slot); - return retval; + return 0; } @@ -308,19 +195,15 @@ * Instead, we fake adapter status from _STA * */ -static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); *value = acpiphp_get_adapter_status(slot->acpi_slot); - return retval; + return 0; } @@ -330,51 +213,18 @@ * @busdev: pointer to struct pci_busdev (seg, bus, dev) * */ -static int get_address (struct hotplug_slot *hotplug_slot, u32 *value) +static int get_address(struct hotplug_slot *hotplug_slot, u32 *value) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); *value = acpiphp_get_address(slot->acpi_slot); - return retval; -} - - -/* return dummy value because ACPI doesn't provide any method... */ -static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) -{ - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; - - *value = PCI_SPEED_UNKNOWN; - - return 0; -} - - -/* return dummy value because ACPI doesn't provide any method... */ -static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) -{ - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; - - *value = PCI_SPEED_UNKNOWN; - return 0; } - -static int __init init_acpi (void) +static int __init init_acpi(void) { int retval; @@ -397,7 +247,7 @@ * @slot: slot to name * */ -static void make_slot_name (struct slot *slot) +static void make_slot_name(struct slot *slot) { snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%u", slot->acpi_slot->sun); @@ -409,10 +259,7 @@ */ static void release_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -426,42 +273,32 @@ * init_slots - initialize 'struct slot' structures for each slot * */ -static int __init init_slots (void) +static int __init init_slots(void) { struct slot *slot; - int retval = 0; + int retval = -ENOMEM; int i; for (i = 0; i < num_slots; ++i) { slot = kmalloc(sizeof(struct slot), GFP_KERNEL); if (!slot) - return -ENOMEM; + goto error; memset(slot, 0, sizeof(struct slot)); slot->hotplug_slot = kmalloc(sizeof(struct hotplug_slot), GFP_KERNEL); - if (!slot->hotplug_slot) { - kfree(slot); - return -ENOMEM; - } + if (!slot->hotplug_slot) + goto error_slot; memset(slot->hotplug_slot, 0, sizeof(struct hotplug_slot)); slot->hotplug_slot->info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL); - if (!slot->hotplug_slot->info) { - kfree(slot->hotplug_slot); - kfree(slot); - return -ENOMEM; - } + if (!slot->hotplug_slot->info) + goto error_hpslot; memset(slot->hotplug_slot->info, 0, sizeof(struct hotplug_slot_info)); slot->hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL); - if (!slot->hotplug_slot->name) { - kfree(slot->hotplug_slot->info); - kfree(slot->hotplug_slot); - kfree(slot); - return -ENOMEM; - } + if (!slot->hotplug_slot->name) + goto error_info; - slot->magic = SLOT_MAGIC; slot->number = i; slot->hotplug_slot->private = slot; @@ -473,14 +310,15 @@ slot->hotplug_slot->info->attention_status = acpiphp_get_attention_status(slot->acpi_slot); slot->hotplug_slot->info->latch_status = acpiphp_get_latch_status(slot->acpi_slot); slot->hotplug_slot->info->adapter_status = acpiphp_get_adapter_status(slot->acpi_slot); + slot->hotplug_slot->info->max_bus_speed = PCI_SPEED_UNKNOWN; + slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN; make_slot_name(slot); retval = pci_hp_register(slot->hotplug_slot); if (retval) { err("pci_hp_register failed with error %d\n", retval); - release_slot(slot->hotplug_slot); - return retval; + goto error_name; } /* add slot to our internal list */ @@ -488,6 +326,16 @@ info("Slot [%s] registered\n", slot->hotplug_slot->name); } + return 0; +error_name: + kfree(slot->hotplug_slot->name); +error_info: + kfree(slot->hotplug_slot->info); +error_hpslot: + kfree(slot->hotplug_slot); +error_slot: + kfree(slot); +error: return retval; } @@ -503,8 +351,6 @@ list_del(&slot->slot_list); pci_hp_deregister(slot->hotplug_slot); } - - return; } @@ -521,11 +367,7 @@ if (retval) return retval; - retval = init_slots(); - if (retval) - return retval; - - return 0; + return init_slots(); } diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c --- a/drivers/pci/hotplug/acpiphp_glue.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/acpiphp_glue.c Tue May 4 22:16:06 2004 @@ -66,7 +66,7 @@ * 4. .. * */ -static int is_ejectable (acpi_handle handle) +static int is_ejectable(acpi_handle handle) { acpi_status status; acpi_handle tmp; @@ -326,10 +326,10 @@ bridge->hpp.enable_PERR = package->package.elements[3].integer.value; dbg("_HPP parameter = (%02x, %02x, %02x, %02x)\n", - bridge->hpp.cache_line_size, - bridge->hpp.latency_timer, - bridge->hpp.enable_SERR, - bridge->hpp.enable_PERR); + bridge->hpp.cache_line_size, + bridge->hpp.latency_timer, + bridge->hpp.enable_SERR, + bridge->hpp.enable_PERR); bridge->flags |= BRIDGE_HAS_HPP; @@ -1180,7 +1180,8 @@ } /* should never happen! */ - err("%s: no object for id %d\n",__FUNCTION__, id); + err("%s: no object for id %d\n", __FUNCTION__, id); + WARN_ON(1); return 0; } diff -Nru a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h --- a/drivers/pci/hotplug/cpci_hotplug.h Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpci_hotplug.h Tue May 4 22:16:06 2004 @@ -40,9 +40,7 @@ #define HS_CSR_EIM 0x0002 #define HS_CSR_DHA 0x0001 -#define SLOT_MAGIC 0x67267322 struct slot { - u32 magic; u8 number; unsigned int devfn; struct pci_bus *bus; diff -Nru a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c --- a/drivers/pci/hotplug/cpci_hotplug_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpci_hotplug_core.c Tue May 4 22:16:06 2004 @@ -94,10 +94,6 @@ dbg("%s - slot == NULL", function); return -1; } - if(slot->magic != SLOT_MAGIC) { - dbg("%s - bad magic number for slot", function); - return -1; - } if(!slot->hotplug_slot) { dbg("%s - slot->hotplug_slot == NULL!", function); return -1; @@ -353,7 +349,6 @@ } hotplug_slot->name = name; - slot->magic = SLOT_MAGIC; slot->bus = bus; slot->number = i; slot->devfn = PCI_DEVFN(i, 0); diff -Nru a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c --- a/drivers/pci/hotplug/cpcihp_generic.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpcihp_generic.c Tue May 4 22:16:06 2004 @@ -76,73 +76,6 @@ static struct cpci_hp_controller_ops generic_hpc_ops; static struct cpci_hp_controller generic_hpc; -/* The following allows configuring the driver when it's compiled into the kernel */ -#ifndef MODULE -static int __init cpcihp_generic_setup(char* str) -{ - char* p; - unsigned long tmp; - - if(!str) - return -EINVAL; - bridge = str; - - p = strchr(str, ','); - str = p + 1; - if(!(p && *str && *p == ',')) - goto setup_error; - tmp = simple_strtoul(str, &p, 0); - if(p == str || tmp > 0xff) { - err("hotplug bus first slot number out of range"); - goto setup_error; - } - first_slot = (u8) tmp; - - str = p + 1; - if(!(*str && *p == ',')) - return -EINVAL; - tmp = simple_strtoul(str, &p, 0); - if(p == str || tmp > 0xff) { - err("hotplug bus last slot number out of range"); - goto setup_error; - } - last_slot = (u8) tmp; - - str = p + 1; - if(!(*str && *p == ',')) - goto setup_error; - tmp = simple_strtoul(str, &p, 0); - if(p == str || tmp > 0xffff) { - err("port number out of range"); - goto setup_error; - } - port = (u16) tmp; - - str = p + 1; - if(!(*str && *p == ',')) - goto setup_error; - tmp = simple_strtoul(str, &p, 0); - if(p == str) { - err("invalid #ENUM bit number"); - goto setup_error; - } - enum_bit = (u8) tmp; - - str = p + 1; - if(*str && *p == ',') { - tmp = simple_strtoul(str, &p, 0); - if(p != str) - debug = (int) tmp; - } - return 0; -setup_error: - bridge = NULL; - return -EINVAL; -} - -__setup("cpcihp_generic=", cpcihp_generic_setup); -#endif - static int __init validate_parameters(void) { char* str; diff -Nru a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c --- a/drivers/pci/hotplug/cpcihp_zt5550.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpcihp_zt5550.c Tue May 4 22:16:06 2004 @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -42,11 +43,7 @@ #define DRIVER_AUTHOR "Scott Murray " #define DRIVER_DESC "ZT5550 CompactPCI Hot Plug Driver" -#if !defined(CONFIG_HOTPLUG_PCI_CPCI_ZT5550_MODULE) #define MY_NAME "cpcihp_zt5550" -#else -#define MY_NAME THIS_MODULE->name -#endif #define dbg(format, arg...) \ do { \ @@ -301,7 +298,7 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "i"); +module_param(debug, bool, 644); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); -MODULE_PARM(poll, "i"); +module_param(poll, bool, 644); MODULE_PARM_DESC(poll, "#ENUM polling mode enabled or not"); diff -Nru a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h --- a/drivers/pci/hotplug/cpqphp.h Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpqphp.h Tue May 4 22:16:06 2004 @@ -33,11 +33,7 @@ #include /* for read? and write? functions */ #include /* for delays */ -#if !defined(CONFIG_HOTPLUG_PCI_COMPAQ_MODULE) - #define MY_NAME "cpqphp.o" -#else - #define MY_NAME THIS_MODULE->name -#endif +#define MY_NAME "cpqphp" #define dbg(fmt, arg...) do { if (cpqhp_debug) printk(KERN_DEBUG "%s: " fmt , MY_NAME , ## arg); } while (0) #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg) @@ -257,9 +253,7 @@ struct pci_dev* pci_dev; }; -#define SLOT_MAGIC 0x67267321 struct slot { - u32 magic; struct slot *next; u8 bus; u8 device; @@ -377,11 +371,8 @@ #define PCISLOT_66_MHZ_SUPPORTED 0x00000100 #define PCISLOT_64_BIT_SUPPORTED 0x00000200 - - #define PCI_TO_PCI_BRIDGE_CLASS 0x00060400 - #define INTERLOCK_OPEN 0x00000002 #define ADD_NOT_SUPPORTED 0x00000003 #define CARD_FUNCTIONING 0x00000005 @@ -453,50 +444,15 @@ extern u8 cpqhp_disk_irq; - /* inline functions */ - -/* Inline functions to check the sanity of a pointer that is passed to us */ -static inline int slot_paranoia_check (struct slot *slot, const char *function) -{ - if (!slot) { - dbg("%s - slot == NULL", function); - return -1; - } - if (slot->magic != SLOT_MAGIC) { - dbg("%s - bad magic number for slot", function); - return -1; - } - if (!slot->hotplug_slot) { - dbg("%s - slot->hotplug_slot == NULL!", function); - return -1; - } - return 0; -} - -static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function) -{ - struct slot *slot; - - if (!hotplug_slot) { - dbg("%s - hotplug_slot == NULL\n", function); - return NULL; - } - - slot = (struct slot *)hotplug_slot->private; - if (slot_paranoia_check (slot, function)) - return NULL; - return slot; -} - /* * return_resource * * Puts node back in the resource list pointed to by head * */ -static inline void return_resource (struct pci_resource **head, struct pci_resource *node) +static inline void return_resource(struct pci_resource **head, struct pci_resource *node) { if (!node || !head) return; @@ -504,7 +460,7 @@ *head = node; } -static inline void set_SOGO (struct controller *ctrl) +static inline void set_SOGO(struct controller *ctrl) { u16 misc; @@ -514,7 +470,7 @@ } -static inline void amber_LED_on (struct controller *ctrl, u8 slot) +static inline void amber_LED_on(struct controller *ctrl, u8 slot) { u32 led_control; @@ -524,7 +480,7 @@ } -static inline void amber_LED_off (struct controller *ctrl, u8 slot) +static inline void amber_LED_off(struct controller *ctrl, u8 slot) { u32 led_control; @@ -534,7 +490,7 @@ } -static inline int read_amber_LED (struct controller *ctrl, u8 slot) +static inline int read_amber_LED(struct controller *ctrl, u8 slot) { u32 led_control; @@ -545,7 +501,7 @@ } -static inline void green_LED_on (struct controller *ctrl, u8 slot) +static inline void green_LED_on(struct controller *ctrl, u8 slot) { u32 led_control; @@ -554,7 +510,7 @@ writel(led_control, ctrl->hpc_reg + LED_CONTROL); } -static inline void green_LED_off (struct controller *ctrl, u8 slot) +static inline void green_LED_off(struct controller *ctrl, u8 slot) { u32 led_control; @@ -564,7 +520,7 @@ } -static inline void green_LED_blink (struct controller *ctrl, u8 slot) +static inline void green_LED_blink(struct controller *ctrl, u8 slot) { u32 led_control; @@ -575,7 +531,7 @@ } -static inline void slot_disable (struct controller *ctrl, u8 slot) +static inline void slot_disable(struct controller *ctrl, u8 slot) { u8 slot_enable; @@ -585,7 +541,7 @@ } -static inline void slot_enable (struct controller *ctrl, u8 slot) +static inline void slot_enable(struct controller *ctrl, u8 slot) { u8 slot_enable; @@ -595,7 +551,7 @@ } -static inline u8 is_slot_enabled (struct controller *ctrl, u8 slot) +static inline u8 is_slot_enabled(struct controller *ctrl, u8 slot) { u8 slot_enable; @@ -605,7 +561,7 @@ } -static inline u8 read_slot_enable (struct controller *ctrl) +static inline u8 read_slot_enable(struct controller *ctrl) { return readb(ctrl->hpc_reg + SLOT_ENABLE); } @@ -619,7 +575,7 @@ * Returns controller speed. * */ -static inline u8 get_controller_speed (struct controller *ctrl) +static inline u8 get_controller_speed(struct controller *ctrl) { u8 curr_freq; u16 misc; @@ -652,7 +608,7 @@ * Returns adapter speed. * */ -static inline u8 get_adapter_speed (struct controller *ctrl, u8 hp_slot) +static inline u8 get_adapter_speed(struct controller *ctrl, u8 hp_slot) { u32 temp_dword = readl(ctrl->hpc_reg + NON_INT_INPUT); dbg("slot: %d, PCIXCAP: %8x\n", hp_slot, temp_dword); @@ -669,7 +625,7 @@ return PCI_SPEED_33MHz; } -static inline void enable_slot_power (struct controller *ctrl, u8 slot) +static inline void enable_slot_power(struct controller *ctrl, u8 slot) { u8 slot_power; @@ -678,7 +634,7 @@ writeb(slot_power, ctrl->hpc_reg + SLOT_POWER); } -static inline void disable_slot_power (struct controller *ctrl, u8 slot) +static inline void disable_slot_power(struct controller *ctrl, u8 slot) { u8 slot_power; @@ -688,40 +644,31 @@ } -static inline int cpq_get_attention_status (struct controller *ctrl, struct slot *slot) +static inline int cpq_get_attention_status(struct controller *ctrl, struct slot *slot) { u8 hp_slot; - if (slot == NULL) - return 1; - hp_slot = slot->device - ctrl->slot_device_offset; - return read_amber_LED (ctrl, hp_slot); + return read_amber_LED(ctrl, hp_slot); } -static inline int get_slot_enabled (struct controller *ctrl, struct slot *slot) +static inline int get_slot_enabled(struct controller *ctrl, struct slot *slot) { u8 hp_slot; - if (slot == NULL) - return 1; - hp_slot = slot->device - ctrl->slot_device_offset; - return is_slot_enabled (ctrl, hp_slot); + return is_slot_enabled(ctrl, hp_slot); } -static inline int cpq_get_latch_status (struct controller *ctrl, struct slot *slot) +static inline int cpq_get_latch_status(struct controller *ctrl, struct slot *slot) { u32 status; u8 hp_slot; - if (slot == NULL) - return 1; - hp_slot = slot->device - ctrl->slot_device_offset; dbg("%s: slot->device = %d, ctrl->slot_device_offset = %d \n", __FUNCTION__, slot->device, ctrl->slot_device_offset); @@ -732,15 +679,12 @@ } -static inline int get_presence_status (struct controller *ctrl, struct slot *slot) +static inline int get_presence_status(struct controller *ctrl, struct slot *slot) { int presence_save = 0; u8 hp_slot; u32 tempdword; - if (slot == NULL) - return 0; - hp_slot = slot->device - ctrl->slot_device_offset; tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); @@ -751,13 +695,13 @@ #define SLOT_NAME_SIZE 10 -static inline void make_slot_name (char *buffer, int buffer_size, struct slot *slot) +static inline void make_slot_name(char *buffer, int buffer_size, struct slot *slot) { - snprintf (buffer, buffer_size, "%d", slot->number); + snprintf(buffer, buffer_size, "%d", slot->number); } -static inline int wait_for_ctrl_irq (struct controller *ctrl) +static inline int wait_for_ctrl_irq(struct controller *ctrl) { DECLARE_WAITQUEUE(wait, current); int retval = 0; @@ -773,139 +717,6 @@ dbg("%s - end\n", __FUNCTION__); return retval; -} - - -/** - * set_controller_speed - set the frequency and/or mode of a specific - * controller segment. - * - * @ctrl: controller to change frequency/mode for. - * @adapter_speed: the speed of the adapter we want to match. - * @hp_slot: the slot number where the adapter is installed. - * - * Returns 0 if we successfully change frequency and/or mode to match the - * adapter speed. - * - */ -static inline u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) -{ - struct slot *slot; - u8 reg; - u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); - u16 reg16; - u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); - - if (ctrl->speed == adapter_speed) - return 0; - - /* We don't allow freq/mode changes if we find another adapter running - * in another slot on this controller */ - for(slot = ctrl->slot; slot; slot = slot->next) { - if (slot->device == (hp_slot + ctrl->slot_device_offset)) - continue; - if (!slot->hotplug_slot && !slot->hotplug_slot->info) - continue; - if (slot->hotplug_slot->info->adapter_status == 0) - continue; - /* If another adapter is running on the same segment but at a - * lower speed/mode, we allow the new adapter to function at - * this rate if supported */ - if (ctrl->speed < adapter_speed) - return 0; - - return 1; - } - - /* If the controller doesn't support freq/mode changes and the - * controller is running at a higher mode, we bail */ - if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability)) - return 1; - - /* But we allow the adapter to run at a lower rate if possible */ - if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability)) - return 0; - - /* We try to set the max speed supported by both the adapter and - * controller */ - if (ctrl->speed_capability < adapter_speed) { - if (ctrl->speed == ctrl->speed_capability) - return 0; - adapter_speed = ctrl->speed_capability; - } - - writel(0x0L, ctrl->hpc_reg + LED_CONTROL); - writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); - - set_SOGO(ctrl); - wait_for_ctrl_irq(ctrl); - - if (adapter_speed != PCI_SPEED_133MHz_PCIX) - reg = 0xF5; - else - reg = 0xF4; - pci_write_config_byte(ctrl->pci_dev, 0x41, reg); - - reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); - reg16 &= ~0x000F; - switch(adapter_speed) { - case(PCI_SPEED_133MHz_PCIX): - reg = 0x75; - reg16 |= 0xB; - break; - case(PCI_SPEED_100MHz_PCIX): - reg = 0x74; - reg16 |= 0xA; - break; - case(PCI_SPEED_66MHz_PCIX): - reg = 0x73; - reg16 |= 0x9; - break; - case(PCI_SPEED_66MHz): - reg = 0x73; - reg16 |= 0x1; - break; - default: /* 33MHz PCI 2.2 */ - reg = 0x71; - break; - - } - reg16 |= 0xB << 12; - writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); - - mdelay(5); - - /* Reenable interrupts */ - writel(0, ctrl->hpc_reg + INT_MASK); - - pci_write_config_byte(ctrl->pci_dev, 0x41, reg); - - /* Restart state machine */ - reg = ~0xF; - pci_read_config_byte(ctrl->pci_dev, 0x43, ®); - pci_write_config_byte(ctrl->pci_dev, 0x43, reg); - - /* Only if mode change...*/ - if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || - ((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) - set_SOGO(ctrl); - - wait_for_ctrl_irq(ctrl); - mdelay(1100); - - /* Restore LED/Slot state */ - writel(leds, ctrl->hpc_reg + LED_CONTROL); - writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); - - set_SOGO(ctrl); - wait_for_ctrl_irq(ctrl); - - ctrl->speed = adapter_speed; - slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); - - info("Successfully changed frequency/mode for adapter in slot %d\n", - slot->number); - return 0; } #endif diff -Nru a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c --- a/drivers/pci/hotplug/cpqphp_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpqphp_core.c Tue May 4 22:16:06 2004 @@ -2,7 +2,7 @@ * Compaq Hot Plug Controller Driver * * Copyright (C) 1995,2001 Compaq Computer Corporation - * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2001 Greg Kroah-Hartman * Copyright (C) 2001 IBM Corp. * * All rights reserved. @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -57,10 +58,10 @@ static void *smbios_table; static void *smbios_start; static void *cpqhp_rom_start; -static u8 power_mode; +static int power_mode; static int debug; -#define DRIVER_VERSION "0.9.7" +#define DRIVER_VERSION "0.9.8" #define DRIVER_AUTHOR "Dan Zink , Greg Kroah-Hartman " #define DRIVER_DESC "Compaq Hot Plug PCI Controller Driver" @@ -68,16 +69,16 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM(power_mode, "b"); +module_param(power_mode, bool, 644); MODULE_PARM_DESC(power_mode, "Power mode enabled or not"); -MODULE_PARM(debug, "i"); +module_param(debug, bool, 644); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); #define CPQHPC_MODULE_MINOR 208 -static int one_time_init (void); -static int set_attention_status (struct hotplug_slot *slot, u8 value); +static int one_time_init (void); +static int set_attention_status (struct hotplug_slot *slot, u8 value); static int process_SI (struct hotplug_slot *slot); static int process_SS (struct hotplug_slot *slot); static int hardware_test (struct hotplug_slot *slot, u32 value); @@ -103,30 +104,18 @@ }; -static inline int is_slot64bit (struct slot *slot) +static inline int is_slot64bit(struct slot *slot) { - if (!slot || !slot->p_sm_slot) - return 0; - - if (readb(slot->p_sm_slot + SMBIOS_SLOT_WIDTH) == 0x06) - return 1; - - return 0; + return (readb(slot->p_sm_slot + SMBIOS_SLOT_WIDTH) == 0x06) ? 1 : 0; } -static inline int is_slot66mhz (struct slot *slot) +static inline int is_slot66mhz(struct slot *slot) { - if (!slot || !slot->p_sm_slot) - return 0; - - if (readb(slot->p_sm_slot + SMBIOS_SLOT_TYPE) == 0x0E) - return 1; - - return 0; + return (readb(slot->p_sm_slot + SMBIOS_SLOT_TYPE) == 0x0E) ? 1 : 0; } /** - * detect_SMBIOS_pointer - find the system Management BIOS Table in the specified region of memory. + * detect_SMBIOS_pointer - find the System Management BIOS Table in mem region. * * @begin: begin pointer for region to be scanned. * @end: end pointer for region to be scanned. @@ -210,7 +199,8 @@ return -ENOMEM; } - len = (routing_table->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); + len = (routing_table->size - sizeof(struct irq_routing_table)) / + sizeof(struct irq_info); // Make sure I got at least one entry if (len == 0) { kfree(routing_table); @@ -231,8 +221,8 @@ } -/* - * get_subsequent_smbios_entry +/** + * get_subsequent_smbios_entry: get the next entry from bios table. * * Gets the first entry if previous == NULL * Otherwise, returns the next entry @@ -242,7 +232,8 @@ * * returns a pointer to an SMBIOS structure or NULL if none found */ -static void * get_subsequent_smbios_entry(void *smbios_start, void *smbios_table, void *curr) +static void *get_subsequent_smbios_entry(void *smbios_start, + void *smbios_table, void *curr) { u8 bail = 0; u8 previous_byte = 1; @@ -259,8 +250,9 @@ p_temp += readb(curr + SMBIOS_GENERIC_LENGTH); while ((p_temp < p_max) && !bail) { - // Look for the double NULL terminator - // The first condition is the previous byte and the second is the curr + /* Look for the double NULL terminator + * The first condition is the previous byte + * and the second is the curr */ if (!previous_byte && !(readb(p_temp))) { bail = 1; } @@ -290,7 +282,8 @@ * * returns a pointer to an SMBIOS structure or %NULL if none found */ -static void *get_SMBIOS_entry (void *smbios_start, void *smbios_table, u8 type, void * previous) +static void *get_SMBIOS_entry(void *smbios_start, void *smbios_table, u8 type, + void * previous) { if (!smbios_table) return NULL; @@ -298,12 +291,14 @@ if (!previous) { previous = smbios_start; } else { - previous = get_subsequent_smbios_entry(smbios_start, smbios_table, previous); + previous = get_subsequent_smbios_entry(smbios_start, + smbios_table, previous); } while (previous) { if (readb(previous + SMBIOS_GENERIC_TYPE) != type) { - previous = get_subsequent_smbios_entry(smbios_start, smbios_table, previous); + previous = get_subsequent_smbios_entry(smbios_start, + smbios_table, previous); } else { break; } @@ -314,11 +309,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return; - + struct slot *slot = hotplug_slot->private; + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); kfree(slot->hotplug_slot->info); @@ -327,7 +319,8 @@ kfree(slot); } -static int ctrl_slot_setup (struct controller * ctrl, void *smbios_start, void *smbios_table) +static int ctrl_slot_setup(struct controller * ctrl, void *smbios_start, + void *smbios_table) { struct slot *new_slot; u8 number_of_slots; @@ -336,7 +329,7 @@ u8 ctrl_slot; u32 tempdword; void *slot_entry= NULL; - int result; + int result = -ENOMEM; dbg("%s\n", __FUNCTION__); @@ -347,44 +340,40 @@ slot_number = ctrl->first_slot; while (number_of_slots) { - new_slot = (struct slot *) kmalloc(sizeof(struct slot), GFP_KERNEL); + new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL); if (!new_slot) - return -ENOMEM; + goto error; memset(new_slot, 0, sizeof(struct slot)); - new_slot->hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL); - if (!new_slot->hotplug_slot) { - kfree (new_slot); - return -ENOMEM; - } - memset(new_slot->hotplug_slot, 0, sizeof (struct hotplug_slot)); + new_slot->hotplug_slot = kmalloc(sizeof(*(new_slot->hotplug_slot)), + GFP_KERNEL); + if (!new_slot->hotplug_slot) + goto error_slot; + memset(new_slot->hotplug_slot, 0, sizeof(struct hotplug_slot)); + + new_slot->hotplug_slot->info = + kmalloc(sizeof(*(new_slot->hotplug_slot->info)), + GFP_KERNEL); + if (!new_slot->hotplug_slot->info) + goto error_hpslot; + memset(new_slot->hotplug_slot->info, 0, + sizeof(struct hotplug_slot_info)); + new_slot->hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL); + if (!new_slot->hotplug_slot->name) + goto error_info; - new_slot->hotplug_slot->info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); - if (!new_slot->hotplug_slot->info) { - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return -ENOMEM; - } - memset(new_slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info)); - new_slot->hotplug_slot->name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL); - if (!new_slot->hotplug_slot->name) { - kfree (new_slot->hotplug_slot->info); - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return -ENOMEM; - } - - new_slot->magic = SLOT_MAGIC; new_slot->ctrl = ctrl; new_slot->bus = ctrl->bus; new_slot->device = slot_device; new_slot->number = slot_number; dbg("slot->number = %d\n",new_slot->number); - slot_entry = get_SMBIOS_entry(smbios_start, smbios_table, 9, slot_entry); + slot_entry = get_SMBIOS_entry(smbios_start, smbios_table, 9, + slot_entry); while (slot_entry && (readw(slot_entry + SMBIOS_SLOT_NUMBER) != new_slot->number)) { - slot_entry = get_SMBIOS_entry(smbios_start, smbios_table, 9, slot_entry); + slot_entry = get_SMBIOS_entry(smbios_start, + smbios_table, 9, slot_entry); } new_slot->p_sm_slot = slot_entry; @@ -417,7 +406,7 @@ /* register this slot with the hotplug pci core */ new_slot->hotplug_slot->release = &release_slot; new_slot->hotplug_slot->private = new_slot; - make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot); + make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot); new_slot->hotplug_slot->ops = &cpqphp_hotplug_slot_ops; new_slot->hotplug_slot->info->power_status = get_slot_enabled(ctrl, new_slot); @@ -425,13 +414,15 @@ new_slot->hotplug_slot->info->latch_status = cpq_get_latch_status(ctrl, new_slot); new_slot->hotplug_slot->info->adapter_status = get_presence_status(ctrl, new_slot); - dbg ("registering bus %d, dev %d, number %d, ctrl->slot_device_offset %d, slot %d\n", - new_slot->bus, new_slot->device, new_slot->number, ctrl->slot_device_offset, slot_number); + dbg ("registering bus %d, dev %d, number %d, " + "ctrl->slot_device_offset %d, slot %d\n", + new_slot->bus, new_slot->device, + new_slot->number, ctrl->slot_device_offset, + slot_number); result = pci_hp_register (new_slot->hotplug_slot); if (result) { err ("pci_hp_register failed with error %d\n", result); - release_slot(new_slot->hotplug_slot); - return result; + goto error_name; } new_slot->next = ctrl->slot; @@ -443,6 +434,17 @@ } return 0; + +error_name: + kfree(new_slot->hotplug_slot->name); +error_info: + kfree(new_slot->hotplug_slot->info); +error_hpslot: + kfree(new_slot->hotplug_slot); +error_slot: + kfree(new_slot); +error: + return result; } static int ctrl_slot_cleanup (struct controller * ctrl) @@ -485,7 +487,8 @@ // // Output: SUCCESS or FAILURE //============================================================================= -static int get_slot_mapping (struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) +static int +get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) { struct irq_routing_table *PCIIRQRoutingInfoLength; u32 work; @@ -520,17 +523,22 @@ kfree(PCIIRQRoutingInfoLength); return 0; } else { - // Didn't get a match on the target PCI device. Check if the - // current IRQ table entry is a PCI-to-PCI bridge device. If so, - // and it's secondary bus matches the bus number for the target - // device, I need to save the bridge's slot number. If I can't - // find an entry for the target device, I will have to assume it's - // on the other side of the bridge, and assign it the bridge's slot. + /* Did not get a match on the target PCI device. Check + * if the current IRQ table entry is a PCI-to-PCI bridge + * device. If so, and it's secondary bus matches the + * bus number for the target device, I need to save the + * bridge's slot number. If I can not find an entry for + * the target device, I will have to assume it's on the + * other side of the bridge, and assign it the bridge's + * slot. */ bus->number = tbus; - pci_bus_read_config_dword (bus, PCI_DEVFN(tdevice, 0), PCI_REVISION_ID, &work); + pci_bus_read_config_dword(bus, PCI_DEVFN(tdevice, 0), + PCI_REVISION_ID, &work); if ((work >> 8) == PCI_TO_PCI_BRIDGE_CLASS) { - pci_bus_read_config_dword (bus, PCI_DEVFN(tdevice, 0), PCI_PRIMARY_BUS, &work); + pci_bus_read_config_dword(bus, + PCI_DEVFN(tdevice, 0), + PCI_PRIMARY_BUS, &work); // See if bridge's secondary bus matches target bus. if (((work >> 8) & 0x000000FF) == (long) bus_num) { bridgeSlot = tslot; @@ -559,7 +567,9 @@ * cpqhp_set_attention_status - Turns the Amber LED for a slot on or off * */ -static int cpqhp_set_attention_status (struct controller *ctrl, struct pci_func *func, u32 status) +static int +cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func, + u32 status) { u8 hp_slot; @@ -600,22 +610,15 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) { struct pci_func *slot_func; - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; u8 bus; u8 devfn; u8 device; u8 function; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) return -ENODEV; @@ -624,33 +627,25 @@ dbg("bus, dev, fn = %d, %d, %d\n", bus, device, function); slot_func = cpqhp_slot_find(bus, device, function); - if (!slot_func) { + if (!slot_func) return -ENODEV; - } return cpqhp_set_attention_status(ctrl, slot_func, status); } -static int process_SI (struct hotplug_slot *hotplug_slot) +static int process_SI(struct hotplug_slot *hotplug_slot) { struct pci_func *slot_func; - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; u8 bus; u8 devfn; u8 device; u8 function; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) return -ENODEV; @@ -659,9 +654,8 @@ dbg("bus, dev, fn = %d, %d, %d\n", bus, device, function); slot_func = cpqhp_slot_find(bus, device, function); - if (!slot_func) { + if (!slot_func) return -ENODEV; - } slot_func->bus = bus; slot_func->device = device; @@ -672,25 +666,18 @@ } -static int process_SS (struct hotplug_slot *hotplug_slot) +static int process_SS(struct hotplug_slot *hotplug_slot) { struct pci_func *slot_func; - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; u8 bus; u8 devfn; u8 device; u8 function; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) return -ENODEV; @@ -699,121 +686,78 @@ dbg("bus, dev, fn = %d, %d, %d\n", bus, device, function); slot_func = cpqhp_slot_find(bus, device, function); - if (!slot_func) { + if (!slot_func) return -ENODEV; - } - - dbg("In power_down_board, slot_func = %p, ctrl = %p\n", slot_func, ctrl); + + dbg("In %s, slot_func = %p, ctrl = %p\n", __FUNCTION__, slot_func, ctrl); return cpqhp_process_SS(ctrl, slot_func); } -static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value) +static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - if (slot == NULL) - return -ENODEV; - - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - - return cpqhp_hardware_test (ctrl, value); + return cpqhp_hardware_test(ctrl, value); } -static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; - - if (slot == NULL) - return -ENODEV; - + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - *value = get_slot_enabled(ctrl, slot); return 0; } -static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - *value = cpq_get_attention_status(ctrl, slot); return 0; } -static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; - - if (slot == NULL) - return -ENODEV; - + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - - *value = cpq_get_latch_status (ctrl, slot); + *value = cpq_get_latch_status(ctrl, slot); return 0; } -static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - - *value = get_presence_status (ctrl, slot); + *value = get_presence_status(ctrl, slot); return 0; } static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - *value = ctrl->speed_capability; return 0; @@ -821,18 +765,11 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - struct controller *ctrl; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; + struct controller *ctrl = slot->ctrl; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - ctrl = slot->ctrl; - if (ctrl == NULL) - return -ENODEV; - *value = ctrl->speed; return 0; @@ -908,11 +845,11 @@ case PCI_VENDOR_ID_COMPAQ: if (rev >= 0x13) { /* CIOBX */ ctrl->push_flag = 1; - ctrl->slot_switch_type = 1; // Switch is present - ctrl->push_button = 1; // Pushbutton is present - ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported - ctrl->defeature_PHP = 1; // PHP is supported - ctrl->pcix_support = 1; // PCI-X supported + ctrl->slot_switch_type = 1; + ctrl->push_button = 1; + ctrl->pci_config_space = 1; + ctrl->defeature_PHP = 1; + ctrl->pcix_support = 1; ctrl->pcix_speed_capability = 1; pci_read_config_byte(pdev, 0x41, &bus_cap); if (bus_cap & 0x80) { @@ -942,55 +879,55 @@ switch (subsystem_deviceid) { case PCI_SUB_HPC_ID: /* Original 6500/7000 implementation */ - ctrl->slot_switch_type = 1; // Switch is present + ctrl->slot_switch_type = 1; ctrl->speed_capability = PCI_SPEED_33MHz; - ctrl->push_button = 0; // No pushbutton - ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported - ctrl->defeature_PHP = 1; // PHP is supported - ctrl->pcix_support = 0; // PCI-X not supported - ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported + ctrl->push_button = 0; + ctrl->pci_config_space = 1; + ctrl->defeature_PHP = 1; + ctrl->pcix_support = 0; + ctrl->pcix_speed_capability = 0; break; case PCI_SUB_HPC_ID2: /* First Pushbutton implementation */ ctrl->push_flag = 1; - ctrl->slot_switch_type = 1; // Switch is present + ctrl->slot_switch_type = 1; ctrl->speed_capability = PCI_SPEED_33MHz; - ctrl->push_button = 1; // Pushbutton is present - ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported - ctrl->defeature_PHP = 1; // PHP is supported - ctrl->pcix_support = 0; // PCI-X not supported - ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported + ctrl->push_button = 1; + ctrl->pci_config_space = 1; + ctrl->defeature_PHP = 1; + ctrl->pcix_support = 0; + ctrl->pcix_speed_capability = 0; break; case PCI_SUB_HPC_ID_INTC: /* Third party (6500/7000) */ - ctrl->slot_switch_type = 1; // Switch is present + ctrl->slot_switch_type = 1; ctrl->speed_capability = PCI_SPEED_33MHz; - ctrl->push_button = 0; // No pushbutton - ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported - ctrl->defeature_PHP = 1; // PHP is supported - ctrl->pcix_support = 0; // PCI-X not supported - ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported + ctrl->push_button = 0; + ctrl->pci_config_space = 1; + ctrl->defeature_PHP = 1; + ctrl->pcix_support = 0; + ctrl->pcix_speed_capability = 0; break; case PCI_SUB_HPC_ID3: /* First 66 Mhz implementation */ ctrl->push_flag = 1; - ctrl->slot_switch_type = 1; // Switch is present + ctrl->slot_switch_type = 1; ctrl->speed_capability = PCI_SPEED_66MHz; - ctrl->push_button = 1; // Pushbutton is present - ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported - ctrl->defeature_PHP = 1; // PHP is supported - ctrl->pcix_support = 0; // PCI-X not supported - ctrl->pcix_speed_capability = 0; // N/A since PCI-X not supported + ctrl->push_button = 1; + ctrl->pci_config_space = 1; + ctrl->defeature_PHP = 1; + ctrl->pcix_support = 0; + ctrl->pcix_speed_capability = 0; break; case PCI_SUB_HPC_ID4: /* First PCI-X implementation, 100MHz */ ctrl->push_flag = 1; - ctrl->slot_switch_type = 1; // Switch is present + ctrl->slot_switch_type = 1; ctrl->speed_capability = PCI_SPEED_100MHz_PCIX; - ctrl->push_button = 1; // Pushbutton is present - ctrl->pci_config_space = 1; // Index/data access to working registers 0 = not supported, 1 = supported - ctrl->defeature_PHP = 1; // PHP is supported - ctrl->pcix_support = 1; // PCI-X supported + ctrl->push_button = 1; + ctrl->pci_config_space = 1; + ctrl->defeature_PHP = 1; + ctrl->pcix_support = 1; ctrl->pcix_speed_capability = 0; break; default: @@ -1079,33 +1016,41 @@ } // Tell the user that we found one. - info("Initializing the PCI hot plug controller residing on PCI bus %d\n", pdev->bus->number); + info("Initializing the PCI hot plug controller residing on PCI bus %d\n", + pdev->bus->number); - dbg ("Hotplug controller capabilities:\n"); - dbg (" speed_capability %d\n", ctrl->speed_capability); - dbg (" slot_switch_type %s\n", ctrl->slot_switch_type == 0 ? "no switch" : "switch present"); - dbg (" defeature_PHP %s\n", ctrl->defeature_PHP == 0 ? "PHP not supported" : "PHP supported"); - dbg (" alternate_base_address %s\n", ctrl->alternate_base_address == 0 ? "not supported" : "supported"); - dbg (" pci_config_space %s\n", ctrl->pci_config_space == 0 ? "not supported" : "supported"); - dbg (" pcix_speed_capability %s\n", ctrl->pcix_speed_capability == 0 ? "not supported" : "supported"); - dbg (" pcix_support %s\n", ctrl->pcix_support == 0 ? "not supported" : "supported"); + dbg("Hotplug controller capabilities:\n"); + dbg(" speed_capability %d\n", ctrl->speed_capability); + dbg(" slot_switch_type %s\n", ctrl->slot_switch_type ? + "switch present" : "no switch"); + dbg(" defeature_PHP %s\n", ctrl->defeature_PHP ? + "PHP supported" : "PHP not supported"); + dbg(" alternate_base_address %s\n", ctrl->alternate_base_address ? + "supported" : "not supported"); + dbg(" pci_config_space %s\n", ctrl->pci_config_space ? + "supported" : "not supported"); + dbg(" pcix_speed_capability %s\n", ctrl->pcix_speed_capability ? + "supported" : "not supported"); + dbg(" pcix_support %s\n", ctrl->pcix_support ? + "supported" : "not supported"); ctrl->pci_dev = pdev; pci_set_drvdata(pdev, ctrl); - /* make our own copy of the pci bus structure, as we like tweaking it a lot */ - ctrl->pci_bus = kmalloc (sizeof (*ctrl->pci_bus), GFP_KERNEL); + /* make our own copy of the pci bus structure, + * as we like tweaking it a lot */ + ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL); if (!ctrl->pci_bus) { err("out of memory\n"); rc = -ENOMEM; goto err_free_ctrl; } - memcpy (ctrl->pci_bus, pdev->bus, sizeof (*ctrl->pci_bus)); + memcpy(ctrl->pci_bus, pdev->bus, sizeof(*ctrl->pci_bus)); ctrl->bus = pdev->bus->number; ctrl->rev = rev; dbg("bus device function rev: %d %d %d %d\n", ctrl->bus, - PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev); + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev); init_MUTEX(&ctrl->crit_sect); init_waitqueue_head(&ctrl->queue); @@ -1127,9 +1072,12 @@ goto err_free_bus; } - ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); + ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0), + pci_resource_len(pdev, 0)); if (!ctrl->hpc_reg) { - err("cannot remap MMIO region %lx @ %lx\n", pci_resource_len(pdev, 0), pci_resource_start(pdev, 0)); + err("cannot remap MMIO region %lx @ %lx\n", + pci_resource_len(pdev, 0), + pci_resource_start(pdev, 0)); rc = -ENODEV; goto err_free_mem_region; } @@ -1138,21 +1086,25 @@ ctrl->speed = get_controller_speed(ctrl); - //************************************************** - // - // Save configuration headers for this and - // subordinate PCI buses - // - //************************************************** + /******************************************************** + * + * Save configuration headers for this and + * subordinate PCI buses + * + ********************************************************/ // find the physical slot number of the first hot plug slot - // Get slot won't work for devices behind bridges, but - // in this case it will always be called for the "base" - // bus/dev/func of a slot. - // CS: this is leveraging the PCIIRQ routing code from the kernel (pci-pc.c: get_irq_routing_table) - rc = get_slot_mapping(ctrl->pci_bus, pdev->bus->number, (readb(ctrl->hpc_reg + SLOT_MASK) >> 4), &(ctrl->first_slot)); - dbg("get_slot_mapping: first_slot = %d, returned = %d\n", ctrl->first_slot, rc); + /* Get slot won't work for devices behind bridges, but + * in this case it will always be called for the "base" + * bus/dev/func of a slot. + * CS: this is leveraging the PCIIRQ routing code from the kernel + * (pci-pc.c: get_irq_routing_table) */ + rc = get_slot_mapping(ctrl->pci_bus, pdev->bus->number, + (readb(ctrl->hpc_reg + SLOT_MASK) >> 4), + &(ctrl->first_slot)); + dbg("get_slot_mapping: first_slot = %d, returned = %d\n", + ctrl->first_slot, rc); if (rc) { err(msg_initialization_err, rc); goto err_iounmap; @@ -1161,7 +1113,8 @@ // Store PCI Config Space for all devices on this bus rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK)); if (rc) { - err("%s: unable to save PCI configuration data, error %d\n", __FUNCTION__, rc); + err("%s: unable to save PCI configuration data, error %d\n", + __FUNCTION__, rc); goto err_iounmap; } @@ -1198,7 +1151,8 @@ rc = ctrl_slot_setup(ctrl, smbios_start, smbios_table); if (rc) { err(msg_initialization_err, 6); - err("%s: unable to save PCI configuration data, error %d\n", __FUNCTION__, rc); + err("%s: unable to save PCI configuration data, error %d\n", + __FUNCTION__, rc); goto err_iounmap; } @@ -1209,7 +1163,8 @@ dbg("HPC interrupt = %d \n", ctrl->interrupt); if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, SA_SHIRQ, MY_NAME, ctrl)) { - err("Can't get irq %d for the hotplug pci controller\n", ctrl->interrupt); + err("Can't get irq %d for the hotplug pci controller\n", + ctrl->interrupt); rc = -ENODEV; goto err_iounmap; } @@ -1265,8 +1220,8 @@ if (!power_mode) { if (!func->is_a_board) { - green_LED_off (ctrl, hp_slot); - slot_disable (ctrl, hp_slot); + green_LED_off(ctrl, hp_slot); + slot_disable(ctrl, hp_slot); } } @@ -1277,7 +1232,7 @@ if (!power_mode) { set_SOGO(ctrl); // Wait for SOBS to be unset - wait_for_ctrl_irq (ctrl); + wait_for_ctrl_irq(ctrl); } rc = init_SERR(ctrl); @@ -1290,7 +1245,7 @@ // Done with exclusive hardware access up(&ctrl->crit_sect); - cpqhp_create_ctrl_files (ctrl); + cpqhp_create_ctrl_files(ctrl); return 0; @@ -1350,35 +1305,36 @@ compaq_nvram_init(cpqhp_rom_start); /* Map smbios table entry point structure */ - smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start, cpqhp_rom_start + ROM_PHY_LEN); + smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start, + cpqhp_rom_start + ROM_PHY_LEN); if (!smbios_table) { err ("Could not find the SMBIOS pointer in memory\n"); retval = -EIO; - goto error; + goto error_rom_start; } - smbios_start = ioremap(readl(smbios_table + ST_ADDRESS), readw(smbios_table + ST_LENGTH)); + smbios_start = ioremap(readl(smbios_table + ST_ADDRESS), + readw(smbios_table + ST_LENGTH)); if (!smbios_start) { err ("Could not ioremap memory region taken from SMBIOS values\n"); retval = -EIO; - goto error; + goto error_smbios_start; } initialized = 1; return retval; +error_smbios_start: + iounmap(smbios_start); +error_rom_start: + iounmap(cpqhp_rom_start); error: - if (cpqhp_rom_start) - iounmap(cpqhp_rom_start); - if (smbios_start) - iounmap(smbios_start); - return retval; } -static void unload_cpqphpd(void) +static void __exit unload_cpqphpd(void) { struct pci_func *next; struct pci_func *TempSlot; @@ -1512,7 +1468,7 @@ static struct pci_driver cpqhpc_driver = { - .name = "pci_hotplug", + .name = "compaq_pci_hotplug", .id_table = hpcd_pci_tbl, .probe = cpqhpc_probe, /* remove: cpqhpc_remove_one, */ @@ -1526,12 +1482,10 @@ cpqhp_debug = debug; + info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); result = pci_module_init(&cpqhpc_driver); dbg("pci_module_init = %d\n", result); - if (result) - return result; - info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); - return 0; + return result; } diff -Nru a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c --- a/drivers/pci/hotplug/cpqphp_ctrl.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpqphp_ctrl.c Tue May 4 22:16:06 2004 @@ -39,8 +39,10 @@ #include #include "cpqphp.h" -static u32 configure_new_device(struct controller* ctrl, struct pci_func *func,u8 behind_bridge, struct resource_lists *resources); -static int configure_new_function(struct controller* ctrl, struct pci_func *func,u8 behind_bridge, struct resource_lists *resources); +static u32 configure_new_device(struct controller* ctrl, struct pci_func *func, + u8 behind_bridge, struct resource_lists *resources); +static int configure_new_function(struct controller* ctrl, struct pci_func *func, + u8 behind_bridge, struct resource_lists *resources); static void interrupt_event_handler(struct controller *ctrl); static struct semaphore event_semaphore; /* mutex for process loop (up if something to process) */ @@ -53,7 +55,7 @@ static wait_queue_head_t delay_wait; /* delay is in jiffies to wait for */ -static void long_delay (int delay) +static void long_delay(int delay) { DECLARE_WAITQUEUE(wait, current); @@ -64,7 +66,7 @@ */ down (&delay_sem); - init_waitqueue_head (&delay_wait); + init_waitqueue_head(&delay_wait); add_wait_queue(&delay_wait, &wait); set_current_state(TASK_INTERRUPTIBLE); @@ -72,11 +74,11 @@ remove_wait_queue(&delay_wait, &wait); set_current_state(TASK_RUNNING); - up (&delay_sem); + up(&delay_sem); } -//FIXME: The following line needs to be somewhere else... +/* FIXME: The following line needs to be somewhere else... */ #define WRONG_BUS_FREQUENCY 0x07 static u8 handle_switch_change(u8 change, struct controller * ctrl) { @@ -89,18 +91,19 @@ if (!change) return 0; - // Switch Change + /* Switch Change */ dbg("cpqsbd: Switch interrupt received.\n"); for (hp_slot = 0; hp_slot < 6; hp_slot++) { if (change & (0x1L << hp_slot)) { - //********************************* - // this one changed. - //********************************* - func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0); + /********************************** + * this one changed. + **********************************/ + func = cpqhp_slot_find(ctrl->bus, + (hp_slot + ctrl->slot_device_offset), 0); - //this is the structure that tells the worker thread - //what to do + /* this is the structure that tells the worker thread + *what to do */ taskInfo = &(ctrl->event_queue[ctrl->next_event]); ctrl->next_event = (ctrl->next_event + 1) % 10; taskInfo->hp_slot = hp_slot; @@ -112,17 +115,17 @@ func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { - //********************************* - // Switch opened - //********************************* + /********************************** + * Switch opened + **********************************/ func->switch_save = 0; taskInfo->event_type = INT_SWITCH_OPEN; } else { - //********************************* - // Switch closed - //********************************* + /********************************** + * Switch closed + **********************************/ func->switch_save = 0x10; @@ -134,18 +137,14 @@ return rc; } - -/* - * cpqhp_find_slot +/** + * cpqhp_find_slot: find the struct slot of given device + * @ctrl: scan lots of this controller + * @device: the device id to find */ -struct slot *cpqhp_find_slot (struct controller * ctrl, u8 device) +struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device) { - struct slot *slot; - - if (!ctrl) - return NULL; - - slot = ctrl->slot; + struct slot *slot = ctrl->slot; while (slot && (slot->device != device)) { slot = slot->next; @@ -168,18 +167,19 @@ if (!change) return 0; - //********************************* - // Presence Change - //********************************* + /********************************** + * Presence Change + **********************************/ dbg("cpqsbd: Presence/Notify input change.\n"); dbg(" Changed bits are 0x%4.4x\n", change ); for (hp_slot = 0; hp_slot < 6; hp_slot++) { if (change & (0x0101 << hp_slot)) { - //********************************* - // this one changed. - //********************************* - func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0); + /********************************** + * this one changed. + **********************************/ + func = cpqhp_slot_find(ctrl->bus, + (hp_slot + ctrl->slot_device_offset), 0); taskInfo = &(ctrl->event_queue[ctrl->next_event]); ctrl->next_event = (ctrl->next_event + 1) % 10; @@ -191,55 +191,51 @@ if (!p_slot) return 0; - // If the switch closed, must be a button - // If not in button mode, nevermind + /* If the switch closed, must be a button + * If not in button mode, nevermind */ if (func->switch_save && (ctrl->push_button == 1)) { temp_word = ctrl->ctrl_int_comp >> 16; temp_byte = (temp_word >> hp_slot) & 0x01; temp_byte |= (temp_word >> (hp_slot + 7)) & 0x02; if (temp_byte != func->presence_save) { - //********************************* - // button Pressed (doesn't do anything) - //********************************* + /************************************** + * button Pressed (doesn't do anything) + **************************************/ dbg("hp_slot %d button pressed\n", hp_slot); taskInfo->event_type = INT_BUTTON_PRESS; } else { - //********************************* - // button Released - TAKE ACTION!!!! - //********************************* + /********************************** + * button Released - TAKE ACTION!!!! + **********************************/ dbg("hp_slot %d button released\n", hp_slot); taskInfo->event_type = INT_BUTTON_RELEASE; - // Cancel if we are still blinking + /* Cancel if we are still blinking */ if ((p_slot->state == BLINKINGON_STATE) || (p_slot->state == BLINKINGOFF_STATE)) { taskInfo->event_type = INT_BUTTON_CANCEL; dbg("hp_slot %d button cancel\n", hp_slot); } else if ((p_slot->state == POWERON_STATE) || (p_slot->state == POWEROFF_STATE)) { - //info(msg_button_ignore, p_slot->number); + /* info(msg_button_ignore, p_slot->number); */ taskInfo->event_type = INT_BUTTON_IGNORE; dbg("hp_slot %d button ignore\n", hp_slot); } } } else { - // Switch is open, assume a presence change - // Save the presence state + /* Switch is open, assume a presence change + * Save the presence state */ temp_word = ctrl->ctrl_int_comp >> 16; func->presence_save = (temp_word >> hp_slot) & 0x01; func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; if ((!(ctrl->ctrl_int_comp & (0x010000 << hp_slot))) || (!(ctrl->ctrl_int_comp & (0x01000000 << hp_slot)))) { - //********************************* - // Present - //********************************* + /* Present */ taskInfo->event_type = INT_PRESENCE_ON; } else { - //********************************* - // Not Present - //********************************* + /* Not Present */ taskInfo->event_type = INT_PRESENCE_OFF; } } @@ -260,18 +256,19 @@ if (!change) return 0; - //********************************* - // power fault - //********************************* + /********************************** + * power fault + **********************************/ info("power fault interrupt\n"); for (hp_slot = 0; hp_slot < 6; hp_slot++) { if (change & (0x01 << hp_slot)) { - //********************************* - // this one changed. - //********************************* - func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0); + /********************************** + * this one changed. + **********************************/ + func = cpqhp_slot_find(ctrl->bus, + (hp_slot + ctrl->slot_device_offset), 0); taskInfo = &(ctrl->event_queue[ctrl->next_event]); ctrl->next_event = (ctrl->next_event + 1) % 10; @@ -280,16 +277,16 @@ rc++; if (ctrl->ctrl_int_comp & (0x00000100 << hp_slot)) { - //********************************* - // power fault Cleared - //********************************* + /********************************** + * power fault Cleared + **********************************/ func->status = 0x00; taskInfo->event_type = INT_POWER_FAULT_CLEAR; } else { - //********************************* - // power fault - //********************************* + /********************************** + * power fault + **********************************/ taskInfo->event_type = INT_POWER_FAULT; if (ctrl->rev < 4) { @@ -297,18 +294,20 @@ green_LED_off (ctrl, hp_slot); set_SOGO (ctrl); - // this is a fatal condition, we want to crash the - // machine to protect from data corruption - // simulated_NMI shouldn't ever return - //FIXME - //simulated_NMI(hp_slot, ctrl); - - //The following code causes a software crash just in - //case simulated_NMI did return - //FIXME - //panic(msg_power_fault); + /* this is a fatal condition, we want + * to crash the machine to protect from + * data corruption. simulated_NMI + * shouldn't ever return */ + /* FIXME + simulated_NMI(hp_slot, ctrl); */ + + /* The following code causes a software + * crash just in case simulated_NMI did + * return */ + /*FIXME + panic(msg_power_fault); */ } else { - // set power fault status for this board + /* set power fault status for this board */ func->status = 0xFF; info("power fault bit %x set\n", hp_slot); } @@ -320,11 +319,9 @@ } -/* - * sort_by_size - * - * Sorts nodes on the list by their length. - * Smallest first. +/** + * sort_by_size: sort nodes on the list by their length, smallest first. + * @head: list to sort * */ static int sort_by_size(struct pci_resource **head) @@ -334,15 +331,15 @@ int out_of_order = 1; if (!(*head)) - return(1); + return 1; if (!((*head)->next)) - return(0); + return 0; while (out_of_order) { out_of_order = 0; - // Special case for swapping list head + /* Special case for swapping list head */ if (((*head)->next) && ((*head)->length > (*head)->next->length)) { out_of_order++; @@ -365,17 +362,15 @@ } else current_res = current_res->next; } - } // End of out_of_order loop + } /* End of out_of_order loop */ - return(0); + return 0; } -/* - * sort_by_max_size - * - * Sorts nodes on the list by their length. - * Largest first. +/** + * sort_by_max_size: sort nodes on the list by their length, largest first. + * @head: list to sort * */ static int sort_by_max_size(struct pci_resource **head) @@ -385,15 +380,15 @@ int out_of_order = 1; if (!(*head)) - return(1); + return 1; if (!((*head)->next)) - return(0); + return 0; while (out_of_order) { out_of_order = 0; - // Special case for swapping list head + /* Special case for swapping list head */ if (((*head)->next) && ((*head)->length < (*head)->next->length)) { out_of_order++; @@ -416,19 +411,18 @@ } else current_res = current_res->next; } - } // End of out_of_order loop + } /* End of out_of_order loop */ - return(0); + return 0; } -/* - * do_pre_bridge_resource_split - * - * Returns zero or one node of resources that aren't in use +/** + * do_pre_bridge_resource_split: find node of resources that are unused * */ -static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **head, struct pci_resource **orig_head, u32 alignment) +static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **head, + struct pci_resource **orig_head, u32 alignment) { struct pci_resource *prevnode = NULL; struct pci_resource *node; @@ -438,32 +432,32 @@ dbg("do_pre_bridge_resource_split\n"); if (!(*head) || !(*orig_head)) - return(NULL); + return NULL; rc = cpqhp_resource_sort_and_combine(head); if (rc) - return(NULL); + return NULL; if ((*head)->base != (*orig_head)->base) - return(NULL); + return NULL; if ((*head)->length == (*orig_head)->length) - return(NULL); + return NULL; - // If we got here, there the bridge requires some of the resource, but - // we may be able to split some off of the front + /* If we got here, there the bridge requires some of the resource, but + * we may be able to split some off of the front */ node = *head; if (node->length & (alignment -1)) { - // this one isn't an aligned length, so we'll make a new entry - // and split it up. - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + /* this one isn't an aligned length, so we'll make a new entry + * and split it up. */ + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; temp_dword = (node->length | (alignment-1)) + 1 - alignment; @@ -473,52 +467,45 @@ node->length -= temp_dword; node->base += split_node->length; - // Put it in the list + /* Put it in the list */ *head = split_node; split_node->next = node; } - if (node->length < alignment) { - return(NULL); - } + if (node->length < alignment) + return NULL; - // Now unlink it + /* Now unlink it */ if (*head == node) { *head = node->next; - node->next = NULL; } else { prevnode = *head; while (prevnode->next != node) prevnode = prevnode->next; prevnode->next = node->next; - node->next = NULL; } + node->next = NULL; - return(node); + return node; } -/* - * do_bridge_resource_split - * - * Returns zero or one node of resources that aren't in use +/** + * do_bridge_resource_split: find one node of resources that aren't in use * */ -static struct pci_resource *do_bridge_resource_split (struct pci_resource **head, u32 alignment) +static struct pci_resource *do_bridge_resource_split(struct pci_resource **head, u32 alignment) { struct pci_resource *prevnode = NULL; struct pci_resource *node; u32 rc; u32 temp_dword; - if (!(*head)) - return(NULL); - rc = cpqhp_resource_sort_and_combine(head); if (rc) - return(NULL); + return NULL; node = *head; @@ -528,44 +515,41 @@ kfree(prevnode); } - if (node->length < alignment) { - kfree(node); - return(NULL); - } + if (node->length < alignment) + goto error; if (node->base & (alignment - 1)) { - // Short circuit if adjusted size is too small + /* Short circuit if adjusted size is too small */ temp_dword = (node->base | (alignment-1)) + 1; - if ((node->length - (temp_dword - node->base)) < alignment) { - kfree(node); - return(NULL); - } + if ((node->length - (temp_dword - node->base)) < alignment) + goto error; node->length -= (temp_dword - node->base); node->base = temp_dword; } - if (node->length & (alignment - 1)) { - // There's stuff in use after this node - kfree(node); - return(NULL); - } - - return(node); + if (node->length & (alignment - 1)) + /* There's stuff in use after this node */ + goto error; + + return node; +error: + kfree(node); + return NULL; } -/* - * get_io_resource +/** + * get_io_resource: find first node of given size not in ISA aliasing window. + * @head: list to search + * @size: size of node to find, must be a power of two. * - * this function sorts the resource list by size and then - * returns the first node of "size" length that is not in the - * ISA aliasing window. If it finds a node larger than "size" - * it will split it up. + * Description: this function sorts the resource list by size and then returns + * returns the first node of "size" length that is not in the ISA aliasing + * window. If it finds a node larger than "size" it will split it up. * - * size must be a power of two. */ -static struct pci_resource *get_io_resource (struct pci_resource **head, u32 size) +static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size) { struct pci_resource *prevnode; struct pci_resource *node; @@ -573,66 +557,66 @@ u32 temp_dword; if (!(*head)) - return(NULL); + return NULL; if ( cpqhp_resource_sort_and_combine(head) ) - return(NULL); + return NULL; if ( sort_by_size(head) ) - return(NULL); + return NULL; for (node = *head; node; node = node->next) { if (node->length < size) continue; if (node->base & (size - 1)) { - // this one isn't base aligned properly - // so we'll make a new entry and split it up + /* this one isn't base aligned properly + * so we'll make a new entry and split it up */ temp_dword = (node->base | (size-1)) + 1; - // Short circuit if adjusted size is too small + /* Short circuit if adjusted size is too small */ if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base; split_node->length = temp_dword - node->base; node->base = temp_dword; node->length -= split_node->length; - // Put it in the list + /* Put it in the list */ split_node->next = node->next; node->next = split_node; - } // End of non-aligned base + } /* End of non-aligned base */ - // Don't need to check if too small since we already did + /* Don't need to check if too small since we already did */ if (node->length > size) { - // this one is longer than we need - // so we'll make a new entry and split it up - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + /* this one is longer than we need + * so we'll make a new entry and split it up */ + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base + size; split_node->length = node->length - size; node->length = size; - // Put it in the list + /* Put it in the list */ split_node->next = node->next; node->next = split_node; - } // End of too big on top end + } /* End of too big on top end */ - // For IO make sure it's not in the ISA aliasing space + /* For IO make sure it's not in the ISA aliasing space */ if (node->base & 0x300L) continue; - // If we got here, then it is the right size - // Now take it out of the list + /* If we got here, then it is the right size + * Now take it out of the list and break */ if (*head == node) { *head = node->next; } else { @@ -643,92 +627,87 @@ prevnode->next = node->next; } node->next = NULL; - // Stop looping break; } - return(node); + return node; } -/* - * get_max_resource +/** + * get_max_resource: get largest node which has at least the given size. + * @head: the list to search the node in + * @size: the minimum size of the node to find * - * Gets the largest node that is at least "size" big from the + * Description: Gets the largest node that is at least "size" big from the * list pointed to by head. It aligns the node on top and bottom * to "size" alignment before returning it. */ -static struct pci_resource *get_max_resource (struct pci_resource **head, u32 size) +static struct pci_resource *get_max_resource(struct pci_resource **head, u32 size) { struct pci_resource *max; struct pci_resource *temp; struct pci_resource *split_node; u32 temp_dword; - if (!(*head)) - return(NULL); - if (cpqhp_resource_sort_and_combine(head)) - return(NULL); + return NULL; if (sort_by_max_size(head)) - return(NULL); - - for (max = *head;max; max = max->next) { + return NULL; - // If not big enough we could probably just bail, - // instead we'll continue to the next. + for (max = *head; max; max = max->next) { + /* If not big enough we could probably just bail, + * instead we'll continue to the next. */ if (max->length < size) continue; if (max->base & (size - 1)) { - // this one isn't base aligned properly - // so we'll make a new entry and split it up + /* this one isn't base aligned properly + * so we'll make a new entry and split it up */ temp_dword = (max->base | (size-1)) + 1; - // Short circuit if adjusted size is too small + /* Short circuit if adjusted size is too small */ if ((max->length - (temp_dword - max->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = max->base; split_node->length = temp_dword - max->base; max->base = temp_dword; max->length -= split_node->length; - // Put it next in the list split_node->next = max->next; max->next = split_node; } if ((max->base + max->length) & (size - 1)) { - // this one isn't end aligned properly at the top - // so we'll make a new entry and split it up - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + /* this one isn't end aligned properly at the top + * so we'll make a new entry and split it up */ + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; temp_dword = ((max->base + max->length) & ~(size - 1)); split_node->base = temp_dword; split_node->length = max->length + max->base - split_node->base; max->length -= split_node->length; - // Put it in the list split_node->next = max->next; max->next = split_node; } - // Make sure it didn't shrink too much when we aligned it + /* Make sure it didn't shrink too much when we aligned it */ if (max->length < size) continue; - // Now take it out of the list - temp = (struct pci_resource*) *head; + /* Now take it out of the list */ + temp = *head; if (temp == max) { *head = max->next; } else { @@ -740,38 +719,36 @@ } max->next = NULL; - return(max); + break; } - // If we get here, we couldn't find one - return(NULL); + return max; } -/* - * get_resource +/** + * get_resource: find resource of given size and split up larger ones. + * @head: the list to search for resources + * @size: the size limit to use * - * this function sorts the resource list by size and then + * Description: This function sorts the resource list by size and then * returns the first node of "size" length. If it finds a node * larger than "size" it will split it up. * * size must be a power of two. */ -static struct pci_resource *get_resource (struct pci_resource **head, u32 size) +static struct pci_resource *get_resource(struct pci_resource **head, u32 size) { struct pci_resource *prevnode; struct pci_resource *node; struct pci_resource *split_node; u32 temp_dword; - if (!(*head)) - return(NULL); - - if ( cpqhp_resource_sort_and_combine(head) ) - return(NULL); + if (cpqhp_resource_sort_and_combine(head)) + return NULL; - if ( sort_by_size(head) ) - return(NULL); + if (sort_by_size(head)) + return NULL; for (node = *head; node; node = node->next) { dbg("%s: req_size =%x node=%p, base=%x, length=%x\n", @@ -781,51 +758,50 @@ if (node->base & (size - 1)) { dbg("%s: not aligned\n", __FUNCTION__); - // this one isn't base aligned properly - // so we'll make a new entry and split it up + /* this one isn't base aligned properly + * so we'll make a new entry and split it up */ temp_dword = (node->base | (size-1)) + 1; - // Short circuit if adjusted size is too small + /* Short circuit if adjusted size is too small */ if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base; split_node->length = temp_dword - node->base; node->base = temp_dword; node->length -= split_node->length; - // Put it in the list split_node->next = node->next; node->next = split_node; - } // End of non-aligned base + } /* End of non-aligned base */ - // Don't need to check if too small since we already did + /* Don't need to check if too small since we already did */ if (node->length > size) { dbg("%s: too big\n", __FUNCTION__); - // this one is longer than we need - // so we'll make a new entry and split it up - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + /* this one is longer than we need + * so we'll make a new entry and split it up */ + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base + size; split_node->length = node->length - size; node->length = size; - // Put it in the list + /* Put it in the list */ split_node->next = node->next; node->next = split_node; - } // End of too big on top end + } /* End of too big on top end */ dbg("%s: got one!!!\n", __FUNCTION__); - // If we got here, then it is the right size - // Now take it out of the list + /* If we got here, then it is the right size + * Now take it out of the list */ if (*head == node) { *head = node->next; } else { @@ -836,17 +812,17 @@ prevnode->next = node->next; } node->next = NULL; - // Stop looping break; } - return(node); + return node; } -/* - * cpqhp_resource_sort_and_combine +/** + * cpqhp_resource_sort_and_combine: sort nodes by base addresses and clean up. + * @head: the list to sort and clean up * - * Sorts all of the nodes in the list in ascending order by + * Description: Sorts all of the nodes in the list in ascending order by * their base addresses. Also does garbage collection by * combining adjacent nodes. * @@ -861,19 +837,19 @@ dbg("%s: head = %p, *head = %p\n", __FUNCTION__, head, *head); if (!(*head)) - return(1); + return 1; dbg("*head->next = %p\n",(*head)->next); if (!(*head)->next) - return(0); /* only one item on the list, already sorted! */ + return 0; /* only one item on the list, already sorted! */ dbg("*head->base = 0x%x\n",(*head)->base); dbg("*head->next->base = 0x%x\n",(*head)->next->base); while (out_of_order) { out_of_order = 0; - // Special case for swapping list head + /* Special case for swapping list head */ if (((*head)->next) && ((*head)->base > (*head)->next->base)) { node1 = *head; @@ -896,13 +872,13 @@ } else node1 = node1->next; } - } // End of out_of_order loop + } /* End of out_of_order loop */ node1 = *head; while (node1 && node1->next) { if ((node1->base + node1->length) == node1->next->base) { - // Combine + /* Combine */ dbg("8..\n"); node1->length += node1->next->length; node2 = node1->next; @@ -912,7 +888,7 @@ node1 = node1->next; } - return(0); + return 0; } @@ -927,23 +903,23 @@ misc = readw(ctrl->hpc_reg + MISC); - //********************************* - // Check to see if it was our interrupt - //********************************* + /*************************************** + * Check to see if it was our interrupt + ***************************************/ if (!(misc & 0x000C)) { return IRQ_NONE; } if (misc & 0x0004) { - //********************************* - // Serial Output interrupt Pending - //********************************* + /********************************** + * Serial Output interrupt Pending + **********************************/ - // Clear the interrupt + /* Clear the interrupt */ misc |= 0x0004; writew(misc, ctrl->hpc_reg + MISC); - // Read to clear posted writes + /* Read to clear posted writes */ misc = readw(ctrl->hpc_reg + MISC); dbg ("%s - waking up\n", __FUNCTION__); @@ -951,21 +927,20 @@ } if (misc & 0x0008) { - // General-interrupt-input interrupt Pending + /* General-interrupt-input interrupt Pending */ Diff = readl(ctrl->hpc_reg + INT_INPUT_CLEAR) ^ ctrl->ctrl_int_comp; ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); - // Clear the interrupt + /* Clear the interrupt */ writel(Diff, ctrl->hpc_reg + INT_INPUT_CLEAR); - // Read it back to clear any posted writes + /* Read it back to clear any posted writes */ temp_dword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); - if (!Diff) { - // Clear all interrupts + if (!Diff) + /* Clear all interrupts */ writel(0xFFFFFFFF, ctrl->hpc_reg + INT_INPUT_CLEAR); - } schedule_flag += handle_switch_change((u8)(Diff & 0xFFL), ctrl); schedule_flag += handle_presence_change((u16)((Diff & 0xFFFF0000L) >> 16), ctrl); @@ -1000,12 +975,12 @@ struct pci_func *new_slot; struct pci_func *next; - new_slot = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL); + new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL); if (new_slot == NULL) { - // I'm not dead yet! - // You will be. - return(new_slot); + /* I'm not dead yet! + * You will be. */ + return new_slot; } memset(new_slot, 0, sizeof(struct pci_func)); @@ -1021,11 +996,11 @@ next = next->next; next->next = new_slot; } - return(new_slot); + return new_slot; } -/* +/** * slot_remove - Removes a node from the linked list of slots. * @old_slot: slot to remove * @@ -1036,19 +1011,19 @@ struct pci_func *next; if (old_slot == NULL) - return(1); + return 1; next = cpqhp_slot_list[old_slot->bus]; if (next == NULL) { - return(1); + return 1; } if (next == old_slot) { cpqhp_slot_list[old_slot->bus] = old_slot->next; cpqhp_destroy_board_resources(old_slot); kfree(old_slot); - return(0); + return 0; } while ((next->next != old_slot) && (next->next != NULL)) { @@ -1059,9 +1034,9 @@ next->next = old_slot->next; cpqhp_destroy_board_resources(old_slot); kfree(old_slot); - return(0); + return 0; } else - return(2); + return 2; } @@ -1077,9 +1052,6 @@ u8 tempBus; struct pci_func *next; - if (bridge == NULL) - return(1); - secondaryBus = (bridge->config_space[0x06] >> 8) & 0xFF; subordinateBus = (bridge->config_space[0x06] >> 16) & 0xFF; @@ -1093,26 +1065,23 @@ next = cpqhp_slot_list[bridge->bus]; - if (next == NULL) { - return(1); - } + if (next == NULL) + return 1; if (next == bridge) { cpqhp_slot_list[bridge->bus] = bridge->next; - kfree(bridge); - return(0); + goto out; } - while ((next->next != bridge) && (next->next != NULL)) { + while ((next->next != bridge) && (next->next != NULL)) next = next->next; - } - if (next->next == bridge) { - next->next = bridge->next; - kfree(bridge); - return(0); - } else - return(2); + if (next->next != bridge) + return 2; + next->next = bridge->next; +out: + kfree(bridge); + return 0; } @@ -1132,7 +1101,7 @@ func = cpqhp_slot_list[bus]; if ((func == NULL) || ((func->device == device) && (index == 0))) - return(func); + return func; if (func->device == device) found++; @@ -1144,18 +1113,18 @@ found++; if (found == index) - return(func); + return func; } - return(NULL); + return NULL; } -// DJZ: I don't think is_bridge will work as is. -//FIXME +/* DJZ: I don't think is_bridge will work as is. + * FIXME */ static int is_bridge(struct pci_func * func) { - // Check the header type + /* Check the header type */ if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01) return 1; else @@ -1163,6 +1132,138 @@ } +/** + * set_controller_speed - set the frequency and/or mode of a specific + * controller segment. + * + * @ctrl: controller to change frequency/mode for. + * @adapter_speed: the speed of the adapter we want to match. + * @hp_slot: the slot number where the adapter is installed. + * + * Returns 0 if we successfully change frequency and/or mode to match the + * adapter speed. + * + */ +static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) +{ + struct slot *slot; + u8 reg; + u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); + u16 reg16; + u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); + + if (ctrl->speed == adapter_speed) + return 0; + + /* We don't allow freq/mode changes if we find another adapter running + * in another slot on this controller */ + for(slot = ctrl->slot; slot; slot = slot->next) { + if (slot->device == (hp_slot + ctrl->slot_device_offset)) + continue; + if (!slot->hotplug_slot && !slot->hotplug_slot->info) + continue; + if (slot->hotplug_slot->info->adapter_status == 0) + continue; + /* If another adapter is running on the same segment but at a + * lower speed/mode, we allow the new adapter to function at + * this rate if supported */ + if (ctrl->speed < adapter_speed) + return 0; + + return 1; + } + + /* If the controller doesn't support freq/mode changes and the + * controller is running at a higher mode, we bail */ + if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability)) + return 1; + + /* But we allow the adapter to run at a lower rate if possible */ + if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability)) + return 0; + + /* We try to set the max speed supported by both the adapter and + * controller */ + if (ctrl->speed_capability < adapter_speed) { + if (ctrl->speed == ctrl->speed_capability) + return 0; + adapter_speed = ctrl->speed_capability; + } + + writel(0x0L, ctrl->hpc_reg + LED_CONTROL); + writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); + + set_SOGO(ctrl); + wait_for_ctrl_irq(ctrl); + + if (adapter_speed != PCI_SPEED_133MHz_PCIX) + reg = 0xF5; + else + reg = 0xF4; + pci_write_config_byte(ctrl->pci_dev, 0x41, reg); + + reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); + reg16 &= ~0x000F; + switch(adapter_speed) { + case(PCI_SPEED_133MHz_PCIX): + reg = 0x75; + reg16 |= 0xB; + break; + case(PCI_SPEED_100MHz_PCIX): + reg = 0x74; + reg16 |= 0xA; + break; + case(PCI_SPEED_66MHz_PCIX): + reg = 0x73; + reg16 |= 0x9; + break; + case(PCI_SPEED_66MHz): + reg = 0x73; + reg16 |= 0x1; + break; + default: /* 33MHz PCI 2.2 */ + reg = 0x71; + break; + + } + reg16 |= 0xB << 12; + writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); + + mdelay(5); + + /* Reenable interrupts */ + writel(0, ctrl->hpc_reg + INT_MASK); + + pci_write_config_byte(ctrl->pci_dev, 0x41, reg); + + /* Restart state machine */ + reg = ~0xF; + pci_read_config_byte(ctrl->pci_dev, 0x43, ®); + pci_write_config_byte(ctrl->pci_dev, 0x43, reg); + + /* Only if mode change...*/ + if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || + ((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) + set_SOGO(ctrl); + + wait_for_ctrl_irq(ctrl); + mdelay(1100); + + /* Restore LED/Slot state */ + writel(leds, ctrl->hpc_reg + LED_CONTROL); + writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); + + set_SOGO(ctrl); + wait_for_ctrl_irq(ctrl); + + ctrl->speed = adapter_speed; + slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); + + info("Successfully changed frequency/mode for adapter in slot %d\n", + slot->number); + return 0; +} + /* the following routines constitute the bulk of the hotplug controller logic */ @@ -1178,7 +1279,7 @@ * If board isn't same, turns it back off. * */ -static u32 board_replaced(struct pci_func * func, struct controller * ctrl) +static u32 board_replaced(struct pci_func *func, struct controller *ctrl) { u8 hp_slot; u8 temp_byte; @@ -1190,36 +1291,35 @@ hp_slot = func->device - ctrl->slot_device_offset; if (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot)) { - //********************************* - // The switch is open. - //********************************* + /********************************** + * The switch is open. + **********************************/ rc = INTERLOCK_OPEN; } else if (is_slot_enabled (ctrl, hp_slot)) { - //********************************* - // The board is already on - //********************************* + /********************************** + * The board is already on + **********************************/ rc = CARD_FUNCTIONING; } else { - // Wait for exclusive access to hardware down(&ctrl->crit_sect); - // turn on board without attaching to the bus + /* turn on board without attaching to the bus */ enable_slot_power (ctrl, hp_slot); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Change bits in slot power register to force another shift out - // NOTE: this is to work around the timer bug + /* Change bits in slot power register to force another shift out + * NOTE: this is to work around the timer bug */ temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); writeb(0x00, ctrl->hpc_reg + SLOT_POWER); writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); adapter_speed = get_adapter_speed(ctrl, hp_slot); @@ -1227,21 +1327,19 @@ if (set_controller_speed(ctrl, adapter_speed, hp_slot)) rc = WRONG_BUS_FREQUENCY; - // turn off board without attaching to the bus + /* turn off board without attaching to the bus */ disable_slot_power (ctrl, hp_slot); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); if (rc) - return(rc); + return rc; - // Wait for exclusive access to hardware down(&ctrl->crit_sect); slot_enable (ctrl, hp_slot); @@ -1251,35 +1349,34 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); - // Wait for ~1 second because of hot plug spec + /* Wait for ~1 second because of hot plug spec */ long_delay(1*HZ); - // Check for a power fault + /* Check for a power fault */ if (func->status == 0xFF) { - // power fault occurred, but it was benign + /* power fault occurred, but it was benign */ rc = POWER_FAILURE; func->status = 0; } else rc = cpqhp_valid_replace(ctrl, func); if (!rc) { - // It must be the same board + /* It must be the same board */ rc = cpqhp_configure_board(ctrl, func); if (rc || src) { - // If configuration fails, turn it off - // Get slot won't work for devices behind bridges, but - // in this case it will always be called for the "base" - // bus/dev/func of an adapter. + /* If configuration fails, turn it off + * Get slot won't work for devices behind + * bridges, but in this case it will always be + * called for the "base" bus/dev/func of an + * adapter. */ - // Wait for exclusive access to hardware down(&ctrl->crit_sect); amber_LED_on (ctrl, hp_slot); @@ -1288,16 +1385,15 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); if (rc) - return(rc); + return rc; else - return(1); + return 1; } func->status = 0; @@ -1310,12 +1406,12 @@ } if (rc) { - // If configuration fails, turn it off - // Get slot won't work for devices behind bridges, but - // in this case it will always be called for the "base" - // bus/dev/func of an adapter. + /* If configuration fails, turn it off + * Get slot won't work for devices behind + * bridges, but in this case it will always be + * called for the "base" bus/dev/func of an + * adapter. */ - // Wait for exclusive access to hardware down(&ctrl->crit_sect); amber_LED_on (ctrl, hp_slot); @@ -1324,37 +1420,33 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); - return(rc); + return rc; } - // Done configuring so turn LED on full time + /* Done configuring so turn LED on full time */ - // Wait for exclusive access to hardware down(&ctrl->crit_sect); green_LED_on (ctrl, hp_slot); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); rc = 0; } else { - // Something is wrong + /* Something is wrong - // Get slot won't work for devices behind bridges, but - // in this case it will always be called for the "base" - // bus/dev/func of an adapter. + * Get slot won't work for devices behind bridges, but + * in this case it will always be called for the "base" + * bus/dev/func of an adapter. */ - // Wait for exclusive access to hardware down(&ctrl->crit_sect); amber_LED_on (ctrl, hp_slot); @@ -1363,15 +1455,14 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); } } - return(rc); + return rc; } @@ -1383,7 +1474,7 @@ * Configures board * */ -static u32 board_added(struct pci_func * func, struct controller * ctrl) +static u32 board_added(struct pci_func *func, struct controller *ctrl) { u8 hp_slot; u8 temp_byte; @@ -1399,26 +1490,25 @@ dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n", __FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot); - // Wait for exclusive access to hardware down(&ctrl->crit_sect); - // turn on board without attaching to the bus - enable_slot_power (ctrl, hp_slot); + /* turn on board without attaching to the bus */ + enable_slot_power(ctrl, hp_slot); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Change bits in slot power register to force another shift out - // NOTE: this is to work around the timer bug + /* Change bits in slot power register to force another shift out + * NOTE: this is to work around the timer bug */ temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); writeb(0x00, ctrl->hpc_reg + SLOT_POWER); writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); adapter_speed = get_adapter_speed(ctrl, hp_slot); @@ -1426,25 +1516,23 @@ if (set_controller_speed(ctrl, adapter_speed, hp_slot)) rc = WRONG_BUS_FREQUENCY; - // turn off board without attaching to the bus + /* turn off board without attaching to the bus */ disable_slot_power (ctrl, hp_slot); set_SOGO(ctrl); - // Wait for SOBS to be unset - wait_for_ctrl_irq (ctrl); + /* Wait for SOBS to be unset */ + wait_for_ctrl_irq(ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); if (rc) - return(rc); + return rc; p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); - // turn on board and blink green LED + /* turn on board and blink green LED */ - // Wait for exclusive access to hardware dbg("%s: before down\n", __FUNCTION__); down(&ctrl->crit_sect); dbg("%s: after down\n", __FUNCTION__); @@ -1461,47 +1549,46 @@ dbg("%s: before set_SOGO\n", __FUNCTION__); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ dbg("%s: before wait_for_ctrl_irq\n", __FUNCTION__); wait_for_ctrl_irq (ctrl); dbg("%s: after wait_for_ctrl_irq\n", __FUNCTION__); - // Done with exclusive hardware access dbg("%s: before up\n", __FUNCTION__); up(&ctrl->crit_sect); dbg("%s: after up\n", __FUNCTION__); - // Wait for ~1 second because of hot plug spec + /* Wait for ~1 second because of hot plug spec */ dbg("%s: before long_delay\n", __FUNCTION__); long_delay(1*HZ); dbg("%s: after long_delay\n", __FUNCTION__); dbg("%s: func status = %x\n", __FUNCTION__, func->status); - // Check for a power fault + /* Check for a power fault */ if (func->status == 0xFF) { - // power fault occurred, but it was benign + /* power fault occurred, but it was benign */ temp_register = 0xFFFFFFFF; dbg("%s: temp register set to %x by power fault\n", __FUNCTION__, temp_register); rc = POWER_FAILURE; func->status = 0; } else { - // Get vendor/device ID u32 + /* Get vendor/device ID u32 */ ctrl->pci_bus->number = func->bus; rc = pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(func->device, func->function), PCI_VENDOR_ID, &temp_register); dbg("%s: pci_read_config_dword returns %d\n", __FUNCTION__, rc); dbg("%s: temp_register is %x\n", __FUNCTION__, temp_register); if (rc != 0) { - // Something's wrong here + /* Something's wrong here */ temp_register = 0xFFFFFFFF; dbg("%s: temp register set to %x by error\n", __FUNCTION__, temp_register); } - // Preset return code. It will be changed later if things go okay. + /* Preset return code. It will be changed later if things go okay. */ rc = NO_ADAPTER_PRESENT; } - // All F's is an empty slot or an invalid board - if (temp_register != 0xFFFFFFFF) { // Check for a board in the slot + /* All F's is an empty slot or an invalid board */ + if (temp_register != 0xFFFFFFFF) { /* Check for a board in the slot */ res_lists.io_head = ctrl->io_head; res_lists.mem_head = ctrl->mem_head; res_lists.p_mem_head = ctrl->p_mem_head; @@ -1522,7 +1609,6 @@ cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); if (rc) { - // Wait for exclusive access to hardware down(&ctrl->crit_sect); amber_LED_on (ctrl, hp_slot); @@ -1531,12 +1617,11 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); - return(rc); + return rc; } else { cpqhp_save_slot_config(ctrl, func); } @@ -1546,7 +1631,8 @@ func->switch_save = 0x10; func->is_a_board = 0x01; - //next, we will instantiate the linux pci_dev structures (with appropriate driver notification, if already present) + /* next, we will instantiate the linux pci_dev structures (with + * appropriate driver notification, if already present) */ dbg("%s: configure linux pci_dev structure\n", __FUNCTION__); index = 0; do { @@ -1556,20 +1642,17 @@ } } while (new_slot); - // Wait for exclusive access to hardware down(&ctrl->crit_sect); green_LED_on (ctrl, hp_slot); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); } else { - // Wait for exclusive access to hardware down(&ctrl->crit_sect); amber_LED_on (ctrl, hp_slot); @@ -1578,13 +1661,12 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); - return(rc); + return rc; } return 0; } @@ -1605,26 +1687,23 @@ struct resource_lists res_lists; struct pci_func *temp_func; - if (func == NULL) - return(1); - if (cpqhp_unconfigure_device(func)) - return(1); + return 1; device = func->device; hp_slot = func->device - ctrl->slot_device_offset; dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot); - // When we get here, it is safe to change base Address Registers. - // We will attempt to save the base Address Register Lengths + /* When we get here, it is safe to change base address registers. + * We will attempt to save the base address register lengths */ if (replace_flag || !ctrl->add_support) rc = cpqhp_save_base_addr_length(ctrl, func); else if (!func->bus_head && !func->mem_head && !func->p_mem_head && !func->io_head) { - // Here we check to see if we've saved any of the board's - // resources already. If so, we'll skip the attempt to - // determine what's being used. + /* Here we check to see if we've saved any of the board's + * resources already. If so, we'll skip the attempt to + * determine what's being used. */ index = 0; temp_func = cpqhp_slot_find(func->bus, func->device, index++); while (temp_func) { @@ -1639,12 +1718,11 @@ if (!skip) rc = cpqhp_save_used_resources(ctrl, func); } - // Change status to shutdown + /* Change status to shutdown */ if (func->is_a_board) func->status = 0x01; func->configured = 0; - // Wait for exclusive access to hardware down(&ctrl->crit_sect); green_LED_off (ctrl, hp_slot); @@ -1652,15 +1730,14 @@ set_SOGO(ctrl); - // turn off SERR for slot + /* turn off SERR for slot */ temp_byte = readb(ctrl->hpc_reg + SLOT_SERR); temp_byte &= ~(0x01 << hp_slot); writeb(temp_byte, ctrl->hpc_reg + SLOT_SERR); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); if (!replace_flag && ctrl->add_support) { @@ -1690,13 +1767,11 @@ func = cpqhp_slot_find(ctrl->bus, device, 0); } - // Setup slot structure with entry for empty slot + /* Setup slot structure with entry for empty slot */ func = cpqhp_slot_create(ctrl->bus); - if (func == NULL) { - // Out of memory - return(1); - } + if (func == NULL) + return 1; func->bus = ctrl->bus; func->device = device; @@ -1710,15 +1785,14 @@ return 0; } - -static void pushbutton_helper_thread (unsigned long data) +static void pushbutton_helper_thread(unsigned long data) { pushbutton_pending = data; up(&event_semaphore); } -// this is the main worker thread +/* this is the main worker thread */ static int event_thread(void* data) { struct controller *ctrl; @@ -1745,7 +1819,7 @@ } -int cpqhp_event_start_thread (void) +int cpqhp_event_start_thread(void) { int pid; @@ -1765,7 +1839,7 @@ } -void cpqhp_event_stop_thread (void) +void cpqhp_event_stop_thread(void) { event_finished = 1; dbg("event_thread finish command given\n"); @@ -1775,12 +1849,12 @@ } -static int update_slot_info (struct controller *ctrl, struct slot *slot) +static int update_slot_info(struct controller *ctrl, struct slot *slot) { struct hotplug_slot_info *info; int result; - info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); + info = kmalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; @@ -1805,7 +1879,7 @@ change = 0; for (loop = 0; loop < 10; loop++) { - //dbg("loop %d\n", loop); + /* dbg("loop %d\n", loop); */ if (ctrl->event_queue[loop].event_type != 0) { hp_slot = ctrl->event_queue[loop].hp_slot; @@ -1827,17 +1901,14 @@ dbg("button cancel\n"); del_timer(&p_slot->task_event); - // Wait for exclusive access to hardware down(&ctrl->crit_sect); if (p_slot->state == BLINKINGOFF_STATE) { - // slot is on - // turn on green LED + /* slot is on */ dbg("turn on green LED\n"); green_LED_on (ctrl, hp_slot); } else if (p_slot->state == BLINKINGON_STATE) { - // slot is off - // turn off green LED + /* slot is off */ dbg("turn off green LED\n"); green_LED_off (ctrl, hp_slot); } @@ -1850,28 +1921,24 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); } - // ***********button Released (No action on press...) + /*** button Released (No action on press...) */ else if (ctrl->event_queue[loop].event_type == INT_BUTTON_RELEASE) { dbg("button release\n"); if (is_slot_enabled (ctrl, hp_slot)) { - // slot is on dbg("slot is on\n"); p_slot->state = BLINKINGOFF_STATE; info(msg_button_off, p_slot->number); } else { - // slot is off dbg("slot is off\n"); p_slot->state = BLINKINGON_STATE; info(msg_button_on, p_slot->number); } - // Wait for exclusive access to hardware down(&ctrl->crit_sect); dbg("blink green LED and turn off amber\n"); @@ -1881,23 +1948,22 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); - // Done with exclusive hardware access up(&ctrl->crit_sect); init_timer(&p_slot->task_event); p_slot->hp_slot = hp_slot; p_slot->ctrl = ctrl; -// p_slot->physical_slot = physical_slot; - p_slot->task_event.expires = jiffies + 5 * HZ; // 5 second delay +/* p_slot->physical_slot = physical_slot; */ + p_slot->task_event.expires = jiffies + 5 * HZ; /* 5 second delay */ p_slot->task_event.function = pushbutton_helper_thread; p_slot->task_event.data = (u32) p_slot; dbg("add_timer p_slot = %p\n", p_slot); add_timer(&p_slot->task_event); } - // ***********POWER FAULT + /***********POWER FAULT */ else if (ctrl->event_queue[loop].event_type == INT_POWER_FAULT) { dbg("power fault\n"); } else { @@ -1910,7 +1976,7 @@ change = 1; } - } // End of FOR loop + } /* End of FOR loop */ } return; @@ -1924,7 +1990,7 @@ * Handles all pending events and exits. * */ -void cpqhp_pushbutton_thread (unsigned long slot) +void cpqhp_pushbutton_thread(unsigned long slot) { u8 hp_slot; u8 device; @@ -1937,9 +2003,9 @@ device = p_slot->device; - if (is_slot_enabled (ctrl, hp_slot)) { + if (is_slot_enabled(ctrl, hp_slot)) { p_slot->state = POWEROFF_STATE; - // power Down board + /* power Down board */ func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0); dbg("In power_down_board, func = %p, ctrl = %p\n", func, ctrl); if (!func) { @@ -1954,7 +2020,7 @@ set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); } } @@ -1962,7 +2028,7 @@ p_slot->state = STATIC_STATE; } else { p_slot->state = POWERON_STATE; - // slot is off + /* slot is off */ func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0); dbg("In add_board, func = %p, ctrl = %p\n", func, ctrl); @@ -1973,12 +2039,12 @@ if (func != NULL && ctrl != NULL) { if (cpqhp_process_SI(ctrl, func) != 0) { - amber_LED_on (ctrl, hp_slot); - green_LED_off (ctrl, hp_slot); + amber_LED_on(ctrl, hp_slot); + green_LED_off(ctrl, hp_slot); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); } } @@ -1990,7 +2056,7 @@ } -int cpqhp_process_SI (struct controller *ctrl, struct pci_func *func) +int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func) { u8 device, hp_slot; u16 temp_word; @@ -1999,35 +2065,30 @@ struct slot* p_slot; int physical_slot = 0; - if (!ctrl) - return(1); - tempdword = 0; device = func->device; hp_slot = device - ctrl->slot_device_offset; p_slot = cpqhp_find_slot(ctrl, device); - if (p_slot) { + if (p_slot) physical_slot = p_slot->number; - } - // Check to see if the interlock is closed + /* Check to see if the interlock is closed */ tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); if (tempdword & (0x01 << hp_slot)) { - return(1); + return 1; } if (func->is_a_board) { rc = board_replaced(func, ctrl); } else { - // add board + /* add board */ slot_remove(func); func = cpqhp_slot_create(ctrl->bus); - if (func == NULL) { - return(1); - } + if (func == NULL) + return 1; func->bus = ctrl->bus; func->device = device; @@ -2035,7 +2096,7 @@ func->configured = 0; func->is_a_board = 1; - // We have to save the presence info for these slots + /* We have to save the presence info for these slots */ temp_word = ctrl->ctrl_int_comp >> 16; func->presence_save = (temp_word >> hp_slot) & 0x01; func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; @@ -2053,13 +2114,11 @@ } else slot_remove(func); - // Setup slot structure with entry for empty slot + /* Setup slot structure with entry for empty slot */ func = cpqhp_slot_create(ctrl->bus); - if (func == NULL) { - // Out of memory - return(1); - } + if (func == NULL) + return 1; func->bus = ctrl->bus; func->device = device; @@ -2067,7 +2126,7 @@ func->configured = 0; func->is_a_board = 0; - // We have to save the presence info for these slots + /* We have to save the presence info for these slots */ temp_word = ctrl->ctrl_int_comp >> 16; func->presence_save = (temp_word >> hp_slot) & 0x01; func->presence_save |= @@ -2092,7 +2151,7 @@ } -int cpqhp_process_SS (struct controller *ctrl, struct pci_func *func) +int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) { u8 device, class_code, header_type, BCR; u8 index = 0; @@ -2110,12 +2169,12 @@ physical_slot = p_slot->number; } - // Make sure there are no video controllers here + /* Make sure there are no video controllers here */ while (func && !rc) { pci_bus->number = func->bus; devfn = PCI_DEVFN(func->device, func->function); - // Check the Class Code + /* Check the Class Code */ rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code); if (rc) return rc; @@ -2124,18 +2183,19 @@ /* Display/Video adapter (not supported) */ rc = REMOVE_NOT_SUPPORTED; } else { - // See if it's a bridge + /* See if it's a bridge */ rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); if (rc) return rc; - // If it's a bridge, check the VGA Enable bit + /* If it's a bridge, check the VGA Enable bit */ if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_BRIDGE_CONTROL, &BCR); if (rc) return rc; - // If the VGA Enable bit is set, remove isn't supported + /* If the VGA Enable bit is set, remove isn't + * supported */ if (BCR & PCI_BRIDGE_CTL_VGA) { rc = REMOVE_NOT_SUPPORTED; } @@ -2147,7 +2207,7 @@ func = cpqhp_slot_find(ctrl->bus, device, 0); if ((func != NULL) && !rc) { - //FIXME: Replace flag should be passed into process_SS + /* FIXME: Replace flag should be passed into process_SS */ replace_flag = !(ctrl->add_support); rc = remove_board(func, replace_flag, ctrl); } else if (!rc) { @@ -2157,16 +2217,42 @@ if (p_slot) update_slot_info(ctrl, p_slot); - return(rc); + return rc; } +/** + * switch_leds: switch the leds, go from one site to the other. + * @ctrl: controller to use + * @num_of_slots: number of slots to use + * @direction: 1 to start from the left side, 0 to start right. + */ +void switch_leds(struct controller *ctrl, const int num_of_slots, + u32 *work_LED, const int direction) +{ + int loop; + for (loop = 0; loop < num_of_slots; loop++) { + if (direction) + *work_LED = *work_LED >> 1; + else + *work_LED = *work_LED << 1; + writel(*work_LED, ctrl->hpc_reg + LED_CONTROL); + + set_SOGO(ctrl); + + /* Wait for SOGO interrupt */ + wait_for_ctrl_irq(ctrl); + + /* Get ready for next iteration */ + long_delay((2*HZ)/10); + } +} /** * hardware_test - runs hardware tests * * For hot plug ctrl folks to play with. - * test_num is the number entered in the GUI + * test_num is the number written to the "test" file in sysfs * */ int cpqhp_hardware_test(struct controller *ctrl, int test_num) @@ -2180,132 +2266,45 @@ switch (test_num) { case 1: - // Do stuff here! + /* Do stuff here! */ - // Do that funky LED thing - save_LED = readl(ctrl->hpc_reg + LED_CONTROL); // so we can restore them later + /* Do that funky LED thing */ + /* so we can restore them later */ + save_LED = readl(ctrl->hpc_reg + LED_CONTROL); work_LED = 0x01010101; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - for (loop = 0; loop < num_of_slots; loop++) { - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - work_LED = work_LED << 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - long_delay((2*HZ)/10); - } - for (loop = 0; loop < num_of_slots; loop++) { - work_LED = work_LED >> 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - long_delay((2*HZ)/10); - } - for (loop = 0; loop < num_of_slots; loop++) { - work_LED = work_LED << 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - long_delay((2*HZ)/10); - } - for (loop = 0; loop < num_of_slots; loop++) { - work_LED = work_LED >> 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - long_delay((2*HZ)/10); - } + switch_leds(ctrl, num_of_slots, &work_LED, 0); + switch_leds(ctrl, num_of_slots, &work_LED, 1); + switch_leds(ctrl, num_of_slots, &work_LED, 0); + switch_leds(ctrl, num_of_slots, &work_LED, 1); work_LED = 0x01010000; writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - for (loop = 0; loop < num_of_slots; loop++) { - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - work_LED = work_LED << 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - long_delay((2*HZ)/10); - } - for (loop = 0; loop < num_of_slots; loop++) { - work_LED = work_LED >> 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - long_delay((2*HZ)/10); - } + switch_leds(ctrl, num_of_slots, &work_LED, 0); + switch_leds(ctrl, num_of_slots, &work_LED, 1); work_LED = 0x00000101; writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - for (loop = 0; loop < num_of_slots; loop++) { - work_LED = work_LED << 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - long_delay((2*HZ)/10); - } - for (loop = 0; loop < num_of_slots; loop++) { - work_LED = work_LED >> 1; - writel(work_LED, ctrl->hpc_reg + LED_CONTROL); - - set_SOGO(ctrl); - - // Wait for SOGO interrupt - wait_for_ctrl_irq (ctrl); - - // Get ready for next iteration - long_delay((2*HZ)/10); - } - + switch_leds(ctrl, num_of_slots, &work_LED, 0); + switch_leds(ctrl, num_of_slots, &work_LED, 1); work_LED = 0x01010000; writel(work_LED, ctrl->hpc_reg + LED_CONTROL); for (loop = 0; loop < num_of_slots; loop++) { set_SOGO(ctrl); - // Wait for SOGO interrupt + /* Wait for SOGO interrupt */ wait_for_ctrl_irq (ctrl); - // Get ready for next iteration + /* Get ready for next iteration */ long_delay((3*HZ)/10); work_LED = work_LED >> 16; writel(work_LED, ctrl->hpc_reg + LED_CONTROL); set_SOGO(ctrl); - // Wait for SOGO interrupt + /* Wait for SOGO interrupt */ wait_for_ctrl_irq (ctrl); - // Get ready for next iteration + /* Get ready for next iteration */ long_delay((3*HZ)/10); work_LED = work_LED << 16; writel(work_LED, ctrl->hpc_reg + LED_CONTROL); @@ -2313,18 +2312,19 @@ writel(work_LED, ctrl->hpc_reg + LED_CONTROL); } - writel (save_LED, ctrl->hpc_reg + LED_CONTROL); // put it back the way it was + /* put it back the way it was */ + writel(save_LED, ctrl->hpc_reg + LED_CONTROL); set_SOGO(ctrl); - // Wait for SOBS to be unset + /* Wait for SOBS to be unset */ wait_for_ctrl_irq (ctrl); break; case 2: - // Do other stuff here! + /* Do other stuff here! */ break; case 3: - // and more... + /* and more... */ break; } return 0; @@ -2342,7 +2342,7 @@ * Returns 0 if success * */ -static u32 configure_new_device (struct controller * ctrl, struct pci_func * func, +static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, u8 behind_bridge, struct resource_lists * resources) { u8 temp_byte, function, max_functions, stop_it; @@ -2354,7 +2354,7 @@ new_slot = func; dbg("%s\n", __FUNCTION__); - // Check for Multi-function device + /* Check for Multi-function device */ ctrl->pci_bus->number = func->bus; rc = pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(func->device, func->function), 0x0E, &temp_byte); if (rc) { @@ -2362,7 +2362,7 @@ return rc; } - if (temp_byte & 0x80) // Multi-function device + if (temp_byte & 0x80) /* Multi-function device */ max_functions = 8; else max_functions = 1; @@ -2383,29 +2383,27 @@ cpqhp_return_board_resources(new_slot, resources); } - return(rc); + return rc; } function++; stop_it = 0; - // The following loop skips to the next present function - // and creates a board structure + /* The following loop skips to the next present function + * and creates a board structure */ while ((function < max_functions) && (!stop_it)) { pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(func->device, function), 0x00, &ID); - if (ID == 0xFFFFFFFF) { // There's nothing there. + if (ID == 0xFFFFFFFF) { /* There's nothing there. */ function++; - } else { // There's something there - // Setup slot structure. + } else { /* There's something there */ + /* Setup slot structure. */ new_slot = cpqhp_slot_create(func->bus); - if (new_slot == NULL) { - // Out of memory - return(1); - } + if (new_slot == NULL) + return 1; new_slot->bus = func->bus; new_slot->device = func->device; @@ -2442,8 +2440,9 @@ * Returns 0 if success * */ -static int configure_new_function (struct controller * ctrl, struct pci_func * func, - u8 behind_bridge, struct resource_lists * resources) +static int configure_new_function(struct controller *ctrl, struct pci_func *func, + u8 behind_bridge, + struct resource_lists *resources) { int cloop; u8 IRQ = 0; @@ -2475,57 +2474,56 @@ pci_bus->number = func->bus; devfn = PCI_DEVFN(func->device, func->function); - // Check for Bridge - rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte); + /* Check for Bridge */ + rc = pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte); if (rc) return rc; - if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge - // set Primary bus + if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */ + /* set Primary bus */ dbg("set Primary bus = %d\n", func->bus); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_PRIMARY_BUS, func->bus); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_PRIMARY_BUS, func->bus); if (rc) return rc; - // find range of busses to use + /* find range of busses to use */ dbg("find ranges of buses to use\n"); - bus_node = get_max_resource(&resources->bus_head, 1); + bus_node = get_max_resource(&(resources->bus_head), 1); - // If we don't have any busses to allocate, we can't continue + /* If we don't have any busses to allocate, we can't continue */ if (!bus_node) return -ENOMEM; - // set Secondary bus + /* set Secondary bus */ temp_byte = bus_node->base; dbg("set Secondary bus = %d\n", bus_node->base); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte); if (rc) return rc; - // set subordinate bus + /* set subordinate bus */ temp_byte = bus_node->base + bus_node->length - 1; dbg("set subordinate bus = %d\n", bus_node->base + bus_node->length - 1); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte); if (rc) return rc; - // set subordinate Latency Timer and base Latency Timer + /* set subordinate Latency Timer and base Latency Timer */ temp_byte = 0x40; - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SEC_LATENCY_TIMER, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SEC_LATENCY_TIMER, temp_byte); if (rc) return rc; - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_LATENCY_TIMER, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_LATENCY_TIMER, temp_byte); if (rc) return rc; - // set Cache Line size + /* set Cache Line size */ temp_byte = 0x08; - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_CACHE_LINE_SIZE, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_CACHE_LINE_SIZE, temp_byte); if (rc) return rc; - // Setup the IO, memory, and prefetchable windows - + /* Setup the IO, memory, and prefetchable windows */ io_node = get_max_resource(&(resources->io_head), 0x1000); if (!io_node) return -ENOMEM; @@ -2537,13 +2535,16 @@ return -ENOMEM; dbg("Setup the IO, memory, and prefetchable windows\n"); dbg("io_node\n"); - dbg("(base, len, next) (%x, %x, %p)\n", io_node->base, io_node->length, io_node->next); + dbg("(base, len, next) (%x, %x, %p)\n", io_node->base, + io_node->length, io_node->next); dbg("mem_node\n"); - dbg("(base, len, next) (%x, %x, %p)\n", mem_node->base, mem_node->length, mem_node->next); + dbg("(base, len, next) (%x, %x, %p)\n", mem_node->base, + mem_node->length, mem_node->next); dbg("p_mem_node\n"); - dbg("(base, len, next) (%x, %x, %p)\n", p_mem_node->base, p_mem_node->length, p_mem_node->next); + dbg("(base, len, next) (%x, %x, %p)\n", p_mem_node->base, + p_mem_node->length, p_mem_node->next); - // set up the IRQ info + /* set up the IRQ info */ if (!resources->irqs) { irqs.barber_pole = 0; irqs.interrupt[0] = 0; @@ -2560,32 +2561,28 @@ irqs.valid_INT = resources->irqs->valid_INT; } - // set up resource lists that are now aligned on top and bottom - // for anything behind the bridge. + /* set up resource lists that are now aligned on top and bottom + * for anything behind the bridge. */ temp_resources.bus_head = bus_node; temp_resources.io_head = io_node; temp_resources.mem_head = mem_node; temp_resources.p_mem_head = p_mem_node; temp_resources.irqs = &irqs; - // Make copies of the nodes we are going to pass down so that - // if there is a problem,we can just use these to free resources - hold_bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_IO_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + /* Make copies of the nodes we are going to pass down so that + * if there is a problem,we can just use these to free resources */ + hold_bus_node = kmalloc(sizeof(*hold_bus_node), GFP_KERNEL); + hold_IO_node = kmalloc(sizeof(*hold_IO_node), GFP_KERNEL); + hold_mem_node = kmalloc(sizeof(*hold_mem_node), GFP_KERNEL); + hold_p_mem_node = kmalloc(sizeof(*hold_p_mem_node), GFP_KERNEL); if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) { - if (hold_bus_node) - kfree(hold_bus_node); - if (hold_IO_node) - kfree(hold_IO_node); - if (hold_mem_node) - kfree(hold_mem_node); - if (hold_p_mem_node) - kfree(hold_p_mem_node); + kfree(hold_bus_node); + kfree(hold_IO_node); + kfree(hold_mem_node); + kfree(hold_p_mem_node); - return(1); + return 1; } memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource)); @@ -2594,55 +2591,55 @@ bus_node->length -= 1; bus_node->next = NULL; - // If we have IO resources copy them and fill in the bridge's - // IO range registers + /* If we have IO resources copy them and fill in the bridge's + * IO range registers */ if (io_node) { memcpy(hold_IO_node, io_node, sizeof(struct pci_resource)); io_node->next = NULL; - // set IO base and Limit registers + /* set IO base and Limit registers */ temp_byte = io_node->base >> 8; - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_BASE, temp_byte); temp_byte = (io_node->base + io_node->length - 1) >> 8; - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte); } else { kfree(hold_IO_node); hold_IO_node = NULL; } - // If we have memory resources copy them and fill in the bridge's - // memory range registers. Otherwise, fill in the range - // registers with values that disable them. + /* If we have memory resources copy them and fill in the + * bridge's memory range registers. Otherwise, fill in the + * range registers with values that disable them. */ if (mem_node) { memcpy(hold_mem_node, mem_node, sizeof(struct pci_resource)); mem_node->next = NULL; - // set Mem base and Limit registers + /* set Mem base and Limit registers */ temp_word = mem_node->base >> 16; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word); temp_word = (mem_node->base + mem_node->length - 1) >> 16; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); } else { temp_word = 0xFFFF; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word); temp_word = 0x0000; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); kfree(hold_mem_node); hold_mem_node = NULL; } - // If we have prefetchable memory resources copy them and - // fill in the bridge's memory range registers. Otherwise, - // fill in the range registers with values that disable them. + /* If we have prefetchable memory resources copy them and + * fill in the bridge's memory range registers. Otherwise, + * fill in the range registers with values that disable them. */ if (p_mem_node) { memcpy(hold_p_mem_node, p_mem_node, sizeof(struct pci_resource)); p_mem_node->next = NULL; - // set Pre Mem base and Limit registers + /* set Pre Mem base and Limit registers */ temp_word = p_mem_node->base >> 16; rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); @@ -2659,12 +2656,12 @@ hold_p_mem_node = NULL; } - // Adjust this to compensate for extra adjustment in first loop + /* Adjust this to compensate for extra adjustment in first loop */ irqs.barber_pole--; rc = 0; - // Here we actually find the devices and configure them + /* Here we actually find the devices and configure them */ for (device = 0; (device <= 0x1F) && !rc; device++) { irqs.barber_pole = (irqs.barber_pole + 1) & 0x03; @@ -2673,12 +2670,11 @@ pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), 0x00, &ID); pci_bus->number = func->bus; - if (ID != 0xFFFFFFFF) { // device Present - // Setup slot structure. + if (ID != 0xFFFFFFFF) { /* device present */ + /* Setup slot structure. */ new_slot = cpqhp_slot_create(hold_bus_node->base); if (new_slot == NULL) { - // Out of memory rc = -ENOMEM; continue; } @@ -2691,19 +2687,12 @@ rc = configure_new_device(ctrl, new_slot, 1, &temp_resources); dbg("configure_new_device rc=0x%x\n",rc); - } // End of IF (device in slot?) - } // End of FOR loop - - if (rc) { - cpqhp_destroy_resource_list(&temp_resources); + } /* End of IF (device in slot?) */ + } /* End of FOR loop */ - return_resource(&(resources->bus_head), hold_bus_node); - return_resource(&(resources->io_head), hold_IO_node); - return_resource(&(resources->mem_head), hold_mem_node); - return_resource(&(resources->p_mem_head), hold_p_mem_node); - return(rc); - } - // save the interrupt routing information + if (rc) + goto free_and_out; + /* save the interrupt routing information */ if (resources->irqs) { resources->irqs->interrupt[0] = irqs.interrupt[0]; resources->irqs->interrupt[1] = irqs.interrupt[1]; @@ -2711,25 +2700,19 @@ resources->irqs->interrupt[3] = irqs.interrupt[3]; resources->irqs->valid_INT = irqs.valid_INT; } else if (!behind_bridge) { - // We need to hook up the interrupts here + /* We need to hook up the interrupts here */ for (cloop = 0; cloop < 4; cloop++) { if (irqs.valid_INT & (0x01 << cloop)) { rc = cpqhp_set_irq(func->bus, func->device, 0x0A + cloop, irqs.interrupt[cloop]); - if (rc) { - cpqhp_destroy_resource_list (&temp_resources); - - return_resource(&(resources-> bus_head), hold_bus_node); - return_resource(&(resources-> io_head), hold_IO_node); - return_resource(&(resources-> mem_head), hold_mem_node); - return_resource(&(resources-> p_mem_head), hold_p_mem_node); - return rc; - } + if (rc) + goto free_and_out; } - } // end of for loop + } /* end of for loop */ } - // Return unused bus resources - // First use the temporary node to store information for the board + /* Return unused bus resources + * First use the temporary node to store information for + * the board */ if (hold_bus_node && bus_node && temp_resources.bus_head) { hold_bus_node->length = bus_node->base - hold_bus_node->base; @@ -2738,7 +2721,7 @@ temp_byte = temp_resources.bus_head->base - 1; - // set subordinate bus + /* set subordinate bus */ rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte); if (temp_resources.bus_head->length == 0) { @@ -2749,13 +2732,13 @@ } } - // If we have IO space available and there is some left, - // return the unused portion + /* If we have IO space available and there is some left, + * return the unused portion */ if (hold_IO_node && temp_resources.io_head) { io_node = do_pre_bridge_resource_split(&(temp_resources.io_head), &hold_IO_node, 0x1000); - // Check if we were able to split something off + /* Check if we were able to split something off */ if (io_node) { hold_IO_node->base = io_node->base + io_node->length; @@ -2767,12 +2750,13 @@ io_node = do_bridge_resource_split(&(temp_resources.io_head), 0x1000); - // Check if we were able to split something off + /* Check if we were able to split something off */ if (io_node) { - // First use the temporary node to store information for the board + /* First use the temporary node to store + * information for the board */ hold_IO_node->length = io_node->base - hold_IO_node->base; - // If we used any, add it to the board's list + /* If we used any, add it to the board's list */ if (hold_IO_node->length) { hold_IO_node->next = func->io_head; func->io_head = hold_IO_node; @@ -2782,7 +2766,7 @@ return_resource(&(resources->io_head), io_node); } else { - // it doesn't need any IO + /* it doesn't need any IO */ temp_word = 0x0000; rc = pci_bus_write_config_word (pci_bus, devfn, PCI_IO_LIMIT, temp_word); @@ -2790,22 +2774,22 @@ kfree(hold_IO_node); } } else { - // it used most of the range + /* it used most of the range */ hold_IO_node->next = func->io_head; func->io_head = hold_IO_node; } } else if (hold_IO_node) { - // it used the whole range + /* it used the whole range */ hold_IO_node->next = func->io_head; func->io_head = hold_IO_node; } - // If we have memory space available and there is some left, - // return the unused portion + /* If we have memory space available and there is some left, + * return the unused portion */ if (hold_mem_node && temp_resources.mem_head) { mem_node = do_pre_bridge_resource_split(&(temp_resources. mem_head), &hold_mem_node, 0x100000); - // Check if we were able to split something off + /* Check if we were able to split something off */ if (mem_node) { hold_mem_node->base = mem_node->base + mem_node->length; @@ -2817,23 +2801,24 @@ mem_node = do_bridge_resource_split(&(temp_resources.mem_head), 0x100000); - // Check if we were able to split something off + /* Check if we were able to split something off */ if (mem_node) { - // First use the temporary node to store information for the board + /* First use the temporary node to store + * information for the board */ hold_mem_node->length = mem_node->base - hold_mem_node->base; if (hold_mem_node->length) { hold_mem_node->next = func->mem_head; func->mem_head = hold_mem_node; - // configure end address + /* configure end address */ temp_word = (mem_node->base - 1) >> 16; rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); - // Return unused resources to the pool + /* Return unused resources to the pool */ return_resource(&(resources->mem_head), mem_node); } else { - // it doesn't need any Mem + /* it doesn't need any Mem */ temp_word = 0x0000; rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); @@ -2841,22 +2826,22 @@ kfree(hold_mem_node); } } else { - // it used most of the range + /* it used most of the range */ hold_mem_node->next = func->mem_head; func->mem_head = hold_mem_node; } } else if (hold_mem_node) { - // it used the whole range + /* it used the whole range */ hold_mem_node->next = func->mem_head; func->mem_head = hold_mem_node; } - // If we have prefetchable memory space available and there is some - // left at the end, return the unused portion + /* If we have prefetchable memory space available and there + * is some left at the end, return the unused portion */ if (hold_p_mem_node && temp_resources.p_mem_head) { p_mem_node = do_pre_bridge_resource_split(&(temp_resources.p_mem_head), &hold_p_mem_node, 0x100000); - // Check if we were able to split something off + /* Check if we were able to split something off */ if (p_mem_node) { hold_p_mem_node->base = p_mem_node->base + p_mem_node->length; @@ -2868,12 +2853,13 @@ p_mem_node = do_bridge_resource_split(&(temp_resources.p_mem_head), 0x100000); - // Check if we were able to split something off + /* Check if we were able to split something off */ if (p_mem_node) { - // First use the temporary node to store information for the board + /* First use the temporary node to store + * information for the board */ hold_p_mem_node->length = p_mem_node->base - hold_p_mem_node->base; - // If we used any, add it to the board's list + /* If we used any, add it to the board's list */ if (hold_p_mem_node->length) { hold_p_mem_node->next = func->p_mem_head; func->p_mem_head = hold_p_mem_node; @@ -2883,7 +2869,7 @@ return_resource(&(resources->p_mem_head), p_mem_node); } else { - // it doesn't need any PMem + /* it doesn't need any PMem */ temp_word = 0x0000; rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); @@ -2891,35 +2877,42 @@ kfree(hold_p_mem_node); } } else { - // it used the most of the range + /* it used the most of the range */ hold_p_mem_node->next = func->p_mem_head; func->p_mem_head = hold_p_mem_node; } } else if (hold_p_mem_node) { - // it used the whole range + /* it used the whole range */ hold_p_mem_node->next = func->p_mem_head; func->p_mem_head = hold_p_mem_node; } - // We should be configuring an IRQ and the bridge's base address - // registers if it needs them. Although we have never seen such - // a device - - // enable card - command = 0x0157; // = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY | PCI_COMMAND_SERR + /* We should be configuring an IRQ and the bridge's base address + * registers if it needs them. Although we have never seen such + * a device */ + + /* enable card */ + command = 0x0157; /* = PCI_COMMAND_IO | + * PCI_COMMAND_MEMORY | + * PCI_COMMAND_MASTER | + * PCI_COMMAND_INVALIDATE | + * PCI_COMMAND_PARITY | + * PCI_COMMAND_SERR */ rc = pci_bus_write_config_word (pci_bus, devfn, PCI_COMMAND, command); - // set Bridge Control Register - command = 0x07; // = PCI_BRIDGE_CTL_PARITY | PCI_BRIDGE_CTL_SERR | PCI_BRIDGE_CTL_NO_ISA + /* set Bridge Control Register */ + command = 0x07; /* = PCI_BRIDGE_CTL_PARITY | + * PCI_BRIDGE_CTL_SERR | + * PCI_BRIDGE_CTL_NO_ISA */ rc = pci_bus_write_config_word (pci_bus, devfn, PCI_BRIDGE_CONTROL, command); } else if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_NORMAL) { - // Standard device + /* Standard device */ rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code); if (class_code == PCI_BASE_CLASS_DISPLAY) { - // Display (video) adapter (not supported) - return(DEVICE_TYPE_NOT_SUPPORTED); + /* Display (video) adapter (not supported) */ + return DEVICE_TYPE_NOT_SUPPORTED; } - // Figure out IO and memory needs + /* Figure out IO and memory needs */ for (cloop = 0x10; cloop <= 0x24; cloop += 4) { temp_register = 0xFFFFFFFF; @@ -2929,11 +2922,11 @@ rc = pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp_register); dbg("CND: base = 0x%x\n", temp_register); - if (temp_register) { // If this register is implemented + if (temp_register) { /* If this register is implemented */ if ((temp_register & 0x03L) == 0x01) { - // Map IO + /* Map IO */ - // set base = amount of IO space + /* set base = amount of IO space */ base = temp_register & 0xFFFFFFFC; base = ~base + 1; @@ -2943,7 +2936,7 @@ io_node->base, io_node->length, io_node->next); dbg("func (%p) io_head (%p)\n", func, func->io_head); - // allocate the resource to the board + /* allocate the resource to the board */ if (io_node) { base = io_node->base; @@ -2952,14 +2945,14 @@ } else return -ENOMEM; } else if ((temp_register & 0x0BL) == 0x08) { - // Map prefetchable memory + /* Map prefetchable memory */ base = temp_register & 0xFFFFFFF0; base = ~base + 1; dbg("CND: length = 0x%x\n", base); p_mem_node = get_resource(&(resources->p_mem_head), base); - // allocate the resource to the board + /* allocate the resource to the board */ if (p_mem_node) { base = p_mem_node->base; @@ -2968,14 +2961,14 @@ } else return -ENOMEM; } else if ((temp_register & 0x0BL) == 0x00) { - // Map memory + /* Map memory */ base = temp_register & 0xFFFFFFF0; base = ~base + 1; dbg("CND: length = 0x%x\n", base); mem_node = get_resource(&(resources->mem_head), base); - // allocate the resource to the board + /* allocate the resource to the board */ if (mem_node) { base = mem_node->base; @@ -2984,14 +2977,14 @@ } else return -ENOMEM; } else if ((temp_register & 0x0BL) == 0x04) { - // Map memory + /* Map memory */ base = temp_register & 0xFFFFFFF0; base = ~base + 1; dbg("CND: length = 0x%x\n", base); mem_node = get_resource(&(resources->mem_head), base); - // allocate the resource to the board + /* allocate the resource to the board */ if (mem_node) { base = mem_node->base; @@ -3000,42 +2993,44 @@ } else return -ENOMEM; } else if ((temp_register & 0x0BL) == 0x06) { - // Those bits are reserved, we can't handle this - return(1); + /* Those bits are reserved, we can't handle this */ + return 1; } else { - // Requesting space below 1M - return(NOT_ENOUGH_RESOURCES); + /* Requesting space below 1M */ + return NOT_ENOUGH_RESOURCES; } - rc = pci_bus_write_config_dword (pci_bus, devfn, cloop, base); + rc = pci_bus_write_config_dword(pci_bus, devfn, cloop, base); - // Check for 64-bit base + /* Check for 64-bit base */ if ((temp_register & 0x07L) == 0x04) { cloop += 4; - // Upper 32 bits of address always zero on today's systems - // FIXME this is probably not true on Alpha and ia64??? + /* Upper 32 bits of address always zero + * on today's systems */ + /* FIXME this is probably not true on + * Alpha and ia64??? */ base = 0; - rc = pci_bus_write_config_dword (pci_bus, devfn, cloop, base); + rc = pci_bus_write_config_dword(pci_bus, devfn, cloop, base); } } - } // End of base register loop + } /* End of base register loop */ if (cpqhp_legacy_mode) { - // Figure out which interrupt pin this function uses + /* Figure out which interrupt pin this function uses */ rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_INTERRUPT_PIN, &temp_byte); - // If this function needs an interrupt and we are behind a bridge - // and the pin is tied to something that's alread mapped, - // set this one the same + /* If this function needs an interrupt and we are behind + * a bridge and the pin is tied to something that's + * alread mapped, set this one the same */ if (temp_byte && resources->irqs && (resources->irqs->valid_INT & (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { - // We have to share with something already set up + /* We have to share with something already set up */ IRQ = resources->irqs->interrupt[(temp_byte + resources->irqs->barber_pole - 1) & 0x03]; } else { - // Program IRQ based on card type + /* Program IRQ based on card type */ rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code); if (class_code == PCI_BASE_CLASS_STORAGE) { @@ -3045,43 +3040,59 @@ } } - // IRQ Line + /* IRQ Line */ rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_INTERRUPT_LINE, IRQ); } if (!behind_bridge) { rc = cpqhp_set_irq(func->bus, func->device, temp_byte + 0x09, IRQ); if (rc) - return(1); + return 1; } else { - //TBD - this code may also belong in the other clause of this If statement + /* TBD - this code may also belong in the other clause + * of this If statement */ resources->irqs->interrupt[(temp_byte + resources->irqs->barber_pole - 1) & 0x03] = IRQ; resources->irqs->valid_INT |= 0x01 << (temp_byte + resources->irqs->barber_pole - 1) & 0x03; } - // Latency Timer + /* Latency Timer */ temp_byte = 0x40; - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_LATENCY_TIMER, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, + PCI_LATENCY_TIMER, temp_byte); - // Cache Line size + /* Cache Line size */ temp_byte = 0x08; - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_CACHE_LINE_SIZE, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, + PCI_CACHE_LINE_SIZE, temp_byte); - // disable ROM base Address + /* disable ROM base Address */ temp_dword = 0x00L; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_ROM_ADDRESS, temp_dword); + rc = pci_bus_write_config_word(pci_bus, devfn, + PCI_ROM_ADDRESS, temp_dword); - // enable card - temp_word = 0x0157; // = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY | PCI_COMMAND_SERR - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_COMMAND, temp_word); - } // End of Not-A-Bridge else - else { - // It's some strange type of PCI adapter (Cardbus?) - return(DEVICE_TYPE_NOT_SUPPORTED); + /* enable card */ + temp_word = 0x0157; /* = PCI_COMMAND_IO | + * PCI_COMMAND_MEMORY | + * PCI_COMMAND_MASTER | + * PCI_COMMAND_INVALIDATE | + * PCI_COMMAND_PARITY | + * PCI_COMMAND_SERR */ + rc = pci_bus_write_config_word (pci_bus, devfn, + PCI_COMMAND, temp_word); + } else { /* End of Not-A-Bridge else */ + /* It's some strange type of PCI adapter (Cardbus?) */ + return DEVICE_TYPE_NOT_SUPPORTED; } func->configured = 1; return 0; -} +free_and_out: + cpqhp_destroy_resource_list (&temp_resources); + return_resource(&(resources-> bus_head), hold_bus_node); + return_resource(&(resources-> io_head), hold_IO_node); + return_resource(&(resources-> mem_head), hold_mem_node); + return_resource(&(resources-> p_mem_head), hold_p_mem_node); + return rc; +} diff -Nru a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c --- a/drivers/pci/hotplug/cpqphp_pci.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/cpqphp_pci.c Tue May 4 22:16:06 2004 @@ -722,23 +722,23 @@ devfn = PCI_DEVFN(func->device, func->function); // Save the command register - pci_bus_read_config_word (pci_bus, devfn, PCI_COMMAND, &save_command); + pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command); // disable card command = 0x00; - pci_bus_write_config_word (pci_bus, devfn, PCI_COMMAND, command); + pci_bus_write_config_word(pci_bus, devfn, PCI_COMMAND, command); // Check for Bridge - pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); + pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type); if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { // PCI-PCI Bridge // Clear Bridge Control Register command = 0x00; - pci_bus_write_config_word (pci_bus, devfn, PCI_BRIDGE_CONTROL, command); - pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); - pci_bus_read_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); + pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command); + pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); + pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); - bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + bus_node = kmalloc(sizeof(*bus_node), GFP_KERNEL); if (!bus_node) return -ENOMEM; @@ -749,11 +749,11 @@ func->bus_head = bus_node; // Save IO base and Limit registers - pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_BASE, &b_base); - pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_LIMIT, &b_length); + pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &b_base); + pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &b_length); if ((b_base <= b_length) && (save_command & 0x01)) { - io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof(*io_node), GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -765,11 +765,11 @@ } // Save memory base and Limit registers - pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_BASE, &w_base); - pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); + pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base); + pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (save_command & 0x02)) { - mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + mem_node = kmalloc(sizeof(*mem_node), GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -781,11 +781,11 @@ } // Save prefetchable memory base and Limit registers - pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); - pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); + pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); + pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (save_command & 0x02)) { - p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + p_mem_node = kmalloc(sizeof(*p_mem_node), GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -800,8 +800,8 @@ pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base); temp_register = 0xFFFFFFFF; - pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); - pci_bus_read_config_dword (pci_bus, devfn, cloop, &base); + pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register); + pci_bus_read_config_dword(pci_bus, devfn, cloop, &base); temp_register = base; @@ -813,7 +813,8 @@ temp_register = base & 0xFFFFFFFE; temp_register = (~temp_register) + 1; - io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof(*io_node), + GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -830,7 +831,8 @@ temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + p_mem_node = kmalloc(sizeof(*p_mem_node), + GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -846,7 +848,8 @@ temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + mem_node = kmalloc(sizeof(*mem_node), + GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -862,11 +865,11 @@ } else if ((header_type & 0x7F) == 0x00) { // Standard header // Figure out IO and memory base lengths for (cloop = 0x10; cloop <= 0x24; cloop += 4) { - pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base); + pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base); temp_register = 0xFFFFFFFF; - pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); - pci_bus_read_config_dword (pci_bus, devfn, cloop, &base); + pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register); + pci_bus_read_config_dword(pci_bus, devfn, cloop, &base); temp_register = base; @@ -878,7 +881,8 @@ temp_register = base & 0xFFFFFFFE; temp_register = (~temp_register) + 1; - io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof(*io_node), + GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -894,7 +898,8 @@ temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + p_mem_node = kmalloc(sizeof(*p_mem_node), + GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -910,7 +915,8 @@ temp_register = base & 0xFFFFFFF0; temp_register = (~temp_register) + 1; - mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + mem_node = kmalloc(sizeof(*mem_node), + GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -1293,14 +1299,15 @@ temp_dword = io_base + io_length; if ((io_base) && (temp_dword < 0x10000)) { - io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof(*io_node), GFP_KERNEL); if (!io_node) return -ENOMEM; io_node->base = io_base; io_node->length = io_length; - dbg("found io_node(base, length) = %x, %x\n", io_node->base, io_node->length); + dbg("found io_node(base, length) = %x, %x\n", + io_node->base, io_node->length); dbg("populated slot =%d \n", populated_slot); if (!populated_slot) { io_node->next = ctrl->io_head; @@ -1314,7 +1321,7 @@ // If we've got a valid memory base, use it temp_dword = mem_base + mem_length; if ((mem_base) && (temp_dword < 0x10000)) { - mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + mem_node = kmalloc(sizeof(*mem_node), GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -1322,7 +1329,8 @@ mem_node->length = mem_length << 16; - dbg("found mem_node(base, length) = %x, %x\n", mem_node->base, mem_node->length); + dbg("found mem_node(base, length) = %x, %x\n", + mem_node->base, mem_node->length); dbg("populated slot =%d \n", populated_slot); if (!populated_slot) { mem_node->next = ctrl->mem_head; @@ -1337,14 +1345,15 @@ // the base + length isn't greater than 0xFFFF temp_dword = pre_mem_base + pre_mem_length; if ((pre_mem_base) && (temp_dword < 0x10000)) { - p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + p_mem_node = kmalloc(sizeof(*p_mem_node), GFP_KERNEL); if (!p_mem_node) return -ENOMEM; p_mem_node->base = pre_mem_base << 16; p_mem_node->length = pre_mem_length << 16; - dbg("found p_mem_node(base, length) = %x, %x\n", p_mem_node->base, p_mem_node->length); + dbg("found p_mem_node(base, length) = %x, %x\n", + p_mem_node->base, p_mem_node->length); dbg("populated slot =%d \n", populated_slot); if (!populated_slot) { @@ -1360,13 +1369,14 @@ // The second condition is to ignore bus numbers on // populated slots that don't have PCI-PCI bridges if (secondary_bus && (secondary_bus != primary_bus)) { - bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + bus_node = kmalloc(sizeof(*bus_node), GFP_KERNEL); if (!bus_node) return -ENOMEM; bus_node->base = secondary_bus; bus_node->length = max_bus - secondary_bus + 1; - dbg("found bus_node(base, length) = %x, %x\n", bus_node->base, bus_node->length); + dbg("found bus_node(base, length) = %x, %x\n", + bus_node->base, bus_node->length); dbg("populated slot =%d \n", populated_slot); if (!populated_slot) { bus_node->next = ctrl->bus_head; diff -Nru a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c --- a/drivers/pci/hotplug/pci_hotplug_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/pci_hotplug_core.c Tue May 4 22:16:06 2004 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -45,11 +46,7 @@ #include "pci_hotplug.h" -#if !defined(CONFIG_HOTPLUG_PCI_MODULE) - #define MY_NAME "pci_hotplug" -#else - #define MY_NAME THIS_MODULE->name -#endif +#define MY_NAME "pci_hotplug" #define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0) #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg) @@ -704,7 +701,7 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "i"); +module_param(debug, bool, 644); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); EXPORT_SYMBOL_GPL(pci_hotplug_slots_subsys); diff -Nru a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h --- a/drivers/pci/hotplug/pciehp.h Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/pciehp.h Tue May 4 22:16:06 2004 @@ -35,11 +35,7 @@ #include #include "pci_hotplug.h" -#if !defined(CONFIG_HOTPLUG_PCI_PCIE_MODULE) - #define MY_NAME "pciehp" -#else - #define MY_NAME THIS_MODULE->name -#endif +#define MY_NAME "pciehp" extern int pciehp_poll_mode; extern int pciehp_poll_time; @@ -72,9 +68,7 @@ struct pci_dev* pci_dev; }; -#define SLOT_MAGIC 0x67267321 struct slot { - u32 magic; struct slot *next; u8 bus; u8 device; @@ -108,9 +102,9 @@ struct controller { struct controller *next; struct semaphore crit_sect; /* critical section semaphore */ - void * hpc_ctlr_handle; /* HPC controller handle */ + void *hpc_ctlr_handle; /* HPC controller handle */ int num_slots; /* Number of slots on ctlr */ - int slot_num_inc; /* 1 or -1 */ + int slot_num_inc; /* 1 or -1 */ struct pci_resource *mem_head; struct pci_resource *p_mem_head; struct pci_resource *io_head; @@ -191,7 +185,7 @@ #define msg_initialization_err "Initialization failure, error=%d\n" #define msg_HPC_rev_error "Unsupported revision of the PCI hot plug controller found.\n" #define msg_HPC_non_pcie "The PCI hot plug controller is not supported by this driver.\n" -#define msg_HPC_not_supported "This system is not supported by this version of pciephd mdoule. Upgrade to a newer version of pciehpd\n" +#define msg_HPC_not_supported "This system is not supported by this version of pciephd module. Upgrade to a newer version of pciehpd\n" #define msg_unable_to_save "Unable to store PCI hot plug add resource information. This system must be rebooted before adding any PCI devices.\n" #define msg_button_on "PCI slot #%d - powering on due to button press.\n" #define msg_button_off "PCI slot #%d - powering off due to button press.\n" @@ -239,47 +233,10 @@ /* Inline functions */ - -/* Inline functions to check the sanity of a pointer that is passed to us */ -static inline int slot_paranoia_check (struct slot *slot, const char *function) -{ - if (!slot) { - dbg("%s - slot == NULL", function); - return -1; - } - if (slot->magic != SLOT_MAGIC) { - dbg("%s - bad magic number for slot", function); - return -1; - } - if (!slot->hotplug_slot) { - dbg("%s - slot->hotplug_slot == NULL!", function); - return -1; - } - return 0; -} - -static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function) -{ - struct slot *slot; - - if (!hotplug_slot) { - dbg("%s - hotplug_slot == NULL\n", function); - return NULL; - } - - slot = (struct slot *)hotplug_slot->private; - if (slot_paranoia_check (slot, function)) - return NULL; - return slot; -} - -static inline struct slot *pciehp_find_slot (struct controller *ctrl, u8 device) +static inline struct slot *pciehp_find_slot(struct controller *ctrl, u8 device) { struct slot *p_slot, *tmp_slot = NULL; - if (!ctrl) - return NULL; - p_slot = ctrl->slot; dbg("p_slot = %p\n", p_slot); @@ -294,10 +251,10 @@ p_slot = tmp_slot; } - return (p_slot); + return p_slot; } -static inline int wait_for_ctrl_irq (struct controller *ctrl) +static inline int wait_for_ctrl_irq(struct controller *ctrl) { int retval = 0; @@ -345,7 +302,7 @@ typedef u8(*php_intr_callback_t) (unsigned int change_id, void *instance_id); -int pcie_init( struct controller *ctrl, struct pci_dev *pdev, +int pcie_init(struct controller *ctrl, struct pci_dev *pdev, php_intr_callback_t attention_button_callback, php_intr_callback_t switch_change_callback, php_intr_callback_t presence_change_callback, @@ -353,7 +310,7 @@ /* This has no meaning for PCI Express, as there is only 1 slot per port */ -int pcie_get_ctlr_slot_config( struct controller *ctrl, +int pcie_get_ctlr_slot_config(struct controller *ctrl, int *num_ctlr_slots, int *first_device_num, int *physical_slot_num, @@ -361,12 +318,12 @@ int *flags); struct hpc_ops { - int (*power_on_slot ) (struct slot *slot); - int (*power_off_slot ) (struct slot *slot); - int (*get_power_status) (struct slot *slot, u8 *status); + int (*power_on_slot) (struct slot *slot); + int (*power_off_slot) (struct slot *slot); + int (*get_power_status) (struct slot *slot, u8 *status); int (*get_attention_status) (struct slot *slot, u8 *status); int (*set_attention_status) (struct slot *slot, u8 status); - int (*get_latch_status) (struct slot *slot, u8 *status); + int (*get_latch_status) (struct slot *slot, u8 *status); int (*get_adapter_status) (struct slot *slot, u8 *status); int (*get_max_bus_speed) (struct slot *slot, enum pci_bus_speed *speed); @@ -380,7 +337,7 @@ void (*green_led_off) (struct slot *slot); void (*green_led_blink) (struct slot *slot); void (*release_ctlr) (struct controller *ctrl); - int (*check_lnk_status) (struct controller *ctrl); + int (*check_lnk_status) (struct controller *ctrl); }; #endif /* _PCIEHP_H */ diff -Nru a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c --- a/drivers/pci/hotplug/pciehp_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/pciehp_core.c Tue May 4 22:16:06 2004 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -45,7 +46,7 @@ int pciehp_debug; int pciehp_poll_mode; int pciehp_poll_time; -struct controller *pciehp_ctrl_list; /* = NULL */ +struct controller *pciehp_ctrl_list; struct pci_func *pciehp_slot_list[256]; #define DRIVER_VERSION "0.4" @@ -56,20 +57,19 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM(pciehp_debug, "i"); -MODULE_PARM(pciehp_poll_mode, "i"); -MODULE_PARM(pciehp_poll_time, "i"); +module_param(pciehp_debug, bool, 644); +module_param(pciehp_poll_mode, bool, 644); +module_param(pciehp_poll_time, int, 644); MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not"); MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not"); MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds"); #define PCIE_MODULE_NAME "pciehp" -static int pcie_start_thread (void); +static int pcie_start_thread(void); static int set_attention_status (struct hotplug_slot *slot, u8 value); static int enable_slot (struct hotplug_slot *slot); static int disable_slot (struct hotplug_slot *slot); -static int hardware_test (struct hotplug_slot *slot, u32 value); static int get_power_status (struct hotplug_slot *slot, u8 *value); static int get_attention_status (struct hotplug_slot *slot, u8 *value); static int get_latch_status (struct hotplug_slot *slot, u8 *value); @@ -82,7 +82,6 @@ .set_attention_status = set_attention_status, .enable_slot = enable_slot, .disable_slot = disable_slot, - .hardware_test = hardware_test, .get_power_status = get_power_status, .get_attention_status = get_attention_status, .get_latch_status = get_latch_status, @@ -97,7 +96,7 @@ u8 number_of_slots; u8 slot_device; u32 slot_number; - int result; + int result = -ENOMEM; dbg("%s\n",__FUNCTION__); @@ -106,34 +105,30 @@ slot_number = ctrl->first_slot; while (number_of_slots) { - new_slot = (struct slot *) kmalloc(sizeof(struct slot), GFP_KERNEL); + new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL); if (!new_slot) - return -ENOMEM; + goto error; memset(new_slot, 0, sizeof(struct slot)); - new_slot->hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL); - if (!new_slot->hotplug_slot) { - kfree (new_slot); - return -ENOMEM; - } - memset(new_slot->hotplug_slot, 0, sizeof (struct hotplug_slot)); - - new_slot->hotplug_slot->info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); - if (!new_slot->hotplug_slot->info) { - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return -ENOMEM; - } - memset(new_slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info)); - new_slot->hotplug_slot->name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL); - if (!new_slot->hotplug_slot->name) { - kfree (new_slot->hotplug_slot->info); - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return -ENOMEM; - } + new_slot->hotplug_slot = + kmalloc(sizeof(*(new_slot->hotplug_slot)), + GFP_KERNEL); + if (!new_slot->hotplug_slot) + goto error_slot; + memset(new_slot->hotplug_slot, 0, sizeof(struct hotplug_slot)); + + new_slot->hotplug_slot->info = + kmalloc(sizeof(*(new_slot->hotplug_slot->info)), + GFP_KERNEL); + if (!new_slot->hotplug_slot->info) + goto error_hpslot; + memset(new_slot->hotplug_slot->info, 0, + sizeof(struct hotplug_slot_info)); + new_slot->hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, + GFP_KERNEL); + if (!new_slot->hotplug_slot->name) + goto error_info; - new_slot->magic = SLOT_MAGIC; new_slot->ctrl = ctrl; new_slot->bus = ctrl->slot_bus; new_slot->device = slot_device; @@ -147,21 +142,22 @@ make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot); new_slot->hotplug_slot->ops = &pciehp_hotplug_slot_ops; - new_slot->hpc_ops->get_power_status(new_slot, &(new_slot->hotplug_slot->info->power_status)); - new_slot->hpc_ops->get_attention_status(new_slot, &(new_slot->hotplug_slot->info->attention_status)); - new_slot->hpc_ops->get_latch_status(new_slot, &(new_slot->hotplug_slot->info->latch_status)); - new_slot->hpc_ops->get_adapter_status(new_slot, &(new_slot->hotplug_slot->info->adapter_status)); + new_slot->hpc_ops->get_power_status(new_slot, + &(new_slot->hotplug_slot->info->power_status)); + new_slot->hpc_ops->get_attention_status(new_slot, + &(new_slot->hotplug_slot->info->attention_status)); + new_slot->hpc_ops->get_latch_status(new_slot, + &(new_slot->hotplug_slot->info->latch_status)); + new_slot->hpc_ops->get_adapter_status(new_slot, + &(new_slot->hotplug_slot->info->adapter_status)); dbg("Registering bus=%x dev=%x hp_slot=%x sun=%x slot_device_offset=%x\n", - new_slot->bus, new_slot->device, new_slot->hp_slot, new_slot->number, ctrl->slot_device_offset); - result = pci_hp_register (new_slot->hotplug_slot); + new_slot->bus, new_slot->device, new_slot->hp_slot, + new_slot->number, ctrl->slot_device_offset); + result = pci_hp_register(new_slot->hotplug_slot); if (result) { err ("pci_hp_register failed with error %d\n", result); - kfree (new_slot->hotplug_slot->info); - kfree (new_slot->hotplug_slot->name); - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return result; + goto error_name; } new_slot->next = ctrl->slot; @@ -172,11 +168,22 @@ slot_number += ctrl->slot_num_inc; } - return(0); + return 0; + +error_name: + kfree(new_slot->hotplug_slot->name); +error_info: + kfree(new_slot->hotplug_slot->info); +error_hpslot: + kfree(new_slot->hotplug_slot); +error_slot: + kfree(new_slot); +error: + return result; } -static int cleanup_slots (struct controller * ctrl) +static int cleanup_slots(struct controller * ctrl) { struct slot *old_slot, *next_slot; @@ -185,7 +192,7 @@ while (old_slot) { next_slot = old_slot->next; - pci_hp_deregister (old_slot->hotplug_slot); + pci_hp_deregister(old_slot->hotplug_slot); kfree(old_slot->hotplug_slot->info); kfree(old_slot->hotplug_slot->name); kfree(old_slot->hotplug_slot); @@ -206,9 +213,11 @@ int rc; int flags; /* Not needed */ - rc = pcie_get_ctlr_slot_config(ctrl, &num_ctlr_slots, &first_device_num, &physical_slot_num, &updown, &flags); + rc = pcie_get_ctlr_slot_config(ctrl, &num_ctlr_slots, &first_device_num, + &physical_slot_num, &updown, &flags); if (rc) { - err("%s: get_ctlr_slot_config fail for b:d (%x:%x)\n", __FUNCTION__, ctrl->bus, ctrl->device); + err("%s: get_ctlr_slot_config fail for b:d (%x:%x)\n", + __FUNCTION__, ctrl->bus, ctrl->device); return (-1); } @@ -218,8 +227,8 @@ ctrl->slot_num_inc = updown; /* Not needed */ /* either -1 or 1 */ dbg("%s: bus(0x%x) num_slot(0x%x) 1st_dev(0x%x) psn(0x%x) updown(%d) for b:d (%x:%x)\n", - __FUNCTION__, ctrl->slot_bus, num_ctlr_slots, first_device_num, physical_slot_num, updown, - ctrl->bus, ctrl->device); + __FUNCTION__, ctrl->slot_bus, num_ctlr_slots, first_device_num, + physical_slot_num, updown, ctrl->bus, ctrl->device); return (0); } @@ -228,13 +237,10 @@ /* * set_attention_status - Turns the Amber LED for a slot on, off or blink */ -static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) +static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; - if (slot == NULL) - return -ENODEV; - dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); hotplug_slot->info->attention_status = status; @@ -244,12 +250,9 @@ } -static int enable_slot (struct hotplug_slot *hotplug_slot) +static int enable_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -257,33 +260,20 @@ } -static int disable_slot (struct hotplug_slot *hotplug_slot) +static int disable_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); return pciehp_disable_slot(slot); } - -static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value) -{ - return 0; -} - - -static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_power_status(slot, value); @@ -293,14 +283,11 @@ return 0; } -static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_attention_status(slot, value); @@ -310,14 +297,11 @@ return 0; } -static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_latch_status(slot, value); @@ -327,31 +311,24 @@ return 0; } -static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_adapter_status(slot, value); - if (retval < 0) *value = hotplug_slot->info->adapter_status; return 0; } -static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) +static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -362,13 +339,10 @@ return 0; } -static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) +static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -388,7 +362,7 @@ int num_ctlr_slots; /* number of slots supported by this HPC */ u8 value; - ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL); + ctrl = kmalloc(sizeof(*ctrl), GFP_KERNEL); if (!ctrl) { err("%s : out of memory\n", __FUNCTION__); goto err_out_none; @@ -411,21 +385,22 @@ pci_set_drvdata(pdev, ctrl); - ctrl->pci_bus = kmalloc (sizeof (*ctrl->pci_bus), GFP_KERNEL); + ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL); if (!ctrl->pci_bus) { err("%s: out of memory\n", __FUNCTION__); rc = -ENOMEM; goto err_out_unmap_mmio_region; } dbg("%s: ctrl->pci_bus %p\n", __FUNCTION__, ctrl->pci_bus); - memcpy (ctrl->pci_bus, pdev->bus, sizeof (*ctrl->pci_bus)); + memcpy(ctrl->pci_bus, pdev->bus, sizeof(*ctrl->pci_bus)); ctrl->bus = pdev->bus->number; /* ctrl bus */ ctrl->slot_bus = pdev->subordinate->number; /* bus controlled by this HPC */ ctrl->device = PCI_SLOT(pdev->devfn); ctrl->function = PCI_FUNC(pdev->devfn); - dbg("%s: ctrl bus=0x%x, device=%x, function=%x, irq=%x\n", __FUNCTION__, - ctrl->bus, ctrl->device, ctrl->function, pdev->irq); + dbg("%s: ctrl bus=0x%x, device=%x, function=%x, irq=%x\n", + __FUNCTION__, ctrl->bus, ctrl->device, + ctrl->function, pdev->irq); /* * Save configuration headers for this and subordinate PCI buses @@ -442,9 +417,11 @@ /* Store PCI Config Space for all devices on this bus */ dbg("%s: Before calling pciehp_save_config, ctrl->bus %x,ctrl->slot_bus %x\n", __FUNCTION__,ctrl->bus, ctrl->slot_bus); - rc = pciehp_save_config(ctrl, ctrl->slot_bus, num_ctlr_slots, first_device_num); + rc = pciehp_save_config(ctrl, ctrl->slot_bus, num_ctlr_slots, + first_device_num); if (rc) { - err("%s: unable to save PCI configuration data, error %d\n", __FUNCTION__, rc); + err("%s: unable to save PCI configuration data, error %d\n", + __FUNCTION__, rc); goto err_out_free_ctrl_bus; } @@ -471,31 +448,23 @@ /* Finish setting up the hot plug ctrl device */ ctrl->next_event = 0; - if (!pciehp_ctrl_list) { - pciehp_ctrl_list = ctrl; - ctrl->next = NULL; - } else { - ctrl->next = pciehp_ctrl_list; - pciehp_ctrl_list = ctrl; - } + pciehp_ctrl_list = ctrl; + ctrl->next = NULL; - /* Wait for exclusive access to hardware */ down(&ctrl->crit_sect); t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */ dbg("%s: adpater value %x\n", __FUNCTION__, value); if (!value) { - rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/ + rc = t_slot->hpc_ops->power_off_slot(t_slot); if (rc) { - /* Done with exclusive hardware access */ up(&ctrl->crit_sect); goto err_out_free_ctrl_slot; } else /* Wait for the command to complete */ - wait_for_ctrl_irq (ctrl); + wait_for_ctrl_irq(ctrl); } - /* Done with exclusive hardware access */ up(&ctrl->crit_sect); return 0; @@ -513,10 +482,10 @@ } -static int pcie_start_thread(void) +static int __init pcie_start_thread(void) { int loop; - int retval = 0; + int retval; dbg("Initialize + Start the notification/polling mechanism \n"); @@ -535,49 +504,35 @@ return retval; } +static inline void __exit +free_pciehp_res(struct pci_resource *res) +{ + struct pci_resource *tres; + + while (res) { + tres = res; + res = res->next; + kfree(tres); + } +} -static void unload_pciehpd(void) +static void __exit unload_pciehpd(void) { struct pci_func *next; struct pci_func *TempSlot; int loop; struct controller *ctrl; struct controller *tctrl; - struct pci_resource *res; - struct pci_resource *tres; ctrl = pciehp_ctrl_list; while (ctrl) { cleanup_slots(ctrl); - res = ctrl->io_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = ctrl->mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = ctrl->p_mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = ctrl->bus_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } + free_pciehp_res(ctrl->io_head); + free_pciehp_res(ctrl->mem_head); + free_pciehp_res(ctrl->p_mem_head); + free_pciehp_res(ctrl->bus_head); kfree (ctrl->pci_bus); @@ -592,33 +547,10 @@ for (loop = 0; loop < 256; loop++) { next = pciehp_slot_list[loop]; while (next != NULL) { - res = next->io_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = next->mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = next->p_mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = next->bus_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } + free_pciehp_res(ctrl->io_head); + free_pciehp_res(ctrl->mem_head); + free_pciehp_res(ctrl->p_mem_head); + free_pciehp_res(ctrl->bus_head); TempSlot = next; next = next->next; @@ -700,8 +632,5 @@ info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); } - module_init(pcied_init); module_exit(pcied_cleanup); - - diff -Nru a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c --- a/drivers/pci/hotplug/pciehp_ctrl.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/pciehp_ctrl.c Tue May 4 22:16:06 2004 @@ -251,12 +251,10 @@ } -/* - * sort_by_size - * - * Sorts nodes on the list by their length. - * Smallest first. +/** + * sort_by_size: sort nodes by their length, smallest first. * + * @head: list to sort */ static int sort_by_size(struct pci_resource **head) { @@ -265,10 +263,10 @@ int out_of_order = 1; if (!(*head)) - return(1); + return 1; if (!((*head)->next)) - return(0); + return 0; while (out_of_order) { out_of_order = 0; @@ -298,7 +296,7 @@ } } /* End of out_of_order loop */ - return(0); + return 0; } @@ -316,10 +314,10 @@ int out_of_order = 1; if (!(*head)) - return(1); + return 1; if (!((*head)->next)) - return(0); + return 0; while (out_of_order) { out_of_order = 0; @@ -349,17 +347,18 @@ } } /* End of out_of_order loop */ - return(0); + return 0; } -/* - * do_pre_bridge_resource_split - * - * Returns zero or one node of resources that aren't in use +/** + * do_pre_bridge_resource_split: return one unused resource node + * @head: list to scan * */ -static struct pci_resource *do_pre_bridge_resource_split (struct pci_resource **head, struct pci_resource **orig_head, u32 alignment) +static struct pci_resource * +do_pre_bridge_resource_split(struct pci_resource **head, + struct pci_resource **orig_head, u32 alignment) { struct pci_resource *prevnode = NULL; struct pci_resource *node; @@ -369,18 +368,18 @@ dbg("do_pre_bridge_resource_split\n"); if (!(*head) || !(*orig_head)) - return(NULL); + return NULL; rc = pciehp_resource_sort_and_combine(head); if (rc) - return(NULL); + return NULL; if ((*head)->base != (*orig_head)->base) - return(NULL); + return NULL; if ((*head)->length == (*orig_head)->length) - return(NULL); + return NULL; /* If we got here, there the bridge requires some of the resource, but @@ -392,10 +391,10 @@ /* this one isn't an aligned length, so we'll make a new entry * and split it up. */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; temp_dword = (node->length | (alignment-1)) + 1 - alignment; @@ -410,34 +409,32 @@ split_node->next = node; } - if (node->length < alignment) { - return(NULL); - } + if (node->length < alignment) + return NULL; /* Now unlink it */ if (*head == node) { *head = node->next; - node->next = NULL; } else { prevnode = *head; while (prevnode->next != node) prevnode = prevnode->next; prevnode->next = node->next; - node->next = NULL; } + node->next = NULL; - return(node); + return node; } -/* - * do_bridge_resource_split - * - * Returns zero or one node of resources that aren't in use +/** + * do_bridge_resource_split: return one unused resource node + * @head: list to scan * */ -static struct pci_resource *do_bridge_resource_split (struct pci_resource **head, u32 alignment) +static struct pci_resource * +do_bridge_resource_split(struct pci_resource **head, u32 alignment) { struct pci_resource *prevnode = NULL; struct pci_resource *node; @@ -445,12 +442,12 @@ u32 temp_dword; if (!(*head)) - return(NULL); + return NULL; rc = pciehp_resource_sort_and_combine(head); if (rc) - return(NULL); + return NULL; node = *head; @@ -462,7 +459,7 @@ if (node->length < alignment) { kfree(node); - return(NULL); + return NULL; } if (node->base & (alignment - 1)) { @@ -470,7 +467,7 @@ temp_dword = (node->base | (alignment-1)) + 1; if ((node->length - (temp_dword - node->base)) < alignment) { kfree(node); - return(NULL); + return NULL; } node->length -= (temp_dword - node->base); @@ -480,10 +477,10 @@ if (node->length & (alignment - 1)) { /* There's stuff in use after this node */ kfree(node); - return(NULL); + return NULL; } - return(node); + return node; } @@ -497,7 +494,7 @@ * * size must be a power of two. */ -static struct pci_resource *get_io_resource (struct pci_resource **head, u32 size) +static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size) { struct pci_resource *prevnode; struct pci_resource *node; @@ -505,13 +502,13 @@ u32 temp_dword; if (!(*head)) - return(NULL); + return NULL; if ( pciehp_resource_sort_and_combine(head) ) - return(NULL); + return NULL; if ( sort_by_size(head) ) - return(NULL); + return NULL; for (node = *head; node; node = node->next) { if (node->length < size) @@ -526,10 +523,11 @@ if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base; split_node->length = temp_dword - node->base; @@ -545,10 +543,11 @@ if (node->length > size) { /* this one is longer than we need so we'll make a new entry and split it up */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base + size; split_node->length = node->length - size; @@ -579,7 +578,7 @@ break; } - return(node); + return node; } @@ -592,7 +591,7 @@ * J.I. modified to put max size limits of; 64M->32M->16M->8M->4M->1M * This is needed to avoid allocating entire ACPI _CRS res to one child bridge/slot. */ -static struct pci_resource *get_max_resource (struct pci_resource **head, u32 size) +static struct pci_resource *get_max_resource(struct pci_resource **head, u32 size) { struct pci_resource *max; struct pci_resource *temp; @@ -602,13 +601,13 @@ int i; if (!(*head)) - return(NULL); + return NULL; if (pciehp_resource_sort_and_combine(head)) - return(NULL); + return NULL; if (sort_by_max_size(head)) - return(NULL); + return NULL; for (max = *head;max; max = max->next) { @@ -626,10 +625,11 @@ if ((max->length - (temp_dword - max->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = max->base; split_node->length = temp_dword - max->base; @@ -644,10 +644,11 @@ if ((max->base + max->length) & (size - 1)) { /* this one isn't end aligned properly at the top so we'll make a new entry and split it up */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; temp_dword = ((max->base + max->length) & ~(size - 1)); split_node->base = temp_dword; split_node->length = max->length + max->base @@ -665,9 +666,10 @@ for ( i = 0; max_size[i] > size; i++) { if (max->length > max_size[i]) { - split_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!split_node) - break; /* return (NULL); */ + break; /* return NULL; */ split_node->base = max->base + max_size[i]; split_node->length = max->length - max_size[i]; max->length = max_size[i]; @@ -691,11 +693,11 @@ } max->next = NULL; - return(max); + return max; } /* If we get here, we couldn't find one */ - return(NULL); + return NULL; } @@ -708,7 +710,7 @@ * * size must be a power of two. */ -static struct pci_resource *get_resource (struct pci_resource **head, u32 size) +static struct pci_resource *get_resource(struct pci_resource **head, u32 size) { struct pci_resource *prevnode; struct pci_resource *node; @@ -716,13 +718,13 @@ u32 temp_dword; if (!(*head)) - return(NULL); + return NULL; if ( pciehp_resource_sort_and_combine(head) ) - return(NULL); + return NULL; if ( sort_by_size(head) ) - return(NULL); + return NULL; for (node = *head; node; node = node->next) { dbg("%s: req_size =0x%x node=%p, base=0x%x, length=0x%x\n", @@ -740,10 +742,11 @@ if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base; split_node->length = temp_dword - node->base; @@ -760,10 +763,11 @@ dbg("%s: too big\n", __FUNCTION__); /* this one is longer than we need so we'll make a new entry and split it up */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!split_node) - return(NULL); + return NULL; split_node->base = node->base + size; split_node->length = node->length - size; @@ -790,7 +794,7 @@ /* Stop looping */ break; } - return(node); + return node; } @@ -812,12 +816,12 @@ dbg("%s: head = %p, *head = %p\n", __FUNCTION__, head, *head); if (!(*head)) - return(1); + return 1; dbg("*head->next = %p\n",(*head)->next); if (!(*head)->next) - return(0); /* only one item on the list, already sorted! */ + return 0; /* only one item on the list, already sorted! */ dbg("*head->base = 0x%x\n",(*head)->base); dbg("*head->next->base = 0x%x\n",(*head)->next->base); @@ -863,7 +867,7 @@ node1 = node1->next; } - return(0); + return 0; } @@ -878,11 +882,10 @@ struct pci_func *new_slot; struct pci_func *next; dbg("%s: busnumber %x\n", __FUNCTION__, busnumber); - new_slot = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL); + new_slot = kmalloc(sizeof(struct pci_func), GFP_KERNEL); - if (new_slot == NULL) { - return(new_slot); - } + if (new_slot == NULL) + return new_slot; memset(new_slot, 0, sizeof(struct pci_func)); @@ -897,11 +900,11 @@ next = next->next; next->next = new_slot; } - return(new_slot); + return new_slot; } -/* +/** * slot_remove - Removes a node from the linked list of slots. * @old_slot: slot to remove * @@ -912,19 +915,18 @@ struct pci_func *next; if (old_slot == NULL) - return(1); + return 1; next = pciehp_slot_list[old_slot->bus]; - if (next == NULL) { - return(1); - } + if (next == NULL) + return 1; if (next == old_slot) { pciehp_slot_list[old_slot->bus] = old_slot->next; pciehp_destroy_board_resources(old_slot); kfree(old_slot); - return(0); + return 0; } while ((next->next != old_slot) && (next->next != NULL)) { @@ -935,9 +937,9 @@ next->next = old_slot->next; pciehp_destroy_board_resources(old_slot); kfree(old_slot); - return(0); + return 0; } else - return(2); + return 2; } @@ -954,7 +956,7 @@ struct pci_func *next; if (bridge == NULL) - return(1); + return 1; secondaryBus = (bridge->config_space[0x06] >> 8) & 0xFF; subordinateBus = (bridge->config_space[0x06] >> 16) & 0xFF; @@ -970,13 +972,13 @@ next = pciehp_slot_list[bridge->bus]; if (next == NULL) { - return(1); + return 1; } if (next == bridge) { pciehp_slot_list[bridge->bus] = bridge->next; kfree(bridge); - return(0); + return 0; } while ((next->next != bridge) && (next->next != NULL)) { @@ -986,9 +988,9 @@ if (next->next == bridge) { next->next = bridge->next; kfree(bridge); - return(0); + return 0; } else - return(2); + return 2; } @@ -1016,7 +1018,7 @@ dbg("%s: func == NULL\n", __FUNCTION__); if ((func == NULL) || ((func->device == device) && (index == 0))) - return(func); + return func; if (func->device == device) found++; @@ -1035,11 +1037,11 @@ if ((found == index) || (func->function == index)) { dbg("%s: Found bus %x dev %x func %x\n", __FUNCTION__, func->bus, func->device, func->function); - return(func); + return func; } } - return(NULL); + return NULL; } static int is_bridge(struct pci_func * func) @@ -1187,7 +1189,7 @@ /* Done with exclusive hardware access */ up(&ctrl->crit_sect); - return(rc); + return rc; } pciehp_save_slot_config(ctrl, func); @@ -1251,7 +1253,7 @@ /* Done with exclusive hardware access */ up(&ctrl->crit_sect); - return(rc); + return rc; } return 0; } @@ -1273,10 +1275,10 @@ struct slot *p_slot; if (func == NULL) - return(1); + return 1; if (pciehp_unconfigure_device(func)) - return(1); + return 1; device = func->device; @@ -1370,7 +1372,7 @@ func = pciehp_slot_create(ctrl->slot_bus); if (func == NULL) { - return(1); + return 1; } func->bus = ctrl->slot_bus; @@ -1385,7 +1387,7 @@ } -static void pushbutton_helper_thread (unsigned long data) +static void pushbutton_helper_thread(unsigned long data) { pushbutton_pending = data; @@ -1420,7 +1422,7 @@ return 0; } -int pciehp_event_start_thread (void) +int pciehp_event_start_thread(void) { int pid; @@ -1440,7 +1442,7 @@ } -void pciehp_event_stop_thread (void) +void pciehp_event_stop_thread(void) { event_finished = 1; dbg("event_thread finish command given\n"); @@ -1450,13 +1452,13 @@ } -static int update_slot_info (struct slot *slot) +static int update_slot_info(struct slot *slot) { struct hotplug_slot_info *info; /* char buffer[SLOT_NAME_SIZE]; */ int result; - info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); + info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL); if (!info) return -ENOMEM; @@ -1603,8 +1605,6 @@ } } /* End of FOR loop */ } - - return; } @@ -1615,7 +1615,7 @@ * Handles all pending events and exits. * */ -void pciehp_pushbutton_thread (unsigned long slot) +void pciehp_pushbutton_thread(unsigned long slot) { struct slot *p_slot = (struct slot *) slot; u8 getstatus; @@ -1683,7 +1683,7 @@ } -int pciehp_enable_slot (struct slot *p_slot) +int pciehp_enable_slot(struct slot *p_slot) { u8 getstatus = 0; int rc; @@ -1692,7 +1692,7 @@ func = pciehp_slot_find(p_slot->bus, p_slot->device, 0); if (!func) { dbg("%s: Error! slot NULL\n", __FUNCTION__); - return (1); + return 1; } /* Check to see if (latch closed, card present, power off) */ @@ -1701,21 +1701,21 @@ if (rc || !getstatus) { info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number); up(&p_slot->ctrl->crit_sect); - return (0); + return 0; } rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); if (rc || getstatus) { info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number); up(&p_slot->ctrl->crit_sect); - return (0); + return 0; } rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); if (rc || getstatus) { info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number); up(&p_slot->ctrl->crit_sect); - return (0); + return 0; } up(&p_slot->ctrl->crit_sect); @@ -1723,7 +1723,7 @@ func = pciehp_slot_create(p_slot->bus); if (func == NULL) - return (1); + return 1; func->bus = p_slot->bus; func->device = p_slot->device; @@ -1746,7 +1746,7 @@ /* Setup slot structure with entry for empty slot */ func = pciehp_slot_create(p_slot->bus); if (func == NULL) - return (1); /* Out of memory */ + return 1; /* Out of memory */ func->bus = p_slot->bus; func->device = p_slot->device; @@ -1767,7 +1767,7 @@ } -int pciehp_disable_slot (struct slot *p_slot) +int pciehp_disable_slot(struct slot *p_slot) { u8 class_code, header_type, BCR; u8 index = 0; @@ -1779,7 +1779,7 @@ struct pci_func *func; if (!p_slot->ctrl) - return (1); + return 1; /* Check to see if (latch closed, card present, power on) */ down(&p_slot->ctrl->crit_sect); @@ -1788,21 +1788,21 @@ if (ret || !getstatus) { info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number); up(&p_slot->ctrl->crit_sect); - return (0); + return 0; } ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); if (ret || getstatus) { info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number); up(&p_slot->ctrl->crit_sect); - return (0); + return 0; } ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); if (ret || !getstatus) { info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number); up(&p_slot->ctrl->crit_sect); - return (0); + return 0; } up(&p_slot->ctrl->crit_sect); @@ -1854,7 +1854,7 @@ if (p_slot) update_slot_info(p_slot); - return(rc); + return rc; } @@ -1869,7 +1869,7 @@ * Returns 0 if success * */ -static u32 configure_new_device (struct controller * ctrl, struct pci_func * func, +static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, u8 behind_bridge, struct resource_lists * resources, u8 bridge_bus, u8 bridge_dev) { u8 temp_byte, function, max_functions, stop_it; @@ -1901,20 +1901,23 @@ function = 0; do { - rc = configure_new_function(ctrl, new_slot, behind_bridge, resources, bridge_bus, bridge_dev); + rc = configure_new_function(ctrl, new_slot, behind_bridge, + resources, bridge_bus, bridge_dev); if (rc) { - dbg("configure_new_function failed %d\n",rc); + dbg("configure_new_function failed: %d\n", rc); index = 0; while (new_slot) { - new_slot = pciehp_slot_find(new_slot->bus, new_slot->device, index++); + new_slot = pciehp_slot_find(new_slot->bus, + new_slot->device, index++); if (new_slot) - pciehp_return_board_resources(new_slot, resources); + pciehp_return_board_resources(new_slot, + resources); } - return(rc); + return rc; } function++; @@ -1936,7 +1939,7 @@ if (new_slot == NULL) { /* Out of memory */ - return(1); + return 1; } new_slot->bus = func->bus; @@ -1950,41 +1953,63 @@ } } while (function < max_functions); - dbg("returning from configure_new_device\n"); + dbg("returning from %s\n", __FUNCTION__); return 0; } - /* * Configuration logic that involves the hotplug data structures and * their bookkeeping */ - /** - * configure_new_function - Configures the PCI header information of one device - * - * @ctrl: pointer to controller structure - * @func: pointer to function structure - * @behind_bridge: 1 if this is a recursive call, 0 if not - * @resources: pointer to set of resource lists - * - * Calls itself recursively for bridged devices. - * Returns 0 if success - * + * configure_bridge: fill bridge's registers, either configure or disable it. */ -static int configure_new_function (struct controller * ctrl, struct pci_func * func, - u8 behind_bridge, struct resource_lists *resources, u8 bridge_bus, u8 bridge_dev) +static int +configure_bridge(struct pci_bus *pci_bus, unsigned int devfn, + struct pci_resource *mem_node, + struct pci_resource **hold_mem_node, + int base_addr, int limit_addr) +{ + u16 temp_word; + u32 rc; + + if (mem_node) { + memcpy(*hold_mem_node, mem_node, sizeof(struct pci_resource)); + mem_node->next = NULL; + + /* set Mem base and Limit registers */ + RES_CHECK(mem_node->base, 16); + temp_word = (u16)(mem_node->base >> 16); + rc = pci_bus_write_config_word(pci_bus, devfn, base_addr, temp_word); + + RES_CHECK(mem_node->base + mem_node->length - 1, 16); + temp_word = (u16)((mem_node->base + mem_node->length - 1) >> 16); + rc = pci_bus_write_config_word(pci_bus, devfn, limit_addr, temp_word); + } else { + temp_word = 0xFFFF; + rc = pci_bus_write_config_word(pci_bus, devfn, base_addr, temp_word); + + temp_word = 0x0000; + rc = pci_bus_write_config_word(pci_bus, devfn, limit_addr, temp_word); + + kfree(*hold_mem_node); + *hold_mem_node = NULL; + } + return rc; +} + +static int +configure_new_bridge(struct controller *ctrl, struct pci_func *func, + u8 behind_bridge, struct resource_lists *resources, + struct pci_bus *pci_bus) { int cloop; u8 temp_byte; u8 device; - u8 class_code; u16 temp_word; u32 rc; - u32 temp_register; - u32 base; u32 ID; unsigned int devfn; struct pci_resource *mem_node; @@ -1997,486 +2022,483 @@ struct pci_resource *hold_bus_node; struct irq_mapping irqs; struct pci_func *new_slot; - struct pci_bus lpci_bus, *pci_bus; struct resource_lists temp_resources; - memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus)); - pci_bus = &lpci_bus; - pci_bus->number = func->bus; devfn = PCI_DEVFN(func->device, func->function); - /* Check for Bridge */ - rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte); + /* set Primary bus */ + dbg("set Primary bus = 0x%x\n", func->bus); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_PRIMARY_BUS, func->bus); if (rc) return rc; - dbg("%s: bus %x dev %x func %x temp_byte = %x\n", __FUNCTION__, - func->bus, func->device, func->function, temp_byte); - if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */ - /* set Primary bus */ - dbg("set Primary bus = 0x%x\n", func->bus); - rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_PRIMARY_BUS, func->bus); - if (rc) - return rc; - - /* find range of busses to use */ - bus_node = get_max_resource(&resources->bus_head, 1L); - - /* If we don't have any busses to allocate, we can't continue */ - if (!bus_node) { - err("Got NO bus resource to use\n"); - return -ENOMEM; - } - dbg("Got ranges of buses to use: base:len=0x%x:%x\n", bus_node->base, bus_node->length); - - /* set Secondary bus */ - dbg("set Secondary bus = 0x%x\n", temp_byte); - dbg("func->bus %x\n", func->bus); - - temp_byte = (u8)bus_node->base; - dbg("set Secondary bus = 0x%x\n", temp_byte); - rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte); - if (rc) - return rc; + /* find range of busses to use */ + bus_node = get_max_resource(&resources->bus_head, 1L); - /* set subordinate bus */ - temp_byte = (u8)(bus_node->base + bus_node->length - 1); - dbg("set subordinate bus = 0x%x\n", temp_byte); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte); - if (rc) - return rc; - - /* Set HP parameters (Cache Line Size, Latency Timer) */ - rc = pciehprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_BRIDGE); - if (rc) - return rc; + /* If we don't have any busses to allocate, we can't continue */ + if (!bus_node) { + err("Got NO bus resource to use\n"); + return -ENOMEM; + } + dbg("Got ranges of buses to use: base:len=0x%x:%x\n", bus_node->base, bus_node->length); - /* Setup the IO, memory, and prefetchable windows */ + /* set Secondary bus */ + temp_byte = (u8)bus_node->base; + dbg("set Secondary bus = 0x%x\n", temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, temp_byte); + if (rc) + return rc; - io_node = get_max_resource(&(resources->io_head), 0x1000L); - if (io_node) { - dbg("io_node(base, len, next) (%x, %x, %p)\n", io_node->base, io_node->length, io_node->next); - } + /* set subordinate bus */ + temp_byte = (u8)(bus_node->base + bus_node->length - 1); + dbg("set subordinate bus = 0x%x\n", temp_byte); + rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte); + if (rc) + return rc; - mem_node = get_max_resource(&(resources->mem_head), 0x100000L); - if (mem_node) { - dbg("mem_node(base, len, next) (%x, %x, %p)\n", mem_node->base, mem_node->length, mem_node->next); - } + /* Set HP parameters (Cache Line Size, Latency Timer) */ + rc = pciehprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_BRIDGE); + if (rc) + return rc; - if (resources->p_mem_head) - p_mem_node = get_max_resource(&(resources->p_mem_head), 0x100000L); - else { - /* - * In some platform implementation, MEM and PMEM are not - * distinguished, and hence ACPI _CRS has only MEM entries - * for both MEM and PMEM. - */ - dbg("using MEM for PMEM\n"); - p_mem_node = get_max_resource(&(resources->mem_head), 0x100000L); - } - if (p_mem_node) { - dbg("p_mem_node(base, len, next) (%x, %x, %p)\n", p_mem_node->base, p_mem_node->length, p_mem_node->next); - } + /* Setup the IO, memory, and prefetchable windows */ - /* set up the IRQ info */ - if (!resources->irqs) { - irqs.barber_pole = 0; - irqs.interrupt[0] = 0; - irqs.interrupt[1] = 0; - irqs.interrupt[2] = 0; - irqs.interrupt[3] = 0; - irqs.valid_INT = 0; - } else { - irqs.barber_pole = resources->irqs->barber_pole; - irqs.interrupt[0] = resources->irqs->interrupt[0]; - irqs.interrupt[1] = resources->irqs->interrupt[1]; - irqs.interrupt[2] = resources->irqs->interrupt[2]; - irqs.interrupt[3] = resources->irqs->interrupt[3]; - irqs.valid_INT = resources->irqs->valid_INT; - } + io_node = get_max_resource(&(resources->io_head), 0x1000L); + if (io_node) { + dbg("io_node(base, len, next) (%x, %x, %p)\n", io_node->base, + io_node->length, io_node->next); + } - /* set up resource lists that are now aligned on top and bottom - * for anything behind the bridge. - */ - temp_resources.bus_head = bus_node; - temp_resources.io_head = io_node; - temp_resources.mem_head = mem_node; - temp_resources.p_mem_head = p_mem_node; - temp_resources.irqs = &irqs; + mem_node = get_max_resource(&(resources->mem_head), 0x100000L); + if (mem_node) { + dbg("mem_node(base, len, next) (%x, %x, %p)\n", mem_node->base, + mem_node->length, mem_node->next); + } - /* Make copies of the nodes we are going to pass down so that - * if there is a problem,we can just use these to free resources + if (resources->p_mem_head) + p_mem_node = get_max_resource(&(resources->p_mem_head), 0x100000L); + else { + /* + * In some platform implementation, MEM and PMEM are not + * distinguished, and hence ACPI _CRS has only MEM entries + * for both MEM and PMEM. */ - hold_bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_IO_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - - if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) { - if (hold_bus_node) - kfree(hold_bus_node); - if (hold_IO_node) - kfree(hold_IO_node); - if (hold_mem_node) - kfree(hold_mem_node); - if (hold_p_mem_node) - kfree(hold_p_mem_node); + dbg("using MEM for PMEM\n"); + p_mem_node = get_max_resource(&(resources->mem_head), 0x100000L); + } + if (p_mem_node) { + dbg("p_mem_node(base, len, next) (%x, %x, %p)\n", p_mem_node->base, + p_mem_node->length, p_mem_node->next); + } + + /* set up the IRQ info */ + if (!resources->irqs) { + irqs.barber_pole = 0; + irqs.interrupt[0] = 0; + irqs.interrupt[1] = 0; + irqs.interrupt[2] = 0; + irqs.interrupt[3] = 0; + irqs.valid_INT = 0; + } else { + irqs.barber_pole = resources->irqs->barber_pole; + irqs.interrupt[0] = resources->irqs->interrupt[0]; + irqs.interrupt[1] = resources->irqs->interrupt[1]; + irqs.interrupt[2] = resources->irqs->interrupt[2]; + irqs.interrupt[3] = resources->irqs->interrupt[3]; + irqs.valid_INT = resources->irqs->valid_INT; + } - return(1); - } + /* set up resource lists that are now aligned on top and bottom + * for anything behind the bridge. + */ + temp_resources.bus_head = bus_node; + temp_resources.io_head = io_node; + temp_resources.mem_head = mem_node; + temp_resources.p_mem_head = p_mem_node; + temp_resources.irqs = &irqs; - memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource)); + /* Make copies of the nodes we are going to pass down so that + * if there is a problem,we can just use these to free resources + */ + hold_bus_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + hold_IO_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + hold_mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + hold_p_mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + + if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) { + kfree(hold_bus_node); + kfree(hold_IO_node); + kfree(hold_mem_node); + kfree(hold_p_mem_node); - bus_node->base += 1; - bus_node->length -= 1; - bus_node->next = NULL; + return 1; + } - /* If we have IO resources copy them and fill in the bridge's - * IO range registers - */ - if (io_node) { - memcpy(hold_IO_node, io_node, sizeof(struct pci_resource)); - io_node->next = NULL; + memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource)); - /* set IO base and Limit registers */ - RES_CHECK(io_node->base, 8); - temp_byte = (u8)(io_node->base >> 8); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte); + bus_node->base += 1; + bus_node->length -= 1; + bus_node->next = NULL; - RES_CHECK(io_node->base + io_node->length - 1, 8); - temp_byte = (u8)((io_node->base + io_node->length - 1) >> 8); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte); - } else { - kfree(hold_IO_node); - hold_IO_node = NULL; - } + /* If we have IO resources copy them and fill in the bridge's + * IO range registers + */ + if (io_node) { + memcpy(hold_IO_node, io_node, sizeof(struct pci_resource)); + io_node->next = NULL; + + /* set IO base and Limit registers */ + RES_CHECK(io_node->base, 8); + temp_byte = (u8)(io_node->base >> 8); + rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte); + + RES_CHECK(io_node->base + io_node->length - 1, 8); + temp_byte = (u8)((io_node->base + io_node->length - 1) >> 8); + rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte); + } else { + kfree(hold_IO_node); + hold_IO_node = NULL; + } - /* If we have memory resources copy them and fill in the bridge's - * memory range registers. Otherwise, fill in the range - * registers with values that disable them. - */ - if (mem_node) { - memcpy(hold_mem_node, mem_node, sizeof(struct pci_resource)); - mem_node->next = NULL; + /* If we have memory resources copy them and fill in the bridge's + * memory range registers. Otherwise, fill in the range + * registers with values that disable them. + */ + rc = configure_bridge(pci_bus, devfn, mem_node, &hold_mem_node, + PCI_MEMORY_BASE, PCI_MEMORY_LIMIT); - /* set Mem base and Limit registers */ - RES_CHECK(mem_node->base, 16); - temp_word = (u32)(mem_node->base >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); + /* If we have prefetchable memory resources copy them and + * fill in the bridge's memory range registers. Otherwise, + * fill in the range registers with values that disable them. + */ + rc = configure_bridge(pci_bus, devfn, p_mem_node, &hold_p_mem_node, + PCI_PREF_MEMORY_BASE, PCI_PREF_MEMORY_LIMIT); - RES_CHECK(mem_node->base + mem_node->length - 1, 16); - temp_word = (u32)((mem_node->base + mem_node->length - 1) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); - } else { - temp_word = 0xFFFF; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); + /* Adjust this to compensate for extra adjustment in first loop */ + irqs.barber_pole--; - temp_word = 0x0000; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + rc = 0; - kfree(hold_mem_node); - hold_mem_node = NULL; - } + /* Here we actually find the devices and configure them */ + for (device = 0; (device <= 0x1F) && !rc; device++) { + irqs.barber_pole = (irqs.barber_pole + 1) & 0x03; - /* If we have prefetchable memory resources copy them and - * fill in the bridge's memory range registers. Otherwise, - * fill in the range registers with values that disable them. - */ - if (p_mem_node) { - memcpy(hold_p_mem_node, p_mem_node, sizeof(struct pci_resource)); - p_mem_node->next = NULL; + ID = 0xFFFFFFFF; + pci_bus->number = hold_bus_node->base; + pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID); + pci_bus->number = func->bus; - /* set Pre Mem base and Limit registers */ - RES_CHECK(p_mem_node->base, 16); - temp_word = (u32)(p_mem_node->base >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); + if (ID != 0xFFFFFFFF) { /* device Present */ + /* Setup slot structure. */ + new_slot = pciehp_slot_create(hold_bus_node->base); + + if (new_slot == NULL) { + /* Out of memory */ + rc = -ENOMEM; + continue; + } - RES_CHECK(p_mem_node->base + p_mem_node->length - 1, 16); - temp_word = (u32)((p_mem_node->base + p_mem_node->length - 1) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); - } else { - temp_word = 0xFFFF; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); + new_slot->bus = hold_bus_node->base; + new_slot->device = device; + new_slot->function = 0; + new_slot->is_a_board = 1; + new_slot->status = 0; + + rc = configure_new_device(ctrl, new_slot, 1, + &temp_resources, func->bus, + func->device); + dbg("configure_new_device rc=0x%x\n",rc); + } /* End of IF (device in slot?) */ + } /* End of FOR loop */ - temp_word = 0x0000; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); + if (rc) { + pciehp_destroy_resource_list(&temp_resources); - kfree(hold_p_mem_node); - hold_p_mem_node = NULL; - } + return_resource(&(resources->bus_head), hold_bus_node); + return_resource(&(resources->io_head), hold_IO_node); + return_resource(&(resources->mem_head), hold_mem_node); + return_resource(&(resources->p_mem_head), hold_p_mem_node); + return(rc); + } - /* Adjust this to compensate for extra adjustment in first loop */ - irqs.barber_pole--; + /* save the interrupt routing information */ + if (resources->irqs) { + resources->irqs->interrupt[0] = irqs.interrupt[0]; + resources->irqs->interrupt[1] = irqs.interrupt[1]; + resources->irqs->interrupt[2] = irqs.interrupt[2]; + resources->irqs->interrupt[3] = irqs.interrupt[3]; + resources->irqs->valid_INT = irqs.valid_INT; + } else if (!behind_bridge) { + /* We need to hook up the interrupts here */ + for (cloop = 0; cloop < 4; cloop++) { + if (irqs.valid_INT & (0x01 << cloop)) { + rc = pciehp_set_irq(func->bus, func->device, + 0x0A + cloop, irqs.interrupt[cloop]); + if (rc) { + pciehp_destroy_resource_list (&temp_resources); + return_resource(&(resources->bus_head), hold_bus_node); + return_resource(&(resources->io_head), hold_IO_node); + return_resource(&(resources->mem_head), hold_mem_node); + return_resource(&(resources->p_mem_head), hold_p_mem_node); + return rc; + } + } + } /* end of for loop */ + } - rc = 0; + /* Return unused bus resources + * First use the temporary node to store information for the board + */ + if (hold_bus_node && bus_node && temp_resources.bus_head) { + hold_bus_node->length = bus_node->base - hold_bus_node->base; - /* Here we actually find the devices and configure them */ - for (device = 0; (device <= 0x1F) && !rc; device++) { - irqs.barber_pole = (irqs.barber_pole + 1) & 0x03; + hold_bus_node->next = func->bus_head; + func->bus_head = hold_bus_node; - ID = 0xFFFFFFFF; - pci_bus->number = hold_bus_node->base; - pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID); - pci_bus->number = func->bus; + temp_byte = (u8)(temp_resources.bus_head->base - 1); - if (ID != 0xFFFFFFFF) { /* device Present */ - /* Setup slot structure. */ - new_slot = pciehp_slot_create(hold_bus_node->base); + /* set subordinate bus */ + dbg("re-set subordinate bus = 0x%x\n", temp_byte); + rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte); - if (new_slot == NULL) { - /* Out of memory */ - rc = -ENOMEM; - continue; - } + if (temp_resources.bus_head->length == 0) { + kfree(temp_resources.bus_head); + temp_resources.bus_head = NULL; + } else { + dbg("return bus res of b:d(0x%x:%x) base:len(0x%x:%x)\n", + func->bus, func->device, temp_resources.bus_head->base, temp_resources.bus_head->length); + return_resource(&(resources->bus_head), temp_resources.bus_head); + } + } - new_slot->bus = hold_bus_node->base; - new_slot->device = device; - new_slot->function = 0; - new_slot->is_a_board = 1; - new_slot->status = 0; + /* If we have IO space available and there is some left, + * return the unused portion + */ + if (hold_IO_node && temp_resources.io_head) { + io_node = do_pre_bridge_resource_split(&(temp_resources.io_head), + &hold_IO_node, 0x1000); - rc = configure_new_device(ctrl, new_slot, 1, &temp_resources, func->bus, func->device); - dbg("configure_new_device rc=0x%x\n",rc); - } /* End of IF (device in slot?) */ - } /* End of FOR loop */ + /* Check if we were able to split something off */ + if (io_node) { + hold_IO_node->base = io_node->base + io_node->length; - if (rc) { - pciehp_destroy_resource_list(&temp_resources); + RES_CHECK(hold_IO_node->base, 8); + temp_byte = (u8)((hold_IO_node->base) >> 8); + rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte); - return_resource(&(resources->bus_head), hold_bus_node); - return_resource(&(resources->io_head), hold_IO_node); - return_resource(&(resources->mem_head), hold_mem_node); - return_resource(&(resources->p_mem_head), hold_p_mem_node); - return(rc); - } - - /* save the interrupt routing information */ - if (resources->irqs) { - resources->irqs->interrupt[0] = irqs.interrupt[0]; - resources->irqs->interrupt[1] = irqs.interrupt[1]; - resources->irqs->interrupt[2] = irqs.interrupt[2]; - resources->irqs->interrupt[3] = irqs.interrupt[3]; - resources->irqs->valid_INT = irqs.valid_INT; - } else if (!behind_bridge) { - /* We need to hook up the interrupts here */ - for (cloop = 0; cloop < 4; cloop++) { - if (irqs.valid_INT & (0x01 << cloop)) { - rc = pciehp_set_irq(func->bus, func->device, - 0x0A + cloop, irqs.interrupt[cloop]); - if (rc) { - pciehp_destroy_resource_list (&temp_resources); - return_resource(&(resources->bus_head), hold_bus_node); - return_resource(&(resources->io_head), hold_IO_node); - return_resource(&(resources->mem_head), hold_mem_node); - return_resource(&(resources->p_mem_head), hold_p_mem_node); - return rc; - } - } - } /* end of for loop */ + return_resource(&(resources->io_head), io_node); } - /* Return unused bus resources - * First use the temporary node to store information for the board - */ - if (hold_bus_node && bus_node && temp_resources.bus_head) { - hold_bus_node->length = bus_node->base - hold_bus_node->base; + io_node = do_bridge_resource_split(&(temp_resources.io_head), 0x1000); - hold_bus_node->next = func->bus_head; - func->bus_head = hold_bus_node; + /* Check if we were able to split something off */ + if (io_node) { + /* First use the temporary node to store information for the board */ + hold_IO_node->length = io_node->base - hold_IO_node->base; - temp_byte = (u8)(temp_resources.bus_head->base - 1); + /* If we used any, add it to the board's list */ + if (hold_IO_node->length) { + hold_IO_node->next = func->io_head; + func->io_head = hold_IO_node; - /* set subordinate bus */ - dbg("re-set subordinate bus = 0x%x\n", temp_byte); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, temp_byte); + RES_CHECK(io_node->base - 1, 8); + temp_byte = (u8)((io_node->base - 1) >> 8); + rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte); - if (temp_resources.bus_head->length == 0) { - kfree(temp_resources.bus_head); - temp_resources.bus_head = NULL; + return_resource(&(resources->io_head), io_node); } else { - dbg("return bus res of b:d(0x%x:%x) base:len(0x%x:%x)\n", - func->bus, func->device, temp_resources.bus_head->base, temp_resources.bus_head->length); - return_resource(&(resources->bus_head), temp_resources.bus_head); - } - } - - /* If we have IO space available and there is some left, - * return the unused portion - */ - if (hold_IO_node && temp_resources.io_head) { - io_node = do_pre_bridge_resource_split(&(temp_resources.io_head), - &hold_IO_node, 0x1000); - - /* Check if we were able to split something off */ - if (io_node) { - hold_IO_node->base = io_node->base + io_node->length; - - RES_CHECK(hold_IO_node->base, 8); - temp_byte = (u8)((hold_IO_node->base) >> 8); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte); + /* it doesn't need any IO */ + temp_byte = 0x00; + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte); return_resource(&(resources->io_head), io_node); + kfree(hold_IO_node); } - - io_node = do_bridge_resource_split(&(temp_resources.io_head), 0x1000); - - /* Check if we were able to split something off */ - if (io_node) { - /* First use the temporary node to store information for the board */ - hold_IO_node->length = io_node->base - hold_IO_node->base; - - /* If we used any, add it to the board's list */ - if (hold_IO_node->length) { - hold_IO_node->next = func->io_head; - func->io_head = hold_IO_node; - - RES_CHECK(io_node->base - 1, 8); - temp_byte = (u8)((io_node->base - 1) >> 8); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte); - - return_resource(&(resources->io_head), io_node); - } else { - /* it doesn't need any IO */ - temp_byte = 0x00; - rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte); - - return_resource(&(resources->io_head), io_node); - kfree(hold_IO_node); - } - } else { - /* it used most of the range */ - hold_IO_node->next = func->io_head; - func->io_head = hold_IO_node; - } - } else if (hold_IO_node) { - /* it used the whole range */ + } else { + /* it used most of the range */ hold_IO_node->next = func->io_head; func->io_head = hold_IO_node; } + } else if (hold_IO_node) { + /* it used the whole range */ + hold_IO_node->next = func->io_head; + func->io_head = hold_IO_node; + } - /* If we have memory space available and there is some left, - * return the unused portion - */ - if (hold_mem_node && temp_resources.mem_head) { - mem_node = do_pre_bridge_resource_split(&(temp_resources.mem_head), &hold_mem_node, 0x100000L); + /* If we have memory space available and there is some left, + * return the unused portion + */ + if (hold_mem_node && temp_resources.mem_head) { + mem_node = do_pre_bridge_resource_split(&(temp_resources.mem_head), &hold_mem_node, 0x100000L); - /* Check if we were able to split something off */ - if (mem_node) { - hold_mem_node->base = mem_node->base + mem_node->length; - - RES_CHECK(hold_mem_node->base, 16); - temp_word = (u32)((hold_mem_node->base) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); + /* Check if we were able to split something off */ + if (mem_node) { + hold_mem_node->base = mem_node->base + mem_node->length; - return_resource(&(resources->mem_head), mem_node); - } + RES_CHECK(hold_mem_node->base, 16); + temp_word = (u16)((hold_mem_node->base) >> 16); + rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); - mem_node = do_bridge_resource_split(&(temp_resources.mem_head), 0x100000L); + return_resource(&(resources->mem_head), mem_node); + } - /* Check if we were able to split something off */ - if (mem_node) { - /* First use the temporary node to store information for the board */ - hold_mem_node->length = mem_node->base - hold_mem_node->base; - - if (hold_mem_node->length) { - hold_mem_node->next = func->mem_head; - func->mem_head = hold_mem_node; - - /* configure end address */ - RES_CHECK(mem_node->base - 1, 16); - temp_word = (u32)((mem_node->base - 1) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + mem_node = do_bridge_resource_split(&(temp_resources.mem_head), 0x100000L); - /* Return unused resources to the pool */ - return_resource(&(resources->mem_head), mem_node); - } else { - /* it doesn't need any Mem */ - temp_word = 0x0000; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + /* Check if we were able to split something off */ + if (mem_node) { + /* First use the temporary node to store information for the board */ + hold_mem_node->length = mem_node->base - hold_mem_node->base; - return_resource(&(resources->mem_head), mem_node); - kfree(hold_mem_node); - } - } else { - /* it used most of the range */ + if (hold_mem_node->length) { hold_mem_node->next = func->mem_head; func->mem_head = hold_mem_node; + + /* configure end address */ + RES_CHECK(mem_node->base - 1, 16); + temp_word = (u16)((mem_node->base - 1) >> 16); + rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + + /* Return unused resources to the pool */ + return_resource(&(resources->mem_head), mem_node); + } else { + /* it doesn't need any Mem */ + temp_word = 0x0000; + rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + + return_resource(&(resources->mem_head), mem_node); + kfree(hold_mem_node); } - } else if (hold_mem_node) { - /* it used the whole range */ + } else { + /* it used most of the range */ hold_mem_node->next = func->mem_head; func->mem_head = hold_mem_node; } + } else if (hold_mem_node) { + /* it used the whole range */ + hold_mem_node->next = func->mem_head; + func->mem_head = hold_mem_node; + } - /* If we have prefetchable memory space available and there is some - * left at the end, return the unused portion - */ - if (hold_p_mem_node && temp_resources.p_mem_head) { - p_mem_node = do_pre_bridge_resource_split(&(temp_resources.p_mem_head), - &hold_p_mem_node, 0x100000L); - - /* Check if we were able to split something off */ - if (p_mem_node) { - hold_p_mem_node->base = p_mem_node->base + p_mem_node->length; - - RES_CHECK(hold_p_mem_node->base, 16); - temp_word = (u32)((hold_p_mem_node->base) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); + /* If we have prefetchable memory space available and there is some + * left at the end, return the unused portion + */ + if (hold_p_mem_node && temp_resources.p_mem_head) { + p_mem_node = do_pre_bridge_resource_split(&(temp_resources.p_mem_head), + &hold_p_mem_node, 0x100000L); - return_resource(&(resources->p_mem_head), p_mem_node); - } + /* Check if we were able to split something off */ + if (p_mem_node) { + hold_p_mem_node->base = p_mem_node->base + p_mem_node->length; - p_mem_node = do_bridge_resource_split(&(temp_resources.p_mem_head), 0x100000L); + RES_CHECK(hold_p_mem_node->base, 16); + temp_word = (u16)((hold_p_mem_node->base) >> 16); + rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); - /* Check if we were able to split something off */ - if (p_mem_node) { - /* First use the temporary node to store information for the board */ - hold_p_mem_node->length = p_mem_node->base - hold_p_mem_node->base; - - /* If we used any, add it to the board's list */ - if (hold_p_mem_node->length) { - hold_p_mem_node->next = func->p_mem_head; - func->p_mem_head = hold_p_mem_node; - - RES_CHECK(p_mem_node->base - 1, 16); - temp_word = (u32)((p_mem_node->base - 1) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); + return_resource(&(resources->p_mem_head), p_mem_node); + } - return_resource(&(resources->p_mem_head), p_mem_node); - } else { - /* it doesn't need any PMem */ - temp_word = 0x0000; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); + p_mem_node = do_bridge_resource_split(&(temp_resources.p_mem_head), 0x100000L); - return_resource(&(resources->p_mem_head), p_mem_node); - kfree(hold_p_mem_node); - } - } else { - /* it used the most of the range */ + /* Check if we were able to split something off */ + if (p_mem_node) { + /* First use the temporary node to store information for the board */ + hold_p_mem_node->length = p_mem_node->base - hold_p_mem_node->base; + + /* If we used any, add it to the board's list */ + if (hold_p_mem_node->length) { hold_p_mem_node->next = func->p_mem_head; func->p_mem_head = hold_p_mem_node; + + RES_CHECK(p_mem_node->base - 1, 16); + temp_word = (u16)((p_mem_node->base - 1) >> 16); + rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); + + return_resource(&(resources->p_mem_head), p_mem_node); + } else { + /* it doesn't need any PMem */ + temp_word = 0x0000; + rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); + + return_resource(&(resources->p_mem_head), p_mem_node); + kfree(hold_p_mem_node); } - } else if (hold_p_mem_node) { - /* it used the whole range */ + } else { + /* it used the most of the range */ hold_p_mem_node->next = func->p_mem_head; func->p_mem_head = hold_p_mem_node; } + } else if (hold_p_mem_node) { + /* it used the whole range */ + hold_p_mem_node->next = func->p_mem_head; + func->p_mem_head = hold_p_mem_node; + } - /* We should be configuring an IRQ and the bridge's base address - * registers if it needs them. Although we have never seen such - * a device - */ + /* We should be configuring an IRQ and the bridge's base address + * registers if it needs them. Although we have never seen such + * a device + */ + + pciehprm_enable_card(ctrl, func, PCI_HEADER_TYPE_BRIDGE); + + dbg("PCI Bridge Hot-Added s:b:d:f(%02x:%02x:%02x:%02x)\n", ctrl->seg, func->bus, func->device, func->function); + + return rc; +} + +/** + * configure_new_function - Configures the PCI header information of one device + * + * @ctrl: pointer to controller structure + * @func: pointer to function structure + * @behind_bridge: 1 if this is a recursive call, 0 if not + * @resources: pointer to set of resource lists + * + * Calls itself recursively for bridged devices. + * Returns 0 if success + * + */ +static int +configure_new_function(struct controller *ctrl, struct pci_func *func, + u8 behind_bridge, struct resource_lists *resources, + u8 bridge_bus, u8 bridge_dev) +{ + int cloop; + u8 temp_byte; + u8 class_code; + u16 temp_word; + u32 rc; + u32 temp_register; + u32 base; + unsigned int devfn; + struct pci_resource *mem_node; + struct pci_resource *io_node; + struct pci_bus lpci_bus, *pci_bus; + + memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus)); + pci_bus = &lpci_bus; + pci_bus->number = func->bus; + devfn = PCI_DEVFN(func->device, func->function); + + /* Check for Bridge */ + rc = pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &temp_byte); + if (rc) + return rc; + dbg("%s: bus %x dev %x func %x temp_byte = %x\n", __FUNCTION__, + func->bus, func->device, func->function, temp_byte); - pciehprm_enable_card(ctrl, func, PCI_HEADER_TYPE_BRIDGE); + if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */ + rc = configure_new_bridge(ctrl, func, behind_bridge, resources, + pci_bus); - dbg("PCI Bridge Hot-Added s:b:d:f(%02x:%02x:%02x:%02x)\n", ctrl->seg, func->bus, func->device, func->function); + if (rc) + return rc; } else if ((temp_byte & 0x7F) == PCI_HEADER_TYPE_NORMAL) { /* Standard device */ u64 base64; - rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code); + rc = pci_bus_read_config_byte(pci_bus, devfn, 0x0B, &class_code); if (class_code == PCI_BASE_CLASS_DISPLAY) - return (DEVICE_TYPE_NOT_SUPPORTED); + return DEVICE_TYPE_NOT_SUPPORTED; /* Figure out IO and memory needs */ for (cloop = PCI_BASE_ADDRESS_0; cloop <= PCI_BASE_ADDRESS_5; cloop += 4) { @@ -2535,7 +2557,7 @@ else { if (prefetchable) dbg("using MEM for PMEM\n"); - mem_node=get_resource(&(resources->mem_head), (ulong)base); + mem_node = get_resource(&(resources->mem_head), (ulong)base); } /* allocate the resource to the board */ @@ -2614,11 +2636,10 @@ } /* End of Not-A-Bridge else */ else { /* It's some strange type of PCI adapter (Cardbus?) */ - return(DEVICE_TYPE_NOT_SUPPORTED); + return DEVICE_TYPE_NOT_SUPPORTED; } func->configured = 1; return 0; } - diff -Nru a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c --- a/drivers/pci/hotplug/pciehp_hpc.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/pciehp_hpc.c Tue May 4 22:16:06 2004 @@ -291,14 +291,14 @@ static int pcie_write_cmd(struct slot *slot, u16 cmd) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; int retval = 0; u16 slot_status; DBG_ENTER_ROUTINE dbg("%s : Enter\n", __FUNCTION__); - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -331,13 +331,13 @@ static int hpc_check_lnk_status(struct controller *ctrl) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = ctrl->hpc_ctlr_handle; u16 lnk_status; int retval = 0; DBG_ENTER_ROUTINE - if (!ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -362,14 +362,14 @@ static int hpc_get_attention_status(struct slot *slot, u8 *status) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_ctrl; u8 atten_led_state; int retval = 0; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -409,14 +409,14 @@ static int hpc_get_power_status(struct slot * slot, u8 *status) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_ctrl; u8 pwr_state; int retval = 0; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -450,13 +450,13 @@ static int hpc_get_latch_status(struct slot *slot, u8 *status) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_status; int retval = 0; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -476,14 +476,14 @@ static int hpc_get_adapter_status(struct slot *slot, u8 *status) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_status; u8 card_state; int retval = 0; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -503,7 +503,7 @@ static int hpc_query_power_fault(struct slot * slot) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_status; u8 pwr_fault; int retval = 0; @@ -511,7 +511,7 @@ DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -532,13 +532,13 @@ static int hpc_set_attention_status(struct slot *slot, u8 value) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_cmd = 0; u16 slot_ctrl; int rc = 0; dbg("%s: \n", __FUNCTION__); - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -580,13 +580,13 @@ static void hpc_set_green_led_on(struct slot *slot) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_cmd; u16 slot_ctrl; int rc = 0; dbg("%s: \n", __FUNCTION__); - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return ; } @@ -615,13 +615,13 @@ static void hpc_set_green_led_off(struct slot *slot) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_cmd; u16 slot_ctrl; int rc = 0; dbg("%s: \n", __FUNCTION__); - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return ; } @@ -651,13 +651,13 @@ static void hpc_set_green_led_blink(struct slot *slot) { - struct php_ctlr_state_s *php_ctlr =(struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_cmd; u16 slot_ctrl; int rc = 0; dbg("%s: \n", __FUNCTION__); - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return ; } @@ -692,13 +692,13 @@ int *updown, /* physical_slot_num increament: 1 or -1 */ int *flags) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = ctrl->hpc_ctlr_handle; u32 slot_cap; int rc = 0; DBG_ENTER_ROUTINE - if (!ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -723,12 +723,12 @@ static void hpc_release_ctlr(struct controller *ctrl) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = ctrl->hpc_ctlr_handle; struct php_ctlr_state_s *p, *p_prev; DBG_ENTER_ROUTINE - if (!ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return ; } @@ -769,7 +769,7 @@ static int hpc_power_on_slot(struct slot * slot) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_cmd; u16 slot_ctrl; @@ -778,7 +778,7 @@ DBG_ENTER_ROUTINE dbg("%s: \n", __FUNCTION__); - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -818,7 +818,7 @@ static int hpc_power_off_slot(struct slot * slot) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; u16 slot_cmd; u16 slot_ctrl; @@ -827,7 +827,7 @@ DBG_ENTER_ROUTINE dbg("%s: \n", __FUNCTION__); - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -879,10 +879,10 @@ return IRQ_NONE; if (!pciehp_poll_mode) { - ctrl = (struct controller *)dev_id; + ctrl = dev_id; php_ctlr = ctrl->hpc_ctlr_handle; } else { - php_ctlr = (struct php_ctlr_state_s *) dev_id; + php_ctlr = dev_id; ctrl = (struct controller *)php_ctlr->callback_instance_id; } @@ -1017,14 +1017,14 @@ static int hpc_get_max_lnk_speed (struct slot *slot, enum pcie_link_speed *value) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; enum pcie_link_speed lnk_speed; u32 lnk_cap; int retval = 0; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -1058,14 +1058,14 @@ static int hpc_get_max_lnk_width (struct slot *slot, enum pcie_link_width *value) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; enum pcie_link_width lnk_wdth; u32 lnk_cap; int retval = 0; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -1120,14 +1120,14 @@ static int hpc_get_cur_lnk_speed (struct slot *slot, enum pcie_link_speed *value) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; enum pcie_link_speed lnk_speed = PCI_SPEED_UNKNOWN; int retval = 0; u16 lnk_status; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -1161,14 +1161,14 @@ static int hpc_get_cur_lnk_width (struct slot *slot, enum pcie_link_width *value) { - struct php_ctlr_state_s *php_ctlr = (struct php_ctlr_state_s *) slot->ctrl->hpc_ctlr_handle; + struct php_ctlr_state_s *php_ctlr = slot->ctrl->hpc_ctlr_handle; enum pcie_link_width lnk_wdth = PCIE_LNK_WIDTH_UNKNOWN; int retval = 0; u16 lnk_status; DBG_ENTER_ROUTINE - if (!slot->ctrl->hpc_ctlr_handle) { + if (!php_ctlr) { err("%s: Invalid HPC controller handle!\n", __FUNCTION__); return -1; } @@ -1245,7 +1245,7 @@ }; int pcie_init(struct controller * ctrl, - struct pci_dev * pdev, + struct pci_dev *pdev, php_intr_callback_t attention_button_callback, php_intr_callback_t switch_change_callback, php_intr_callback_t presence_change_callback, diff -Nru a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c --- a/drivers/pci/hotplug/pciehp_pci.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/pciehp_pci.c Tue May 4 22:16:06 2004 @@ -69,7 +69,7 @@ if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus); - child = (struct pci_bus*) pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus); + child = pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus); pci_do_scan_bus(child); } @@ -83,10 +83,12 @@ int rc = 0; int j; - dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function); + dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, + func->device, func->function); for (j=0; j<8 ; j++) { - struct pci_dev* temp = pci_find_slot(func->bus, (func->device << 3) | j); + struct pci_dev* temp = pci_find_slot(func->bus, + (func->device << 3) | j); if (temp) { pci_remove_bus_device(temp); } @@ -169,7 +171,8 @@ memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus)); pci_bus = &lpci_bus; - dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, num_ctlr_slots, first_device_num); + dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, + num_ctlr_slots, first_device_num); /* Decide which slots are supported */ if (is_hot_plug) { @@ -183,7 +186,8 @@ LastSupported = 0x1F; } - dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported, LastSupported); + dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported, + LastSupported); /* Save PCI configuration space for all devices in supported slots */ dbg("%s: pci_bus->number = %x\n", __FUNCTION__, pci_bus->number); @@ -191,15 +195,18 @@ dbg("%s: bus = %x, dev = %x\n", __FUNCTION__, busnumber, device); for (device = FirstSupported; device <= LastSupported; device++) { ID = 0xFFFFFFFF; - rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID); + rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), + PCI_VENDOR_ID, &ID); if (ID != 0xFFFFFFFF) { /* device in slot */ dbg("%s: ID = %x\n", __FUNCTION__, ID); - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), 0x0B, &class_code); + rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), + 0x0B, &class_code); if (rc) return rc; - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), PCI_HEADER_TYPE, &header_type); + rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), + PCI_HEADER_TYPE, &header_type); if (rc) return rc; @@ -221,7 +228,8 @@ /* Recurse the subordinate bus * get the subordinate bus number */ - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), + rc = pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(device, function), PCI_SECONDARY_BUS, &secondary_bus); if (rc) { return rc; @@ -263,13 +271,17 @@ new_slot->switch_save = 0x10; /* In case of unsupported board */ new_slot->status = DevError; - new_slot->pci_dev = pci_find_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function); + new_slot->pci_dev = pci_find_slot(new_slot->bus, + (new_slot->device << 3) | new_slot->function); dbg("new_slot->pci_dev = %p\n", new_slot->pci_dev); for (cloop = 0; cloop < 0x20; cloop++) { - rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), cloop << 2, - (u32 *) & (new_slot->config_space [cloop])); - /* dbg("new_slot->config_space[%x] = %x\n", cloop, new_slot->config_space[cloop]); */ + rc = pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(device, function), + cloop << 2, + (u32 *) &(new_slot->config_space [cloop])); + /* dbg("new_slot->config_space[%x] = %x\n", + cloop, new_slot->config_space[cloop]); */ if (rc) return rc; } @@ -284,19 +296,23 @@ while ((function < max_functions)&&(!stop_it)) { dbg("%s: In while loop \n", __FUNCTION__); - rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), PCI_VENDOR_ID, &ID); + rc = pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(device, function), + PCI_VENDOR_ID, &ID); if (ID == 0xFFFFFFFF) { /* nothing there. */ function++; dbg("Nothing there\n"); } else { /* Something there */ - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), 0x0B, - &class_code); + rc = pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(device, function), + 0x0B, &class_code); if (rc) return rc; - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), PCI_HEADER_TYPE, - &header_type); + rc = pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(device, function), + PCI_HEADER_TYPE, &header_type); if (rc) return rc; @@ -306,8 +322,8 @@ } } while (function < max_functions); - } /* End of IF (device in slot?) */ - else if (is_hot_plug) { + /* End of IF (device in slot?) */ + } else if (is_hot_plug) { /* Setup slot structure with entry for empty slot */ new_slot = pciehp_slot_create(busnumber); @@ -339,7 +355,7 @@ * * returns 0 if success */ -int pciehp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) +int pciehp_save_slot_config(struct controller *ctrl, struct pci_func * new_slot) { int rc; u8 class_code; @@ -358,12 +374,15 @@ ID = 0xFFFFFFFF; - pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID); + pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0), + PCI_VENDOR_ID, &ID); if (ID != 0xFFFFFFFF) { /* device in slot */ - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), 0x0B, &class_code); + pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), + 0x0B, &class_code); - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_HEADER_TYPE, &header_type); + pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), + PCI_HEADER_TYPE, &header_type); if (header_type & 0x80) /* Multi-function device */ max_functions = 8; @@ -375,7 +394,8 @@ do { if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */ /* Recurse the subordinate bus */ - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), + pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(new_slot->device, function), PCI_SECONDARY_BUS, &secondary_bus); sub_bus = (int) secondary_bus; @@ -384,15 +404,17 @@ rc = pciehp_save_config(ctrl, sub_bus, 0, 0); if (rc) - return(rc); + return rc; } /* End of IF */ new_slot->status = 0; for (cloop = 0; cloop < 0x20; cloop++) { - pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), - cloop << 2, (u32 *) & (new_slot->config_space [cloop])); + pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(new_slot->device, function), + cloop << 2, + (u32 *) &(new_slot->config_space [cloop])); } function++; @@ -404,15 +426,20 @@ */ while ((function < max_functions) && (!stop_it)) { - pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_VENDOR_ID, &ID); + pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(new_slot->device, function), + PCI_VENDOR_ID, &ID); if (ID == 0xFFFFFFFF) { /* nothing there. */ function++; } else { /* Something there */ - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), 0x0B, &class_code); - - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_HEADER_TYPE, - &header_type); + pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(new_slot->device, function), + 0x0B, &class_code); + + pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(new_slot->device, function), + PCI_HEADER_TYPE, &header_type); stop_it++; } @@ -421,10 +448,10 @@ } while (function < max_functions); } /* End of IF (device in slot?) */ else { - return(2); + return 2; } - return(0); + return 0; } @@ -440,7 +467,7 @@ * it loops for all functions of the slot and disables them. * else, it just get resources of the function and return. */ -int pciehp_save_used_resources (struct controller *ctrl, struct pci_func *func, int disable) +int pciehp_save_used_resources(struct controller *ctrl, struct pci_func *func, int disable) { u8 cloop; u8 header_type; @@ -472,7 +499,7 @@ devfn = PCI_DEVFN(func->device, func->function); /* Save the command register */ - pci_bus_read_config_word (pci_bus, devfn, PCI_COMMAND, &save_command); + pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command); if (disable) { /* disable card */ @@ -481,20 +508,22 @@ } /* Check for Bridge */ - pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); + pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type); if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */ - dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command); + dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n", + func->bus, func->device, save_command); if (disable) { /* Clear Bridge Control Register */ command = 0x00; pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command); } - pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); - pci_bus_read_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); + pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); + pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); - bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + bus_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!bus_node) return -ENOMEM; @@ -505,13 +534,14 @@ func->bus_head = bus_node; /* Save IO base and Limit registers */ - pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_BASE, &temp_byte); + pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &temp_byte); base = temp_byte; - pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_LIMIT, &temp_byte); + pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &temp_byte); length = temp_byte; if ((base <= length) && (!disable || (save_command & PCI_COMMAND_IO))) { - io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -523,11 +553,12 @@ } /* Save memory base and Limit registers */ - pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_BASE, &w_base); - pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); + pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base); + pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) { - mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + mem_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -538,11 +569,12 @@ func->mem_head = mem_node; } /* Save prefetchable memory base and Limit registers */ - pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); - pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); + pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); + pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) { - p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + p_mem_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -553,38 +585,41 @@ func->p_mem_head = p_mem_node; } } else if ((header_type & 0x7F) == PCI_HEADER_TYPE_NORMAL) { - dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command); + dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n", + func->bus, func->device, save_command); /* Figure out IO and memory base lengths */ for (cloop = PCI_BASE_ADDRESS_0; cloop <= PCI_BASE_ADDRESS_5; cloop += 4) { - pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base); + pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base); temp_register = 0xFFFFFFFF; - pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); - pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp_register); + pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register); + pci_bus_read_config_dword(pci_bus, devfn, cloop, &temp_register); - if (!disable) { - pci_bus_write_config_dword (pci_bus, devfn, cloop, save_base); - } + if (!disable) + pci_bus_write_config_dword(pci_bus, devfn, cloop, save_base); if (!temp_register) continue; base = temp_register; - if ((base & PCI_BASE_ADDRESS_SPACE_IO) && (!disable || (save_command & PCI_COMMAND_IO))) { + if ((base & PCI_BASE_ADDRESS_SPACE_IO) && + (!disable || (save_command & PCI_COMMAND_IO))) { /* IO base */ /* set temp_register = amount of IO space requested */ base = base & 0xFFFFFFFCL; base = (~base) + 1; - io_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof (struct pci_resource), + GFP_KERNEL); if (!io_node) return -ENOMEM; io_node->base = (ulong)save_base & PCI_BASE_ADDRESS_IO_MASK; io_node->length = (ulong)base; - dbg("sur adapter: IO bar=0x%x(length=0x%x)\n", io_node->base, io_node->length); + dbg("sur adapter: IO bar=0x%x(length=0x%x)\n", + io_node->base, io_node->length); io_node->next = func->io_head; func->io_head = io_node; @@ -594,11 +629,13 @@ char *res_type_str = "PMEM"; u32 temp_register2; - t_mem_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL); + t_mem_node = kmalloc(sizeof (struct pci_resource), + GFP_KERNEL); if (!t_mem_node) return -ENOMEM; - if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) && (!disable || (save_command & PCI_COMMAND_MEMORY))) { + if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) && + (!disable || (save_command & PCI_COMMAND_MEMORY))) { prefetchable = 0; mem_node = t_mem_node; res_type_str++; @@ -613,16 +650,20 @@ if (prefetchable) { p_mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK; p_mem_node->length = (ulong)base; - dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, - p_mem_node->base, p_mem_node->length); + dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", + res_type_str, + p_mem_node->base, + p_mem_node->length); p_mem_node->next = func->p_mem_head; func->p_mem_head = p_mem_node; } else { mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK; mem_node->length = (ulong)base; - dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, - mem_node->base, mem_node->length); + dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", + res_type_str, + mem_node->base, + mem_node->length); mem_node->next = func->mem_head; func->mem_head = mem_node; @@ -642,16 +683,20 @@ if (prefetchable) { p_mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK; p_mem_node->length = base; - dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, - p_mem_node->base, p_mem_node->length); + dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", + res_type_str, + p_mem_node->base, + p_mem_node->length); p_mem_node->next = func->p_mem_head; func->p_mem_head = p_mem_node; } else { mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK; mem_node->length = base; - dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, - mem_node->base, mem_node->length); + dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", + res_type_str, + mem_node->base, + mem_node->length); mem_node->next = func->mem_head; func->mem_head = mem_node; @@ -659,13 +704,15 @@ cloop += 4; break; default: - dbg("asur: reserved BAR type=0x%x\n", temp_register); + dbg("asur: reserved BAR type=0x%x\n", + temp_register); break; } } } /* End of base register loop */ } else { /* Some other unknown header type */ - dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n", func->bus, func->device); + dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n", + func->bus, func->device); } /* find the next device in this slot */ @@ -674,10 +721,29 @@ func = pciehp_slot_find(func->bus, func->device, index++); } - return(0); + return 0; } +/** + * kfree_resource_list: release memory of all list members + * @res: resource list to free + */ +static inline void +return_resource_list(struct pci_resource **func, struct pci_resource **res) +{ + struct pci_resource *node; + struct pci_resource *t_node; + + node = *func; + *func = NULL; + while (node) { + t_node = node->next; + return_resource(res, node); + node = t_node; + } +} + /* * pciehp_return_board_resources * @@ -686,95 +752,40 @@ * * returns 0 if success */ -int pciehp_return_board_resources(struct pci_func * func, struct resource_lists * resources) +int pciehp_return_board_resources(struct pci_func * func, + struct resource_lists * resources) { - int rc = 0; - struct pci_resource *node; - struct pci_resource *t_node; + int rc; + dbg("%s\n", __FUNCTION__); if (!func) - return(1); + return 1; - node = func->io_head; - func->io_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->io_head), node); - node = t_node; - } + return_resource_list(&(func->io_head),&(resources->io_head)); + return_resource_list(&(func->mem_head),&(resources->mem_head)); + return_resource_list(&(func->p_mem_head),&(resources->p_mem_head)); + return_resource_list(&(func->bus_head),&(resources->bus_head)); - node = func->mem_head; - func->mem_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->mem_head), node); - node = t_node; - } - - node = func->p_mem_head; - func->p_mem_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->p_mem_head), node); - node = t_node; - } - - node = func->bus_head; - func->bus_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->bus_head), node); - node = t_node; - } - - rc |= pciehp_resource_sort_and_combine(&(resources->mem_head)); + rc = pciehp_resource_sort_and_combine(&(resources->mem_head)); rc |= pciehp_resource_sort_and_combine(&(resources->p_mem_head)); rc |= pciehp_resource_sort_and_combine(&(resources->io_head)); rc |= pciehp_resource_sort_and_combine(&(resources->bus_head)); - return(rc); + return rc; } - -/* - * pciehp_destroy_resource_list - * - * Puts node back in the resource list pointed to by head +/** + * kfree_resource_list: release memory of all list members + * @res: resource list to free */ -void pciehp_destroy_resource_list (struct resource_lists * resources) +static inline void +kfree_resource_list(struct pci_resource **r) { struct pci_resource *res, *tres; - res = resources->io_head; - resources->io_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = resources->mem_head; - resources->mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = resources->p_mem_head; - resources->p_mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = resources->bus_head; - resources->bus_head = NULL; + res = *r; + *r = NULL; while (res) { tres = res; @@ -783,50 +794,26 @@ } } - -/* - * pciehp_destroy_board_resources - * - * Puts node back in the resource list pointed to by head +/** + * pciehp_destroy_resource_list: put node back in the resource list + * @resources: list to put nodes back */ -void pciehp_destroy_board_resources (struct pci_func * func) +void pciehp_destroy_resource_list(struct resource_lists * resources) { - struct pci_resource *res, *tres; - - res = func->io_head; - func->io_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = func->mem_head; - func->mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = func->p_mem_head; - func->p_mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = func->bus_head; - func->bus_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } + kfree_resource_list(&(resources->io_head)); + kfree_resource_list(&(resources->mem_head)); + kfree_resource_list(&(resources->p_mem_head)); + kfree_resource_list(&(resources->bus_head)); } +/** + * pciehp_destroy_board_resources: put node back in the resource list + * @resources: list to put nodes back + */ +void pciehp_destroy_board_resources(struct pci_func * func) +{ + kfree_resource_list(&(func->io_head)); + kfree_resource_list(&(func->mem_head)); + kfree_resource_list(&(func->p_mem_head)); + kfree_resource_list(&(func->bus_head)); +} diff -Nru a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c --- a/drivers/pci/hotplug/pcihp_skeleton.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/pcihp_skeleton.c Tue May 4 22:16:06 2004 @@ -30,16 +30,14 @@ #include #include +#include #include #include #include #include #include "pci_hotplug.h" - -#define SLOT_MAGIC 0x67267322 struct slot { - u32 magic; u8 number; struct hotplug_slot *hotplug_slot; struct list_head slot_list; @@ -47,11 +45,7 @@ static LIST_HEAD(slot_list); -#if !defined(CONFIG_HOTPLUG_PCI_SKELETON_MODULE) - #define MY_NAME "pcihp_skeleton" -#else - #define MY_NAME THIS_MODULE->name -#endif +#define MY_NAME "pcihp_skeleton" #define dbg(format, arg...) \ do { \ @@ -69,14 +63,14 @@ static int debug; static int num_slots; -#define DRIVER_VERSION "0.2" +#define DRIVER_VERSION "0.3" #define DRIVER_AUTHOR "Greg Kroah-Hartman " #define DRIVER_DESC "Hot Plug PCI Controller Skeleton Driver" MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM(debug, "i"); +module_param(debug, bool, 644); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); static int enable_slot (struct hotplug_slot *slot); @@ -100,50 +94,12 @@ .get_adapter_status = get_adapter_status, }; - -/* Inline functions to check the sanity of a pointer that is passed to us */ -static inline int slot_paranoia_check (struct slot *slot, const char *function) -{ - if (!slot) { - dbg("%s - slot == NULL", function); - return -1; - } - if (slot->magic != SLOT_MAGIC) { - dbg("%s - bad magic number for slot", function); - return -1; - } - if (!slot->hotplug_slot) { - dbg("%s - slot->hotplug_slot == NULL!", function); - return -1; - } - return 0; -} - -static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function) -{ - struct slot *slot; - - if (!hotplug_slot) { - dbg("%s - hotplug_slot == NULL\n", function); - return NULL; - } - - slot = (struct slot *)hotplug_slot->private; - if (slot_paranoia_check (slot, function)) - return NULL; - return slot; -} - - -static int enable_slot (struct hotplug_slot *hotplug_slot) +static int enable_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - - dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); + + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* * Fill in code here to enable the specified slot @@ -153,15 +109,12 @@ } -static int disable_slot (struct hotplug_slot *hotplug_slot) +static int disable_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - - dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); + + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* * Fill in code here to disable the specified slot @@ -170,15 +123,12 @@ return retval; } -static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status) +static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - - dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); + + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); switch (status) { case 0: @@ -198,32 +148,30 @@ return retval; } -static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value) +static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - - dbg ("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); - err ("No hardware tests are defined for this driver"); - retval = -ENODEV; + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); + + switch (value) { + case 0: + /* Specify a test here */ + break; + case 1: + /* Specify another test here */ + break; + } - /* Or you can specify a test if you want to */ - return retval; } -static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* @@ -234,14 +182,11 @@ return retval; } -static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* @@ -252,14 +197,11 @@ return retval; } -static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* @@ -270,14 +212,11 @@ return retval; } -static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value) +static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) { - struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); + struct slot *slot = hotplug_slot->private; int retval = 0; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); /* @@ -288,13 +227,9 @@ return retval; } -static void release_slots(struct hotplug_slot *hotplug_slot) +static void release_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - int retval = 0; - - if (slot == NULL) - return -ENODEV; + struct slot *slot = hotplug_slot->private; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); kfree(slot->hotplug_slot->info); @@ -304,22 +239,26 @@ } #define SLOT_NAME_SIZE 10 -static void make_slot_name (struct slot *slot) +static void make_slot_name(struct slot *slot) { /* * Stupid way to make a filename out of the slot name. * replace this if your hardware provides a better way to name slots. */ - snprintf (slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d", slot->number); + snprintf(slot->hotplug_slot->name, SLOT_NAME_SIZE, "%d", slot->number); } -static int init_slots (void) +/** + * init_slots - initialize 'struct slot' structures for each slot + * + */ +static int __init init_slots(void) { struct slot *slot; struct hotplug_slot *hotplug_slot; struct hotplug_slot_info *info; char *name; - int retval = 0; + int retval = -ENOMEM; int i; /* @@ -327,43 +266,34 @@ * with the pci_hotplug subsystem. */ for (i = 0; i < num_slots; ++i) { - slot = kmalloc (sizeof (struct slot), GFP_KERNEL); + slot = kmalloc(sizeof(struct slot), GFP_KERNEL); if (!slot) - return -ENOMEM; + goto error; memset(slot, 0, sizeof(struct slot)); - hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL); - if (!hotplug_slot) { - kfree (slot); - return -ENOMEM; - } + hotplug_slot = kmalloc(sizeof(struct hotplug_slot), + GFP_KERNEL); + if (!hotplug_slot) + goto error_slot; memset(hotplug_slot, 0, sizeof (struct hotplug_slot)); slot->hotplug_slot = hotplug_slot; - info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); - if (!info) { - kfree (hotplug_slot); - kfree (slot); - return -ENOMEM; - } + info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL); + if (!info) + goto error_hpslot; memset(info, 0, sizeof (struct hotplug_slot_info)); hotplug_slot->info = info; - name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL); - if (!name) { - kfree (info); - kfree (hotplug_slot); - kfree (slot); - return -ENOMEM; - } + name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL); + if (!name) + goto error_info; hotplug_slot->name = name; - slot->magic = SLOT_MAGIC; slot->number = i; hotplug_slot->private = slot; hotplug_slot->release = &release_slot; - make_slot_name (slot); + make_slot_name(slot); hotplug_slot->ops = &skel_hotplug_slot_ops; /* @@ -375,25 +305,31 @@ info->latch_status = get_latch_status(slot); info->adapter_status = get_adapter_status(slot); - dbg ("registering slot %d\n", i); - retval = pci_hp_register (slot->hotplug_slot); + dbg("registering slot %d\n", i); + retval = pci_hp_register(slot->hotplug_slot); if (retval) { - err ("pci_hp_register failed with error %d\n", retval); - kfree (info); - kfree (name); - kfree (hotplug_slot); - kfree (slot); - return retval; + err("pci_hp_register failed with error %d\n", retval); + goto error_name; } /* add slot to our internal list */ - list_add (&slot->slot_list, &slot_list); + list_add(&slot->slot_list, &slot_list); } + return 0; +error_name: + kfree(name); +error_info: + kfree(info); +error_hpslot: + kfree(hotplug_slot); +error_slot: + kfree(slot); +error: return retval; } -static void cleanup_slots(void) +static void __exit cleanup_slots(void) { struct list_head *tmp; struct list_head *next; @@ -404,10 +340,10 @@ * Memory will be freed in release_slot() callback after slot's * lifespan is finished. */ - list_for_each_safe (tmp, next, &slot_list) { - slot = list_entry (tmp, struct slot, slot_list); - list_del (&slot->slot_list); - pci_hp_deregister (slot->hotplug_slot); + list_for_each_safe(tmp, next, &slot_list) { + slot = list_entry(tmp, struct slot, slot_list); + list_del(&slot->slot_list); + pci_hp_deregister(slot->hotplug_slot); } } @@ -415,20 +351,16 @@ { int retval; + info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); /* * Do specific initialization stuff for your driver here - * Like initilizing your controller hardware (if any) and + * Like initializing your controller hardware (if any) and * determining the number of slots you have in the system * right now. */ num_slots = 5; - retval = init_slots(); - if (retval) - return retval; - - info (DRIVER_DESC " version: " DRIVER_VERSION "\n"); - return 0; + return init_slots(); } static void __exit pcihp_skel_exit(void) @@ -441,4 +373,3 @@ module_init(pcihp_skel_init); module_exit(pcihp_skel_exit); - diff -Nru a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c --- a/drivers/pci/hotplug/rpadlpar_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/rpadlpar_core.c Tue May 4 22:16:06 2004 @@ -47,15 +47,13 @@ { struct device_node *child; struct device_node *parent = of_find_node_by_name(NULL, "vdevice"); + char *loc_code; if (!parent) return NULL; - for (child = of_get_next_child(parent, NULL); + for (child = of_get_next_child(parent, NULL); child; child = of_get_next_child(parent, child)) { - - char *loc_code; - loc_code = get_property(child, "ibm,loc-code", NULL); if (loc_code && !strcmp(loc_code, drc_name)) return child; @@ -309,12 +307,8 @@ */ int dlpar_remove_pci_slot(struct slot *slot, char *drc_name) { - struct device_node *dn = find_php_slot_pci_node(drc_name); struct pci_dev *bridge_dev; - if (!dn) - return -ENODEV; - bridge_dev = slot->bridge; if (!bridge_dev) { printk(KERN_ERR "%s: unexpected null bridge device\n", @@ -358,13 +352,19 @@ if (down_interruptible(&rpadlpar_sem)) return -ERESTARTSYS; - + + if (!find_php_slot_vio_node(drc_name) && + !find_php_slot_pci_node(drc_name)) { + rc = -ENODEV; + goto exit; + } + slot = find_slot(drc_name); if (!slot) { rc = -EINVAL; goto exit; } - + switch (slot->dev_type) { case PCI_DEV: rc = dlpar_remove_pci_slot(slot, drc_name); diff -Nru a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h --- a/drivers/pci/hotplug/rpaphp.h Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/rpaphp.h Tue May 4 22:16:06 2004 @@ -62,8 +62,6 @@ #define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) #define warn(format, arg...) printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) -#define SLOT_MAGIC 0x67267322 - /* slot types */ #define VIO_DEV 1 #define PCI_DEV 2 @@ -79,7 +77,6 @@ * struct slot - slot information for each *physical* slot */ struct slot { - u32 magic; int state; u32 index; u32 type; diff -Nru a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c --- a/drivers/pci/hotplug/rpaphp_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/rpaphp_core.c Tue May 4 22:16:06 2004 @@ -54,7 +54,7 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -module_param(debug, int, 0644); +module_param(debug, bool, 0644); static int enable_slot(struct hotplug_slot *slot); static int disable_slot(struct hotplug_slot *slot); @@ -63,7 +63,6 @@ static int get_attention_status(struct hotplug_slot *slot, u8 * value); static int get_adapter_status(struct hotplug_slot *slot, u8 * value); static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value); -static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value); struct hotplug_slot_ops rpaphp_hotplug_slot_ops = { .owner = THIS_MODULE, @@ -74,18 +73,8 @@ .get_attention_status = get_attention_status, .get_adapter_status = get_adapter_status, .get_max_bus_speed = get_max_bus_speed, - .get_cur_bus_speed = get_cur_bus_speed, }; -static inline struct slot *get_slot (struct hotplug_slot *hotplug_slot, const char *function) -{ - if (!hotplug_slot) { - dbg("%s - hotplug_slot == NULL\n", function); - return NULL; - } - return (struct slot *)hotplug_slot->private; -} - static int rpaphp_get_attention_status(struct slot *slot) { return slot->hotplug_slot->info->attention_status; @@ -100,11 +89,8 @@ */ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value) { - int retval = 0; - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + int retval; + struct slot *slot = (struct slot *)hotplug_slot->private; down(&rpaphp_sem); switch (value) { @@ -136,10 +122,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) { int retval; - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + struct slot *slot = (struct slot *)hotplug_slot->private; down(&rpaphp_sem); retval = rpaphp_get_power_status(slot, value); @@ -155,10 +138,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value) { int retval = 0; - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + struct slot *slot = (struct slot *)hotplug_slot->private; down(&rpaphp_sem); *value = rpaphp_get_attention_status(slot); @@ -168,11 +148,9 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); + struct slot *slot = (struct slot *)hotplug_slot->private; int retval = 0; - if (slot == NULL) - return -ENODEV; down(&rpaphp_sem); /* have to go through this */ switch (slot->dev_type) { @@ -191,10 +169,7 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) { - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + struct slot *slot = (struct slot *)hotplug_slot->private; down(&rpaphp_sem); switch (slot->type) { @@ -231,18 +206,6 @@ return 0; } -/* return dummy value because not sure if PRA provides any method... */ -static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value) -{ - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; - - *value = PCI_SPEED_UNKNOWN; - return 0; -} - int rpaphp_remove_slot(struct slot *slot) { int retval = 0; @@ -268,24 +231,24 @@ { *indexes = (int *) get_property(dn, "ibm,drc-indexes", NULL); if (!*indexes) - return (0); + return 0; /* &names[1] contains NULL terminated slot names */ *names = (int *) get_property(dn, "ibm,drc-names", NULL); if (!*names) - return (0); + return 0; /* &types[1] contains NULL terminated slot types */ *types = (int *) get_property(dn, "ibm,drc-types", NULL); if (!*types) - return (0); + return 0; /* power_domains[1...n] are the slot power domains */ *power_domains = (int *) get_property(dn, "ibm,drc-power-domains", NULL); if (!*power_domains) - return (0); + return 0; if (strcmp(dn->name, "pci") == 0 && - !get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL)) - return (0); - return (1); + !get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL)) + return 0; + return 1; } static inline int is_vdevice_root(struct device_node *dn) @@ -293,10 +256,10 @@ return !strcmp(dn->name, "vdevice"); } -/************************************* - * Add Hot Plug slot(s) to sysfs +/** + * rpaphp_add_slot: Add Hot Plug slot(s) to sysfs * - ************************************/ + */ int rpaphp_add_slot(struct device_node *dn) { struct slot *slot; @@ -320,8 +283,9 @@ name = (char *) &names[1]; type = (char *) &types[1]; for (i = 0; i < indexes[0]; - i++, - name += (strlen(name) + 1), type += (strlen(type) + 1)) { + i++, + name += (strlen(name) + 1), + type += (strlen(type) + 1)) { if (!(slot = alloc_slot_struct(dn, indexes[i + 1], name, power_domains[i + 1]))) { retval = -ENOMEM; @@ -334,38 +298,28 @@ } /* for indexes */ } /* end of PCI device_node */ - exit: +exit: dbg("%s - Exit: num_slots=%d rc[%d]\n", __FUNCTION__, num_slots, retval); return retval; } -/* - * init_slots - initialize 'struct slot' structures for each slot - * - */ -static void init_slots(void) +static int __init init_rpa(void) { struct device_node *dn; - for (dn = find_all_nodes(); dn; dn = dn->next) - rpaphp_add_slot(dn); -} - -static int init_rpa(void) -{ - init_MUTEX(&rpaphp_sem); /* initialize internal data structure etc. */ - init_slots(); + for (dn = find_all_nodes(); dn; dn = dn->next) + rpaphp_add_slot(dn); if (!num_slots) return -ENODEV; return 0; } -static void cleanup_slots(void) +static void __exit cleanup_slots(void) { struct list_head *tmp, *n; struct slot *slot; @@ -400,10 +354,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot) { int retval = 0; - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + struct slot *slot = (struct slot *)hotplug_slot->private; if (slot->state == CONFIGURED) { dbg("%s: %s is already enabled\n", __FUNCTION__, slot->name); @@ -431,10 +382,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot) { int retval; - struct slot *slot = get_slot(hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; + struct slot *slot = (struct slot *)hotplug_slot->private; dbg("%s - Entry: slot[%s]\n", __FUNCTION__, slot->name); diff -Nru a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c --- a/drivers/pci/hotplug/rpaphp_pci.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/rpaphp_pci.c Tue May 4 22:16:06 2004 @@ -30,7 +30,7 @@ struct pci_dev *rpaphp_find_pci_dev(struct device_node *dn) { - struct pci_dev *retval_dev = NULL, *dev = NULL; + struct pci_dev *retval_dev = NULL, *dev; char bus_id[BUS_ID_SIZE]; sprintf(bus_id, "%04x:%02x:%02x.%d",dn->phb->global_number, @@ -57,9 +57,8 @@ struct resource *res = &dev->resource[resource]; struct resource *root = pci_find_parent_resource(dev, res); char *dtype = resource < PCI_BRIDGE_RESOURCES ? "device" : "bridge"; - int err; + int err = -EINVAL; - err = -EINVAL; if (root != NULL) { err = request_resource(root, res); } @@ -117,8 +116,8 @@ return rc; } -/* - * get_pci_adapter_status - get the status of a slot +/** + * get_pci_adapter_status - get the status of a slot * * 0-- slot is empty * 1-- adapter is configured @@ -136,7 +135,7 @@ if (state == PRESENT) { if (!is_init) /* at run-time slot->state can be changed by */ - /* config/unconfig adapter */ + /* config/unconfig adapter */ *value = slot->state; else { if (!slot->dn->child) @@ -154,7 +153,7 @@ *value = state; } - exit: +exit: return rc; } @@ -175,6 +174,7 @@ pci_read_irq_line(dev); for (i = 0; i < PCI_NUM_RESOURCES; i++) { struct resource *r = &dev->resource[i]; + if (r->parent || !r->start || !r->flags) continue; rpaphp_claim_resource(dev, i); @@ -183,7 +183,8 @@ } } -static void rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node *dn) +static void +rpaphp_pci_config_device(struct pci_bus *pci_bus, struct device_node *dn) { int num; @@ -192,7 +193,6 @@ rpaphp_fixup_new_pci_devices(pci_bus); pci_bus_add_devices(pci_bus); } - return; } static int rpaphp_pci_config_bridge(struct pci_dev *dev, struct device_node *dn); @@ -201,7 +201,8 @@ rpaphp_pci_config_dn() will recursively configure all devices under the given slot->dn and return the dn's pci_dev. *****************************************************************************/ -static struct pci_dev *rpaphp_pci_config_dn(struct device_node *dn, struct pci_bus *bus) +static struct pci_dev * +rpaphp_pci_config_dn(struct device_node *dn, struct pci_bus *bus) { struct device_node *local; struct pci_dev *dev; @@ -256,16 +257,16 @@ goto exit; } + eeh_add_device_early(slot->dn->child); dev = rpaphp_pci_config_dn(slot->dn, pci_bus); - eeh_add_device(dev); + eeh_add_device_late(dev); } else { /* slot is not enabled */ err("slot doesn't have pci_dev structure\n"); dev = NULL; - goto exit; } - exit: +exit: dbg("Exit %s: pci_dev %s\n", __FUNCTION__, dev ? "found" : "not found"); return dev; } @@ -304,9 +305,9 @@ if (slot->hotplug_slot->info->adapter_status == NOT_VALID) { dbg("%s: NOT_VALID: skip dn->full_name=%s\n", __FUNCTION__, slot->dn->full_name); - return (-1); + return -1; } - return (0); + return 0; } static int setup_pci_slot(struct slot *slot) @@ -353,7 +354,7 @@ if (setup_pci_slot(slot)) goto exit_rc; rc = register_slot(slot); - exit_rc: +exit_rc: if (rc) dealloc_slot_struct(slot); return rc; @@ -389,7 +390,7 @@ slot->state = NOT_VALID; retval = -EINVAL; } - exit: +exit: if (slot->state != NOT_VALID) rpaphp_set_attention_status(slot, LED_ON); else diff -Nru a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c --- a/drivers/pci/hotplug/rpaphp_slot.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/rpaphp_slot.c Tue May 4 22:16:06 2004 @@ -58,13 +58,10 @@ sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_location.attr); } -/* free up the memory user by a slot */ +/* free up the memory used by a slot */ static void rpaphp_release_slot(struct hotplug_slot *hotplug_slot) { - struct slot *slot = hotplug_slot? (struct slot *) hotplug_slot->private:NULL; - - if (slot == NULL) - return; + struct slot *slot = (struct slot *) hotplug_slot->private; dealloc_slot_struct(slot); } @@ -83,54 +80,52 @@ { struct slot *slot; - dbg("Enter alloc_slot_struct(): dn->full_name=%s drc_index=0x%x drc_name=%s\n", - dn->full_name, drc_index, drc_name); + dbg("Enter %s: dn->full_name=%s drc_index=0x%x drc_name=%s\n", + __FUNCTION__, dn->full_name, drc_index, drc_name); slot = kmalloc(sizeof (struct slot), GFP_KERNEL); if (!slot) - return (NULL); + goto error_nomem; memset(slot, 0, sizeof (struct slot)); slot->hotplug_slot = kmalloc(sizeof (struct hotplug_slot), GFP_KERNEL); - if (!slot->hotplug_slot) { - kfree(slot); - return (NULL); - } + if (!slot->hotplug_slot) + goto error_hpslot; memset(slot->hotplug_slot, 0, sizeof (struct hotplug_slot)); slot->hotplug_slot->info = kmalloc(sizeof (struct hotplug_slot_info), GFP_KERNEL); - if (!slot->hotplug_slot->info) { - kfree(slot->hotplug_slot); - kfree(slot); - return (NULL); - } + if (!slot->hotplug_slot->info) + goto error_hoslot; memset(slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info)); slot->hotplug_slot->name = kmalloc(BUS_ID_SIZE + 1, GFP_KERNEL); - if (!slot->hotplug_slot->name) { - kfree(slot->hotplug_slot->info); - kfree(slot->hotplug_slot); - kfree(slot); - return (NULL); - } + if (!slot->hotplug_slot->name) + goto error_name; slot->location = kmalloc(strlen(drc_name) + 1, GFP_KERNEL); - if (!slot->location) { - kfree(slot->hotplug_slot->info); - kfree(slot->hotplug_slot->name); - kfree(slot->hotplug_slot); - kfree(slot); - return (NULL); - } + if (!slot->location) + goto error_info; slot->name = slot->hotplug_slot->name; slot->dn = dn; slot->index = drc_index; strcpy(slot->location, drc_name); slot->power_domain = power_domain; - slot->magic = SLOT_MAGIC; slot->hotplug_slot->private = slot; slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops; slot->hotplug_slot->release = &rpaphp_release_slot; - dbg("Exit alloc_slot_struct(): slot->dn->full_name=%s drc_index=0x%x drc_name=%s\n", - slot->dn->full_name, slot->index, slot->name); - return (slot); + slot->hotplug_slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN; + dbg("Exit %s: slot->dn->full_name=%s drc_index=0x%x drc_name=%s\n", + __FUNCTION__, slot->dn->full_name, slot->index, slot->name); + + return slot; + +error_info: + kfree(slot->hotplug_slot->info); +error_name: + kfree(slot->hotplug_slot->name); +error_hpslot: + kfree(slot->hotplug_slot); +error_slot: + kfree(slot); +error_nomem: + return NULL; } int register_slot(struct slot *slot) @@ -138,13 +133,15 @@ int retval; char *vio_uni_addr = NULL; - dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", __FUNCTION__, slot->dn->full_name, slot->index, slot->name, slot->power_domain, slot->type); + dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", + __FUNCTION__, slot->dn->full_name, slot->index, slot->name, + slot->power_domain, slot->type); retval = pci_hp_register(slot->hotplug_slot); if (retval) { err("pci_hp_register failed with error %d\n", retval); rpaphp_release_slot(slot->hotplug_slot); - return (retval); + return retval; } /* create "phy_locatoin" file */ @@ -163,7 +160,7 @@ info("Slot [%s](bus_id=%s) registered\n", slot->name, pci_name(slot->bridge)); num_slots++; - return (0); + return 0; } int rpaphp_get_power_status(struct slot *slot, u8 * value) diff -Nru a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c --- a/drivers/pci/hotplug/shpchp_core.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/shpchp_core.c Tue May 4 22:16:06 2004 @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -56,9 +57,9 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); -MODULE_PARM(shpchp_debug, "i"); -MODULE_PARM(shpchp_poll_mode, "i"); -MODULE_PARM(shpchp_poll_time, "i"); +module_param(shpchp_debug, bool, 644); +module_param(shpchp_poll_mode, bool, 644); +module_param(shpchp_poll_time, int, 644); MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not"); MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not"); MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds"); @@ -69,7 +70,6 @@ static int set_attention_status (struct hotplug_slot *slot, u8 value); static int enable_slot (struct hotplug_slot *slot); static int disable_slot (struct hotplug_slot *slot); -static int hardware_test (struct hotplug_slot *slot, u32 value); static int get_power_status (struct hotplug_slot *slot, u8 *value); static int get_attention_status (struct hotplug_slot *slot, u8 *value); static int get_latch_status (struct hotplug_slot *slot, u8 *value); @@ -82,22 +82,37 @@ .set_attention_status = set_attention_status, .enable_slot = enable_slot, .disable_slot = disable_slot, - .hardware_test = hardware_test, .get_power_status = get_power_status, .get_attention_status = get_attention_status, - .get_latch_status = get_latch_status, + .get_latch_status = get_latch_status, .get_adapter_status = get_adapter_status, - .get_max_bus_speed = get_max_bus_speed, - .get_cur_bus_speed = get_cur_bus_speed, + .get_max_bus_speed = get_max_bus_speed, + .get_cur_bus_speed = get_cur_bus_speed, }; +/** + * release_slot - free up the memory used by a slot + * @hotplug_slot: slot to free + */ +static void release_slot(struct hotplug_slot *hotplug_slot) +{ + struct slot *slot = (struct slot *)hotplug_slot->private; + + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); + + kfree(slot->hotplug_slot->info); + kfree(slot->hotplug_slot->name); + kfree(slot->hotplug_slot); + kfree(slot); +} + static int init_slots(struct controller *ctrl) { struct slot *new_slot; u8 number_of_slots; u8 slot_device; u32 slot_number, sun; - int result; + int result = -ENOMEM; dbg("%s\n",__FUNCTION__); @@ -108,30 +123,21 @@ while (number_of_slots) { new_slot = (struct slot *) kmalloc(sizeof(struct slot), GFP_KERNEL); if (!new_slot) - return -ENOMEM; + goto error; memset(new_slot, 0, sizeof(struct slot)); new_slot->hotplug_slot = kmalloc (sizeof (struct hotplug_slot), GFP_KERNEL); - if (!new_slot->hotplug_slot) { - kfree (new_slot); - return -ENOMEM; - } + if (!new_slot->hotplug_slot) + goto error_slot; memset(new_slot->hotplug_slot, 0, sizeof (struct hotplug_slot)); new_slot->hotplug_slot->info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); - if (!new_slot->hotplug_slot->info) { - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return -ENOMEM; - } + if (!new_slot->hotplug_slot->info) + goto error_hpslot; memset(new_slot->hotplug_slot->info, 0, sizeof (struct hotplug_slot_info)); new_slot->hotplug_slot->name = kmalloc (SLOT_NAME_SIZE, GFP_KERNEL); - if (!new_slot->hotplug_slot->name) { - kfree (new_slot->hotplug_slot->info); - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return -ENOMEM; - } + if (!new_slot->hotplug_slot->name) + goto error_info; new_slot->magic = SLOT_MAGIC; new_slot->ctrl = ctrl; @@ -139,19 +145,17 @@ new_slot->device = slot_device; new_slot->hpc_ops = ctrl->hpc_ops; - if (shpchprm_get_physical_slot_number(ctrl, &sun, new_slot->bus, new_slot->device)) { - kfree (new_slot->hotplug_slot->info); - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return -ENOMEM; - } + if (shpchprm_get_physical_slot_number(ctrl, &sun, + new_slot->bus, new_slot->device)) + goto error_name; new_slot->number = sun; new_slot->hp_slot = slot_device - ctrl->slot_device_offset; /* register this slot with the hotplug pci core */ new_slot->hotplug_slot->private = new_slot; - make_slot_name (new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot); + new_slot->hotplug_slot->release = &release_slot; + make_slot_name(new_slot->hotplug_slot->name, SLOT_NAME_SIZE, new_slot); new_slot->hotplug_slot->ops = &shpchp_hotplug_slot_ops; new_slot->hpc_ops->get_power_status(new_slot, &(new_slot->hotplug_slot->info->power_status)); @@ -164,11 +168,7 @@ result = pci_hp_register (new_slot->hotplug_slot); if (result) { err ("pci_hp_register failed with error %d\n", result); - kfree (new_slot->hotplug_slot->info); - kfree (new_slot->hotplug_slot->name); - kfree (new_slot->hotplug_slot); - kfree (new_slot); - return result; + goto error_name; } new_slot->next = ctrl->slot; @@ -179,29 +179,31 @@ slot_number += ctrl->slot_num_inc; } - return(0); -} + return 0; +error_name: + kfree(new_slot->hotplug_slot->name); +error_info: + kfree(new_slot->hotplug_slot->info); +error_hpslot: + kfree(new_slot->hotplug_slot); +error_slot: + kfree(new_slot); +error: + return result; +} -static int cleanup_slots (struct controller * ctrl) +static void cleanup_slots(struct controller *ctrl) { - struct slot *old_slot, *next_slot; + struct slot *old_slot; old_slot = ctrl->slot; ctrl->slot = NULL; while (old_slot) { - next_slot = old_slot->next; - pci_hp_deregister (old_slot->hotplug_slot); - kfree(old_slot->hotplug_slot->info); - kfree(old_slot->hotplug_slot->name); - kfree(old_slot->hotplug_slot); - kfree(old_slot); - old_slot = next_slot; + pci_hp_deregister(old_slot->hotplug_slot); + old_slot = old_slot->next; } - - - return(0); } static int get_ctlr_slot_config(struct controller *ctrl) @@ -216,7 +218,7 @@ rc = shpc_get_ctlr_slot_config(ctrl, &num_ctlr_slots, &first_device_num, &physical_slot_num, &updown, &flags); if (rc) { err("%s: get_ctlr_slot_config fail for b:d (%x:%x)\n", __FUNCTION__, ctrl->bus, ctrl->device); - return (-1); + return -1; } ctrl->num_slots = num_ctlr_slots; @@ -227,7 +229,7 @@ dbg("%s: num_slot(0x%x) 1st_dev(0x%x) psn(0x%x) updown(%d) for b:d (%x:%x)\n", __FUNCTION__, num_ctlr_slots, first_device_num, physical_slot_num, updown, ctrl->bus, ctrl->device); - return (0); + return 0; } @@ -238,15 +240,11 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - if (slot == NULL) - return -ENODEV; - dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); hotplug_slot->info->attention_status = status; slot->hpc_ops->set_attention_status(slot, status); - return 0; } @@ -254,9 +252,6 @@ static int enable_slot (struct hotplug_slot *hotplug_slot) { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -267,30 +262,17 @@ static int disable_slot (struct hotplug_slot *hotplug_slot) { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); return shpchp_disable_slot(slot); } - -static int hardware_test (struct hotplug_slot *hotplug_slot, u32 value) -{ - return 0; -} - - static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value) { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_power_status(slot, value); @@ -304,10 +286,7 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_attention_status(slot, value); @@ -321,10 +300,7 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; - + dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_latch_status(slot, value); @@ -338,14 +314,10 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); retval = slot->hpc_ops->get_adapter_status(slot, value); - if (retval < 0) *value = hotplug_slot->info->adapter_status; @@ -356,9 +328,6 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -373,9 +342,6 @@ { struct slot *slot = get_slot (hotplug_slot, __FUNCTION__); int retval; - - if (slot == NULL) - return -ENODEV; dbg("%s - physical_slot = %s\n", __FUNCTION__, hotplug_slot->name); @@ -531,49 +497,35 @@ return retval; } +static inline void __exit +free_shpchp_res(struct pci_resource *res) +{ + struct pci_resource *tres; + + while (res) { + tres = res; + res = res->next; + kfree(tres); + } +} -static void unload_shpchpd(void) +static void __exit unload_shpchpd(void) { struct pci_func *next; struct pci_func *TempSlot; int loop; struct controller *ctrl; struct controller *tctrl; - struct pci_resource *res; - struct pci_resource *tres; ctrl = shpchp_ctrl_list; while (ctrl) { cleanup_slots(ctrl); - res = ctrl->io_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = ctrl->mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = ctrl->p_mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = ctrl->bus_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } + free_shpchp_res(ctrl->io_head); + free_shpchp_res(ctrl->mem_head); + free_shpchp_res(ctrl->p_mem_head); + free_shpchp_res(ctrl->bus_head); kfree (ctrl->pci_bus); @@ -589,33 +541,10 @@ for (loop = 0; loop < 256; loop++) { next = shpchp_slot_list[loop]; while (next != NULL) { - res = next->io_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = next->mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = next->p_mem_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = next->bus_head; - while (res) { - tres = res; - res = res->next; - kfree(tres); - } + free_shpchp_res(ctrl->io_head); + free_shpchp_res(ctrl->mem_head); + free_shpchp_res(ctrl->p_mem_head); + free_shpchp_res(ctrl->bus_head); TempSlot = next; next = next->next; @@ -697,8 +626,5 @@ info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); } - module_init(shpcd_init); module_exit(shpcd_cleanup); - - diff -Nru a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c --- a/drivers/pci/hotplug/shpchp_ctrl.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/shpchp_ctrl.c Tue May 4 22:16:06 2004 @@ -396,7 +396,7 @@ /* This one isn't an aligned length, so we'll make a new entry * and split it up. */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) return(NULL); @@ -530,7 +530,7 @@ if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) return(NULL); @@ -549,7 +549,7 @@ if (node->length > size) { /* This one is longer than we need so we'll make a new entry and split it up */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) return(NULL); @@ -630,7 +630,7 @@ if ((max->length - (temp_dword - max->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) return(NULL); @@ -648,7 +648,7 @@ if ((max->base + max->length) & (size - 1)) { /* This one isn't end aligned properly at the top so we'll make a new entry and split it up */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) return(NULL); @@ -669,7 +669,8 @@ for ( i = 0; max_size[i] > size; i++) { if (max->length > max_size[i]) { - split_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), + GFP_KERNEL); if (!split_node) break; /* return (NULL); */ split_node->base = max->base + max_size[i]; @@ -744,7 +745,7 @@ if ((node->length - (temp_dword - node->base)) < size) continue; - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) return(NULL); @@ -764,7 +765,7 @@ dbg("%s: too big\n", __FUNCTION__); /* this one is longer than we need so we'll make a new entry and split it up */ - split_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + split_node = kmalloc(sizeof(*split_node), GFP_KERNEL); if (!split_node) return(NULL); @@ -882,7 +883,7 @@ struct pci_func *new_slot; struct pci_func *next; - new_slot = (struct pci_func *) kmalloc(sizeof(struct pci_func), GFP_KERNEL); + new_slot = kmalloc(sizeof(*new_slot), GFP_KERNEL); if (new_slot == NULL) { return(new_slot); @@ -1856,7 +1857,7 @@ struct hotplug_slot_info *info; int result; - info = kmalloc (sizeof (struct hotplug_slot_info), GFP_KERNEL); + info = kmalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; @@ -2504,22 +2505,18 @@ /* Make copies of the nodes we are going to pass down so that * if there is a problem,we can just use these to free resources */ - hold_bus_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_IO_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); - hold_p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + hold_bus_node = kmalloc(sizeof(*hold_bus_node), GFP_KERNEL); + hold_IO_node = kmalloc(sizeof(*hold_IO_node), GFP_KERNEL); + hold_mem_node = kmalloc(sizeof(*hold_mem_node), GFP_KERNEL); + hold_p_mem_node = kmalloc(sizeof(*hold_p_mem_node), GFP_KERNEL); if (!hold_bus_node || !hold_IO_node || !hold_mem_node || !hold_p_mem_node) { - if (hold_bus_node) - kfree(hold_bus_node); - if (hold_IO_node) - kfree(hold_IO_node); - if (hold_mem_node) - kfree(hold_mem_node); - if (hold_p_mem_node) - kfree(hold_p_mem_node); + kfree(hold_bus_node); + kfree(hold_IO_node); + kfree(hold_mem_node); + kfree(hold_p_mem_node); - return(1); + return 1; } memcpy(hold_bus_node, bus_node, sizeof(struct pci_resource)); @@ -2538,11 +2535,11 @@ /* set IO base and Limit registers */ RES_CHECK(io_node->base, 8); temp_byte = (u8)(io_node->base >> 8); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_BASE, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_BASE, temp_byte); RES_CHECK(io_node->base + io_node->length - 1, 8); temp_byte = (u8)((io_node->base + io_node->length - 1) >> 8); - rc = pci_bus_write_config_byte (pci_bus, devfn, PCI_IO_LIMIT, temp_byte); + rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_IO_LIMIT, temp_byte); } else { kfree(hold_IO_node); hold_IO_node = NULL; @@ -2559,17 +2556,17 @@ /* set Mem base and Limit registers */ RES_CHECK(mem_node->base, 16); temp_word = (u32)(mem_node->base >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word); RES_CHECK(mem_node->base + mem_node->length - 1, 16); temp_word = (u32)((mem_node->base + mem_node->length - 1) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); } else { temp_word = 0xFFFF; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_BASE, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_BASE, temp_word); temp_word = 0x0000; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, temp_word); kfree(hold_mem_node); hold_mem_node = NULL; @@ -2586,17 +2583,17 @@ /* set Pre Mem base and Limit registers */ RES_CHECK(p_mem_node->base, 16); temp_word = (u32)(p_mem_node->base >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); RES_CHECK(p_mem_node->base + p_mem_node->length - 1, 16); temp_word = (u32)((p_mem_node->base + p_mem_node->length - 1) >> 16); - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); } else { temp_word = 0xFFFF; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, temp_word); temp_word = 0x0000; - rc = pci_bus_write_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); + rc = pci_bus_write_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, temp_word); kfree(hold_p_mem_node); hold_p_mem_node = NULL; @@ -2613,7 +2610,8 @@ ID = 0xFFFFFFFF; pci_bus->number = hold_bus_node->base; - pci_bus_read_config_dword (pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID); + pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), + PCI_VENDOR_ID, &ID); pci_bus->number = func->bus; if (ID != 0xFFFFFFFF) { /* device Present */ diff -Nru a/drivers/pci/hotplug/shpchp_pci.c b/drivers/pci/hotplug/shpchp_pci.c --- a/drivers/pci/hotplug/shpchp_pci.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/hotplug/shpchp_pci.c Tue May 4 22:16:06 2004 @@ -53,10 +53,11 @@ /* Still NULL ? Well then scan for it ! */ if (func->pci_dev == NULL) { num = pci_scan_slot(ctrl->pci_dev->subordinate, PCI_DEVFN(func->device, func->function)); - if (num) + if (num) { dbg("%s: subordiante %p number %x\n", __FUNCTION__, ctrl->pci_dev->subordinate, ctrl->pci_dev->subordinate->number); - pci_bus_add_devices(ctrl->pci_dev->subordinate); + pci_bus_add_devices(ctrl->pci_dev->subordinate); + } func->pci_dev = pci_find_slot(func->bus, PCI_DEVFN(func->device, func->function)); if (func->pci_dev == NULL) { @@ -67,7 +68,7 @@ if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus); - child = (struct pci_bus*) pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus); + child = pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus); pci_do_scan_bus(child); } @@ -81,10 +82,12 @@ int rc = 0; int j; - dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function); + dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, + func->device, func->function); for (j=0; j<8 ; j++) { - struct pci_dev* temp = pci_find_slot(func->bus, (func->device << 3) | j); + struct pci_dev* temp = pci_find_slot(func->bus, + (func->device << 3) | j); if (temp) { pci_remove_bus_device(temp); } @@ -163,12 +166,14 @@ int is_hot_plug = num_ctlr_slots || first_device_num; struct pci_bus lpci_bus, *pci_bus; - dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, num_ctlr_slots, first_device_num); + dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, + num_ctlr_slots, first_device_num); memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus)); pci_bus = &lpci_bus; - dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, num_ctlr_slots, first_device_num); + dbg("%s: num_ctlr_slots = %d, first_device_num = %d\n", __FUNCTION__, + num_ctlr_slots, first_device_num); /* Decide which slots are supported */ if (is_hot_plug) { @@ -182,20 +187,24 @@ LastSupported = 0x1F; } - dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported, LastSupported); + dbg("FirstSupported = %d, LastSupported = %d\n", FirstSupported, + LastSupported); /* Save PCI configuration space for all devices in supported slots */ pci_bus->number = busnumber; for (device = FirstSupported; device <= LastSupported; device++) { ID = 0xFFFFFFFF; - rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), PCI_VENDOR_ID, &ID); + rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, 0), + PCI_VENDOR_ID, &ID); if (ID != 0xFFFFFFFF) { /* device in slot */ - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), 0x0B, &class_code); + rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), + 0x0B, &class_code); if (rc) return rc; - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), PCI_HEADER_TYPE, &header_type); + rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, 0), + PCI_HEADER_TYPE, &header_type); if (rc) return rc; @@ -216,7 +225,8 @@ /* Recurse the subordinate bus * get the subordinate bus number */ - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), + rc = pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(device, function), PCI_SECONDARY_BUS, &secondary_bus); if (rc) { return rc; @@ -255,13 +265,17 @@ new_slot->switch_save = 0x10; /* In case of unsupported board */ new_slot->status = DevError; - new_slot->pci_dev = pci_find_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function); + new_slot->pci_dev = pci_find_slot(new_slot->bus, + (new_slot->device << 3) | new_slot->function); dbg("new_slot->pci_dev = %p\n", new_slot->pci_dev); for (cloop = 0; cloop < 0x20; cloop++) { - rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), - cloop << 2, (u32 *) & (new_slot->config_space [cloop])); - /* dbg("new_slot->config_space[%x] = %x\n", cloop, new_slot->config_space[cloop]); */ + rc = pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(device, function), + cloop << 2, + (u32 *) &(new_slot->config_space [cloop])); + /* dbg("new_slot->config_space[%x] = %x\n", + cloop, new_slot->config_space[cloop]); */ if (rc) return rc; } @@ -275,23 +289,28 @@ */ while ((function < max_functions)&&(!stop_it)) { - rc = pci_bus_read_config_dword(pci_bus, PCI_DEVFN(device, function), PCI_VENDOR_ID, &ID); + rc = pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(device, function), + PCI_VENDOR_ID, &ID); if (ID == 0xFFFFFFFF) { /* nothing there. */ function++; dbg("Nothing there\n"); } else { /* Something there */ - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), + rc = pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(device, function), 0x0B, &class_code); if (rc) return rc; - rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(device, function), + rc = pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(device, function), PCI_HEADER_TYPE, &header_type); if (rc) return rc; - dbg("class_code = %x, header_type = %x\n", class_code, header_type); + dbg("class_code = %x, header_type = %x\n", + class_code, header_type); stop_it++; } } @@ -328,7 +347,7 @@ * * returns 0 if success */ -int shpchp_save_slot_config (struct controller *ctrl, struct pci_func * new_slot) +int shpchp_save_slot_config(struct controller *ctrl, struct pci_func * new_slot) { int rc; u8 class_code; @@ -347,12 +366,15 @@ ID = 0xFFFFFFFF; - pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_VENDOR_ID, &ID); + pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, 0), + PCI_VENDOR_ID, &ID); if (ID != 0xFFFFFFFF) { /* device in slot */ - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), 0x0B, &class_code); + pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), + 0x0B, &class_code); - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), PCI_HEADER_TYPE, &header_type); + pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, 0), + PCI_HEADER_TYPE, &header_type); if (header_type & 0x80) /* Multi-function device */ max_functions = 8; @@ -364,7 +386,8 @@ do { if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */ /* Recurse the subordinate bus */ - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), + pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(new_slot->device, function), PCI_SECONDARY_BUS, &secondary_bus); sub_bus = (int) secondary_bus; @@ -373,15 +396,17 @@ rc = shpchp_save_config(ctrl, sub_bus, 0, 0); if (rc) - return(rc); + return rc; } /* End of IF */ new_slot->status = 0; for (cloop = 0; cloop < 0x20; cloop++) { - pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), - cloop << 2, (u32 *) & (new_slot->config_space [cloop])); + pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(new_slot->device, function), + cloop << 2, + (u32 *) &(new_slot->config_space [cloop])); } function++; @@ -393,15 +418,20 @@ */ while ((function < max_functions) && (!stop_it)) { - pci_bus_read_config_dword(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_VENDOR_ID, &ID); + pci_bus_read_config_dword(pci_bus, + PCI_DEVFN(new_slot->device, function), + PCI_VENDOR_ID, &ID); if (ID == 0xFFFFFFFF) { /* nothing there. */ function++; } else { /* Something there */ - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), 0x0B, &class_code); - - pci_bus_read_config_byte(pci_bus, PCI_DEVFN(new_slot->device, function), PCI_HEADER_TYPE, - &header_type); + pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(new_slot->device, function), + 0x0B, &class_code); + + pci_bus_read_config_byte(pci_bus, + PCI_DEVFN(new_slot->device, function), + PCI_HEADER_TYPE, &header_type); stop_it++; } @@ -410,10 +440,10 @@ } while (function < max_functions); } /* End of IF (device in slot?) */ else { - return(2); + return 2; } - return(0); + return 0; } @@ -429,7 +459,7 @@ * it loops for all functions of the slot and disables them. * else, it just get resources of the function and return. */ -int shpchp_save_used_resources (struct controller *ctrl, struct pci_func *func, int disable) +int shpchp_save_used_resources(struct controller *ctrl, struct pci_func *func, int disable) { u8 cloop; u8 header_type; @@ -461,7 +491,7 @@ devfn = PCI_DEVFN(func->device, func->function); /* Save the command register */ - pci_bus_read_config_word (pci_bus, devfn, PCI_COMMAND, &save_command); + pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &save_command); if (disable) { /* disable card */ @@ -470,20 +500,22 @@ } /* Check for Bridge */ - pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type); + pci_bus_read_config_byte(pci_bus, devfn, PCI_HEADER_TYPE, &header_type); if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) { /* PCI-PCI Bridge */ - dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command); + dbg("Save_used_res of PCI bridge b:d=0x%x:%x, sc=0x%x\n", + func->bus, func->device, save_command); if (disable) { /* Clear Bridge Control Register */ command = 0x00; pci_bus_write_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, command); } - pci_bus_read_config_byte (pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); - pci_bus_read_config_byte (pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); + pci_bus_read_config_byte(pci_bus, devfn, PCI_SECONDARY_BUS, &secondary_bus); + pci_bus_read_config_byte(pci_bus, devfn, PCI_SUBORDINATE_BUS, &temp_byte); - bus_node =(struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + bus_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!bus_node) return -ENOMEM; @@ -494,13 +526,14 @@ func->bus_head = bus_node; /* Save IO base and Limit registers */ - pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_BASE, &temp_byte); + pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_BASE, &temp_byte); base = temp_byte; - pci_bus_read_config_byte (pci_bus, devfn, PCI_IO_LIMIT, &temp_byte); + pci_bus_read_config_byte(pci_bus, devfn, PCI_IO_LIMIT, &temp_byte); length = temp_byte; if ((base <= length) && (!disable || (save_command & PCI_COMMAND_IO))) { - io_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!io_node) return -ENOMEM; @@ -512,11 +545,12 @@ } /* Save memory base and Limit registers */ - pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_BASE, &w_base); - pci_bus_read_config_word (pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); + pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_BASE, &w_base); + pci_bus_read_config_word(pci_bus, devfn, PCI_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) { - mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + mem_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!mem_node) return -ENOMEM; @@ -527,11 +561,12 @@ func->mem_head = mem_node; } /* Save prefetchable memory base and Limit registers */ - pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); - pci_bus_read_config_word (pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); + pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_BASE, &w_base); + pci_bus_read_config_word(pci_bus, devfn, PCI_PREF_MEMORY_LIMIT, &w_length); if ((w_base <= w_length) && (!disable || (save_command & PCI_COMMAND_MEMORY))) { - p_mem_node = (struct pci_resource *) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); + p_mem_node = kmalloc(sizeof(struct pci_resource), + GFP_KERNEL); if (!p_mem_node) return -ENOMEM; @@ -542,38 +577,41 @@ func->p_mem_head = p_mem_node; } } else if ((header_type & 0x7F) == PCI_HEADER_TYPE_NORMAL) { - dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n", func->bus, func->device, save_command); + dbg("Save_used_res of PCI adapter b:d=0x%x:%x, sc=0x%x\n", + func->bus, func->device, save_command); /* Figure out IO and memory base lengths */ for (cloop = PCI_BASE_ADDRESS_0; cloop <= PCI_BASE_ADDRESS_5; cloop += 4) { - pci_bus_read_config_dword (pci_bus, devfn, cloop, &save_base); + pci_bus_read_config_dword(pci_bus, devfn, cloop, &save_base); temp_register = 0xFFFFFFFF; - pci_bus_write_config_dword (pci_bus, devfn, cloop, temp_register); - pci_bus_read_config_dword (pci_bus, devfn, cloop, &temp_register); + pci_bus_write_config_dword(pci_bus, devfn, cloop, temp_register); + pci_bus_read_config_dword(pci_bus, devfn, cloop, &temp_register); - if (!disable) { - pci_bus_write_config_dword (pci_bus, devfn, cloop, save_base); - } + if (!disable) + pci_bus_write_config_dword(pci_bus, devfn, cloop, save_base); if (!temp_register) continue; base = temp_register; - if ((base & PCI_BASE_ADDRESS_SPACE_IO) && (!disable || (save_command & PCI_COMMAND_IO))) { + if ((base & PCI_BASE_ADDRESS_SPACE_IO) && + (!disable || (save_command & PCI_COMMAND_IO))) { /* IO base */ /* set temp_register = amount of IO space requested */ base = base & 0xFFFFFFFCL; base = (~base) + 1; - io_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL); + io_node = kmalloc(sizeof (struct pci_resource), + GFP_KERNEL); if (!io_node) return -ENOMEM; io_node->base = (ulong)save_base & PCI_BASE_ADDRESS_IO_MASK; io_node->length = (ulong)base; - dbg("sur adapter: IO bar=0x%x(length=0x%x)\n", io_node->base, io_node->length); + dbg("sur adapter: IO bar=0x%x(length=0x%x)\n", + io_node->base, io_node->length); io_node->next = func->io_head; func->io_head = io_node; @@ -583,11 +621,13 @@ char *res_type_str = "PMEM"; u32 temp_register2; - t_mem_node = (struct pci_resource *) kmalloc(sizeof (struct pci_resource), GFP_KERNEL); + t_mem_node = kmalloc(sizeof (struct pci_resource), + GFP_KERNEL); if (!t_mem_node) return -ENOMEM; - if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) && (!disable || (save_command & PCI_COMMAND_MEMORY))) { + if (!(base & PCI_BASE_ADDRESS_MEM_PREFETCH) && + (!disable || (save_command & PCI_COMMAND_MEMORY))) { prefetchable = 0; mem_node = t_mem_node; res_type_str++; @@ -602,16 +642,20 @@ if (prefetchable) { p_mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK; p_mem_node->length = (ulong)base; - dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, - p_mem_node->base, p_mem_node->length); + dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", + res_type_str, + p_mem_node->base, + p_mem_node->length); p_mem_node->next = func->p_mem_head; func->p_mem_head = p_mem_node; } else { mem_node->base = (ulong)save_base & PCI_BASE_ADDRESS_MEM_MASK; mem_node->length = (ulong)base; - dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", res_type_str, - mem_node->base, mem_node->length); + dbg("sur adapter: 32 %s bar=0x%x(length=0x%x)\n", + res_type_str, + mem_node->base, + mem_node->length); mem_node->next = func->mem_head; func->mem_head = mem_node; @@ -631,16 +675,20 @@ if (prefetchable) { p_mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK; p_mem_node->length = base; - dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, - p_mem_node->base, p_mem_node->length); + dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", + res_type_str, + p_mem_node->base, + p_mem_node->length); p_mem_node->next = func->p_mem_head; func->p_mem_head = p_mem_node; } else { mem_node->base = base64 & PCI_BASE_ADDRESS_MEM_MASK; mem_node->length = base; - dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", res_type_str, - mem_node->base, mem_node->length); + dbg("sur adapter: 64 %s base=0x%x(len=0x%x)\n", + res_type_str, + mem_node->base, + mem_node->length); mem_node->next = func->mem_head; func->mem_head = mem_node; @@ -648,13 +696,15 @@ cloop += 4; break; default: - dbg("asur: reserved BAR type=0x%x\n", temp_register); + dbg("asur: reserved BAR type=0x%x\n", + temp_register); break; } } } /* End of base register loop */ } else { /* Some other unknown header type */ - dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n", func->bus, func->device); + dbg("Save_used_res of PCI unknown type b:d=0x%x:%x. skip.\n", + func->bus, func->device); } /* find the next device in this slot */ @@ -663,9 +713,27 @@ func = shpchp_slot_find(func->bus, func->device, index++); } - return(0); + return 0; } +/** + * kfree_resource_list: release memory of all list members + * @res: resource list to free + */ +static inline void +return_resource_list(struct pci_resource **func, struct pci_resource **res) +{ + struct pci_resource *node; + struct pci_resource *t_node; + + node = *func; + *func = NULL; + while (node) { + t_node = node->next; + return_resource(res, node); + node = t_node; + } +} /* * shpchp_return_board_resources @@ -675,95 +743,39 @@ * * returns 0 if success */ -int shpchp_return_board_resources(struct pci_func * func, struct resource_lists * resources) +int shpchp_return_board_resources(struct pci_func * func, + struct resource_lists * resources) { - int rc = 0; - struct pci_resource *node; - struct pci_resource *t_node; + int rc; dbg("%s\n", __FUNCTION__); if (!func) - return(1); - - node = func->io_head; - func->io_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->io_head), node); - node = t_node; - } + return 1; - node = func->mem_head; - func->mem_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->mem_head), node); - node = t_node; - } + return_resource_list(&(func->io_head),&(resources->io_head)); + return_resource_list(&(func->mem_head),&(resources->mem_head)); + return_resource_list(&(func->p_mem_head),&(resources->p_mem_head)); + return_resource_list(&(func->bus_head),&(resources->bus_head)); - node = func->p_mem_head; - func->p_mem_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->p_mem_head), node); - node = t_node; - } - - node = func->bus_head; - func->bus_head = NULL; - while (node) { - t_node = node->next; - return_resource(&(resources->bus_head), node); - node = t_node; - } - - rc |= shpchp_resource_sort_and_combine(&(resources->mem_head)); + rc = shpchp_resource_sort_and_combine(&(resources->mem_head)); rc |= shpchp_resource_sort_and_combine(&(resources->p_mem_head)); rc |= shpchp_resource_sort_and_combine(&(resources->io_head)); rc |= shpchp_resource_sort_and_combine(&(resources->bus_head)); - return(rc); + return rc; } - -/* - * shpchp_destroy_resource_list - * - * Puts node back in the resource list pointed to by head +/** + * kfree_resource_list: release memory of all list members + * @res: resource list to free */ -void shpchp_destroy_resource_list (struct resource_lists * resources) +static inline void +kfree_resource_list(struct pci_resource **r) { struct pci_resource *res, *tres; - res = resources->io_head; - resources->io_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = resources->mem_head; - resources->mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = resources->p_mem_head; - resources->p_mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = resources->bus_head; - resources->bus_head = NULL; + res = *r; + *r = NULL; while (res) { tres = res; @@ -772,50 +784,26 @@ } } - -/* - * shpchp_destroy_board_resources - * - * Puts node back in the resource list pointed to by head +/** + * shpchp_destroy_resource_list: put node back in the resource list + * @resources: list to put nodes back */ -void shpchp_destroy_board_resources (struct pci_func * func) +void shpchp_destroy_resource_list(struct resource_lists *resources) { - struct pci_resource *res, *tres; - - res = func->io_head; - func->io_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = func->mem_head; - func->mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = func->p_mem_head; - func->p_mem_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } - - res = func->bus_head; - func->bus_head = NULL; - - while (res) { - tres = res; - res = res->next; - kfree(tres); - } + kfree_resource_list(&(resources->io_head)); + kfree_resource_list(&(resources->mem_head)); + kfree_resource_list(&(resources->p_mem_head)); + kfree_resource_list(&(resources->bus_head)); } +/** + * shpchp_destroy_board_resources: put node back in the resource list + * @resources: list to put nodes back + */ +void shpchp_destroy_board_resources(struct pci_func * func) +{ + kfree_resource_list(&(func->io_head)); + kfree_resource_list(&(func->mem_head)); + kfree_resource_list(&(func->p_mem_head)); + kfree_resource_list(&(func->bus_head)); +} diff -Nru a/drivers/pci/pci.ids b/drivers/pci/pci.ids --- a/drivers/pci/pci.ids Tue May 4 22:16:06 2004 +++ b/drivers/pci/pci.ids Tue May 4 22:16:06 2004 @@ -7,7 +7,7 @@ # so if you have anything to contribute, please visit the home page or # send a diff -u against the most recent pci.ids to pci-ids@ucw.cz. # -# Daily snapshot on Wed 2004-01-14 11:00:17 +# Daily snapshot on Thu 2004-04-15 10:00:04 # # Vendors, devices and subsystems. Please keep sorted. @@ -24,7 +24,23 @@ # Real TJN ID is e159, but they got it wrong several times --mj 0059 Tiger Jet Network Inc. (Wrong ID) 0070 Hauppauge computer works Inc. + 4000 WinTV PVR-350 + 4001 WinTV PVR-250 (v1) + 4009 WinTV PVR-250 + 4801 WinTV PVR-250 MCE 0100 Ncipher Corp Ltd +# 018a is not LevelOne but there is a board misprogrammed +018a LevelOne + 0106 FPC-0106TX misprogrammed [RTL81xx] +# 021b is not Compaq but there is a board misprogrammed +021b Compaq Computer Corporation + 8139 HNE-300 (RealTek RTL8139c) [iPaq Networking] +# http://www.davicom.com.tw/ +0291 Davicom Semiconductor, Inc. + 8212 DM9102A(DM9102AE, SM9102AF) Ethernet 100/10 MBit(Rev 40) +# SpeedStream is Efficient Networks, Inc, a Siemens Company +02ac SpeedStream + 1012 1012 PCMCIA 10/100 Ethernet Card [RTL81xx] 0675 Dynalink 1700 IS64PH ISDN Adapter 1702 IS64PH ISDN Adapter @@ -36,8 +52,23 @@ 0e11 Compaq Computer Corporation 0001 PCI to EISA Bridge 0002 PCI to ISA Bridge + 0046 Smart Array 64xx + 0e11 409a Smart Array 641 + 0e11 409b Smart Array 642 + 0e11 409c Smart Array 6400 + 0e11 409d Smart Array 6400 EM 0049 NC7132 Gigabit Upgrade Module 004a NC6136 Gigabit Server Adapter + 007c NC7770 1000BaseTX + 007d NC6770 1000BaseTX + 0085 NC7780 1000BaseTX + 00bb NC7760 + 00ca NC7771 + 00cb NC7781 + 00cf NC7772 + 00d0 NC7782 + 00d1 NC7783 + 00e3 NC7761 0508 Netelligent 4/16 Token Ring 1000 Triflex/Pentium Bridge, Model 1000 2000 Triflex/Pentium Bridge, Model 2000 @@ -45,6 +76,25 @@ 3033 QVision 1280/p 3034 QVision 1280/p 4000 4000 [Triflex] + 4030 SMART-2/P + 4031 SMART-2SL + 4032 Smart Array 3200 + 4033 Smart Array 3100ES + 4034 Smart Array 221 + 4040 Integrated Array + 4048 Compaq Raid LC2 + 4050 Smart Array 4200 + 4051 Smart Array 4250ES + 4058 Smart Array 431 + 4070 Smart Array 5300 + 4080 Smart Array 5i + 4082 Smart Array 532 + 4083 Smart Array 5312 + 4091 Smart Array 6i + 409a Smart Array 641 + 409b Smart Array 642 + 409c Smart Array 6400 + 409d Smart Array 6400 EM 6010 HotPlug PCI Bridge 6010 7020 USB Controller a0ec Fibre Channel Host Controller @@ -54,7 +104,7 @@ 8086 002a PCI Hotplug Controller A 8086 002b PCI Hotplug Controller B a0f8 ZFMicro Chipset USB - a0fc Fibre Channel Host Controller + a0fc FibreChannel HBA Tachyon ae10 Smart-2/P RAID Controller 0e11 4030 Smart-2/P Array Controller 0e11 4031 Smart-2SL Array Controller @@ -64,21 +114,21 @@ ae2a MPC ae2b MIS-E ae31 System Management Controller - ae32 Netelligent 10/100 + ae32 Netelligent 10/100 TX PCI UTP ae33 Triflex Dual EIDE Controller - ae34 Netelligent 10 + ae34 Netelligent 10 T PCI UTP ae35 Integrated NetFlex-3/P - ae40 Netelligent 10/100 Dual - ae43 ProLiant Integrated Netelligent 10/100 + ae40 Netelligent Dual 10/100 TX PCI UTP + ae43 Netelligent Integrated 10/100 TX UTP ae69 CETUS-L ae6c Northstar ae6d NorthStar CPU to PCI Bridge - b011 Integrated Netelligent 10/100 - b012 Netelligent 10 T/2 + b011 Netelligent 10/100 TX Embedded UTP + b012 Netelligent 10 T/2 PCI UTP/Coax b01e NC3120 Fast Ethernet NIC b01f NC3122 Fast Ethernet NIC b02f NC1120 Ethernet NIC - b030 Netelligent WS 5100 + b030 Netelligent 10/100 TX UTP b04a 10/100 TX PCI Intel WOL UTP Controller b060 Smart Array 5300 Controller b0c6 NC3161 Fast Ethernet NIC @@ -96,6 +146,9 @@ b163 NC3134 Fast Ethernet NIC b164 NC3165 Fast Ethernet Upgrade Module b178 Smart Array 5i/532 + 0e11 4080 Smart Array 5i + 0e11 4082 Smart Array 532 + 0e11 4083 Smart Array 5312 b1a4 NC7131 Gigabit Server Adapter f130 NetFlex-3/P ThunderLAN 1.0 f150 NetFlex-3/P ThunderLAN 2.3 @@ -128,32 +181,59 @@ 0020 53c1010 Ultra3 SCSI Adapter 1de1 1020 DC-390U3W 0021 53c1010 66MHz Ultra3 SCSI Adapter + 124b 1070 PMC-USCSI3 4c53 1080 CT8 mainboard 4c53 1300 P017 mezzanine (32-bit PMC) 4c53 1310 P017 mezzanine (64-bit PMC) 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI + 1028 0123 PowerEdge 2600 + 1028 014a PowerEdge 1750 1028 1010 LSI U320 SCSI Controller - 0040 53c1035 + 0031 53c1030ZC PCI-X Fusion-MPT Dual Ultra320 SCSI + 0032 53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI + 0033 1030ZC_53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI + 0040 53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI + 1000 0033 MegaRAID SCSI 320-2XR + 1000 0066 MegaRAID SCSI 320-2XRWS + 0041 53C1035ZC PCI-X Fusion-MPT Dual Ultra320 SCSI 008f 53c875J 1092 8000 FirePort 40 SCSI Controller 1092 8760 FirePort 40 Dual SCSI Host Adapter - 0621 FC909 - 0622 FC929 + 0407 MegaRAID + 1000 0530 MegaRAID 530 SCSI 320-0X RAID Controller + 1000 0531 MegaRAID 531 SCSI 320-4X RAID Controller + 1000 0532 MegaRAID 532 SCSI 320-2X RAID Controller + 1028 0533 PowerEgde Expandable RAID Controller 4/QC + 8086 0532 Storage RAID Controller SRCU42X + 0621 FC909 Fibre Channel Adapter + 0622 FC929 Fibre Channel Adapter + 1000 1020 44929 O Dual Fibre Channel card 0623 FC929 LAN - 0624 FC919 + 0624 FC919 Fibre Channel Adapter 0625 FC919 LAN - 0626 FC929X + 0626 FC929X Fibre Channel Adapter + 1000 1010 7202-XP-LC Dual Fibre Channel card 0627 FC929X LAN - 0628 FC919X + 0628 FC919X Fibre Channel Adapter 0629 FC919X LAN 0701 83C885 NT50 DigitalScape Fast Ethernet 0702 Yellowfin G-NIC gigabit ethernet 1318 0000 PEI100X + 0804 SA2010 + 0805 SA2010ZC + 0806 SA2020 + 0807 SA2020ZC 0901 61C102 1000 63C815 - 1960 PowerEdge Expandable RAID Controller 4 - 1028 0518 PowerEdge Expandable RAID Controller 4/DC - 1028 0520 PowerEdge Expandable RAID Controller 4/SC + 1960 MegaRAID + 1000 0518 MegaRAID 518 SCSI 320-2 Controller + 1000 0520 MegaRAID 520 SCSI 320-1 Controller + 1000 0522 MegaRAID 522 i4133 RAID Controller + 1000 0523 MegaRAID SATA 150-6 RAID Controller + 1000 4523 MegaRAID SATA 150-4 RAID Controller + 1000 a520 MegaRAID ZCR SCSI 320-0 Controller + 1028 0518 MegaRAID 518 DELL PERC 4/DC RAID Controller + 1028 0520 MegaRAID 520 DELL PERC 4/SC RAID Controller 1028 0531 PowerEdge Expandable RAID Controller 4/QC 1001 Kolter Electronic 0010 PCI 1616 Measurement card with 32 digital I/O lines @@ -167,16 +247,57 @@ 9100 INI-9100/9100W SCSI Host 1002 ATI Technologies Inc 4136 Radeon IGP 320 M - 4144 Radeon R300 AD [Radeon 9500 Pro] - 4145 Radeon R300 AE [Radeon 9500 Pro] - 4146 Radeon R300 AF [Radeon 9500 Pro] - 4147 Radeon R300 AG [FireGL Z1/X1] + 4144 R300 AD [Radeon 9500 Pro] +# New PCI ID provided by ATI developer relations (correction to above) + 4145 R300 AE [Radeon 9700 Pro] +# New PCI ID provided by ATI developer relations (oops, correction to above) + 4146 R300 AF [Radeon 9700 Pro] + 4147 R300 AG [FireGL Z1/X1] + 4148 R350 AH [Radeon 9800] + 4149 R350 AI [Radeon 9800] + 414b R350 AK [Fire GL ??] +# New PCI ID provided by ATI developer relations + 4150 RV350 AP [Radeon 9600] + 1458 4024 Giga-Byte GV-R96128D Primary + 148c 2064 PowerColor R96A-C3N + 148c 2066 PowerColor R96A-C3N + 174b 7c19 Sapphire Atlantis Radeon 9600 Pro + 174b 7c29 GC-R9600PRO Primary [Sapphire] + 18bc 0101 GC-R9600PRO Primary +# New PCI ID provided by ATI developer relations + 4151 RV350 AQ [Radeon 9600] +# New PCI ID provided by ATI developer relations + 4152 RV350 AR [Radeon 9600] + 4154 RV350 AT [Fire GL T2] + 4155 RV350 AU [Fire GL T2] + 4156 RV350 AV [Fire GL T2] + 4157 RV350 AW [Fire GL T2] 4158 68800AX [Mach32] - 4164 Radeon R300 Secondary (DVI) output - 4242 Radeon R200 BB [Radeon All in Wonder 8500DV] +# The PCI ID is unrelated to any DVI output. + 4164 R300 AD [Radeon 9500 Pro] (Secondary) +# New PCI ID info provided by ATI developer relations + 4165 R300 AE [Radeon 9700 Pro] (Secondary) +# New PCI ID info provided by ATI developer relations + 4166 R300 AF [Radeon 9700 Pro] (Secondary) +# New PCI ID provided by ATI developer relations + 4168 Radeon R350 [Radeon 9800] (Secondary) +# New PCI ID provided by ATI developer relations (correction to above) + 4170 RV350 AP [Radeon 9600] (Secondary) + 1458 4025 Giga-Byte GV-R96128D Secondary + 148c 2067 PowerColor R96A-C3N (Secondary) + 174b 7c28 GC-R9600PRO Secondary [Sapphire] + 18bc 0100 GC-R9600PRO Secondary +# New PCI ID provided by ATI developer relations (correction to above) + 4171 RV350 AQ [Radeon 9600] (Secondary) +# New PCI ID provided by ATI developer relations (correction to above) + 4172 RV350 AR [Radeon 9600] (Secondary) + 4242 R200 BB [Radeon All in Wonder 8500DV] 1002 02aa Radeon 8500 AIW DV Edition 4336 Radeon Mobility U1 4337 Radeon IGP 340M + 4341 IXP150 AC'97 Audio Controller +# Radeon 9100 IGP integrated + 4353 ATI SMBus 4354 215CT [Mach64 CT] 4358 210888CX [Mach64 CX] 4554 210888ET [Mach64 ET] @@ -246,21 +367,22 @@ 475a 3D Rage IIC AGP 1002 0087 Rage 3D IIC 1002 475a Rage IIC AGP - 4964 Radeon R250 Id [Radeon 9000] - 4965 Radeon R250 Ie [Radeon 9000] - 4966 Radeon R250 If [Radeon 9000] - 10f1 0002 R250 If [Tachyon G9000 PRO] - 148c 2039 R250 If [Radeon 9000 Pro "Evil Commando"] - 1509 9a00 R250 If [Radeon 9000 "AT009"] -# New subdevice - 3D Prophet 9000 PCI by Hercules. AGP version probably would have same ID, so not specified. - 1681 0040 R250 If [3D prophet 9000] - 174b 7176 R250 If [Sapphire Radeon 9000 Pro] - 174b 7192 R250 If [Radeon 9000 "Atlantis"] - 17af 2005 R250 If [Excalibur Radeon 9000 Pro] - 17af 2006 R250 If [Excalibur Radeon 9000] - 4967 Radeon R250 Ig [Radeon 9000] - 496e Radeon R250 [Radeon 9000] (Secondary) + 4964 Radeon RV250 Id [Radeon 9000] + 4965 Radeon RV250 Ie [Radeon 9000] + 4966 Radeon RV250 If [Radeon 9000] + 10f1 0002 RV250 If [Tachyon G9000 PRO] + 148c 2039 RV250 If [Radeon 9000 Pro "Evil Commando"] + 1509 9a00 RV250 If [Radeon 9000 "AT009"] +# New subdevice - 3D Prophet 9000 PCI by Hercules. AGP version probably would have same ID, so not specified. + 1681 0040 RV250 If [3D prophet 9000] + 174b 7176 RV250 If [Sapphire Radeon 9000 Pro] + 174b 7192 RV250 If [Radeon 9000 "Atlantis"] + 17af 2005 RV250 If [Excalibur Radeon 9000 Pro] + 17af 2006 RV250 If [Excalibur Radeon 9000] + 4967 Radeon RV250 Ig [Radeon 9000] + 496e Radeon RV250 [Radeon 9000] (Secondary) 4c42 3D Rage LT Pro AGP-133 + 0e11 b0e7 Rage LT Pro (Compaq Presario 5240) 0e11 b0e8 Rage 3D LT Pro 0e11 b10e 3D Rage LT Pro (Compaq Armada 1750) 1002 0040 Rage LT Pro AGP 2X @@ -294,10 +416,11 @@ 4c57 Radeon Mobility M7 LW [Radeon Mobility 7500] 1014 0517 ThinkPad T30 1028 00e6 Radeon Mobility M7 LW (Dell Inspiron 8100) + 1028 012a Latitude C640 144d c006 Radeon Mobility M7 LW in vpr Matrix 170B4 4c58 Radeon RV200 LX [Mobility FireGL 7800 M7] 4c59 Radeon Mobility M6 LY - 1014 0235 ThinkPad A30p (2653-64G) + 1014 0235 ThinkPad A30/A30p (2652/2653) 1014 0239 ThinkPad X22/X23/X24 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 4c5a Radeon Mobility M6 LZ @@ -312,15 +435,29 @@ 4e44 Radeon R300 ND [Radeon 9700 Pro] 4e45 Radeon R300 NE [Radeon 9500 Pro] 1002 0002 Radeon R300 NE [Radeon 9500 Pro] - 4e46 Radeon R300 NF [Radeon 9700] +# New PCI ID provided by ATI developer relations (correction to above) + 4e46 RV350 NF [Radeon 9600] 4e47 Radeon R300 NG [FireGL X1] 4e48 Radeon R350 [Radeon 9800] +# New PCI ID provided by ATI developer relations + 4e49 Radeon R350 [Radeon 9800] + 4e4a RV350 NJ [Radeon 9800 XT] + 4e4b R350 NK [Fire GL X2] +# New PCI ID provided by ATI developer relations + 4e50 RV350 [Mobility Radeon 9600 M10] +# New PCI ID provided by ATI developer relations + 4e52 RV350 [Mobility Radeon 9600 M10] + 4e54 M10 NT [FireGL Mobility T2] 4e64 Radeon R300 [Radeon 9700 Pro] (Secondary) 4e65 Radeon R300 [Radeon 9500 Pro] (Secondary) 1002 0003 Radeon R300 NE [Radeon 9500 Pro] - 4e66 Radeon R300 [Radeon 9700] (Secondary) +# New PCI ID provided by ATI developer relations (correction to above) + 4e66 RV350 NF [Radeon 9600] (Secondary) 4e67 Radeon R300 [FireGL X1] (Secondary) 4e68 Radeon R350 [Radeon 9800] (Secondary) +# New PCI ID provided by ATI developer relations + 4e69 Radeon R350 [Radeon 9800] (Secondary) + 4e6a RV350 NJ [Radeon 9800 XT] (Secondary) 5041 Rage 128 PA/PRO 5042 Rage 128 PB/PRO AGP 2x 5043 Rage 128 PC/PRO AGP 4x @@ -390,6 +527,8 @@ 514d Radeon R200 QM [Radeon 9100] 514e Radeon R200 QN [Radeon 8500LE] 514f Radeon R200 QO [Radeon 8500LE] + 5154 R200 QT [Radeon 8500] + 5155 R200 QU [Radeon 9100] 5157 Radeon RV200 QW [Radeon 7500] 1002 013a Radeon 7500 1458 4000 RV200 QW [RADEON 7500 PRO MAYA AR] @@ -469,7 +608,20 @@ 1002 5654 Mach64VT Reference 5655 264VT3 [Mach64 VT3] 5656 264VT4 [Mach64 VT4] - 5961 Radeon RV280 [Radeon 9200] + 5941 RV280 [Radeon 9200] (Secondary) +# http://www.hightech.com.hk/html/9200.htm + 17af 200d Excalibur Radeon 9200 + 18bc 0050 GeXcube GC-R9200-C3 (Secondary) + 5960 RV280 [Radeon 9200 PRO] + 5961 RV280 [Radeon 9200] +# http://www.hightech.com.hk/html/9200.htm + 17af 200c Excalibur Radeon 9200 + 18bc 0051 GeXcube GC-R9200-C3 + 5964 RV280 [Radeon 9200 SE] + 148c 2073 CN-AG92E + 5c61 RV250 5c61 [Radeon Mobility 9200 M9+] + 5c63 RV250 5c63 [Radeon Mobility 9200 M9+] + 5d44 RV280 [Radeon 9200 SE] (Secondary) 700f PCI Bridge [IGP 320M] 7010 PCI Bridge [IGP 340M] cab0 AGP Bridge [IGP 320M] @@ -610,6 +762,7 @@ 1186 1100 DFE-500TX Fast Ethernet 1186 1101 DFE-500TX Fast Ethernet 1186 1102 DFE-500TX Fast Ethernet + 1186 1112 DFE-570TX Quad Fast Ethernet 1259 2800 AT-2800Tx Fast Ethernet 1266 0004 Eagle Fast EtherMAX 12af 0019 NetFlyer Cardbus Fast Ethernet @@ -621,7 +774,7 @@ 1395 0001 10/100 Ethernet CardBus PC Card 13d1 ab01 EtherFast 10/100 Cardbus (PCMPC200) 8086 0001 EtherExpress PRO/100 Mobile CardBus 32 - 001a Farallon PN9000SX + 001a Farallon PN9000SX Gigabit Ethernet 0021 DECchip 21052 0022 DECchip 21150 0023 DECchip 21150 @@ -639,7 +792,8 @@ 12d9 000a IP Telephony card 4c53 1050 CT7 mainboard 4c53 1051 CE7 mainboard - 9005 0365 Adaptec 5400S + 9005 0364 5400S (Mustang) + 9005 0365 5400S (Mustang) 9005 1364 Dell PowerEdge RAID Controller 2 9005 1365 Dell PowerEdge RAID Controller 2 e4bf 1000 CC8-1-BLUES @@ -818,8 +972,13 @@ 101e American Megatrends Inc. 1960 MegaRAID 101e 0471 MegaRAID 471 Enterprise 1600 RAID Controller - 101e 0475 MegaRAID 475 Express 500 RAID Controller + 101e 0475 MegaRAID 475 Express 500/500LC RAID Controller + 101e 0477 MegaRAID 477 Elite 3100 RAID Controller 101e 0493 MegaRAID 493 Elite 1600 RAID Controller + 101e 0494 MegaRAID 494 Elite 1650 RAID Controller + 101e 0503 MegaRAID 503 Enterprise 1650 RAID Controller + 101e 0511 MegaRAID 511 i4 IDE RAID Controller + 101e 0522 MegaRAID 522 i4133 RAID Controller 1028 0471 PowerEdge RAID Controller 3/QC 1028 0475 PowerEdge RAID Controller 3/SC 1028 0493 PowerEdge RAID Controller 3/DC @@ -843,6 +1002,7 @@ 1103 K8 NorthBridge 2000 79c970 [PCnet32 LANCE] 1014 2000 NetFinity 10/100 Fast Ethernet + 1022 2000 PCnet - Fast 79C971 103c 104c Ethernet with LAN remote power Adapter 103c 1064 Ethernet with LAN remote power Adapter 103c 1065 Ethernet with LAN remote power Adapter @@ -913,6 +1073,7 @@ 0194 82C194 2000 4DWave DX 2001 4DWave NX + 2100 CyberBlade XP4m32 8400 CyberBlade/i7 1023 8400 CyberBlade i7 AGP 8420 CyberBlade/i7d @@ -1029,7 +1190,6 @@ 1028 0003 PowerEdge Expandable RAID Controller 3/Si 0004 PowerEdge Expandable RAID Controller 3/Si 1028 00d0 PowerEdge Expandable RAID Controller 3/Si - 0005 PowerEdge Expandable RAID Controller 3/Di 0006 PowerEdge Expandable RAID Controller 3/Di 0007 Remote Access Controller:DRAC III 0008 Remote Access Controller @@ -1040,12 +1200,26 @@ 1028 0121 PowerEdge Expandable RAID Controller 3/Di 000c Remote Access Controller:ERA or ERA/O 000d BMC/SMIC device - 000e PowerEdge Expandable RAID Controller - 000f PowerEdge Expandable RAID Controller 4/Di + 000e PowerEdge Expandable RAID controller 4 + 1028 0123 PowerEdge Expandable RAID Controller 4/Di + 000f PowerEdge Expandable RAID controller 4 + 1028 013b MegaRAID DELL PERC 4/Di RAID On Motherboard + 1028 014a PowerEdge Expandable RAID Controller 4/Di + 1028 014c MegaRAID DELL PERC 4/Di RAID On Motherboard + 1028 014d MegaRAID DELL PERC 4/Di RAID On Motherboard 1029 Siemens Nixdorf IS 102a LSI Logic 0000 HYDRA 0010 ASPEN + 001f AHA-2940U2/U2W /7890/7891 SCSI Controllers + 9005 000f 2940U2W SCSI Controller + 9005 0106 2940U2W SCSI Controller + 9005 a180 2940U2W SCSI Controller + 00c5 AIC-7899 U160/m SCSI Controller + 1028 00c5 PowerEdge 2550/2650/4600 + 00cf AIC-7899P U160/m + 1028 0106 PowerEdge 4600 + 1028 0121 PowerEdge 2650 102b Matrox Graphics, Inc. # DJ: I've a suspicion that 0010 is a duplicate of 0d10. 0010 MGA-I [Impression?] @@ -1171,6 +1345,7 @@ 102b 0f83 Millennium G550 102b 0f84 Millennium G550 Dual Head DDR 32Mb 102b 1e41 Millennium G550 + 2537 MGA G650 AGP 4536 VIA Framegrabber 6573 Shark 10/100 Multiport SwitchNIC 102c Chips and Technologies @@ -1206,6 +1381,11 @@ 0009 r4x00 0020 ATM Meteor 155 102f 00f8 ATM Meteor 155 + 0105 TC86C001 [goku-s] IDE + 0106 TC86C001 [goku-s] USB 1.1 Host + 0107 TC86C001 [goku-s] USB Device Controller + 0108 TC86C001 [goku-s] I2C/SIO/GPIO Controller + 0180 TX4927 1030 TMC Research 1031 Miro Computer Products AG 5601 DC20 ASIC @@ -1235,6 +1415,7 @@ 1179 0001 USB 12ee 7000 Root Hub 1799 0001 Root Hub + 807d 0035 PCI-USB2 (OHCI subsystem) 003b PCI to C-bus Bridge 003e NAPCCARD Cardbus Controller 0046 PowerVR PCX2 [midas] @@ -1252,14 +1433,21 @@ 0074 56k Voice Modem 1033 8014 RCV56ACF 56k Voice Modem 009b Vrc5476 + 00a5 VRC4173 00a6 VRC5477 AC97 00cd IEEE 1394 [OrangeLink] Host Controller 12ee 8011 Root hub + 00ce IEEE 1394 Host Controller 00df Vr4131 00e0 USB 2.0 + 0ee4 3383 Sitecom IEEE 1394 / USB2.0 Combo Card 12ee 7001 Root hub 1799 0002 Root Hub + 807d 1043 PCI-USB2 (EHCI subsystem) + 00e7 IEEE 1394 Host Controller + 00f2 uPD72874 IEEE1394 OHCI 1.1 3-port PHY-Link Ctrlr 00f3 uPD6113x Multimedia Decoder/Processor [EMMA2] + 010c VR7701 1034 Framatome Connectors USA Inc. 1035 Comp. & Comm. Research Lab 1036 Future Domain Corp. @@ -1267,27 +1455,27 @@ 1037 Hitachi Micro Systems 1038 AMP, Inc 1039 Silicon Integrated Systems [SiS] -# This is what all my tests report. I don't know if this is equivalent to "5591/5592 AGP". - 0001 SiS 530 Virtual PCI-to-PCI bridge (AGP) + 0001 Virtual PCI-to-PCI bridge (AGP) 0002 SG86C202 0006 85C501/2/3 - 0008 85C503/5513 + 0008 SiS85C503/5513 (LPC Bridge) 0009 ACPI 0018 SiS85C503/5513 (LPC Bridge) 0200 5597/5598/6326 VGA 1039 0000 SiS5597 SVGA (Shared RAM) 0204 82C204 0205 SG86C205 - 0300 SiS300/305 PCI/AGP VGA Display Adapter + 0300 300/305 PCI/AGP VGA Display Adapter 107d 2720 Leadtek WinFast VR300 - 0310 SiS315H PCI/AGP VGA Display Adapter - 0315 SiS315 PCI/AGP VGA Display Adapter - 0325 SiS315PRO PCI/AGP VGA Display Adapter - 0330 SiS330 [Xabre] PCI/AGP VGA Display Adapter + 0310 315H PCI/AGP VGA Display Adapter + 0315 315 PCI/AGP VGA Display Adapter + 0325 315PRO PCI/AGP VGA Display Adapter + 0330 330 [Xabre] PCI/AGP VGA Display Adapter 0406 85C501/2 0496 85C496 0530 530 Host 0540 540 Host + 0550 550 Host 0597 5513C 0601 85C601 0620 620 Host @@ -1297,24 +1485,32 @@ 0645 SiS645 Host & Memory & AGP Controller 0646 SiS645DX Host & Memory & AGP Controller 0648 SiS 645xx - 0650 650 Host - 0651 SiS651 Host + 0650 650/M650 Host + 0651 651 Host + 0655 655 Host + 0660 660 Host + 0661 661FX/M661FX/M661MX Host 0730 730 Host 0733 733 Host 0735 735 Host 0740 740 Host + 0741 741/741GX/M741 Host 0745 745 Host 0746 746 Host - 0755 SiS 755 Host Bridge - 0900 SiS900 10/100 Ethernet + 0755 755 Host + 0760 760/M760 Host + 0900 SiS900 PCI Fast Ethernet 1039 0900 SiS900 10/100 Ethernet Adapter 1043 8035 CUSI-FX motherboard 0961 SiS961 [MuTIOL Media IO] 0962 SiS962 [MuTIOL Media IO] + 0963 SiS963 [MuTIOL Media IO] + 0964 SiS964 [MuTIOL Media IO] + 0965 SiS965 [MuTIOL Media IO] 3602 83C602 5107 5107 5300 SiS540 PCI Display Adapter - 5315 SiS550 AGP/VGA VGA Display Adapter + 5315 550 PCI/AGP VGA Display Adapter 5401 486 PCI Chipset 5511 5511/5512 5513 5513 [IDE] @@ -1332,12 +1528,12 @@ 6204 Video decoder & MPEG interface 6205 VGA Controller 6236 6236 3D-AGP - 6300 SiS630 GUI Accelerator+3D + 6300 630/730 PCI/AGP VGA Display Adapter 1019 0970 P6STP-FL motherboard 1043 8035 CUSI-FX motherboard - 6306 SiS530 3D PCI/AGP + 6306 530/620 PCI/AGP VGA Display Adapter 1039 6306 SiS530,620 GUI Accelerator+3D - 6325 SiS650/651/M650/740 PCI/AGP VGA Display Adapter + 6325 65x/M650/740 PCI/AGP VGA Display Adapter 6326 86C326 5598/6326 1039 6326 SiS6326 GUI Accelerator 1092 0a50 SpeedStar A50 @@ -1345,14 +1541,16 @@ 1092 4910 SpeedStar A70 1092 4920 SpeedStar A70 1569 6326 SiS6326 GUI Accelerator + 6330 661FX/M661FX/M661MX/741/M741/760/M760 PCI/AGP 7001 USB 1.0 Controller 1039 7000 Onboard USB Controller 7002 USB 2.0 Controller 1509 7002 Onboard USB Controller 7007 FireWire Controller 7012 Sound Controller - 7013 Intel 537 [56k Winmodem] - 7016 10/100 Ethernet Adapter +# There are may be different modem codecs here (Intel537 compatible and incompatible) + 7013 AC'97 Modem Controller + 7016 SiS7016 PCI Fast Ethernet Adapter 1039 7016 SiS7016 10/100 Ethernet Adapter 7018 SiS PCI Audio Accelerator 1014 01b6 SiS PCI Audio Accelerator @@ -1410,6 +1608,7 @@ 103c 1226 Keystone SP2 103c 1227 Powerbar SP2 103c 1282 Everest SP2 + 1054 PCI Local Bus Adapter 1064 79C970 PCnet Ethernet Controller 108b Visualize FXe 10c1 NetServer Smart IRQ Router @@ -1422,6 +1621,7 @@ 1229 zx1 System Bus Adapter 122a zx1 I/O Controller 122e zx1 Local Bus Adapter + 127c sx1000 I/O Controller 1290 Auxiliary Diva Serial Port 2910 E2910A PCIBus Exerciser 2925 E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer @@ -1437,8 +1637,11 @@ 3020 Samurai_IDE 1043 Asustek Computer, Inc. 0675 ISDNLink P-IN100-ST-D + 4015 v7100 SDRAM [GeForce2 MX] 4021 v7100 Combo Deluxe [GeForce2 MX + TV tuner] 4057 v8200 GeForce 3 + 8043 v8240 PAL 128M [P4T] Motherboard + 807b v9280/TD [Geforce4 TI4200 8X With TV-Out and DVI] 1044 Distributed Processing Technology 1012 Domino RAID Engine a400 SmartCache/Raid I-IV Controller @@ -1523,9 +1726,9 @@ 021b STPC Consumer IIA Southbridge 0500 ST70137 [Unicorn] ADSL DMT Transceiver 0564 STPC Client Northbridge - 0981 DEC-Tulip compatible 10/100 Ethernet + 0981 21x4x DEC-Tulip compatible 10/100 Ethernet 1746 STG 1764X - 2774 DEC-Tulip compatible 10/100 Ethernet + 2774 21x4x DEC-Tulip compatible 10/100 Ethernet 3520 MPEG-II decoder card 55cc STPC Client Southbridge 104b BusLogic @@ -1577,24 +1780,33 @@ 8022 TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link) 8023 TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link) 8024 TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link) + 8025 TSB82AA2 IEEE-1394b Link Layer Controller 8026 TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link) 8027 PCI4451 IEEE-1394 Controller 1028 00e6 PCI4451 IEEE-1394 Controller (Dell Inspiron 8100) 8029 PCI4510 IEEE-1394 Controller + 1071 8160 MIM2900 8400 ACX 100 22Mbps Wireless Interface + 00fc 16ec U.S. Robotics 22 Mbps Wireless PC Card (model 2210) + 00fd 16ec U.S. Robotics 22Mbps Wireless PCI Adapter (model 2216) + 1186 3b01 DWL-520+ 22Mbps PCI Wireless Adapter 8401 ACX 100 22Mbps Wireless Interface # OK, this info is almost useless as is, but at least it's known that it's a wireless card. More info requested from reporter (whi 9000 Wireless Interface (of unknown type) + 9066 ACX 111 54Mbps Wireless Interface a001 TDC1570 a100 TDC1561 a102 TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f - a106 TMS320C6205 + a106 TMS320C6205 Fixed Point DSP + 175c 5000 ASI50xx Audio Adapter + 175c 8700 ASI87xx Radio Tuner card ac10 PCI1050 ac11 PCI1053 ac12 PCI1130 ac13 PCI1031 ac15 PCI1131 ac16 PCI1250 + 1014 0092 ThinkPad 600 ac17 PCI1220 ac18 PCI1260 ac19 PCI1221 @@ -1603,6 +1815,7 @@ 0e11 b113 Armada M700 ac1c PCI1225 0e11 b121 Armada E500 + 1028 0088 Dell Computer Corporation Latitude CPi A400XT ac1d PCI1251A ac1e PCI1211 ac1f PCI1251B @@ -1617,18 +1830,27 @@ ac42 PCI4451 PC card Cardbus Controller 1028 00e6 PCI4451 PC card CardBus Controller (Dell Inspiron 8100) ac44 PCI4510 PC card Cardbus Controller + 1071 8160 MIM2000 + ac46 PCI4520 PC card Cardbus Controller ac50 PCI1410 PC card Cardbus Controller ac51 PCI1420 1014 023b ThinkPad T23 (2647-4MG) 1028 00b1 Latitude C600 + 1028 012a Latitude C640 10cf 1095 Lifebook C6155 e4bf 1000 CP2-2-HIPHOP ac52 PCI1451 PC card Cardbus Controller ac53 PCI1421 PC card Cardbus Controller - ac55 PCI1250 PC card Cardbus Controller - 1014 0512 ThinkPad T30 + ac55 PCI1520 PC card Cardbus Controller + 1014 0512 ThinkPad T30/T40 ac56 PCI1510 PC card Cardbus Controller ac60 PCI2040 PCI to DSP Bridge Controller + 175c 5100 ASI51xx Audio Adapter + 175c 6100 ASI61xx Audio Adapter + 175c 6200 ASI62xx Audio Adapter + ac8d PCI 7620 + ac8e PCI7420 CardBus Controller + ac8f PCI7420 Flash Media Controller fe00 FireWire Host Controller fe03 12C01A FireWire Host Controller 104d Sony Corporation @@ -1674,7 +1896,20 @@ 0006 MPC8245 [Unity] 0100 MC145575 [HFC-PCI] 0431 KTI829c 100VG - 1801 Audio I/O Controller (MIDI) + 1801 DSP56301 Digital Signal Processor + 14fb 0101 Transas Radar Imitator Board [RIM] + 14fb 0102 Transas Radar Imitator Board [RIM-2] + 14fb 0202 Transas Radar Integrator Board [RIB-2] + 14fb 0611 1 channel CAN bus Controller [CanPci-1] + 14fb 0612 2 channels CAN bus Controller [CanPci-2] + 14fb 0613 3 channels CAN bus Controller [CanPci-3] + 14fb 0614 4 channels CAN bus Controller [CanPci-4] + 14fb 0621 1 channel CAN bus Controller [CanPci2-1] + 14fb 0622 2 channels CAN bus Controller [CanPci2-2] + 14fb 0810 Transas VTS Radar Integrator Board [RIB-4] + 175c 4200 ASI4215 Audio Adapter + 175c 4300 ASI43xx Audio Adapter + 175c 4400 ASI4401 Audio Adapter ecc0 0030 Layla 18c0 MPC8265A/MPC8266 4801 Raven @@ -1710,6 +1945,10 @@ 105a 4d39 Fasttrak66 1275 20275 3318 PDC20318 (SATA150 TX4) + 3319 PDC20319 (SATA150 TX4) + 3373 PDC20378 (SATA150 TX) + 1462 702e K8T NEO FIS2R motherboard + 3375 PDC20375 (SATA150 TX2plus) 3376 PDC20376 1043 809e A7V8X motherboard 4d30 20267 @@ -1727,11 +1966,15 @@ 105a 4d68 Ultra133TX2 5275 PDC20276 IDE 105a 0275 SuperTrak SX6000 IDE + 105a 1275 MBFastTrak133 Lite (tm) Controller (RAID mode) + 1458 b001 MBUltra 133 5300 DC5300 6268 20268R 6269 PDC20271 105a 6269 FastTrak TX2/TX2000 6621 PDC20621 [SX4000] 4 Channel IDE RAID Controller + 6622 PDC20621 [SATA150 SX4] 4 Channel IDE RAID Controller + 6626 PDC20618 Ultra 618 6629 PDC20619 FastTrak TX4000 RAID 7275 PDC20277 105b Foxconn International, Inc. @@ -1812,14 +2055,21 @@ 0005 National PC87550 System Controller 8002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave 1067 Mitsubishi Electric + 0301 AccelGraphics AccelECLIPSE + 0304 AccelGALAXY A2100 [OEM Evans & Sutherland] + 0308 Tornado 3000 [OEM Evans & Sutherland] 1002 VG500 [VolumePro Volume Rendering Accelerator] 1068 Diversified Technology 1069 Mylex Corporation 0001 DAC960P 0002 DAC960PD - 0010 DAC960PX + 0010 DAC960PG + 0020 DAC960LA 0050 AcceleRAID 352/170/160 support Device b166 Gemstone chipset SCSI controller + 1014 0242 iSeries 2872 DASD IOA + 1014 0266 Dual Channel PCI-X U320 SCSI Adapter + 1014 0278 Dual Channel PCI-X U320 SCSI RAID Adapter ba55 eXtremeRAID 1100 support Device ba56 eXtremeRAID 2000/3000 support Device 106a Aten Research Inc @@ -1853,6 +2103,22 @@ 0032 UniNorth 2 GMAC (Sun GEM) 0033 UniNorth 2 ATA/100 0034 UniNorth 2 AGP + 0035 UniNorth 2 PCI + 0036 UniNorth 2 Internal PCI + 003b UniNorth/Intrepid ATA/100 + 003e KeyLargo/Intrepid Mac I/O + 003f KeyLargo/Intrepid USB + 0040 K2 KeyLargo USB + 0041 K2 KeyLargo Mac/IO + 0042 K2 FireWire + 0043 K2 ATA/100 + 0045 K2 HT-PCI Bridge + 0046 K2 HT-PCI Bridge + 0047 K2 HT-PCI Bridge + 0048 K2 HT-PCI Bridge + 0049 K2 HT-PCI Bridge + 004b U3 AGP + 004c K2 GMAC (Sun GEM) 1645 Tigon3 Gigabit Ethernet NIC (BCM5701) 106c Hyundai Electronics America 8801 Dual Pentium ISA/PCI Motherboard @@ -1865,6 +2131,7 @@ 106f City Gate Development Ltd 1070 Daewoo Telecom Ltd 1071 Mitac + 8160 Mitac 8060B Mobile Platform 1072 GIT Co Ltd 1073 Yamaha Corporation 0001 3D GUI Accelerator @@ -1905,13 +2172,13 @@ 101e 8471 QLA12160 on AMI MegaRAID 101e 8493 QLA12160 on AMI MegaRAID 1240 ISP1240 SCSI Host Adapter - 1280 ISP1280 + 1280 ISP1280 SCSI Host Adapter 2020 ISP2020A Fast!SCSI Basic Adapter 2100 QLA2100 64-bit Fibre Channel Adapter 1077 0001 QLA2100 64-bit Fibre Channel Adapter - 2200 QLA2200 + 2200 QLA2200 64-bit Fibre Channel Adapter 1077 0002 QLA2200 - 2300 QLA2300 64-bit FC-AL Adapter + 2300 QLA2300 64-bit Fibre Channel Adapter 2312 QLA2312 Fibre Channel Adapter 1078 Cyrix Corporation 0000 5510 [Grappa] @@ -2008,6 +2275,7 @@ 8001 Schizo PCI Bus Module a000 Ultra IIi a001 Ultra IIe + a801 Tomatillo PCI Bus Module 108f Systemsoft 1090 Encore Computer Corporation 1091 Intergraph Corporation @@ -2063,7 +2331,7 @@ c801 PCI-GPIB c831 PCI-GPIB bridge 1094 First International Computers [FIC] -1095 CMD Technology Inc +1095 Silicon Image, Inc. (formerly CMD Technology Inc) 0240 Adaptec AAR-1210SA SATA HostRAID Controller 0640 PCI0640 0643 PCI0643 @@ -2078,8 +2346,12 @@ 0670 USB0670 1095 0670 USB0670 0673 USB0673 - 0680 PCI0680 - 3112 Silicon Image SiI 3112 SATARaid Controller + 0680 PCI0680 Ultra ATA-133 Host Controller + 1095 3680 Winic W-680 (Silicon Image 680 based) + 3112 Silicon Image Serial ATARaid Controller [ CMD/Sil 3112/3112A ] + 1095 6112 Asus A7N8X + 3114 Silicon Image SiI 3114 SATARaid Controller + 3512 Silicon Image Serial ATARaid Controller [ CMD/Sil 3512 ] 1096 Alacron 1097 Appian Technology 1098 Quantum Designs (H.K.) Ltd @@ -2109,11 +2381,13 @@ 127a 0003 Bt878a Mediastream Controller PAL BG 127a 0048 Bt878/832 Mediastream Controller 144f 3000 MagicTView CPH060 - Video + 1461 0002 TV98 Series (TV/No FM/Remote) 1461 0004 AVerTV WDM Video Capture 14f1 0001 Bt878 Mediastream Controller NTSC 14f1 0002 Bt878 Mediastream Controller PAL BG 14f1 0003 Bt878a Mediastream Controller PAL BG 14f1 0048 Bt878/832 Mediastream Controller + 1822 0001 VisionPlus DVB card 1851 1850 FlyVideo'98 - Video 1851 1851 FlyVideo II 1852 1852 FlyVideo'98 - Video (with FM Tuner) @@ -2170,6 +2444,7 @@ 14f1 0002 Bt878 Video Capture (Audio Section) 14f1 0003 Bt878 Video Capture (Audio Section) 14f1 0048 Bt878 Video Capture (Audio Section) + 1822 0001 VisionPlus DVB Card bd11 1200 PCTV pro (TV + FM stereo receiver, audio section) 0879 Bt879 Audio Capture 127a 0044 Bt879 Video Capture (Audio Section) @@ -2228,8 +2503,8 @@ 0006 HPCEX 0007 RPCEX 0008 DiVO VIP - 0009 Alteon Gigabit Ethernet - 10a9 8002 Acenic Gigabit Ethernet + 0009 AceNIC Gigabit Ethernet + 10a9 8002 AceNIC Gigabit Ethernet 0010 AMP Video I/O 0011 GRIP 0012 SGH PSHAC GSN @@ -2278,12 +2553,18 @@ 1147 VScom 020 2 port parallel adaptor 2724 Thales PCSM Security Card 9030 PCI <-> IOBus Bridge Hot Swap + 10b5 2862 Alpermann+Velte PCL PCI LV (3V/5V): Timecode Reader Board + 10b5 2906 Alpermann+Velte PCI TS (3V/5V): Time Synchronisation Board + 10b5 2940 Alpermann+Velte PCL PCI D (3V/5V): Timecode Reader Board 15ed 1002 MCCS 8-port Serial Hot Swap 15ed 1003 MCCS 16-port Serial Hot Swap 9036 9036 9050 PCI <-> IOBus Bridge 10b5 2036 SatPak GPS + 10b5 2221 Alpermann+Velte PCL PCI LV: Timecode Reader Board 10b5 2273 SH-ARC SoHard ARCnet card + 10b5 2431 Alpermann+Velte PCL PCI D: Timecode Reader Board + 10b5 2905 Alpermann+Velte PCI TS: Time Synchronisation Board 10b5 9050 MP9050 1522 0001 RockForce 4 Port V.90 Data/Fax/Voice Modem 1522 0002 RockForce 2 Port V.90 Data/Fax/Voice Modem @@ -2295,6 +2576,10 @@ 15ed 1001 Macrolink MCCS 16-port Serial 15ed 1002 Macrolink MCCS 8-port Serial Hot Swap 15ed 1003 Macrolink MCCS 16-port Serial Hot Swap +# Sorry, there was a typo + 5654 2036 OpenSwitch 6 Telephony card +# Sorry, there was a typo + 5654 3132 OpenSwitch 12 Telephony card 5654 5634 OpenLine4 Telephony Card d531 c002 PCIntelliCAN 2xSJA1000 CAN bus d84d 4006 EX-4006 1P @@ -2317,7 +2602,17 @@ 9054 PCI <-> IOBus Bridge 10b5 2455 Wessex Techology PHIL-PCI 10b5 2696 Innes Corp AM Radcap card + 10b5 2717 Innes Corp Auricon card + 10b5 2844 Innes Corp TVS Encoder card 12d9 0002 PCI Prosody Card rev 1.5 + 16df 0011 PIKA PrimeNet MM PCI + 16df 0012 PIKA PrimeNet MM cPCI 8 + 16df 0013 PIKA PrimeNet MM cPCI 8 (without CAS Signaling Option) + 16df 0014 PIKA PrimeNet MM cPCI 4 + 16df 0015 PIKA Daytona MM + 16df 0016 PIKA InLine MM + 9056 Francois + 10b5 2979 CellinkBlade 11 - CPCI board VoATM AAL1 9060 9060 906d 9060SD 125c 0640 Aries 16000P @@ -2326,6 +2621,7 @@ 10b5 9080 9080 [real subsystem ID not set] 129d 0002 Aculab PCI Prosidy card 12d9 0002 PCI Prosody Card + 12df 4422 4422PCI ["Do-All" Telemetry Data Aquisition System] bb04 B&B 3PCIOSD1A Isolated PCI Serial 10b6 Madge Networks 0001 Smart 16/4 PCI Ringnode @@ -2358,17 +2654,22 @@ 1006 MINI PCI type 3B Data Fax Modem 1007 Mini PCI 56k Winmodem 10b7 615c Mini PCI 56K Modem - 1700 3c940 1000Base? + 1201 3c982-TXM 10/100baseTX Dual Port A [Hydra] + 1202 3c982-TXM 10/100baseTX Dual Port B [Hydra] + 1700 3c940 10/100/1000Base-T [Marvell] + 1043 80eb P4P800 Mainboard + 10b7 0010 3C940 Gigabit LOM Ethernet Adapter + 10b7 0020 3C941 Gigabit LOM Ethernet Adapter 3390 3c339 TokenLink Velocity 3590 3c359 TokenLink Velocity XL 10b7 3590 TokenLink Velocity XL Adapter (3C359/359B) - 4500 3c450 Cyclone/unknown + 4500 3c450 HomePNA [Tornado] 5055 3c555 Laptop Hurricane - 5057 3c575 [Megahertz] 10/100 LAN CardBus + 5057 3c575 Megahertz 10/100 LAN CardBus [Boomerang] 10b7 5a57 3C575 Megahertz 10/100 LAN Cardbus PC Card - 5157 3c575 [Megahertz] 10/100 LAN CardBus + 5157 3cCFE575BT Megahertz 10/100 LAN CardBus [Cyclone] 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card - 5257 3CCFE575CT Cyclone CardBus + 5257 3cCFE575CT CardBus [Cyclone] 10b7 5c57 FE575C-3Com 10/100 LAN CardBus-Fast Ethernet 5900 3c590 10BaseT [Vortex] 5920 3c592 EISA 10mbps Demon/Vortex @@ -2376,20 +2677,22 @@ 5951 3c595 100BaseT4 [Vortex] 5952 3c595 100Base-MII [Vortex] 5970 3c597 EISA Fast Demon/Vortex - 5b57 3c595 [Megahertz] 10/100 LAN CardBus + 5b57 3c595 Megahertz 10/100 LAN CardBus [Boomerang] 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card - 6055 3c556 Hurricane CardBus - 6056 3c556B Hurricane CardBus + 6000 3CRSHPW796 [OfficeConnect Wireless CardBus] + 6001 3com 3CRWE154G72 [Office Connect Wireless LAN Adapter] + 6055 3c556 Hurricane CardBus [Cyclone] + 6056 3c556B CardBus [Tornado] 10b7 6556 10/100 Mini PCI Ethernet Adapter - 6560 3CCFE656 Cyclone CardBus + 6560 3cCFE656 CardBus [Cyclone] 10b7 656a 3CCFEM656 10/100 LAN+56K Modem CardBus - 6561 3CCFEM656 10/100 LAN+56K Modem CardBus + 6561 3cCFEM656 10/100 LAN+56K Modem CardBus 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus - 6562 3CCFEM656 [id 6562] Cyclone CardBus + 6562 3cCFEM656B 10/100 LAN+Winmodem CardBus [Cyclone] 10b7 656b 3CCFEM656B 10/100 LAN+56K Modem CardBus - 6563 3CCFEM656B 10/100 LAN+56K Modem CardBus + 6563 3cCFEM656B 10/100 LAN+56K Modem CardBus 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus - 6564 3CCFEM656 [id 6564] Cyclone CardBus + 6564 3cXFEM656C 10/100 LAN+Winmodem CardBus [Tornado] 7646 3cSOHO100-TX Hurricane 7770 3CRWE777 PCI(PLX) Wireless Adaptor [Airconnect] 7940 3c803 FDDILink UTP Controller @@ -2397,13 +2700,13 @@ 7990 3c805 FDDILink DAS Controller 8811 Token ring 9000 3c900 10BaseT [Boomerang] - 9001 3c900 Combo [Boomerang] - 9004 3c900B-TPO [Etherlink XL TPO] + 9001 3c900 10Mbps Combo [Boomerang] + 9004 3c900B-TPO Etherlink XL [Cyclone] 10b7 9004 3C900B-TPO Etherlink XL TPO 10Mb - 9005 3c900B-Combo [Etherlink XL Combo] + 9005 3c900B-Combo Etherlink XL [Cyclone] 10b7 9005 3C900B-Combo Etherlink XL Combo - 9006 3c900B-TPC [Etherlink XL TPC] - 900a 3c900B-FL [Etherlink XL FL] + 9006 3c900B-TPC Etherlink XL [Cyclone] + 900a 3c900B-FL 10base-FL [Cyclone] 9050 3c905 100BaseTX [Boomerang] 9051 3c905 100BaseT4 [Boomerang] 9055 3c905B 100BaseTX [Cyclone] @@ -2428,21 +2731,23 @@ 1028 0098 3C905B Fast Etherlink XL 10/100 1028 0099 3C905B Fast Etherlink XL 10/100 10b7 9055 3C905B Fast Etherlink XL 10/100 - 9056 3c905B-T4 [Fast EtherLink XL 10/100] - 9058 3c905B-Combo [Deluxe Etherlink XL 10/100] - 905a 3c905B-FX [Fast Etherlink XL FX 10/100] + 9056 3c905B-T4 Fast EtherLink XL [Cyclone] + 9058 3c905B Deluxe Etherlink 10/100/BNC [Cyclone] + 905a 3c905B-FX Fast Etherlink XL FX 100baseFx [Cyclone] 9200 3c905C-TX/TX-M [Tornado] 1028 0095 3C920 Integrated Fast Ethernet Controller 1028 0097 3C920 Integrated Fast Ethernet Controller + 1028 012a 3C920 Integrated Fast Ethernet Controller [Latitude C640] 10b7 1000 3C905C-TX Fast Etherlink for PC Management NIC 10b7 7000 10/100 Mini PCI Ethernet Adapter - 9201 3C920B-EMB Integrated Fast Ethernet Controller - 9300 3CSOHO100B-TX [910-A01] - 9800 3c980-TX [Fast Etherlink XL Server Adapter] + 10f1 2466 Tiger MPX S2466 (3C920 Integrated Fast Ethernet Controller) + 9201 3C920B-EMB Integrated Fast Ethernet Controller [Tornado] + 9202 3Com 3C920B-EMB-WNM Integrated Fast Ethernet Controller + 9210 3C920B-EMB-WNM Integrated Fast Ethernet Controller + 9300 3CSOHO100B-TX 910-A01 [tulip] + 9800 3c980-TX Fast Etherlink XL Server Adapter [Cyclone] 10b7 9800 3c980-TX Fast Etherlink XL Server Adapter - 9805 3c980-TX 10/100baseTX NIC [Python-T] - 10b7 1201 3c982-TXM 10/100baseTX Dual Port A [Hydra] - 10b7 1202 3c982-TXM 10/100baseTX Dual Port B [Hydra] + 9805 3c980-C 10/100baseTX NIC [Python-T] 10b7 9805 3c980 10/100baseTX NIC [Python-T] 10f1 2462 Thunder K7 S2462 9900 3C990-TX [Typhoon] @@ -2458,9 +2763,10 @@ 10b7 2102 3CR990-FX-97 Server [Typhoon Fiber 168-bit] 9908 3CR990SVR95 [Typhoon Server 56-bit] 9909 3CR990SVR97 [Typhoon Server 168-bit] + 990a 3C990SVR [Typhoon Server] 990b 3C990SVR [Typhoon Server] 10b8 Standard Microsystems Corp [SMC] - 0005 83C170QF + 0005 83c170 EPIC/100 Fast Ethernet Adapter 1055 e000 LANEPIC 10/100 [EVB171Q-PCI] 1055 e002 LANEPIC 10/100 [EVB171G-PCI] 10b8 a011 EtherPower II 10/100 @@ -2468,7 +2774,7 @@ 10b8 a015 EtherPower II 10/100 10b8 a016 EtherPower II 10/100 10b8 a017 EtherPower II 10/100 - 0006 LANEPIC + 0006 83c175 EPIC/100 Fast Ethernet Adapter 1055 e100 LANEPIC Cardbus Fast Ethernet Adapter 1055 e102 LANEPIC Cardbus Fast Ethernet Adapter 1055 e300 LANEPIC Cardbus Fast Ethernet Adapter @@ -2478,6 +2784,8 @@ 13a2 8006 LANEPIC Cardbus Fast Ethernet Adapter 1000 FDC 37c665 1001 FDC 37C922 +# 802.11g card + 2802 SMC2802W [EZ Connect g] a011 83C170QF b106 SMC34C90 10b9 ALi Corporation @@ -2522,6 +2830,7 @@ 3151 M3151 3307 M3307 3309 M3309 + 3323 M3325 Video/Audio Decoder 5212 M4803 5215 MS4803 5217 M5217H @@ -2543,7 +2852,7 @@ 1014 0506 ThinkPad R30 5453 M5453 PCI AC-Link Controller Modem Device 5455 M5455 PCI AC-Link Controller Audio Device - 5457 Intel 537 [M5457 AC-Link Modem] + 5457 M5457 AC'97 Modem Controller # Same but more usefull for driver's lookup 5459 SmartLink SmartPCI561 56K Modem # SmartLink PCI SoftModem @@ -2554,6 +2863,9 @@ 10b9 7101 ALI M7101 Power Management Controller 10ba Mitsubishi Electric Corp. 0301 AccelGraphics AccelECLIPSE + 0304 AccelGALAXY A2100 [OEM Evans & Sutherland] + 0308 Tornado 3000 [OEM Evans & Sutherland] + 1002 VG500 [VolumePro Volume Rendering Accelerator] 10bb Dapha Electronics Corporation 10bc Advanced Logic Research 10bd Surecom Technology @@ -2594,6 +2906,7 @@ 10f7 8312 MagicGraph 128XD 0005 NM2200 [MagicGraph 256AV] 1014 00dd ThinkPad 570 + 1028 0088 Latitude CPi A400XT 0006 NM2360 [MagicMedia 256ZX] 0016 NM2380 [MagicMedia 256XL+] 10c8 0016 MagicMedia 256XL+ @@ -2725,7 +3038,7 @@ 1102 1024 CT6932 RIVA TNT2 Value 32Mb 1102 102c CT6931 RIVA TNT2 Value [Jumper] 1462 8808 MSI-8808 - 1554 1041 PixelView RIVA TNT2 M64 32MB + 1554 1041 Pixelview RIVA TNT2 M64 002e NV6 [Vanta] 002f NV6 [Vanta] 0060 nForce2 ISA Bridge @@ -2781,9 +3094,11 @@ 0150 NV15 [GeForce2 GTS/Pro] 1043 4016 V7700 AGP Video Card 107d 2840 WinFast GeForce2 GTS with TV output + 107d 2842 WinFast GeForce 2 Pro 1462 8831 Creative GeForce2 Pro 0151 NV15DDR [GeForce2 Ti] 1043 405f V7700Ti + 1462 5506 Creative 3D Blaster Geforce2 Titanium 0152 NV15BR [GeForce2 Ultra, Bladerunner] 1048 0c56 GLADIAC Ultra 0153 NV15GL [Quadro2 Pro] @@ -2798,16 +3113,23 @@ 0174 NV17 [GeForce4 440 Go] 0175 NV17 [GeForce4 420 Go] 0176 NV17 [GeForce4 420 Go 32M] + 4c53 1090 Cx9 / Vx9 mainboard + 0177 NV17 [GeForce4 460 Go] 0178 NV17GL [Quadro4 550 XGL] 0179 NV17 [GeForce4 440 Go 64M] + 10de 0179 GeForce4 MX (Mac) 017a NV17GL [Quadro4 200/400 NVS] 017b NV17GL [Quadro4 550 XGL] 017c NV17GL [Quadro4 550 GoGL] 0181 NV18 [GeForce4 MX 440 AGP 8x] 1043 806f V9180 Magic 1462 8880 MS-StarForce GeForce4 MX 440 with AGP8X + 1462 8900 MS-8890 GeForce 4 MX440 AGP8X + 1462 9350 MSI Geforce4 MX T8X with AGP8X + 147b 8f0d Siluro GF4 MX-8X 0182 NV18 [GeForce4 MX 440SE AGP 8x] 0183 NV18 [GeForce4 MX 420 AGP 8x] + 0185 NV18 [GeForce4 MX 4000 AGP 8x] 0188 NV18GL [Quadro4 580 XGL] 018a NV18GL [Quadro4 NVS AGP 8x] 018b NV18GL [Quadro4 380 XGL] @@ -2822,7 +3144,7 @@ 01b7 nForce AGP to PCI Bridge 01b8 nForce PCI-to-PCI bridge 01bc nForce IDE - 01c1 Intel 537 [nForce MC97 Modem] + 01c1 nForce AC'97 Modem Controller 01c2 nForce USB Controller 01c3 nForce Ethernet Controller 01e0 nForce2 AGP (different version?) @@ -2863,21 +3185,42 @@ 0309 NV30GL [Quadro FX 1000] 0311 NV31 [GeForce FX 5600 Ultra] 0312 NV31 [GeForce FX 5600] + 0314 NV31 [GeForce FX 5600XT] + 031a NV31M [GeForce FX Go 5600] + 031c NVIDIA Quadro FX 700 Go 0321 NV34 [GeForce FX 5200 Ultra] 0322 NV34 [GeForce FX 5200] + 1462 9171 MS-8917 (FX5200-T128) + 0324 NV34M [GeForce FX Go 5200] + 1071 8160 MIM2000 + 0328 NV34M [GeForce FX Go 5200] + 0329 NV34M [GeForce FX Go5200] 032b NV34GL [Quadro FX 500] + 032c NV34GLM [GeForce FX Go 5300] 0330 NV35 [GeForce FX 5900 Ultra] 0331 NV35 [GeForce FX 5900] + 0332 NV35 [GeForce FX 5900XT] + 0333 NV38 [GeForce FX 5950 Ultra] 0338 NV35GL [Quadro FX 3000] + 0341 NV 36 [GeForce 5700 Ultra] + 0342 NV 36 [GeForce 5700] 10df Emulex Corporation 1ae5 LP6000 Fibre Channel Host Adapter + 1ae6 LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) + 1ae7 LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:2-3) f085 LP850 Fibre Channel Adapter f095 LP952 Fibre Channel Adapter f098 LP982 Fibre Channel Adapter f700 LP7000 Fibre Channel Host Adapter + f701 LP 7000EFibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f800 LP8000 Fibre Channel Host Adapter + f801 LP 8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f900 LP9000 Fibre Channel Host Adapter + f901 LP 9000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2) f980 LP9802 Fibre Channel Adapter + f981 LP 9802 Fibre Channel Host Adapter Alternate ID + f982 LP 9802 Fibre Channel Host Adapter Alternate ID + fa00 LP10000 Fibre Channel Host Adapter 10e0 Integrated Micro Solutions Inc. 5026 IMS5026/27/28 5027 IMS5027 @@ -2900,6 +3243,7 @@ 10e6 Gainbery Computer Products Inc. 10e7 Vadem 10e8 Applied Micro Circuits Corp. + 1072 INES GPIB-PCI (AMCC5920 based) 2011 Q-Motion Video Capture/Edit board 4750 S5930 [Matchmaker] 5920 S5920 @@ -2926,6 +3270,8 @@ 5000 CyberPro 5000 5050 CyberPro 5050 5202 CyberPro 5202 +# CyberPro5202 Audio Function + 5252 CyberPro5252 10eb Artists Graphics 0101 3GA 8111 Twist3 Frame Grabber @@ -2943,6 +3289,7 @@ 8139 RTL-8139/8139C/8139C+ 1025 8920 ALN-325 1025 8921 ALN-325 + 1071 8160 MIM2000 10bd 0320 EP-320X-R 10ec 8139 RT8139 1186 1300 DFE-538TX @@ -2954,17 +3301,20 @@ 1429 d010 ND010 1432 9130 EN-9130TX 1436 8139 RT8139 + 1458 e000 GA-7VM400M Motherboard 146c 1439 FE-1439TX 1489 6001 GF100TXRII 1489 6002 GF100TXRA 149c 139a LFE-8139ATX 149c 8139 LFE-8139TX + 1799 5000 F5D5000 PCI Card/Desktop Network PCI Card 2646 0001 EtheRx 8e2e 7000 KF-230TX 8e2e 7100 KF-230TX/2 a0a0 0007 ALN-325C - 8169 RTL-8169 + 8169 RTL-8169 Gigabit Ethernet 1371 434e ProG-2000L + 8180 RTL8180L 802.11b MAC 8197 SmartLAN56 56K Modem 10ed Ascii Corporation 7310 V7310 @@ -2975,6 +3325,7 @@ 3fc3 RME Digi96/8 Pad 3fc4 RME Digi9652 (Hammerfall) 3fc5 RME Hammerfall DSP + 3fc6 RME Hammerfall DSP MADI 8381 Ellips Santos Frame Grabber 10ef Racore Computer Products, Inc. 8154 M815x Token Ring Adapter @@ -3029,7 +3380,10 @@ 0004 SB Audigy 1102 0051 SB0090 Audigy Player 1102 0053 SB0090 Audigy Player/OEM + 1102 0058 SB0090 Audigy Player/OEM + 1102 2002 SB Audigy 2 ZS (SB0350) 0006 [SB Live! Value] EMU10k1X + 0007 SB Audigy LS 4001 SB Audigy FireWire Port 1102 0010 SB Audigy FireWire Port 7002 SB Live! MIDI/Game Port @@ -3037,6 +3391,7 @@ 7003 SB Audigy MIDI/Game port 1102 0040 SB Audigy MIDI/Game Port 7004 [SB Live! Value] Input device controller + 7005 SB Audigy LS MIDI/Game port 8064 SB0100 [SBLive! 5.1 OEM] 8938 Ectiva EV1938 1103 Triones Technologies, Inc. @@ -3055,6 +3410,13 @@ 1105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder 8300 REALmagic Hollywood Plus DVD Decoder 8400 EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder + 8401 EM8401 REALmagic DVD/MPEG-2 A/V Decoder + 8470 EM8470 REALmagic DVD/MPEG-4 A/V Decoder + 8471 EM8471 REALmagic DVD/MPEG-4 A/V Decoder + 8475 EM8475 REALmagic DVD/MPEG-4 A/V Decoder + 8476 EM8476 REALmagic DVD/MPEG-4 A/V Decoder + 8485 EM8485 REALmagic DVD/MPEG-4 A/V Decoder + 8486 EM8486 REALmagic DVD/MPEG-4 A/V Decoder 1106 VIA Technologies, Inc. 0102 Embedded VIA Ethernet Controller 0130 VT6305 1394.A Controller @@ -3068,10 +3430,13 @@ 0505 VT82C505 # Shares chip with :0576. The VT82C576M has :1571 instead of :0561. 0561 VT82C576MV - 0571 VT82C586A/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE + 0571 VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE 1019 0985 P6VXA Motherboard + 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235) 1043 8052 VT8233A Bus Master ATA100/66/33 IDE 1043 808c A7V8X motherboard + 1043 80a1 A7V8X-X motherboard rev. 1.01 + 1043 80ed A7V600 motherboard 1106 0571 VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE 1179 0001 Magnia Z310 1297 f641 FX41 motherboard @@ -3112,10 +3477,14 @@ 1106 VT82C570MV 1571 VT82C576M/VT82C586 1595 VT82C595/97 [Apollo VP2/97] - 3038 USB +# This is *not* USB 2.0 as the existing entry suggests + 3038 VT82xxxxx UHCI USB 1.1 Controller 0925 1234 USB Controller 1019 0985 P6VXA Motherboard - 1043 808c A7V8X motherboard + 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235) + 1043 808c VT6202 USB2.0 4 port controller + 1043 80a1 A7V8X-X motherboard + 1043 80ed A7V600 motherboard 1179 0001 Magnia Z310 1458 5004 GA-7VAX Mainboard 3040 VT82C586B ACPI @@ -3126,6 +3495,7 @@ 3044 IEEE 1394 Host Controller 3050 VT82C596 Power Management 3051 VT82C596 Power Management + 3053 VT6105M [Rhine-III] 3057 VT82C686 [Apollo Super ACPI] 1019 0985 P6VXA Motherboard 1043 8033 A7V Mainboard @@ -3134,17 +3504,23 @@ 1043 8042 A7V133/A7V133-C Mainboard 1179 0001 Magnia Z310 3058 VT82C686 AC97 Audio Controller + 0e11 0097 SoundMax Digital Integrated Audio 0e11 b194 Soundmax integrated digital audio 1019 0985 P6VXA Motherboard 1106 4511 Onboard Audio on EP7KXA 1458 7600 Onboard Audio 1462 3091 MS-6309 Onboard Audio 15dd 7609 Onboard Audio - 3059 VT8233/A/8235 AC97 Audio Controller + 3059 VT8233/A/8235/8237 AC97 Audio Controller + 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235) 1043 8095 A7V8X Motherboard (Realtek ALC650 codec) + 1043 80b0 A7V600 motherboard (ADI AD1980 codec [SoundMAX]) + 1106 3059 L7VMM2 Motherboard 1297 c160 FX41 motherboard (Realtek ALC650 codec) 1458 a002 GA-7VAX Onboard Audio (Realtek ALC650) + 1462 3800 KT266 onboard audio 3065 VT6102 [Rhine-II] + 1043 80a1 A7V8X-X Motherboard 1106 0102 VT6102 [Rhine II] Embeded Ethernet Controller on VT8235 1186 1400 DFE-530TX rev A 1186 1401 DFE-530TX rev B @@ -3160,10 +3536,14 @@ 3102 VT8662 Host Bridge 3103 VT8615 Host Bridge 3104 USB 2.0 + 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235) 1043 808c A7V8X motherboard + 1043 80a1 A7V8X-X motherboard rev 1.01 + 1043 80ed A7V600 motherboard 1297 f641 FX41 motherboard 1458 5004 GA-7VAX Mainboard 3106 VT6105 [Rhine-III] + 1186 1403 DFE-530TX rev C 3109 VT8233C PCI to ISA Bridge 3112 VT8361 [KLE133] Host Bridge 3116 VT8375 [KM266/KL266] Host Bridge @@ -3176,17 +3556,33 @@ 3133 VT3133 Host Bridge 3147 VT8233A ISA Bridge 3148 P4M266 Host Bridge + 3149 VIA VT6420 SATA RAID Controller + 1043 80ed A7V600 motherboard + 1462 7020 MSI Neo K8T FIS2R mainboard 3156 P/KN266 Host Bridge +# on ASUS P4P800 + 3164 VT6410 ATA133 RAID controller 3168 VT8374 P4X400 Host Controller/AGP Bridge 3177 VT8235 ISA Bridge + 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235) 1043 808c A7V8X motherboard + 1043 80a1 A7V8X-X motherboard 1297 f641 FX41 motherboard 1458 5001 GA-7VAX Mainboard - 3189 VT8377 [KT400 AGP] Host Bridge + 3188 VT8385 [K8T800 AGP] Host Bridge + 3189 VT8377 [KT400/KT600 AGP] Host Bridge 1043 807f A7V8X motherboard 1458 5000 GA-7VAX Mainboard +# Updated the entry to the proper "chip [name] desc" format + 3205 VT8378 [KM400] Chipset Host Bridge + 1458 5000 GA-7VM400M Motherboard + 3227 VT8237 ISA bridge [K8T800 South] + 1043 80ed A7V600 motherboard 5030 VT82C596 ACPI [Apollo PRO] 6100 VT85C100A [Rhine II] +# S3 Graphics UniChromeâ„¢ 2D/3D Graphics with motion compensation + 7205 VT8378 [S3 UniChrome] Integrated Video + 1458 d000 GA-7VM400M Motherboard 8231 VT8231 [PCI-to-ISA Bridge] 8235 VT8235 ACPI 8305 VT8363/8365 [KT133/KM133 AGP] @@ -3207,7 +3603,10 @@ b103 VT8615 AGP Bridge b112 VT8361 [KLE133] AGP Bridge b168 VT8235 PCI Bridge + b188 VT8237 PCI bridge [K8T800 South] b198 VT8237 PCI Bridge +# 32-Bit PCI bus master Ethernet MAC with standard MII interface + d104 VT8237 Integrated Fast Ethernet Controller 1107 Stratus Computers 0576 VIA VT82C570MV [Apollo] (Wrong vendor ID!) 1108 Proteon, Inc. @@ -3231,6 +3630,7 @@ 007c FSC Remote Service Controller, shared memory device 007d FSC Remote Service Controller, SMIC device 2102 DSCC4 WAN adapter + 2104 Eicon Diva 2.02 compatible passive ISDN card 4021 SIMATIC NET CP 5512 (Profibus and MPI Cardbus Adapter) 4942 FPGA I-Bus Tracer for MBD 6120 SZB6120 @@ -3256,13 +3656,15 @@ 103c 1207 EN-1207D Fast Ethernet Adapter 1113 1211 EN-1207D Fast Ethernet Adapter 1216 EN-1216 Ethernet Adapter + 1113 2242 EN2242 10/100 Ethernet Mini-PCI Card 111a 1020 SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?] 1217 EN-1217 Ethernet Adapter 5105 10Mbps Network card 9211 EN-1207D Fast Ethernet Adapter 1113 9211 EN-1207D Fast Ethernet Adapter - 9511 Fast Ethernet Adapter + 9511 21x4x DEC-Tulip compatible Fast Ethernet 1114 Atmel Corporation + 0506 802.11b Wireless Network Adaptor (at76c506) 1115 3D Labs 1116 Data Translation 0022 DT3001 @@ -3283,14 +3685,18 @@ 0003 GDT 6120/6520 0004 GDT 6530 0005 GDT 6550 - 0006 GDT 6x17 - 0007 GDT 6x27 + 0006 GDT 6117/6517 + 0007 GDT 6127/6527 0008 GDT 6537 - 0009 GDT 6557 + 0009 GDT 6557/6557-ECC 000a GDT 6115/6515 000b GDT 6125/6525 000c GDT 6535 000d GDT 6555 + 0010 GDT 6115/6515 + 0011 GDT 6125/6525 + 0012 GDT 6535 + 0013 GDT 6555/6555-ECC 0100 GDT 6117RP/6517RP 0101 GDT 6127RP/6527RP 0102 GDT 6537RP @@ -3345,7 +3751,8 @@ 0211 GDT 6529RD/6629RD 0260 GDT 7519RN/7619RN 0261 GDT 7529RN/7629RN - 0300 GDT Raid Controller + 02ff GDT MAXRP + 0300 GDT NEWRX 111a Efficient Networks, Inc 0000 155P-MF1 (FPGA) 0002 155P-MF1 (ASIC) @@ -3361,6 +3768,7 @@ 111a 0a09 ENI-3060 ADSL (VPI=<0..15>) 0007 SpeedStream ADSL 111a 1001 ENI-3061 ADSL [ASIC] + 1203 SpeedStream 1023 Wireless PCI Adapter 111b Teledyne Electronic Systems 111c Tricord Systems Inc. 0001 Powerbis Bridge @@ -3409,11 +3817,32 @@ 7135 SAA7135 Audio+video broadcast decoder 7145 SAA7145 7146 SAA7146 + 110a 0000 Fujitsu/Siemens DVB-C card rev1.5 + 110a ffff Fujitsu/Siemens DVB-C card rev1.5 + 1131 4f56 KNC1 DVB-S Budget + 1131 4f61 Fujitsu-Siemens Activy DVB-S Budget 114b 2003 DVRaptor Video Edit/Capture Card 11bd 0006 DV500 Overlay 11bd 000a DV500 Overlay + 13c2 0000 Siemens/Technotrend/Hauppauge DVB card rev1.3 + 13c2 0001 Technotrend/Hauppauge DVB card rev1.3 or rev1.6 + 13c2 0002 Technotrend/Hauppauge DVB card rev2.1 + 13c2 0003 Technotrend/Hauppauge DVB card rev2.1 + 13c2 0004 Technotrend/Hauppauge DVB card rev2.1 + 13c2 0006 Technotrend/Hauppauge DVB card rev1.3 or rev1.6 + 13c2 0008 Technotrend/Hauppauge DVB-T + 13c2 000a Octal/Technotrend DVB-C for iTV + 13c2 1003 Technotrend-Budget / Hauppauge WinTV-NOVA-S DVB card + 13c2 1004 Technotrend-Budget / Hauppauge WinTV-NOVA-C DVB card + 13c2 1005 Technotrend-Budget / Hauppauge WinTV-NOVA-T DVB card + 13c2 100c Technotrend-Budget / Hauppauge WinTV-NOVA-CI DVB card + 13c2 100f Technotrend-Budget / Hauppauge WinTV-NOVA-CI DVB card + 13c2 1011 Technotrend-Budget / Hauppauge WinTV-NOVA-T DVB card + 13c2 1013 SATELCO Multimedia DVB + 13c2 1102 Technotrend/Hauppauge DVB card rev2.1 1132 Mitel Corp. -1133 Eicon Technology Corporation +# This is the new official company name. See disclaimer on www.eicon.com for details! +1133 Eicon Networks Corporation 7901 EiconCard S90 7902 EiconCard S90 7911 EiconCard S91 @@ -3478,6 +3907,8 @@ 1133 1c0c Diva Server V-PRI/E1-30 Cornet NQ 3 e01e Diva Server 2PRI e020 Diva Server 4PRI + e024 Diva Server Analog-4P + e028 Diva Server Analog-8P 1134 Mercury Computer Systems 0001 Raceway Bridge 1135 Fuji Xerox Co Ltd @@ -3545,24 +3976,37 @@ 1148 5843 FDDI SK-5843 (SK-NET FDDI-LP64) 1148 5844 FDDI SK-5844 (SK-NET FDDI-LP64 DAS) 4200 Token Ring adapter - 4300 Gigabit Ethernet - 1148 9821 SK-9821 (1000Base-T single link) - 1148 9822 SK-9822 (1000Base-T dual link) - 1148 9841 SK-9841 (1000Base-LX single link) - 1148 9842 SK-9842 (1000Base-LX dual link) - 1148 9843 SK-9843 (1000Base-SX single link) - 1148 9844 SK-9844 (1000Base-SX dual link) - 1148 9861 SK-9861 (1000Base-SX VF45 single link) - 1148 9862 SK-9862 (1000Base-SX VF45 dual link) -# Information got from SysKonnekt - 1148 9871 SK-9871 (1000Base-ZX single link) -# Information got from SysKonnekt - 1148 9872 SK-9872 (1000Base-ZX dual link) - 1259 2970 AT-2970SX [Allied Telesyn] - 1259 2972 AT-2970T [Allied Telesyn] - 1259 2975 AT-2970SX [Allied Telesyn] - 1259 2977 AT-2970T [Allied Telesyn] - 4320 SK-98xx Gigabit Ethernet Server Adapter + 4300 SK-98xx Gigabit Ethernet Server Adapter + 1148 9821 SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T) + 1148 9822 SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link) + 1148 9841 SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX) + 1148 9842 SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link) + 1148 9843 SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX) + 1148 9844 SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link) + 1148 9861 SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition) + 1148 9862 SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link) + 1148 9871 SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX) + 1148 9872 SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link) + 1259 2970 AT-2970SX Gigabit Ethernet Adapter + 1259 2971 AT-2970LX Gigabit Ethernet Adapter + 1259 2972 AT-2970TX Gigabit Ethernet Adapter + 1259 2973 AT-2971SX Gigabit Ethernet Adapter + 1259 2974 AT-2971T Gigabit Ethernet Adapter + 1259 2975 AT-2970SX/2SC Gigabit Ethernet Adapter + 1259 2976 AT-2970LX/2SC Gigabit Ethernet Adapter + 1259 2977 AT-2970TX/2TX Gigabit Ethernet Adapter + 4320 SK-98xx V2.0 Gigabit Ethernet Adapter + 1148 0121 Marvell RDK-8001 Adapter + 1148 0221 Marvell RDK-8002 Adapter + 1148 0321 Marvell RDK-8003 Adapter + 1148 0421 Marvell RDK-8004 Adapter + 1148 0621 Marvell RDK-8006 Adapter + 1148 0721 Marvell RDK-8007 Adapter + 1148 0821 Marvell RDK-8008 Adapter + 1148 0921 Marvell RDK-8009 Adapter + 1148 1121 Marvell RDK-8011 Adapter + 1148 1221 Marvell RDK-8012 Adapter + 1148 3221 SK-9521 V2.0 10/100/1000Base-T Adapter 1148 5021 SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter 1148 5041 SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter 1148 5043 SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter @@ -3570,7 +4014,8 @@ 1148 5061 SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter 1148 5071 SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter 1148 9521 SK-9521 10/100/1000Base-T Adapter - 4400 Gigabit Ethernet + 4400 SK-9Dxx Gigabit Ethernet Adapter + 4500 SK-9Mxx Gigabit Ethernet Adapter 1149 Win System Corporation 114a VMIC 5579 VMIPCI-5579 (Reflective Memory Card) @@ -3611,14 +4056,28 @@ 114f 0031 DataFire RAS BRI S/T Adapter 0026 AccelePort 4r 920 0027 AccelePort Xr 920 + 0028 ClassicBoard 4 + 0029 ClassicBoard 8 0034 AccelePort 2r 920 0035 DataFire DSP T1/E1/PRI cPCI 0040 AccelePort Xp - 0042 AccelePort 2p PCI + 0042 AccelePort 2p + 0043 AccelePort 4p + 0044 AccelePort 8p + 0045 AccelePort 16p + 004e AccelePort 32p 0070 Datafire Micro V IOM2 (Europe) 0071 Datafire Micro V (Europe) 0072 Datafire Micro V IOM2 (North America) 0073 Datafire Micro V (North America) + 00b0 Digi Neo 4 + 00b1 Digi Neo 8 + 00c8 Digi Neo 2 DB9 + 00c9 Digi Neo 2 DB9 PRI + 00ca Digi Neo 2 RJ45 + 00cb Digi Neo 2 RJ45 PRI + 00d0 ClassicBoard 4 422 + 00d1 ClassicBoard 8 422 6001 Avanstar 1150 Thinking Machines Corp 1151 JAE Electronics Inc. @@ -3665,6 +4124,7 @@ 000f Cardbus Ethernet 10/100 1014 0183 10/100 EtherJet Cardbus Adapter 115d 0183 Cardbus Ethernet 10/100 + 00d4 Mini-PCI K56Flex Modem 0101 Cardbus 56k modem 115d 1081 Cardbus 56k Modem 0103 Cardbus Ethernet + 56k Modem @@ -3698,6 +4158,8 @@ 0015 CMIC-GC Host Bridge 0016 CMIC-GC Host Bridge 0017 GCNB-LE Host Bridge + 0101 CIOB-X2 + 0110 CIOB-E I/O Bridge with Gigabit Ethernet 0200 OSB4 South Bridge 0201 CSB5 South Bridge 4c53 1080 CT8 mainboard @@ -3709,10 +4171,11 @@ 0220 OSB4/CSB5 OHCI USB Controller 4c53 1080 CT8 mainboard 0221 CSB6 OHCI USB Controller - 0225 GCLE Host Bridge + 0225 CSB5 LPC bridge # cancelled 4c53 1080 CT8 mainboard 0227 GCLE-2 Host Bridge + 0230 CSB5 LPC bridge 4c53 1080 CT8 mainboard 1167 Mutoh Industries Inc 1168 Thine Electronics Inc @@ -3769,6 +4232,7 @@ 1014 0185 ThinkPad A/T/X Series 104d 80df Vaio PCG-FX403 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP + 14ef 0220 PCD-RP-220S 0477 RL5c477 0478 RL5c478 1014 0184 ThinkPad A30p (2653-64G) @@ -3792,7 +4256,11 @@ 1186 1301 DFE-530TX+ 10/100 Ethernet Adapter 1340 DFE-690TXD CardBus PC Card 1561 DRP-32TXD Cardbus PC Card - 4000 DL2K Ethernet + 3300 DWL-510 2.4GHz Wireless PCI Adapter + 3b05 DWL-G650+ CardBus PC Card + 4000 DL2000-based Gigabit Ethernet + 4c00 Gigabit Ethernet Adapter + 8400 D-Link DWL-650+ CardBus PC Card 1187 Advanced Technology Laboratories, Inc. 1188 Shima Seiki Manufacturing Ltd. 1189 Matsushita Electronics Co Ltd @@ -3845,6 +4313,7 @@ 1195 Ratoc System Inc 1196 Hytec Electronics Ltd 1197 Gage Applied Sciences, Inc. + 010c CompuScope 82G 8bit 2GS/s Analog Input Card 1198 Lambda Systems Inc 1199 Attachmate Corporation 119a Mind Share, Inc. @@ -3868,11 +4337,20 @@ 11a9 InnoSys Inc. 4240 AMCC S933Q Intelligent Serial Card 11aa Actel -11ab Galileo Technology Ltd. +# (formerly Galileo technologies) +11ab Marvell 0146 GT-64010/64010A System Controller + 4320 Yukon Gigabit Ethernet 10/100/1000Base-T Adapter 4611 GT-64115 System Controller 4620 GT-64120/64120A/64121A System Controller 4801 GT-48001 + 5040 MV88SX5040 4-port SATA I PCI-X Controller + 5041 MV88SX5041 4-port SATA I PCI-X Controller + 5080 MV88SX5080 8-port SATA I PCI-X Controller + 5081 MV88SX5081 8-port SATA I PCI-X Controller + 6041 MV88SX6041 4-port SATA II PCI-X Controller + 6081 MV88SX6081 8-port SATA II PCI-X Controller + 6460 MV64360/64361/64362 System Controller f003 GT-64010 Primary Image Piranha Image Generator 11ac Canon Information Systems Research Aust. 11ad Lite-On Communications Inc @@ -3886,6 +4364,7 @@ 11ad c001 LNE100TX [ver 2.0] 11ae Aztech System Ltd 11af Avid Technology Inc. + 0001 [Cinema] 11b0 V3 Semiconductor Inc. 0002 V300PSC 0292 V292PBC [Am29030/40 Bridge] @@ -3966,6 +4445,7 @@ 0444 LT WinModem 0445 LT WinModem 8086 2203 PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card) + 8086 2204 PRO/100+ MiniPCI on Armada E500 0446 LT WinModem 0447 LT WinModem 0448 WinModem 56k @@ -4011,6 +4491,7 @@ 0461 V90 WildWire Modem 0462 V90 WildWire Modem 0480 Venus Modem (V90, 56KFlex) + 048c V.92 56K WinModem 5801 USB 5802 USS-312 USB Controller # 4 port PCI USB Controller made by Agere (formely Lucent) @@ -4047,6 +4528,7 @@ 11d2 Intercom Inc. 11d3 Trancell Systems Inc 11d4 Analog Devices + 1535 Blackfin BF535 processor 1805 SM56 PCI modem 1889 AD1889 sound chip 11d5 Ikon Corporation @@ -4107,7 +4589,7 @@ 11f6 2011 RL100-ATX 2201 ReadyLink 100TX (Winbond W89C840) 11f6 2011 ReadyLink 100TX - 9881 RL100TX + 9881 RL100TX Fast Ethernet 11f7 Scientific Atlanta 11f8 PMC-Sierra Inc. 7375 PM7375 [LASAR-155 ATM SAR] @@ -4117,18 +4599,28 @@ 11fc Silicon Magic 11fd High Street Consultants 11fe Comtrol Corporation - 0001 RocketPort 8 Oct - 0002 RocketPort 8 Intf - 0003 RocketPort 16 Intf - 0004 RocketPort 32 Intf - 0005 RocketPort Octacable - 0006 RocketPort 8J - 0007 RocketPort 4-port - 0008 RocketPort 8-port - 0009 RocketPort 16-port - 000a RocketPort Plus Quadcable - 000b RocketPort Plus Octacable - 000c RocketPort 8-port Modem + 0001 RocketPort 32 port w/external I/F + 0002 RocketPort 8 port w/external I/F + 0003 RocketPort 16 port w/external I/F + 0004 RocketPort 4 port w/quad cable + 0005 RocketPort 8 port w/octa cable + 0006 RocketPort 8 port w/RJ11 connectors + 0007 RocketPort 4 port w/RJ11 connectors + 0008 RocketPort 8 port w/ DB78 SNI (Siemens) connector + 0009 RocketPort 16 port w/ DB78 SNI (Siemens) connector + 000a RocketPort Plus 4 port + 000b RocketPort Plus 8 port + 000c RocketModem 6 port + 000d RocketModem 4-port + 000e RocketPort Plus 2 port RS232 + 000f RocketPort Plus 2 port RS422 + 0801 RocketPort UPCI 32 port w/external I/F + 0802 RocketPort UPCI 8 port w/external I/F + 0803 RocketPort UPCI 16 port w/external I/F + 0805 RocketPort UPCI 8 port w/octa cable + 080c RocketModem III 8 port + 080d RocketModem III 4 port + 0903 RocketPort Compact PCI 16 port w/external I/F 8015 RocketPort 4-port UART 16954 11ff Scion Corporation 1200 CSS Corporation @@ -4186,6 +4678,14 @@ 1025 1016 Travelmate 612 TX 6972 OZ6912 Cardbus Controller 1179 0001 Magnia Z310 + 7110 OZ711Mx MultiMediaBay Accelerator + 7112 OZ711EC1/M1 SmartCardBus MultiMediaBay Controller + 7113 OZ711EC1 SmartCardBus Controller + 7114 OZ711M1 SmartCardBus MultiMediaBay Controller + 71e2 OZ711E2 SmartCardBus Controller + 7212 OZ711M2 SmartCardBus MultiMediaBay Controller + 7213 OZ6933E CardBus Controller + 7223 OZ711M3 SmartCardBus MultiMediaBay Controller 1218 Hybricon Corp. 1219 First Virtual Corporation 121a 3Dfx Interactive, Inc. @@ -4228,6 +4728,7 @@ 121a 0061 Voodoo3 3500 TV (PAL) 121a 0062 Voodoo3 3500 TV (SECAM) 0009 Voodoo 4 / Voodoo 5 + 121a 0003 Voodoo5 PCI 5500 121a 0009 Voodoo5 AGP 5500/6000 0057 Voodoo 3/3000 [Avenger] 121b Advanced Telecommunications Modules @@ -4253,6 +4754,7 @@ 1224 Interactive Images 1225 Power I/O, Inc. 1227 Tech-Source + 0006 Raptor GFX 8P 1228 Norsk Elektro Optikk A/S 1229 Data Kinesis Inc. 122a Integrated Telecom @@ -4314,6 +4816,7 @@ 0e00 Fritz!PCI v2.0 ISDN 1100 C2 ISDN 1200 T1 ISDN + 2700 Fritz!Card DSL SL 1245 A.P.D., S.A. 1246 Dipix Technologies, Inc. 1247 Xylon Research, Inc. @@ -4350,10 +4853,13 @@ 1258 Gilbarco, Inc. 1259 Allied Telesyn International 2560 AT-2560 Fast Ethernet Adapter (i82557B) + a117 RTL81xx Fast Ethernet + a120 21x4x DEC-Tulip compatible 10/100 Ethernet 125a ABB Power Systems 125b Asix Electronics Corporation - 1400 ALFA GFC2204 + 1400 ALFA GFC2204 Fast Ethernet 125c Aurora Technologies, Inc. + 0101 Saturn 4520P 0640 Aries 16000P 125d ESS Technology 0000 ES336H Fax Modem (Early Model) @@ -4395,13 +4901,16 @@ 14fe 0429 ES56-PI Data Fax Modem 125e Specialvideo Engineering SRL 125f Concurrent Technologies, Inc. -1260 Harris Semiconductor +1260 Intersil Corporation 3873 Prism 2.5 Wavelan chipset 1186 3501 DWL-520 Wireless PCI Adapter + 1186 3700 DWL-520 Wireless PCI Adapter, Rev E1 1668 0414 HWP01170-01 802.11b PCI Wireless Adapter + 16a5 1601 AIR.mate PC-400 PCI Wireless LAN Adapter 1737 3874 WMP11 Wireless 802.11b PCI Adapter 8086 2513 Wireless 802.11b MiniPCI Adapter - 3890 D-Links DWL-g650 A1 + 3890 Intersil ISL3890 [Prism GT/Prism Duette] + 17cf 0014 Ovislink WL-5400PCM, Prism GT 8130 HMP8130 NTSC/PAL Video Decoder 8131 HMP8131 NTSC/PAL Video Decoder 1261 Matsushita-Kotobuki Electronics Industries, Ltd. @@ -4421,9 +4930,12 @@ 126a Lexmark International, Inc. 126b Adax, Inc. 126c Northern Telecom + 1211 10/100BaseTX [RTL81xx] + 126c 802.11b Wireless Ethernet Adapter 126d Splash Technology, Inc. 126e Sumitomo Metal Industries, Ltd. 126f Silicon Motion, Inc. + 0501 SM501 VoyagerGX 0710 SM710 LynxEM 0712 SM712 LynxEM+ 0720 SM720 Lynx3DM @@ -4498,6 +5010,7 @@ 1274 2000 Creative Sound Blaster AudioPCI128 1274 2003 Creative SoundBlaster AudioPCI 128 1274 5880 Creative Sound Blaster AudioPCI128 + 1274 8001 Sound Blaster 16PCI 4.1ch 1458 a000 5880 AudioPCI On Motherboard 6OXET 1462 6880 5880 AudioPCI On Motherboard MS-6188 1.00 270f 2001 5880 AudioPCI On Motherboard 6CTR @@ -4637,12 +5150,14 @@ 1281 Yokogawa Electric Corporation 1282 Davicom Semiconductor, Inc. 9009 Ethernet 100/10 MBit - 9100 Ethernet 100/10 MBit - 9102 Ethernet 100/10 MBit + 9100 21x4x DEC-Tulip compatible 10/100 Ethernet + 9102 21x4x DEC-Tulip compatible 10/100 Ethernet 9132 Ethernet 100/10 MBit 1283 Integrated Technology Express, Inc. 673a IT8330G + 8212 IT/ITE8212 Dual channel ATA RAID controller (PCI version seems to be IT8212, embedded seems to be ITE8212) 8330 IT8330G + 8872 IT8874F PCI Dual Serial Port Controller 8888 IT8888F PCI to ISA Bridge with SMB 8889 IT8889F PCI to ISA Bridge e886 IT8330G @@ -4688,6 +5203,7 @@ 12a1 Simpact Associates, Inc. 12a2 Newgen Systems Corporation 12a3 Lucent Technologies + 8105 T8105 H100 Digital Switch 12a4 NTT Electronics Technology Company 12a5 Vision Dynamics Ltd. 12a6 Scalable Networks, Inc. @@ -4706,6 +5222,7 @@ 0002 AceNIC Gigabit Ethernet (Copper) 10a9 8002 Acenic Gigabit Ethernet 12ae 0002 Gigabit Ethernet-T (3C986-T) + 00fa Farallon PN9100-T Gigabit Ethernet 12af TDK USA Corp 12b0 Jorge Scientific Corp 12b1 GammaLink @@ -4807,6 +5324,7 @@ 12d9 Aculab PLC 0002 PCI Prosody 0004 cPCI Prosody + 0005 Aculab E1/T1 PCI card 12da True Time Inc. 12db Annapolis Micro Systems, Inc 12dc Symicron Computer Communication Ltd. @@ -4889,7 +5407,8 @@ 1304 Juniper Networks 1305 Netphone, Inc 1306 Duet Technologies -1307 Computer Boards +# Formerly ComputerBoards +1307 Measurement Computing 0001 PCI-DAS1602/16 000b PCI-DIO48H 000c PCI-PDISO8 @@ -4926,6 +5445,7 @@ 0037 PCI-DAS64/M3/16 004c PCI-DAS1000 004d PCI-QUAD04 + 0052 PCI-DAS4020/12 1308 Jato Technologies Inc. 0001 NetCelerator Adapter 1308 0001 NetCelerator Adapter @@ -4942,11 +5462,15 @@ 1313 Yaskawa Electric Co. 1316 Teradyne Inc 1317 Linksys - 0981 Fast Ethernet 10/100 - 0985 Network Everywhere Fast Ethernet 10/100 model NC100 - 1985 Fast Ethernet 10/100 + 0981 21x4x DEC-Tulip compatible 10/100 Ethernet + 0985 NC100 Network Everywhere Fast Ethernet 10/100 + 1985 21x4x DEC-Tulip compatible 10/100 Ethernet + 2850 HSP MicroModem 56 + 8201 [ADMtek] SP906B_V2 Wireless LAN adapter + 1317 8201 SMC2635W 802.11b (11mbps) wireless lan pcmcia (cardbus) card + 9511 21x4x DEC-Tulip compatible 10/100 Ethernet 1318 Packet Engines Inc. - 0911 PCI Ethernet Adapter + 0911 GNIC-II PCI Gigabit Ethernet [Hamachi] 1319 Fortemedia, Inc 0801 Xwave QS3000A [FM801] 0802 Xwave QS3000A [FM801 game port] @@ -5083,6 +5607,7 @@ 01c0 SSCLP-200/300 135d ABB Network Partner AB 135e Sealevel Systems Inc + 5101 Route 56.PCI - Multi-Protocol Serial Interface (Zilog Z16C32) 7101 Single Port RS-232/422/485/530 7201 Dual Port RS-232/422/485 Interface 7202 Dual Port RS-232 Interface @@ -5109,6 +5634,7 @@ 136f Applied Magic Inc 1370 ATL Products 1371 CNet Technology Inc + 434e GigaCard Network Adapter 1373 Silicon Vision Inc 1374 Silicom Ltd 1375 Argosystems Inc @@ -5117,6 +5643,7 @@ 1378 Telemann Co. Ltd 1379 Asahi Kasei Microsystems Co Ltd 137a Mark of the Unicorn Inc + 0001 PCI-324 Audiowire Interface 137b PPT Vision 137c Iwatsu Electric Co Ltd 137d Dynachip Corporation @@ -5125,15 +5652,15 @@ 1380 Sanritz Automation Co Ltd 1381 Brains Co. Ltd 1382 Marian - Electronic & Software + 2088 Marc-8 MIDI 8 channel audio card 1383 Controlnet Inc 1384 Reality Simulation Systems Inc 1385 Netgear 4100 802.11b Wireless Adapter (MA301) 4105 MA311 802.11b wireless adapter - 620a GA620 + 620a GA620 Gigabit Ethernet 622a GA622 - 630a GA630 - f311 FA311 + 630a GA630 Gigabit Ethernet 1386 Video Domain Technologies 1387 Systran Corp 1388 Hitachi Information Technology Co Ltd @@ -5150,6 +5677,7 @@ 1392 Medialight Inc 1393 Moxa Technologies Co Ltd 1040 Smartio C104H/PCI + 1141 Industrio CP-114 1680 Smartio C168H/PCI 2040 Intellio CP-204J 2180 Intellio C218 Turbo PCI @@ -5229,6 +5757,9 @@ 13c4 Phase Metrics 13c5 Alphi Technology Corp 13c6 Condor Engineering Inc + 0520 CEI-520 A429 Card + 0620 CEI-620 A429 Card + 0820 CEI-820 A429 Card 13c7 Blue Chip Technology Ltd 13c8 Apptech Inc 13c9 Eaton Corporation @@ -5239,11 +5770,13 @@ 13ce Cocom A/S 13cf Studio Audio & Video Ltd 13d0 Techsan Electronics Co Ltd -# http://www.b2c2inc.com/products/pc-specs.html - 2103 B2C2 Sky2PC PCI [SkyStar2] + 2103 B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card + 2200 B2C2 FlexCopIII DVB chip / Technisat SkyStar2 DVB card 13d1 Abocom Systems Inc ab02 ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter + ab03 21x4x DEC-Tulip compatible 10/100 Ethernet ab06 RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter + ab08 21x4x DEC-Tulip compatible 10/100 Ethernet 13d2 Shark Multimedia Inc 13d3 IMC Networks 13d4 Graphics Microsystems Inc @@ -5285,6 +5818,7 @@ 1401 Zentai Fibre Channel Adapter 13f5 Kansai Electric Co. Ltd 13f6 C-Media Electronics Inc + 0011 CMI8738 0100 CM8338A 13f6 ffff CMI8338/C3DX PCI Audio Device 0101 CM8338B @@ -5305,6 +5839,9 @@ 13fc Computer Peripherals International 13fd Micro Science Inc 13fe Advantech Co. Ltd + 1600 PCI-1612 4-port RS-232/422/485 PCI Communication Card + 1752 PCI-1752 + 1754 PCI-1754 1756 PCI-1756 13ff Silicon Spice Inc 1400 Artx Inc @@ -5319,9 +5856,15 @@ 0100 Lava Dual Serial 0101 Lava Quatro A 0102 Lava Quatro B + 0120 Quattro-PCI A + 0121 Quattro-PCI B + 0180 Lava Octo A + 0181 Lava Octo B 0200 Lava Port Plus 0201 Lava Quad A 0202 Lava Quad B + 0220 Lava Quattro PCI Ports A/B + 0221 Lava Quattro PCI Ports C/D 0500 Lava Single Serial 0600 Lava Port 650 8000 Lava Parallel @@ -5342,6 +5885,7 @@ 1411 Ikos Systems Inc 1412 IC Ensemble Inc 1712 ICE1712 [Envy24] + 1412 d638 M-Audio Delta 410 1724 ICE1724 [Envy24HT] 1413 Addonics 1414 Microsoft Corporation @@ -5382,10 +5926,12 @@ 142c Minton Optic Industry Co Ltd 142d Pix stream Inc 142e Vitec Multimedia + 4020 VM2-2 [Video Maker 2] MPEG1/2 Encoder 142f Radicom Research Inc 1430 ITT Aerospace/Communications Division 1431 Gilat Satellite Networks 1432 Edimax Computer Co. + 9130 RTL81xx Fast Ethernet 1433 Eltec Elektronik GmbH 1435 Real Time Devices US Inc. 1436 CIS Technology Inc @@ -5443,6 +5989,10 @@ 1460 DYNARC INC 1461 Avermedia Technologies Inc 1462 Micro-Star International Co., Ltd. + 8725 NVIDIA NV25 [GeForce4 Ti 4600] VGA Adapter +# MSI G4Ti4800, 128MB DDR SDRAM, TV-Out, DVI-I + 9000 NVIDIA NV28 [GeForce4 Ti 4800] VGA Adapter + 9119 NVIDIA NV31 [GeForce FX 5600XT] VGA Adapter 1463 Fast Corporation 1464 Interactive Circuits & Systems Ltd 1465 GN NETTEST Telecom DIV. @@ -5533,7 +6083,7 @@ 14b5 Creamware GmBH 0200 Scope 0300 Pulsar - 0400 Pulsar2 + 0400 PulsarSRB 0600 Pulsar2 0800 DSP-Board 0900 DSP-Board @@ -5548,8 +6098,9 @@ 0340 PC4800 0350 PC4800 4500 PC4500 - 4800 PC4800 + 4800 Cisco Aironet 340 802.11b Wireless LAN Adapter/Aironet PC4800 a504 Cisco Aironet Wireless 802.11b + a505 Cisco Aironet CB20a 802.11a Wireless LAN Adapter 14ba INTERNIX Inc. 14bb SEMTECH Corporation 14bc Globespan Semiconductor Inc. @@ -5558,6 +6109,7 @@ 14bf SPIDER Communications Inc. 14c0 COMPAL Electronics Inc 14c1 MYRICOM Inc. + 8043 Myrinet 2000 Scalable Cluster Interconnect 14c2 DTK Computer 14c3 MEDIATEK Corp. 14c4 IWASAKI Information Systems Co Ltd @@ -5598,11 +6150,10 @@ 14d7 Hirakawa Hewtech Corp 14d8 HOPF Elektronik GmBH 14d9 Alpha Processor Inc + 0010 AP1011 HyperTransport-PCI Bridge [Sturgeon] 14da National Aerospace Laboratories 14db AFAVLAB Technology Inc 2120 TK9902 - 2180 P028 - 2182 P030 14dc Amplicon Liveline Ltd 0000 PCI230 0001 PCI242 @@ -5649,6 +6200,10 @@ 0e11 009a NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 0e11 00c1 NC6770 Gigabit Server Adapter (PCI-X, 1000-SX) 1028 0121 Broadcom BCM5701 1000Base-T + 103c 128a HP 1000Base-T (PCI) [A7061A] + 103c 128b HP 1000Base-SX (PCI) [A7073A] + 103c 12a4 HP Core Lan 1000Base-T + 103c 12c1 HP IOX Core Lan 1000Base-T [A7109AX] 10a9 8010 SGI IO9 Gigabit Ethernet (Copper) 10a9 8011 SGI Gigabit Ethernet (Copper) 10a9 8012 SGI Gigabit Ethernet (Fiber) @@ -5684,16 +6239,19 @@ 1166 1648 NetXtreme CIOB-E 1000Base-T 164d NetXtreme BCM5702FE Gigabit Ethernet 1653 NetXtreme BCM5705 Gigabit Ethernet + 1654 NetXtreme BCM5705_2 Gigabit Ethernet 165d NetXtreme BCM5705M Gigabit Ethernet + 165e NetXtreme BCM5705M_2 Gigabit Ethernet 1696 NetXtreme BCM5782 Gigabit Ethernet + 103c 12bc HP d530 CMT (DG746A) 14e4 000d NetXtreme BCM5782 1000Base-T 169c NetXtreme BCM5788 Gigabit Ethernet - 16a6 NetXtreme BCM5702 Gigabit Ethernet + 16a6 NetXtreme BCM5702X Gigabit Ethernet 0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T) 1028 0126 BCM5702 1000Base-T 14e4 000c BCM5702 1000Base-T 14e4 8009 BCM5702 1000Base-T - 16a7 NetXtreme BCM5703 Gigabit Ethernet + 16a7 NetXtreme BCM5703X Gigabit Ethernet 0e11 00ca NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 0e11 00cb NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T) 14e4 0009 NetXtreme BCM5703 1000Base-T @@ -5702,25 +6260,35 @@ 14e4 800a NetXtreme BCM5703 1000Base-T 16a8 NetXtreme BCM5704S Gigabit Ethernet 10b7 2001 3C998-SX Dual Port 1000-SX PCI-X - 16c6 NetXtreme BCM5702 Gigabit Ethernet + 16c6 NetXtreme BCM5702A3 Gigabit Ethernet 10b7 1100 3C1000B-T 10/100/1000 PCI 14e4 000c BCM5702 1000Base-T 14e4 8009 BCM5702 1000Base-T 16c7 NetXtreme BCM5703 Gigabit Ethernet + 103c 12c3 HP Combo FC/GigE-SX [A9782A] + 103c 12ca HP Combo FC/GigE-T [A9784A] 14e4 0009 NetXtreme BCM5703 1000Base-T 14e4 000a NetXtreme BCM5703 1000Base-SX +# it's 5705, 5707 was a typo, sorry + 170c BCM5705M 10/100/1000Base T + 170d NetXtreme BCM5901 100Base-TX + 170e NetXtreme BCM5901 100Base-TX 4210 BCM4210 iLine10 HomePNA 2.0 4211 BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem 4212 BCM4212 v.90 56k modem 4301 BCM4301 802.11b 4320 BCM94306 802.11g + 1028 0001 TrueMobile 1300 WLAN Mini-PCI Card 1737 4320 WPC54G + 4324 BCM4309 802.11a/b/g + 1028 0001 Truemobile 1400 4401 BCM4401 100Base-T 1043 80a8 A7V8X motherboard 4402 BCM4402 Integrated 10/100BaseT 4410 BCM4413 iLine32 HomePNA 2.0 4411 BCM4413 V.90 56k modem 4412 BCM4413 10/100BaseT + 5690 BCM5690 12-port Multi-Layer Gigabit Ethernet Switch 5820 BCM5820 Crypto Accelerator 5821 BCM5821 Crypto Accelerator 14e5 Pixelfusion Ltd @@ -5730,6 +6298,7 @@ 14e9 GARNETS System CO Ltd 14ea Planex Communications, Inc ab06 FNW-3603-TX CardBus Fast Ethernet + ab07 RTL81xx RealTek Ethernet 14eb SEIKO EPSON Corp 14ec ACQIRIS 14ed DATAKINETICS Ltd @@ -5872,6 +6441,7 @@ 13e0 8d85 Compaq Stinger 14f1 2004 Dynalink 56PMi 8234 RS8234 ATM SAR Controller [ServiceSAR Plus] + 8800 Winfast TV2000 XP 14f2 MOBILITY Electronics 0120 EV1000 bridge 0121 EV1000 Parallel port @@ -5894,6 +6464,7 @@ 14fe ARCHTEK TELECOM Corp 14ff TWINHEAD INTERNATIONAL Corp 1500 DELTA Electronics, Inc + 1360 RTL81xx RealTek Ethernet 1501 BANKSOFT CANADA Ltd 1502 MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd 1503 KAWASAKI LSI USA Inc @@ -5926,8 +6497,10 @@ 1514 TFL LAN Inc 1515 Advent design 1516 MYSON Technology Inc + 0800 MTD-8xx 100/10M Ethernet PCI Adapter 0803 SURECOM EP-320X-S 100/10M Ethernet PCI Adapter 1320 10bd SURECOM EP-320X-S 100/10M Ethernet PCI Adapter + 0891 MTD-8xx 100/10M Ethernet PCI Adapter 1517 ECHOTEK Corp 1518 PEP MODULAR Computers GmbH 1519 TELEFON AKTIEBOLAGET LM Ericsson @@ -5952,12 +6525,19 @@ 1522 0600 RockForce+ 2 Port V.90 Data/Fax/Voice Modem 1522 0700 RockForce+ 4 Port V.90 Data/Fax/Voice Modem 1522 0800 RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem + 1522 0c00 RockForceDUO+ 2 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem + 1522 0d00 RockForceQUATRO+ 4 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem +# this is a correction to a recent entry. 1522:0E00 should be 1522:1D00 + 1522 1d00 RockForceOCTO+ 8 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem 1523 MUSIC Semiconductors 1524 ENE Technology Inc + 0510 CB710 Memory Card Reader Controller 1211 CB1211 Cardbus Controller 1225 CB1225 Cardbus Controller 1410 CB1410 Cardbus Controller + 1411 CB710 Cardbus Controller 1420 CB1420 Cardbus Controller + 1421 CB720 Cardbus Controller 1525 IMPACT Technologies 1526 ISS, Inc 1527 SOLECTRON @@ -5977,9 +6557,11 @@ 1535 EVERGREEN Technologies Inc 1537 DATALEX COMMUNCATIONS 1538 ARALION Inc + 0303 ARS106S Ultra ATA 133/100/66 Host Controller 1539 ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A. 153a ONO SOKKI 153b TERRATEC Electronic GmbH + 1144 Aureon 5.1 153c ANTAL Electronic 153d FILANET Corp 153e TECHWELL Inc @@ -6123,6 +6705,7 @@ 15ab Bluesteel Networks Inc 15ac North Atlantic Instruments 15ad VMWare Inc + 0405 [VMWare SVGA II] PCI Display Adapter 0710 Virtual SVGA 15ae Amersham Pharmacia Biotech 15b0 Zoltrix International Ltd @@ -6130,6 +6713,9 @@ 15b2 Mosaid Technologies Inc 15b3 Mellanox Technology 5274 MT21108 InfiniBridge + 5a44 MT23108 InfiniHost + 5a45 MT23108 InfiniHost (Tavor) + 5a46 MT23108 PCI Bridge 15b4 CCI/TRIAD 15b5 Cimetrics Inc 15b6 Texas Memory Systems Inc @@ -6139,7 +6725,9 @@ 15ba Impacct Technology Corp 15bb Portwell Inc 15bc Agilent Technologies - 2929 E2929A PCI/PCI-X Bus Analyzer + 2922 64 Bit, 133MHz PCI-X Exerciser & Protocol Checker + 2928 64 Bit, 66MHz PCI Exerciser & Analyzer + 2929 64 Bit, 133MHz PCI-X Analyzer & Exerciser 15bd DFI Inc 15be Sola Electronics 15bf High Tech Computer Corp (HTC) @@ -6149,6 +6737,7 @@ 15c3 Taiwan Mycomp Co Ltd 15c4 EVSX Inc 15c5 Procomp Informatics Ltd + 8010 1394b - 1394 Firewire 3-Port Host Adapter Card 15c6 Technical University of Budapest 15c7 Tateyama System Laboratory Co Ltd 0349 Tateyama C-PCI PLC/NC card Rev.01A @@ -6187,9 +6776,12 @@ 15e8 National Datacomm Corp 0130 Wireless PCI Card 15e9 Pacific Digital Corp + 1841 ADMA-100 DiscStaQ ATA Controller 15ea Tokyo Denshi Sekei K.K. 15eb Drsearch GmbH 15ec Beckhoff GmbH + 3101 FC3101 Profibus DP 1 Channel PCI + 5102 FC5102 15ed Macrolink Inc 15ee In Win Development Inc 15ef Intelligent Paradigm Inc @@ -6223,11 +6815,13 @@ 1619 FarSite Communications Ltd 0400 FarSync T2P (2 port X.21/V.35/V.24) 0440 FarSync T4P (4 port X.21/V.35/V.24) +1626 TDK Semiconductor Corp. + 8410 RTL81xx Fast Ethernet 1629 Kongsberg Spacetec AS 1003 Format synchronizer v3.0 2002 Fast Universal Data Output 1638 Standard Microsystems Corp [SMC] - 1100 SMC2602W EZConnect / Addtron AWA-100 + 1100 SMC2602W EZConnect / Addtron AWA-100 / Eumitcom PCI WL11000 163c Smart Link Ltd. 3052 SmartLink SmartPCI562 56K Modem 5449 SmartPCI561 Modem @@ -6239,27 +6833,69 @@ 165d Hsing Tech. Enterprise Co., Ltd. 1661 Worldspace Corp. 1668 Actiontec Electronics Inc + 0100 Mini-PCI bridge +# Formerly SiByte, Inc. +166d Broadcom Corporation + 0001 SiByte BCM1125/1125H/1250 System-on-a-Chip PCI + 0002 SiByte BCM1125H/1250 System-on-a-Chip HyperTransport 1681 Hercules +# More specs, more accurate desc. + 0010 Hercules 3d Prophet II Ultra 64MB [ 350 MHz NV15BR core, 128-bit DDR @ 460 MHz, 1.5v AGP4x ] +1688 CastleNet Technology Inc. + 1170 WLAN 802.11b card +168c Atheros Communications, Inc. + 0007 AR5000 802.11a Wireless Adapter + 0011 AR5210 802.11a NIC + 0012 AR5211 802.11ab NIC + 0013 AR5212 802.11abg NIC + 1186 3202 D-link DWL-G650 B3 Wireless cardbus adapter + 1186 3203 DWL-G520 Wireless PCI Adapter + 1186 3a94 C54C Wireless 801.11g cardbus + 168c 0013 WG511T Wireless CardBus Adapter + 168c 1025 DWL-G650B2 Wireless CardBus Adapter + 1014 AR5212 802.11abg NIC 16ab Global Sun Technology Inc + 1100 GL24110P + 1101 PLX9052 PCMCIA-to-PCI Wireless LAN 1102 PCMCIA-to-PCI Wireless Network Bridge +16ae Safenet Inc + 1141 SafeXcel-1141 16be Creatix Polymedia GmbH 16ca CENATEK Inc 0001 Rocket Drive DL +16cd Densitron Technologies +# www.pikatechnologies.com +16df PIKA Technologies Inc. 16ec U.S. Robotics + 00ff USR997900 10/100 Mbps PCI Network Card 3685 Wireless Access PCI Adapter Model 022415 16f6 VideoTele.com, Inc. +# www.internetmachines.com +1702 Internet Machines Corporation (IMC) 1705 Digital First, Inc. -170b NetOctave Inc +170b NetOctave + 0100 NSP2000-SSL crypto accelerator 170c YottaYotta Inc. 172a Accelerated Encryption 1737 Linksys + 1032 Gigabit Network Adapter + 1737 0015 EG1032 v2 Instant Gigabit Network Adapter + 1064 Gigabit Network Adapter + 1737 0016 EG1064 v2 Instant Gigabit Network Adapter + ab08 21x4x DEC-Tulip compatible 10/100 Ethernet + ab09 21x4x DEC-Tulip compatible 10/100 Ethernet 173b Altima (nee Broadcom) 03e8 AC1000 Gigabit Ethernet + 03e9 AC1001 Gigabit Ethernet 03ea AC9100 Gigabit Ethernet 173b 0001 AC1002 + 03eb AC1003 Gigabit Ethernet 1743 Peppercon AG 8139 ROL/F-100 Fast Ethernet Adapter with ROL +1749 RLX Technologies 174b PC Partner Limited +174d WellX Telecom SA +175c AudioScience Inc 175e Sanera Systems, Inc. 1787 Hightech Information System Ltd. # also used by Struck Innovative Systeme for joint developments @@ -6271,21 +6907,48 @@ 0005 PROFIBUS 0006 AMCC HOTlink 1799 Belkin + 6001 Wireless PCI Card - F5D6001 + 6020 Wireless PCMCIA Card - F5D6020 + 6060 Wireless PDA Card - F5D6060 17af Hightech Information System Ltd. +17b3 Hawking Technologies + ab08 PN672TX 10/100 Ethernet +17b4 Indra Networks, Inc. + 0011 WebEnhance 100 GZIP Compression Card +17c0 Wistron Corp. +17c2 Newisys, Inc. 17cc NetChip Technology, Inc 2280 USB 2.0 +# S2io ships 10Gb PCI-X Ethernet adapters www.s2io.com +17d5 S2io Inc. 1813 Ambient Technologies Inc 4000 HaM controllerless modem 16be 0001 V9x HAM Data Fax Modem 4100 HaM plus Data Fax Modem 16be 0002 V9x HAM 1394 +1814 RaLink + 0101 Wireless PCI Adpator RT2400 / RT2460 + 0201 Ralink RT2500 802.11 Cardbus Reference Card +1830 Credence Systems Corporation 1851 Microtune, Inc. 1852 Anritsu Corp. +1867 Topspin Communications + 5a44 MT23108 PCI-X HCA + 5a45 MT23108 PCI-X HCA flash recovery + 5a46 MT23108 PCI-X HCA bridge 1888 Varisys Ltd 0301 VMFX1 FPGA PMC module 0601 VSM2 dual PMC carrier 0710 VS14x series PowerPC PCI board 0720 VS24x series PowerPC PCI board +# found e.g. on KNC DVB-S card +1894 KNC One +18a1 Astute Networks Inc. +18ca XGI - Xabre Graphics Inc + 0040 Volari V8 +18e6 MPL AG + 0001 OSCI [Octal Serial Communication Interface] +18fb Resilience Corporation 1a08 Sierra semiconductor 0000 SC15064 1b13 Jaton Corp @@ -6321,7 +6984,10 @@ 0021 HB6 Universal PCI-PCI bridge (non-transparent mode) 4c53 1050 CT7 mainboard 4c53 1080 CT8 mainboard + 4c53 10a0 CA3/CR3 mainboard 4c53 3010 PPCI mezzanine (32-bit PMC) + 4c53 3011 PPCI mezzanine (64-bit PMC) + 0026 HB2 PCI-PCI Bridge 101a E.Band [AudioTrak Inca88] 101b E.Band [AudioTrak Inca88] 8011 VXPro II Chipset @@ -6356,7 +7022,17 @@ 3d3d 0121 Oxygen VX1 000c GLINT R3 [Oxygen VX1] 3d3d 0144 Oxygen VX1-4X AGP [Permedia 4] + 000d GLint R4 rev A + 0011 GLint R4 rev B + 0012 GLint R5 rev A + 0013 GLint R5 rev B + 0020 VP10 visual processor +# P10 generic II + 0022 VP10 visual processor + 0024 VP9 visual processor 0100 Permedia II 2D+3D + 07a1 Wildcat III 6210 + 07a3 Wildcat IV 7210 1004 Permedia 3d04 Permedia ffff Glint VGA @@ -6379,11 +7055,16 @@ 4033 Addtron Technology Co, Inc. 1360 RTL8139 Ethernet 4143 Digital Equipment Corp +4144 Alpha Data 416c Aladdin Knowledge Systems 0100 AladdinCARD 0200 CPC 4444 Internext Compression Inc + 0016 iTVC16 (CX23416) MPEG-2 Encoder + 0070 4009 WinTV PVR 250 0803 iTVC15 MPEG-2 Encoder + 0070 4000 WinTV PVR-350 + 0070 4001 WinTV PVR-250 4468 Bridgeport machines 4594 Cogetec Informatique Inc 45fb Baldor Electric Company @@ -6399,6 +7080,11 @@ 4b10 Buslogic Inc. 4c48 LUNG HWA Electronics 4c53 SBS Technologies + 0000 PLUSTEST device + 4c53 3000 PLUSTEST card (PC104+) + 4c53 3001 PLUSTEST card (PMC) + 0001 PLUSTEST-MM device + 4c53 3002 PLUSTEST-MM card (PMC) 4ca1 Seanix Technology Inc 4d51 MediaQ Inc. 0200 MQ-200 @@ -6576,6 +7262,7 @@ 0003 TURBOstor HFP-832 [HiPPI NIC] 5654 VoiceTronix Pty Ltd 5700 Netpower +5851 Exacq Technologies 6356 UltraStor 6374 c't Magazin für Computertechnik 6773 GPPCI @@ -6589,11 +7276,37 @@ 8008 Quancom Electronic GmbH 0010 WDOG1 [PCI-Watchdog 1] 0011 PWDOG2 [PCI-Watchdog 2] +# Wrong ID used in subsystem ID of AsusTek PCI-USB2 PCI card. +807d Asustek Computer, Inc. 8086 Intel Corp. 0007 82379AB 0008 Extended Express System Support Controller - 0039 21145 + 0008 1000 WorldMark 4300 INCA ASIC + 0039 21145 Fast Ethernet 0122 82437FX + 0326 PCI Bridge Hub I/OxAPIC Interrupt Controller A + 0327 PCI Bridge Hub I/OxAPIC Interrupt Controller B + 0329 PCI Bridge Hub A + 032a PCI Bridge Hub B + 032c PCI Bridge Hub +# A-segment bridge + 0330 80332 [Dobson] I/O processor +# A-segment IOAPIC + 0331 80332 [Dobson] I/O processor +# B-segment bridge + 0332 80332 [Dobson] I/O processor +# B-segment IOAPIC + 0333 80332 [Dobson] I/O processor +# Address Translation Unit (ATU) + 0334 80332 [Dobson] I/O processor +# PCI-X bridge + 0335 80331 [Lindsay] I/O processor +# Address Translation Unit (ATU) + 0336 80331 [Lindsay] I/O processor +# A-segment bridge + 0340 41210 [Lanai] Serial to Parallel PCI Bridge +# B-segment bridge + 0341 41210 [Lanai] Serial to Parallel PCI Bridge 0482 82375EB 0483 82424ZX [Saturn] 0484 82378IB [SIO ISA Bridge] @@ -6625,28 +7338,84 @@ 8086 1004 PRO/1000 T Server Adapter 8086 2004 PRO/1000 T Server Adapter 1008 82544EI Gigabit Ethernet Controller (Copper) + 1014 0269 iSeries 1000/100/10 Ethernet Adapter + 1028 011c PRO/1000 XT Network Connection 8086 1107 PRO/1000 XT Server Adapter 8086 2107 PRO/1000 XT Server Adapter 8086 2110 PRO/1000 XT Server Adapter + 8086 3108 PRO/1000 XT Network Connection 1009 82544EI Gigabit Ethernet Controller (Fiber) + 1014 0268 iSeries Gigabit Ethernet Adapter 8086 1109 PRO/1000 XF Server Adapter 8086 2109 PRO/1000 XF Server Adapter 100c 82544GC Gigabit Ethernet Controller (Copper) 8086 1112 PRO/1000 T Desktop Adapter 8086 2112 PRO/1000 T Desktop Adapter 100d 82544GC Gigabit Ethernet Controller (LOM) + 1028 0123 PRO/1000 XT Network Connection + 1079 891f 82544GC Based Network Connection + 4c53 1080 CT8 mainboard + 8086 110d 82544GC Based Network Connection 100e 82540EM Gigabit Ethernet Controller + 1014 0265 PRO/1000 MT Network Connection + 1014 0267 PRO/1000 MT Network Connection + 1014 026a PRO/1000 MT Network Connection + 107b 8920 PRO/1000 MT Desktop Adapter 8086 001e PRO/1000 MT Desktop Adapter 8086 002e PRO/1000 MT Desktop Adapter 100f 82545EM Gigabit Ethernet Controller (Copper) + 1014 0269 iSeries 1000/100/10 Ethernet Adapter + 1014 028e PRO/1000 MT Network Connection + 8086 1000 PRO/1000 MT Network Connection 8086 1001 PRO/1000 MT Server Adapter 1010 82546EB Gigabit Ethernet Controller (Copper) + 1014 027c PRO/1000 MT Dual Port Network Adapter + 18fb 7872 RESlink-X + 4c53 1080 CT8 mainboard + 4c53 10a0 CA3/CR3 mainboard 8086 1011 PRO/1000 MT Dual Port Server Adapter + 8086 101a PRO/1000 MT Dual Port Network Adapter 1011 82545EM Gigabit Ethernet Controller (Fiber) + 1014 0268 iSeries Gigabit Ethernet Adapter 8086 1002 PRO/1000 MF Server Adapter + 8086 1003 PRO/1000 MF Server Adapter (LX) 1012 82546EB Gigabit Ethernet Controller (Fiber) 8086 1012 PRO/1000 MF Dual Port Server Adapter + 1013 82541EI Gigabit Ethernet Controller (Copper) + 8086 0013 PRO/1000 MT Network Connection + 8086 1113 PRO/1000 MT Desktop Adapter + 1014 82541ER Gigabit Ethernet Controller 1015 82540EM Gigabit Ethernet Controller (LOM) + 1016 82540EP Gigabit Ethernet Controller (LOM) + 1014 052c PRO/1000 MT Mobile Connection + 1179 0001 PRO/1000 MT Mobile Connection + 8086 1016 PRO/1000 MT Mobile Connection + 1017 82540EP Gigabit Ethernet Controller (LOM) + 8086 1017 PR0/1000 MT Desktop Connection +# Update controller name from 82541EP to 82541EI + 1018 82541EI Gigabit Ethernet Controller + 8086 1018 PRO/1000 MT Desktop Adapter + 1019 82547EI Gigabit Ethernet Controller (LOM) + 1458 1019 GA-8IPE1000 Pro2 motherboard (865PE) + 8086 1019 PRO/1000 CT Desktop Connection + 101d 82546EB Gigabit Ethernet Controller + 8086 1000 PRO/1000 MT Quad Port Server Adapter + 101e 82540EP Gigabit Ethernet Controller (Mobile) + 1014 0549 PRO/1000 MT Mobile Connection + 1179 0001 PRO/1000 MT Mobile Connection + 8086 101e PRO/1000 MT Mobile Connection + 1026 82545GM Gigabit Ethernet Controller + 8086 1000 PRO/1000 MT Server Connection + 8086 1001 PRO/1000 MT Server Adapter + 8086 1002 PRO/1000 MT Server Adapter + 8086 1026 PRO/1000 MT Server Connection + 1027 82545GM Gigabit Ethernet Controller + 8086 1001 PRO/1000 MF Server Adapter(LX) + 8086 1002 PRO/1000 MF Server Adapter(LX) + 8086 1003 PRO/1000 MF Server Adapter(LX) + 8086 1027 PRO/1000 MF Server Adapter + 1028 82545GM Gigabit Ethernet Controller + 8086 1028 PRO/1000 MB Server Adapter 1029 82559 Ethernet Controller 1030 82559 InBusiness 10/100 1031 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller @@ -6666,6 +7435,7 @@ 1037 82801CAM (ICH3) Chipset Ethernet Controller 1038 82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller 1039 82801BD PRO/100 VE (LOM) Ethernet Controller + 1014 0267 NetVista A30p 103a 82801BD PRO/100 VE (CNR) Ethernet Controller 103b 82801BD PRO/100 VM (LOM) Ethernet Controller 103c 82801BD PRO/100 VM (CNR) Ethernet Controller @@ -6674,10 +7444,49 @@ 1040 536EP Data Fax Modem 16be 1040 V.9X DSP Data Fax Modem 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter - 1048 82597EX 10GbE Ethernet Controller + 8086 2527 MIM2000/Centrino + 1048 Intel(R) PRO/10GbE LR Server Adapter 8086 a01f PRO/10GbE LR Server Adapter 8086 a11f PRO/10GbE LR Server Adapter + 1050 82562EZ 10/100 Ethernet Controller + 1462 728c 865PE Neo2 (MS-6728) + 1051 82801EB/ER (ICH5/ICH5R) integrated LAN Controller 1059 82551QM Ethernet Controller +# Updated controller name from 82547EI to 82547GI + 1075 82547GI Gigabit Ethernet Controller + 8086 0075 PRO/1000 CT Network Connection + 8086 1075 PRO/1000 CT Network Connection +# Added PI to part name. Previous part name was 82541GI + 1076 82541GI/PI Gigabit Ethernet Controller + 8086 0076 PRO/1000 MT Network Connection + 8086 1076 PRO/1000 MT Network Connection + 8086 1176 PRO/1000 MT Desktop Adapter + 8086 1276 PRO/1000 MT Desktop Adapter +# Update controller name from 82541EI to 82541GI + 1077 82541GI Gigabit Ethernet Controller + 1179 0001 PRO/1000 MT Mobile Connection + 8086 0077 PRO/1000 MT Mobile Connection + 8086 1077 PRO/1000 MT Mobile Connection + 1078 82541EI Gigabit Ethernet Controller + 8086 1078 PRO/1000 MT Network Connection +# Update from mistaken ID of 82546EB + 1079 82546GB Gigabit Ethernet Controller + 103c 12a6 HP Dual Port 1000Base-T [A9900A] + 103c 12cf HP Core Dual Port 1000Base-T [AB352A] + 4c53 1090 Cx9 / Vx9 mainboard + 8086 0079 PRO/1000 MT Dual Port Network Connection + 8086 1079 PRO/1000 MT Dual Port Network Connection + 8086 1179 PRO/1000 MT Dual Port Network Connection + 8086 117a PRO/1000 MT Dual Port Server Adapter +# Update from mistaken ID of 82546EB + 107a 82546GB Gigabit Ethernet Controller + 103c 12a8 HP Dual Port 1000base-SX [A9899A] + 8086 107a PRO/1000 MF Dual Port Server Adapter + 8086 127a PRO/1000 MF Dual Port Server Adapter +# Update from mistaken ID of 82546EB + 107b 82546GB Gigabit Ethernet Controller + 8086 007b PRO/1000 MB Dual Port Server Connection + 8086 107b PRO/1000 MB Dual Port Server Connection 1130 82815 815 Chipset Host Bridge and Memory Controller Hub 1025 1016 Travelmate 612 TX 1043 8027 TUSL2-C Mainboard @@ -6696,6 +7505,9 @@ 1200 Intel IXP1200 Network Processor 172a 0000 AEP SSL Accelerator 1209 82559ER + 4c53 1050 CT7 mainboard + 4c53 1051 CE7 mainboard + 4c53 1070 PC6 mainboard 1221 82092AA_0 1222 82092AA_1 1223 SAA7116 @@ -6744,6 +7556,7 @@ 1014 705c 10/100 Netfinity 10/100 Ethernet Security Adapter 1014 805c 10/100 Netfinity 10/100 Ethernet Security Adapter 1028 009b PowerEdge 2550 + 1028 00ce PowerEdge 1400 1033 8000 PC-9821X-B06 1033 8016 PK-UG-X006 1033 801f PK-UG-X006 @@ -6769,6 +7582,7 @@ 144d 2501 SEM-2000 MiniPCI LAN Adapter 144d 2502 SEM-2100IL MiniPCI LAN Adapter 1668 1100 EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem) + 4c53 1080 CT8 mainboard 8086 0001 EtherExpress PRO/100B (TX) 8086 0002 EtherExpress PRO/100B (T4) 8086 0003 EtherExpress PRO/10+ @@ -6875,6 +7689,7 @@ 1460 82870P2 P64H2 Hub PCI Bridge 1461 82870P2 P64H2 I/OxAPIC 15d9 3480 P4DP6 + 4c53 1090 Cx9 / Vx9 mainboard 1462 82870P2 P64H2 Hot Plug Controller 1960 80960RP [i960RP Microprocessor] 101e 0431 MegaRAID 431 RAID Controller @@ -6897,6 +7712,10 @@ 1111 1111 MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC 1111 1112 PowerEdge Expandable RAID Controller 2/SC 113c 03a2 MegaRAID + e4bf 1010 CG1-RADIO + e4bf 1020 CU2-QUARTET + e4bf 1040 CU1-CHORUS + e4bf 3100 CX1-BAND 1962 80960RM [i960RM Microprocessor] 105a 0000 SuperTrak SX6000 I2O CPU 1a21 82840 840 (Carmel) Chipset Host Bridge (Hub A) @@ -6997,7 +7816,8 @@ 8086 4532 D815EEA2 mainboard 8086 4557 D815EGEW Mainboard 244c 82801BAM ISA Bridge (LPC) - 244e 82801BA/CA/DB/EB PCI Bridge + 244e 82801BA/CA/DB/EB/ER Hub interface to PCI Bridge + 1014 0267 NetVista A30p 2450 82801E ISA Bridge (LPC) 2452 82801E USB 2453 82801E SMBus @@ -7011,6 +7831,7 @@ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 15d9 3480 P4DP6 8086 1958 vpr Matrix 170B4 + 8086 4541 Latitude C640 2483 82801CA/CAM SMBus Controller 1014 0220 ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP @@ -7022,7 +7843,7 @@ 15d9 3480 P4DP6 8086 1958 vpr Matrix 170B4 2485 82801CA/CAM AC'97 Audio Controller - 1014 0222 ThinkPad T23 (2647-4MG) or A30p (2653-64G) + 1014 0222 ThinkPad T23 (2647-4MG) or A30/A30p (2652/2653) 1014 0508 ThinkPad T30 1014 051c ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP @@ -7031,6 +7852,7 @@ 1014 0223 ThinkPad A/T/X Series 1014 0503 ThinkPad R31 2656BBG 1014 051a ThinkPad A/T/X Series + 101f 1025 Acer 620 Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 1179 0001 Toshiba Satellite 1110 Z15 internal Modem 134d 4c21 Dell Inspiron 2100 internal modem @@ -7045,40 +7867,98 @@ 1014 0220 ThinkPad A/T/X Series 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 8086 1958 vpr Matrix 170B4 + 8086 4541 Latitude C640 248b 82801CA Ultra ATA Storage Controller 15d9 3480 P4DP6 248c 82801CAM ISA Bridge (LPC) - 24c0 82801DB LPC Interface Controller + 24c0 82801DB (ICH4) LPC Bridge + 1014 0267 NetVista A30p 1462 5800 845PE Max (MS-6580) - 24c2 82801DB USB (Hub #1) + 24c2 82801DB (ICH4) USB UHCI #1 + 1014 0267 NetVista A30p + 1071 8160 MIM2000 1462 5800 845PE Max (MS-6580) - 24c3 82801DB/DBM SMBus Controller + 24c3 82801DB/DBM (ICH4) SMBus Controller + 1014 0267 NetVista A30p + 1071 8160 MIM2000 + 1458 24c2 GA-8PE667 Ultra 1462 5800 845PE Max (MS-6580) - 24c4 82801DB USB (Hub #2) + 4c53 1090 Cx9 / Vx9 mainboard + 24c4 82801DB (ICH4) USB UHCI #2 + 1014 0267 NetVista A30p + 1071 8160 MIM2000 1462 5800 845PE Max (MS-6580) - 24c5 82801DB AC'97 Audio Controller + 4c53 1090 Cx9 / Vx9 mainboard + 24c5 82801DB (ICH4) AC'97 Audio Controller + 0e11 00b8 Analog Devices Inc. codec [SoundMAX] + 1014 0267 NetVista A30p + 1071 8160 MIM2000 + 1458 a002 GA-8PE667 Ultra 1462 5800 845PE Max (MS-6580) - 24c6 82801DB AC'97 Modem Controller - 24c7 82801DB USB (Hub #3) + 24c6 82801DB (ICH4) AC'97 Modem Controller + 1071 8160 MIM2000 + 24c7 82801DB (ICH4) USB UHCI #3 + 1014 0267 NetVista A30p + 1071 8160 MIM2000 1462 5800 845PE Max (MS-6580) - 24ca 82801DBM Ultra ATA Storage Controller - 24cb 82801DB Ultra ATA Storage Controller + 24ca 82801DBM (ICH4) Ultra ATA Storage Controller + 1071 8160 MIM2000 + 24cb 82801DB (ICH4) Ultra ATA 100 Storage Controller + 1014 0267 NetVista A30p + 1458 24c2 GA-8PE667 Ultra 1462 5800 845PE Max (MS-6580) + 4c53 1090 Cx9 / Vx9 mainboard 24cc 82801DBM LPC Interface Controller - 24cd 82801DB USB2 - 1462 3981 845PE Max (MS-6580) Onboard USB EHCI Controller - 24d0 82801EB LPC Interface Controller - 24d1 82801EB Ultra ATA Storage Controller - 24d2 82801EB USB - 24d3 82801EB SMBus Controller - 24d4 82801EB USB - 24d5 82801EB AC'97 Audio Controller - 24d6 82801EB AC'97 Modem Controller - 24d7 82801EB USB - 24db 82801EB Ultra ATA Storage Controller + 24cd 82801DB (ICH4) USB2 EHCI Controller + 1014 0267 NetVista A30p + 1071 8160 MIM2000 + 1462 3981 845PE Max (MS-6580) + 4c53 1090 Cx9 / Vx9 mainboard + 24d0 82801EB/ER (ICH5/ICH5R) LPC Bridge + 24d1 82801EB (ICH5) Serial ATA 150 Storage Controller + 103c 12bc d530 CMT (DG746A) + 1458 24d1 GA-8IPE1000 Pro2 motherboard (865PE) + 1462 7280 865PE Neo2 (MS-6728) + 24d2 82801EB/ER (ICH5/ICH5R) USB UHCI #1 + 103c 12bc d530 CMT (DG746A) + 1043 80a6 P4P800 Mainboard + 1462 7280 865PE Neo2 (MS-6728) + 24d3 82801EB/ER (ICH5/ICH5R) SMBus Controller + 1043 80a6 P4P800 Mainboard + 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) + 1462 7280 865PE Neo2 (MS-6728) + 24d4 82801EB/ER (ICH5/ICH5R) USB UHCI #2 + 103c 12bc d530 CMT (DG746A) + 1043 80a6 P4P800 Mainboard + 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) + 1462 7280 865PE Neo2 (MS-6728) + 24d5 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller + 103c 12bc Analog Devices codec [SoundMAX Integrated Digital Audio] + 1043 80f3 P4P800 Mainboard + 1462 7280 865PE Neo2 (MS-6728) + 24d6 82801EB/ER (ICH5/ICH5R) AC'97 Modem Controller + 24d7 82801EB/ER (ICH5/ICH5R) USB UHCI #3 + 103c 12bc d530 CMT (DG746A) + 1043 80a6 P4P800 Mainboard + 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) + 1462 7280 865PE Neo2 (MS-6728) + 24db 82801EB/ER (ICH5/ICH5R) Ultra ATA 100 Storage Controller + 103c 12bc d530 CMT (DG746A) + 1043 80a6 P4P800 Mainboard + 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) + 1462 7280 865PE Neo2 (MS-6728) + 1462 7580 MSI 875P 24dc 82801EB LPC Interface Controller - 24dd 82801EB USB2 - 24de 82801EB USB + 24dd 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller + 103c 12bc d530 CMT (DG746A) + 1043 80a6 P4P800 Mainboard + 1458 5006 GA-8IPE1000 Pro2 motherboard (865PE) + 1462 7280 865PE Neo2 (MS-6728) + 24de 82801EB/ER (ICH5/ICH5R) USB UHCI #4 + 1043 80a6 P4P800 Mainboard + 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) + 1462 7280 865PE Neo2 (MS-6728) + 24df 82801EB (ICH5R) SATA (cc=RAID) 2500 82820 820 (Camino) Chipset Host Bridge (MCH) 1028 0095 Precision Workstation 220 Chipset 1043 801c P3C-2000 system chipset @@ -7098,33 +7978,85 @@ 15d9 3480 P4DP6 2541 E7000 Series Host RASUM Controller 15d9 3480 P4DP6 + 4c53 1090 Cx9 / Vx9 mainboard 2543 E7000 Series Hub Interface B PCI-to-PCI Bridge 2544 E7000 Series Hub Interface B RASUM Controller + 4c53 1090 Cx9 / Vx9 mainboard 2545 E7000 Series Hub Interface C PCI-to-PCI Bridge 2546 E7000 Series Hub Interface C RASUM Controller 2547 E7000 Series Hub Interface D PCI-to-PCI Bridge 2548 E7000 Series Hub Interface D RASUM Controller 254c E7501 Memory Controller Hub + 4c53 1090 Cx9 / Vx9 mainboard 2550 E7505 Memory Controller Hub 2551 E7000 Series RAS Controller 2552 E7000 Series Processor to AGP Controller 2553 E7000 Series Hub Interface B PCI-to-PCI Bridge 2554 E7000 Series Hub Interface B PCI-to-PCI Bridge RAS Controller 255d E7205 Memory Controller Hub - 2560 82845G/GL [Brookdale-G] Chipset Host Bridge + 2560 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface + 1458 2560 GA-8PE667 Ultra 1462 5800 845PE Max (MS-6580) - 2561 82845G/GL [Brookdale-G] Chipset AGP Bridge - 2562 82845G/GL [Brookdale-G] Chipset Integrated Graphics Device - 2570 82865G/PE/P Processor to I/O Controller - 2571 82865G/PE/P Processor to AGP Controller + 2561 82845G/GL[Brookdale-G]/GE/PE Host-to-AGP Bridge + 2562 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device + 1014 0267 NetVista A30p + 2570 82865G/PE/P DRAM Controller/Host-Hub Interface + 1043 80f2 P4P800 Mainboard + 1458 2570 GA-8IPE1000 Pro2 motherboard (865PE) + 2571 82865G/PE/P PCI to AGP Controller 2572 82865G Integrated Graphics Device - 2573 82865G/PE/P Processor to PCI to CSA Bridge - 2576 82864G/PE/P Processor to I/O Memory Interface + 2573 82865G/PE/P PCI to CSA Bridge + 2576 82865G/PE/P Processor to I/O Memory Interface 2578 82875P Memory Controller Hub + 1462 7580 MS-6758 (875P Neo) +# Motherboard P4SCE + 15d9 4580 Super Micro Computer Inc. P4SCE 2579 82875P Processor to AGP Controller 257b 82875P Processor to PCI to CSA Bridge 257e 82875P Processor to I/O Memory Interface + 2580 Memory Controller Hub + 2581 Memory Controller Hub PCI Express Port + 2582 Graphics Controller + 2584 Workstation Memory Controller Hub + 2585 Workstation Memory Controller Hub PCI Express Port + 2588 Server Memory Controller Hub + 2589 Server Memory Controller Hub PCI Express Port + 258a Graphics Controller + 25a1 6300ESB LPC Interface Controller + 25a2 6300ESB PATA Storage Controller + 25a3 6300ESB SATA Storage Controller + 25a4 6300ESB SMBus Controller + 25a6 6300ESB AC'97 Audio Controller + 25a7 6300ESB AC'97 Modem Controller + 25a9 6300ESB USB Universal Host Controller + 25aa 6300ESB USB Universal Host Controller + 25ab 6300ESB Watchdog Timer + 25ac 6300ESB I/O Advanced Programmable Interrupt Controller + 25ad 6300ESB USB2 Enhanced Host Controller + 25ae 6300ESB 64-bit PCI-X Bridge + 25b0 6300ESB SATA RAID Controller + 2640 I/O Controller Hub LPC + 2641 I/O Controller Hub LPC + 2642 I/O Controller Hub LPC + 2651 I/O Controller Hub SATA cc=ide + 2652 I/O Controller Hub SATA cc=raid + 2658 I/O Controller Hub USB + 2659 I/O Controller Hub USB + 265a I/O Controller Hub USB + 265b I/O Controller Hub USB + 265c I/O Controller Hub USB2 + 2660 I/O Controller Hub PCI Express Port 0 + 2662 I/O Controller Hub PCI Express Port 1 + 2664 I/O Controller Hub PCI Express Port 2 + 2666 I/O Controller Hub PCI Express Port 3 + 2668 I/O Controller Hub Audio + 266a I/O Controller Hub SMBus + 266d I/O Controller Hub Modem + 266e I/O Controller Hub Audio + 266f I/O Controller Hub PATA + 2782 Graphics Controller 3092 Integrated RAID + 3200 GD31244 PCI-X SATA HBA 3340 82855PM Processor to I/O Controller 3341 82855PM Processor to AGP Controller 3575 82830 830 Chipset Host Bridge @@ -7135,7 +8067,24 @@ 1014 0513 ThinkPad A/T/X Series 3578 82830 830 Chipset Host Bridge 3580 82852/855GM Host Bridge + 3581 855GME GMCH Host-to-AGP Bridge (Virtual PCI-to-PCI) 3582 82852/855GM Integrated Graphics Device + 3584 855GM/GME GMCH Memory I/O Control Registers + 3585 855GM/GME GMCH Configuration Process Registers + 3590 Server Memory Controller Hub + 3591 Memory Controller Hub Error Reporting Register + 3592 Server Memory Controller Hub + 3593 Memory Controller Hub Error Reporting Register + 3594 Memory Controller Hub DMA Controller + 3595 Memory Controller Hub PCI Express Port A0 + 3596 Memory Controller Hub PCI Express Port A1 + 3597 Memory Controller Hub PCI Express Port B0 + 3598 Memory Controller Hub PCI Express Port B1 + 3599 Memory Controller Hub PCI Express Port C0 + 359a Memory Controller Hub PCI Express Port C1 + 359b Memory Controller Hub Extended Configuration Registers + 359e Workstation Memory Controller Hub + 4220 Intel(R) PRO/Wireless 2200BG 5200 EtherExpress PRO/100 Intelligent Server 5201 EtherExpress PRO/100 Intelligent Server 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter @@ -7144,13 +8093,18 @@ 7010 82371SB PIIX3 IDE [Natoma/Triton II] 7020 82371SB PIIX3 USB [Natoma/Triton II] 7030 430VX - 82437VX TVX [Triton VX] + 7050 Intel Intercast Video Capture Card 7100 430TX - 82439TX MTXC 7110 82371AB/EB/MB PIIX4 ISA 7111 82371AB/EB/MB PIIX4 IDE 7112 82371AB/EB/MB PIIX4 USB 7113 82371AB/EB/MB PIIX4 ACPI 7120 82810 GMCH [Graphics Memory Controller Hub] + 4c53 1040 CL7 mainboard + 4c53 1060 PC7 mainboard 7121 82810 CGC [Chipset Graphics Controller] + 4c53 1040 CL7 mainboard + 4c53 1060 PC7 mainboard 8086 4341 Cayman (CA810) Mainboard 7122 82810 DC-100 GMCH [Graphics Memory Controller Hub] 7123 82810 DC-100 CGC [Chipset Graphics Controller] @@ -7163,12 +8117,17 @@ 7181 440LX/EX - 82443LX/EX AGP bridge 7190 440BX/ZX/DX - 82443BX/ZX/DX Host bridge 0e11 0500 Armada 1750 Laptop System Chipset - 0e11 b110 Armada M700 + 0e11 b110 Armada M700/E500 1179 0001 Toshiba Tecra 8100 Laptop System Chipset + 4c53 1050 CT7 mainboard + 4c53 1051 CE7 mainboard 7191 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge 7192 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) 0e11 0460 Armada 1700 Laptop System Chipset + 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 7194 82440MX Host Bridge + 1033 0000 Versa Note Vxi + 4c53 10a0 CA3/CR3 mainboard 7195 82440MX AC'97 Audio Controller 10cf 1099 QSound_SigmaTel Stac97 PCI Audio 11d4 0040 SoundMAX Integrated Digital Audio @@ -7179,8 +8138,11 @@ 719a 82440MX USB Universal Host Controller 719b 82440MX Power Management Controller 71a0 440GX - 82443GX Host bridge + 4c53 1050 CT7 mainboard + 4c53 1051 CE7 mainboard 71a1 440GX - 82443GX AGP bridge 71a2 440GX - 82443GX Host bridge (AGP disabled) + 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard 7600 82372FB PIIX5 ISA 7601 82372FB PIIX5 IDE 7602 82372FB PIIX5 USB @@ -7204,6 +8166,8 @@ 84e4 460GX - 84460GX Memory Data Controller (MDC) 84e6 460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB) 84ea 460GX - 84460GX AGP Bridge (GXB function 1) + 8500 IXP4xx Family Network Processor (IXP420, 421, 422, 425 and IXC1100) + 9000 Intel IXP2000 Familly Network Processor 9621 Integrated RAID 9622 Integrated RAID 9641 Integrated RAID @@ -7212,16 +8176,22 @@ # observed, and documented in Intel revision note; new mask of 1011:0026 b154 21154 PCI-to-PCI Bridge b555 21555 Non transparent PCI-to-PCI Bridge + 4c53 1050 CT7 mainboard + 4c53 1051 CE7 mainboard e4bf 1000 CC8-1-BLUES ffff 450NX/GX [Orion] - 82453KX/GX Memory controller [BUG] 8800 Trigem Computer Inc. 2008 Video assistent component 8866 T-Square Design Inc. 8888 Silicon Magic +# 8c4a is not Winbond but there is a board misprogrammed +8c4a Winbond + 1980 W89C940 misprogrammed [ne2k] 8e0e Computone Corporation 8e2e KTI 3000 ET32P2 9004 Adaptec + 0078 AHA-2940U_CN 1078 AIC-7810 1160 AIC-1160 [Family Fibre Channel Adapter] 2178 AIC-7821 @@ -7240,6 +8210,9 @@ 5478 AIC-7850 5575 AVA-2930 5578 AIC-7855 + 5647 ANA-7711 TCP Offload Engine + 9004 7710 ANA-7711F TCP Offload Engine - Optical + 9004 7711 ANA-7711LP TCP Offload Engine - Copper 5675 AIC-755x 5678 AIC-7856 5775 AIC-755x @@ -7331,11 +8304,13 @@ 0010 AHA-2940U2/U2W 9005 2180 AHA-2940U2 SCSI Controller 9005 8100 AHA-2940U2B SCSI Controller + 9005 a100 AHA-2940U2B SCSI Controller 9005 a180 AHA-2940U2W SCSI Controller 9005 e100 AHA-2950U2B SCSI Controller 0011 AHA-2930U2 0013 78902 9005 0003 AAA-131U2 Array1000 1 Channel RAID Controller + 9005 000f AIC7890_ARO 001f AHA-2940U2/U2W / 7890/7891 9005 000f 2940U2W SCSI Controller 9005 a180 2940U2W SCSI Controller @@ -7345,6 +8320,7 @@ 003f AIC-7890 0050 AHA-3940U2x/395U2x 9005 f500 AHA-3950U2B + 9005 ffff AHA-3950U2B 0051 AHA-3950U2D 9005 b500 AHA-3950U2D 0053 AIC-7896 SCSI Controller @@ -7352,6 +8328,7 @@ 005f AIC-7896U2/7897U2 0080 AIC-7892A U160/m 0e11 e2a0 Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter + 9005 6220 AHA-29160C 9005 62a0 29160N Ultra160 SCSI Controller 9005 e220 29160LP Low Profile Ultra160 SCSI Controller 9005 e2a0 29160 Ultra160 SCSI Controller @@ -7369,23 +8346,50 @@ 00c5 RAID subsystem HBA 1028 00c5 PowerEdge 2550 00cf AIC-7899P U160/m + 1028 00ce PowerEdge 1400 1028 00d1 PowerEdge 2550 10f1 2462 Thunder K7 S2462 15d9 9005 Onboard SCSI Host Adapter 0250 ServeRAID Controller 1014 0279 ServeRAID-xx 1014 028c ServeRAID-xx + 0283 AAC-RAID + 9005 0283 Catapult + 0284 AAC-RAID + 9005 0284 Tomcat 0285 AAC-RAID + 0e11 0295 SATA 6Ch (Bearcat) 1028 0287 PowerEdge Expandable RAID Controller 320/DC + 1028 0291 CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) + 17aa 0286 Legend S220 (Legend Crusader) + 17aa 0287 Legend S230 (Legend Vulcan) + 9005 0285 2200S (Vulcan) + 9005 0286 2120S (Crusader) + 9005 0287 2200S (Vulcan-2m) + 9005 0288 3230S (Harrier) + 9005 0289 3240S (Tornado) + 9005 028a ASR-2020S PCI-X ZCR (Skyhawk) + 9005 028b ASR-2020S SO-DIMM PCI-X ZCR (Terminator) + 9005 0290 AAR-2410SA PCI SATA 4ch (Jaguar II) + 9005 0292 AAR-2810SA PCI SATA 8ch (Corsair-8) + 9005 0293 AAR-21610SA PCI SATA 16ch (Corsair-16) + 9005 0294 ESD SO-DIMM PCI-X SATA ZCR (Prowler) + 0286 AAC-RAID (Rocket) + 9005 028c ASR-2230S + ASR-2230SLP PCI-X (Lancer) 8000 ASC-29320A U320 800f AIC-7901 U320 8010 ASC-39320 U320 8011 ASC-32320D U320 - 0e11 00ac U320 + 0e11 00ac ASC-39320D U320 9005 0041 ASC-39320D U320 8012 ASC-29320 U320 8013 ASC-29320B U320 8014 ASC-29320LP U320 + 8015 ASC-39320B U320 + 8016 ASC-39320A U320 + 8017 ASC-29320ALP U320 + 801c ASC-39320D U320 + 801d AIC-7902B U320 801e AIC-7901A U320 801f AIC-7902 U320 8080 ASC-29320A U320 w/HostRAID @@ -7410,8 +8414,19 @@ 9699 Omni Media Technology Inc 6565 6565 9710 NetMos Technology - 9815 VScom 021H-EP2 2 port parallel adaptor - 9835 222N-2 I/O Card (2S+1P) + 9815 PCI 9815 Multi-I/O Controller + 1000 0020 2P0S (2 port parallel adaptor) + 9835 PCI 9835 Multi-I/O Controller + 1000 0002 2S (16C550 UART) + 1000 0012 1P2S + 9845 PCI 9845 Multi-I/O Controller + 1000 0006 0P6S (6 port 16550a serial card) + 9855 PCI 9855 Multi-I/O Controller 4 Serial 1 Parallel + 1000 0014 1P4S +9902 Stargen Inc. + 0001 SG2010 PCI over Starfabric Bridge + 0002 SG2010 PCI to Starfabric Gateway + 0003 SG1010 Starfabric Switch and PCI Bridge a0a0 AOPEN Inc. a0f1 UNISYS Corporation a200 NEC Corporation @@ -7441,12 +8456,15 @@ dead Indigita Corporation e000 Winbond e000 W89C940 -e159 Tiger Jet Network Inc. +# see : http://www.schoenfeld.de/inside/Inside_CWMK3.txt +e159 Individual Computers - Jens Schoenfeld 0001 Intel 537 0059 0001 128k ISDN-S/T Adapter 0059 0003 128k ISDN-U Adapter 0002 Tiger100APC ISDN chipset e4bf EKF Elektronik GmbH +# Innovative and scalable network IC vendor +e55e Essence Technology, Inc. ea01 Eagle Technology # The main chip of all these devices is by Xilinx -> It could also be a Xilinx ID. ea60 RME @@ -7486,12 +8504,17 @@ cafe KONA SD SMPTE 259M I/O efac KONA SD SMPTE 259M I/O facd KONA HD SMPTE 292M I/O -fa57 Fast Search & Transfer ASA +fa57 Interagon AS + 0001 PMC [Pattern Matching Chip] febd Ultraview Corp. feda Broadcom Inc (nee Epigram) a0fa BCM4210 iLine10 HomePNA 2.0 a10e BCM4230 iLine10 HomePNA 2.0 +# IT & Telecom company, develops PCI Trunk cards +fede Fedetec Inc. + 0003 TABIC PCI v3 fffe VMWare Inc + 0405 Virtual SVGA 4.0 0710 Virtual SVGA ffff Illegal Vendor ID diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c --- a/drivers/pci/probe.c Tue May 4 22:16:06 2004 +++ b/drivers/pci/probe.c Tue May 4 22:16:06 2004 @@ -193,7 +193,7 @@ return; if (dev->transparent) { - printk("Transparent bridge - %s\n", pci_name(dev)); + printk(KERN_INFO "PCI: Transparent bridge - %s\n", pci_name(dev)); for(i = 0; i < PCI_BUS_NUM_RESOURCES; i++) child->resource[i] = child->parent->resource[i]; return; diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h --- a/include/linux/pci_ids.h Tue May 4 22:16:06 2004 +++ b/include/linux/pci_ids.h Tue May 4 22:16:06 2004 @@ -2129,6 +2129,7 @@ #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca #define PCI_DEVICE_ID_INTEL_82454NX 0x84cb #define PCI_DEVICE_ID_INTEL_84460GX 0x84ea +#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500 #define PCI_VENDOR_ID_COMPUTONE 0x8e0e #define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291