From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 28 22:13:33 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1809816A41F for ; Wed, 28 Sep 2005 22:13:33 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from ni-mail1.dna.utvinternet.net (mail1.u.tv [194.46.8.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 763EB43D48 for ; Wed, 28 Sep 2005 22:13:31 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from mail.cobbled.net (unverified [194.46.136.88]) by ni-mail1.dna.utvinternet.net (Vircom SMTPRS 4.2.420.1) with ESMTP id ; Wed, 28 Sep 2005 23:13:26 +0100 X-Modus-BlackList: 194.46.136.88=OK;fergus@cobbled.net=OK X-Modus-Trusted: 194.46.136.88=YES Received: from eyore.cobbled.net (localhost [127.0.0.1]) by mail.cobbled.net (8.12.10/8.12.10) with ESMTP id j8SMDNTI000895; Wed, 28 Sep 2005 23:13:23 +0100 (BST) (envelope-from fergus@eyore.public.cobbled.net) Received: (from fergus@localhost) by eyore.cobbled.net (8.12.10/8.12.10/Submit) id j8SMDMYK000894; Wed, 28 Sep 2005 23:13:22 +0100 (BST) (envelope-from fergus) Date: Wed, 28 Sep 2005 23:13:22 +0100 From: n0g0013 To: rashmi ns Message-ID: <20050928221322.GB267@eyore.cobbled.net> Mail-Followup-To: rashmi ns , bugi@lists.redbrick.dcu.ie, freebsd-hackers@freebsd.org References: <9f999316050928011010542946@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f999316050928011010542946@mail.gmail.com> X-Mailman-Approved-At: Thu, 29 Sep 2005 11:54:53 +0000 Cc: freebsd-hackers@freebsd.org, bugi@lists.redbrick.dcu.ie Subject: Re: [BUGI] IOCTL :Facing problems while acccessing data from kernel space X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 22:13:33 -0000 On 28.09-13:40, rashmi ns wrote: [ ... ] > I was trying to add a new ioctl command like > > #define HDLCMODE _IOR('6',0xF,int) > > when i trying to uprintf the data which was sent from the user-space in > > the device-driver-ioctl-routine i'll get a different value than which was > > passed. Can anybody please tell me why this is happening . I pass the > > address of an integer where data is stored from the user space as third arg > > to the ioctl call . i would guess that it's a simple typo and your pointer conversions are off somewhere. i.e. uprintf( "%d", (int*)data ) ; instead of uprintf( "%d", *(int*)data ) ; otherwise, use a debugger or post the code. -- t t w