Lines Matching refs:ctx
182 struct mcba_usb_ctx *ctx = NULL;
186 ctx = &priv->tx_context[i];
187 ctx->ndx = i;
190 ctx->can = true;
191 ctx->dlc = cf->can_dlc;
193 ctx->can = false;
194 ctx->dlc = 0;
203 /* That was the last free ctx. Slow down tx path */
206 return ctx;
212 static inline void mcba_usb_free_ctx(struct mcba_usb_ctx *ctx)
214 /* Increase number of free ctxs before freeing ctx */
215 atomic_inc(&ctx->priv->free_ctx_cnt);
217 ctx->ndx = MCBA_CTX_FREE;
219 /* Wake up the queue once ctx is marked free */
220 netif_wake_queue(ctx->priv->netdev);
225 struct mcba_usb_ctx *ctx = urb->context;
228 WARN_ON(!ctx);
230 netdev = ctx->priv->netdev;
236 if (ctx->can) {
241 netdev->stats.tx_bytes += ctx->dlc;
244 can_get_echo_skb(netdev, ctx->ndx);
251 mcba_usb_free_ctx(ctx);
257 struct mcba_usb_ctx *ctx)
278 mcba_usb_write_bulk_callback, ctx);
316 struct mcba_usb_ctx *ctx = NULL;
327 ctx = mcba_usb_get_free_ctx(priv, cf);
328 if (!ctx)
360 can_put_echo_skb(skb, priv->netdev, ctx->ndx);
362 err = mcba_usb_xmit(priv, (struct mcba_usb_msg *)&usb_msg, ctx);
369 can_free_echo_skb(priv->netdev, ctx->ndx);
370 mcba_usb_free_ctx(ctx);
380 struct mcba_usb_ctx *ctx = NULL;
383 ctx = mcba_usb_get_free_ctx(priv, NULL);
384 if (!ctx) {
386 "Lack of free ctx. Sending (%d) cmd aborted",
392 err = mcba_usb_xmit(priv, usb_msg, ctx);