Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 13 Jun 2002 11:35:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 13 Jun 2002 11:35:02 -0400 Received: from ip68-3-14-32.ph.ph.cox.net ([68.3.14.32]:37802 "EHLO grok.yi.org") by vger.kernel.org with ESMTP id ; Thu, 13 Jun 2002 11:34:56 -0400 Message-ID: <3D08BB98.9050305@candelatech.com> Date: Thu, 13 Jun 2002 08:34:48 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 X-Accept-Language: en-us MIME-Version: 1.0 To: Matthew Hall CC: Donald Becker , Kernel , jgarzik@mandrakesoft.com Subject: Re: [PROBLEM] sundance on d-link dfe-580tx In-Reply-To: <1023980246.1090.25.camel@smelly.dark.lan> Content-Type: multipart/mixed; boundary="------------020103070307090102090206" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------020103070307090102090206 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Dlink has driver source on their web page (somewhere) that evidently works. I'll attach a copy, but I have not had a chance to test it yet. Matthew Hall wrote: > Thanks for your reply Donald, > I have tried and tested the sundance.c file as you indicated, and the > netdrivers packages with a recompiled kernel, yet we still cannot get > this (damn) card working :) -- Ben Greear President of Candela Technologies Inc http://www.candelatech.com ScryMUD: http://scry.wanfear.com http://scry.wanfear.com/~greear --------------020103070307090102090206 Content-Type: application/vnd.sun.xml.calc; name="sundance.c" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="sundance.c" Lyogc3VuZGFuY2UuYzogQSBMaW51eCBkZXZpY2UgZHJpdmVyIGZvciB0aGUgU3VuZGFuY2Ug U1QyMDEgIkFsdGEiLiAqLwovKgkKCU1vZGlmaWVkIGJ5IEVkd2FyZCBQZW5nLiA8ZWR3YXJk X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XJfZGF0YSA9IE5VTEw7Cn0K CnN0YXRpYyBzdHJ1Y3QgcGNpX2RyaXZlciBzdW5kYW5jZV9kcml2ZXIgPSB7CgluYW1lOiJz dW5kYW5jZSIsCglpZF90YWJsZTpzdW5kYW5jZV9wY2lfdGJsLAoJcHJvYmU6c3VuZGFuY2Vf cHJvYmUxLAoJcmVtb3ZlOnN1bmRhbmNlX3JlbW92ZTEsCn07CgpzdGF0aWMgaW50IF9faW5p dApzdW5kYW5jZV9pbml0ICh2b2lkKQp7CglyZXR1cm4gcGNpX21vZHVsZV9pbml0ICgmc3Vu ZGFuY2VfZHJpdmVyKTsKfQoKc3RhdGljIHZvaWQgX19leGl0CnN1bmRhbmNlX2V4aXQgKHZv aWQpCnsKCXBjaV91bnJlZ2lzdGVyX2RyaXZlciAoJnN1bmRhbmNlX2RyaXZlcik7Cn0KCm1v ZHVsZV9pbml0IChzdW5kYW5jZV9pbml0KTsKbW9kdWxlX2V4aXQgKHN1bmRhbmNlX2V4aXQp Owo= --------------020103070307090102090206-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/