X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=include%2Fnet%2Ftls.h;h=2a6ac8d642afa0d358d6d3633eb099f47647626f;hb=e0c38a4d1f196a4b17d2eba36afff8f656a4f1de;hp=bab5627ff5e393502fc5ed4eb7bd33cae5d02d14;hpb=4b42745211af552f170f38a1b97f4a112b5da6b2;p=linux-2.6-microblaze.git diff --git a/include/net/tls.h b/include/net/tls.h index bab5627ff5e3..2a6ac8d642af 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -76,6 +76,10 @@ * * void (*unhash)(struct tls_device *device, struct sock *sk); * This function cleans listen state set by Inline TLS driver + * + * void (*release)(struct kref *kref); + * Release the registered device and allocated resources + * @kref: Number of reference to tls_device */ struct tls_device { char name[TLS_DEVICE_NAME_MAX]; @@ -83,6 +87,8 @@ struct tls_device { int (*feature)(struct tls_device *device); int (*hash)(struct tls_device *device, struct sock *sk); void (*unhash)(struct tls_device *device, struct sock *sk); + void (*release)(struct kref *kref); + struct kref kref; }; enum { @@ -454,6 +460,15 @@ tls_offload_ctx_tx(const struct tls_context *tls_ctx) return (struct tls_offload_context_tx *)tls_ctx->priv_ctx_tx; } +static inline bool tls_sw_has_ctx_tx(const struct sock *sk) +{ + struct tls_context *ctx = tls_get_ctx(sk); + + if (!ctx) + return false; + return !!tls_sw_ctx_tx(ctx); +} + static inline struct tls_offload_context_rx * tls_offload_ctx_rx(const struct tls_context *tls_ctx) {