[PATCH] Enable MACsec HW offload in driver_macsec_linux if supported
Jouni Malinen
j at w1.fi
Sat Nov 26 02:14:40 PST 2022
On Fri, Oct 28, 2022 at 04:59:56PM +0200, Benny Lønstrup Ammitzbøll wrote:
> +static int macsec_drv_try_enable_hw_offload(void *priv, enum macsec_offload offl)
This breaks the build with many existing systems since enum
macsec_offload is not defined. In other words, this would need some kind
of conditional build mechanism to try to include this only if the needed
defines are available.
> + msg = msg_prepare(MACSEC_CMD_UPD_OFFLOAD, ctx, drv->ifi);
Same applies for these MACSEC*OFFLOAD* values
> @@ -1180,7 +1220,28 @@ static int macsec_drv_create_transmit_sc(
> + /* Try to enable MACsec hardware offloading */
> + err = macsec_drv_try_enable_hw_offload(drv, MACSEC_OFFLOAD_MAC);
> + if (err) {
> + err = macsec_drv_try_enable_hw_offload(drv, MACSEC_OFFLOAD_PHY);
> + if (err) {
> + wpa_printf(MSG_INFO, DRV_PREFIX
> + "%s: MACSEC_OFFLOAD_OFF",
> + drv->common.ifname);
> + } else {
> + wpa_printf(MSG_INFO, DRV_PREFIX
> + "%s: MACSEC_OFFLOAD_PHY",
> + drv->common.ifname);
> + }
> + } else {
> + wpa_printf(MSG_INFO, DRV_PREFIX
> + "%s: MACSEC_OFFLOAD_MAC",
> + drv->common.ifname);
> + }
> }
Missing return 0 at the end of the function.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list