secy               64 drivers/net/macsec.c #define for_each_rxsc(secy, sc)				\
secy               65 drivers/net/macsec.c 	for (sc = rcu_dereference_bh(secy->rx_sc);	\
secy               68 drivers/net/macsec.c #define for_each_rxsc_rtnl(secy, sc)			\
secy               69 drivers/net/macsec.c 	for (sc = rtnl_dereference(secy->rx_sc);	\
secy              266 drivers/net/macsec.c 	struct macsec_secy secy;
secy              400 drivers/net/macsec.c static bool send_sci(const struct macsec_secy *secy)
secy              402 drivers/net/macsec.c 	const struct macsec_tx_sc *tx_sc = &secy->tx_sc;
secy              405 drivers/net/macsec.c 		(secy->n_rx_sc > 1 && !tx_sc->end_station && !tx_sc->scb);
secy              448 drivers/net/macsec.c 			       const struct macsec_secy *secy, u32 pn,
secy              451 drivers/net/macsec.c 	const struct macsec_tx_sc *tx_sc = &secy->tx_sc;
secy              458 drivers/net/macsec.c 		memcpy(&h->secure_channel_id, &secy->sci,
secy              472 drivers/net/macsec.c 	else if (secy->icv_len != DEFAULT_ICV_LEN)
secy              536 drivers/net/macsec.c static u32 tx_sa_update_pn(struct macsec_tx_sa *tx_sa, struct macsec_secy *secy)
secy              547 drivers/net/macsec.c 		if (secy->protect_frames)
secy              548 drivers/net/macsec.c 			secy->operational = false;
secy              606 drivers/net/macsec.c 	macsec_count_tx(skb, &macsec->secy.tx_sc, macsec_skb_cb(skb)->tx_sa);
secy              657 drivers/net/macsec.c 	struct macsec_secy *secy;
secy              664 drivers/net/macsec.c 	secy = &macsec->secy;
secy              665 drivers/net/macsec.c 	tx_sc = &secy->tx_sc;
secy              670 drivers/net/macsec.c 		secy->operational = false;
secy              699 drivers/net/macsec.c 	sci_present = send_sci(secy);
secy              703 drivers/net/macsec.c 	pn = tx_sa_update_pn(tx_sa, secy);
secy              709 drivers/net/macsec.c 	macsec_fill_sectag(hh, secy, pn, sci_present);
secy              712 drivers/net/macsec.c 	skb_put(skb, secy->icv_len);
secy              740 drivers/net/macsec.c 	macsec_fill_iv(iv, secy->sci, pn);
secy              753 drivers/net/macsec.c 			  secy->icv_len;
secy              758 drivers/net/macsec.c 		aead_request_set_ad(req, skb->len - secy->icv_len);
secy              784 drivers/net/macsec.c static bool macsec_post_decrypt(struct sk_buff *skb, struct macsec_secy *secy, u32 pn)
secy              792 drivers/net/macsec.c 	if (rx_sa->next_pn >= secy->replay_window)
secy              793 drivers/net/macsec.c 		lowest_pn = rx_sa->next_pn - secy->replay_window;
secy              798 drivers/net/macsec.c 	if (secy->replay_protect && pn < lowest_pn) {
secy              806 drivers/net/macsec.c 	if (secy->validate_frames != MACSEC_VALIDATE_DISABLED) {
secy              820 drivers/net/macsec.c 		    secy->validate_frames == MACSEC_VALIDATE_STRICT) {
secy              828 drivers/net/macsec.c 		if (secy->validate_frames == MACSEC_VALIDATE_CHECK) {
secy              901 drivers/net/macsec.c 	if (!macsec_post_decrypt(skb, &macsec->secy, pn)) {
secy              907 drivers/net/macsec.c 	macsec_finalize_skb(skb, macsec->secy.icv_len,
secy              909 drivers/net/macsec.c 	macsec_reset_skb(skb, macsec->secy.netdev);
secy              927 drivers/net/macsec.c 				      struct macsec_secy *secy)
secy              935 drivers/net/macsec.c 	u16 icv_len = secy->icv_len;
secy             1009 drivers/net/macsec.c static struct macsec_rx_sc *find_rx_sc(struct macsec_secy *secy, sci_t sci)
secy             1013 drivers/net/macsec.c 	for_each_rxsc(secy, rx_sc) {
secy             1021 drivers/net/macsec.c static struct macsec_rx_sc *find_rx_sc_rtnl(struct macsec_secy *secy, sci_t sci)
secy             1025 drivers/net/macsec.c 	for_each_rxsc_rtnl(secy, rx_sc) {
secy             1049 drivers/net/macsec.c 		if (macsec->secy.validate_frames == MACSEC_VALIDATE_STRICT) {
secy             1061 drivers/net/macsec.c 		nskb->dev = macsec->secy.netdev;
secy             1078 drivers/net/macsec.c 	struct macsec_secy *secy = NULL;
secy             1140 drivers/net/macsec.c 		struct macsec_rx_sc *sc = find_rx_sc(&macsec->secy, sci);
secy             1145 drivers/net/macsec.c 			secy = &macsec->secy;
secy             1151 drivers/net/macsec.c 	if (!secy)
secy             1154 drivers/net/macsec.c 	dev = secy->netdev;
secy             1159 drivers/net/macsec.c 	if (!macsec_validate_skb(skb, secy->icv_len)) {
secy             1174 drivers/net/macsec.c 		    secy->validate_frames == MACSEC_VALIDATE_STRICT) {
secy             1192 drivers/net/macsec.c 	if (secy->replay_protect) {
secy             1196 drivers/net/macsec.c 		late = rx_sa->next_pn >= secy->replay_window &&
secy             1197 drivers/net/macsec.c 		       pn < (rx_sa->next_pn - secy->replay_window);
secy             1212 drivers/net/macsec.c 	    secy->validate_frames != MACSEC_VALIDATE_DISABLED)
secy             1213 drivers/net/macsec.c 		skb = macsec_decrypt(skb, dev, rx_sa, sci, secy);
secy             1226 drivers/net/macsec.c 	if (!macsec_post_decrypt(skb, secy, pn))
secy             1230 drivers/net/macsec.c 	macsec_finalize_skb(skb, secy->icv_len,
secy             1232 drivers/net/macsec.c 	macsec_reset_skb(skb, secy->netdev);
secy             1243 drivers/net/macsec.c 		macsec->secy.netdev->stats.rx_dropped++;
secy             1276 drivers/net/macsec.c 		    macsec->secy.validate_frames == MACSEC_VALIDATE_STRICT) {
secy             1290 drivers/net/macsec.c 		macsec_reset_skb(nskb, macsec->secy.netdev);
secy             1298 drivers/net/macsec.c 			macsec->secy.netdev->stats.rx_dropped++;
secy             1375 drivers/net/macsec.c static struct macsec_rx_sc *del_rx_sc(struct macsec_secy *secy, sci_t sci)
secy             1379 drivers/net/macsec.c 	for (rx_scp = &secy->rx_sc, rx_sc = rtnl_dereference(*rx_scp);
secy             1384 drivers/net/macsec.c 				secy->n_rx_sc--;
secy             1399 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1402 drivers/net/macsec.c 		if (find_rx_sc_rtnl(&macsec->secy, sci))
secy             1420 drivers/net/macsec.c 	secy = &macsec_priv(dev)->secy;
secy             1421 drivers/net/macsec.c 	rcu_assign_pointer(rx_sc->next, secy->rx_sc);
secy             1422 drivers/net/macsec.c 	rcu_assign_pointer(secy->rx_sc, rx_sc);
secy             1425 drivers/net/macsec.c 		secy->n_rx_sc++;
secy             1495 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1511 drivers/net/macsec.c 	secy = &macsec_priv(dev)->secy;
secy             1512 drivers/net/macsec.c 	tx_sc = &secy->tx_sc;
secy             1520 drivers/net/macsec.c 	*secyp = secy;
secy             1531 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1539 drivers/net/macsec.c 	secy = &macsec_priv(dev)->secy;
secy             1545 drivers/net/macsec.c 	rx_sc = find_rx_sc_rtnl(secy, sci);
secy             1549 drivers/net/macsec.c 	*secyp = secy;
secy             1657 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1678 drivers/net/macsec.c 	rx_sc = get_rxsc_from_nl(genl_info_net(info), attrs, tb_rxsc, &dev, &secy);
secy             1686 drivers/net/macsec.c 	if (nla_len(tb_sa[MACSEC_SA_ATTR_KEY]) != secy->key_len) {
secy             1688 drivers/net/macsec.c 			  nla_len(tb_sa[MACSEC_SA_ATTR_KEY]), secy->key_len);
secy             1706 drivers/net/macsec.c 			 secy->key_len, secy->icv_len);
secy             1813 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1836 drivers/net/macsec.c 	secy = &macsec_priv(dev)->secy;
secy             1837 drivers/net/macsec.c 	tx_sc = &secy->tx_sc;
secy             1841 drivers/net/macsec.c 	if (nla_len(tb_sa[MACSEC_SA_ATTR_KEY]) != secy->key_len) {
secy             1843 drivers/net/macsec.c 			  nla_len(tb_sa[MACSEC_SA_ATTR_KEY]), secy->key_len);
secy             1861 drivers/net/macsec.c 			 secy->key_len, secy->icv_len);
secy             1878 drivers/net/macsec.c 		secy->operational = true;
secy             1891 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1909 drivers/net/macsec.c 				 &dev, &secy, &rx_sc, &assoc_num);
secy             1932 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1953 drivers/net/macsec.c 	secy = &macsec_priv(dev)->secy;
secy             1956 drivers/net/macsec.c 	rx_sc = del_rx_sc(secy, sci);
secy             1972 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             1986 drivers/net/macsec.c 				 &dev, &secy, &tx_sc, &assoc_num);
secy             2030 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             2047 drivers/net/macsec.c 				 &dev, &secy, &tx_sc, &assoc_num);
secy             2063 drivers/net/macsec.c 		secy->operational = tx_sa->active;
secy             2074 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             2095 drivers/net/macsec.c 				 &dev, &secy, &rx_sc, &assoc_num);
secy             2118 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             2132 drivers/net/macsec.c 	rx_sc = get_rxsc_from_nl(genl_info_net(info), attrs, tb_rxsc, &dev, &secy);
secy             2142 drivers/net/macsec.c 			secy->n_rx_sc += new ? 1 : -1;
secy             2359 drivers/net/macsec.c static int nla_put_secy(struct macsec_secy *secy, struct sk_buff *skb)
secy             2361 drivers/net/macsec.c 	struct macsec_tx_sc *tx_sc = &secy->tx_sc;
secy             2369 drivers/net/macsec.c 	switch (secy->key_len) {
secy             2380 drivers/net/macsec.c 	if (nla_put_sci(skb, MACSEC_SECY_ATTR_SCI, secy->sci,
secy             2384 drivers/net/macsec.c 	    nla_put_u8(skb, MACSEC_SECY_ATTR_ICV_LEN, secy->icv_len) ||
secy             2385 drivers/net/macsec.c 	    nla_put_u8(skb, MACSEC_SECY_ATTR_OPER, secy->operational) ||
secy             2386 drivers/net/macsec.c 	    nla_put_u8(skb, MACSEC_SECY_ATTR_PROTECT, secy->protect_frames) ||
secy             2387 drivers/net/macsec.c 	    nla_put_u8(skb, MACSEC_SECY_ATTR_REPLAY, secy->replay_protect) ||
secy             2388 drivers/net/macsec.c 	    nla_put_u8(skb, MACSEC_SECY_ATTR_VALIDATE, secy->validate_frames) ||
secy             2396 drivers/net/macsec.c 	if (secy->replay_protect) {
secy             2397 drivers/net/macsec.c 		if (nla_put_u32(skb, MACSEC_SECY_ATTR_WINDOW, secy->replay_window))
secy             2410 drivers/net/macsec.c dump_secy(struct macsec_secy *secy, struct net_device *dev,
secy             2414 drivers/net/macsec.c 	struct macsec_tx_sc *tx_sc = &secy->tx_sc;
secy             2430 drivers/net/macsec.c 	if (nla_put_secy(secy, skb))
secy             2499 drivers/net/macsec.c 	for_each_rxsc_rtnl(secy, rx_sc) {
secy             2614 drivers/net/macsec.c 		struct macsec_secy *secy;
secy             2622 drivers/net/macsec.c 		secy = &macsec_priv(dev)->secy;
secy             2623 drivers/net/macsec.c 		if (dump_secy(secy, dev, skb, cb) < 0)
secy             2713 drivers/net/macsec.c 	struct macsec_secy *secy = &macsec->secy;
secy             2718 drivers/net/macsec.c 	if (!secy->protect_frames) {
secy             2730 drivers/net/macsec.c 	if (!secy->operational) {
secy             2743 drivers/net/macsec.c 	macsec_count_tx(skb, &macsec->secy.tx_sc, macsec_skb_cb(skb)->tx_sa);
secy             2913 drivers/net/macsec.c 	macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES);
secy             2920 drivers/net/macsec.c 	unsigned int extra = macsec->secy.icv_len + macsec_extra_len(true);
secy             3007 drivers/net/macsec.c 	free_percpu(macsec->secy.tx_sc.stats);
secy             3028 drivers/net/macsec.c 	struct macsec_secy *secy;
secy             3031 drivers/net/macsec.c 	secy = &macsec_priv(dev)->secy;
secy             3032 drivers/net/macsec.c 	tx_sc = &secy->tx_sc;
secy             3040 drivers/net/macsec.c 		secy->operational = tx_sa && tx_sa->active;
secy             3044 drivers/net/macsec.c 		secy->replay_window = nla_get_u32(data[IFLA_MACSEC_WINDOW]);
secy             3050 drivers/net/macsec.c 		secy->protect_frames = !!nla_get_u8(data[IFLA_MACSEC_PROTECT]);
secy             3062 drivers/net/macsec.c 		secy->replay_protect = !!nla_get_u8(data[IFLA_MACSEC_REPLAY_PROTECT]);
secy             3065 drivers/net/macsec.c 		secy->validate_frames = nla_get_u8(data[IFLA_MACSEC_VALIDATION]);
secy             3071 drivers/net/macsec.c 			secy->key_len = MACSEC_GCM_AES_128_SAK_LEN;
secy             3074 drivers/net/macsec.c 			secy->key_len = MACSEC_GCM_AES_256_SAK_LEN;
secy             3104 drivers/net/macsec.c 	while (macsec->secy.rx_sc) {
secy             3105 drivers/net/macsec.c 		struct macsec_rx_sc *rx_sc = rtnl_dereference(macsec->secy.rx_sc);
secy             3107 drivers/net/macsec.c 		rcu_assign_pointer(macsec->secy.rx_sc, rx_sc->next);
secy             3112 drivers/net/macsec.c 		struct macsec_tx_sa *sa = rtnl_dereference(macsec->secy.tx_sc.sa[i]);
secy             3115 drivers/net/macsec.c 			RCU_INIT_POINTER(macsec->secy.tx_sc.sa[i], NULL);
secy             3181 drivers/net/macsec.c 		if (macsec->secy.sci == sci)
secy             3191 drivers/net/macsec.c 	struct macsec_secy *secy = &macsec->secy;
secy             3197 drivers/net/macsec.c 	secy->tx_sc.stats = netdev_alloc_pcpu_stats(struct pcpu_tx_sc_stats);
secy             3198 drivers/net/macsec.c 	if (!secy->tx_sc.stats) {
secy             3206 drivers/net/macsec.c 	secy->netdev = dev;
secy             3207 drivers/net/macsec.c 	secy->operational = true;
secy             3208 drivers/net/macsec.c 	secy->key_len = DEFAULT_SAK_LEN;
secy             3209 drivers/net/macsec.c 	secy->icv_len = icv_len;
secy             3210 drivers/net/macsec.c 	secy->validate_frames = MACSEC_VALIDATE_DEFAULT;
secy             3211 drivers/net/macsec.c 	secy->protect_frames = true;
secy             3212 drivers/net/macsec.c 	secy->replay_protect = false;
secy             3214 drivers/net/macsec.c 	secy->sci = sci;
secy             3215 drivers/net/macsec.c 	secy->tx_sc.active = true;
secy             3216 drivers/net/macsec.c 	secy->tx_sc.encoding_sa = DEFAULT_ENCODING_SA;
secy             3217 drivers/net/macsec.c 	secy->tx_sc.encrypt = DEFAULT_ENCRYPT;
secy             3218 drivers/net/macsec.c 	secy->tx_sc.send_sci = DEFAULT_SEND_SCI;
secy             3219 drivers/net/macsec.c 	secy->tx_sc.end_station = false;
secy             3220 drivers/net/macsec.c 	secy->tx_sc.scb = false;
secy             3412 drivers/net/macsec.c 	struct macsec_secy *secy = &macsec_priv(dev)->secy;
secy             3413 drivers/net/macsec.c 	struct macsec_tx_sc *tx_sc = &secy->tx_sc;
secy             3416 drivers/net/macsec.c 	switch (secy->key_len) {
secy             3427 drivers/net/macsec.c 	if (nla_put_sci(skb, IFLA_MACSEC_SCI, secy->sci,
secy             3429 drivers/net/macsec.c 	    nla_put_u8(skb, IFLA_MACSEC_ICV_LEN, secy->icv_len) ||
secy             3434 drivers/net/macsec.c 	    nla_put_u8(skb, IFLA_MACSEC_PROTECT, secy->protect_frames) ||
secy             3438 drivers/net/macsec.c 	    nla_put_u8(skb, IFLA_MACSEC_REPLAY_PROTECT, secy->replay_protect) ||
secy             3439 drivers/net/macsec.c 	    nla_put_u8(skb, IFLA_MACSEC_VALIDATION, secy->validate_frames) ||
secy             3443 drivers/net/macsec.c 	if (secy->replay_protect) {
secy             3444 drivers/net/macsec.c 		if (nla_put_u32(skb, IFLA_MACSEC_WINDOW, secy->replay_window))
secy             3492 drivers/net/macsec.c 			struct net_device *dev = m->secy.netdev;
secy             3504 drivers/net/macsec.c 			macsec_common_dellink(m->secy.netdev, &head);
secy             3519 drivers/net/macsec.c 			struct net_device *dev = m->secy.netdev;
secy             3520 drivers/net/macsec.c 			unsigned int mtu = real_dev->mtu - (m->secy.icv_len +