diff options
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_ctrl.c | 96 |
1 files changed, 47 insertions, 49 deletions
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index 856d57b4d604..4018420c6f95 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c | |||
@@ -123,7 +123,7 @@ static u8 handle_switch_change(u8 change, struct controller * ctrl) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * cpqhp_find_slot: find the struct slot of given device | 126 | * cpqhp_find_slot - find the struct slot of given device |
127 | * @ctrl: scan lots of this controller | 127 | * @ctrl: scan lots of this controller |
128 | * @device: the device id to find | 128 | * @device: the device id to find |
129 | */ | 129 | */ |
@@ -305,9 +305,8 @@ static u8 handle_power_fault(u8 change, struct controller * ctrl) | |||
305 | 305 | ||
306 | 306 | ||
307 | /** | 307 | /** |
308 | * sort_by_size: sort nodes on the list by their length, smallest first. | 308 | * sort_by_size - sort nodes on the list by their length, smallest first. |
309 | * @head: list to sort | 309 | * @head: list to sort |
310 | * | ||
311 | */ | 310 | */ |
312 | static int sort_by_size(struct pci_resource **head) | 311 | static int sort_by_size(struct pci_resource **head) |
313 | { | 312 | { |
@@ -354,9 +353,8 @@ static int sort_by_size(struct pci_resource **head) | |||
354 | 353 | ||
355 | 354 | ||
356 | /** | 355 | /** |
357 | * sort_by_max_size: sort nodes on the list by their length, largest first. | 356 | * sort_by_max_size - sort nodes on the list by their length, largest first. |
358 | * @head: list to sort | 357 | * @head: list to sort |
359 | * | ||
360 | */ | 358 | */ |
361 | static int sort_by_max_size(struct pci_resource **head) | 359 | static int sort_by_max_size(struct pci_resource **head) |
362 | { | 360 | { |
@@ -403,8 +401,10 @@ static int sort_by_max_size(struct pci_resource **head) | |||
403 | 401 | ||
404 | 402 | ||
405 | /** | 403 | /** |
406 | * do_pre_bridge_resource_split: find node of resources that are unused | 404 | * do_pre_bridge_resource_split - find node of resources that are unused |
407 | * | 405 | * @head: new list head |
406 | * @orig_head: original list head | ||
407 | * @alignment: max node size (?) | ||
408 | */ | 408 | */ |
409 | static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **head, | 409 | static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **head, |
410 | struct pci_resource **orig_head, u32 alignment) | 410 | struct pci_resource **orig_head, u32 alignment) |
@@ -477,8 +477,9 @@ static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **h | |||
477 | 477 | ||
478 | 478 | ||
479 | /** | 479 | /** |
480 | * do_bridge_resource_split: find one node of resources that aren't in use | 480 | * do_bridge_resource_split - find one node of resources that aren't in use |
481 | * | 481 | * @head: list head |
482 | * @alignment: max node size (?) | ||
482 | */ | 483 | */ |
483 | static struct pci_resource *do_bridge_resource_split(struct pci_resource **head, u32 alignment) | 484 | static struct pci_resource *do_bridge_resource_split(struct pci_resource **head, u32 alignment) |
484 | { | 485 | { |
@@ -525,14 +526,13 @@ error: | |||
525 | 526 | ||
526 | 527 | ||
527 | /** | 528 | /** |
528 | * get_io_resource: find first node of given size not in ISA aliasing window. | 529 | * get_io_resource - find first node of given size not in ISA aliasing window. |
529 | * @head: list to search | 530 | * @head: list to search |
530 | * @size: size of node to find, must be a power of two. | 531 | * @size: size of node to find, must be a power of two. |
531 | * | 532 | * |
532 | * Description: this function sorts the resource list by size and then returns | 533 | * Description: This function sorts the resource list by size and then returns |
533 | * returns the first node of "size" length that is not in the ISA aliasing | 534 | * returns the first node of "size" length that is not in the ISA aliasing |
534 | * window. If it finds a node larger than "size" it will split it up. | 535 | * window. If it finds a node larger than "size" it will split it up. |
535 | * | ||
536 | */ | 536 | */ |
537 | static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size) | 537 | static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size) |
538 | { | 538 | { |
@@ -620,7 +620,7 @@ static struct pci_resource *get_io_resource(struct pci_resource **head, u32 size | |||
620 | 620 | ||
621 | 621 | ||
622 | /** | 622 | /** |
623 | * get_max_resource: get largest node which has at least the given size. | 623 | * get_max_resource - get largest node which has at least the given size. |
624 | * @head: the list to search the node in | 624 | * @head: the list to search the node in |
625 | * @size: the minimum size of the node to find | 625 | * @size: the minimum size of the node to find |
626 | * | 626 | * |
@@ -712,7 +712,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz | |||
712 | 712 | ||
713 | 713 | ||
714 | /** | 714 | /** |
715 | * get_resource: find resource of given size and split up larger ones. | 715 | * get_resource - find resource of given size and split up larger ones. |
716 | * @head: the list to search for resources | 716 | * @head: the list to search for resources |
717 | * @size: the size limit to use | 717 | * @size: the size limit to use |
718 | * | 718 | * |
@@ -804,14 +804,14 @@ static struct pci_resource *get_resource(struct pci_resource **head, u32 size) | |||
804 | 804 | ||
805 | 805 | ||
806 | /** | 806 | /** |
807 | * cpqhp_resource_sort_and_combine: sort nodes by base addresses and clean up. | 807 | * cpqhp_resource_sort_and_combine - sort nodes by base addresses and clean up |
808 | * @head: the list to sort and clean up | 808 | * @head: the list to sort and clean up |
809 | * | 809 | * |
810 | * Description: Sorts all of the nodes in the list in ascending order by | 810 | * Description: Sorts all of the nodes in the list in ascending order by |
811 | * their base addresses. Also does garbage collection by | 811 | * their base addresses. Also does garbage collection by |
812 | * combining adjacent nodes. | 812 | * combining adjacent nodes. |
813 | * | 813 | * |
814 | * returns 0 if success | 814 | * Returns %0 if success. |
815 | */ | 815 | */ |
816 | int cpqhp_resource_sort_and_combine(struct pci_resource **head) | 816 | int cpqhp_resource_sort_and_combine(struct pci_resource **head) |
817 | { | 817 | { |
@@ -951,9 +951,9 @@ irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data) | |||
951 | 951 | ||
952 | /** | 952 | /** |
953 | * cpqhp_slot_create - Creates a node and adds it to the proper bus. | 953 | * cpqhp_slot_create - Creates a node and adds it to the proper bus. |
954 | * @busnumber - bus where new node is to be located | 954 | * @busnumber: bus where new node is to be located |
955 | * | 955 | * |
956 | * Returns pointer to the new node or NULL if unsuccessful | 956 | * Returns pointer to the new node or %NULL if unsuccessful. |
957 | */ | 957 | */ |
958 | struct pci_func *cpqhp_slot_create(u8 busnumber) | 958 | struct pci_func *cpqhp_slot_create(u8 busnumber) |
959 | { | 959 | { |
@@ -986,7 +986,7 @@ struct pci_func *cpqhp_slot_create(u8 busnumber) | |||
986 | * slot_remove - Removes a node from the linked list of slots. | 986 | * slot_remove - Removes a node from the linked list of slots. |
987 | * @old_slot: slot to remove | 987 | * @old_slot: slot to remove |
988 | * | 988 | * |
989 | * Returns 0 if successful, !0 otherwise. | 989 | * Returns %0 if successful, !0 otherwise. |
990 | */ | 990 | */ |
991 | static int slot_remove(struct pci_func * old_slot) | 991 | static int slot_remove(struct pci_func * old_slot) |
992 | { | 992 | { |
@@ -1026,7 +1026,7 @@ static int slot_remove(struct pci_func * old_slot) | |||
1026 | * bridge_slot_remove - Removes a node from the linked list of slots. | 1026 | * bridge_slot_remove - Removes a node from the linked list of slots. |
1027 | * @bridge: bridge to remove | 1027 | * @bridge: bridge to remove |
1028 | * | 1028 | * |
1029 | * Returns 0 if successful, !0 otherwise. | 1029 | * Returns %0 if successful, !0 otherwise. |
1030 | */ | 1030 | */ |
1031 | static int bridge_slot_remove(struct pci_func *bridge) | 1031 | static int bridge_slot_remove(struct pci_func *bridge) |
1032 | { | 1032 | { |
@@ -1071,7 +1071,7 @@ out: | |||
1071 | * cpqhp_slot_find - Looks for a node by bus, and device, multiple functions accessed | 1071 | * cpqhp_slot_find - Looks for a node by bus, and device, multiple functions accessed |
1072 | * @bus: bus to find | 1072 | * @bus: bus to find |
1073 | * @device: device to find | 1073 | * @device: device to find |
1074 | * @index: is 0 for first function found, 1 for the second... | 1074 | * @index: is %0 for first function found, %1 for the second... |
1075 | * | 1075 | * |
1076 | * Returns pointer to the node if successful, %NULL otherwise. | 1076 | * Returns pointer to the node if successful, %NULL otherwise. |
1077 | */ | 1077 | */ |
@@ -1115,16 +1115,13 @@ static int is_bridge(struct pci_func * func) | |||
1115 | 1115 | ||
1116 | 1116 | ||
1117 | /** | 1117 | /** |
1118 | * set_controller_speed - set the frequency and/or mode of a specific | 1118 | * set_controller_speed - set the frequency and/or mode of a specific controller segment. |
1119 | * controller segment. | ||
1120 | * | ||
1121 | * @ctrl: controller to change frequency/mode for. | 1119 | * @ctrl: controller to change frequency/mode for. |
1122 | * @adapter_speed: the speed of the adapter we want to match. | 1120 | * @adapter_speed: the speed of the adapter we want to match. |
1123 | * @hp_slot: the slot number where the adapter is installed. | 1121 | * @hp_slot: the slot number where the adapter is installed. |
1124 | * | 1122 | * |
1125 | * Returns 0 if we successfully change frequency and/or mode to match the | 1123 | * Returns %0 if we successfully change frequency and/or mode to match the |
1126 | * adapter speed. | 1124 | * adapter speed. |
1127 | * | ||
1128 | */ | 1125 | */ |
1129 | static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) | 1126 | static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) |
1130 | { | 1127 | { |
@@ -1253,13 +1250,14 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ | |||
1253 | 1250 | ||
1254 | /** | 1251 | /** |
1255 | * board_replaced - Called after a board has been replaced in the system. | 1252 | * board_replaced - Called after a board has been replaced in the system. |
1253 | * @func: PCI device/function information | ||
1254 | * @ctrl: hotplug controller | ||
1256 | * | 1255 | * |
1257 | * This is only used if we don't have resources for hot add | 1256 | * This is only used if we don't have resources for hot add. |
1258 | * Turns power on for the board | 1257 | * Turns power on for the board. |
1259 | * Checks to see if board is the same | 1258 | * Checks to see if board is the same. |
1260 | * If board is same, reconfigures it | 1259 | * If board is same, reconfigures it. |
1261 | * If board isn't same, turns it back off. | 1260 | * If board isn't same, turns it back off. |
1262 | * | ||
1263 | */ | 1261 | */ |
1264 | static u32 board_replaced(struct pci_func *func, struct controller *ctrl) | 1262 | static u32 board_replaced(struct pci_func *func, struct controller *ctrl) |
1265 | { | 1263 | { |
@@ -1403,10 +1401,11 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl) | |||
1403 | 1401 | ||
1404 | /** | 1402 | /** |
1405 | * board_added - Called after a board has been added to the system. | 1403 | * board_added - Called after a board has been added to the system. |
1404 | * @func: PCI device/function info | ||
1405 | * @ctrl: hotplug controller | ||
1406 | * | 1406 | * |
1407 | * Turns power on for the board | 1407 | * Turns power on for the board. |
1408 | * Configures board | 1408 | * Configures board. |
1409 | * | ||
1410 | */ | 1409 | */ |
1411 | static u32 board_added(struct pci_func *func, struct controller *ctrl) | 1410 | static u32 board_added(struct pci_func *func, struct controller *ctrl) |
1412 | { | 1411 | { |
@@ -1607,8 +1606,10 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) | |||
1607 | 1606 | ||
1608 | 1607 | ||
1609 | /** | 1608 | /** |
1610 | * remove_board - Turns off slot and LED's | 1609 | * remove_board - Turns off slot and LEDs |
1611 | * | 1610 | * @func: PCI device/function info |
1611 | * @replace_flag: whether replacing or adding a new device | ||
1612 | * @ctrl: target controller | ||
1612 | */ | 1613 | */ |
1613 | static u32 remove_board(struct pci_func * func, u32 replace_flag, struct controller * ctrl) | 1614 | static u32 remove_board(struct pci_func * func, u32 replace_flag, struct controller * ctrl) |
1614 | { | 1615 | { |
@@ -1902,11 +1903,11 @@ static void interrupt_event_handler(struct controller *ctrl) | |||
1902 | 1903 | ||
1903 | 1904 | ||
1904 | /** | 1905 | /** |
1905 | * cpqhp_pushbutton_thread | 1906 | * cpqhp_pushbutton_thread - handle pushbutton events |
1907 | * @slot: target slot (struct) | ||
1906 | * | 1908 | * |
1907 | * Scheduled procedure to handle blocking stuff for the pushbuttons | 1909 | * Scheduled procedure to handle blocking stuff for the pushbuttons. |
1908 | * Handles all pending events and exits. | 1910 | * Handles all pending events and exits. |
1909 | * | ||
1910 | */ | 1911 | */ |
1911 | void cpqhp_pushbutton_thread(unsigned long slot) | 1912 | void cpqhp_pushbutton_thread(unsigned long slot) |
1912 | { | 1913 | { |
@@ -2137,9 +2138,10 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) | |||
2137 | } | 2138 | } |
2138 | 2139 | ||
2139 | /** | 2140 | /** |
2140 | * switch_leds: switch the leds, go from one site to the other. | 2141 | * switch_leds - switch the leds, go from one site to the other. |
2141 | * @ctrl: controller to use | 2142 | * @ctrl: controller to use |
2142 | * @num_of_slots: number of slots to use | 2143 | * @num_of_slots: number of slots to use |
2144 | * @work_LED: LED control value | ||
2143 | * @direction: 1 to start from the left side, 0 to start right. | 2145 | * @direction: 1 to start from the left side, 0 to start right. |
2144 | */ | 2146 | */ |
2145 | static void switch_leds(struct controller *ctrl, const int num_of_slots, | 2147 | static void switch_leds(struct controller *ctrl, const int num_of_slots, |
@@ -2165,11 +2167,11 @@ static void switch_leds(struct controller *ctrl, const int num_of_slots, | |||
2165 | } | 2167 | } |
2166 | 2168 | ||
2167 | /** | 2169 | /** |
2168 | * hardware_test - runs hardware tests | 2170 | * cpqhp_hardware_test - runs hardware tests |
2171 | * @ctrl: target controller | ||
2172 | * @test_num: the number written to the "test" file in sysfs. | ||
2169 | * | 2173 | * |
2170 | * For hot plug ctrl folks to play with. | 2174 | * For hot plug ctrl folks to play with. |
2171 | * test_num is the number written to the "test" file in sysfs | ||
2172 | * | ||
2173 | */ | 2175 | */ |
2174 | int cpqhp_hardware_test(struct controller *ctrl, int test_num) | 2176 | int cpqhp_hardware_test(struct controller *ctrl, int test_num) |
2175 | { | 2177 | { |
@@ -2249,14 +2251,12 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num) | |||
2249 | 2251 | ||
2250 | /** | 2252 | /** |
2251 | * configure_new_device - Configures the PCI header information of one board. | 2253 | * configure_new_device - Configures the PCI header information of one board. |
2252 | * | ||
2253 | * @ctrl: pointer to controller structure | 2254 | * @ctrl: pointer to controller structure |
2254 | * @func: pointer to function structure | 2255 | * @func: pointer to function structure |
2255 | * @behind_bridge: 1 if this is a recursive call, 0 if not | 2256 | * @behind_bridge: 1 if this is a recursive call, 0 if not |
2256 | * @resources: pointer to set of resource lists | 2257 | * @resources: pointer to set of resource lists |
2257 | * | 2258 | * |
2258 | * Returns 0 if success | 2259 | * Returns 0 if success. |
2259 | * | ||
2260 | */ | 2260 | */ |
2261 | static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, | 2261 | static u32 configure_new_device(struct controller * ctrl, struct pci_func * func, |
2262 | u8 behind_bridge, struct resource_lists * resources) | 2262 | u8 behind_bridge, struct resource_lists * resources) |
@@ -2346,15 +2346,13 @@ static u32 configure_new_device(struct controller * ctrl, struct pci_func * func | |||
2346 | 2346 | ||
2347 | /** | 2347 | /** |
2348 | * configure_new_function - Configures the PCI header information of one device | 2348 | * configure_new_function - Configures the PCI header information of one device |
2349 | * | ||
2350 | * @ctrl: pointer to controller structure | 2349 | * @ctrl: pointer to controller structure |
2351 | * @func: pointer to function structure | 2350 | * @func: pointer to function structure |
2352 | * @behind_bridge: 1 if this is a recursive call, 0 if not | 2351 | * @behind_bridge: 1 if this is a recursive call, 0 if not |
2353 | * @resources: pointer to set of resource lists | 2352 | * @resources: pointer to set of resource lists |
2354 | * | 2353 | * |
2355 | * Calls itself recursively for bridged devices. | 2354 | * Calls itself recursively for bridged devices. |
2356 | * Returns 0 if success | 2355 | * Returns 0 if success. |
2357 | * | ||
2358 | */ | 2356 | */ |
2359 | static int configure_new_function(struct controller *ctrl, struct pci_func *func, | 2357 | static int configure_new_function(struct controller *ctrl, struct pci_func *func, |
2360 | u8 behind_bridge, | 2358 | u8 behind_bridge, |