[RFC v3 03/13] bcma: add functions to scan cores needed on SoCs

Hauke Mehrtens hauke at hauke-m.de
Thu Jun 30 03:23:11 EDT 2011


On 06/30/2011 08:42 AM, Rafał Miłecki wrote:
> 2011/6/30 Hauke Mehrtens <hauke at hauke-m.de>:
-		err = bcma_get_next_core(bus, &eromptr, core);
-		if (err == -ENXIO)
+		err = bcma_get_next_core(bus, &eromptr, NULL, core_num, core);
+		if (err == -ENODEV) {
+			core_num++;
+			continue;
+		} else if (err == -ENXIO)
 			continue;
 		else if (err == -ESPIPE)
 			break;
 		else if (err < 0)
 			return err;

+		core->core_index = core_num++;
+		bus->nr_cores++;
+
 		pr_info("Core %d found: %s "
 			"(manuf 0x%03X, id 0x%03X, rev 0x%02X, class 0x%X)\n",
-			bus->nr_cores, bcma_device_name(&core->id),
+			core->core_index, bcma_device_name(&core->id),
 			core->id.manuf, core->id.id, core->id.rev,
 			core->id.class);

-		core->core_index = bus->nr_cores++;
> 
> Didn't you just change core indexes (0, 1, ...) to numbers (1, 2,
> ...)? It would break enabling IRQs on PCI.
No, the cores are getting the same indexes numbers as before. While
scanning core_num is increased for every core found also for cores we
are not searching for or we already found. Then core_num will be
assigned to core->core_index. bus->nr_cores is no used any more so it
could be removed or is it needed for something else?

As you can see here [0] it finds core 0 and 3 at first and then the others.
> 
> Didn't test it however yet, I'll have access to my machines tomorrow.
> 

Hauke

[0] http://permalink.gmane.org/gmane.linux.kernel.wireless.general/71851




More information about the b43-dev mailing list