As future Machine-to-Machine (M2M) communications aim at supporting wireless networks with large coverage range and a huge number of devices without human intervention, energy-efficient protocol design for M2M communications networks becomes notably significant. The emerging energy harvesting technology, allowing devices to harvest energy from external sources automatically without human intervention, is promisingly applied to M2M communications networks, which can therefore operate permanently. However, currently available IEEE 802.11 protocols do not consider supporting energy-harvesting devices efficiently. Our research focuses effort in enhancing IEEE 802.11 power saving mode (PSM) with widely-deployed numerous devices powered by energy-harvesting modules so as to realize an energy-efficient M2M communications network. We propose DeepSleep with the aim of improving energy-efficiency and reducing the overall outage probability, application layer loss rate and collision probability. The effectiveness of DeepSleep is demonstrated by NS-2 platform. An analytical model is provided to select DeepSleep parameters. Applying DeepSleep, an energy-harvesting device can have less energy wastage on idle listening and overhearing, and have a higher channel access priority when waking up from a relatively longer period of sleeping. In addition, the channel access fairness is considered in DeepSleep design. In addition, all devices benefit when DeepSleep and 802.11 PSM co-exist in the network, which implies DeepSleep has potential to be deployed in existing WLANs.