]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
macsec_qca: Fix byte order of TX SCI port
authorxiaofeis <xiaofeis@codeaurora.org>
Fri, 25 May 2018 02:41:01 +0000 (10:41 +0800)
committerJouni Malinen <j@w1.fi>
Mon, 28 May 2018 19:17:58 +0000 (22:17 +0300)
Before calling HW macsec driver API, be_to_host16() should be used to
reverse the SCI port byte order. This was broken as part of the mka API
changes.

Fixes: 8ebfc7c2ba77 ("mka: Pass full structures down to macsec drivers' transmit SC ops")
Signed-off-by: xiaofeis <xiaofeis@codeaurora.org>
src/drivers/driver_macsec_qca.c

index d3be19c48a5ca1a22bb8275819a1640a800f9aaa..6766a6259f14e9be35c74b84584f0e73180704b5 100644 (file)
@@ -592,6 +592,7 @@ static int macsec_qca_create_transmit_sc(void *priv, struct transmit_sc *sc,
        fal_tx_class_lut_t entry;
        u8 psci[ETH_ALEN + 2];
        u32 channel;
+       u16 sci_port = be_to_host16(sc->sci.port);
 
        ret = macsec_qca_get_available_transmit_sc(priv, &channel);
        if (ret != 0)
@@ -607,8 +608,8 @@ static int macsec_qca_create_transmit_sc(void *priv, struct transmit_sc *sc,
        entry.channel = channel;
 
        os_memcpy(psci, sc->sci.addr, ETH_ALEN);
-       psci[6] = (sc->sci.port >> 8) & 0xf;
-       psci[7] = sc->sci.port & 0xf;
+       psci[6] = (sci_port >> 8) & 0xf;
+       psci[7] = sci_port & 0xf;
 
        ret += nss_macsec_secy_tx_class_lut_set(drv->secy_id, channel, &entry);
        ret += nss_macsec_secy_tx_sc_create(drv->secy_id, channel, psci, 8);