From: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: ioctl number change / backwards compatibility doubt
Date: Mon, 24 Jan 2022 17:49:06 +1300 [thread overview]
Message-ID: <20220124044906.GA8954@mail.google.com> (raw)
In-Reply-To: <Ye02UFT+DU0lM6wn@kroah.com>
On Sun, Jan 23, 2022 at 12:04:48PM +0100, Greg KH wrote:
> On Sun, Jan 23, 2022 at 08:55:30PM +1300, Paulo Miguel Almeida wrote:
> >
> > I googled a fair bit of time and I'm 99% confident that there isn't such
> > userspace/lib tool so I guess this will have done the hard way :(
>
> If there is no tool, why was the ioctl code written at all? Something
> had to call it.
>
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 <sys/ioctl.h> /* ioctl */
int file_desc = open("/dev/pi433.0", O_RDWR);
struct pi433_tx_cfg tx_cfg = {
.frequency = 433000000,
.bit_rate = 4800,
<omitted for brevity>...
};
int ret_val = ioctl(file_desc, PI433_IOC_WR_TX_CFG, tx_cfg);
....
thanks,
Paulo Almeida
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
next prev parent reply other threads:[~2022-01-24 4:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-17 7:01 ioctl number change / backwards compatibility doubt Paulo Miguel Almeida
2022-01-17 12:58 ` Greg KH
2022-01-23 7:55 ` Paulo Miguel Almeida
2022-01-23 11:04 ` Greg KH
2022-01-24 4:49 ` Paulo Miguel Almeida [this message]
2022-01-24 6:20 ` Greg KH
2022-03-12 0:05 ` Paulo Miguel Almeida
2022-03-14 12:30 ` Rogério Valentim Feitoza da Silva
2022-03-16 14:07 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220124044906.GA8954@mail.google.com \
--to=paulo.miguel.almeida.rodenas@gmail.com \
--cc=greg@kroah.com \
--cc=kernelnewbies@kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.