summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_vr.c
AgeCommit message (Collapse)Author
2022-09-24Remove unnecessary include of <sys/malloc.h>.thorpej
2022-09-17Eliminate use of IFF_OACTIVE.thorpej
2021-07-24s/structres/structures + s/whenver/wheneverandvar
2021-05-08Use pci_compatible_match().thorpej
2020-02-07Use callout_setfunc() / callout_schedule().thorpej
2020-01-30Adopt <net/if_stats.h>.thorpej
2019-09-13 if_flags is neither int nor short. It's unsigned short.msaitoh
2019-05-28 Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.msaitoh
2019-05-23 Whitespace fix (mainly tabify).msaitoh
2019-05-23-No functional change:msaitoh
- Simplify struct ethercom's pointer near ETHER_FIRST_MULTI(). - Simplify MII structure initialization. - u_int*_t -> uint*_t. - KNF
2019-01-22 Change MII PHY read/write API from:msaitoh
int (*mii_readreg_t)(device_t, int, int); void (*mii_writereg_t)(device_t, int, int, int); to: int (*mii_readreg_t)(device_t, int, int, uint16_t *); int (*mii_writereg_t)(device_t, int, int, uint16_t); Now we can test if a read/write operation failed or not by the return value. In 802.3 spec says that the PHY shall not respond to read/write transaction to the unimplemented register(22.2.4.3). Detecting timeout can be used to check whether a register is implemented or not (if the register conforms to the spec). ukphy(4) can be used this for MII_MMDACR and MII_MMDAADR. Note that I noticed that the following code do infinite loop in the read/wirte function. If it accesses unimplemented PHY register, it will hang. It should be fixed: arm/at91/at91emac.c arm/ep93xx/epe.c arm/omap/omapl1x_emac.c mips/ralink/ralink_eth.c arch/powerpc/booke/dev/pq3etsec.c(read) dev/cadence/if_cemac.c <- hkenken dev/ic/lan9118.c Tested with the following device: axe+ukphy axe+rgephy axen+rgephy (tested by Andrius V) wm+atphy wm+ukphy wm+igphy wm+ihphy wm+makphy sk+makphy sk+brgphy sk+gentbi msk+makphy sip+icsphy sip+ukphy re+rgephy bge+brgphy bnx+brgphy gsip+gphyter rtk+rlphy fxp+inphy (tested by Andrius V) tlp+acphy ex+exphy epic+qsphy vge+ciphy (tested by Andrius V) vr+ukphy (tested by Andrius V) vte+ukphy (tested by Andrius V) Not tested (MAC): arm:at91emac arm:cemac arm:epe arm:geminigmac arm:enet arm:cpsw arm:emac(omac) arm:emac(sunxi) arm:npe evbppc:temac macppc:bm macppc:gm mips:aumac mips:ae mips:cnmac mips:reth mips:sbmac playstation2:smap powerpc:tsec powerpc:emac(ibm4xx) sgimips:mec sparc:be sf ne(ax88190, dl10019) awge ep gem hme smsh mtd sm age alc ale bce cas et jme lii nfe pcn ste stge tl xi aue mue smsc udav url Not tested (PHY): amhphy bmtphy dmphy etphy glxtphy ikphy iophy lxtphy nsphyter pnaphy rdcphy sqphy tlphy tqphy urlphy
2018-12-09use pci_intr_establish_xname() everywherejdolecek
2018-07-18Be consistent among ethernet drivers on the convention for printing ethernetsevan
addresses. NFC
2018-06-26 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backwardmsaitoh
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same as FreeBSD. This change also fixes a bug that the direction is misunderstand on some environment by passing the direction to bpf_mtap*() instead of checking m->m_pkthdr.rcvif.
2018-02-28Cosmetic printf/aprint changes.flxd
Add missing return statement after failed pci_intr_establish().
2018-02-28Cosmetic fix for the Physical Address Registers PAR0 to PAR5.flxd
2016-12-15Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_inputozaki-r
The benefits of the change are: - We can reduce codes - We can provide the same behavior between drivers - Where/When if_ipackets is counted up - Note that some drivers still update packet statistics in their own way (periodical update) - Moved bpf_mtap run in softint - This makes it easy to MP-ify bpf Proposed on tech-kern and tech-net
2016-12-08Apply deferred if_start frameworkozaki-r
if_schedule_deferred_start checks if the if_snd queue contains packets, so drivers don't need to check it by themselves.
2016-07-14- Use aprint*() instead of printf() in xxx_attach().msaitoh
- Add missing aprint_naive("\n"); - KNF
2016-07-07KNF. Remove extra spaces. No functional change.msaitoh
2016-06-10Introduce m_set_rcvif and m_reset_rcvifozaki-r
The API is used to set (or reset) a received interface of a mbuf. They are counterpart of m_get_rcvif, which will come in another commit, hide internal of rcvif operation, and reduce the diff of the upcoming change. No functional change.
2016-02-09Introduce softint-based if_inputozaki-r
This change intends to run the whole network stack in softint context (or normal LWP), not hardware interrupt context. Note that the work is still incomplete by this change; to that end, we also have to softint-ify if_link_state_change (and bpf) which can still run in hardware interrupt. This change softint-ifies at ifp->if_input that is called from each device driver (and ieee80211_input) to ensure Layer 2 runs in softint (e.g., ether_input and bridge_input). To this end, we provide a framework (called percpuq) that utlizes softint(9) and percpu ifqueues. With this patch, rxintr of most drivers just queues received packets and schedules a softint, and the softint dequeues packets and does rest packet processing. To minimize changes to each driver, percpuq is allocated in struct ifnet for now and that is initialized by default (in if_attach). We probably have to move percpuq to softc of each driver, but it's future work. At this point, only wm(4) has percpuq in its softc as a reference implementation. Additional information including performance numbers can be found in the thread at tech-kern@ and tech-net@: http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html Acknowledgment: riastradh@ greatly helped this work. Thank you very much!
2015-04-13Convert sys/dev to use <sys/rndsource.h>.riastradh
2014-08-10Merge tls-earlyentropy branch into HEAD.tls
2014-03-29make pci_intr_string and eisa_intr_string take a buffer and a lengthchristos
instead of relying in local static storage.
2012-12-27- reset the chip if the tx engine gets stuck after a link state change,jmcneill
from OpenBSD - no need to do a full reset of the chip when enabling or disabling promiscuous mode
2012-07-22Fix mii_statchg to take a 'struct ifnet *' instead of device_t. This fixesmatt
problem with a common MDIO bus used for multiple interfaces. Some drivers converted to CFATTACL_DECL_NEW.
2012-02-02Entropy-pool implementation move and cleanup.tls
1) Move core entropy-pool code and source/sink/sample management code to sys/kern from sys/dev. 2) Remove use of NRND as test for presence of entropy-pool code throughout source tree. 3) Remove use of RND_ENABLED in device drivers as microoptimization to avoid expensive operations on disabled entropy sources; make the rnd_add calls do this directly so all callers benefit. 4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might have lead to slight entropy overestimation for some sources. 5) Add new source types for environmental sensors, power sensors, VM system events, and skew between clocks, with a sample implementation for each. ok releng to go in before the branch due to the difficulty of later pullup (widespread #ifdef removal and moved files). Tested with release builds on amd64 and evbarm and live testing on amd64.
2012-01-30Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive}drochner
where it looks straightforward, and pci_aprint_devinfo_fancy in a few others where drivers want to supply their own device names instead of the pcidevs generated one. More complicated cases, where names are composed at runtime, are left alone for now. It certainly makes sense to simplify the drivers here rather than inventing a catch-all API. This should serve as as example for new drivers, and also ensure consistent output in the AB_QUIET ("boot -q") case. Also, it avoids excessive stack usage where drivers attach child devices because the buffer for the device name is not kept on the local stack anymore.
2011-11-19First step of random number subsystem rework described intls
<20111022023242.BA26F14A158@mail.netbsd.org>. This change includes the following: An initial cleanup and minor reorganization of the entropy pool code in sys/dev/rnd.c and sys/dev/rndpool.c. Several bugs are fixed. Some effort is made to accumulate entropy more quickly at boot time. A generic interface, "rndsink", is added, for stream generators to request that they be re-keyed with good quality entropy from the pool as soon as it is available. The arc4random()/arc4randbytes() implementation in libkern is adjusted to use the rndsink interface for rekeying, which helps address the problem of low-quality keys at boot time. An implementation of the FIPS 140-2 statistical tests for random number generator quality is provided (libkern/rngtest.c). This is based on Greg Rose's implementation from Qualcomm. A new random stream generator, nist_ctr_drbg, is provided. It is based on an implementation of the NIST SP800-90 CTR_DRBG by Henric Jungheim. This generator users AES in a modified counter mode to generate a backtracking-resistant random stream. An abstraction layer, "cprng", is provided for in-kernel consumers of randomness. The arc4random/arc4randbytes API is deprecated for in-kernel use. It is replaced by "cprng_strong". The current cprng_fast implementation wraps the existing arc4random implementation. The current cprng_strong implementation wraps the new CTR_DRBG implementation. Both interfaces are rekeyed from the entropy pool automatically at intervals justifiable from best current cryptographic practice. In some quick tests, cprng_fast() is about the same speed as the old arc4randbytes(), and cprng_strong() is about 20% faster than rnd_extract_data(). Performance is expected to improve. The AES code in src/crypto/rijndael is no longer an optional kernel component, as it is required by cprng_strong, which is not an optional kernel component. The entropy pool output is subjected to the rngtest tests at startup time; if it fails, the system will reboot. There is approximately a 3/10000 chance of a false positive from these tests. Entropy pool _input_ from hardware random numbers is subjected to the rngtest tests at attach time, as well as the FIPS continuous-output test, to detect bad or stuck hardware RNGs; if any are detected, they are detached, but the system continues to run. A problem with rndctl(8) is fixed -- datastructures with pointers in arrays are no longer passed to userspace (this was not a security problem, but rather a major issue for compat32). A new kernel will require a new rndctl. The sysctl kern.arandom() and kern.urandom() nodes are hooked up to the new generators, but the /dev/*random pseudodevices are not, yet. Manual pages for the new kernel interfaces are forthcoming.
2010-12-16Enable ETHERCAP_VLAN_MTU in vr(4). Tested on VT6105M and VT8237R+.jakllsch
May or may not work on earlier chips, for now just assume it will. Provoked by PR#44243.
2010-11-13Don't pull in the whole uvm(9) API to access only PAGE_SIZE anduebayasi
some other constants. These are provided by sys/param.h now.
2010-04-28Silence for boot -zhubertf
2010-04-05Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpfjoerg
check into the inline functions as well the fourth argument for bpf_attach.
2010-02-24A pointer typedef entails trading too much flexibility to declare constdyoung
and non-const types, and the kernel uses both const and non-const PMF qualifiers and device suspensors, so change the pmf_qual_t and device_suspensor_t typedefs from "pointers to const" to non-pointer, non-const types.
2010-01-19Redefine bpf linkage through an always present op vector, i.e.pooka
#if NBPFILTER is no longer required in the client. This change doesn't yet add support for loading bpf as a module, since drivers can register before bpf is attached. However, callers of bpf can now be modularized. Dynamically loadable bpf could probably be done fairly easily with coordination from the stub driver and the real driver by registering attachments in the stub before the real driver is loaded and doing a handoff. ... and I'm not going to ponder the depths of unload here. Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
2010-01-08Expand PMF_FN_* macros.dyoung
2009-11-26Cleanup interrupt establish error messages. Do not mixnjoly
aprint_error/aprint_normal/printf calls for a single line.
2009-09-26add suspend/resume supportjmcneill
2009-09-06Replace shutdownhook_establish(9) with pmf_device_register1(9).tsutsui
Tested VIA VT86C100A (which is probed as VT3043).
2009-08-23Don't maintain a list of descriptions for each supported device, that'sjmcneill
what PCIVERBOSE is for; use pci_devinfo instead.
2009-05-06struct cfdata * -> cfdata_t, no functional changes intended.cegger
2008-07-09- device/softc splitjoerg
2008-07-09Constify device table.joerg
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-10use aprint_*_dev and device_xnamecegger
2008-03-21pci_activate() expects for its void * argument to be a device_t,dyoung
so change the type of the argument to device_t. Update each use of pci_activate(). Use device_t and accessors. Use aprint_*_dev().
2008-03-11Prepare for PMF self-suspension: in the if_stop() methods, cleardyoung
IFF_UP and IFF_RUNNING before running the 'disable' step, instead of after. Soon I will handle the 'disable' step by calling into PMF, which may call if_stop(, 0). Ordinarily, that is harmless. This change lets the if_stop() routines exit early when they find on entry that IFF_RUNNING is not set.
2008-01-19Make many ethernet drivers share the common code for MII mediadyoung
handling, ether_mediastatus() and ether_mediachange(). Check for a non-ENXIO error return from mii_mediachg(). (ENXIO indicates that a PHY is suspended.) This patch shrinks the source code size by 979 lines. There was a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL. I have made a few miscellaneous changes, too: gem(4): use LIST_EMPTY(), LIST_FOREACH(). mtd(4): handle media ioctls, for a change! axe(4): do not track link status in sc->axe_link any longer nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs on a change of media Except for the change to mtd(4), no functional changes are intended. XXX This patch affects more architectures than I can feasibly XXX compile and run. I have compiled macppc, sparc64, i386. I XXX have run the patches on i386 boxen with bnx(4) and sip(4). XXX Compiling and running on evbmips (MERAKI, ADM5120) is in XXX progress.
2007-10-19machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.had