On Sun, Mar 12, 2017 at 7:13 PM, Daniel Wagner wrote:
> Currently, when a scan is requested, it is only check if device
> powered. It
> prevents to start scanning or finding if WiFi technology is disabled.
> when WiFi technolgy is enabled but P2P technology is not, the P2P finding
> can be started anyway. This patch prevents it by adding an additional
> on the technology status only in case the technology where scan was
> requested is
> P2P, doing so the return values for WiFi technology will not change.
I re-read this paragraph many times but I don't really understand what the
problem is you try to fix. From the code I can read that if the technology
type is p2p and is !enabled (== disabled) return a permission denied... Ah,
is this check added because we end up at the same D-Bus object for both WiFi
and P2P? And if WiFi is enabled but not P2P we should just return ENOPERM?
That would make sense indeed.
No, the D-Bus objects are different. This check is added because P2P
and WiFi scan end up at the same device and at that level there is not
differentiation between WiFi and P2P, they both are WiFi devices.
Therefore, when device's power is checked in device.c:device_scan(),
it is actually checking only if WiFi technology is enabled thus P2P
scan will go ahead even if P2P technology is not enabled.
I wouldn't mind if you could reword your commit message a bit. It
hard to understand.
Sorry, I will try to explain myself better next time. Is above
explanation better for the commit message?