From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: RFC: minimalistic TLV implementation Date: Thu, 01 Jun 2006 15:38:17 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id D7690129 for ; Thu, 1 Jun 2006 15:38:28 +0200 (MEST) Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 554031EBB3 for ; Thu, 1 Jun 2006 15:38:18 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Jaroslav Kysela Cc: ALSA development List-Id: alsa-devel@alsa-project.org At Thu, 1 Jun 2006 15:12:05 +0200 (CEST), Jaroslav Kysela wrote: > > On Thu, 1 Jun 2006, Takashi Iwai wrote: > > > At Wed, 31 May 2006 15:10:21 +0200 (CEST), > > Jaroslav Kysela wrote: > > > > > > Hi, > > > > > > I've created a minimalistic TLV implemetation for the driver side. > > > Please, review and comment it. We can add more TLV funcionality in future. > > > It is essential that user space will handle SNDRV_CTL_TLVT_LEVEL type > > > immediately (altough it is not used in the kernel space now), otherwise we > > > cannot group and level TLVs in future. > > > > Please never ever include pointers in the ioctl struct. > > That's to be avoided as much as possible. > > > > +struct snd_ctl_tlv { > > > + unsigned int flags; > > > + unsigned int length; > > > + unsigned int value; > > > + /* > > > + * TLV structure is: > > > + * unsigned int length > > > + * unsigned int type - see SNDRV_CTL_TLVT_* > > > + * .... data aligned to sizeof(unsigned int), use > > > + * block_length = (length + (sizeof(unsigned int) - 1)) & > > > + * ~(sizeof(unsigned int) - 1)) .... > > > + */ > > > + void *ptr; > > > +}; > > So what you suggest? Something like 'struct dm_ioctl' > (include/linux/dm-ioctl.h) does? Data are stored after ioctl struct. > It's nearly similar. Yes. It's similar but a really big difference if you consider about 32/64bit compatibility. Also, the order of "TLV" is type-length-value. Takashi