Commit Graph

68 Commits

Author SHA1 Message Date
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Alfred Perlstein
d602acc208 fix warnings. NULL -> 0 2003-12-24 19:00:49 +00:00
Brooks Davis
9bf40ede4a Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.

This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.

Approved By:	re (in principle)
Reviewed By:	njl, imp
Tested On:	i386, amd64, sparc64
Obtained From:	NetBSD (if_xname)
2003-10-31 18:32:15 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Sam Leffler
d7648a8288 update to new 802.11 support 2003-06-28 17:57:30 +00:00
Sam Leffler
2c71d3c795 update for new 802.11 support 2003-06-28 06:17:26 +00:00
Alexander Kabaev
104a9b7e3e Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on:	standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-04-29 13:36:06 +00:00
Duncan Barclay
4becbcddc0 Retire some misleading comments and explain why we need to keep a copy
of parameters written to the card.
2003-03-05 18:13:19 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Sam Leffler
673d91916d network interface driver changes:
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
2002-11-14 23:54:55 +00:00
Alfred Perlstein
47f654d3a0 Fix warnings.
There's no need to use concatination when you have 'something.macro_arg'.
Comment out comment following #endif.
2002-06-01 18:50:35 +00:00
Duncan Barclay
60453b06de Primary purpose of this commit is to enable support for the Aviator
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
2001-05-17 22:23:49 +00:00
Duncan Barclay
3f36f543ff Eliminate some panics for errors we can recover from.
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
2001-05-09 00:03:19 +00:00
Duncan Barclay
9dc1f83dc8 Remove if_ray_oldcard.h because pccard support multiple windows now.
Setup attribute memory resource in ray_probe so that it is added to
the print out of the resource list on card insertion.
2001-05-07 13:11:08 +00:00
Duncan Barclay
a6a0d91dba pkh's TAILQ changes to if_mutliaddrs missed a counting loop. 2001-03-04 20:56:45 +00:00
Poul-Henning Kamp
6817526d14 Convert if_multiaddrs from LIST to TAILQ so that it can be traversed
backwards in the three drivers which want to do that.

Reviewed by:    mikeh
2001-02-06 10:12:15 +00:00
Poul-Henning Kamp
37d4006626 Another round of the <sys/queue.h> FOREACH transmogriffer.
Created with:   sed(1)
Reviewed by:    md5(1)
2001-02-04 16:08:18 +00:00
Poul-Henning Kamp
78d82c8c59 Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead of
<sys/queue.h> implementation details.

Created with:   /usr/sbin/sed
Reviewed with:  /sbin/md5
2001-02-03 16:29:10 +00:00
Duncan Barclay
a07736d0f6 Take advantage of the fixes to the pcic code that allows multiple
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.
2001-01-17 17:55:00 +00:00
Warner Losh
486d464d74 o Now that I've had time to test the new interface, reintegrate it back in.
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)
2001-01-07 16:31:09 +00:00
Duncan Barclay
2ae2c42c38 Tidy up if_init routine so that it does not return an error. 2001-01-02 20:29:25 +00:00
Bill Paul
b1f3daafde Fix probe/attach a little. We don't have to call bpfattach() anymore
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
2000-12-08 21:35:11 +00:00
Warner Losh
3e8e7863b2 Changes necessary to make this work.
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.
2000-11-12 21:43:52 +00:00
Duncan Barclay
6b55e51be0 Add attribute memory setup warnings 2000-07-11 21:31:59 +00:00
Duncan Barclay
766748ceac Move newbus detection code to alloc routines.
Work around pccard nasties.
2000-07-07 19:13:11 +00:00
Duncan Barclay
cbe16a893d Subtle Tx bugs - I wonder why the cast wans't picked up... 2000-06-21 21:37:27 +00:00
Duncan Barclay
a8cef3390b Minor tweaks to error messages (after writing man page).
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.
2000-06-20 20:14:29 +00:00
Duncan Barclay
0218cb013b General tidy up and plough through TODO list.
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.
2000-06-18 21:40:46 +00:00
Duncan Barclay
da5777391d Suck out all of the current and desired n/w parameters. 2000-06-11 13:57:59 +00:00
Duncan Barclay
46281163a8 A bunch of misc. tidy ups really.
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!
2000-06-11 13:32:07 +00:00
Duncan Barclay
5f95c244f0 Removed a few RAY_MAP_CMs that were not needed.
Made checking sc->gone a lot safer by checking to see if sc is NULL first.

Made return from tsleep in the ccs allocator detach safe.
2000-06-10 21:24:36 +00:00
Duncan Barclay
8204ff6102 Remove promisc_user, ray_reset and ray_reset_timo as they are not used. Incidental remove of a timer too. Remove the runq_abort code.
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.
2000-06-10 13:50:57 +00:00
Duncan Barclay
8544bea23f Main changes are resurection of mutlicast code (jgibbs moved the stuff I
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.
2000-06-04 17:51:36 +00:00
Duncan Barclay
66d7d8c631 Remove unused ioctl locking 2000-05-28 23:23:24 +00:00
Duncan Barclay
9385b6d6d7 A bit of a messy monster.
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
2000-05-28 23:10:12 +00:00
Duncan Barclay
1a733adb0e Moved a bit of resource allocation from probe to attach based on feedback
in -hackers on the correct driver structure.

Started to tidy up _detach and _stop.

Added the comq array stuff into mcast.
2000-05-23 16:38:12 +00:00
Duncan Barclay
ca08af854e MFRELENG_3 2000-05-21 21:20:18 +00:00
Duncan Barclay
753c209eb7 Newbusify resource allocation.
Have OLDCARD version of the remapping.

Remove BPF conditionals.

Remove ISA/3.x stuff and add -current stuff.
2000-05-11 18:55:38 +00:00
Duncan Barclay
9fad5d9072 Move a couple fo things around to be nicer for -current
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
2000-05-10 21:19:38 +00:00
Duncan Barclay
88577b0806 Move _detach to be underneath _attach.
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.
2000-05-07 16:03:36 +00:00
Duncan Barclay
b986ec50b9 Move variables to if_rayvar.h 2000-05-07 15:15:06 +00:00
Duncan Barclay
9eb774e39c Sync with an early version of the -current code. Mainly a tidy up
of some function names, dropping the ISA bits that were never used and
removing __P

We've renamed the _pccard_ stuff as nothing else probes or attaches.

In the next commit we will move some routines around and split out some of the
structure definitions to another file.

I've dropped the SYSCTL as I never got it working. APM is gone too as it
is broken.

Note, that the attr_read/write will be in both this and NEWCARD/NEWBUS so
I've moved the prototypes to the right place.
Add a few casts.
2000-05-07 15:00:06 +00:00
Duncan Barclay
049629c406 Cosmetic to make errors messages look similar. 2000-04-24 15:49:20 +00:00
Duncan Barclay
d4f3c0d870 Moved debugging definitions to a header file.
Removed NETBSDTX spares.

Renamed a load of functions - specifcally
	start -> tx
	init has download, sj and assoc as sub-functions
	report_params and update params move to repparams/upparams

Tidied up old #define's

Got rid of old DPRINTF, made printf's RAY_PRINTF and panic's RAY_PANIC

All code KNF

Removed checking the ECF_TO_HOST area in ray_init - this gets hosed
when someone updates/read a parameter from the card so causes
unneeded grief. This required moving the tib check into ray_attach.

Changed handling of interface flags in ioctl so that promiscous mode
changes are only done as needed.

Sequences of comq entries can be added to an array and automatically
dealt with - used in ray_init_user and others.

Moved IFF_RUNNING checks from the comq commands to com_runq - still
not sure what to do so we PANIC - will be fixed.

ray_sj now checks to see if any of the parameters it can update can be
updated.

ray_sj_done now updates parameters to the current n/w set if we changed
them earlier. I was being a bit thick in earlier comments as to why this
check was done - the ECF never changes the parameters.

Assocication with APs is handled outside of ray_sj - need to add
WEP stuff if I ever get my hands on an AP.

ray_stop, ray_unload and ray_reset are currently broken - reset isn't used anyway.

ray_tx_XXX and ray_rx only have cosmetic changes.

Interrupt handler now gets command out of ccs. This is so ray_intr_ccs and
ray_intr_rcs don't need to remap CM (I'm trying to roll things up a bit as
it must be slowing us down).

ray_intr_ccs just vectors commands to functions or error checks - a
jump table could replace it in ray_intr.

Ditto for ray_intr_rcs.

mcast is currently broken - I need to do more work for ALLMULTI etc. This is reasonably easy to fix becuase of the comq array stuff.

Added a few more checks into repparams so that it is firmware version aware. It also uses the new comq framework.

Parameter updating is also much better with the update parameter return routine re-worked.

Added a couple of runq entry helper functions - one that malloc's a new
entry and fills it in with sensible defaults and another that adds and
runs a seqencue of entries.
2000-04-24 15:19:40 +00:00
Duncan Barclay
276c01a834 Make the moved about version compile and run 2000-04-24 10:10:01 +00:00
Duncan Barclay
66682a7f1e Moved functions around so that they are grouped a little more sensibly. 2000-04-22 14:22:51 +00:00
Duncan Barclay
4e618aafa1 Functional driver with new command queue in place.
Working download and start/join network. What's nice is that I didn't touch
TX or RX code at all.

Not fully done yet - stubs for assoc, cast, promisc and user param updating. I
can't work out the "nicest" way to get the mcast and promisc interactions
sorted without needing to abort runq commands half way through. And, as
mcast/promisc used elsewhere I want to get this right.

Other stuff
	Fancy new debugging with __FUNCTION__ and __LINE__.

	Lots of panic's inserted until I check some stuff out.

	Removed all of the old scheduler.

	Removed start join timeout as I don't need it.

	Removed the promiscuous broadcast code that waas ifdef'd out.

	New CCS allocation
2000-04-21 15:01:49 +00:00
Duncan Barclay
9273e2696c A messy commit that checkpoints the driver (not known to actually work)
before I rip out the scheduler - whilst v. nice 'n all, it is doing the
wrong job. We need something that sends commands to the card atomically
so dhcp etc. works right.

I've renamed and moved a lot of the scheduler code so that it is all
in one place and all starts with ray_cmd_

ray_stop has some debugging crap left in - to be deleted rsn
2000-04-15 19:51:18 +00:00