In reported questions the subject normally comes before the verb. It is not necessary to use do or did. Question marks are not used in reported questions.
- He said, "When are you leaving?"
- He asked me when I was leaving. (NOT When was I leaving?)
Yes/No questions are reported with if/whether.
- "Do you speak English," she asked him.
- She asked him if he spoke English.