ctl_util.c (268353) | ctl_util.c (269587) |
---|---|
1/*- 2 * Copyright (c) 2003 Silicon Graphics International Corp. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 */ 32/* 33 * CAM Target Layer SCSI library 34 * 35 * Author: Ken Merry <ken@FreeBSD.org> 36 */ 37 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003 Silicon Graphics International Corp. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 */ 32/* 33 * CAM Target Layer SCSI library 34 * 35 * Author: Ken Merry <ken@FreeBSD.org> 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_util.c 268353 2014-07-07 03:10:56Z mav $"); | 39__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_util.c 269587 2014-08-05 15:01:30Z mav $"); |
40 41#ifdef _KERNEL 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> 45#include <sys/types.h> 46#include <sys/malloc.h> 47#else /* __KERNEL__ */ --- 292 unchanged lines hidden (view full) --- 340 ctsio->ext_data_ptr = data_ptr; 341 ctsio->ext_data_len = data_len; 342 ctsio->ext_sg_entries = 0; 343 ctsio->ext_data_filled = 0; 344 ctsio->sense_len = SSD_FULL_SIZE; 345} 346 347void | 40 41#ifdef _KERNEL 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> 45#include <sys/types.h> 46#include <sys/malloc.h> 47#else /* __KERNEL__ */ --- 292 unchanged lines hidden (view full) --- 340 ctsio->ext_data_ptr = data_ptr; 341 ctsio->ext_data_len = data_len; 342 ctsio->ext_sg_entries = 0; 343 ctsio->ext_data_filled = 0; 344 ctsio->sense_len = SSD_FULL_SIZE; 345} 346 347void |
348ctl_scsi_write_same(union ctl_io *io, uint8_t *data_ptr, uint32_t data_len, 349 uint8_t byte2, uint64_t lba, uint32_t num_blocks, 350 ctl_tag_type tag_type, uint8_t control) 351{ 352 struct ctl_scsiio *ctsio; 353 struct scsi_write_same_16 *cdb; 354 355 ctl_scsi_zero_io(io); 356 357 io->io_hdr.io_type = CTL_IO_SCSI; 358 ctsio = &io->scsiio; 359 ctsio->cdb_len = sizeof(*cdb); 360 cdb = (struct scsi_write_same_16 *)ctsio->cdb; 361 cdb->opcode = WRITE_SAME_16; 362 cdb->byte2 = byte2; 363 scsi_u64to8b(lba, cdb->addr); 364 scsi_ulto4b(num_blocks, cdb->length); 365 cdb->group = 0; 366 cdb->control = control; 367 368 io->io_hdr.io_type = CTL_IO_SCSI; 369 io->io_hdr.flags = CTL_FLAG_DATA_OUT; 370 ctsio->tag_type = tag_type; 371 ctsio->ext_data_ptr = data_ptr; 372 ctsio->ext_data_len = data_len; 373 ctsio->ext_sg_entries = 0; 374 ctsio->ext_data_filled = 0; 375 ctsio->sense_len = SSD_FULL_SIZE; 376} 377 378void |
|
348ctl_scsi_read_capacity(union ctl_io *io, uint8_t *data_ptr, uint32_t data_len, 349 uint32_t addr, int reladr, int pmi, 350 ctl_tag_type tag_type, uint8_t control) 351{ 352 struct scsi_read_capacity *cdb; 353 354 ctl_scsi_zero_io(io); 355 --- 489 unchanged lines hidden --- | 379ctl_scsi_read_capacity(union ctl_io *io, uint8_t *data_ptr, uint32_t data_len, 380 uint32_t addr, int reladr, int pmi, 381 ctl_tag_type tag_type, uint8_t control) 382{ 383 struct scsi_read_capacity *cdb; 384 385 ctl_scsi_zero_io(io); 386 --- 489 unchanged lines hidden --- |