From owner-freebsd-drivers@FreeBSD.ORG Thu Nov 16 16:25:27 2006 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7B0E16A403 for ; Thu, 16 Nov 2006 16:25:27 +0000 (UTC) (envelope-from jackie7691@yahoo.com.mx) Received: from web56013.mail.re3.yahoo.com (web56013.mail.re3.yahoo.com [216.252.110.192]) by mx1.FreeBSD.org (Postfix) with SMTP id 214C043D99 for ; Thu, 16 Nov 2006 16:24:34 +0000 (GMT) (envelope-from jackie7691@yahoo.com.mx) Received: (qmail 63610 invoked by uid 60001); 16 Nov 2006 16:24:34 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.mx; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=RqBjVq9OKkN7sN3+81GYDbVL7lvxX/xZhqHPydrpD/F+qgA6Q+O/wmzneN6LPVsk5Rlx59ouitMjSn4mKo6VHf9GtnBSZGxw5b1wRFWu8iy9tg+2x9jRXHUd4NVKQWiO5nat7W7B6mtE2M82rCQfh1tRTyrC2y5A80m4jZcy53U=; X-YMail-OSG: YIMPeb4VM1li2Sn6AdNLiRDeosXLlxWXyjtcyHXWE9UXQ_iYXdpBat.F8bO6.8EpnkKQPtsv9wpnSyTZ.wjq36kkRfbk2RXV8dUjIChkP_ZHDPK_vhHTfLO3lTwoJxgxtsEpF43n7eGQ0fM- Received: from [83.64.77.210] by web56013.mail.re3.yahoo.com via HTTP; Thu, 16 Nov 2006 10:24:34 CST Date: Thu, 16 Nov 2006 10:24:34 -0600 (CST) From: Jacqueline P To: Attilio Rao , Warner Losh In-Reply-To: <3bbf2fe10611081130i1e34ab2end66bf238117cfcf8@mail.gmail.com> MIME-Version: 1.0 Message-ID: <331679.63275.qm@web56013.mail.re3.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-drivers@freebsd.org, jackie7691@yahoo.com.mx Subject: Re: PCCARD - interruptible sleep X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2006 16:25:27 -0000 Hi so what can I do to get my driver running ? Actually I have no idea. Jacqueline Attilio Rao escribió: 2006/11/8, Warner Losh : > From: "Attilio Rao" > Subject: Re: PCCARD - interruptible sleep > Date: Wed, 8 Nov 2006 14:43:59 +0100 > > > 2006/11/8, Jacqueline P : > > > Hi all > > > > > > how can I implement an interruptible sleep within my pccard smart card reader driver like ? > > > For Linux I do this the following way > > > > > > // interruptible_pause() > > > static inline void ipause(unsigned long amount) { > > > set_current_state(TASK_INTERRUPTIBLE); > > > schedule_timeout(amount); > > > } > > > > > > and within my driver I use the function DELAY which does a busy wait. > > > > > > The problem is, that the driver does not recognize when the pccard is detached during a read / write operation. > > > > > > Does the kernel update the struct device_t, so that the driver can use the function device_is_attached() to determine that the device is detached ? > > > > You can implement a 'dying' flag in your softc structure (and > > subsequent macro in order to handle). > > But that won't tell you if the hardware has disappeared. Experience > has shown that dying isn't such a good idea in many cases and tends to > cause more races than it solves. Nothing that can't be solved with a softc lock? Give an example please. Attilio -- Peace can only be achieved by understanding - A. Einstein _______________________________________________ freebsd-drivers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-drivers To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" --------------------------------- Do You Yahoo!? La mejor conexión a Internet y 2GB extra a tu correo por $100 al mes. http://net.yahoo.com.mx