Name

i2o_dma_map_sg — Map a SG List to controller and fill in I2O message.

Synopsis

int i2o_dma_map_sg (struct i2o_controller *  c,
 struct scatterlist *  sg,
 int  sg_count,
 enum dma_data_direction  direction,
 u32 **  sg_ptr);

Arguments

c

I2O controller

sg

SG list to be mapped

sg_count

number of elements in the SG list

direction

DMA_TO_DEVICE / DMA_FROM_DEVICE

sg_ptr

pointer to the SG list inside the I2O message

Description

This function does all necessary DMA handling and also writes the I2O SGL elements into the I2O message. For details on DMA handling see also dma_map_sg. The pointer sg_ptr will only be set to the end of the SG list if the allocation was successful.

Returns 0 on failure or 1 on success.