You can see that for the ath9k driver (actually for any driver..) there are at least 2 versions of the same file. One is in "backports" folder and the other is in "linux-5*" folder. There are obviously differences.
So simple question - which one should I patch if I want to, considering that the patch will be applied during build as usual (and resides in the package patches folder for the specific driver/feature).
The thing is that in for example /openwrt/package/kernel/mac80211/patches/ath9k/111-whatever.patch
As I reviewed the other patches they follow this scheme --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c
Which means that it is already pointing somewhere from the mentioned files and I don't know where (and it is preconfigured).
And by your answer I get that this unknown (for me) probably variable/constant is set to either patches,backports,hacks excluding the chance that it is pointing to kernel folder?
That's what I needed to know.
So "--- a" in the patches is actually the backport folder / source. And that answers the 2nd question that there's somewhere a setting (inclusion path) of the image builder which is configured that "--- a" is backports.
Well there's relative path after "--a" (or "--b" it doesn't matter). So the question was where does the "a" (or "b") files relate to. And I got that's always the backports folder (at least for WiFi drivers).
Of course I still don't know where is the variable in order to have "relative" path and how it is chosen. But anyway you helped for this specific case