• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/pci/hotplug/

Lines Matching refs:count

359 	int count;
372 for (count = 0; address[count]; count++) { /* for 6 BARs */
379 PCI_BASE_ADDRESS_0 + 4 * count, &tmp);
382 PCI_BASE_ADDRESS_0 + 4 * count, 0xFFFFFFFD);
385 PCI_BASE_ADDRESS_0 + 4 * count, 0xFFFFFFFF);
387 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFF);
388 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
390 if (!bar[count]) /* This BAR is not implemented */
393 debug ("Device %x BAR %d wants %x\n", func->device, count, bar[count]);
395 if (bar[count] & PCI_BASE_ADDRESS_SPACE_IO) {
399 len[count] = bar[count] & 0xFFFFFFFC;
400 len[count] = ~len[count] + 1;
402 debug ("len[count] in IO %x, count %d\n", len[count], count);
404 io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
406 if (!io[count]) {
410 io[count]->type = IO;
411 io[count]->busno = func->busno;
412 io[count]->devfunc = PCI_DEVFN(func->device, func->function);
413 io[count]->len = len[count];
414 if (ibmphp_check_resource(io[count], 0) == 0) {
415 ibmphp_add_resource (io[count]);
416 func->io[count] = io[count];
419 func->busno, func->device, func->function, len[count]);
420 kfree (io[count]);
423 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->io[count]->start);
426 debug ("b4 writing, the IO address is %x\n", func->io[count]->start);
427 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
428 debug ("after writing.... the start address is %x\n", bar[count]);
433 if (bar[count] & PCI_BASE_ADDRESS_MEM_PREFETCH) {
437 len[count] = bar[count] & 0xFFFFFFF0;
438 len[count] = ~len[count] + 1;
440 debug ("len[count] in PFMEM %x, count %d\n", len[count], count);
442 pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
443 if (!pfmem[count]) {
447 pfmem[count]->type = PFMEM;
448 pfmem[count]->busno = func->busno;
449 pfmem[count]->devfunc = PCI_DEVFN(func->device,
451 pfmem[count]->len = len[count];
452 pfmem[count]->fromMem = 0;
453 if (ibmphp_check_resource (pfmem[count], 0) == 0) {
454 ibmphp_add_resource (pfmem[count]);
455 func->pfmem[count] = pfmem[count];
460 kfree (pfmem[count]);
464 mem_tmp->busno = pfmem[count]->busno;
465 mem_tmp->devfunc = pfmem[count]->devfunc;
466 mem_tmp->len = pfmem[count]->len;
470 pfmem[count]->fromMem = 1;
471 pfmem[count]->rangeno = mem_tmp->rangeno;
472 pfmem[count]->start = mem_tmp->start;
473 pfmem[count]->end = mem_tmp->end;
474 ibmphp_add_pfmem_from_mem (pfmem[count]);
475 func->pfmem[count] = pfmem[count];
478 func->busno, func->device, len[count]);
480 kfree (pfmem[count]);
485 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->pfmem[count]->start);
488 debug ("b4 writing, start address is %x\n", func->pfmem[count]->start);
489 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
490 debug ("after writing, start address is %x\n", bar[count]);
493 if (bar[count] & PCI_BASE_ADDRESS_MEM_TYPE_64) { /* takes up another dword */
494 debug ("inside the mem 64 case, count %d\n", count);
495 count += 1;
497 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0x00000000);
503 len[count] = bar[count] & 0xFFFFFFF0;
504 len[count] = ~len[count] + 1;
506 debug ("len[count] in Mem %x, count %d\n", len[count], count);
508 mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
509 if (!mem[count]) {
513 mem[count]->type = MEM;
514 mem[count]->busno = func->busno;
515 mem[count]->devfunc = PCI_DEVFN(func->device,
517 mem[count]->len = len[count];
518 if (ibmphp_check_resource (mem[count], 0) == 0) {
519 ibmphp_add_resource (mem[count]);
520 func->mem[count] = mem[count];
523 func->busno, func->device, len[count]);
524 kfree (mem[count]);
527 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->mem[count]->start);
529 debug ("b4 writing, start address is %x\n", func->mem[count]->start);
530 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
531 debug ("after writing, the address is %x\n", bar[count]);
534 if (bar[count] & PCI_BASE_ADDRESS_MEM_TYPE_64) {
536 debug ("inside mem 64 case, reg. mem, count %d\n", count);
537 count += 1;
539 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0x00000000);
566 int count;
652 for (count = 0; address[count]; count++) { /* for 2 BARs */
653 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFF);
654 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
656 if (!bar[count]) {
658 debug ("so we come here then, eh?, count = %d\n", count);
661 // tmp_bar = bar[count];
663 debug ("Bar %d wants %x\n", count, bar[count]);
665 if (bar[count] & PCI_BASE_ADDRESS_SPACE_IO) {
667 len[count] = bar[count] & 0xFFFFFFFC;
668 len[count] = ~len[count] + 1;
670 debug ("len[count] in IO = %x\n", len[count]);
672 bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
674 if (!bus_io[count]) {
679 bus_io[count]->type = IO;
680 bus_io[count]->busno = func->busno;
681 bus_io[count]->devfunc = PCI_DEVFN(func->device,
683 bus_io[count]->len = len[count];
684 if (ibmphp_check_resource (bus_io[count], 0) == 0) {
685 ibmphp_add_resource (bus_io[count]);
686 func->io[count] = bus_io[count];
689 func->busno, func->device, len[count]);
690 kfree (bus_io[count]);
694 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->io[count]->start);
698 if (bar[count] & PCI_BASE_ADDRESS_MEM_PREFETCH) {
700 len[count] = bar[count] & 0xFFFFFFF0;
701 len[count] = ~len[count] + 1;
703 debug ("len[count] in PFMEM = %x\n", len[count]);
705 bus_pfmem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
706 if (!bus_pfmem[count]) {
711 bus_pfmem[count]->type = PFMEM;
712 bus_pfmem[count]->busno = func->busno;
713 bus_pfmem[count]->devfunc = PCI_DEVFN(func->device,
715 bus_pfmem[count]->len = len[count];
716 bus_pfmem[count]->fromMem = 0;
717 if (ibmphp_check_resource (bus_pfmem[count], 0) == 0) {
718 ibmphp_add_resource (bus_pfmem[count]);
719 func->pfmem[count] = bus_pfmem[count];
728 mem_tmp->busno = bus_pfmem[count]->busno;
729 mem_tmp->devfunc = bus_pfmem[count]->devfunc;
730 mem_tmp->len = bus_pfmem[count]->len;
733 bus_pfmem[count]->fromMem = 1;
734 bus_pfmem[count]->rangeno = mem_tmp->rangeno;
735 ibmphp_add_pfmem_from_mem (bus_pfmem[count]);
736 func->pfmem[count] = bus_pfmem[count];
739 func->busno, func->device, len[count]);
741 kfree (bus_pfmem[count]);
746 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->pfmem[count]->start);
748 if (bar[count] & PCI_BASE_ADDRESS_MEM_TYPE_64) {
750 count += 1;
752 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0x00000000);
757 len[count] = bar[count] & 0xFFFFFFF0;
758 len[count] = ~len[count] + 1;
760 debug ("len[count] in Memory is %x\n", len[count]);
762 bus_mem[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
763 if (!bus_mem[count]) {
768 bus_mem[count]->type = MEM;
769 bus_mem[count]->busno = func->busno;
770 bus_mem[count]->devfunc = PCI_DEVFN(func->device,
772 bus_mem[count]->len = len[count];
773 if (ibmphp_check_resource (bus_mem[count], 0) == 0) {
774 ibmphp_add_resource (bus_mem[count]);
775 func->mem[count] = bus_mem[count];
778 func->busno, func->device, len[count]);
779 kfree (bus_mem[count]);
783 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->mem[count]->start);
785 if (bar[count] & PCI_BASE_ADDRESS_MEM_TYPE_64) {
787 count += 1;
789 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0x00000000);
810 for (count = 0; address[count]; count++) {
812 if (bus_io[count]) {
813 ibmphp_remove_resource (bus_io[count]);
814 func->io[count] = NULL;
815 } else if (bus_pfmem[count]) {
816 ibmphp_remove_resource (bus_pfmem[count]);
817 func->pfmem[count] = NULL;
818 } else if (bus_mem[count]) {
819 ibmphp_remove_resource (bus_mem[count]);
820 func->mem[count] = NULL;
1078 int count, len[6];
1141 for (count = 0; address[count]; count++) {
1144 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, address[count], &tmp);
1146 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFD);
1148 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFF);
1150 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFF);
1151 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
1153 debug ("what is bar[count]? %x, count = %d\n", bar[count], count);
1155 if (!bar[count]) /* This BAR is not implemented */
1158 //tmp_bar = bar[count];
1160 debug ("count %d device %x function %x wants %x resources\n", count, device, function, bar[count]);
1162 if (bar[count] & PCI_BASE_ADDRESS_SPACE_IO) {
1164 len[count] = bar[count] & 0xFFFFFFFC;
1165 len[count] = ~len[count] + 1;
1166 amount->io += len[count];
1169 if (bar[count] & PCI_BASE_ADDRESS_MEM_PREFETCH) {
1171 len[count] = bar[count] & 0xFFFFFFF0;
1172 len[count] = ~len[count] + 1;
1173 amount->pfmem += len[count];
1174 if (bar[count] & PCI_BASE_ADDRESS_MEM_TYPE_64)
1176 count += 1;
1180 len[count] = bar[count] & 0xFFFFFFF0;
1181 len[count] = ~len[count] + 1;
1182 amount->mem += len[count];
1183 if (bar[count] & PCI_BASE_ADDRESS_MEM_TYPE_64) {
1185 count += 1;
1226 int count;
1247 for (count = 0; address[count]; count++) { /* for 6 BARs */
1248 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &start_address);
1252 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFF);
1253 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &size);
1254 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], start_address);
1260 debug ("is this bar no implemented?, count = %d\n", count);
1324 count += 1;
1334 int count;
1383 for (count = 0; address[count]; count++) {
1385 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &start_address);
1436 count += 1;
1570 int count;
1593 count = 2;
1595 count = 6;
1598 for (i = 0; i < count; i++) {