HomeFreeBSD

bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN

Description

bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN

The driver and applications currently use hard-coded numeric ioctl command
opcodes. These opcodes are interpreted as having the IOC_IN direction (data
copied from the user application to the driver), regardless of the actual packet
size. Consequently, when the packet size is zero and the direction is set to
IOC_IN, the kernel fails these ioctls if COMPAT is disabled.

While the driver and applications should ideally set the direction correctly—
for example, using IOC_VOID when the packet size is zero—the driver will now
be updated to define ioctl opcodes using the _IOC macro to support both
IOC_VOID and IOC_IN. This change ensures backward compatibility with older
applications that exclusively use IOC_IN.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D54601
MFC after: 3 days

Details

Provenance
sumit.saxena_broadcom.comAuthored on Jan 9 2026, 10:28 AM
Reviewer
gallatin
Differential Revision
Restricted Differential Revision
Parents
rGa556feb99765: freebsd-base.7: Fix stray -r
Branches
Unknown
Tags
Unknown