Custom ioctl on Linux FORE200E ATM driver

  • Thread starter dalves
  • Start date
  • Tags
    Linux
In summary, it is not possible to pass a user-space pointer to the FORE200E Linux ATM driver using ioctl(). Instead, the recommended approach is to use the mmap() system call to map a file descriptor into memory and access the pointer directly from user-space.
  • #1
dalves
4
0
I need to pass a user-space pointer for a 64 bit memory chunk to the FORE200E Linux ATM driver so that the driver can write in it. I was thinking of using the ioctl() call to perform this custom "operation" of recording the user-space pointer in the driver module.

I open the socket without a problem:

atmSocket = socket(PF_ATMPVC, SOCK_DGRAM, 0);

I can do setsockopt(atmSocket, ...), send(atmSocket, ...) and recv(atmSocket, ...) calls also without a problem.

However, regardless of the cmd I pass to the ioctl() call, it always fails with the "No such device" error message:

int someInt;
ioctl(atmSocket, FIOGETOWN, &someInt);
perror("ioctl");

-> ioctl: No such device
 
Last edited:
Technology news on Phys.org
  • #2
Is it possible to pass a user-space pointer to the FORE200E Linux ATM driver using ioctl? If yes, what is the proper way of doing this? No, it is not possible to use ioctl() to pass a user-space pointer to the FORE200E Linux ATM driver. The FORE200E Linux ATM driver does not support the ioctl() call, so it is not possible to use the ioctl() call to send the user-space pointer.The best way to pass a user-space pointer to the FORE200E Linux ATM driver would be to use the mmap() system call. The mmap() system call is used to map a file descriptor (or any other object) into memory and then access that memory directly from the user-space. This is the recommended approach for passing user-space pointers to the FORE200E Linux ATM driver.
 

1. What is a custom ioctl on the Linux FORE200E ATM driver?

A custom ioctl (input/output control) is a system call on the Linux operating system that allows users to send commands directly to a device driver. In this case, the FORE200E ATM driver is a driver for ATM (Asynchronous Transfer Mode) networking devices, and a custom ioctl can be used to control and configure the settings of these devices.

2. How do I use custom ioctl on the Linux FORE200E ATM driver?

To use custom ioctl on the Linux FORE200E ATM driver, you will first need to obtain the necessary header files for the driver. Then, you can use the ioctl system call with the appropriate command and arguments to communicate with the driver and configure the settings of your ATM device.

3. What are some common commands that can be used with custom ioctl on the Linux FORE200E ATM driver?

Some common commands that can be used with custom ioctl on the Linux FORE200E ATM driver include setting the VPI (Virtual Path Identifier) and VCI (Virtual Channel Identifier) values, enabling or disabling specific features of the ATM device, and retrieving information about the device's current status.

4. Are there any risks associated with using custom ioctl on the Linux FORE200E ATM driver?

As with any system call, there is always a risk of causing system instability or crashes if the ioctl commands are used incorrectly. It is important to thoroughly read the documentation and understand the potential consequences before using custom ioctl on the Linux FORE200E ATM driver.

5. Can custom ioctl be used on other device drivers besides the FORE200E ATM driver?

Yes, custom ioctl can be used on any device driver that supports this type of system call. However, the commands and arguments may differ depending on the specific driver and device being used.

Similar threads

  • Programming and Computer Science
Replies
3
Views
310
  • Programming and Computer Science
2
Replies
60
Views
16K
  • Computing and Technology
Replies
6
Views
5K
Replies
2
Views
5K
  • STEM Academic Advising
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
4K
  • Special and General Relativity
Replies
13
Views
2K
  • Programming and Computer Science
Replies
2
Views
3K
Back
Top