Automated in band flow control using programmable Xon/Xoff in both directions