From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C37C04DD6F3 for ; Thu, 2 Jul 2026 14:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783002719; cv=none; b=iMXAeqc4douezsvc4ZZGPC/RPylej0hgSeNbdpj8EplwvqvnsNm5Ptd00J76qghVTJyzUUZcUjHzLPeurTgMLgNXlnr05gfpUOyCSs+bBfVO8awjDdGDT+qRuHglGSECe9pCiLoEQv/92Y+yUSRJldX60lS3xipKBsUrctlq+0E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783002719; c=relaxed/simple; bh=Htl6c36B8dE9puLyF/oy3vogvxkI7f0K2VvzunfRNqE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cN/wDd7LtjRW++StnrmGDRL5CT7+f/3cNDBQc+w8avZWrfCNtK9PCFnY+/WCh1liZcWT7OVOGMMFcE7wWGoA9MI7LzfNfW/bUWwBTcC4dxQiEiyQPYPwLdOEb9iBaHnGqrZE6zRj+OGTSA1J278UV4IceewMMNj3mgaCho16j+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BF30B74237; Thu, 2 Jul 2026 14:31:48 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 87995779AC; Thu, 2 Jul 2026 14:31:48 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 0HQTIFR2Rmr0MwAAD6G6ig (envelope-from ); Thu, 02 Jul 2026 14:31:48 +0000 From: Oliver Neukum To: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shaoxul@foxmail.com, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Oliver Neukum Subject: [PATCH net-next 3/4] net: usb: usbnet: add cdc_state to struct usbnet Date: Thu, 2 Jul 2026 16:25:32 +0200 Message-ID: <20260702143142.890654-4-oneukum@suse.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260702143142.890654-1-oneukum@suse.com> References: <20260702143142.890654-1-oneukum@suse.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]; TAGGED_RCPT(0.00)[netdev] X-Rspamd-Queue-Id: BF30B74237 X-Rspamd-Action: no action This allows centralisation of code using cdc_state in usbnet, reducing code duplication. No functional change intended. Signed-off-by: Oliver Neukum --- include/linux/usb/usbnet.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index bbf799ccf3b3..79f48eb388ee 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h @@ -16,6 +16,14 @@ #include #include +struct cdc_state { + struct usb_cdc_header_desc *header; + struct usb_cdc_union_desc *u; + struct usb_cdc_ether_desc *ether; + struct usb_interface *control; + struct usb_interface *data; +}; + /* interface from usbnet core to each USB networking link we handle */ struct usbnet { /* housekeeping */ @@ -41,6 +49,7 @@ struct usbnet { /* protocol/interface state */ struct net_device *net; int msg_enable; + struct cdc_state cdc; /* too common to leave out*/ unsigned long data[5]; u32 xid; u32 hard_mtu; /* count any extra framing */ @@ -211,13 +220,6 @@ extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, * (notably, using multiple interfaces according to the CDC * union descriptor) get some helper code. */ -struct cdc_state { - struct usb_cdc_header_desc *header; - struct usb_cdc_union_desc *u; - struct usb_cdc_ether_desc *ether; - struct usb_interface *control; - struct usb_interface *data; -}; extern void usbnet_cdc_update_filter(struct usbnet *dev); extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *); -- 2.54.0