From owner-freebsd-firewire@FreeBSD.ORG Fri Feb 8 21:06:21 2008 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2DD416A417; Fri, 8 Feb 2008 21:06:21 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from plato.miralink.com (mail.miralink.com [70.103.185.20]) by mx1.freebsd.org (Postfix) with ESMTP id 8F87713C457; Fri, 8 Feb 2008 21:06:21 +0000 (UTC) (envelope-from sbruno@miralink.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by plato.miralink.com (Postfix) with ESMTP id 1D6E261B853; Fri, 8 Feb 2008 13:06:21 -0800 (PST) Received: from plato.miralink.com ([127.0.0.1]) by localhost (plato.miralink.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01245-05; Fri, 8 Feb 2008 13:06:19 -0800 (PST) Received: from iago.office.miralink.com (iago.office.miralink.com [10.0.0.40]) by plato.miralink.com (Postfix) with ESMTP id BBFF061B3BE; Fri, 8 Feb 2008 13:06:19 -0800 (PST) Message-ID: <47ACC44B.9090504@miralink.com> Date: Fri, 08 Feb 2008 13:06:19 -0800 From: Sean Bruno User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Hidetoshi Shimokawa References: <47A79E13.5040706@miralink.com> <626eb4530802042020n78001c00kddbdedb907902691@mail.gmail.com> <47A7E550.7060500@miralink.com> <626eb4530802042043t3e0ce8d1l83f64b2d3ea48b1c@mail.gmail.com> <47AA13FB.4080209@miralink.com> <47AA1C78.1080305@miralink.com> In-Reply-To: <47AA1C78.1080305@miralink.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DSPAM-Result: Innocent X-DSPAM-Processed: Fri Feb 8 13:06:20 2008 X-DSPAM-Confidence: 0.9997 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 47acc44c226427852419847 X-DSPAM-Factors: 27, X-Virus-Scanned: amavisd-new at X-Spam-Status: No, score=-4.499 tagged_above=-10 required=6.6 autolearn=ham tests=[ALL_TRUSTED=-1.8, BAYES_00=-2.599, DSPAM_HAM=-0.1] X-Spam-Score: -4.499 X-Spam-Level: Cc: freebsd-firewire@freebsd.org Subject: Re: Implementation of the AGENT_STATE Register X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2008 21:06:21 -0000 Hidetoshi: Can you review this and correct it where needed? I am sure that it is wrong, but I haven't tested it yet. struct agent_state { uint32_t fetch_agent_state; #define AGENT_STATE_RESET 0 #define AGENT_STATE_ACTIVE 1 #define AGENT_STATE_SUSPENDED 2 #define AGENT_STATE_DEAD 3 uint32_t bus_reset_command_reset_init_vals; uint32_t read_vals; uint32_t write_effects; }; static void sbp_targ_send_agent_state(struct fw_xfer *xfer) { struct agent_state *current_state; struct fw_pkt *rfp; /* response to request --> from target */ xfer->send.payload = malloc(sizeof(struct agent_state), M_SBP_TARG, M_NOWAIT | M_ZERO); xfer->send.pay_len = ntohs(sizeof(struct agent_state)); xfer->send.spd = FWSPD_S400; current_state = (struct agent_state *)xfer->send.payload; current_state->fetch_agent_state = AGENT_STATE_ACTIVE; rfp = &xfer->recv.hdr; rfp->mode.rresb.tcode = FWTCODE_RRESB; rfp->mode.rresb.rtcode = 0; rfp->mode.rresb.extcode = 0; xfer->send.hdr.mode.hdr.dst = ntohs(rfp->mode.hdr.src); xfer->hand = fw_xfer_free_buf; rfp->mode.hdr.pri = 0; fw_asyreq(xfer->fc, -1, xfer); } Sean