o don't strip the Ethernet header from inbound packets; pass packets
up the stack intact (required significant changes to some drivers)
o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN)
o track ether_ifattach/ether_ifdetach API changes
o track bpf changes (use BPF_TAP and BPF_MTAP)
o track vlan changes (ifnet capabilities, revised processing scheme, etc.)
o use if_input to pass packets "up"
o call ether_ioctl for default handling of ioctls
Reviewed by: many
Approved by: re
Pro and Raylink cards with version 5 firmware. Only infra-structure
mode has been tested. Specific changes for this feature are:
o Add RFC1042 encapsulation of IP datagrams
o Add authentication and association
o Decode of the beacon (although not used)
Other changes have been made:
o Pass command completion status to *_done (in place for
adding proper error recovery)
o Move a couple of state variables into the current
network parameters structure. This is in prep. for
dealing with roaming.
MFC after: 1 week
Reduce the verbose memory map setup reports and work with pccardd to
set the common memory map up.
Use enumeration values for CARD_SET_RES_FLAGS.
Use DELAY when spinning waiting for the card to come free instead of a loop.
MFC: after 1 week
active memory maps. This removes the need to change the memory
map from common to attribute every time a packet is sent/received.
This increases performance and decreases cpu load (ping times on
slow machines improve by about 1.5ms).
Move out the old common memory/attrbiute memory hack functions to a
new header file to tidy up the main code. I want to keep them available
for a while.
o Fix OLDCARD to use the new interface.
o Rename the offsetp argument to deltap to more closely reflect what it
is returning (it returns the delta from the requested value to the actual
value).
o Remove duplicate $FreeBSD$ in pccbb.c
o Allow deltap to be NULL.
o Convert new isa pcic driver and add XXX comments that this function isn't
actually implemented there (which means that NEWCARD pccard stuff won't
work there until it is).
o Revert attempts to make old inferface work in NEWCARD.
Subitted by: peter (Parts of the new version code)
since ether_ifattach() does it for us. We do need to call ether_ifdetach()
instead of if_detach(). And we don't have to check for ifp->if_name
already being initialized because it never will be in FreeBSD 4.x and
above.
Reviewed by: Warner Losh, Duncan Barclay
The prior version in the tree was repo-copied from Duncan Barclay's
cvs tree.
Also add $FreeBSD$
Submitted by: Duncan Barclay
Committed-via: raylan link with two webgear cards.
Renamed varible dst in ray_rx to mp as it is a pointer to an mbuf.
Correctly grok addresses in data packets.
Promte a couple of RECERRs to real errors.
Rewrote intro at top of file to reflect my better understanding of how it
the memory mapping works.
Clear the DONE list and move some thoughts into the TODO list.
Remove RECERR from RAY_DEBUG
Start to use a desired network parameter structure, only used in download
code as I've realised that there are some problems with the idea.
Break up ray_rx, and move the data packet handler into a seperate function. This meant some knock on changes in ray_rx_mgt/ray_rx_ctl to do with
mbuf freeing.
Remove some debug code/XXX comments that are out of date.
Generated a new macor, RAY_RECERR for reporting errors with. Verbosity set with IFF_DEBUG (recommended at present).
Add PRIBIO to tsleeps.
Catch detach on ray_ccs_alloc a little better.
Move sc_promisc into desired and current n/w parameters.
Remove IFQ_PEEK, we know the driver runs okay without it.
Drain the output queue in ray_stop.
Only use ray_mcast for ADD/DEL multi ioctls. ray_init_multi resets the
multicast list on startup. Simplifies ray_init a little.
Tidy some old comments.
ray_download_done now copies the whole desired n/w parameter set into the
current set. This is because I was missing soem parameters - like the
net type!
Get ray_detach working correctly. This is a very simple routine as it
just wakes up sleeping processes. Note that anything woken has NO softc
structure available! runq_add is suitably modified to detect a detach and
return straight away.
Due to ray_detach and its implications use a macro for adding things
to the runq in user land.
needed to add into ether_input) and finally sorting IFF_RUNNING through
whole driver.
As part of the IFF_RUNNING stuff, we've added an extra flag so callers
can request that runq routines should check IFF_RUNNING before executing.
Remove BPF taps as this is now done by ether_input.
Resurrect multicast code, moving the multicast list stuff to the runq
routine.
Dump ray_promisc_user as all flag changes are now handled by ray_init, and
add a couple of checks to ray_promisc.
In uppparams_user, allow changes before the card is running (need to
fix some breakage with _download here later). In addition, don't
assume that the current n/w parameters are valid - they are only valid
in the runq.
Fix a nasty flag bug - runq_add cleared all the flags on the last command!
Remove the hacks for setting the memory flags - problems were down
to buggy versions of pccardd. For some reason pccardd only dtrt with
the "right" debug_level.
Simple stuff
------------
Split _download up so that the MIB settings are in their own functions.
Made "tx completed but status is ..." a recoverable error
Cut down verbosity of "unloaded" messages
Moved ccs_free and com_runq from intr_ccs to ecf_done and runq_done
to avoid embarasing mistakes and waits.
Merged runq_add and runq_arr into one and called it runq_add
Made RAY_COM_DUMP a real debug called RAY_DCOM
Consistnet debugging around tsleeps.
Use bus_activate_resource for attr/cm mapping, and set the flags
correctly in the allocation routines (needs more hacks to
sys/pccard/pcic.c)
com_malloc is now seperated from the comq initialization. This was
done whilst trying to set automatic variables for the comqs.
Harder Stuff
------------
As part of the IFF_RUNNING fixes, remove the panic in runq if we are
not running.
Change, again, runq_add. This time we don't do any cleaning up
if there were errors. This is so that callers get the chance
to re-try (not that I ever see it being used).
In runq_add, only sleep when there is something to sleep on!
ioctl locking routines, stolen from awi.c but not used
Hardest Stuff
-------------
Dealing with serialing ioctls correctly means that we must QUEUE
changes to IFF_RUNNING and check it in the QUEUED commands, not
in the user commands. Whilst simple to state, it took a few
hours of head scratching to get it right. The realisation was that
I only have to guarantee that sub-commands from a single process
are serialised and "atomic", and that they check the status of the
interface flags when invoked and not when they are queued.
Another way of looking at it, is that the driver's state is stored
in the runq and the IFF_RUNNING flag. These must be changed together.
What this means practically, is that IFF_RUNNING is set after
we have started/joined/associated with a network. And it is
cleared by ray_stop via the runq so that unfinsished commands are
not distrupted.
I still have to fix up promisc, upp/repparams and mcast.
Oh yeah, stop is essentially a noop in that it only
changes IFF_RUNNING
Move to using /sys/dev/ray for driver
Backport -current ray_res code - most are stubs.
Make ray_attr stuff look like currents layout.
Make attribute memory access use a macro and ripple through.
Drop FIXUP as we always need it
Move the code that checks the card into _probe and out of _attach and
shuffle a couple of things around in attach.
Set ifp in the variable block - catches unused variables.