The doping mechanism in amorphous silicon