aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiaofeis <xiaofeis@codeaurora.org>2018-05-25 02:41:01 (GMT)
committerJouni Malinen <j@w1.fi>2018-05-28 19:17:58 (GMT)
commit0fe3ede0a4f6fe984bbaad90f1a9d9e8decc155d (patch)
tree46c9f28842bf480bbbd6a5b32e556a5e948d10cb
parent5e597ed9f03d33fd8c8e260f28d015657cbaa16a (diff)
downloadhostap-0fe3ede0a4f6fe984bbaad90f1a9d9e8decc155d.zip
hostap-0fe3ede0a4f6fe984bbaad90f1a9d9e8decc155d.tar.gz
hostap-0fe3ede0a4f6fe984bbaad90f1a9d9e8decc155d.tar.bz2
macsec_qca: Fix byte order of TX SCI port
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>
-rw-r--r--src/drivers/driver_macsec_qca.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/drivers/driver_macsec_qca.c b/src/drivers/driver_macsec_qca.c
index d3be19c..6766a62 100644
--- a/src/drivers/driver_macsec_qca.c
+++ b/src/drivers/driver_macsec_qca.c
@@ -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);