1/*- 2 * Copyright (c) 2007 Scott Long 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 --- 16 unchanged lines hidden (view full) --- 25 */ 26 27/* 28 * scsi_sg peripheral driver. This driver is meant to implement the Linux 29 * SG passthrough interface for SCSI. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/cam/scsi/scsi_sg.c 183381 2008-09-26 14:19:52Z ed $"); |
34 35#include <sys/param.h> 36#include <sys/systm.h> 37#include <sys/kernel.h> 38#include <sys/types.h> 39#include <sys/bio.h> 40#include <sys/malloc.h> 41#include <sys/fcntl.h> --- 240 unchanged lines hidden (view full) --- 282 283 /* 284 * We pass in 0 for all blocksize, since we don't know what the 285 * blocksize of the device is, if it even has a blocksize. 286 */ 287 cam_periph_unlock(periph); 288 no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0; 289 softc->device_stats = devstat_new_entry("sg", |
290 periph->unit_number, 0, |
291 DEVSTAT_NO_BLOCKSIZE 292 | (no_tags ? DEVSTAT_NO_ORDERED_TAGS : 0), 293 softc->pd_type | 294 DEVSTAT_TYPE_IF_SCSI | 295 DEVSTAT_TYPE_PASS, 296 DEVSTAT_PRIORITY_PASS); 297 298 /* Register the device */ |
299 softc->dev = make_dev(&sg_cdevsw, periph->unit_number, |
300 UID_ROOT, GID_OPERATOR, 0600, "%s%d", 301 periph->periph_name, periph->unit_number); 302 (void)make_dev_alias(softc->dev, "sg%c", 'a' + periph->unit_number); 303 cam_periph_lock(periph); 304 softc->dev->si_drv1 = periph; 305 306 /* 307 * Add as async callback so that we get --- 676 unchanged lines hidden --- |