Lines Matching full:ipsec
17 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_dbg_netdev_ops_read() local
26 bufsize = (ipsec->count * 4 * 60) + 60; in nsim_dbg_netdev_ops_read()
34 ipsec->count, ipsec->tx); in nsim_dbg_netdev_ops_read()
37 struct nsim_sa *sap = &ipsec->sa[i]; in nsim_dbg_netdev_ops_read()
68 static int nsim_ipsec_find_empty_idx(struct nsim_ipsec *ipsec) in nsim_ipsec_find_empty_idx() argument
72 if (ipsec->count == NSIM_IPSEC_MAX_SA_COUNT) in nsim_ipsec_find_empty_idx()
77 if (!ipsec->sa[i].used) in nsim_ipsec_find_empty_idx()
94 netdev_err(dev, "Unsupported IPsec algorithm\n"); in nsim_ipsec_parse_proto_keys()
99 netdev_err(dev, "IPsec offload requires %d bit authentication\n", in nsim_ipsec_parse_proto_keys()
109 netdev_err(dev, "Unsupported IPsec algorithm - please use %s\n", in nsim_ipsec_parse_proto_keys()
120 netdev_err(dev, "IPsec hw offload only supports 128 bit keys with optional 32 bit salt\n"); in nsim_ipsec_parse_proto_keys()
130 struct nsim_ipsec *ipsec; in nsim_ipsec_add_sa() local
139 ipsec = &ns->ipsec; in nsim_ipsec_add_sa()
142 netdev_err(dev, "Unsupported protocol 0x%04x for ipsec offload\n", in nsim_ipsec_add_sa()
153 ret = nsim_ipsec_find_empty_idx(ipsec); in nsim_ipsec_add_sa()
184 memcpy(&ipsec->sa[sa_idx], &sa, sizeof(sa)); in nsim_ipsec_add_sa()
190 ipsec->count++; in nsim_ipsec_add_sa()
198 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_del_sa() local
202 if (!ipsec->sa[sa_idx].used) { in nsim_ipsec_del_sa()
208 memset(&ipsec->sa[sa_idx], 0, sizeof(struct nsim_sa)); in nsim_ipsec_del_sa()
209 ipsec->count--; in nsim_ipsec_del_sa()
215 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_offload_ok() local
217 ipsec->ok++; in nsim_ipsec_offload_ok()
231 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_tx() local
259 tsa = &ipsec->sa[sa_idx]; in nsim_ipsec_tx()
270 ipsec->tx++; in nsim_ipsec_tx()
286 ns->ipsec.pfile = debugfs_create_file("ipsec", 0400, in nsim_ipsec_init()
293 struct nsim_ipsec *ipsec = &ns->ipsec; in nsim_ipsec_teardown() local
295 if (ipsec->count) in nsim_ipsec_teardown()
296 netdev_err(ns->netdev, "tearing down IPsec offload with %d SAs left\n", in nsim_ipsec_teardown()
297 ipsec->count); in nsim_ipsec_teardown()
298 debugfs_remove_recursive(ipsec->pfile); in nsim_ipsec_teardown()