HomeFreeBSD

Add ETHER_ALIGN support to ng_device(4).

Description

Add ETHER_ALIGN support to ng_device(4).

This adds a new ng_device command, NGM_DEVICE_ETHERALIGN, which has no
associated args. After the command arrives, the device begins adjusting all
packets sent out its hook to have ETHER_ALIGN bytes of padding at the
beginning of the packet. The ETHER_ALIGN padding is added only when
running on an architecture that requires strict alignment of IP headers
(based on the __NO_STRICT_ALIGNMENT macro, which is only #define'd on
x86 as of this writing).

This also adds ascii <-> binary command translation to ng_device, both for
the existing NGM_DEVICE_GET_DEVNAME and the new ETHERALIGN command.

This also gives a name to every ng_device node when it is constructed, using
the cdev device name (ngd0, ngd1, etc). This makes it easier to address
command msgs to the device using ngctl(8).

Reviewed by: donner, ray, adrian
Differential Revision: https://reviews.freebsd.org/D32905
MFC after: 1 week

Details

Provenance
ianAuthored on Nov 9 2021, 2:34 PM
manuCommitted on Nov 14 2021, 12:37 PM
Reviewer
donner
Differential Revision
D32905: Add ETHER_ALIGN support to ng_device(4).
Parents
rG98c60dc31f2f: pmic: rockchip: Split the driver in rk805 and rk808
Branches
Unknown
Tags
Unknown