Undefined std_logic_vector size parameter in procedure
This seems to work. I was confused because not mentioning x downto x coded the vector LSB first instead of MSB first as intended in my first snippet of code. It is that easy. 

procedure spi_transfer(data : std_logic_vector) is 
variable bitCnt : integer := 0;
begin
    spi_clk &lt;= '0';
    spi_mosi &lt;= 'Z';
    spi_ss &lt;= '0';
    wait until rising_edge(clk);

    for i in data'range loop
       wait for SPI_CLK_PERIOD/2;
       spi_clk &lt;= '1';
       spi_mosi &lt;= data(i);
       wait for SPI_CLK_PERIOD/2;
       spi_clk &lt;= '0';
    end loop;

    spi_clk &lt;= '0';
    wait until rising_edge(clk);
    spi_ss &lt;= '1';
    spi_mosi &lt;= 'Z';
end spi_transfer;