Referred pain from tonsils to the middle ear is along the -
Nerve supply of tonsils 

Lesser palatine branches of sphenopalatine ganglion and glossopharyngeal nerve provide sensory nerve supply to the tonsils.
Glossopharyngeal nerve also gives sensory supply to middle ear (through tympanic plexus). Therefore, pain from the tonsils can be referred to middle ear along glossopharyngeal nerve.
Vagus nerve
Glossopharyngeal nerve
Auriculotemporal nerve
Greater auricular nerve