linux-device-driver

How does my Framebuffer driver get named/specified from the command line?

I've written code for an Epson SED1335 lcd driver (not the 1355) and I would like the driver to behave as a FB driver. When it's all said and done, how is the driver named in the kernel command line? Is it the same name given to the name field in the device_driver structure? Ex. the 1355 driver populates this field with "epson1355fb"...

module_init and init_module of linux

I have been trying to port few linux drivers and realized that there is substantial difference between kernel version 2.4 and 2.6 of linux. In the 2.4 version of kernel, the module programming was as below - #define MODULE #include <linux/module.h> #include <linux/kernel.h> int init_module(void) { printk(KERN_INFO "Hi \n"); re...

how to find if unregister_chrdev() call was successful

unregister_chrdev() call from [linux\fs.h] used to return 0 if successful and <0 other wise. But now, in newer kernel versions, the return value of the function has been changed to void so it no longer returns any thing. Question: Is there any way to find out if the unregister_chrdev() call was successful or not? ...

When to use /proc and when /dev

I need to write a kernel module that is not a device driver. That module will be communicating with some user space processes. As I dont want to use ioctl(), I am left with either creating a file in /proc directory or creating a device file in /dev directory. Question: How do i decide between /proc and /dev. Is this just a judgement cal...

Streaming audio to a "speaker server" in linux

Is there a way to stream all audio from a laptop (which has low quality speakers) to a desktop with much better speakers in linux (on both computers)? I think that this would have to be a kernel driver, since it would have to fit under the alsa system to make it application transparent. Thanks, Andrew ...

Correct lock to use in linux character driver

Hello everyone, I am writing a simple character device driver. (kernel 2.6.26) Multiple concurrent reader & writers are expected. I am not sure what type of lock is best used to synchronize a short access to internal structures. Any advice will be most appreciated ...

Linux equivalent of Windows Device Manager / DevCon utility?

Hello, I was wondering if there is any Linux equivalent to Windows Device Manager, or the Windows DevCon utility (a command line utility with hardware management functionality). Do drivers even work the same way in Linux? Thanks! R ...

What options do we have for communication between a user program and a Linux Kernel Module?

I am a new comer to Linux Kernel Module programming. From the material that I have read so far, I have found that there are 3 ways for a user program to request services or to communicate with a Linux Kernel Module a device file in /dev a file in /proc file system ioctl() call Question: What other options do we have for communicatio...

How to use netlink socket to communicate with a kernel module?

I am trying to write a linux kernel module that communicates with user process using netlink. I am using netlink because the user program I want to communicate to communicates only using sockets and I cant change that to add ioctl() or anything. Problem is that I cant figure out how to do that. I have googled but all examples I found ar...

Help monitoring battery status through SMBus

I am currenlty trying to monitor my battery status through SMBus. I have a battery along with a contorl board which constantly outputs the battery status. This control board is then connected to my mother board through a I2C-USB module. I need to write some program to recognize the SMBus connection and transmit the battery status to the ...

Whose responsibility is it to free sk_buff

While creating a netlink socket using netlink_kernel_create() a function pointer is passed as argument to this function which is called when a message is received on this socket. This call back function receives an sk_buff as parameter which contains the message received. My question is that whose responsibility is it to free this sk_bu...

Remove USB Host Controller driver from Linux

Can you please let me know how do i disable/remove the USB Host Controller driver from the kernel. Is there a way I can unhook the usb driver module from the kernel. Linux 2.6.24.7-r1116 / Fedora ...

Mapping DMA buffers to userspace

hi everybody, i am writing a device driver on linux-2.6.26. I want to have a dma buffer mapped into userspace for sending data from driver to userspace application. Please suggest some good tutorial on it. Thanks ...

how do i create a buffer which is not cached?

i have to make a driver in linux kernel which allocates buffers and provides them to userspace via mmap. How do i ensure that these buffers aren't cached? ...

Are there any memory restrictions on Linux Kernel Modules?

Are there any restrictions on memory usage by a Linux Kernel Module i.e Code Segment size or amount of global memory or any thing. ...

How to control access right on a SCSI disk in Linux?

I'm trying to lock a SCSI device (a shared storage disk) using ioctl but I can't find a highlevel API for this and I'm not sure which commands to use. Basically I want to be able to do the four operations mentioned here: http://docs.sun.com/app/docs/doc/816-5177/mhd-7i?l=en&amp;n=1&amp;a=view (See: Non-shared multihost disk). I already h...

How to use mpc8xxx_gpio.c device driver

Hi, I am new to device driver development. I am trying to access the GPIO of MPC837xERDB eval board. I have upgraded its kernel to linux-2.6.28.9 and enable support for mpc8xxx_gpio.c. On boot up, it successfully detect two gpio controllers. Now my question is how I am going to use it to communicate with the gpio pins? Do I have to modi...

Chaning the I2C address on-the-fly of a linux device driver

I have two cameras attached to my linux system. The cameras are controlled via I2C. The device driver for a single camera is based on the i2c-core device driver. I want to switch between the two cameras. Therefore, I want to change the I2C address on the fly to control one or the other camera. Is this reasonable? If yes, is there a func...

Writing an API to communicate with a device connected on Serial port

I am afraid that several terminologies in my question are wrong. Please bear with me and correct me wherever I am wrong. I have to write a library/program that will provide set of function to operate a card reader attached at Serial Port. Like to eject card that was inserted in it, user will simply have to call in his code, for example,...

Why can't certain USB Mass Storage Devices be detected by some hardware?

I am trying to modify a mass storage driver using the composite usb framework to allow an embedded mass storage device to be visible on my Xbox 360. I have confirmed that this is not a simple VendorID/ProductID block. I would like to understand what specifically prevents some devices, say the Xbox 360, from seeing certain mass storage ...