Laptop refuses to connect to 802.11g modem-router1

Devices: Samsung N150 DLINK DSL-2640B modem-router Netgear WNR2000 router Realtek RTL8188CE Mini PCI-E Here’s the story… a friend sold me his laptop for $25, everything works fine, except for the wireless connection, the laptop had Windows 7 installed but it ran horrible, wireless didn’t worked with 7 so I installed Debian 8.7, wireless still not working with my modem-router, drivers are ok, but here’s the thing, my modem has 802.11g and it works because I tried connecting my computer and had no problems, so after hours of trying stuff including checking the modem configuration I plugged in the Netgear router, 802.11n and guess… it works, well, almost, the laptop connects but if it enters sleep mode then I have to disconnect and reconnect the network from the Debian network manager, not a big problem though.