Lines Matching refs:ctx

65 static void cdc_ncm_tx_timeout_start(struct cdc_ncm_ctx *ctx);
107 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_get_ethtool_stats() local
112 p = (char *)ctx + cdc_ncm_gstrings_stats[i].stat_offset; in cdc_ncm_get_ethtool_stats()
149 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_check_rx_max() local
154 max = min_t(u32, CDC_NCM_NTB_MAX_SIZE_RX, le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)); in cdc_ncm_check_rx_max()
159 le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize), min); in cdc_ncm_check_rx_max()
172 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_check_tx_max() local
176 min = ctx->max_datagram_size + ctx->max_ndp_size + sizeof(struct usb_cdc_ncm_nth16); in cdc_ncm_check_tx_max()
177 max = min_t(u32, CDC_NCM_NTB_MAX_SIZE_TX, le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize)); in cdc_ncm_check_tx_max()
192 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_show_min_tx_pkt() local
194 return sprintf(buf, "%u\n", ctx->min_tx_pkt); in cdc_ncm_show_min_tx_pkt()
200 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_show_rx_max() local
202 return sprintf(buf, "%u\n", ctx->rx_max); in cdc_ncm_show_rx_max()
208 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_show_tx_max() local
210 return sprintf(buf, "%u\n", ctx->tx_max); in cdc_ncm_show_tx_max()
216 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_show_tx_timer_usecs() local
218 return sprintf(buf, "%u\n", ctx->timer_interval / (u32)NSEC_PER_USEC); in cdc_ncm_show_tx_timer_usecs()
224 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_store_min_tx_pkt() local
231 ctx->min_tx_pkt = val; in cdc_ncm_store_min_tx_pkt()
238 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_store_rx_max() local
244 cdc_ncm_update_rxtx_max(dev, val, ctx->tx_max); in cdc_ncm_store_rx_max()
251 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_store_tx_max() local
257 cdc_ncm_update_rxtx_max(dev, ctx->rx_max, val); in cdc_ncm_store_tx_max()
264 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_store_tx_timer_usecs() local
274 spin_lock_bh(&ctx->mtx); in cdc_ncm_store_tx_timer_usecs()
275 ctx->timer_interval = val * NSEC_PER_USEC; in cdc_ncm_store_tx_timer_usecs()
276 if (!ctx->timer_interval) in cdc_ncm_store_tx_timer_usecs()
277 ctx->tx_timer_pending = 0; in cdc_ncm_store_tx_timer_usecs()
278 spin_unlock_bh(&ctx->mtx); in cdc_ncm_store_tx_timer_usecs()
291 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; \
292 return sprintf(buf, format "\n", tocpu(ctx->ncm_parm.name)); \
333 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_update_rxtx_max() local
334 u8 iface_no = ctx->control->cur_altsetting->desc.bInterfaceNumber; in cdc_ncm_update_rxtx_max()
340 if (val != ctx->rx_max) { in cdc_ncm_update_rxtx_max()
352 ctx->rx_max = val; in cdc_ncm_update_rxtx_max()
356 if (dev->rx_urb_size != ctx->rx_max) { in cdc_ncm_update_rxtx_max()
357 dev->rx_urb_size = ctx->rx_max; in cdc_ncm_update_rxtx_max()
363 if (val != ctx->tx_max) in cdc_ncm_update_rxtx_max()
373 if (val != le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize) && in cdc_ncm_update_rxtx_max()
378 if (netif_running(dev->net) && val > ctx->tx_max) { in cdc_ncm_update_rxtx_max()
382 if (ctx->tx_curr_skb) { in cdc_ncm_update_rxtx_max()
383 dev_kfree_skb_any(ctx->tx_curr_skb); in cdc_ncm_update_rxtx_max()
384 ctx->tx_curr_skb = NULL; in cdc_ncm_update_rxtx_max()
386 ctx->tx_max = val; in cdc_ncm_update_rxtx_max()
389 ctx->tx_max = val; in cdc_ncm_update_rxtx_max()
392 dev->hard_mtu = ctx->tx_max; in cdc_ncm_update_rxtx_max()
398 ctx->min_tx_pkt = clamp_t(u16, ctx->tx_max - 3 * usb_maxpacket(dev->udev, dev->out, 1), in cdc_ncm_update_rxtx_max()
399 CDC_NCM_MIN_TX_PKT, ctx->tx_max); in cdc_ncm_update_rxtx_max()
405 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_flags() local
407 if (cdc_ncm_comm_intf_is_mbim(dev->intf->cur_altsetting) && ctx->mbim_desc) in cdc_ncm_flags()
408 return ctx->mbim_desc->bmNetworkCapabilities; in cdc_ncm_flags()
409 if (ctx->func_desc) in cdc_ncm_flags()
410 return ctx->func_desc->bmNetworkCapabilities; in cdc_ncm_flags()
430 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_max_dgram_size() local
432 if (cdc_ncm_comm_intf_is_mbim(dev->intf->cur_altsetting) && ctx->mbim_desc) in cdc_ncm_max_dgram_size()
433 return le16_to_cpu(ctx->mbim_desc->wMaxSegmentSize); in cdc_ncm_max_dgram_size()
434 if (ctx->ether_desc) in cdc_ncm_max_dgram_size()
435 return le16_to_cpu(ctx->ether_desc->wMaxSegmentSize); in cdc_ncm_max_dgram_size()
444 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_init() local
445 u8 iface_no = ctx->control->cur_altsetting->desc.bInterfaceNumber; in cdc_ncm_init()
451 0, iface_no, &ctx->ncm_parm, in cdc_ncm_init()
452 sizeof(ctx->ncm_parm)); in cdc_ncm_init()
475 if (le16_to_cpu(ctx->ncm_parm.bmNtbFormatsSupported) & in cdc_ncm_init()
488 ctx->rx_max = le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize); in cdc_ncm_init()
489 ctx->tx_max = le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize); in cdc_ncm_init()
490 ctx->tx_remainder = le16_to_cpu(ctx->ncm_parm.wNdpOutPayloadRemainder); in cdc_ncm_init()
491 ctx->tx_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutDivisor); in cdc_ncm_init()
492 ctx->tx_ndp_modulus = le16_to_cpu(ctx->ncm_parm.wNdpOutAlignment); in cdc_ncm_init()
494 ctx->tx_max_datagrams = le16_to_cpu(ctx->ncm_parm.wNtbOutMaxDatagrams); in cdc_ncm_init()
498 ctx->rx_max, ctx->tx_max, ctx->tx_remainder, ctx->tx_modulus, in cdc_ncm_init()
499 ctx->tx_ndp_modulus, ctx->tx_max_datagrams, cdc_ncm_flags(dev)); in cdc_ncm_init()
502 if ((ctx->tx_max_datagrams == 0) || in cdc_ncm_init()
503 (ctx->tx_max_datagrams > CDC_NCM_DPT_DATAGRAMS_MAX)) in cdc_ncm_init()
504 ctx->tx_max_datagrams = CDC_NCM_DPT_DATAGRAMS_MAX; in cdc_ncm_init()
507ctx->max_ndp_size = sizeof(struct usb_cdc_ncm_ndp16) + (ctx->tx_max_datagrams + 1) * sizeof(struct… in cdc_ncm_init()
510 ctx->timer_interval = CDC_NCM_TIMER_INTERVAL_USEC * NSEC_PER_USEC; in cdc_ncm_init()
518 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_set_dgram_size() local
519 u8 iface_no = ctx->control->cur_altsetting->desc.bInterfaceNumber; in cdc_ncm_set_dgram_size()
525 ctx->max_datagram_size = clamp_t(u32, new_size, in cdc_ncm_set_dgram_size()
542 if (le16_to_cpu(max_datagram_size) == ctx->max_datagram_size) in cdc_ncm_set_dgram_size()
545 max_datagram_size = cpu_to_le16(ctx->max_datagram_size); in cdc_ncm_set_dgram_size()
554 dev->net->mtu = min_t(int, dev->net->mtu, ctx->max_datagram_size - cdc_ncm_eth_hlen(dev)); in cdc_ncm_set_dgram_size()
557 if (ctx->mbim_extended_desc) { in cdc_ncm_set_dgram_size()
558 mbim_mtu = le16_to_cpu(ctx->mbim_extended_desc->wMTU); in cdc_ncm_set_dgram_size()
566 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_fix_modulus() local
575 val = ctx->tx_ndp_modulus; in cdc_ncm_fix_modulus()
578 (val != ((-val) & val)) || (val >= ctx->tx_max)) { in cdc_ncm_fix_modulus()
580 ctx->tx_ndp_modulus = USB_CDC_NCM_NDP_ALIGN_MIN_SIZE; in cdc_ncm_fix_modulus()
589 val = ctx->tx_modulus; in cdc_ncm_fix_modulus()
592 (val != ((-val) & val)) || (val >= ctx->tx_max)) { in cdc_ncm_fix_modulus()
594 ctx->tx_modulus = USB_CDC_NCM_NDP_ALIGN_MIN_SIZE; in cdc_ncm_fix_modulus()
598 if (ctx->tx_remainder >= ctx->tx_modulus) { in cdc_ncm_fix_modulus()
600 ctx->tx_remainder = 0; in cdc_ncm_fix_modulus()
604 ctx->tx_remainder = ((ctx->tx_remainder - cdc_ncm_eth_hlen(dev)) & in cdc_ncm_fix_modulus()
605 (ctx->tx_modulus - 1)); in cdc_ncm_fix_modulus()
610 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_setup() local
617 le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)); in cdc_ncm_setup()
619 le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize)); in cdc_ncm_setup()
673 static void cdc_ncm_free(struct cdc_ncm_ctx *ctx) in cdc_ncm_free() argument
675 if (ctx == NULL) in cdc_ncm_free()
678 if (ctx->tx_rem_skb != NULL) { in cdc_ncm_free()
679 dev_kfree_skb_any(ctx->tx_rem_skb); in cdc_ncm_free()
680 ctx->tx_rem_skb = NULL; in cdc_ncm_free()
683 if (ctx->tx_curr_skb != NULL) { in cdc_ncm_free()
684 dev_kfree_skb_any(ctx->tx_curr_skb); in cdc_ncm_free()
685 ctx->tx_curr_skb = NULL; in cdc_ncm_free()
688 kfree(ctx); in cdc_ncm_free()
698 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_change_mtu() local
699 int maxmtu = ctx->max_datagram_size - cdc_ncm_eth_hlen(dev); in cdc_ncm_change_mtu()
721 struct cdc_ncm_ctx *ctx; in cdc_ncm_bind_common() local
728 ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); in cdc_ncm_bind_common()
729 if (!ctx) in cdc_ncm_bind_common()
732 hrtimer_init(&ctx->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); in cdc_ncm_bind_common()
733 ctx->tx_timer.function = &cdc_ncm_tx_timer_cb; in cdc_ncm_bind_common()
734 ctx->bh.data = (unsigned long)dev; in cdc_ncm_bind_common()
735 ctx->bh.func = cdc_ncm_txpath_bh; in cdc_ncm_bind_common()
736 atomic_set(&ctx->stop, 0); in cdc_ncm_bind_common()
737 spin_lock_init(&ctx->mtx); in cdc_ncm_bind_common()
740 dev->data[0] = (unsigned long)ctx; in cdc_ncm_bind_common()
743 ctx->control = intf; in cdc_ncm_bind_common()
768 ctx->data = usb_ifnum_to_if(dev->udev, in cdc_ncm_bind_common()
773 if (buf[0] < sizeof(*(ctx->ether_desc))) in cdc_ncm_bind_common()
776 ctx->ether_desc = in cdc_ncm_bind_common()
781 if (buf[0] < sizeof(*(ctx->func_desc))) in cdc_ncm_bind_common()
784 ctx->func_desc = (const struct usb_cdc_ncm_desc *)buf; in cdc_ncm_bind_common()
788 if (buf[0] < sizeof(*(ctx->mbim_desc))) in cdc_ncm_bind_common()
791 ctx->mbim_desc = (const struct usb_cdc_mbim_desc *)buf; in cdc_ncm_bind_common()
795 if (buf[0] < sizeof(*(ctx->mbim_extended_desc))) in cdc_ncm_bind_common()
798 ctx->mbim_extended_desc = in cdc_ncm_bind_common()
814 ctx->data = usb_ifnum_to_if(dev->udev, intf->cur_altsetting->desc.bInterfaceNumber + 1); in cdc_ncm_bind_common()
819 if (!ctx->data) { in cdc_ncm_bind_common()
824 if (!ctx->mbim_desc) { in cdc_ncm_bind_common()
829 if (!ctx->ether_desc || !ctx->func_desc) { in cdc_ncm_bind_common()
836 if (ctx->data != ctx->control) { in cdc_ncm_bind_common()
837 temp = usb_driver_claim_interface(driver, ctx->data, dev); in cdc_ncm_bind_common()
844 iface_no = ctx->data->cur_altsetting->desc.bInterfaceNumber; in cdc_ncm_bind_common()
864 cdc_ncm_find_endpoints(dev, ctx->data); in cdc_ncm_bind_common()
865 cdc_ncm_find_endpoints(dev, ctx->control); in cdc_ncm_bind_common()
871 usb_set_intfdata(ctx->data, dev); in cdc_ncm_bind_common()
872 usb_set_intfdata(ctx->control, dev); in cdc_ncm_bind_common()
874 if (ctx->ether_desc) { in cdc_ncm_bind_common()
875 temp = usbnet_get_ethernet_addr(dev, ctx->ether_desc->iMACAddress); in cdc_ncm_bind_common()
898 usb_set_intfdata(ctx->control, NULL); in cdc_ncm_bind_common()
899 usb_set_intfdata(ctx->data, NULL); in cdc_ncm_bind_common()
900 if (ctx->data != ctx->control) in cdc_ncm_bind_common()
901 usb_driver_release_interface(driver, ctx->data); in cdc_ncm_bind_common()
912 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_unbind() local
915 if (ctx == NULL) in cdc_ncm_unbind()
918 atomic_set(&ctx->stop, 1); in cdc_ncm_unbind()
920 if (hrtimer_active(&ctx->tx_timer)) in cdc_ncm_unbind()
921 hrtimer_cancel(&ctx->tx_timer); in cdc_ncm_unbind()
923 tasklet_kill(&ctx->bh); in cdc_ncm_unbind()
926 if (ctx->control == ctx->data) in cdc_ncm_unbind()
927 ctx->data = NULL; in cdc_ncm_unbind()
930 if (intf == ctx->control && ctx->data) { in cdc_ncm_unbind()
931 usb_set_intfdata(ctx->data, NULL); in cdc_ncm_unbind()
932 usb_driver_release_interface(driver, ctx->data); in cdc_ncm_unbind()
933 ctx->data = NULL; in cdc_ncm_unbind()
935 } else if (intf == ctx->data && ctx->control) { in cdc_ncm_unbind()
936 usb_set_intfdata(ctx->control, NULL); in cdc_ncm_unbind()
937 usb_driver_release_interface(driver, ctx->control); in cdc_ncm_unbind()
938 ctx->control = NULL; in cdc_ncm_unbind()
942 cdc_ncm_free(ctx); in cdc_ncm_unbind()
1014 static struct usb_cdc_ncm_ndp16 *cdc_ncm_ndp(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 s… in cdc_ncm_ndp() argument
1029 cdc_ncm_align_tail(skb, ctx->tx_ndp_modulus, 0, ctx->tx_max); in cdc_ncm_ndp()
1032 if ((ctx->tx_max - skb->len - reserve) < ctx->max_ndp_size) in cdc_ncm_ndp()
1042 ndp16 = (struct usb_cdc_ncm_ndp16 *)memset(skb_put(skb, ctx->max_ndp_size), 0, ctx->max_ndp_size); in cdc_ncm_ndp()
1051 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_fill_tx_frame() local
1060 swap(skb, ctx->tx_rem_skb); in cdc_ncm_fill_tx_frame()
1061 swap(sign, ctx->tx_rem_sign); in cdc_ncm_fill_tx_frame()
1067 skb_out = ctx->tx_curr_skb; in cdc_ncm_fill_tx_frame()
1071 skb_out = alloc_skb(ctx->tx_max, GFP_ATOMIC); in cdc_ncm_fill_tx_frame()
1083 nth16->wSequence = cpu_to_le16(ctx->tx_seq++); in cdc_ncm_fill_tx_frame()
1086 ctx->tx_curr_frame_num = 0; in cdc_ncm_fill_tx_frame()
1089 ctx->tx_curr_frame_payload = 0; in cdc_ncm_fill_tx_frame()
1092 for (n = ctx->tx_curr_frame_num; n < ctx->tx_max_datagrams; n++) { in cdc_ncm_fill_tx_frame()
1095 skb = ctx->tx_rem_skb; in cdc_ncm_fill_tx_frame()
1096 sign = ctx->tx_rem_sign; in cdc_ncm_fill_tx_frame()
1097 ctx->tx_rem_skb = NULL; in cdc_ncm_fill_tx_frame()
1105 ndp16 = cdc_ncm_ndp(ctx, skb_out, sign, skb->len + ctx->tx_modulus + ctx->tx_remainder); in cdc_ncm_fill_tx_frame()
1108 cdc_ncm_align_tail(skb_out, ctx->tx_modulus, ctx->tx_remainder, ctx->tx_max); in cdc_ncm_fill_tx_frame()
1111 if (!ndp16 || skb_out->len + skb->len > ctx->tx_max) { in cdc_ncm_fill_tx_frame()
1119 if (ctx->tx_rem_skb != NULL) { in cdc_ncm_fill_tx_frame()
1120 dev_kfree_skb_any(ctx->tx_rem_skb); in cdc_ncm_fill_tx_frame()
1123 ctx->tx_rem_skb = skb; in cdc_ncm_fill_tx_frame()
1124 ctx->tx_rem_sign = sign; in cdc_ncm_fill_tx_frame()
1127 ctx->tx_reason_ntb_full++; /* count reason for transmitting */ in cdc_ncm_fill_tx_frame()
1141 ctx->tx_curr_frame_payload += skb->len; /* count real tx payload data */ in cdc_ncm_fill_tx_frame()
1148 ctx->tx_reason_ndp_full++; /* count reason for transmitting */ in cdc_ncm_fill_tx_frame()
1160 ctx->tx_curr_frame_num = n; in cdc_ncm_fill_tx_frame()
1165 ctx->tx_curr_skb = skb_out; in cdc_ncm_fill_tx_frame()
1168 } else if ((n < ctx->tx_max_datagrams) && (ready2send == 0) && (ctx->timer_interval > 0)) { in cdc_ncm_fill_tx_frame()
1171 ctx->tx_curr_skb = skb_out; in cdc_ncm_fill_tx_frame()
1174 ctx->tx_timer_pending = CDC_NCM_TIMER_PENDING_CNT; in cdc_ncm_fill_tx_frame()
1178 if (n == ctx->tx_max_datagrams) in cdc_ncm_fill_tx_frame()
1179 ctx->tx_reason_max_datagram++; /* count reason for transmitting */ in cdc_ncm_fill_tx_frame()
1194 skb_out->len > ctx->min_tx_pkt) in cdc_ncm_fill_tx_frame()
1195 memset(skb_put(skb_out, ctx->tx_max - skb_out->len), 0, in cdc_ncm_fill_tx_frame()
1196 ctx->tx_max - skb_out->len); in cdc_ncm_fill_tx_frame()
1197 else if (skb_out->len < ctx->tx_max && (skb_out->len % dev->maxpacket) == 0) in cdc_ncm_fill_tx_frame()
1205 ctx->tx_curr_skb = NULL; in cdc_ncm_fill_tx_frame()
1208 ctx->tx_overhead += skb_out->len - ctx->tx_curr_frame_payload; in cdc_ncm_fill_tx_frame()
1209 ctx->tx_ntbs++; in cdc_ncm_fill_tx_frame()
1216 (long)ctx->tx_curr_frame_payload - skb_out->len); in cdc_ncm_fill_tx_frame()
1222 if (ctx->tx_curr_skb != NULL && n > 0) in cdc_ncm_fill_tx_frame()
1223 cdc_ncm_tx_timeout_start(ctx); in cdc_ncm_fill_tx_frame()
1228 static void cdc_ncm_tx_timeout_start(struct cdc_ncm_ctx *ctx) in cdc_ncm_tx_timeout_start() argument
1231 if (!(hrtimer_active(&ctx->tx_timer) || atomic_read(&ctx->stop))) in cdc_ncm_tx_timeout_start()
1232 hrtimer_start(&ctx->tx_timer, in cdc_ncm_tx_timeout_start()
1233 ktime_set(0, ctx->timer_interval), in cdc_ncm_tx_timeout_start()
1239 struct cdc_ncm_ctx *ctx = in cdc_ncm_tx_timer_cb() local
1242 if (!atomic_read(&ctx->stop)) in cdc_ncm_tx_timer_cb()
1243 tasklet_schedule(&ctx->bh); in cdc_ncm_tx_timer_cb()
1250 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_txpath_bh() local
1252 spin_lock_bh(&ctx->mtx); in cdc_ncm_txpath_bh()
1253 if (ctx->tx_timer_pending != 0) { in cdc_ncm_txpath_bh()
1254 ctx->tx_timer_pending--; in cdc_ncm_txpath_bh()
1255 cdc_ncm_tx_timeout_start(ctx); in cdc_ncm_txpath_bh()
1256 spin_unlock_bh(&ctx->mtx); in cdc_ncm_txpath_bh()
1258 ctx->tx_reason_timeout++; /* count reason for transmitting */ in cdc_ncm_txpath_bh()
1259 spin_unlock_bh(&ctx->mtx); in cdc_ncm_txpath_bh()
1264 spin_unlock_bh(&ctx->mtx); in cdc_ncm_txpath_bh()
1272 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_tx_fixup() local
1281 if (ctx == NULL) in cdc_ncm_tx_fixup()
1284 spin_lock_bh(&ctx->mtx); in cdc_ncm_tx_fixup()
1286 spin_unlock_bh(&ctx->mtx); in cdc_ncm_tx_fixup()
1298 int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in) in cdc_ncm_rx_verify_nth16() argument
1305 if (ctx == NULL) in cdc_ncm_rx_verify_nth16()
1324 if (len > ctx->rx_max) { in cdc_ncm_rx_verify_nth16()
1327 ctx->rx_max); in cdc_ncm_rx_verify_nth16()
1331 if ((ctx->rx_seq + 1) != le16_to_cpu(nth16->wSequence) && in cdc_ncm_rx_verify_nth16()
1332 (ctx->rx_seq || le16_to_cpu(nth16->wSequence)) && in cdc_ncm_rx_verify_nth16()
1333 !((ctx->rx_seq == 0xffff) && !le16_to_cpu(nth16->wSequence))) { in cdc_ncm_rx_verify_nth16()
1336 ctx->rx_seq, le16_to_cpu(nth16->wSequence)); in cdc_ncm_rx_verify_nth16()
1338 ctx->rx_seq = le16_to_cpu(nth16->wSequence); in cdc_ncm_rx_verify_nth16()
1385 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_rx_fixup() local
1396 ndpoffset = cdc_ncm_rx_verify_nth16(ctx, skb_in); in cdc_ncm_rx_fixup()
1431 (len > ctx->rx_max) || (len < ETH_HLEN)) { in cdc_ncm_rx_fixup()
1456 ctx->rx_overhead += skb_in->len - payload; in cdc_ncm_rx_fixup()
1457 ctx->rx_ntbs++; in cdc_ncm_rx_fixup()
1491 struct cdc_ncm_ctx *ctx; in cdc_ncm_status() local
1494 ctx = (struct cdc_ncm_ctx *)dev->data[0]; in cdc_ncm_status()