If you have had performance issues due to the depression or missed work, that would allow them to take action against you; even the protection against disability-related discrimination (see below) does not obligate employers to refrain from taking action against employees who cannot or do not do their jobs. However, you indicate that is not the case. If  you have been performing at work, and if you are under a doctor's care for the depression and the employer is aware of that, then demoting you might constitute illegal disability-related discrimination--employers may not take adverse actions against an employee simply because he or she has a medical condition (assuming the condition rises to the level of being considered a "disability," which you depression may). You may wish to contact the federal Equal Employment Opportunity Commission (EEOC) or your state's equal/civil rights division, to see if you have a valid complaint.