From patchwork Fri Feb 13 06:33:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dileep Katta X-Patchwork-Id: 44671 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DEC672153D for ; Fri, 13 Feb 2015 06:34:49 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u10sf9448607lbd.3 for ; Thu, 12 Feb 2015 22:34:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=Yv44+5LSVxpFmjJclibNX1tPfnIce2OmcpfGdaTQBaY=; b=ZXSH3btNHrYaQXwrPX83JYR7ZOIC+TTpSMEVkK9/CuhEqLCfPpGnlm5cyHIRb72lKM Ap4/DiLDSRK5iE6UCoOCyz/IT/6DRwRBMia0E4lRadhpOIeSRhvH6RL94/YbE4ZoyTHe Knppr9fhz5Rvrmyzstv3xT0I6orpanuk60a9ZtYP/0fLSepcP+84y5eFFRx+4As7e8Hz AUlLGfkmXx1cAVAFxbrXMeXrR34JypQdjJeNhG4uHFhk/5akYKm4D3PwKkPPoNFTA/7P s+s8c5q9HOJs3Mu7KN6naddmjp9f9Zlig55K7doP/HDLjxpT6HJkz2uCh81AvjKXqhyb NrBw== X-Gm-Message-State: ALoCoQk2zi4TxOX2plshQMr8CWy6ftWCfsIksgzkDzXUU9Mllt6HTwSb1j/W654TF+MOxjUWLJVZ X-Received: by 10.112.160.3 with SMTP id xg3mr1080792lbb.5.1423809288775; Thu, 12 Feb 2015 22:34:48 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.74 with SMTP id r10ls240942lag.17.gmail; Thu, 12 Feb 2015 22:34:48 -0800 (PST) X-Received: by 10.152.45.37 with SMTP id j5mr6524894lam.110.1423809288493; Thu, 12 Feb 2015 22:34:48 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id o8si858180laj.121.2015.02.12.22.34.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 22:34:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id b6so13695616lbj.2 for ; Thu, 12 Feb 2015 22:34:48 -0800 (PST) X-Received: by 10.112.37.197 with SMTP id a5mr6533146lbk.19.1423809288416; Thu, 12 Feb 2015 22:34:48 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp882215lbj; Thu, 12 Feb 2015 22:34:48 -0800 (PST) X-Received: by 10.180.5.131 with SMTP id s3mr3909250wis.82.1423809287865; Thu, 12 Feb 2015 22:34:47 -0800 (PST) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id ct6si2135427wjb.67.2015.02.12.22.34.46; Thu, 12 Feb 2015 22:34:47 -0800 (PST) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AAED4A74BE; Fri, 13 Feb 2015 07:34:46 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iBoSJrA0Ci3a; Fri, 13 Feb 2015 07:34:46 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1937FA74A1; Fri, 13 Feb 2015 07:34:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 30673A74A1 for ; Fri, 13 Feb 2015 07:34:43 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IWaVSqxSS4An for ; Fri, 13 Feb 2015 07:34:43 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by theia.denx.de (Postfix) with ESMTPS id AD537A7442 for ; Fri, 13 Feb 2015 07:34:39 +0100 (CET) Received: by mail-pa0-f53.google.com with SMTP id lf10so16750606pab.12 for ; Thu, 12 Feb 2015 22:34:38 -0800 (PST) X-Received: by 10.68.242.200 with SMTP id ws8mr12984653pbc.138.1423809278099; Thu, 12 Feb 2015 22:34:38 -0800 (PST) Received: from localhost.localdomain ([210.177.145.249]) by mx.google.com with ESMTPSA id xx7sm5653479pab.21.2015.02.12.22.34.32 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 22:34:37 -0800 (PST) From: Dileep Katta To: u-boot@lists.denx.de, robherring2@gmail.com, trini@ti.com, rob.herring@linaro.org, srae@broadcom.com, l.majewski@samsung.com, angelabaker@ti.com Date: Fri, 13 Feb 2015 14:33:43 +0800 Message-Id: <1423809223-24219-3-git-send-email-dileep.katta@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1423809223-24219-1-git-send-email-dileep.katta@linaro.org> References: <1423809223-24219-1-git-send-email-dileep.katta@linaro.org> Cc: Dileep Katta Subject: [U-Boot] [PATCH v1 3/3] usb: gadget: fastboot: Set the Serial Number for Fastboot Gadget X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dileep.katta@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Configure the serial number using the serial# environment variable during the fastboot bind. This enables "fastboot devices" to return the serial number for the attached devices. Signed-off-by: Dileep Katta --- drivers/usb/gadget/f_fastboot.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 0d53a61..d114c07 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -136,6 +136,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f) int id; struct usb_gadget *gadget = c->cdev->gadget; struct f_fastboot *f_fb = func_to_fastboot(f); + const char *s; /* DYNAMIC interface numbers assignments */ id = usb_interface_id(c, f); @@ -161,6 +162,10 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f) hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress; + s = getenv("serial#"); + if (s) + g_dnl_set_serialnumber((char *)s); + return 0; }