Read this and answer the question

Alternatively, or in addition to this practice, the members of an upper house may be indirectly elected by the government or legislature of the component states, as occurred in the United States prior to 1913, or be actual members or delegates of the state governments, as, for example, is the case in the German Bundesrat and in the Council of the European Union. The lower house of a federal legislature is usually directly elected, with apportionment in proportion to population, although states may sometimes still be guaranteed a certain minimum number of seats.

Who can elect the members of the upper house?
government or legislature