How to fix Xperia SL WiFi error? slider is grayed out and it won't recognize networks

A

AC Question

Hello guys, last week my Xperia SL started having this error.

In some occassions, it will activate the WiFi itself attempting to connect to a network and I was unable to stop it, causing the phone to discharge very quickly. In other cases, the WiFi would turn on normally but it wouldn't recognize available connections. And most of the time the slider button will be grayed out and I was unable to turn it on or off and it had a message saying "Turning WiFi on..."

I've read Google results for hours but I can't find a tutorial on how to fix it and what is the recommended software to use. I hope that you can help me out.

Thanks!!