---
name: "pass"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/pass/4"
---

# pass(4)

CAM application passthrough driver

## NAME

**pass** – CAM application passthrough driver

## SYNOPSIS

**device** **pass**

## DESCRIPTION

The **pass** driver provides a way for userland applications to issue CAM CCBs to the kernel.

Since the **pass** driver allows direct access to the CAM subsystem, system administrators should exercise caution when granting access to this driver. If used improperly, this driver can allow userland applications to crash a machine or cause data loss.

The **pass** driver attaches to every SCSI and ATA device found in the system. Since it attaches to every device, it provides a generic means of accessing SCSI and ATA devices, and allows the user to access devices which have no "standard" peripheral driver associated with them.

## KERNEL CONFIGURATION

It is only necessary to configure one **pass** device in the kernel; **pass** devices are automatically allocated as SCSI and ATA devices are found.

## IOCTLS

- CAMIOCOMMAND union ccb \*

  This ioctl takes most kinds of CAM CCBs and passes them through to the CAM transport layer for action. Note that some CCB types are not allowed through the passthrough device, and must be sent through the [xpt(4)](/xpt/4.md) device instead. Some examples of xpt-only CCBs are XPT\_SCAN\_BUS, XPT\_DEV\_MATCH, XPT\_RESET\_BUS, XPT\_SCAN\_LUN, XPT\_ENG\_INQ, and XPT\_ENG\_EXEC. These CCB types have various attributes that make it illogical or impossible to service them through the passthrough interface.

  If the user would like the kernel to do error recovery, the CAM\_PASS\_ERR\_RECOVER flag must be set on the CCB, and the retry\_count field set to the number of retries.

- CAMGETPASSTHRU union ccb \*

  This ioctl takes an XPT\_GDEVLIST CCB, and returns the passthrough device corresponding to the device in question. Although this ioctl is available through the **pass** driver, it is of limited use, since the caller must already know that the device in question is a passthrough device if they are issuing this ioctl. It is probably more useful to issue this ioctl through the [xpt(4)](/xpt/4.md) device.

- CAMIOQUEUE union ccb \*

  Queue a CCB to the **pass** driver to be executed asynchronously. The caller may use [select(2)](/select/2.md), [poll(2)](/poll/2.md) or [kevent(2)](/kevent/2.md) to receive notification when the CCB has completed.

  This ioctl takes most CAM CCBs, but some CCB types are not allowed through the pass device, and must be sent through the [xpt(4)](/xpt/4.md) device instead. Some examples of xpt-only CCBs are XPT\_SCAN\_BUS, XPT\_DEV\_MATCH, XPT\_RESET\_BUS, XPT\_SCAN\_LUN, XPT\_ENG\_INQ, and XPT\_ENG\_EXEC. These CCB types have various attributes that make it illogical or impossible to service them through the passthrough interface.

  Although the CAMIOQUEUE ioctl is not defined to take an argument, it does require a pointer to a union ccb. It is not defined to take an argument to avoid an extra malloc and copy inside the generic [ioctl(2)](/ioctl/2.md) handler.

  The completed CCB will be returned via the CAMIOGET ioctl. An error will only be returned from the CAMIOQUEUE ioctl if there is an error allocating memory for the request or copying memory from userland. All other errors will be reported as standard CAM CCB status errors. Since the CCB is not copied back to the user process from the pass driver in the CAMIOQUEUE ioctl, the user's passed-in CCB will not be modified. This is the case even with immediate CCBs. Instead, the completed CCB must be retrieved via the CAMIOGET ioctl and the status examined.

  Multiple CCBs may be queued via the CAMIOQUEUE ioctl at any given time, and they may complete in a different order than the order that they were submitted. The caller must take steps to identify CCBs that are queued and completed. The periph\_priv structure inside struct ccb\_hdr is available for userland use with the CAMIOQUEUE and CAMIOGET ioctls, and will be preserved across calls. Also, the periph\_links linked list pointers inside struct ccb\_hdr are available for userland use with the CAMIOQUEUE and CAMIOGET ioctls and will be preserved across calls.

  If the user would like the kernel to do error recovery, the CAM\_PASS\_ERR\_RECOVER flag must be set on the CCB, and the retry\_count field set to the number of retries.

- CAMIOGET union ccb \*

  Retrieve completed CAM CCBs queued via the CAMIOQUEUE ioctl. An error will only be returned from the CAMIOGET ioctl if the **pass** driver fails to copy data to the user process or if there are no completed CCBs available to retrieve. If no CCBs are available to retrieve, errno will be set to ENOENT.

  All other errors will be reported as standard CAM CCB status errors.

  Although the CAMIOGET ioctl is not defined to take an argument, it does require a pointer to a union ccb. It is not defined to take an argument to avoid an extra malloc and copy inside the generic [ioctl(2)](/ioctl/2.md) handler.

  The pass driver will report via [select(2)](/select/2.md), [poll(2)](/poll/2.md) or [kevent(2)](/kevent/2.md) when a CCB has completed. One CCB may be retrieved per CAMIOGET call. CCBs may be returned in an order different than the order they were submitted. So the caller should use the periph\_priv area inside the CCB header to store pointers to identifying information.

## FILES

- */dev/pass**n*

  Character device nodes for the **pass** driver. There should be one of these for each device accessed through the CAM subsystem.

## DIAGNOSTICS

None.

## SEE ALSO

[kqueue(2)](/kqueue/2.md), [poll(2)](/poll/2.md), [select(2)](/select/2.md), [cam(3)](/cam/3.md), [cam\_cdbparse(3)](/cam_cdbparse/3.md), [cam(4)](/cam/4.md), [cd(4)](/cd/4.md), [ctl(4)](/ctl/4.md), [da(4)](/da/4.md), [sa(4)](/sa/4.md), [xpt(4)](/xpt/4.md), [camcontrol(8)](/camcontrol/8.md), [camdd(8)](/camdd/8.md)

## HISTORY

The CAM passthrough driver first appeared in FreeBSD 3.0.

## AUTHORS

Kenneth Merry ⟨*ken@FreeBSD.org*⟩
