From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24F09C433EF for ; Sat, 12 Mar 2022 00:06:16 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nSpGf-0001zY-Kd; Fri, 11 Mar 2022 19:05:57 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nSpGd-0001zO-Bv for kernelnewbies@kernelnewbies.org; Fri, 11 Mar 2022 19:05:55 -0500 Received: by mail-pl1-x62b.google.com with SMTP id m2so8990687pll.0 for ; Fri, 11 Mar 2022 16:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=Pg11RhMPzGVXojQl7UsWXxxxVl/eY/VV0vYucmJXD+k=; b=A4mC49Z3W1eN3hDnmw4w2wyIuyyh/0pfS12bwpotJ7+spYECdO6Uluce8MjK3m2y9x MedqWBkXyeP9dDGkdcFrMf8i+4D/cU2mxZ7BQa8zfgl6xkphDB0QQsly3ssUdRxmFc47 y80rgpvprtz3bNpAQAwtljTx0yOOIqCwLzp6jr5YaAMmcr4pt66V+d+nfdYRj5A2jW5D zN79MYTCOkxYA8V37J2W2EiS9UfXZvj1htyuzPBV08z0f3947vpwiOJ6LOVTsTl9uuu2 j9apoubncFtaq5cHKdlBLs9aq2cPlfQ0Il0YVRcIrbTXjP8LRY8uDBLf9l7K5fE2wY1V ZEPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=Pg11RhMPzGVXojQl7UsWXxxxVl/eY/VV0vYucmJXD+k=; b=T0W8HZAlCH6lpe+dk8Sf5PKCATeiWIHpZKXYnhcLI/3zgFoSdli4z+wxnl/oMzbmLU tzv0ZKMbDDreXjvk+R0BMUprP86Z+FCF1j4IJV/VVZwsh2t7DdG2YQfOoWhYcAU5JnxN a7vpbNhbB7WQb2a/vjt7AYrTZWCNy9Y41rH/SablN7XPFf2B4Mvhv6bjQFG8Klnn0oW9 csAtNrYdYOs+UQ6PnmTKN4ifdeGAMcqj0UHAD0rV0ZRBj+Cx6y2rGqGvd7rvxqmJ8ZfE 5RTbcqCEAv/0MVeprEdvP+g0s0oxGZlKmlgGKQDgKyLahDmnBUd5moHy+YuihEWU7Nr6 j50Q== X-Gm-Message-State: AOAM532lqtp98qQkPlGPY4rb3eejoO/YOpretU/C9uGNLS1OEU95cxy2 +Vb8bVOeVsuvx2xH1/ABpfQ= X-Google-Smtp-Source: ABdhPJxS/UYq7Enl0UjBQJHgR3PCg1lCe2bJOhsJRtUS1Kh7k3ogNAw2REDEBujDB6jU9woEmwIqOQ== X-Received: by 2002:a17:90b:4a44:b0:1bf:8deb:9435 with SMTP id lb4-20020a17090b4a4400b001bf8deb9435mr22431252pjb.16.1647043552261; Fri, 11 Mar 2022 16:05:52 -0800 (PST) Received: from mail.google.com ([122.58.164.114]) by smtp.gmail.com with ESMTPSA id ng12-20020a17090b1a8c00b001bfc847b555sm7635163pjb.46.2022.03.11.16.05.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 16:05:51 -0800 (PST) Date: Sat, 12 Mar 2022 13:05:46 +1300 From: Paulo Miguel Almeida To: Greg KH Subject: Re: ioctl number change / backwards compatibility doubt Message-ID: Mail-Followup-To: Paulo Miguel Almeida , Greg KH , kernelnewbies@kernelnewbies.org References: <20220117070125.GA17186@mail.google.com> <20220123075530.GB79751@mail.google.com> <20220124044906.GA8954@mail.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Mon, Jan 24, 2022 at 07:20:45AM +0100, Greg KH wrote: > On Mon, Jan 24, 2022 at 05:49:06PM +1300, Paulo Miguel Almeida wrote: > > On Sun, Jan 23, 2022 at 12:04:48PM +0100, Greg KH wrote: > > > > when you told me to look for the userspace tool that interfaced with the > > ioctl, my interpretation was that you were referring to something akin > > to what /usr/bin/uname utility is to the syscall uname. Please correct me > > if I'm wrong. > > > > re: what calls the ioctl created by the driver. > > > > I'm led to believe that users of this driver make ioctl sycall > > invocations directly from their application's source code like this: > > > > #include "pi433_if.h" /* userspace driver header */ > > #include /* ioctl */ > > > > int file_desc = open("/dev/pi433.0", O_RDWR); > > struct pi433_tx_cfg tx_cfg = { > > .frequency = 433000000, > > .bit_rate = 4800, > > ... > > }; > > > > int ret_val = ioctl(file_desc, PI433_IOC_WR_TX_CFG, tx_cfg); > > .... > > Yes, sorry for the confusion, this is what I am referring to. Where is > that userspace code as that is the code you will be needing to change if > you want to change this ioctl interface. > > thanks, > > greg k-h Hi Greg, The original author replied my email with that question. He sent me some the code used to interface with char device, however, the source code he provided me is already incompatible with the current version of the driver: #include "rfxx.h" (file header name has changed) int main(int argc, char *argv[]) { ... struct rfxx_send_config sendConfig; (struct name has changed) ... fd = open("/dev/rf69_0.0", O_RDWR); *(char device name changed)* ... sendConfig.data_mode = packet; *(property doesn't exist)* ... (IOCTL call has a different name) ret = ioctl(fd, RFXX_IOC_WR_SEND_CONFIG, &sendConfig); if (ret == -1) ... } Assuming that I tweak these tools he provided me with and publish them, will I then be able to tweak the structures passed back and forth via ioctl? (do I need to change ioctl number in this case?) The reason why I'm asking this is because given the fact that other developers could have written similar code for interfacing with the driver (and that we will never know because code is proprietary), I won't be sure that I've changed all occurences at the same time, right? All in all, please correct if there are gaps in this train of thought. - If a change doesn't break *compiled* code (such as struct renaming) then it's 'okay' to make the change ? (this has happened in the this driver before) Best regards, Paulo Almeida _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies