6666#include <linux/crash_dump.h>
6767#include <net/udp_tunnel.h>
6868#include <net/xfrm.h>
69- #if defined (CONFIG_CHELSIO_TLS_DEVICE )
69+ #if IS_ENABLED (CONFIG_CHELSIO_TLS_DEVICE )
7070#include <net/tls.h>
7171#endif
7272
@@ -6396,21 +6396,21 @@ static int cxgb4_iov_configure(struct pci_dev *pdev, int num_vfs)
63966396}
63976397#endif /* CONFIG_PCI_IOV */
63986398
6399- #if defined (CONFIG_CHELSIO_TLS_DEVICE ) || IS_ENABLED (CONFIG_CHELSIO_IPSEC_INLINE )
6399+ #if IS_ENABLED (CONFIG_CHELSIO_TLS_DEVICE ) || IS_ENABLED (CONFIG_CHELSIO_IPSEC_INLINE )
64006400
64016401static int chcr_offload_state (struct adapter * adap ,
64026402 enum cxgb4_netdev_tls_ops op_val )
64036403{
64046404 switch (op_val ) {
6405- #if defined (CONFIG_CHELSIO_TLS_DEVICE )
6405+ #if IS_ENABLED (CONFIG_CHELSIO_TLS_DEVICE )
64066406 case CXGB4_TLSDEV_OPS :
6407- if (!adap -> uld [CXGB4_ULD_CRYPTO ].handle ) {
6408- dev_dbg (adap -> pdev_dev , "chcr driver is not loaded\n" );
6407+ if (!adap -> uld [CXGB4_ULD_KTLS ].handle ) {
6408+ dev_dbg (adap -> pdev_dev , "ch_ktls driver is not loaded\n" );
64096409 return - EOPNOTSUPP ;
64106410 }
6411- if (!adap -> uld [CXGB4_ULD_CRYPTO ].tlsdev_ops ) {
6411+ if (!adap -> uld [CXGB4_ULD_KTLS ].tlsdev_ops ) {
64126412 dev_dbg (adap -> pdev_dev ,
6413- "chcr driver has no registered tlsdev_ops\n" );
6413+ "ch_ktls driver has no registered tlsdev_ops\n" );
64146414 return - EOPNOTSUPP ;
64156415 }
64166416 break ;
@@ -6439,7 +6439,7 @@ static int chcr_offload_state(struct adapter *adap,
64396439
64406440#endif /* CONFIG_CHELSIO_TLS_DEVICE || CONFIG_CHELSIO_IPSEC_INLINE */
64416441
6442- #if defined (CONFIG_CHELSIO_TLS_DEVICE )
6442+ #if IS_ENABLED (CONFIG_CHELSIO_TLS_DEVICE )
64436443
64446444static int cxgb4_ktls_dev_add (struct net_device * netdev , struct sock * sk ,
64456445 enum tls_offload_ctx_dir direction ,
@@ -6458,10 +6458,10 @@ static int cxgb4_ktls_dev_add(struct net_device *netdev, struct sock *sk,
64586458 if (ret )
64596459 goto out_unlock ;
64606460
6461- ret = adap -> uld [CXGB4_ULD_CRYPTO ].tlsdev_ops -> tls_dev_add (netdev , sk ,
6462- direction ,
6463- crypto_info ,
6464- tcp_sn );
6461+ ret = adap -> uld [CXGB4_ULD_KTLS ].tlsdev_ops -> tls_dev_add (netdev , sk ,
6462+ direction ,
6463+ crypto_info ,
6464+ tcp_sn );
64656465 /* if there is a failure, clear the refcount */
64666466 if (ret )
64676467 cxgb4_set_ktls_feature (adap ,
@@ -6481,14 +6481,20 @@ static void cxgb4_ktls_dev_del(struct net_device *netdev,
64816481 if (chcr_offload_state (adap , CXGB4_TLSDEV_OPS ))
64826482 goto out_unlock ;
64836483
6484- adap -> uld [CXGB4_ULD_CRYPTO ].tlsdev_ops -> tls_dev_del (netdev , tls_ctx ,
6485- direction );
6484+ adap -> uld [CXGB4_ULD_KTLS ].tlsdev_ops -> tls_dev_del (netdev , tls_ctx ,
6485+ direction );
64866486 cxgb4_set_ktls_feature (adap , FW_PARAMS_PARAM_DEV_KTLS_HW_DISABLE );
64876487
64886488out_unlock :
64896489 mutex_unlock (& uld_mutex );
64906490}
64916491
6492+ static const struct tlsdev_ops cxgb4_ktls_ops = {
6493+ .tls_dev_add = cxgb4_ktls_dev_add ,
6494+ .tls_dev_del = cxgb4_ktls_dev_del ,
6495+ };
6496+ #endif /* CONFIG_CHELSIO_TLS_DEVICE */
6497+
64926498#if IS_ENABLED (CONFIG_CHELSIO_IPSEC_INLINE )
64936499
64946500static int cxgb4_xfrm_add_state (struct xfrm_state * x )
@@ -6597,12 +6603,6 @@ static const struct xfrmdev_ops cxgb4_xfrmdev_ops = {
65976603
65986604#endif /* CONFIG_CHELSIO_IPSEC_INLINE */
65996605
6600- static const struct tlsdev_ops cxgb4_ktls_ops = {
6601- .tls_dev_add = cxgb4_ktls_dev_add ,
6602- .tls_dev_del = cxgb4_ktls_dev_del ,
6603- };
6604- #endif /* CONFIG_CHELSIO_TLS_DEVICE */
6605-
66066606static int init_one (struct pci_dev * pdev , const struct pci_device_id * ent )
66076607{
66086608 struct net_device * netdev ;
@@ -6855,7 +6855,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
68556855 netdev -> hw_features |= NETIF_F_HIGHDMA ;
68566856 netdev -> features |= netdev -> hw_features ;
68576857 netdev -> vlan_features = netdev -> features & VLAN_FEAT ;
6858- #if defined (CONFIG_CHELSIO_TLS_DEVICE )
6858+ #if IS_ENABLED (CONFIG_CHELSIO_TLS_DEVICE )
68596859 if (pi -> adapter -> params .crypto & FW_CAPS_CONFIG_TLS_HW ) {
68606860 netdev -> hw_features |= NETIF_F_HW_TLS_TX ;
68616861 netdev -> tlsdev_ops = & cxgb4_ktls_ops ;
0 commit comments