From patchwork Fri May 19 09:30:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 96308 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1103491vqo; Fri, 19 May 2023 02:37:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6EgbxUA7i+/xkvqgfqELpPn/2W7mXp0drq2YIMytS/KI1MaAghNEQi60XXtEq6TVhk0rtF X-Received: by 2002:a17:90b:300f:b0:250:3bc3:2b09 with SMTP id hg15-20020a17090b300f00b002503bc32b09mr1625979pjb.12.1684489077120; Fri, 19 May 2023 02:37:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684489077; cv=none; d=google.com; s=arc-20160816; b=apvDck8qQpgFl/v7h349tUMq+w+YynJWYfwYguB+/xb6sjZ9QX9Nfsw9FpboarIh8s 7cZ8PAIT4N2iCWOFj2Tj2F6oMsEwue4uq+AIWQJm35yWrhDcWwPcV0Fc+zz2W19Q81s4 bUFrOs3vctwwqq6ikzoJSkWpQFsXUZ3At3HCSC/2CxcETuDBmHQpg/gev07mwcPQTk2U qyNBZf7H6dHwInz4IoVzW/kqVDmIFS8qVRiGlpJXwAGkk0309Kh6dolfUDrJumdvsqBD WHoweCj8JwdSmH0Y4kqZd4iRnYR/JGFeUyXZAW2HPGumVnTJ4MHrOxgOzM81TIPVQ46b RdKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=5JM7aynpADpweyyiVqnN0EwV+i0ZMSlfggv+EXFiSh0=; b=MP0Z1Dq+D4pMMK1l+ezGis+MXCCUhMIOdLWx2EcUJveG3TUVpJ8KgyllTkb7gDEFtA xxTU0DReeQEbUaiabbMoruk38dytUYydZq2cHOYXZVONpNr9U0ZqNnmhehTXzwY2qSjp 9raYSZLpMO7mJy/OORqvvjgAGS10TOzl45oBDjBEp9jIrNRDYr/lmpi8MqIp1Z7o8yrt lFpenvqNa1u4sJtZ2afKFEkOZ9mGHXx1wdZvDtuxDKEo1dnlgE+rAJ+ys6oAewWre2Zn bbwhdctKWGeQSl0+bwtnbb+wqSX6alxSIujmmkjHD7ZjQQrZuA6j9qb72TLmZDYRMx6U 63PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=T8751m1n; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=xapZetBD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a17090a024d00b0023b481b8dcesi1409380pje.102.2023.05.19.02.37.45; Fri, 19 May 2023 02:37:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=T8751m1n; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=xapZetBD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231492AbjESJbm (ORCPT + 99 others); Fri, 19 May 2023 05:31:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231216AbjESJbd (ORCPT ); Fri, 19 May 2023 05:31:33 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F66D1A6 for ; Fri, 19 May 2023 02:31:32 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id BE1941FE3D; Fri, 19 May 2023 09:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684488690; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JM7aynpADpweyyiVqnN0EwV+i0ZMSlfggv+EXFiSh0=; b=T8751m1nsfPI5nGRskWjj24MWhECzBimiz4T1cRKqjFhfVXPWpniyI9UnwrOiRvxYnCfFs BSgjLpsS9Z81ux7uF9leYNUxG6o7GjMRIbYo3TB2Ze+0vtZUWzrH8XDimgbQeXlhIP78KX uz33mmVwU2BYkzHgkHeMhzuBp2llAuI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684488690; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5JM7aynpADpweyyiVqnN0EwV+i0ZMSlfggv+EXFiSh0=; b=xapZetBDUHuRha0Mh7xJV0WGtOnVb5/2mzr9OIXzDHxiZ1VXKEq3zzJZBgaxQjeUlNMlFV +a31hyjSrGeBXSDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A057713A12; Fri, 19 May 2023 09:31:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8ARuJPJBZ2RXJAAAMHmgww (envelope-from ); Fri, 19 May 2023 09:31:30 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 02/36] ALSA: rawmidi: Add ioctl callback to snd_rawmidi_global_ops Date: Fri, 19 May 2023 11:30:40 +0200 Message-Id: <20230519093114.28813-3-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230519093114.28813-1-tiwai@suse.de> References: <20230519093114.28813-1-tiwai@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766314818249407474?= X-GMAIL-MSGID: =?utf-8?q?1766314818249407474?= A new callback, ioctl, is added to snd_rawmidi_global_ops for allowing the driver to deal with the own ioctls. This is another preparation patch for the upcoming UMP support. Signed-off-by: Takashi Iwai --- include/sound/rawmidi.h | 3 +++ sound/core/rawmidi.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index 52b1cbfb2526..a53cd063412c 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h @@ -32,6 +32,7 @@ struct snd_rawmidi; struct snd_rawmidi_substream; +struct snd_rawmidi_file; struct snd_seq_port_info; struct pid; @@ -47,6 +48,8 @@ struct snd_rawmidi_global_ops { int (*dev_unregister) (struct snd_rawmidi * rmidi); void (*get_port_info)(struct snd_rawmidi *rmidi, int number, struct snd_seq_port_info *info); + long (*ioctl)(struct snd_rawmidi_file *rfile, unsigned int cmd, + void __user *argp); }; struct snd_rawmidi_runtime { diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 589b75087d27..1415f559b5d0 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -984,6 +984,8 @@ static long snd_rawmidi_ioctl(struct file *file, unsigned int cmd, unsigned long } } default: + if (rfile->rmidi->ops && rfile->rmidi->ops->ioctl) + return rfile->rmidi->ops->ioctl(rfile, cmd, argp); rmidi_dbg(rfile->rmidi, "rawmidi: unknown command = 0x%x\n", cmd); }