diff --git a/doc/funcref b/doc/funcref
index fb68ca0..da68656 100644
--- a/doc/funcref
+++ b/doc/funcref
@@ -228,8 +228,130 @@ Description:
This function returns a bitfield describing the capabilities of
the specified subdevice. If there is an error, -1 is returned,
and the Comedilib error value is set.
-
- XXX table.
+
+
+ subdevice flags
+
+
+
+ Subdevice Flag
+ Value (hexadecimal)
+ Description
+
+
+
+
+ SDF_BUSY
+ 0x1
+ The subdevice is busy performing an asynchronous command. A subdevice being "busy"
+ is slightly different from the "running" state flagged by SDF_RUNNING. A "running" subdevice
+ is always "busy", but a "busy" subdevice is not necessarily "running". For example, suppose an
+ analog input command has been completed by the hardware, but there are still samples in
+ Comedi's buffer waiting to be read out. In this case, the subdevice is not "running", but
+ is still "busy" until all the samples are read out or comedi_cancel() is called.
+
+
+ SDF_BUSY_OWNER
+ 0x2
+ The subdevice is "busy", and the command it is running was started by the current process.
+
+
+ SDF_LOCKED
+ 0x4
+ The subdevice has been locked by comedi_lock().
+
+
+ SDF_LOCK_OWNER
+ 0x8
+ The subdevice is locked, and was locked by the current process.
+
+
+ SDF_MAXDATA
+ 0x10
+ The maximum data value for the subdevice depends on the channel.
+
+
+ SDF_FLAGS
+ 0x20
+ The subdevice flags depend on the channel (unfinished/broken support in library).
+
+
+ SDF_RANGETYPE
+ 0x40
+ The range type depends on the channel.
+
+
+ SDF_CMD
+ 0x1000
+ The subdevice supports asynchronous commands.
+
+
+ SDF_READABLE
+ 0x10000
+ The subdevice can be read (e.g. analog input).
+
+
+ SDF_WRITABLE
+ 0x20000
+ The subdevice can be written to (e.g. analog output).
+
+
+ SDF_INTERNAL
+ 0x40000
+ The subdevice does not have externally visible lines.
+
+
+ SDF_GROUND
+ 0x100000
+ The subdevice supports AREF_GROUND.
+
+
+ SDF_COMMON
+ 0x200000
+ The subdevice supports AREF_COMMON.
+
+
+ SDF_DIFF
+ 0x400000
+ The subdevice supports AREF_DIFF.
+
+
+ SDF_OTHER
+ 0x800000
+ The subdevice supports AREF_OTHER
+
+
+ SDF_DITHER
+ 0x1000000
+ The subdevice supports dithering (via the CR_ALT_FILTER chanspec flag).
+
+
+ SDF_DEGLITCH
+ 0x2000000
+ The subdevice supports deglitching (via the CR_ALT_FILTER chanspec flag).
+
+
+ SDF_RUNNING
+ 0x8000000
+ An asynchronous command is running. You can use this flag to poll for the completion of an
+ output command.
+
+
+ SDF_LSAMPL
+ 0x10000000
+ The subdevice uses the 32 bit lsampl_t type instead of the 16 bit sampl_t for
+ asynchronous command data.
+
+
+ SDF_PACKED
+ 0x20000000
+ The subdevice uses bitfield samples for asynchronous command data,
+ one bit per channel (otherwise it uses
+ one sampl_t or lsampl_t per channel). Commonly used for digital subdevices.
+
+
+
+
Function: comedi_get_n_channels -- number of subdevice channels
Retval: int