Which command did you run to get that info?
About Wi-Fi disconnecting, others have reported that it helped to change “bandwidth” setting on the router to 20 Mhz, see for example here:
Maybe the “w 40 MHz” in your terminal output indicates you have bandwidth 40 MHz, if it is possible for you to change that from 40 to 20 MHz then that might be worth trying.