All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Kovalenko <garrison@mail.ru>
To: Igor Kovalenko <garrison@mail.ru>,
	qemu-devel@nongnu.org, freebsd-emulation@freebsd.org
Subject: [Qemu-devel] Re: playing with qemu's 8139 nic and FreeBSD (loopback mode missing?)
Date: Sat, 29 Apr 2006 06:48:53 -0000	[thread overview]
Message-ID: <44530C50.6040902@mail.ru> (raw)
In-Reply-To: <20060428221142.GA11504@saturn.kn-bremen.de>

Juergen Lock wrote:
> On Fri, Apr 28, 2006 at 08:25:02PM +0400, Igor Kovalenko wrote:
>> Juergen Lock wrote:
>>> I played with
>>> 	qemu -monitor stdio -m 256 -cdrom 6.1-RC1-i386-disc1.iso -usb -soundhw es1370 -kernel-kqemu -net nic,model=rtl8139 -net user
>>> and got it as far as
>>> 	re0: diagnostic failed, failed to receive packet in loopback mode
>>> (followed by a panic :) with the (experimental) patches below.
>>>
>>>  Anyone in the mood to implement loopback mode for this nic?
>>>
>>>  Hmm actually...  I just found the original posting in the archive,
>>> is C+ mode implemented now?  If not re is probably not what I want,
>> The rtl8139 is set up with PCI rev ID 0x20 which should be enough for OS driver
>> to detect C+ mode features. C+ mode is OK, tested with Linux driver.
> 
> Cool, so I want FreeBSD's re driver.  That one checks TxConfig
> tho, as changed in my patch (inside #if 0).  And when changed,
> it still doesn't work as mentioned above because the driver expects
> loopback mode to be working.
>>> but the rl driver that it attaches without that #if 0'd (now) hunk
>>> below doesnt seem to be able to get data thru either and I get
>>> 	rl0: watchdog timeout
>>> in dmesg, which usually means the driver doesnt receive interrupts.
>>>
>>>  What the heck, I'll append a log of a run just doing in fixit->cdrom:
>>> 	ifconfig rl0 10.0.2.15
>>> and then exiting (which is enough to trigger the watchdog timeout...)
>>>
>> I'm too lasy to test with fresh freebsd installation :)
> 
>  No need to install FreeBSD, you can get away by just using
> fixit mode of an install iso, i.e. disc1.  (which actually is
> what I did above. :)
> 
>  You can look at 6.1RC's re driver here:
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/re/if_re.c?annotate=1.46.2.14
>  which includes:
> http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/pci/if_rlreg.h?annotate=1.51.2.3
> 
>  And 6.1RC disc1 iso is e.g. here:
> ftp://ftp.ru.freebsd.org:/pub/FreeBSD/ISO-IMAGES-i386/6.1/6.1-RC1-i386-disc1.iso
> 
> 

Thanks, that iso pointer made it.

Please try the following on top of your patch, at least ping should now work:

--- hw/rtl8139.c.freebsd        2006-04-29 10:44:43.000000000 +0400
+++ hw/rtl8139.c        2006-04-29 10:45:37.000000000 +0400
@@ -1979,6 +1979,18 @@
     return ret;
 }

+static uint32_t rtl8139_RxBufAddr_read(RTL8139State *s)
+{
+    /* this value is NOT off by 16 */
+    uint32_t ret = s->RxBufAddr;
+
+#ifdef DEBUG_RTL8139
+    printf("RTL8139: RxBufAddr read val=0x%04x\n", ret);
+#endif
+
+    return ret;
+}
+
 static void rtl8139_RxBuf_write(RTL8139State *s, uint32_t val)
 {
 #ifdef DEBUG_RTL8139
@@ -2441,6 +2453,10 @@
             ret = rtl8139_RxBufPtr_read(s);
             break;

+        case RxBufAddr:
+            ret = rtl8139_RxBufAddr_read(s);
+            break;
+
         case BasicModeCtrl:
             ret = rtl8139_BasicModeCtrl_read(s);
             break;

-- 
Kind regards,
Igor V. Kovalenko

  reply	other threads:[~2006-04-29  6:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 20:37 [Qemu-devel] playing with qemu's 8139 nic and FreeBSD (loopback mode missing?) Juergen Lock
2006-04-28 16:25 ` [Qemu-devel] " Igor Kovalenko
2006-04-28 22:11   ` Juergen Lock
2006-04-29  6:48     ` Igor Kovalenko [this message]
2006-04-30  0:46       ` Juergen Lock
2006-05-02  4:28         ` Igor Kovalenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44530C50.6040902@mail.ru \
    --to=garrison@mail.ru \
    --cc=freebsd-emulation@freebsd.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.