Lines Matching refs:ctx
181 struct mcba_usb_ctx *ctx = NULL;
185 ctx = &priv->tx_context[i];
186 ctx->ndx = i;
189 ctx->can = true;
191 ctx->can = false;
199 /* That was the last free ctx. Slow down tx path */
202 return ctx;
208 static inline void mcba_usb_free_ctx(struct mcba_usb_ctx *ctx)
210 /* Increase number of free ctxs before freeing ctx */
211 atomic_inc(&ctx->priv->free_ctx_cnt);
213 ctx->ndx = MCBA_CTX_FREE;
215 /* Wake up the queue once ctx is marked free */
216 netif_wake_queue(ctx->priv->netdev);
221 struct mcba_usb_ctx *ctx = urb->context;
224 WARN_ON(!ctx);
226 netdev = ctx->priv->netdev;
232 if (ctx->can) {
237 netdev->stats.tx_bytes += can_get_echo_skb(netdev, ctx->ndx,
245 mcba_usb_free_ctx(ctx);
251 struct mcba_usb_ctx *ctx)
272 mcba_usb_write_bulk_callback, ctx);
310 struct mcba_usb_ctx *ctx = NULL;
321 ctx = mcba_usb_get_free_ctx(priv, cf);
322 if (!ctx)
354 can_put_echo_skb(skb, priv->netdev, ctx->ndx, 0);
356 err = mcba_usb_xmit(priv, (struct mcba_usb_msg *)&usb_msg, ctx);
363 can_free_echo_skb(priv->netdev, ctx->ndx, NULL);
364 mcba_usb_free_ctx(ctx);
374 struct mcba_usb_ctx *ctx = NULL;
377 ctx = mcba_usb_get_free_ctx(priv, NULL);
378 if (!ctx) {
380 "Lack of free ctx. Sending (%d) cmd aborted",
386 err = mcba_usb_xmit(priv, usb_msg, ctx);