Skip to content

Linux Kernel Driver

The dvb_usb_gp8psk module is a Linux kernel DVB-USB driver supporting multiple Genpix satellite receiver models. It communicates with the FX2 microcontroller via USB vendor control requests to manage tuning, demodulation, LNB control, DiSEqC switching, and transport stream capture.

Source files: drivers/media/usb/dvb-usb/gp8psk.c, gp8psk.h, gp8psk-fe.c

USB IDDevice Namecold_idswarm_idsFW01 Needed?
v09C0p0200Rev.1 ColdYesYes
v09C0p0201Rev.1 WarmYesNo (FW02 needed)
v09C0p0202Rev.2YesNo
v09C0p0203SkyWalker-1YesNo
v09C0p0204SkyWalker-1 (alt)YesNo
v09C0p0206SkyWalker CW3KYesNo

The driver consists of three source files:

FilePurpose
gp8psk.cUSB device management, firmware loading, power control, vendor command wrappers
gp8psk.hVendor command constants, firmware version thresholds, USB PID definitions
gp8psk-fe.cDVB frontend implementation: tuning, signal monitoring, LNB/DiSEqC callbacks

The driver registers with the DVB-USB framework (dvb_usb_device_properties) which handles:

  • USB device enumeration and firmware download (for cold devices)
  • DVB adapter and frontend creation
  • URB management for bulk transport stream capture
  • Power management callbacks
Driver USB configuration
gp8psk_properties {
.usb_ctrl = CYPRESS_FX2;
.firmware = "dvb-usb-gp8psk-01.fw";
.num_adapters = 1;
.generic_bulk_ctrl_endpoint = 0x01;
// Streaming:
.endpoint = 0x82; // IN bulk
.stream = USB_BULK;
.count = 7; // URBs
.buffersize = 8192; // bytes per URB
}

The driver allocates 7 URBs of 8192 bytes each (56 KB total) for transport stream reception on endpoint 0x82 (IN bulk). Vendor commands use endpoint 0x01 with a 2000 ms timeout.

IN operations retry up to 3 times if partial data is received. The command buffer is 80 bytes maximum:

Vendor command wrapper
static int gp8psk_usb_in_op(struct dvb_usb_device *d,
u8 req, u16 value, u16 index, u8 *b, int blen)
{
int ret;
int try;
for (try = 0; try < 3; try++) {
ret = usb_control_msg(d->udev,
usb_rcvctrlpipe(d->udev, 0),
req, USB_TYPE_VENDOR | USB_DIR_IN,
value, index, b, blen, 2000);
if (ret == blen) break;
}
return ret;
}
CmdNameDirwValuewLengthPurpose
0x80GET_8PSK_CONFIGIN0x00001Read config status byte
0x81SET_8PSK_CONFIGOUTvaries0STALL (not implemented)
0x83I2C_WRITEOUTdev_addrNWrite to BCM4500 via I2C
0x84I2C_READINdev_addrNRead from BCM4500 via I2C
0x85ARM_TRANSFEROUT0/10Start/stop TS streaming
0x86TUNE_8PSKOUT0x000010Send tuning parameters
0x87GET_SIGNAL_STRENGTHIN0x00006Read SNR values
0x88LOAD_BCM4500OUT10Initiate demod FW download
0x89BOOT_8PSKIN0/11Power on/off demodulator
0x8ASTART_INTERSILIN0/11Enable/disable LNB supply
0x8BSET_LNB_VOLTAGEOUT0/10Set 13V (0) or 18V (1)
0x8CSET_22KHZ_TONEOUT0/10Enable/disable 22 kHz tone
0x8DSEND_DISEQCOUTmsg[0]3-6Send DiSEqC message
0x8ESET_DVB_MODEOUT10Enable DVB-S mode
0x8FSET_DN_SWITCHOUTcmd0Legacy Dish switch command
0x90GET_SIGNAL_LOCKIN0x00001Read lock status
0x92GET_FW_VERSIN0x00006Read firmware version
0x94USE_EXTRA_VOLTOUT0/10Enable +1V LNB boost
0x95GET_FPGA_VERSIN0x00001Read hardware platform ID
0x99GET_DEMOD_STATUSIN0x00001Read BCM4500 reg 0xF9 (v2.13+)
0x9AINIT_DEMODOUT0x00000Re-init demodulator (v2.13+)
0x9CDELAY_COMMANDOUTparam0Tuning delay with polling (v2.13+)
0x9DCW3K_INITOUT0/10CW3K model initialization

GET_8PSK_CONFIG (0x80) returns a bit-mapped status register:

Bit 0 (0x01): bm8pskStarted - Device booted and running
Bit 1 (0x02): bm8pskFW_Loaded - BCM4500 firmware loaded
Bit 2 (0x04): bmIntersilOn - LNB power supply enabled
Bit 3 (0x08): bmDVBmode - DVB mode enabled
Bit 4 (0x10): bm22kHz - 22 kHz tone active
Bit 5 (0x20): bmSEL18V - 18V LNB voltage selected
Bit 6 (0x40): bmDCtuned - DC offset tuning complete
Bit 7 (0x80): bmArmed - MPEG-2 stream transfer armed
  1. Read config (GET_8PSK_CONFIG 0x80): Check bit 0 (bm8pskStarted)

  2. Boot device if not started: Send BOOT_8PSK 0x89 with wValue=1, then read firmware version via GET_FW_VERS 0x92

  3. Load BCM4500 firmware if bit 1 not set: Only for Rev.1 Warm (PID 0x0201). Send LOAD_BCM4500 0x88 followed by firmware chunks. Skipped for SkyWalker-1 (bit already set from EEPROM boot).

  4. Enable LNB if bit 2 not set: Send START_INTERSIL 0x8A with wValue=1

  5. Set DVB mode: Send SET_DVB_MODE 0x8E with wValue=1 (STALL on some revisions)

  6. Cancel pending stream: Send ARM_TRANSFER 0x85 with wValue=0

  7. Ready for tuning

10-byte tuning payload
Bytes 0-3: Symbol Rate (u32 LE, in sps)
Bytes 4-7: Frequency (u32 LE, in kHz)
Byte 8: Modulation (0-9, see modulation types)
Byte 9: FEC Rate (index into firmware FEC table)
ValueConstantMode
0ADV_MOD_DVB_QPSKDVB-S QPSK
1ADV_MOD_TURBO_QPSKTurbo QPSK
2ADV_MOD_TURBO_8PSKTurbo 8PSK
3ADV_MOD_TURBO_16QAMTurbo 16QAM
4ADV_MOD_DCII_C_QPSKDigicipher II Combo
5ADV_MOD_DCII_I_QPSKDigicipher II I-stream
6ADV_MOD_DCII_Q_QPSKDigicipher II Q-stream
7ADV_MOD_DCII_C_OQPSKDigicipher II Offset QPSK
8ADV_MOD_DSS_QPSKDSS/DIRECTV QPSK
9ADV_MOD_DVB_BPSKDVB-S BPSK

GET_SIGNAL_STRENGTH (0x87) returns 6 bytes:

Bytes 0-1: SNR value (u16 LE, in dBu*256 units)
Bytes 2-5: Reserved / diagnostics

SNR scaling in the kernel: snr_value * 17 maps to the 0—65535 range. 100% signal quality corresponds to SNR >= 0x0F00.

The driver defines two version constants in gp8psk-fe.h:

Firmware version thresholds
#define GP8PSK_FW_REV1 0x020604 // v2.06.4
#define GP8PSK_FW_REV2 0x020704 // v2.07.4

Oldest firmware. No extended commands available.

Not all vendor commands work on all firmware versions. The STALL behavior varies:

Commandv2.06 FWv2.13 FWRev.2 FWCustom v3.01
0x80 GET_8PSK_CONFIGOKOKOKOK
0x86 TUNE_8PSKOKOKOKOK
0x87 GET_SIGNAL_STRENGTHOKChangedOKOK
0x88 LOAD_BCM4500STALLSTALLSTALLSTALL
0x99 GET_DEMOD_STATUSSTALLOKProtoN/A
0x9A INIT_DEMODSTALLOKProtoN/A
0x9C DELAY_COMMANDSTALLOKN/AN/A

The gp8psk module inherits standard DVB-USB parameters:

ParameterDefaultDescription
debug0Enable debug logging (bitmask)
force_pid_filter0Force PID filtering on/off
generic_bulk_ctrl_endpoint0x01Control endpoint

Enable verbose logging with:

Terminal window
modprobe dvb_usb_gp8psk debug=0xff

Or at runtime:

Terminal window
echo 0xff > /sys/module/dvb_usb_gp8psk/parameters/debug

The gp8psk frontend (gp8psk-fe.c) registers with the following capabilities:

Frontend info structure
.name = "Genpix 8psk-to-USB2 DVB-S"
.frequency_min_hz = 800 * MHz
.frequency_max_hz = 2250 * MHz
.frequency_stepsize_hz = 100 * kHz
.symbol_rate_min = 256000 // 256 Ksps
.symbol_rate_max = 30000000 // 30 Msps
.caps = FE_CAN_INVERSION_AUTO |
FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 |
FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 |
FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_QPSK