summaryrefslogtreecommitdiffstats
path: root/sys/dev/ray/if_ray.c
Commit message (Collapse)AuthorAgeFilesLines
* fix warnings. NULL -> 0alfred2003-12-241-4/+4
|
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+1
| | | | | | | | | | | | | 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)
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* update to new 802.11 supportsam2003-06-281-2/+1
|
* update for new 802.11 supportsam2003-06-281-0/+1
|
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-291-2/+1
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Retire some misleading comments and explain why we need to keep a copydmlb2003-03-051-10/+8
| | | | of parameters written to the card.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-3/+3
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-3/+3
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-2/+2
| | | | especially in troff files.
* network interface driver changes:sam2002-11-141-16/+7
| | | | | | | | | | | | | | 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
* Fix warnings.alfred2002-06-011-3/+3
| | | | | There's no need to use concatination when you have 'something.macro_arg'. Comment out comment following #endif.
* Primary purpose of this commit is to enable support for the Aviatordmlb2001-05-171-248/+539
| | | | | | | | | | | | | | | | | | | | | | 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
* Eliminate some panics for errors we can recover from.dmlb2001-05-091-163/+120
| | | | | | | | | | | 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
* Remove if_ray_oldcard.h because pccard support multiple windows now.dmlb2001-05-071-4/+7
| | | | | Setup attribute memory resource in ray_probe so that it is added to the print out of the resource list on card insertion.
* pkh's TAILQ changes to if_mutliaddrs missed a counting loop.dmlb2001-03-041-1/+2
|
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedphk2001-02-061-2/+2
| | | | | | backwards in the three drivers which want to do that. Reviewed by: mikeh
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-041-2/+1
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead ofphk2001-02-031-4/+2
| | | | | | | <sys/queue.h> implementation details. Created with: /usr/sbin/sed Reviewed with: /sbin/md5
* Take advantage of the fixes to the pcic code that allows multipledmlb2001-01-171-107/+24
| | | | | | | | | | | | 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 Now that I've had time to test the new interface, reintegrate it back in.imp2001-01-071-2/+2
| | | | | | | | | | | | | | | 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)
* Tidy up if_init routine so that it does not return an error.dmlb2001-01-021-1/+13
|
* Fix probe/attach a little. We don't have to call bpfattach() anymorewpaul2000-12-081-22/+19
| | | | | | | | | 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
* Changes necessary to make this work.imp2000-11-121-103/+78
| | | | | | | | | | 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.
* Add attribute memory setup warningsdmlb2000-07-111-37/+86
|
* Move newbus detection code to alloc routines.dmlb2000-07-071-50/+68
| | | | Work around pccard nasties.
* Subtle Tx bugs - I wonder why the cast wans't picked up...dmlb2000-06-211-4/+4
|
* Minor tweaks to error messages (after writing man page).dmlb2000-06-201-49/+81
| | | | | | | | 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.
* General tidy up and plough through TODO list.dmlb2000-06-181-303/+143
| | | | | | | | | | | | | | | | | 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.
* Suck out all of the current and desired n/w parameters.dmlb2000-06-111-1/+13
|
* A bunch of misc. tidy ups really.dmlb2000-06-111-209/+195
| | | | | | | | | | | | | | | | | | | | | | | 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!
* Removed a few RAY_MAP_CMs that were not needed.dmlb2000-06-101-22/+13
| | | | | | 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.
* Remove promisc_user, ray_reset and ray_reset_timo as they are not used. ↵dmlb2000-06-101-206/+120
| | | | | | | | | | | | 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.
* Main changes are resurection of mutlicast code (jgibbs moved the stuff Idmlb2000-06-041-175/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove unused ioctl lockingdmlb2000-05-281-85/+14
|
* A bit of a messy monster.dmlb2000-05-281-395/+517
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Moved a bit of resource allocation from probe to attach based on feedbackdmlb2000-05-231-122/+109
| | | | | | | | in -hackers on the correct driver structure. Started to tidy up _detach and _stop. Added the comq array stuff into mcast.
* MFRELENG_3dmlb2000-05-211-187/+625
|
* Newbusify resource allocation.dmlb2000-05-111-196/+234
| | | | | | | | Have OLDCARD version of the remapping. Remove BPF conditionals. Remove ISA/3.x stuff and add -current stuff.
* Move a couple fo things around to be nicer for -currentdmlb2000-05-101-168/+180
| | | | | | | | | | | | 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 _detach to be underneath _attach.dmlb2000-05-071-182/+155
| | | | | | | 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.
* Move variables to if_rayvar.hdmlb2000-05-071-218/+2
|
* Sync with an early version of the -current code. Mainly a tidy updmlb2000-05-071-118/+80
| | | | | | | | | | | | | | | | | 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.
* Cosmetic to make errors messages look similar.dmlb2000-04-241-4/+4
|
* Moved debugging definitions to a header file.dmlb2000-04-241-1313/+1042
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Make the moved about version compile and rundmlb2000-04-241-2/+6
|
* Moved functions around so that they are grouped a little more sensibly.dmlb2000-04-221-1012/+1016
|
* Functional driver with new command queue in place.dmlb2000-04-211-1278/+1068
| | | | | | | | | | | | | | | | | | | | | | | 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
* A messy commit that checkpoints the driver (not known to actually work)dmlb2000-04-151-236/+330
| | | | | | | | | | | 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
* Most of this commit are minor changes whilst trying to make the driverdmlb2000-04-091-217/+375
| | | | | | | | | | | | robust enough to work with dhcp. Essentially the driver returns to userland before certain commands have been completed by the card. I'm trying to work out the best way to fix this. There are very minor functional changes, most of this is debugging. Rework of debugging so a bit mask is used and re-allocation around the place. Tried to protect ray_init with a tsleep until the network has been joined. I think this is only a partial fix as we also update the mcast and promisc values.
OpenPOWER on IntegriCloud