Chapter 3. SCSI mid layer
Prev |  | Next

# Chapter 3. SCSI mid layer

## SCSI midlayer implementation

### include/scsi/scsi_device.h

### drivers/scsi/scsi.c

Main file for the SCSI midlayer.

### drivers/scsi/scsicam.c

SCSI Common Access Method support functions, for use with HDIO_GETGEO, etc.

### drivers/scsi/scsi_error.c

Common SCSI error/timeout handling routines.

### drivers/scsi/scsi_devinfo.c

Manage scsi_dev_info_list, which tracks blacklisted and whitelisted devices.

### drivers/scsi/scsi_ioctl.c

Handle ioctl() calls for SCSI devices.

### drivers/scsi/scsi_lib.c

SCSI queuing library.

### drivers/scsi/scsi_lib_dma.c

SCSI library functions depending on DMA (map and unmap scatter-gather lists).

### drivers/scsi/scsi_module.c

The file drivers/scsi/scsi_module.c contains legacy support for old-style host templates. It should never be used by any new driver.

### drivers/scsi/scsi_proc.c

The functions in this file provide an interface between the PROC file system and the SCSI device drivers It is mainly used for debugging, statistics and to pass information directly to the lowlevel driver. I.E. plumbing to manage /proc/scsi/*

### drivers/scsi/scsi_netlink.c

Infrastructure to provide async events from transports to userspace via netlink, using a single NETLINK_SCSITRANSPORT protocol for all transports. See the original patch submission for more details.

### drivers/scsi/scsi_scan.c

Scan a host to determine which (if any) devices are attached. The general scanning/probing algorithm is as follows, exceptions are made to it depending on device specific flags, compilation options, and global variable (boot or module load time) settings. A specific LUN is scanned via an INQUIRY command; if the LUN has a device attached, a scsi_device is allocated and setup for it. For every id of every channel on the given host, start by scanning LUN 0. Skip hosts that don't respond at all to a scan of LUN 0. Otherwise, if LUN 0 has a device attached, allocate and setup a scsi_device for it. If target is SCSI-3 or up, issue a REPORT LUN, and scan all of the LUNs returned by the REPORT LUN; else, sequentially scan LUNs up until some maximum is reached, or a LUN is seen that cannot have a device attached to it.

### drivers/scsi/scsi_sysctl.c

Set up the sysctl entry: "/dev/scsi/logging_level" (DEV_SCSI_LOGGING_LEVEL) which sets/returns scsi_logging_level.

### drivers/scsi/scsi_sysfs.c

SCSI sysfs interface routines.

### drivers/scsi/hosts.c

mid to lowlevel SCSI driver interface

### drivers/scsi/constants.c

mid to lowlevel SCSI driver interface

Prev |  | Next
ch (SCSI Media Changer) | Home | shost_for_each_device