By default, the father of a woman is her wali. In case the father dies, this status will pass to either the grandfather or a brother of the woman - and here I'm already not sure whether a brother by only the same mother but a different father can become wali; similarly, whether the grandfather on the mother's side can become wali. I'm also not sure if only brothers and grandfathers can become the wali of a woman due to being related to her (eventually the state will be her wali if no eligible person is alive), or whether other male relatives will become wali in some order too. Thus my question:
Who will become wali of a woman due to being related to her, and in what order?