Date: Thu, 31 Dec 1998 10:34:44 -0500 (EST) From: Larry Lile <lile@stdio.com> To: hackers@FreeBSD.ORG Subject: ifmedia and token-ring (Help!!) (fwd) Message-ID: <Pine.BSF.4.05.9812311032240.5164-300000@heathers.stdio.com>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-665532085-914957328=:7114 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: <Pine.BSF.4.05.9812311032242.5164@heathers.stdio.com> I am trying to get ifmedia working for my Olicom token-ring driver but I am having some strange problems. First when I have probed/attached the card and ifconfig it it comes up with this: oltr1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 18000 inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255 lladdr 00:00:83:2f:c3:ad media: autoselect (<unknown type>) supported media: UTP/16Mbit UTP/4Mbit autoselect I really don't understand why I am getting "(<unknown type>)" and I can only select "UTP/4Mbit" or "autoselect" but not "UTP/16Mbit". I have attached my patches to the if_media.h file and my driver. I am not attached to to names or values for anything I changed in if_media. I also forgot to add the 4/16 Fiber values... Their is also an issue of mode, there is "classic" mode which is compatible with the old ibm type of token-ring, "dedicated" mode where you are expected to be hooked directly to a token-ring switch and also a autosense mode. I am not quite sure where this should fit in but I put it in as a type option. Any help? Larry Lile lile@stdio.com --0-665532085-914957328=:7114 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="if_oltr.c" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.BSF.4.05.9812291348480.7114@heathers.stdio.com> Content-Description: Olicom Token-ring driver Content-Disposition: ATTACHMENT; FILENAME="if_oltr.c" LyogDQogKiBDb3B5cmlnaHQgKGMpIDE5OTgsIExhcnJ5IExpbGUNCiAqIEFs bCByaWdodHMgcmVzZXJ2ZWQuDQogKg0KICogRm9yIGxhdGVzdCBzb3VyY2Vz IGFuZCBpbmZvcm1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LT5jb25maWcgPSAmb2x0cl9jb25maWdbaV07 DQogICAgICAgICAgICAgICAgaWYgKGlzLT5pZF9pcnEgPT0gMCkNCiAgICAg ICAgICAgICAgICAgICAgaXMtPmlkX2lycSA9ICgxIDw8IHNjLT5jb25maWct PmludGVycnVwdGxldmVsKTsgICAgICAgICAvKiBDbGFpbSBvdXIgaW50ZXJy dXB0ICovDQogICAgICAgICAgICAgICAgaXMtPmlkX2ludHIgPSAoaW50aGFu ZDJfdCAqKW9sdHJfaW50cjsNCiAgICAgICAgICAgICAgICByZWdpc3Rlcl9p bnRyKGZmcyhpcy0+aWRfaXJxKSAtIDEsIGlzLT5pZF9pZCwgaXMtPmlkX3Jp X2ZsYWdzLCBpcy0+aWRfaW50ciwgJm5ldF9pbWFzaywgaXMtPmlkX3VuaXQp Ow0KICAgICAgICAgICAgICAgIGlmICgoaXMtPmlkX2RycSA9PSAweGZmZmZm ZmZmKSAmJiAoc2MtPmNvbmZpZy0+ZG1hbGV2ZWwgIT0gVFJMTERfRE1BX1BJ TykpDQogICAgICAgICAgICAgICAgICAgIGlzLT5pZF9kcnEgPSBzYy0+Y29u ZmlnLT5kbWFsZXZlbDsgICAgICAgICAgICAgICAgICAgICAgLyogQ2xhaW0g b3VyIGRtYSBjaGFubmVsICovDQogICAgICAgICAgICAgICAgcHJpbnRmKCJv bHRyJWQ6IDwlcz4gWyU2RF1cbiIsIGlzLT5pZF91bml0LCBBZGFwdGVyTmFt ZVtzYy0+Y29uZmlnLT50eXBlXSwgc2MtPmNvbmZpZy0+bWFjYWRkcmVzcywg IjoiKTsNCiAgICAgICAgICAgICAgICBzYy0+aHdfc3RhdGUgPSBIV19GT1VO RDsNCiAgICAgICAgICAgICAgICByZXR1cm4oMSk7DQogICAgICAgICAgICB9 DQogICAgICAgIH0NCiAgICB9DQogICAgcmV0dXJuKDApOyAvKiBDYXJkIHdh cyBub3QgZm91bmQgKi8NCn0NCg0KI2lmIE5QQ0kgPiAwDQpzdGF0aWMgY29u c3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YyA9PSBUUkxMRF9QQ0lDT05GSUdfT0sp IHx8IChyYyA9PSBUUkxMRF9QQ0lDT05GSUdfU0VUX0NPTU1BTkQpKSB7DQog ICAgICAgICAgICBpZiAocmMgPT0gVFJMTERfUENJQ09ORklHX1NFVF9DT01N QU5EKSB7DQogICAgICAgICAgICAgICAgcHJpbnRmKCJvbHRyOiBzZXR0aW5n IGJ1cy1tYXN0ZXIgbW9kZVxuIik7DQogICAgICAgICAgICAgICAgY29tbWFu ZCA9IHBjaV9jb25mX3JlYWQoY29uZmlnX2lkLCBQQ0lSX0NPTU1BTkQpOw0K ICAgICAgICAgICAgICAgIHBjaV9jb25mX3dyaXRlKGNvbmZpZ19pZCwgUENJ Ul9DT01NQU5ELCAoY29tbWFuZCB8IFBDSU1fQ01EX0JVU01BU1RFUkVOKSk7 DQogICAgICAgICAgICB9DQogICAgICAgICAgICBwY2lfY2FyZHMrKzsNCiAg ICAgICAgICAgIHJldHVybiAoQWRhcHRlck5hbWVbb2x0cl9jb25maWdbal0u dHlwZV0pOw0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgaWYgKHJj ID09IFRSTExEX1BDSUNPTkZJR19GQUlMKQ0KICAgICAgICAgICAgICAgIHBy aW50Zigib2x0cjogVFJsbGRQQ0lDb25maWcgZmFpbGVkIVxuIik7DQogICAg ICAgICAgICBpZiAocmMgPT0gVFJMTERfUENJQ09ORklHX1ZFUlNJT04pDQog ICAgICAgICAgICAgICAgcHJpbnRmKCJvbHRyOiB3cm9uZyBMTEQgdmVyc2lv blxuIik7DQogICAgICAgIH0NCiAgICB9DQogICAgcmV0dXJuKE5VTEwpOw0K fQ0KI2VuZGlmIC8qIE5QQ0kgKi8NCg0Kc3RhdGljIGludA0Kb2x0cl9hdHRh Y2goaXMpDQogICAgc3RydWN0IGlzYV9kZXZpY2UgKmlzOw0Kew0KICAgIHN0 cnVjdCBvbHRyX3NvZnRjICpzYyA9ICZvbHRyX3NvZnRjW2lzLT5pZF91bml0 XT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faW5pdCgmc2MtPm9sdHJfY2gpOw0KDQogICAgLyogSW5pdGlh bGl6ZSBhZGFwdGVyICovDQogICAgcmMgPSBUUmxsZEFkYXB0ZXJJbml0KCZv bHRyTGxkRHJpdmVyLCBzYy0+VFJsbGRBZGFwdGVyLCBrdnRvcChzYy0+VFJs bGRBZGFwdGVyKSwgDQogICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lk ICopc2MtPnVuaXQsIHNjLT5jb25maWcpOw0KICAgIGlmIChyYyAhPSBUUkxM RF9JTklUX09LKSB7DQogICAgICAgIHN3aXRjaCAocmMpIHsNCiAgICAgICAg ICAgIGNhc2UgVFJMTERfSU5JVF9OT1RfRk9VTkQ6DQogICAgICAgICAgICAg ICAgcHJpbnRmKCJvbHRyJWQ6IEFkYXB0ZXIgbm90IGZvdW5kIG9yIG1hbGZ1 bmN0aW9uaW5nLlxuIiwgc2MtPnVuaXQpOw0KICAgICAgICAgICAgICAgIHNj LT5od19zdGF0ZSA9IEhXX0JBRDsNCiAgICAgICAgICAgICAgICByZXR1cm4o MCk7DQogICAgICAgICAgICBjYXNlIFRSTExEX0lOSVRfVU5TVVBQT1JURUQ6 DQogICAgICAgICAgICAgICAgcHJpbnRmKCJvbHRyJWQ6IEFkYXB0ZXIgbm90 IHN1cHBvcnRlZCBieSBsb3cgbGV2ZWwgZHJpdmVyLlxuIiwgc2MtPnVuaXQp Ow0KICAgICAgICAgICAgICAgIHNjLT5od19zdGF0ZSA9IEhXX1VOS05PV047 DQogICAgICAgICAgICAgICAgcmV0dXJuKDApOw0KICAgICAgICAgICAgY2Fz ZSBUUkxMRF9JTklUX1BIWVMxNjoNCiAgICAgICAgICAgICAgICBwcmludGYo Im9sdHIlZDogQWRhcHRlciBtZW1vcnkgYmxvY2sgYWJvdmUgMTZNLCBtdXN0 IGJlIGJlbG93IDE2TS5cbiIsIHNjLT51bml0KTsNCiAgICAgICAgICAgICAg ICByZXR1cm4oMCk7DQogICAgICAgICAgICBjYXNlIFRSTExEX0lOSVRfVkVS U0lPTjoNCiAgICAgICAgICAgICAgICBwcmludGYoIm9sdHIlZDogTG93IGxl dmVsIGRyaXZlciB2ZXJzaW9uIG1pc21hdGNoLlxuIiwgc2MtPnVuaXQpOw0K ICAgICAgICAgICAgICAgIHJldHVybigwKTsNCiAgICAgICAgICAgIGRlZmF1 bHQ6DQogICAgICAgICAgICAgICAgcHJpbnRmKCJvbHRyJWQ6IFVua25vd24g aW5pdGlsaXphdGlvbiBlcnJvciBvY2NvdXJlZCAoJXgpLlxuIiwgc2MtPnVu aXQsIHJjKTsNCiAgICAgICAgICAgICAgICByZXR1cm4oMCk7DQogICAgICAg IH0NCiAgICB9DQoNCiAgICAvKiBEb3dubG9hZCBBZGFwdGVyIE1pY3JvY29k ZSAqLw0KICAgIC8qcHJpbnRmKCJvbHRyJWQ6IERvd25sb2FkaW5nIGFkYXB0 ZXIgbWljcm9jb2RlLi4uIiwgc2MtPnVuaXQpOyovDQogICAgc2MtPmh3X3N0 YXRlID0gSFdfTE9BRElORzsNCiAgICBzd2l0Y2goc2MtPmNvbmZpZy0+bWFj dHlwZSkgew0KICAgICAgICBjYXNlIFRSTExEX01BQ19UTVM6ICAgICAgICAg ICAvKiBUTVMgbWljcm9jb2RlICovDQogICAgICAgICAgICByYyA9IFRSbGxk RG93bmxvYWQoc2MtPlRSbGxkQWRhcHRlciwgVFJsbGRNYWNDb2RlKTsNCiAg ICAgICAgICAgIGJyZWFrOw0KICAgICAgICBjYXNlIFRSTExEX01BQ19IQVdL RVlFOiAgICAgICAgLyogSGF3a2V5ZSBtaWNyb2NvZGUgKi8NCiAgICAgICAg ICAgIHJjID0gVFJsbGREb3dubG9hZChzYy0+VFJsbGRBZGFwdGVyLCBUUmxs ZEhhd2tleWVNYWMpOw0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGNh c2UgVFJMTERfTUFDX0JVTExTRVlFOiAgICAgIC8qIEJ1bGxzZXllIG1pY3Jv Y29kZSAqLw0KICAgICAgICAg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gYWRhcHRlciAqLw0KICAgIGZvciAoaSA9IDA7IGkgPCBSWF9M SVNUX1NJWkU7IGkrKykgeyANCiAgICAgICAgcmMgPSBUUmxsZFJlY2VpdmVG cmFnbWVudChzYy0+VFJsbGRBZGFwdGVyLA0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICh2b2lkICopc2MtPnJ4X2J1ZmZlcltzYy0+cnhf bmV4dCAmIFJYX0xJU1RfTUFTS10uYnVmLA0KICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGt2dG9wKHNjLT5yeF9idWZmZXJbc2MtPnJ4X25l eHQgJiBSWF9MSVNUX01BU0tdLmJ1ZiksDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgUlhfQlVGRkVSX0xFTiwNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXNjLT5yeF9idWZmZXJbc2Mt PnJ4X25leHQgJiBSWF9MSVNUX01BU0tdLmluZGV4KTsNCiAgICAgICAgaWYg KHJjICE9IFRSTExEX1JFQ0VJVkVfT0spIHsNCiAgICAgICAgICAgIHByaW50 Zigib2x0ciVkOiBBZGFwdGVyIHJlZnVzZWQgZnJhZ21lbnQgJWQgKHJjID0g JWQpLlxuIiwgc2MtPnVuaXQsIGksIHJjKTsNCiAgICAgICAgICAgIGJyZWFr Ow0KICAgICAgICB9ICBlbHNlIHsNCiAgICAgICAgICAgIHNjLT5yeF9hdmFp bC0tOw0KICAgICAgICB9DQogICAgICAgIHNjLT5yeF9uZXh0Kys7DQogICAg fQ0KICAgIA0KICAgIHJldHVybjsNCn0NCiAgICANCnN0YXRpYyB2b2lkDQpv bHRyX2ludHIodW5pdCkNCiAgICBpbnQgdW5pdDsNCnsNCiAgICBzdHJ1Y3Qg b2x0cl9zb2Z0YyAqc2MgPSAmb2x0cl9zb2Z0Y1t1bml0XTsNCiAgICBpbnQg cmM7DQoNCiAgICAvKnByaW50Zigib2x0ciVkOiBvbHRyX2ludH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ICAgICAgICAgICAgYnJlYWs7DQoNCiAgICAgICAgY2FzZSBT SU9DU0lGRkxBR1M6DQogICAgICAgICAgICAvKg0KICAgICAgICAgICAgICog SWYgdGhlIGludGVyZmFjZSBpcyBtYXJrZWQgdXAgYW5kIHN0b3BwZWQsIHRo ZW4gc3RhcnQgaXQuDQogICAgICAgICAgICAgKiBJZiBpdCBpcyBtYXJrZWQg ZG93biBhbmQgcnVubmluZywgdGhlbiBzdG9wIGl0Lg0KICAgICAgICAgICAg ICovDQogICAgICAgICAgICBpZiAoaWZwLT5pZl9mbGFncyAmIElGRl9VUCkg ew0KICAgICAgICAgICAgICAgICAgICBpZiAoKGlmcC0+aWZfZmxhZ3MgJiBJ RkZfUlVOTklORykgPT0gMCkNCiAgICAgICAgICAgICAgICAgICAgICAgICAg ICBvbHRyX2luaXQoc2MpOw0KICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAg ICAgICAgICAgICAgICAgaWYgKGlmcC0+aWZfZmxhZ3MgJiBJRkZfUlVOTklO Rykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9sdHJfc3RvcChz Yyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWZwLT5pZl9mbGFn cyAmPSB+SUZGX1JVTk5JTkc7DQogICAgICAgICAgICAgICAgICAgIH0NCiAg ICAgICAgICAgIH0NCiAgICAgICAgICAgIA0KICAgICAgICAgICAgYnJlYWs7 DQogICAgICAgIGNhc2UgU0lPQ0dJRk1FRElBOg0KICAgICAgICBjYXNlIFNJ T0NTSUZNRURJQToNCiAgICAgICAgICAgIGVycm9yID0gaWZtZWRpYV9pb2N0 bChpZnAsIGlmciwgJnNjLT5pZm1lZGlhLCBjbWQpOw0KICAgICAgICAgICAg YnJlYWs7DQogICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICBlcnJvciA9 IEVJTlZBTDsNCiAgICB9DQogICAgc3BseChzKTsNCiAgICByZXR1cm4oZXJy b3IpOw0KfQ0KDQovKg0KICogUE1X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gICAgICBicmVh azsNCiAgICAgICAgY2FzZSBUUkxMRF9TVFNfU0VMRlRFU1RfU1RBVFVTOg0K ICAgICAgICAgICAgaWYgKFN0YXR1cy0+U3BlY2lmaWNhdGlvbi5TZWxmdGVz dFN0YXR1cyA9PSBUUkxMRF9TVF9PSykgew0KICAgICAgICAgICAgICAgIHBy aW50Zigib2x0ciVkOiBhZGFwdGVyIHN0YXR1cyBnb29kLiAoY2xvc2UgY29t cGxldGVkL3NlbGYtdGVzdClcbiIsIHNjLT51bml0KTsNCiAgICAgICAgICAg ICAgICBpZiAoKHNjLT5od19zdGF0ZSA9PSBIV19MT0FESU5HKSB8fCAoc2Mt Pmh3X3N0YXRlID09IEhXX0NMT1NJTkcpIHx8IChzYy0+aHdfc3RhdGUgPT0g SFdfQ0xPU0lORzIpKSB7DQogICAgICAgICAgICAgICAgICAgIHNjLT5od19z dGF0ZSA9IEhXX0NMT1NFRDsNCiAgICAgICAgICAgICAgICAgICAgYnJlYWs7 DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSBlbHNlIHsNCiAg ICAgICAgICAgICAgICBwcmludGYoIm9sdHIlZDogU2VsZiB0ZXN0IGZhaWxl ZDogIiwgc2MtPnVuaXQpOw0KICAgICAgICAgICAgICAgIHN3aXRjaCAoU3Rh dHVzLT5TcGVjaWZpY2F0aW9uLlNlbGZ0ZXN0U3RhdHVzKSB7DQogICAgICAg ICAgICAgICAgICAgIGNhc2UgVFJMTERfU1RfRVJST1IgKyAwOiBwcmludGYo IkluaXRpYWwgVGVzdCBFcnJvclxuIik7IGJyZWFrOw0KICAgICAgICAgICAg ICAgICAgICBjYXNlIFRSTExEX1NUX0VSUk9SICsgMTogcHJpbnRmKCJBZGFw dGVyIFNvZnR3YXJlIENoZWNrc3VtIEVycm9yXG4iKTsgYnJlYWs7DQogICAg ICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfU1RfRVJST1IgKyAyOiBwcmlu dGYoIkFkYXB0ZXIgUkFNIEVycm9yXG4iKTsgYnJlYWs7DQogICAgICAgICAg ICAgICAgICAgIGNhc2UgVFJMTERfU1RfRVJST1IgKyA0OiBwcmludGYoIklu c3RydWN0aW9uIFRlc3QgRXJyb3JcbiIpOyBicmVhazsNCiAgICAgICAgICAg ICAgICAgICAgY2FzZSBUUkxMRF9TVF9FUlJPUiArIDU6IHByaW50ZigiUHJv dG9jb2wgSGFuZGxlci9SSSBIdyBFcnJvclxuIik7IGJyZWFrOw0KICAgICAg ICAgICAgICAgICAgICBjYXNlIFRSTExEX1NUX0VSUk9SICsgNjogcHJpbnRm KCJTeXN0ZW0gSW50ZXJmYWNlIFJlZ2lzdGVyIEVycm9yXG4iKTsgYnJlYWs7 DQogICAgICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfU1RfVElNRU9VVDog ICBwcmludGYoIlNlbGZ0ZXN0IGRpZCBub3QgY29tcGxldGVcbiIpOyBicmVh azsNCiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDogcHJpbnRmKCJVbmtu b3duIGVycm9yICgleClcbiIsIFN0YXR1cy0+U3BlY2lmaWNhdGlvbi5TZWxm dGVzdFN0YXR1cyk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAg fQ0KICAgICAgICAgICAgYnJlYWs7DQogICAgICAgIGNhc2UgVFJMTERfU1RT X0lOSVRfU1RBVFVTOg0KICAgICAgICAgICAgcHJpbnRmKCJvbHRyJWQ6IEFk YXB0ZXIgaW5pdGlhbGl6YXRpb24gZmFpbGVkOiAiLCBzYy0+dW5pdCk7DQog ICAgICAgICAgICBzd2l0Y2goU3RhdHVzLT5TcGVjaWZpY2F0aW9uLkluaXRT dGF0dXMpIHsNCiAgICAgICAgICAgICAgICBjYXNlIFRSTExEX0lOSVRfRVJS T1IgKyAweDAxOiBwcmludGYoIkludmFsaWQgaW5pdCBibG9jayAoTExEIGVy cm9yKVxuIik7IGJyZWFrOw0KICAgICAgICAgICAgICAgIGNhc2UgVFJMTERf SU5JVF9FUlJPUiArIDB4MDI6IHByaW50ZigiSW52YWxpZCBvcHRpb25zIChM TEQgZXJyb3IpXG4iKTsgYnJlYWs7DQogICAgICAgICAgICAgICAgY2FzZSBU UkxMRF9JTklUX0VSUk9SICsgMHgwMzogcHJpbnRmKCJJbnZhbGlkIHJjdiBi dXJzdCAoTExEIGVycm9yKVxuIik7IGJyZWFrOw0KICAgICAgICAgICAgICAg IGNhc2UgVFJMTERfSU5JVF9FUlJPUiArIDB4MDQ6IHByaW50ZigiSW52YWxp ZCB4bXQgYnVyc3QgKExMRCBlcnJvcilcbiIpOyBicmVhazsNCiAgICAgICAg ICAgICAgICBjYXNlIFRSTExEX0lOSVRfRVJST1IgKyAweDA1OiBwcmludGYo IkludmFsaWQgRE1BIHRocmVzaG9sZCAoTExEIGVycm9yKVxuIik7IGJyZWFr Ow0KICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfSU5JVF9FUlJPUiArIDB4 MDY6IHByaW50ZigiSW52YWxpZCBzY2IgYWRkclxuIik7IGJyZWFrOw0KICAg ICAgICAgICAgICAgIGNhc2UgVFJMTERfSU5JVF9FUlJPUiArIDB4MDc6IHBy aW50ZigiSW52YWxpZCBzc2IgYWRkclxuIik7IGJyZWFrOw0KICAgICAgICAg ICAgICAgIGNhc2UgVFJMTERfSU5JVF9FUlJPUiArIDB4MDg6IHByaW50Zigi RElPIHBhcml0eSBlcnJvciAoSFcgZXJyb3IpXG4iKTsgYnJlYWs7DQogICAg ICAgICAgICAgICAgY2FzZSBUUkxMRF9JTklUX0VSUk9SICsgMHgwOTogcHJp bnRmKCJETUEgdGltZW91dCAoTWF5IGJlIGludGVycnVwdCBmYWlsaW5nIGlm IFBJTyBtb2RlIG9yIFBDSTIpXG4iKTsgYnJlYWs7DQogICAgICAgICAgICAg ICAgY2FzZSBUUkxMRF9JTklUX0VSUk9SICsgMHgwQTogcHJpbnRmKCJETUEg cGFyaXR5IGVycm9yIChIVyBlcnJvcilcbiIpOyBicmVhazsNCiAgICAgICAg ICAgICAgICBjYXNlIFRSTExEX0lOSVRfRVJST1IgKyAweDBCOiBwcmludGYo IkRNQSBidXMgZXJyb3IgKEhXIGVycm9yKVxuIik7IGJyZWFrOw0KICAgICAg ICAgICAgICAgIGNhc2UgVFJMTERfSU5JVF9FUlJPUiArIDB4MEM6IHByaW50 ZigiRE1BIGRhdGEgZXJyb3JcbiIpOyBicmVhazsNCiAgICAgICAgICAgICAg ICBjYXNlIFRSTExEX0lOSVRfRVJST1IgKyAweDBEOiBwcmludGYoIkFkYXB0 ZXIgQ2hlY2tcbiIpOyBicmVhazsNCiAgICAgICAgICAgICAgICBjYXNlIFRS TExEX0lOSVRfVElNRU9VVDogICAgICBwcmludGYoIkFkYXB0ZXIgaW5pdGlh bGl6YXRpb24gZGlkIG5vdCBjb21wbGV0ZVxuIik7IGJyZWFrOw0KICAgICAg ICAgICAgICAgIGNhc2UgVFJMTERfSU5JVF9ETUFfRVJST1I6ICAgIHByaW50 ZigiQWRhcHRlciBjYW5ub3QgYWNjZXNzIHN5c3RlbSBtZW1vcnlcbiIpOyBi cmVhazsNCiAgICAgICAgICAgICAgICBjYXNlIFRSTExEX0lOSVRfSU5UUl9F UlJPUjogICBwcmludGYoIkFkYXB0ZXIgY2Fubm90IGludGVycnVwdFxuIik7 IGJyZWFrOw0KICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfT1BFTl9USU1F T1VUOiAgICAgIHByaW50ZigiQWRhcHRlciBkaWQgbm90IGNvbXBsZXRlIG9w ZW4gd2l0aGluIDMwIHNlY29uZHNcbiIpOyBicmVhazsNCiAgICAgICAgICAg ICAgICBjYXNlIFRSTExEX09QRU5fRVJST1IgKyAweDAxOiBwcmludGYoIklu dmFsaWQgb3BlbiBvcHRpb25zIChMTEQgZXJyb3IpXG4iKTsgYnJlYWs7DQog ICAgICAgICAgICAgICAgY2FzZSBUUkxMRF9PUEVOX0VSUk9SICsgMHgwNDog cHJpbnRmKCJUeEJ1ZmZlciBjb3VudCBlcnJvciAoTExEIGVycm9yKVxuIik7 IGJyZWFrOw0KICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfT1BFTl9FUlJP UiArIDB4MTA6IHByaW50ZigiQnVmZmVyIHNpemUgZXJyb3IgKExMRCBlcnJv cilcbiIpOyBicmVhazsNCiAgICAgICAgICAgICAgICBjYXNlIFRSTExEX09Q RU5fRVJST1IgKyAweDIwOiBwcmludGYoIkxpc3Qgc2l6ZSBlcnJvciAoTExE IGVycm9yKVxuIik7IGJyZWFrOw0KICAgICAgICAgICAgICAgIGRlZmF1bHQ6 IA0KICAgICAgICAgICAgICAgICAgICBpZiAoU3RhdHVzLT5TcGVjaWZpY2F0 aW9uLkluaXRTdGF0dXMgJiAweDcwMCkgew0KICAgICAgICAgICAgICAgICAg ICAgICAgc3dpdGNoIChTdGF0dXMtPlNwZWNpZmljYXRpb24uSW5pdFN0YXR1 cyAmIDB4NzBGKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2Fz ZSBUUkxMRF9PUEVOX1JFUEVBVCArIDB4MDE6IHByaW50ZigiTG9iZSBtZWRp YSB0ZXN0IC0gIik7IGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGNhc2UgVFJMTERfT1BFTl9SRVBFQVQgKyAweDAyOiBwcmludGYoIlBo eXNpY2FsIGluc2VydGlvbiAtICIpOyBicmVhazsNCiAgICAgICAgICAgICAg ICAgICAgICAgICAgICBjYXNlIFRSTExEX09QRU5fUkVQRUFUICsgMHgwMzog cHJpbnRmKCJBZGRyZXNzIHZlcmlmaWNhdGlvbiAtICIpOyBicmVhazsNCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFRSTExEX09QRU5fUkVQ RUFUICsgMHgwNDogcHJpbnRmKCJQYXJ0aWNpcGF0aW9uIGluIHJpbmcgcG9s bCAtICIpOyBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBj YXNlIFRSTExEX09QRU5fUkVQRUFUICsgMHgwNTogcHJpbnRmKCJSZXF1ZXN0 IGluaXRpYWxpemF0aW9uIC0gIik7IGJyZWFrOw0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGNhc2UgVFJMTERfT1BFTl9SRVBFQVQgKyAweDA5OiBw cmludGYoIlJlcXVlc3QgcmVnaXN0cmF0aW9uIChUWEkpIC0gIik7IGJyZWFr Ow0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfT1BF Tl9SRVBFQVQgKyAweDBBOiBwcmludGYoIkxvYmUgbWVkaWEgdGVzdCAoVFhJ KSAtICIpOyBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBk ZWZhdWx0OiAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJVbmtub3du IHBoYXNlICgleCkgLSAiLCBTdGF0dXMtPlNwZWNpZmljYXRpb24uSW5pdFN0 YXR1cyAmIDB4MDBGKTsNCiAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAg ICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoU3RhdHVzLT5TcGVjaWZp Y2F0aW9uLkluaXRTdGF0dXMgJiAweDdGMCkgew0KICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGNhc2UgVFJMTERfT1BFTl9SRVBFQVQgKyAweDEwOiBw cmludGYoIkZ1bmN0aW9uIGZhaWx1cmUgKE5vIGNhYmxlPylcbiIpOyBicmVh azsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFRSTExEX09Q RU5fUkVQRUFUICsgMHgyMDogcHJpbnRmKCJTaWduYWwgbG9zc1xuIik7IGJy ZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgVFJMTERf T1BFTl9SRVBFQVQgKyAweDUwOiBwcmludGYoIlRpbWVvdXRcbiIpOyBicmVh azsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFRSTExEX09Q RU5fUkVQRUFUICsgMHg2MDogcHJpbnRmKCJSaW5nIGZhaWx1cmUgKFRLUCkg LyBQcm90b2NvbCBlcnJvciAoVFhJKVxuIik7IGJyZWFrOw0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfT1BFTl9SRVBFQVQgKyAw eDcwOiBwcmludGYoIlJpbmcgYmVhY29uaW5nXG4iKTsgYnJlYWs7DQogICAg ICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBUUkxMRF9PUEVOX1JFUEVB VCArIDB4ODA6IHByaW50ZigiRHVwbGljYXRlIG5vZGUgYWRkcmVzcyAoVEtQ KSAvIEluc2VydCBkZW5pZWQgKFRYSSlcbiIpOyBicmVhazsNCiAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjYXNlIFRSTExEX09QRU5fUkVQRUFUICsg MHg5MDogcHJpbnRmKCJSZXF1ZXN0IGluaXRpYWxpemF0aW9uIChUS1ApXG4i KTsgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBU UkxMRF9PUEVOX1JFUEVBVCArIDB4YTA6IHByaW50ZigiUmVtb3ZlIHJlY2Vp dmVkXG4iKTsgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAg Y2FzZSBUUkxMRF9PUEVOX1JFUEVBVCArIDB4YjA6IHByaW50ZigiQy1wb3J0 IGFkZHJlc3MgY2hhbmdlZCAoVFhJKVxuIik7IGJyZWFrOw0KICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICAgICAgICAgICAg ICAgICBwcmludGYoIlVua25vd24gdHlwZSAoJXgpXG4iLCBTdGF0dXMtPlNw ZWNpZmljYXRpb24uSW5pdFN0YXR1cyAmIDB4MEYwKTsNCiAgICAgICAgICAg ICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsN CiAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiVW5rbm93biBlcnJv ciAoJXgpXG4iLCBTdGF0dXMtPlNwZWNpZmljYXRpb24uSW5pdFN0YXR1cyk7 IA0KICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICB9DQogICAg ICAgICAgICBicmVhazsNCiAgICAgICAgY2FzZSBUUkxMRF9TVFNfUklOR19T VEFUVVM6DQogICAgICAgICAgICBpZiAoU3RhdHVzLT5TcGVjaWZpY2F0aW9u LlJpbmdTdGF0dXMgIT0gMCkgew0KICAgICAgICAgICAgICAgIHByaW50Zigi b2x0ciVkOiBSaW5nIHN0YXR1cyBjaGFuZ2U6ICIsIHNjLT51bml0KTsNCiAg ICAgICAgICAgICAgICBpZiAoU3RhdHVzLT5TcGVjaWZpY2F0aW9uLlJpbmdT dGF0dXMgJiBUUkxMRF9SU19IQVJEX0VSUk9SKSAgICAgICAgIHByaW50Zigi W0hhcmQgZXJyb3JdICIpOw0KICAgICAgICAgICAgICAgIGlmIChTdGF0dXMt PlNwZWNpZmljYXRpb24uUmluZ1N0YXR1cyAmIFRSTExEX1JTX1NPRlRfRVJS T1IpICAgICAgICAgcHJpbnRmKCJbU29mdCBlcnJvcl0gIik7DQogICAgICAg ICAgICAgICAgaWYgKFN0YXR1cy0+U3BlY2lmaWNhdGlvbi5SaW5nU3RhdHVz ICYgVFJMTERfUlNfVFJBTlNNSVRfQkVBQ09OKSAgICBwcmludGYoIltUcmFu c21pdCBiZWFjb25dICIpOw0KICAgICAgICAgICAgICAgIGlmIChTdGF0dXMt PlNwZWNpZmljYXRpb24uUmluZ1N0YXR1cyAmIFRSTExEX1JTX0xPQkVfV0lS RV9GQVVMVCkgICAgcHJpbnRmKCJbV2lyZSBmYXVsdF0gIik7DQogICAgICAg ICAgICAgICAgaWYgKFN0YXR1cy0+U3BlY2lmaWNhdGlvbi5SaW5nU3RhdHVz ICYgVFJMTERfUlNfQVVUT19SRU1PVkFMX0VSUk9SKSBwcmludGYoIltBdXRv IHJlbW92YWxdICIpOw0KICAgICAgICAgICAgICAgIGlmIChTdGF0dXMtPlNw ZWNpZmljYXRpb24uUmluZ1N0YXR1cyA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fUFJPTUlT Q1VPVVNfU1RPUFBFRDoNCiAgICAgICAgICAgIHByaW50Zigib2x0ciVkOiBQ cm9taXNjdW91cyBtb2RlIHN0b3BwZWQ6ICIsIHNjLT51bml0KTsNCiAgICAg ICAgICAgIHN3aXRjaChTdGF0dXMtPlNwZWNpZmljYXRpb24uUHJvbVJlbW92 ZWRDYXVzZSkgew0KICAgICAgICAgICAgICAgIGNhc2UgVFJMTERfUFJPTV9S RU1PVkVfUkVDRUlWRUQ6IHByaW50ZigiUmVtb3ZlIHJlY2VpdmVkXG4iKTsg YnJlYWs7DQogICAgICAgICAgICAgICAgY2FzZSBUUkxMRF9QUk9NX1BPTExf RkFJTFVSRTogICAgcHJpbnRmKCJQb2xsIGZhaWx1cmVcbiIpOyBicmVhazsN CiAgICAgICAgICAgICAgICBkZWZhdWx0OiAgICAgICAgICAgICAgICAgICAg ICAgICBwcmludGYoIlVua25vd24gKCV4KVxuIiwgU3RhdHVzLT5TcGVjaWZp Y2F0aW9uLlByb21SZW1vdmVkQ2F1c2UpOw0KICAgICAgICAgICAgfQ0KICAg ICAgICAgICAgYnJlYWs7DQogICAgICAgIGNhc2UgVFJMTERfU1RTX0xMRF9F UlJPUjoNCiAgICAgICAgICAgIHByaW50Zigib2x0ciVkOiBMTEQgZXJyb3Ig KCV4ICV4ICV4ICV4KSAiLCBzYy0+dW5pdCwgU3RhdHVzLT5TcGVjaWZpY2F0 aW9uLkludGVybmFsRXJyb3JbMF0sIA0KICAgICAgICAgICAgICAgICAgICBT dGF0dXMtPlNwZWNpZmljYXRpb24uSW50ZXJuYWxFcnJvclsxXSwgU3RhdHVz LT5TcGVjaWZpY2F0aW9uLkludGVybmFsRXJyb3JbMl0sIA0KICAgICAgICAg ICAgICAgICAgICBTdGF0dXMtPlNwZWNpZmljYXRpb24uSW50ZXJuYWxFcnJv clszXSk7DQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgY2FzZSBUUkxM RF9TVFNfQURBUFRFUl9USU1FT1VUOg0KICAgICAgICAgICAgcHJpbnRmKCJv bHRyJWQ6IEFkYXB0ZXIgb3BlcmF0aW9uIHRpbWVkIG91dDogIiwgc2MtPnVu aXQpOw0KICAgICAgICAgICAgc3dpdGNoKFN0YXR1cy0+U3BlY2lmaWNhdGlv bi5BZGFwdGVyVGltZW91dCkgew0KICAgICAgICAgICAgICAgIGNhc2UgVFJM TERfQ09NTUFORF9USU1FT1VUOiAgIHByaW50ZigiQ29tbWFuZFxuIik7DQog ICAgICAgICAgICAgICAgY2FzZSBUUkxMRF9UUkFOU01JVF9USU1FT1VUOiAg cHJpbnRmKCJUcmFuc21pdFxuIik7DQogICAgICAgICAgICAgICAgY2FzZSBU UkxMRF9JTlRFUlJVUFRfVElNRU9VVDogcHJpbnRmKCJJbnRlcnJ1cHRcbiIp Ow0KICAgICAgICAgICAgICAgIGRlZmF1bHQ6ICAgICAgICAgICAgICAgICAg ICAgIHByaW50ZigiVW5rbm93biAoJXgpXG4iLCBTdGF0dXMtPlNwZWNpZmlj YXRpb24uQWRhcHRlclRpbWVvdXQpOw0KICAgICAgICAgICAgfQ0KICAgICAg ICAgICAgYnJlYWs7DQogICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICBw cmludGYoIm9sdHIlZDogVW5rbm93biBzdGF0dXMgdHlwZSAoJXgpXG4iLCBz Yy0+dW5pdCwgU3RhdHVzLT5UeXBlKTsNCg0KICAgIH0NCiAgICBpZiAoU3Rh dHVzLT5DbG9zZWQpIHsNCiAgICAgICAgaWYgKHNjLT5od19zdGF0ZSA+IEhX X0JBRCkgew0KICAgICAgICAgICAgc2MtPmh3X3N0YXRlID0gSFdfRkFJTEVE Ow0KICAgICAgICAgICAgcHJpbnRmKCJvbHRyJWQ6IGNsb3NpbmcgYWRhcHRl ciBkdWUgdG8gZmFpbHVyZS5cbiIsIHNjLT51bml0KTsNCiAgICAgICAgICAg IG9sdHJfc3RvcChzYyk7DQogICAgICAgIH0NCiAgICB9DQp9DQoNCnN0YXRp YyB2b2l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Ymxvd25cbiIsIHNjLT51bml0KTsNCiAgICAgICAgICAgIG9sdHJfc3RvcChz Yyk7DQogICAgICAgICAgICByZXR1cm47DQogICAgICAgIH0NCiAgICAgICAg aWYgKFJlY2VpdmVTdGF0dXMgPT0gVFJMTERfUkNWX09LKSB7ICAgIC8qIFJl Y2VpdmUgZ29vZCBmcmFtZSAqLw0KICAgICAgICAgICAgTUdFVEhEUihtLCBN X0RPTlRXQUlULCBNVF9EQVRBKTsNCiAgICAgICAgICAgIGlmIChtID09IE5V TEwpIHsNCiAgICAgICAgICAgICAgICBpZnAtPmlmX2llcnJvcnMrKzsNCiAg ICAgICAgICAgICAgICBnb3RvIG91dDsNCiAgICAgICAgICAgIH0NCiAgICAg ICAgICAgIGlmIChmcmFtZV9sZW4gKyAyID4gTUhMRU4pIHsNCiAgICAgICAg ICAgICAgICBNQ0xHRVQobSwgTV9ET05UV0FJVCk7DQogICAgICAgICAgICAg ICAgaWYgKChtLT5tX2ZsYWdzICYgTV9FWFQpID09IDApIHsNCiAgICAgICAg ICAgICAgICAgICAgcHJpbnRmKCJvbHRyJWQ6IHVuYWJsZSB0byBnZXQgbWJ1 ZiBjbHVzdGVyIGR1cmluZyByZWNlaXZlLlxuIiwgc2MtPnVuaXQpOw0KICAg ICAgICAgICAgICAgICAgICBtX2ZyZWVtKG0pOw0KICAgICAgICAgICAgICAg ICAgICBpZnAtPmlmX2llcnJvcnMrKzsNCiAgICAgICAgICAgICAgICAgICAg Z290byBvdXQ7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0K ICAgICAgICAgICAgaWZwLT5pZl9pcGFja2V0cysrOw0KDQogICAgICAgICAg ICBtLT5tX3BrdGhkci5yY3ZpZiA9ICZzYy0+YXJwY29tLmFjX2lmOw0KICAg ICAgICAgICAgbS0+bV9wa3RoZHIubGVuID0gbS0+bV9sZW4gPSBmcmFtZV9s ZW47DQogICAgICAgICAgICBtLT5tX2RhdGEgKz0gMjsNCiAgICAgICAgICAg IHRoID0gbXRvZChtLCBzdHJ1Y3QgaXNvODgwMjVfaGVhZGVyICopOw0KDQog ICAgICAgICAgICBpID0gMDsNCiAgICAgICAgICAgIHdoaWxlIChmcmFtZV9s ZW4gPiBSWF9CVUZGRVJfTEVOKSB7DQogICAgICAgICAgICAgICAgYmNvcHko ZnJhZywgbXRvZChtLCBjaGFyICopICsgaSwgUlhfQlVGRkVSX0xFTik7DQog ICAgICAgICAgICAgICAgaSArPSBSWF9CVUZGRVJfTEVOOw0KICAgICAgICAg ICAgICAgIGZyYW1lX2xlbiAtPSBSWF9CVUZGRVJfTEVOOw0KICAgICAgICAg ICAgICAgIGZyYWcgPSBzYy0+cnhfYnVmZmVyWysral0uYnVmOw0KICAgICAg ICAgICAgfQ0KICAgICAgICAgICAgYmNvcHkoZnJhZywgbXRvZChtLCBjaGFy ICopICsgaSwgZnJhbWVfbGVuKTsNCiAgICAgICAgDQojaWYgTkJQRklMVEVS ID4gMA0KICAgICAgICAgICAgaWYgKGlmcC0+aWZfYnBmKQ0KICAgICAgICAg ICAgICAgIGJwZl9tdGFwKGlmcCwgbSk7DQojZW5kaWYNCg0KICAgICAgICAg ICAgbWFjX2hkcl9sZW4gPSBJU084ODAyNV9IRFJfTEVOOw0KICAgICAgICAg ICAgaWYgKHRoLT5pc284ODAyNV9zaG9zdFswXSAmIDB4ODApIC8qIENoZWNr IGZvciBzb3VyY2Ugcm91dGluZyBpbmZvICovDQogICAgICAgICAgICAgICAg bWFjX2hkcl9sZW4gKz0gIChudG9ocyh0aC0+cmNmKSAmIDB4MWYwMCkgPj4g ODsNCiAgICAgICAgICAgIA0KICAgICAgICAgICAgbS0+bV9wa3RoZHIubGVu ID0gbS0+bV9sZW4gPSBCeXRlQ291bnQgLSBtYWNfaGRyX2xlbjsNCiAgICAg ICAgICAgIG0tPm1fZGF0YSArPSBtYWNfaGRyX2xlbjsNCg0KICAgICAgICAg ICAgaXNvODgwMjVfaW5wdXQoJnNjLT5hcnBjb20uYWNfaWYsIHRoLCBtKTsN Cg0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgaWYgKFJlY2VpdmVT dGF0dXMgIT0gVFJMTERfUkNWX05PX0RBVEEpIHsNCiAgICAgICAgICAgICAg ICBwcmludGYoIm9sdHIlZDogcmVjZWl2ZSBlcnJvci4gKFJlY2VpdmVTdGF0 dXM9JWQpXG4iLCBzYy0+dW5pdCwgUmVjZWl2ZVN0YXR1cyk7DQogICAgICAg ICAgICAgICAgaWZwLT5pZl9pZXJyb3JzKys7DQogICAgICAgICAgICB9DQog ICAgICAgIH0NCm91dDoNCiAgICAgICAgd2hpbGUgKEZyYWdtZW50Q291bnQg PiAwKSB7DQogICAgICAgICAgICByYyA9IFRSbGxkUmVjZWl2ZUZyYWdtZW50 KHNjLT5UUmxsZEFkYXB0ZXIsIA0KICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICh2b2lkICopc2MtPnJ4X2J1ZmZlcltzYy0+cnhfbmV4 dCAmIFJYX0xJU1RfTUFTS10uYnVmLA0KICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGt2dG9wKHNjLT5yeF9idWZmZXJbc2MtPnJ4X25l eHQgJiBSWF9MSVNUX01BU0tdLmJ1ZiksDQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgUlhfQlVGRkVSX0xFTiwNCiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXNjLT5yeF9idWZm ZXJbc2MtPnJ4X25leHQgJiBSWF9MSVNUX01BU0tdLmluZGV4KTsNCiAgICAg ICAgICAgIGlmIChyYyA9PSBUUkxMRF9SRUNFSVZFX09LKSB7DQogICAgICAg ICAgICAgICAgc2MtPnJ4X25leHQrKzsNCiAgICAgICAgICAgICAgICBGcmFn bWVudENvdW50LS07DQogICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAg ICAgICAgIHByaW50Zigib2x0ciVkOiBBZGFwdGVyIHJlZnVzZW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ERhdGFQb2ludGVyLCBEV29yZENvdW50KQ0KICAgIHVuc2lnbmVkIHNob3J0 IElPQWRkcmVzczsNCiAgICB1bnNpZ25lZCBsb25nICAqRGF0YVBvaW50ZXI7 DQogICAgaW50IERXb3JkQ291bnQ7DQp7DQogICAgaW5zbChJT0FkZHJlc3Ms ICh2b2lkICopRGF0YVBvaW50ZXIsIERXb3JkQ291bnQpOw0KfQ0KI2VuZGlm IC8qIFRSbGxkSW5saW5lSU8gKi8NCg0KI2VuZGlmIC8qIE5PTFRSICovDQo= --0-665532085-914957328=:7114 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="if_media.h.patch" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.BSF.4.05.9812291348481.7114@heathers.stdio.com> Content-Description: if_media patches Content-Disposition: ATTACHMENT; FILENAME="if_media.h.patch" KioqIGlmX21lZGlhLmgub3JpZwlGcmkgRGVjIDExIDEwOjU1OjMyIDE5OTgN Ci0tLSBpZl9tZWRpYS5oCUZyaSBEZWMgMTEgMTc6MTQ6MDMgMTk5OA0KKioq KioqKioqKioqKioqDQoqKiogMTM3LDE0NSAqKioqDQotLS0gMTM3LDE1MCAt LS0tDQogICNkZWZpbmUJSUZNX1RPS19TVFAxNgk0CQkvKiBTaGllbGRlZCB0 d2lzdGVkIHBhaXIgMTZtIC0gREI5ICovDQogICNkZWZpbmUJSUZNX1RPS19V VFA0CTUJCS8qIFVuc2hpZWxkZWQgdHdpc3RlZCBwYWlyIDRtIC0gUko0NSAq Lw0KICAjZGVmaW5lCUlGTV9UT0tfVVRQMTYJNgkJLyogVW5zaGllbGRlZCB0 d2lzdGVkIHBhaXIgMTZtIC0gUko0NSAqLw0KKyAjZGVmaW5lIElGTV9UT0tf U1RQMTAwICA3CQkvKiBTaGllbGRlZCB0d2lzdGVkIHBhaXIgMTAwbSAtIERC OSAqLw0KKyAjZGVmaW5lIElGTV9UT0tfVVRQMTAwICA4CQkvKiBVbnNoaWVs ZGVkIHR3aXN0ZW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wJIjRVVFAiIH0sCQkJCQlcDQogIAl7IElGTV9UT0tfVVRQMTYsICIx NlVUUCIgfSwJCQkJCVwNCisgCXsgSUZNX1RPS19TVFAxMDAsICIxMDBTVFAi IH0sCQkJCQlcDQorIAl7IElGTV9UT0tfVVRQMTAwLCAiMTAwVVRQIiB9LAkJ CQkJXA0KICAJeyAwLCBOVUxMIH0sCQkJCQkJCVwNCiAgfQ0KICANCioqKioq KioqKioqKioqKg0KKioqIDI2MCwyNjUgKioqKg0KLS0tIDI3MCwyNzggLS0t LQ0KICAJeyBJRk1fVE9LX0VUUiwJIkVhcmx5VG9rZW5SZWxlYXNlIiB9LAkJ CQlcDQogIAl7IElGTV9UT0tfU1JDUlQsICJTb3VyY2VSb3V0aW5nIiB9LAkJ CQlcDQogIAl7IElGTV9UT0tfQUxMUiwJIkFsbFJvdXRlcyIgfSwJCQkJCVwN CisgCXsgSUZNX1RPS19EVFIsCSJEZWRpY2F0ZWQiIH0sCQkJCQlcDQorIAl7 IElGTV9UT0tfQ0xBU1NJQywiQ2xhc3NpYyIgfSwJCQkJCVwNCisgCXsgSUZN X1RPS19BVVRPLAkiICIgfSwJCQkJCQlcDQogIAl7IDAsIE5VTEwgfSwJCQkJ CQkJXA0KICB9DQogIA0K --0-665532085-914957328=:7114-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9812311032240.5164-300000>