Lines Matching refs:ccid_ops

98 static int __init ccid_activate(struct ccid_operations *ccid_ops)  in ccid_activate()  argument
102 ccid_ops->ccid_hc_rx_slab = in ccid_activate()
103 ccid_kmem_cache_create(ccid_ops->ccid_hc_rx_obj_size, in ccid_activate()
104 ccid_ops->ccid_hc_rx_slab_name, in ccid_activate()
106 ccid_ops->ccid_id); in ccid_activate()
107 if (ccid_ops->ccid_hc_rx_slab == NULL) in ccid_activate()
110 ccid_ops->ccid_hc_tx_slab = in ccid_activate()
111 ccid_kmem_cache_create(ccid_ops->ccid_hc_tx_obj_size, in ccid_activate()
112 ccid_ops->ccid_hc_tx_slab_name, in ccid_activate()
114 ccid_ops->ccid_id); in ccid_activate()
115 if (ccid_ops->ccid_hc_tx_slab == NULL) in ccid_activate()
119 ccid_ops->ccid_id, ccid_ops->ccid_name); in ccid_activate()
124 ccid_kmem_cache_destroy(ccid_ops->ccid_hc_rx_slab); in ccid_activate()
125 ccid_ops->ccid_hc_rx_slab = NULL; in ccid_activate()
129 static void ccid_deactivate(struct ccid_operations *ccid_ops) in ccid_deactivate() argument
131 ccid_kmem_cache_destroy(ccid_ops->ccid_hc_tx_slab); in ccid_deactivate()
132 ccid_ops->ccid_hc_tx_slab = NULL; in ccid_deactivate()
133 ccid_kmem_cache_destroy(ccid_ops->ccid_hc_rx_slab); in ccid_deactivate()
134 ccid_ops->ccid_hc_rx_slab = NULL; in ccid_deactivate()
137 ccid_ops->ccid_id, ccid_ops->ccid_name); in ccid_deactivate()
142 struct ccid_operations *ccid_ops = ccid_by_number(id); in ccid_new() local
145 if (ccid_ops == NULL) in ccid_new()
148 ccid = kmem_cache_alloc(rx ? ccid_ops->ccid_hc_rx_slab : in ccid_new()
149 ccid_ops->ccid_hc_tx_slab, gfp_any()); in ccid_new()
152 ccid->ccid_ops = ccid_ops; in ccid_new()
154 memset(ccid + 1, 0, ccid_ops->ccid_hc_rx_obj_size); in ccid_new()
155 if (ccid->ccid_ops->ccid_hc_rx_init != NULL && in ccid_new()
156 ccid->ccid_ops->ccid_hc_rx_init(ccid, sk) != 0) in ccid_new()
159 memset(ccid + 1, 0, ccid_ops->ccid_hc_tx_obj_size); in ccid_new()
160 if (ccid->ccid_ops->ccid_hc_tx_init != NULL && in ccid_new()
161 ccid->ccid_ops->ccid_hc_tx_init(ccid, sk) != 0) in ccid_new()
167 kmem_cache_free(rx ? ccid_ops->ccid_hc_rx_slab : in ccid_new()
168 ccid_ops->ccid_hc_tx_slab, ccid); in ccid_new()
176 if (ccid->ccid_ops->ccid_hc_rx_exit != NULL) in ccid_hc_rx_delete()
177 ccid->ccid_ops->ccid_hc_rx_exit(sk); in ccid_hc_rx_delete()
178 kmem_cache_free(ccid->ccid_ops->ccid_hc_rx_slab, ccid); in ccid_hc_rx_delete()
185 if (ccid->ccid_ops->ccid_hc_tx_exit != NULL) in ccid_hc_tx_delete()
186 ccid->ccid_ops->ccid_hc_tx_exit(sk); in ccid_hc_tx_delete()
187 kmem_cache_free(ccid->ccid_ops->ccid_hc_tx_slab, ccid); in ccid_hc_tx_delete()