aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/ibmphp_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_pci.c')
-rw-r--r--drivers/pci/hotplug/ibmphp_pci.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
index 97753ddcd856..d87a9e3eaeeb 100644
--- a/drivers/pci/hotplug/ibmphp_pci.c
+++ b/drivers/pci/hotplug/ibmphp_pci.c
@@ -199,7 +199,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
199 } 199 }
200 200
201 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number); 201 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
202 flag = FALSE; 202 flag = 0;
203 for (i = 0; i < 32; i++) { 203 for (i = 0; i < 32; i++) {
204 if (func->devices[i]) { 204 if (func->devices[i]) {
205 newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL); 205 newfunc = kzalloc(sizeof(*newfunc), GFP_KERNEL);
@@ -226,7 +226,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
226 cleanup_count = 2; 226 cleanup_count = 2;
227 goto error; 227 goto error;
228 } 228 }
229 flag = TRUE; 229 flag = 1;
230 } 230 }
231 } 231 }
232 232
@@ -272,7 +272,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
272 cur_func->busno, device, function); 272 cur_func->busno, device, function);
273 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number); 273 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
274 debug ("after configuring bridge..., sec_number = %x\n", sec_number); 274 debug ("after configuring bridge..., sec_number = %x\n", sec_number);
275 flag = FALSE; 275 flag = 0;
276 for (i = 0; i < 32; i++) { 276 for (i = 0; i < 32; i++) {
277 if (func->devices[i]) { 277 if (func->devices[i]) {
278 debug ("inside for loop, device is %x\n", i); 278 debug ("inside for loop, device is %x\n", i);
@@ -301,7 +301,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
301 cleanup_count = 2; 301 cleanup_count = 2;
302 goto error; 302 goto error;
303 } 303 }
304 flag = TRUE; 304 flag = 1;
305 } 305 }
306 } 306 }
307 307
@@ -449,7 +449,7 @@ static int configure_device (struct pci_func *func)
449 pfmem[count]->devfunc = PCI_DEVFN(func->device, 449 pfmem[count]->devfunc = PCI_DEVFN(func->device,
450 func->function); 450 func->function);
451 pfmem[count]->len = len[count]; 451 pfmem[count]->len = len[count];
452 pfmem[count]->fromMem = FALSE; 452 pfmem[count]->fromMem = 0;
453 if (ibmphp_check_resource (pfmem[count], 0) == 0) { 453 if (ibmphp_check_resource (pfmem[count], 0) == 0) {
454 ibmphp_add_resource (pfmem[count]); 454 ibmphp_add_resource (pfmem[count]);
455 func->pfmem[count] = pfmem[count]; 455 func->pfmem[count] = pfmem[count];
@@ -467,7 +467,7 @@ static int configure_device (struct pci_func *func)
467 debug ("there's no pfmem... going into mem.\n"); 467 debug ("there's no pfmem... going into mem.\n");
468 if (ibmphp_check_resource (mem_tmp, 0) == 0) { 468 if (ibmphp_check_resource (mem_tmp, 0) == 0) {
469 ibmphp_add_resource (mem_tmp); 469 ibmphp_add_resource (mem_tmp);
470 pfmem[count]->fromMem = TRUE; 470 pfmem[count]->fromMem = 1;
471 pfmem[count]->rangeno = mem_tmp->rangeno; 471 pfmem[count]->rangeno = mem_tmp->rangeno;
472 pfmem[count]->start = mem_tmp->start; 472 pfmem[count]->start = mem_tmp->start;
473 pfmem[count]->end = mem_tmp->end; 473 pfmem[count]->end = mem_tmp->end;
@@ -571,11 +571,11 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
571 u16 pfmem_base; 571 u16 pfmem_base;
572 u32 bar[2]; 572 u32 bar[2];
573 u32 len[2]; 573 u32 len[2];
574 u8 flag_io = FALSE; 574 u8 flag_io = 0;
575 u8 flag_mem = FALSE; 575 u8 flag_mem = 0;
576 u8 flag_pfmem = FALSE; 576 u8 flag_pfmem = 0;
577 u8 need_io_upper = FALSE; 577 u8 need_io_upper = 0;
578 u8 need_pfmem_upper = FALSE; 578 u8 need_pfmem_upper = 0;
579 struct res_needed *amount_needed = NULL; 579 struct res_needed *amount_needed = NULL;
580 struct resource_node *io = NULL; 580 struct resource_node *io = NULL;
581 struct resource_node *bus_io[2] = {NULL, NULL}; 581 struct resource_node *bus_io[2] = {NULL, NULL};
@@ -713,7 +713,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
713 bus_pfmem[count]->devfunc = PCI_DEVFN(func->device, 713 bus_pfmem[count]->devfunc = PCI_DEVFN(func->device,
714 func->function); 714 func->function);
715 bus_pfmem[count]->len = len[count]; 715 bus_pfmem[count]->len = len[count];
716 bus_pfmem[count]->fromMem = FALSE; 716 bus_pfmem[count]->fromMem = 0;
717 if (ibmphp_check_resource (bus_pfmem[count], 0) == 0) { 717 if (ibmphp_check_resource (bus_pfmem[count], 0) == 0) {
718 ibmphp_add_resource (bus_pfmem[count]); 718 ibmphp_add_resource (bus_pfmem[count]);
719 func->pfmem[count] = bus_pfmem[count]; 719 func->pfmem[count] = bus_pfmem[count];
@@ -730,7 +730,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
730 mem_tmp->len = bus_pfmem[count]->len; 730 mem_tmp->len = bus_pfmem[count]->len;
731 if (ibmphp_check_resource (mem_tmp, 0) == 0) { 731 if (ibmphp_check_resource (mem_tmp, 0) == 0) {
732 ibmphp_add_resource (mem_tmp); 732 ibmphp_add_resource (mem_tmp);
733 bus_pfmem[count]->fromMem = TRUE; 733 bus_pfmem[count]->fromMem = 1;
734 bus_pfmem[count]->rangeno = mem_tmp->rangeno; 734 bus_pfmem[count]->rangeno = mem_tmp->rangeno;
735 ibmphp_add_pfmem_from_mem (bus_pfmem[count]); 735 ibmphp_add_pfmem_from_mem (bus_pfmem[count]);
736 func->pfmem[count] = bus_pfmem[count]; 736 func->pfmem[count] = bus_pfmem[count];
@@ -826,7 +826,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
826 826
827 if (!amount_needed->io) { 827 if (!amount_needed->io) {
828 debug ("it doesn't want IO?\n"); 828 debug ("it doesn't want IO?\n");
829 flag_io = TRUE; 829 flag_io = 1;
830 } else { 830 } else {
831 debug ("it wants %x IO behind the bridge\n", amount_needed->io); 831 debug ("it wants %x IO behind the bridge\n", amount_needed->io);
832 io = kzalloc(sizeof(*io), GFP_KERNEL); 832 io = kzalloc(sizeof(*io), GFP_KERNEL);
@@ -843,13 +843,13 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
843 if (ibmphp_check_resource (io, 1) == 0) { 843 if (ibmphp_check_resource (io, 1) == 0) {
844 debug ("were we able to add io\n"); 844 debug ("were we able to add io\n");
845 ibmphp_add_resource (io); 845 ibmphp_add_resource (io);
846 flag_io = TRUE; 846 flag_io = 1;
847 } 847 }
848 } 848 }
849 849
850 if (!amount_needed->mem) { 850 if (!amount_needed->mem) {
851 debug ("it doesn't want n.e.memory?\n"); 851 debug ("it doesn't want n.e.memory?\n");
852 flag_mem = TRUE; 852 flag_mem = 1;
853 } else { 853 } else {
854 debug ("it wants %x memory behind the bridge\n", amount_needed->mem); 854 debug ("it wants %x memory behind the bridge\n", amount_needed->mem);
855 mem = kzalloc(sizeof(*mem), GFP_KERNEL); 855 mem = kzalloc(sizeof(*mem), GFP_KERNEL);
@@ -864,14 +864,14 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
864 mem->len = amount_needed->mem; 864 mem->len = amount_needed->mem;
865 if (ibmphp_check_resource (mem, 1) == 0) { 865 if (ibmphp_check_resource (mem, 1) == 0) {
866 ibmphp_add_resource (mem); 866 ibmphp_add_resource (mem);
867 flag_mem = TRUE; 867 flag_mem = 1;
868 debug ("were we able to add mem\n"); 868 debug ("were we able to add mem\n");
869 } 869 }
870 } 870 }
871 871
872 if (!amount_needed->pfmem) { 872 if (!amount_needed->pfmem) {
873 debug ("it doesn't want n.e.pfmem mem?\n"); 873 debug ("it doesn't want n.e.pfmem mem?\n");
874 flag_pfmem = TRUE; 874 flag_pfmem = 1;
875 } else { 875 } else {
876 debug ("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem); 876 debug ("it wants %x pfmemory behind the bridge\n", amount_needed->pfmem);
877 pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL); 877 pfmem = kzalloc(sizeof(*pfmem), GFP_KERNEL);
@@ -884,10 +884,10 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
884 pfmem->busno = func->busno; 884 pfmem->busno = func->busno;
885 pfmem->devfunc = PCI_DEVFN(func->device, func->function); 885 pfmem->devfunc = PCI_DEVFN(func->device, func->function);
886 pfmem->len = amount_needed->pfmem; 886 pfmem->len = amount_needed->pfmem;
887 pfmem->fromMem = FALSE; 887 pfmem->fromMem = 0;
888 if (ibmphp_check_resource (pfmem, 1) == 0) { 888 if (ibmphp_check_resource (pfmem, 1) == 0) {
889 ibmphp_add_resource (pfmem); 889 ibmphp_add_resource (pfmem);
890 flag_pfmem = TRUE; 890 flag_pfmem = 1;
891 } else { 891 } else {
892 mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL); 892 mem_tmp = kzalloc(sizeof(*mem_tmp), GFP_KERNEL);
893 if (!mem_tmp) { 893 if (!mem_tmp) {
@@ -901,10 +901,10 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
901 mem_tmp->len = pfmem->len; 901 mem_tmp->len = pfmem->len;
902 if (ibmphp_check_resource (mem_tmp, 1) == 0) { 902 if (ibmphp_check_resource (mem_tmp, 1) == 0) {
903 ibmphp_add_resource (mem_tmp); 903 ibmphp_add_resource (mem_tmp);
904 pfmem->fromMem = TRUE; 904 pfmem->fromMem = 1;
905 pfmem->rangeno = mem_tmp->rangeno; 905 pfmem->rangeno = mem_tmp->rangeno;
906 ibmphp_add_pfmem_from_mem (pfmem); 906 ibmphp_add_pfmem_from_mem (pfmem);
907 flag_pfmem = TRUE; 907 flag_pfmem = 1;
908 } 908 }
909 } 909 }
910 } 910 }
@@ -950,11 +950,11 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
950 950
951 if ((io_base & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) { 951 if ((io_base & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) {
952 debug ("io 32\n"); 952 debug ("io 32\n");
953 need_io_upper = TRUE; 953 need_io_upper = 1;
954 } 954 }
955 if ((pfmem_base & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) { 955 if ((pfmem_base & PCI_PREF_RANGE_TYPE_MASK) == PCI_PREF_RANGE_TYPE_64) {
956 debug ("pfmem 64\n"); 956 debug ("pfmem 64\n");
957 need_pfmem_upper = TRUE; 957 need_pfmem_upper = 1;
958 } 958 }
959 959
960 if (bus->noIORanges) { 960 if (bus->noIORanges) {
@@ -1119,7 +1119,7 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
1119 debug ("hdr_type behind the bridge is %x\n", hdr_type); 1119 debug ("hdr_type behind the bridge is %x\n", hdr_type);
1120 if (hdr_type & PCI_HEADER_TYPE_BRIDGE) { 1120 if (hdr_type & PCI_HEADER_TYPE_BRIDGE) {
1121 err ("embedded bridges not supported for hot-plugging.\n"); 1121 err ("embedded bridges not supported for hot-plugging.\n");
1122 amount->not_correct = TRUE; 1122 amount->not_correct = 1;
1123 return amount; 1123 return amount;
1124 } 1124 }
1125 1125
@@ -1127,12 +1127,12 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
1127 if (class == PCI_CLASS_NOT_DEFINED_VGA) { 1127 if (class == PCI_CLASS_NOT_DEFINED_VGA) {
1128 err ("The device %x is VGA compatible and as is not supported for hot plugging. " 1128 err ("The device %x is VGA compatible and as is not supported for hot plugging. "
1129 "Please choose another device.\n", device); 1129 "Please choose another device.\n", device);
1130 amount->not_correct = TRUE; 1130 amount->not_correct = 1;
1131 return amount; 1131 return amount;
1132 } else if (class == PCI_CLASS_DISPLAY_VGA) { 1132 } else if (class == PCI_CLASS_DISPLAY_VGA) {
1133 err ("The device %x is not supported for hot plugging. " 1133 err ("The device %x is not supported for hot plugging. "
1134 "Please choose another device.\n", device); 1134 "Please choose another device.\n", device);
1135 amount->not_correct = TRUE; 1135 amount->not_correct = 1;
1136 return amount; 1136 return amount;
1137 } 1137 }
1138 1138
@@ -1192,9 +1192,9 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
1192 } /* end for */ 1192 } /* end for */
1193 1193
1194 if (!howmany) 1194 if (!howmany)
1195 amount->not_correct = TRUE; 1195 amount->not_correct = 1;
1196 else 1196 else
1197 amount->not_correct = FALSE; 1197 amount->not_correct = 0;
1198 if ((amount->io) && (amount->io < IOBRIDGE)) 1198 if ((amount->io) && (amount->io < IOBRIDGE))
1199 amount->io = IOBRIDGE; 1199 amount->io = IOBRIDGE;
1200 if ((amount->mem) && (amount->mem < MEMBRIDGE)) 1200 if ((amount->mem) && (amount->mem < MEMBRIDGE))