Have you been upfront with them about the problems? If so it could be a little more tricky. Depression is covered under the DDA, but if they don't know about it, then how are they supposed to support you? Its time to be open and upfront about things. If they do know about the problems, and the extent of them, then it does amount to discrimination. It doesn't matter how long you've been there. If they don't know, it can hardly be called discrimination if, to the best of their knowledge, there isn't a big problem apart from you being ill a lot.
You need to have a conversation with your boss about things and about how best to support you. If you do get fired, then it amounts to disability discrimination and you could take it further