Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2213713rwd; Fri, 19 May 2023 02:32:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ49OycQ0XtO5FT3BDis1/1gkuj3cEGdUYfWsuF1FDwrzPt8qTHuSLSF2RY7+3TS5t6BkWuR X-Received: by 2002:a17:90a:cf15:b0:253:572f:79ae with SMTP id h21-20020a17090acf1500b00253572f79aemr1608911pju.46.1684488762953; Fri, 19 May 2023 02:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684488762; cv=none; d=google.com; s=arc-20160816; b=FSJEfKOwG5+2wyfnm+g/l+WhpGHdz7/LxotTmfrpDJoZxPjBqVZaUIk4jXbCMcMXCZ rwwnxHc7H8VtONZ5MrAnEWafXZSYCwuV4tZvLJ7a4yE4+jWjwcMz5XscgLBXiqdaW9x4 CMq0BqS1awDdM2vNC8RDuYDp53I+MPYMTLq8NRjNhnf/MfmA/paSICnQJKIODk/hMz4w PkgjkiOUjqeSszSjT9jMH24eupH4bw9vA/KromBdf8BKRzpdopkJwrW2cPMkFZKeJjNZ jP5wmZKjTuGifOBZa3HUl92MeohQ5+r100tg+lmwJUy0m6rr8OS271B/cgKf1TOrvfDS b5nA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc4-20020a17090b3b8400b002475916f319si1566709pjb.148.2023.05.19.02.32.30; Fri, 19 May 2023 02:32:42 -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 S231490AbjESJbl (ORCPT + 99 others); Fri, 19 May 2023 05:31:41 -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 Content-Transfer-Encoding: 8bit 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 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); } -- 2.35.3