From: Takashi Iwai Subject: Re: Where to put code for a new ioctl. Date: Mon, 28 Nov 2005 12:44:11 +0100 Message-ID: References: <4389943D.20100@superbug.co.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <4389943D.20100@superbug.co.uk> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: James Courtier-Dutton Cc: alsa-devel List-Id: alsa-devel@alsa-project.org At Sun, 27 Nov 2005 11:10:53 +0000, James Courtier-Dutton wrote: > > I am looking at alsa-lib. > ./src/control/control_hw.c is there the actual ioctl call goes. > ./src/control/control.c calls the routine in control_hw.c > ./src/control/hcontrol.c calls the routine in control.c > ./src/mixer/simple_none.c handles the call from the user app, it then > calls ??? hcontrol.c or control.c ? > > So, my question is, if I have to write code between the user apps > request and the ioctl. The purpose of the code is to take the request > from the user, and then encapsulate it in the ioctl specific format, and > then call the ioctl. Do I implement this encapsulating code in control.c > or hcontrol.c ? I vote for control.c. But, anyway, I feel that the current implementation of mixer is too complex. There are too many layers. How about to reduce hcontrol stuff? It's been never used except as a handle. BTW, James, please remember that you need a new ioctl just for limited drivers. For dB conversion, only usb-audio, hda-codec and possibly emu10k1 (for user-space controls) would use this ioctl. The other drivers don't need this ioctl at all - in other words, the dB conversion table shouldn't be implemented on the kernel space but on user space. So, please consider the above, the existence of user-space dB conversion, for the further implementation. i.e. don't assume that you have always this ioctl for every driver. Rather it's a rare case. Takashi ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click