From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from 6.mo3.mail-out.ovh.net ([188.165.43.173] helo=mo3.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SMDaw-0006hU-PN for barebox@lists.infradead.org; Mon, 23 Apr 2012 07:22:12 +0000 Received: from mail622.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo3.mail-out.ovh.net (Postfix) with SMTP id 8DF8CFFA6CF for ; Mon, 23 Apr 2012 09:23:30 +0200 (CEST) From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 23 Apr 2012 09:02:13 +0200 Message-Id: <1335164539-2188-4-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <20120423065650.GM20601@game.jcrosoft.org> References: <20120423065650.GM20601@game.jcrosoft.org> 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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 04/10] net: Add support for IXP4xx ethernet support To: barebox@lists.infradead.org Cc: =?UTF-8?q?Krzysztof=20Ha=C5=82asa?= RnJvbTogS3J6eXN6dG9mIEhhxYJhc2EgPGtoY0BwbS53YXcucGw+CgpTaWduZWQtb2ZmLWJ5OiBL cnp5c3p0b2YgSGHFgmFzYSA8a2hjQHBtLndhdy5wbD4KU2lnbmVkLW9mZi1ieTogSmVhbi1DaHJp c3RvcGhlIFBMQUdOSU9MLVZJTExBUkQgPHBsYWduaW9qQGpjcm9zb2Z0LmNvbT4KLS0tCiBhcmNo L2FybS9tYWNoLWl4cDR4eC9kZXZpY2VzLmMgfCAgIDM1ICsrCiBkcml2ZXJzL25ldC9LY29uZmln ICAgICAgICAgICAgfCAgICA4ICsKIGRyaXZlcnMvbmV0L01ha2VmaWxlICAgICAgICAgICB8ICAg IDEgKwogZHJpd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