Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Dec 1999 17:09:05 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        Bill Paul <wpaul@skynet.ctr.columbia.edu>
Cc:        hackers@freebsd.org
Subject:   Re: USB ethernet hacking 
Message-ID:  <199912200109.RAA04120@mass.cdrom.com>
In-Reply-To: Your message of "Sun, 19 Dec 1999 20:04:05 EST." <199912200104.UAA04092@skynet.ctr.columbia.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > > bus_space_read_X()/bus_space_write_X() to read the registers directly. I 
> > > don't want to start reading a register and then come back a while later 
> > > to read the results. The code isn't meant to work like that.
> > 
> > Unfortunately, given that your 'register read request' is being queued 
> > over what is basically a packet-switched network, you're going to have to 
> > change the way the code works so that it _can_ work like that.  If you 
> > don't like it now, imagine how much less you're going to like, say, I2O 
> > or SystemIO...
> 
> I need to be able to read/write registers in the MAC at interrupt context.
> I'm not trying to be stubborn: there's just no other way to do the things
> I need to do. If I get a transmit timeout and I need to flip the 'reset MAC'
> bit in one of the control registers, how am I supposed to do it? When a
> timeout fires and I have to check the PHY's link state or read the MAC
> stats counter registers, how am I supposed to do it?

Build and queue the request, and have the callback handle completion.  
Use a state machine, or just fragment your code along the async 
boundaries.

> The hack that I made to usbdi.c seems to have fixed that problem for now,
> however I'm still not sure why I can't seem to transfer full 1500 byte
> frames without getting an I/O error.

I wonder if it's a limit on the payload size in a USB frame.
-- 
\\ Give a man a fish, and you feed him for a day. \\  Mike Smith
\\ Tell him he should learn how to fish himself,  \\  msmith@freebsd.org
\\ and he'll hate you for a lifetime.             \\  msmith@cdrom.com




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?199912200109.RAA04120>