Lines Matching defs:hdr
33 static void sgio_hdr_init(struct sgio_data *sd, struct sg_io_hdr *hdr,
38 memset(hdr, 0, sizeof(*hdr));
41 hdr->interface_id = 'S';
42 hdr->cmdp = sc->cdb;
43 hdr->cmd_len = sizeof(sc->cdb);
44 hdr->pack_id = io_u->index;
45 hdr->usr_ptr = io_u;
48 hdr->dxferp = io_u->xfer_buf;
49 hdr->dxfer_len = io_u->xfer_buflen;
140 struct sg_io_hdr *hdr = (struct sg_io_hdr *) buf + i;
142 sd->events[i] = hdr->usr_ptr;
163 struct sg_io_hdr *hdr = &io_u->hdr;
168 ret = ioctl(f->fd, SG_IO, hdr);
177 struct sg_io_hdr *hdr = &io_u->hdr;
180 ret = write(f->fd, hdr, sizeof(*hdr));
185 ret = read(f->fd, hdr, sizeof(*hdr));
206 struct sg_io_hdr *hdr = &io_u->hdr;
216 sgio_hdr_init(sd, hdr, io_u, 1);
218 hdr->dxfer_direction = SG_DXFER_FROM_DEV;
219 hdr->cmdp[0] = 0x28;
221 sgio_hdr_init(sd, hdr, io_u, 1);
223 hdr->dxfer_direction = SG_DXFER_TO_DEV;
224 hdr->cmdp[0] = 0x2a;
226 sgio_hdr_init(sd, hdr, io_u, 0);
228 hdr->dxfer_direction = SG_DXFER_NONE;
229 hdr->cmdp[0] = 0x35;
232 if (hdr->dxfer_direction != SG_DXFER_NONE) {
235 hdr->cmdp[2] = (unsigned char) ((lba >> 24) & 0xff);
236 hdr->cmdp[3] = (unsigned char) ((lba >> 16) & 0xff);
237 hdr->cmdp[4] = (unsigned char) ((lba >> 8) & 0xff);
238 hdr->cmdp[5] = (unsigned char) (lba & 0xff);
239 hdr->cmdp[7] = (unsigned char) ((nr_blocks >> 8) & 0xff);
240 hdr->cmdp[8] = (unsigned char) (nr_blocks & 0xff);
248 struct sg_io_hdr *hdr = &io_u->hdr;
260 else if (hdr->status) {
261 io_u->resid = hdr->resid;
284 struct sg_io_hdr *hdr;
291 hdr = &io_u.hdr;
292 sgio_hdr_init(sd, hdr, &io_u, 0);
295 hdr->cmdp[0] = 0x25;
296 hdr->dxfer_direction = SG_DXFER_FROM_DEV;
297 hdr->dxferp = buf;
298 hdr->dxfer_len = sizeof(buf);