Subject: A patch for Buffalo LPC4-CLXL (AX88790)
To: None <current-users@netbsd.org>
From: Yong-Jhen Hong <yongjhen@alqualonde.org>
List: current-users
Date: 10/22/2003 02:26:43
--=-vR8KtpaKxRHtKB1siBUY
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Dear BSDers,

This is a patch to use Buffalo LPC4-CLXL, a PC Card Type II NIC.
I can not use this card in FreeBSD and NetBSD before, both kernel just
recognize its chip as AX88190, and left it "unconfigured". The trick
I use is borrowed from here:

  http://www.masaji.org/libretto70/

It is for FreeBSD-4.8, I test it in FreeBSD-current and NetBSD-current,
seems to work fine for me.

yongjhen.


--=-vR8KtpaKxRHtKB1siBUY
Content-Disposition: attachment; filename=patch-lpc4clx
Content-Transfer-Encoding: base64
Content-Type: text/x-patch; name=patch-lpc4clx; charset=Big5

ZGlmZiAtcnUgc3lzL2Rldi5vcmlnL2ljL2F4ODgxOTByZWcuaCBzeXMvZGV2L2ljL2F4ODgxOTBy
ZWcuaA0KLS0tIHN5cy9kZXYub3JpZy9pYy9heDg4MTkwcmVnLmgJMjAwMy0xMC0yMiAwMTo0Mzox
Ny4wMDAwMDAwMDAgKzA4MDANCisrKyBzeXMvZGV2L2ljL2F4ODgxOTByZWcuaAkyMDAzLTEwLTIy
IDAxOjQ2OjMzLjAwMDAwMDAwMCArMDgwMA0KQEAgLTU1LDYgKzU1LDggQEANCiAgKi8NCiAjZGVm
aW5lCUFYODgxOTBfTEFOX0lPQkFTRQkweDNjYQ0KICNkZWZpbmUJQVg4ODE5MF9MQU5fSU9TSVpF
CTQNCisjZGVmaW5lCUFYODg3OTBfQ1NSCQkweDNjMg0KKyNkZWZpbmUJQVg4ODc5MF9DU1JfU0la
RQkyDQogDQogLyoNCiAgKiBPZmZzZXQgb2YgTk9ERSBJRCBpbiBTUkFNIG1lbW9yeSBvZiBBU0lY
IEFYODgxOTAuDQpkaWZmIC1ydSBzeXMvZGV2Lm9yaWcvaWMvbmUyMDAwLmMgc3lzL2Rldi9pYy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