Sounds like a yeast infection to me-foul odor, shaking his head, scratching, waxy gunk. Have you had him out in the water lately? If it was ear mites the 'gunk' would look like similar to coffee grinds. Incase they didn't tell ya when you made the appointment, it's best not to clean the ears the night before or the day of your appointment. That way they will get a good sample when they do the swab and look at it under the microscope. Usually like Zoom said you get a medicated ear ointment and/or cleanser that you do daily until the infection has cleared up, where I am at it's called Mometamax.