From owner-freebsd-usb@FreeBSD.ORG Sun Oct 21 15:07:31 2007 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23D9816A469 for ; Sun, 21 Oct 2007 15:07:31 +0000 (UTC) (envelope-from emdgaurav@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.225]) by mx1.freebsd.org (Postfix) with ESMTP id B14E613C4A6 for ; Sun, 21 Oct 2007 15:06:42 +0000 (UTC) (envelope-from emdgaurav@gmail.com) Received: by wr-out-0506.google.com with SMTP id 70so593604wra for ; Sun, 21 Oct 2007 08:06:25 -0700 (PDT) Received: by 10.150.189.9 with SMTP id m9mr593973ybf.1192910502843; Sat, 20 Oct 2007 13:01:42 -0700 (PDT) Received: by 10.150.178.13 with HTTP; Sat, 20 Oct 2007 13:01:42 -0700 (PDT) Message-ID: Date: Sun, 21 Oct 2007 01:31:42 +0530 From: "GAURAV GUPTA" To: "Hans Petter Selasky" In-Reply-To: <200710201927.51983.hselasky@c2i.net> MIME-Version: 1.0 References: <200710201927.51983.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-usb@freebsd.org Subject: Re: need help X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Oct 2007 15:07:31 -0000 Hi Petter, Thanks for replying. i am not able to understand ATTATCH function call usb_task itself . how internally this function work in stack and why we need it. I have seen function definition below in USB stack . *struct* usb_task { TAILQ_ENTRY ( usb_task) next ; *void* (*fun)(*void* *); *void* * arg; *char* onqueue; }; *void* usb_add_task ( usbd_device_handle dev , *struct* usb_task*task ); *void* usb_rem_task ( usbd_device_handle dev , *struct* usb_task*task ); #*define* usb_init_task(t, f, a) ((t)-> fun= (f), (t)-> arg = (a), (t)->onqueue = 0) I am looking in code of driver if_axe.c (Dlink lan to usb ) not able to understand function call *usb_init_task(&sc->axe_tick_task, axe_tick_task, sc);* I understand this question look very basic or silly ,but i am really looking for your input .. we are in college and just started to understand to BSD . Thanks, Gaurav On 10/20/07, Hans Petter Selasky wrote: > > On Saturday 20 October 2007, GAURAV GUPTA wrote: > > Hi all, > > > > Can anyone explain me the functionality of this standard function. > > I am beginner in this BSD area,so cudn'n get the details clear. > > > > #define usb_init_task(t, f, a) ((t)->fun = (f), (t)->arg = (a), > > (t)->onqueue = 0) > > > > The macro initialises a task structure. > > --HPS >