sgset(D3X)sgset(D3X)NAMEsgset - assign physical addresses to a vector of software scatter-gather
registers
SYNOPSIS
#include "sys/types.h"
#include "sys/buf.h"
#include "sys/sg.h"
sgset(struct buf *bp, struct sg *vec, int maxvec, int *resid);
DESCRIPTIONsgset provides a utility to manage a software equivalent of scatter-
gather registers for devices that do not implement them. Based on the
information provided in the buf type structure pointed to by bp, this
routine fills in maxvec entries of a scatter-gather vector vec. If the
number of vectors required to perform the transfer exceeds maxvec, the
contents of resid is set to the number of pages remaining.
The buffer must not be for mapped address (B_PAGEIO for buf(40) not set).
The scatter gather entries are formatted in the following structure,
excerpted from sys/sg.h:
struct sg {
unsigned long sg_ioaddr; /* physical addrs of page */
unsigned long sg_bcount; /* byte count of transfer */
};
Return Values
The number of vector entries used.
Page 1