How do we install ath9K wifi module?

Thank you for your prompt reply :) I managed to fix it and get it to work.

Your post was very informative and helpful. The most important part, was using nconfig that gave me the clue. When you search for symbols it also shows all necessary information including the dependencies, which in my case was the problem. for some reason, search in xconfig does not tell you anything about the dependencies, or at least that is what I think. nconfig, on the other hand, shows all the information you need, such as what is the dependency and whether it is installed or not. So, after I figured that out, I looked up every feature I needed and selected them for installation and built the image.

Also, I did install ath9k_htc firmware, which is required. You can compile and install it manually from here, GitHub - qca/open-ath9k-htc-firmware: The firmware for QCA AR7010/AR9271 802.11n USB NICs, or you can just do

apt-get install linux-firmware

So to sum up, I built the image with ath9k_htc driver and all dependencies installed, and installed the ath9k_htc firmware.