---
name: "cmx"
section: "4freebsd"
platform: "linux"
package: "freebsd-manpages"
version: "12.2-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cmx"
---

# cmx(4freebsd)

Omnikey CardMan 4040 smartcard reader device driver

## NAME

**cmx** – Omnikey CardMan 4040 smartcard reader device driver

## SYNOPSIS

**device** **cmx**

## DEPRECATION NOTICE

This driver is scheduled for removal prior to the release of FreeBSD 13.0

## DESCRIPTION

The **cmx** driver provides support for the PCCARD based *Omnikey* *CardMan* *4040* smartcard reader. The driver provides a character device special file based *Chip/Smart* *Card* *Interface* *Devices* *(CCID)* interface. The driver implements what the vendor calls the *Synchronous* *API* onto the smartcard reader device.

Reading and writing is synchronous, meaning that a call to [write(2)](/write/2.md) directly corresponds to a complete CCID command sent to the device, while the following [read(2)](/read/2.md) will return the complete answer from the reader. There is no support for partial reads or writes. There is no upper limit on CCID request or response sizes, but the complete CCID request must be sent to the driver in [write(2)](/write/2.md) and the complete CCID response must fit into the buffer supplied to [read(2)](/read/2.md).

Non-blocking I/O, [select(2)](/select/2.md) and [poll(2)](/poll/2.md) are supported and work as expected. An open file descriptor will always be ready for writing, but only ready for reading if the device indicates that it has data available.

## FILES

- */dev/cmx**n***

  Character device special file.

- */usr/ports/security/openct*

  OpenCT, a userspace smartcard daemon containing a *CCID* driver which directly supports **cmx** devices.

## COMPATIBILITY

Userland smartcard code written for the vendor's Linux drivers should work with the **cmx** driver without modification.

## SEE ALSO

[pccard(4)](/pccard/4.md)

## HISTORY

The **cmx** driver first appeared in FreeBSD 7.1.

## AUTHORS

The **cmx** driver was written by Daniel Roethlisberger ⟨*daniel@roe.ch*⟩, originally based on the Linux driver v1.1.0 by Omnikey GmbH **www.omnikey.com**. Early testing and bug fixes by Marcin Cieslak ⟨*saper@system.pl*⟩.

## BUGS

The way the **cmx** driver talks to the CardMan 4040 is a bit rough. Due to the complete lack of hardware documentation other than vendor drivers for other operating systems, the gory details of the device's I/O registers are not understood very well. There may be error conditions which can only be solved by physically reinserting the reader.
