complete wifi host function.