Lines Matching refs:hdr
33 static void sgio_hdr_init(struct sgio_data *sd, struct sg_io_hdr *hdr, in sgio_hdr_init() argument
38 memset(hdr, 0, sizeof(*hdr)); in sgio_hdr_init()
41 hdr->interface_id = 'S'; in sgio_hdr_init()
42 hdr->cmdp = sc->cdb; in sgio_hdr_init()
43 hdr->cmd_len = sizeof(sc->cdb); in sgio_hdr_init()
44 hdr->pack_id = io_u->index; in sgio_hdr_init()
45 hdr->usr_ptr = io_u; in sgio_hdr_init()
48 hdr->dxferp = io_u->xfer_buf; in sgio_hdr_init()
49 hdr->dxfer_len = io_u->xfer_buflen; in sgio_hdr_init()
141 struct sg_io_hdr *hdr = (struct sg_io_hdr *) buf + i; in fio_sgio_getevents() local
143 sd->events[i] = hdr->usr_ptr; in fio_sgio_getevents()
164 struct sg_io_hdr *hdr = &io_u->hdr; in fio_sgio_ioctl_doio() local
169 ret = ioctl(f->fd, SG_IO, hdr); in fio_sgio_ioctl_doio()
178 struct sg_io_hdr *hdr = &io_u->hdr; in fio_sgio_rw_doio() local
181 ret = write(f->fd, hdr, sizeof(*hdr)); in fio_sgio_rw_doio()
186 ret = read(f->fd, hdr, sizeof(*hdr)); in fio_sgio_rw_doio()
207 struct sg_io_hdr *hdr = &io_u->hdr; in fio_sgio_prep() local
217 sgio_hdr_init(sd, hdr, io_u, 1); in fio_sgio_prep()
219 hdr->dxfer_direction = SG_DXFER_FROM_DEV; in fio_sgio_prep()
220 hdr->cmdp[0] = 0x28; in fio_sgio_prep()
222 sgio_hdr_init(sd, hdr, io_u, 1); in fio_sgio_prep()
224 hdr->dxfer_direction = SG_DXFER_TO_DEV; in fio_sgio_prep()
225 hdr->cmdp[0] = 0x2a; in fio_sgio_prep()
227 sgio_hdr_init(sd, hdr, io_u, 0); in fio_sgio_prep()
229 hdr->dxfer_direction = SG_DXFER_NONE; in fio_sgio_prep()
230 hdr->cmdp[0] = 0x35; in fio_sgio_prep()
233 if (hdr->dxfer_direction != SG_DXFER_NONE) { in fio_sgio_prep()
236 hdr->cmdp[2] = (unsigned char) ((lba >> 24) & 0xff); in fio_sgio_prep()
237 hdr->cmdp[3] = (unsigned char) ((lba >> 16) & 0xff); in fio_sgio_prep()
238 hdr->cmdp[4] = (unsigned char) ((lba >> 8) & 0xff); in fio_sgio_prep()
239 hdr->cmdp[5] = (unsigned char) (lba & 0xff); in fio_sgio_prep()
240 hdr->cmdp[7] = (unsigned char) ((nr_blocks >> 8) & 0xff); in fio_sgio_prep()
241 hdr->cmdp[8] = (unsigned char) (nr_blocks & 0xff); in fio_sgio_prep()
249 struct sg_io_hdr *hdr = &io_u->hdr; in fio_sgio_queue() local
261 else if (hdr->status) { in fio_sgio_queue()
262 io_u->resid = hdr->resid; in fio_sgio_queue()
285 struct sg_io_hdr *hdr; in fio_sgio_get_bs() local
292 hdr = &io_u.hdr; in fio_sgio_get_bs()
293 sgio_hdr_init(sd, hdr, &io_u, 0); in fio_sgio_get_bs()
296 hdr->cmdp[0] = 0x25; in fio_sgio_get_bs()
297 hdr->dxfer_direction = SG_DXFER_FROM_DEV; in fio_sgio_get_bs()
298 hdr->dxferp = buf; in fio_sgio_get_bs()
299 hdr->dxfer_len = sizeof(buf); in fio_sgio_get_bs()