summaryrefslogtreecommitdiff
path: root/sys/dev/an
AgeCommit message (Collapse)Author
2021-06-11an: Remove driverEmmanuel Vadot
Last an(4) devices have been End Of Life and End Of Sale in 2007. Time to remove this driver. Differential Revision: https://reviews.freebsd.org/D30679 Reviewed by: imp (earlier version), emaste (earlier version) Sponsored by: Diablotin Systems
2021-06-11an: Deprecate the driverEmmanuel Vadot
Last an(4) devices have been End Of Life and End Of Sale in 2007. Time to remove this driver. Differential Revision: https://reviews.freebsd.org/D30678 Reviewed by: imp (earlier version), adrian (earlier version) MFC after: 3 days Sponsored by: Diablotin Systems
2021-01-07pccard: Remove an(4) PC Card attachmentWarner Losh
Remove pccard attachment for an driver since pccard support is being removed. Relnotes: Yes
2020-09-01an: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365112
2020-08-31Warn for the non pccard attachmentsWarner Losh
These devices have non-pccard attachments. Warn for those as well. Both an and wi don't do the modern cyrpto needed to use these cards on secure wifi networks. an needs firmware from Cisco, which I don't think was ever produced. wi could in theory do it with raw frames and on-host encryption, but nobody has written that in the 15 years since WEP was cracked. MFC After: 3 days Noticed by: rgrimes Differential Revision: https://reviews.freebsd.org/D26138 Notes: svn path=/head/; revision=365015
2020-08-20Tag pccard drivers with gone in 13.Warner Losh
MFC After: 3 days Reviewed by: emaste, brooks, adrian (on twitter) Differential Revision: https://reviews.freebsd.org/D26095 Notes: svn path=/head/; revision=364430
2020-07-19[if_an] unbreak!Adrian Chadd
.. I missed this when checking drivers. Differential Revision: https://reviews.freebsd.org/D25723 Notes: svn path=/head/; revision=363328
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
2019-12-17an(4): Require privileges for all SIOCGAIRONET requests.Mark Johnston
SIOCGAIRONET allows userspace to query an(4) for various device properties and configuration, which appears to potentially include sensitive information such as WEP keys (an(4) seems to predate WPA). Also avoid races by copying in the request structure to a temporary buffer before locking and modifying the device softc. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=355864
2018-09-26Reapply, with minor tweaks, r338025, from the original commit:Warner Losh
Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
2018-08-19Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer
I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
2018-08-19Remove unused and easy to misuse PNP macro parameterConrad Meyer
Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
2018-06-13Add PNP info to PCI attachment of an driverWarner Losh
Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com> Sponsored by: Google, Inc. (GSoC 2018) Notes: svn path=/head/; revision=335080
2018-03-30Use an accessor function to access ifr_data.Brooks Davis
This fixes 32-bit compat (no ioctl command defintions are required as struct ifreq is the same size). This is believed to be sufficent to fully support ifconfig on 32-bit systems. Reviewed by: kib Obtained from: CheriBSD MFC after: 1 week Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14900 Notes: svn path=/head/; revision=331797
2017-12-23Create a new ISA_PNP_INFO macro. Use this macro every where we haveWarner Losh
ISA PNP card support (replace by hand version in if_ed). Move module declarations to the end of some files. Fix PCCARD_PNP_INFO to use nitems(). Remove some stale comments about pc98, turns out the comment was simply wrong. Notes: svn path=/head/; revision=327102
2017-11-18spdx: initial adoption of licensing ID tags.Pedro F. Giffuni
The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
2017-02-20sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni
Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
2016-05-24Reject ioctl commands for FLSHGCHR and FLSHPCHR if the size is greaterSean Bruno
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 Notes: svn path=/head/; revision=300612
2016-05-12Move mutex initialization from PCI probe to PCI attach. Drivers are notScott Long
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 Notes: svn path=/head/; revision=299544
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-02-27Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits
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 Notes: svn path=/head/; revision=296137
2015-12-11Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingWarner Losh
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 Notes: svn path=/head/; revision=292079
2015-01-06In order to reduce use of M_EXT outside of the mbuf allocator andRobert Watson
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 Notes: svn path=/head/; revision=276750
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849
2014-08-08last is set and not used, most likely a cut and paste error from otherWarner Losh
sysctl setting functions in this module. Notes: svn path=/head/; revision=269712
2014-06-10Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases,John Baldwin
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 Notes: svn path=/head/; revision=267340
2013-12-14Fix several panics when initialization of an ISA or PC-CARD device fails:Gavin Atkinson
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 Notes: svn path=/head/; revision=259393
2013-10-26The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff
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. Notes: svn path=/head/; revision=257176
2013-08-12Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIScott Long
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 Notes: svn path=/head/; revision=254263
2012-12-04Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff
malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
2012-03-12Convert a number of drivers to obtaining their parent DMA tag from theirScott Long
PCI device attachment. Notes: svn path=/head/; revision=232854
2012-01-07ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againKevin Lo
Reviewed by: yongari Notes: svn path=/head/; revision=229767
2011-12-17Fix some net80211 enum nits:Bernhard Schmidt
- 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@ Notes: svn path=/head/; revision=228621
2011-11-07Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten
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. Notes: svn path=/head/; revision=227309
2011-06-28Remove duplicate header includesKevin Lo
Notes: svn path=/head/; revision=223624
2010-05-03Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev
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 Notes: svn path=/head/; revision=207554
2009-11-24- For 350 chips, don't set various INTR bits in TX control word; turning INTRJohn Baldwin
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 Notes: svn path=/head/; revision=199757
2009-11-24Use bus_*() rather than bus_space_*().John Baldwin
Notes: svn path=/head/; revision=199756
2009-11-10- Locking fixes to not do silly things like drop the lock only to call aJohn Baldwin
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 Notes: svn path=/head/; revision=199154
2009-11-06- Use device_printf() instead of printf() with an explicit unit numberJohn Baldwin
in the PCI attach routine. - Simplify PCI probe. - Remove no-longer-used 'unit' from an_attach() parameters. PR: kern/126924 Submitted by: gavin Notes: svn path=/head/; revision=198995
2009-11-06Use device_printf() and if_printf() instead of printf() with an explicitJohn Baldwin
unit number and remove 'unit' members from softc. Notes: svn path=/head/; revision=198987
2009-02-04Shutdown routine returns int.Warner Losh
Notes: svn path=/head/; revision=188128
2008-11-06In case INET is not defined, then ANCACHE is not defined andBjoern A. Zeeb
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 Notes: svn path=/head/; revision=184708
2008-01-18Style changes from avatar.Doug Ambrisko
Submitted by: avatar Notes: svn path=/head/; revision=175446
2008-01-18First real attempt at proper locking. The locking is a little complicatedDoug Ambrisko
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@ Notes: svn path=/head/; revision=175445
2007-11-27MFP4(129048): Eliminating an unnecessary check on an_gone insideTai-hwa Liang
an_stats_update() since a properly locked callout_stop(9) does do the right thing. Reviewed by: ambrisko, jhb MFC after: 3 days Notes: svn path=/head/; revision=173975
2007-11-16MFP4(128855, 129015):Tai-hwa Liang
- 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 Notes: svn path=/head/; revision=173668
2007-09-10Fixing invalid channel display in ifconfig(8) by implementing requiredTai-hwa Liang
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) Notes: svn path=/head/; revision=172112
2007-08-07MFP4(123687): Closing another LOR by dropping the driver lock around callsTai-hwa Liang
to if_input(). Reviewed by: ambrisko Tested by: dhw Approved by: re (kensmith) Notes: svn path=/head/; revision=171775
2007-08-02MFP4(123686): Fixing various ancontrol(8) related panics by dropping locksTai-hwa Liang
around copyin()/copyout(). Reviewed by: sam, thompsa Tested by: dhw Approved by: re (kensmith) Notes: svn path=/head/; revision=171692