Ionospheric control of magnetotail reconnection