summaryrefslogtreecommitdiffstats
path: root/sys/dev/an
Commit message (Collapse)AuthorAgeFilesLines
* MFC r313982, r314068:pfg2017-03-141-1/+1
| | | | | | sys: Replace zero with NULL for pointers. Found with: devel/coccinelle
* Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greatersbruno2016-05-241-0/+6
| | | | | | | | | than sc->areq. This is a bounds check to ensure we're not just cramming arbitrarily sized nonsense into the driver and overflowing the heap. PR: 209545 Submitted by: cturt@hardenedbsd.org MFC after: 2 weeks
* Move mutex initialization from PCI probe to PCI attach. Drivers are notscottl2016-05-123-23/+13
| | | | | | | | allowed to create any persistent state in their probe routine because it's not guaranteed that they'll win the election and be allowed to attach. Submitted by: Matthew Macy MFC after: 3 days
* sys/dev: minor spelling fixes.pfg2016-05-032-2/+2
| | | | Most affect comments, very few have user-visible effects.
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().jhibbits2016-02-271-6/+6
| | | | | | | | Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370
* Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingimp2015-12-111-0/+1
| | | | | | | | | block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number. Differential Review: https://reviews.freebsd.org/D3461
* In order to reduce use of M_EXT outside of the mbuf allocator andrwatson2015-01-061-4/+2
| | | | | | | | | | | | | | | | | | | | | socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division
* Mechanically convert to if_inc_counter().glebius2014-09-191-20/+20
|
* last is set and not used, most likely a cut and paste error from otherimp2014-08-081-3/+1
| | | | sysctl setting functions in this module.
* Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,jhb2014-06-101-8/+0
| | | | | | | | | don't create a map before calling bus_dmamem_alloc() (such maps were leaked). It is believed that the extra destroy of the map was generally harmless since bus_dmamem_alloc() often uses special maps for which bus_dmamap_destroy() is a no-op (e.g. on x86). Reviewed by: scottl
* Fix several panics when initialization of an ISA or PC-CARD device fails:gavin2013-12-142-6/+5
| | | | | | | | | | | | o Assign sc->an_dev in an_probe() (which isn't really a probe function in the standard newbus sense) as we may need it for printing errors. o Use device_printf() rather than if_printf() in an_reset() - this is called from an_probe() long before the ifp structure is initialised in an_attach(). o Initialize the ifp structure early in an_attach() as we use if_printf() in cases where allocation of descriptors etc fails. MFC after: 3 days
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-261-0/+1
| | | | | | | | to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIscottl2013-08-121-14/+0
| | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-041-4/+4
| | | | malloc(9) flags in sys/dev.
* Convert a number of drivers to obtaining their parent DMA tag from theirscottl2012-03-121-1/+1
| | | | PCI device attachment.
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againkevlo2012-01-071-1/+0
| | | | Reviewed by: yongari
* Fix some net80211 enum nits:bschmidt2011-12-171-2/+2
| | | | | | | | | | - ic_vap_create() uses an ieee80211_opmode argument - ieee80211_rate2media() takes an ieee80211_phymode argument - ieee80211_plcp2rate() takes an ieee80211_phytype argument - cast to enum ieee80211_protmode and ieee80211_roamingmode to silence compiler warnings Submitted by: arundel@
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+2
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* Remove duplicate header includeskevlo2011-06-281-1/+0
|
* Add new tunable 'net.link.ifqmaxlen' to set default send interfacesobomax2010-05-031-2/+2
| | | | | | | | | | queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month
* - For 350 chips, don't set various INTR bits in TX control word; turning INTRjhb2009-11-242-9/+14
| | | | | | | | | bits on seems to confuse hardware TX engine. - For 350 chips, set TX desc's buffer physical address before turning on the TX desc valid bit. Submitted by: Jeremy O'Brien obrien654j | gmail, sephe Obtained from: DragonFly BSD
* Use bus_*() rather than bus_space_*().jhb2009-11-245-39/+12
|
* - Locking fixes to not do silly things like drop the lock only to call ajhb2009-11-102-76/+67
| | | | | | | | | function that immediately reacquires the lock. Also removes recursive locking. - Use the statistics timer to drive the transmit watchdog instead of using if_watchdog and if_timer. Tested by: gavin
* - Use device_printf() instead of printf() with an explicit unit numberjhb2009-11-065-19/+16
| | | | | | | | | in the PCI attach routine. - Simplify PCI probe. - Remove no-longer-used 'unit' from an_attach() parameters. PR: kern/126924 Submitted by: gavin
* Use device_printf() and if_printf() instead of printf() with an explicitjhb2009-11-062-70/+61
| | | | unit number and remove 'unit' members from softc.
* 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
|
OpenPOWER on IntegriCloud