---
name: "i2o_dma_map_sg"
section: "9"
platform: "linux"
package: "linux-manual-2.6.26"
version: "2.6.26-29"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/i2o_dma_map_sg"
---

# i2o\_dma\_map\_sg(9)

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

## 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.

## COPYRIGHT
