I think there is no end to Afghan war under present circumstances as the American themselves do not know what they are doing in Afghanistan after Osama Bin Laden and Mullah Omar are dead.
The point is, from one perspective it looks like the war has ended, from another it looks like the war has just began.
America achieved her goal in both Iraq and Afghanistan and now only there in Afghanistan to raise Afghan Army besides some general duties of law and order. But from another perspective Russia was awaiting for Americans to spend all their resources they were willing to do and wait until they start tiring up. Now after the Americans have spent 4.8 trillion USD in Afghanistan and Iraq and countries like UK spending billions of dollars (37 billion British Pound in Afghanistan alone) have clearly indicated that they will not participate in any nonsensical war in future, the russians and Iranians have apparently started flexing their muscles to keep them engaged in Afghanistan.
The Afghan government is also confused and continue to blame Pakistan as they have been failed to reduce the number of incidents and Talibans have apparently been never as strong as they look today since the madness began after 9/11.