ioctl number change / backwards compatibility doubt
Paulo Miguel Almeida
paulo.miguel.almeida.rodenas at gmail.com
Sun Jan 23 23:49:06 EST 2022
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
More information about the Kernelnewbies
mailing list