From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-la0-x236.google.com ([2a00:1450:4010:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WpHoe-0006vJ-03 for barebox@lists.infradead.org; Tue, 27 May 2014 13:53:21 +0000 Received: by mail-la0-f54.google.com with SMTP id pv20so6580387lab.27 for ; Tue, 27 May 2014 06:52:56 -0700 (PDT) Date: Tue, 27 May 2014 18:04:11 +0400 From: Antony Pavlov Message-Id: <20140527180411.9c1c650b8e9d19fdcec7614d@gmail.com> In-Reply-To: References: <20140525135819.ebfd62810f698e8f13dbf558@gmail.com> <1401097557.4829.20.camel@weser.hi.pengutronix.de> <20140526160933.db2250dd20bc4c385d56c747@gmail.com> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [RFC] [WIP] incorporate picotcp into barebox: a small demo To: Daniele Lacamera Cc: Kristof Roelants , barebox , Sam Van Den Berge , Daniele Lacamera T24gVHVlLCAyNyBNYXkgMjAxNCAxMTo0NjoyOSArMDIwMApEYW5pZWxlIExhY2FtZXJhIDxkYW5p ZWxlLmxhY2FtZXJhQHRhc3MuYmU+IHdyb3RlOgoKPiBBbnRvbnksIHJlZ2FyZGluZyB5b3VyIGNv bW1lbnRzIG9uIHBpY290Y3AgImNsZWFuaW5nIiwgY291bGQgeW91Cj4gcGxlYXNlIGVsYWJvcmF0 ZSBhIGJpdCBtb3JlLCB0YWtpbmcgaW50byBhY2NvdW50IG15IGNvbW1lbnRzIGJlbG93Pwo+IAo+ IE9uIE1vbiwgTWF5IDI2LCAyMDE0IGF0IDI6MDkgUE0sIEFudG9ueSBQYXZsb3YgPGFudG9ueW5w YXZsb3ZAZ21haWwuY29tPiB3cm90ZToKPiA+IFBpY290Y3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