With the development of wireless technology, users not only have wireless access to the Internet, but this has also sparked the emergence of Wireless Ad-hoc Networks (WANETs); this promising networking paradigm has the potential to adopt the shape of new emergent networks such as the Internet of Things (IoT), Vehicular Ad-hoc Networks (VANET) and Wireless Sensor Networks (WSN). However, channel contention (CC) is one of the key reasons why the TCP performs poorly in WANETs. This paper presents a mechanism called Cross-layer Solution for Contention Control (CSCC) to enhance TCP performance in WANETs. Each node starts marking packets in the proposed mechanism when its CC level reaches a certain threshold. As a result, the source node adjusts the congestion window (cwnd) size to a good state to control the insertion ratio of packets into the network. To provide a fair share to each flow, the flow having a large cwnd is penalized more. Numerous simulations have been conducted across several topologies to clarify the performance of the suggested mechanism. The simulation findings show that, in the presence of the Ad-hoc On-demand Distance Vector (AODV) routing and Dynamic Source Routing (DSR) protocols, the proposed CSCC mechanism outperformed TCP NewReno in terms of throughput and fairness. In comparison to TCP NewReno, the suggested mechanism has fewer retransmitted packets.