From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j0hmI-0005Hg-8N for barebox@lists.infradead.org; Sun, 09 Feb 2020 08:17:20 +0000 Date: Sun, 9 Feb 2020 09:17:13 +0100 From: Oleksij Rempel Message-ID: <20200209081713.bkcqj2syfhjnog3g@pengutronix.de> References: <20200109072855.14154-1-antonynpavlov@gmail.com> <20200109072855.14154-5-antonynpavlov@gmail.com> <20200209093013.be5535bdf036ab3e227912ba@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200209093013.be5535bdf036ab3e227912ba@gmail.com> 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 4/5] net: rtl8169: make it work on big-endian system To: Antony Pavlov Cc: barebox@lists.infradead.org, Peter Mamonov SGksCgpPbiBTdW4sIEZlYiAwOSwgMjAyMCBhdCAwOTozMDoxM0FNICswMzAwLCBBbnRvbnkgUGF2 bG92IHdyb3RlOgo+IE9uIFR1ZSwgNCBGZWIgMjAyMCAxNTowMzo1MyArMDEwMAo+IE9sZWtzaWog UmVtcGVsIDxvLnJlbXBlbEBwZW5ndXRyb25peC5kZT4gd3JvdGU6Cj4gCj4gPiBIaSBBbnRvbnks Cj4gPiAKPiA+IGRvIHlvdSB3b250IHRvIHJlc2VudCB0aGlzIHBhdGNoZXMgYXMgbm90IFJGQz8K PiAKPiBIaSEKPiAKPiBJIHdhbnQgdG8gdGVzdCBQQ0ktcmVsYXRlZCBwYXRjaGVzIG9uIEFSTSBi ZWZvcmUgcmVzZW5kaW5nCj4gKGVzcGVjaWFsbHkgJ25ldDogZTEwMDA6IG1ha2UgaXQgd29yayB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19waHlz KHByaXYtPnJ4X2J1ZiArCj4gPiA+IC0JCQkJICAgICAgICAgICAgIGVudHJ5ICogUEtUX0JVRl9T SVpFKTsKPiA+ID4gKwkJCQljcHVfdG9fbGUzMih2aXJ0X3RvX3BoeXMocHJpdi0+cnhfYnVmICsK PiA+ID4gKwkJCQkgICAgICAgICAgICAgZW50cnkgKiBQS1RfQlVGX1NJWkUpKTsKPiA+ID4gICAJ CX0gZWxzZSB7Cj4gPiA+ICAgCQkJZGV2X2VycigmZWRldi0+ZGV2LCAicnggZXJyb3JcbiIpOwo+ ID4gPiAgIAkJfQo+ID4gPiAKPiA+IAo+ID4gS2luZCByZWdhcmRzLAo+ID4gT2xla3NpaiBSZW1w ZWwKPiA+IAo+ID4gLS0gCj4gPiBQZW5ndXRyb25peCBlLksuICAgICAgICAgICAgICAgICAgICAg ICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAo+ID4gSW5kdXN0cmlhbCBMaW51 eCBTb2x1dGlvbnMgICAgICAgICAgICAgICAgIHwgaHR0cDovL3d3dy5wZW5ndXRyb25peC5kZS8g IHwKPiA+IFBlaW5lciBTdHIuIDYtOCwgMzExMzcgSGlsZGVzaGVpbSwgR2VybWFueSB8IFBob25l OiArNDktNTEyMS0yMDY5MTctMCAgICB8Cj4gPiBBbXRzZ2VyaWNodCBIaWxkZXNoZWltLCBIUkEg MjY4NiAgICAgICAgICAgfCBGYXg6ICAgKzQ5LTUxMjEtMjA2OTE3LTU1NTUgfAo+IAo+IAo+IAoK LS0gClBlbmd1dHJvbml4IGUuSy4gICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8ClN0ZXVlcndhbGRlciBTdHIuIDIxICAgICAgICAgICAgICAg ICAgICAgICB8IGh0dHA6Ly93d3cucGVuZ3V0cm9uaXguZGUvICB8CjMxMTM3IEhpbGRlc2hlaW0s IEdlcm1hbnkgICAgICAgICAgICAgICAgICB8IFBob25lOiArNDktNTEyMS0yMDY5MTctMCAgICB8 CkFtdHNnZXJpY2h0IEhpbGRlc2hlaW0sIEhSQSAyNjg2ICAgICAgICAgICB8IEZheDogICArNDkt NTEyMS0yMDY5MTctNTU1NSB8CgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fXwpiYXJlYm94IG1haWxpbmcgbGlzdApiYXJlYm94QGxpc3RzLmluZnJhZGVhZC5v cmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9iYXJlYm94Cg==