summaryrefslogtreecommitdiffstats
path: root/sys/dev/an
Commit message (Collapse)AuthorAgeFilesLines
* Shutdown routine returns int.imp2009-02-042-3/+3
|
* In case INET is not defined, then ANCACHE is not defined andbz2008-11-061-0/+2
| | | | | | | | the sc does not have 'an_have_rssimap' variable. Add an ANCACHE check to poperly hide the case and make an(4) compile without INET. MFC after: 2 months
* Style changes from avatar.ambrisko2008-01-182-48/+48
| | | | Submitted by: avatar
* First real attempt at proper locking. The locking is a little complicatedambrisko2008-01-183-122/+253
| | | | | | | | | | | | | | | | | | | | since the the command and data that is being built to be sent to or read from the HW lives in the softc. Commands are later run via an_setdef etc. In the ioctl path various references are kept to the data stored in the softc so it needs to be protected. Almost think of the command in the softc a global variable since it essentially is. Since locking wasn't done in this type of context the commands would get corrupted. Thanks to avatar@ for catching some lock issues and dhw@ for testing. Things are a lot more stable except for the MPI-350 cards. My an(4) remote laptop stays on the network now. The driver should be changed so that it uses private memory that is passed to the functions that talk to the card. Then only those functions would really need to grab locks. Reviewed by: avatar@
* MFP4(129048): Eliminating an unnecessary check on an_gone insideavatar2007-11-271-4/+0
| | | | | | | | an_stats_update() since a properly locked callout_stop(9) does do the right thing. Reviewed by: ambrisko, jhb MFC after: 3 days
* MFP4(128855, 129015):avatar2007-11-162-11/+18
| | | | | | | | | | | | | | | | | - Trying to eliminate another racing by replacing the timeout(9) with callout APIs. In addition to that, the callout_drain() in an_detach() help us to avoid a possible panic-on-free due to the callout API tries to lock a destroyed mutex. - In an_stats_update(), check the return value of an_read_record(). This should reduce the chance of device removal(PCCARD) panic [2]. - Adding a comment to state the fact that an_stats_update() is now called via callout(9) with a lock held [2]. Submitted by: jhb [1], ambrisko [2] Reviewed by: jhb, ambrisko Reported by: dhw Tested by: dhw MFC after: 3 days
* Fixing invalid channel display in ifconfig(8) by implementing requiredavatar2007-09-101-0/+17
| | | | | | | | | | | | | | | ioctl(). Note that other information provided by ifconfig(8) such like "list chan" or "list ap" are still not available at this moment. Before an(4) is connected to wlan(4), users are encouraged to use ancontrol(8) to retrieve aforementioned information. Reported by: dhw (http://lists.freebsd.org/pipermail/freebsd-current/2007-July/074848.html) Reviewed by: ambrisko Tested by: dhw Approved by: re (bmah)
* MFP4(123687): Closing another LOR by dropping the driver lock around callsavatar2007-08-071-1/+3
| | | | | | | | to if_input(). Reviewed by: ambrisko Tested by: dhw Approved by: re (kensmith)
* MFP4(123686): Fixing various ancontrol(8) related panics by dropping locksavatar2007-08-021-12/+60
| | | | | | | | around copyin()/copyout(). Reviewed by: sam, thompsa Tested by: dhw Approved by: re (kensmith)
* Remove assignment to uninitialized variable that wasn't then used anyway.mjacob2007-06-081-2/+0
|
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-233-3/+3
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-5/+6
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* Silence the strict-alias warnings. Make a trip through (void *) whenimp2006-02-041-16/+16
| | | | | | casting a structure to a uint32_t *. Many drivers in the tree do this, but I'll not update them until these changes can be reviewed by the pedantic standards folks.
* Since the A-Z range is contained in the previous check, the else-if isnjl2006-01-261-3/+2
| | | | | | | | dead code. Clean up both by using isprint() instead, since that's what it really wants. Coverity ID: 100 Found by: Coverity Prevent
* Don't leak mbufs and mbuf clusters in several error-handling situationsrwatson2006-01-151-0/+4
| | | | | | | in the if_an receive routine. Found with: Coverity Prevent (tm) MFC after: 1 week
* If frame length is excessive, don't leak an mbuf and cluster whenrwatson2006-01-151-0/+1
| | | | | | | abandoning processing. Found with: Coverity Prevent (tm) MFC after: 1 week
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-2/+3
| | | | | | | | | | rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr. - Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
* - Make IFP2ENADDR() a pointer to IF_LLADDR() rather than anotherru2005-11-111-6/+0
| | | | | | | | copy of Ethernet address. - Change iso88025_ifattach() and fddi_ifattach() to accept MAC address as an argument, similar to ether_ifattach(), to make this work.
* MFp4: Remove OLDCARD shimsimp2005-09-221-27/+13
|
* MFp4: trivial KNF nitsimp2005-09-221-6/+1
|
* MFp4: KNF (mostly remove K&R function definitions). Fix some spaces leftimp2005-09-221-176/+82
| | | | | | | over from de__Ping. # Didn't fix the -Exxxx return statements that appaer to be linuxisms # (and wrong) since I don't have hardware to test with.
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weimp2005-09-191-1/+1
| | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call.
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-12/+12
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Minor style nits.imp2005-08-031-6/+4
|
* Do not lock an to check gone flag. Only need to hold the lock to setemax2005-08-021-2/+1
| | | | | | | the gone flag. Reviewed by: imp MFC after: 1 day
* Reorganize an_detach() a bit. Make sure ether_ifdetach() and if_free()emax2005-07-271-3/+4
| | | | | | | | | | | are called outside of AN_LOCK()/AN_UNLOCK. This fixes the following WITNESS warning (produced when an(4) PCMCIA card is detached). taskqueue_drain with the following non-sleepable locks held: exclusive sleep mutex an0 (network driver) r = 0 (0xc59af168) locked @ /usr/src/sys/dev/an/if_an.c:2836 MFC after: 3 days Silence from: current@
* Eliminate unused argument in PCMCIA_CARD macro.imp2005-06-241-4/+4
| | | | | | | | Provide a backwards compatible way to have the extra macro by defining PCCARD_API_LEVEL 5 before including pccarddevs for driver writers that want/need to have the same driver on 5 and 6 with pccard attachments. Approved by: re (dwhite)
* Initialize sc->an_ifp when doing if_alloc(). This prevents an(4)delphij2005-06-141-1/+1
| | | | | | from being panic when attaching. Approved by: re (scottl)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-102-18/+24
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* check copyin/copyout return valuessam2005-03-281-14/+24
| | | | Noticed by: Coverity Prevent analysis tool
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-2/+2
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-065-5/+5
|
* Second part of ALTQ driver modifications, covering:mlaier2004-08-011-5/+7
| | | | | | | | | | an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4) Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/ Tested by: Vaidas Damosevicius (an, ath, wi) Roman Divacky (vr) Submitted by: yongari (hme)
* While setting up a transmit packet disable interupts on the card thenambrisko2004-06-171-0/+6
| | | | | re-enable them after we are done setting up the packet. This seems to fix the MPI350 newer firmware hangs.
* Fix disordering of pccarddevs.h noticed by bde. Also remove a fewimp2004-05-271-3/+4
| | | | | | redundant includes and fix some of the include disordering. Submitted by: bde
* Move to generating pccarddevs.h on the fly, both for the kernel andimp2004-05-261-1/+1
| | | | | | | the modules. Also generate usbdevs.h automatically now, but a non-kernel file is stopping that at the moment.
* We don't need to initialize if_output, ether_ifattach() does itmux2004-05-231-1/+0
| | | | for us.
* It turns out that the module dependency on pccard is in error. Sinceimp2004-05-081-1/+0
| | | | | | | | | | | | there's not dependencies on pccard symboles, such a dependency is not necessary. This means that drivers that have multiple attachments can not drag bogus devices into the kernel at load time. We can't (yet) do this with pci and isa. Drivers written for them actually do seem to have symbols that depend on these busses' implementation code. ndis not touched until other things can be tested.
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+2
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Announce ethernet MAC addresss in ether_ifattach().mdodd2004-03-141-3/+0
|
* Remove the HACK section it breaks the older firmware and doesn't totallyambrisko2004-01-101-21/+0
| | | | fix the new firmware so remove it.
* - Bump up the general and status RID sizesambrisko2003-12-306-67/+46
| | | | | | | | | | | - Clear out an_dma_vaddr on free so we can test to see if dma is setup when the card is kldunloaded/kldloaded etc. only for MPI350 - Use a common detach like wi(4) - Notify on RID read overflow and truncate this currently causes a panic in -stable when the stack during an ifconfig an0 is done with newer firmware - Convert from UNLOCK/tsleep/LOCK to msleep. I thought I did that a while ago.
* Drop the driver lock around calls to if_input to avoid a LOR whensam2003-11-142-0/+5
| | | | | | | | the packets are immediately returned for sending (e.g. when bridging or packet forwarding). There are more efficient ways to do this but for now use the least intrusive approach. Reviewed by: imp, rwatson
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+3
| | | | | | | | | | | | | 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)
* Xircom Wireless Ethernet card is a rebadged Cisco 340, but with aimp2003-10-081-0/+1
| | | | | | different vendor id/product id. Submitted by: Keith Davis
* Use PCIR_BAR(x) instead of PCIR_MAPS.jhb2003-09-021-3/+3
| | | | | Glanced over by: imp, gibbs Tested by: i386 LINT
* Use __FBSDID().obrien2003-08-244-10/+7
| | | | Also some minor style cleanups.
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Fix panic from having multiple locks held when updating firmware. AN_LOCKambrisko2003-08-201-9/+11
| | | | was asserted during a tsleep resulting in a panic in tsleep.
OpenPOWER on IntegriCloud