Carbon pricing legislation has been passed by the Australian Senate.