How is mental illness understood, analyzed, and potentially treated from the perspective of sociology?

How is mental illness understood, analyzed, and potentially treated from the perspective of sociology? How do ideas, practices, and values come into being, gain meaning and significance, get reproduced, and undergo transformations relative to mental illness? How do certain social ideas and practices both reflect and reinforce the social structures of which they form a part?