Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firewire: core: add flags member for isochronous context structure

This is minor code refactoring to add a flag member to the isochronous
context structure. At present, it is used only for the option to drop
packets when the context header overflows.

Link: https://lore.kernel.org/r/20260117142823.440811-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

+9 -4
+1 -1
drivers/firewire/core-cdev.c
··· 1064 1064 if (IS_ERR(context)) 1065 1065 return PTR_ERR(context); 1066 1066 if (client->version < FW_CDEV_VERSION_AUTO_FLUSH_ISO_OVERFLOW) 1067 - context->drop_overflow_headers = true; 1067 + context->flags |= FW_ISO_CONTEXT_FLAG_DROP_OVERFLOW_HEADERS; 1068 1068 1069 1069 // We only support one context at this time. 1070 1070 scoped_guard(mutex, &client->iso_context_mutex) {
+1
drivers/firewire/core-iso.c
··· 151 151 ctx->type = type; 152 152 ctx->channel = channel; 153 153 ctx->speed = speed; 154 + ctx->flags = 0; 154 155 ctx->header_size = header_size; 155 156 ctx->callback = callback; 156 157 ctx->callback_data = callback_data;
+2 -2
drivers/firewire/ohci.c
··· 2756 2756 u32 *ctx_hdr; 2757 2757 2758 2758 if (ctx->sc.header_length + ctx->base.header_size > PAGE_SIZE) { 2759 - if (ctx->base.drop_overflow_headers) 2759 + if (ctx->base.flags & FW_ISO_CONTEXT_FLAG_DROP_OVERFLOW_HEADERS) 2760 2760 return; 2761 2761 flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW); 2762 2762 } ··· 2925 2925 sync_it_packet_for_cpu(context, d); 2926 2926 2927 2927 if (ctx->sc.header_length + 4 > PAGE_SIZE) { 2928 - if (ctx->base.drop_overflow_headers) 2928 + if (ctx->base.flags & FW_ISO_CONTEXT_FLAG_DROP_OVERFLOW_HEADERS) 2929 2929 return 1; 2930 2930 flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW); 2931 2931 }
+5 -1
include/linux/firewire.h
··· 546 546 fw_iso_mc_callback_t mc; 547 547 }; 548 548 549 + enum fw_iso_context_flag { 550 + FW_ISO_CONTEXT_FLAG_DROP_OVERFLOW_HEADERS = BIT(0), 551 + }; 552 + 549 553 struct fw_iso_context { 550 554 struct fw_card *card; 551 555 struct work_struct work; 552 556 int type; 553 557 int channel; 554 558 int speed; 555 - bool drop_overflow_headers; 559 + int flags; 556 560 size_t header_size; 557 561 union fw_iso_callback callback; 558 562 void *callback_data;