summaryrefslogtreecommitdiff
path: root/sys/dev/ic/i82557.c
AgeCommit message (Collapse)Author
2022-06-25Pass proper status values to rnd_add_uint32(9) as rnd(9) man page claims.tsutsui
2020-02-07Use callout_setfunc() / callout_schedule().thorpej
2020-02-04Use ifmedia_fini().thorpej
2020-01-29Adopt <net/if_stats.h>.thorpej
2019-10-30 if_percpuq(9) automatically increments if_ipackets, so don't add number ofmsaitoh
RX frames from device's statistics counter to if_ipackets to avoid double count.
2019-09-20Fix direction of the loop.maxv
Found by the lgtm bot.
2019-07-09 Don't automatically set ec_capenable's ETHERCAP_VLAN_HWTAGGING bit inmsaitoh
vlan_config() to make it user-controllable. Instead, set the bit in xxx_attach().
2019-05-28 Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.msaitoh
2019-05-23No functional change:msaitoh
- Simplify MII structure initialization and reference. - u_int*_t -> uint*_t. - KNF
2019-04-22 In drivers which use MII(4) and have hook SIOC[GS]IFMEDIA which just pass tomsaitoh
ifmedia_ioctl(), the hook is not required because ether_ioctl has it (if_ethersubr.c rev. 1.160). These drivers don't return ENETRESET in ifmedia_ioctl(), so no functional change.
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-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.
2017-09-26VLAN ID uses pkthdr instead of mtag now. Contributed by s-yamaguchi@IIJ.knakahara
I just commit by proxy. Reviewed by joerg@n.o and christos@n.o, thanks. See http://mail-index.netbsd.org/tech-net/2017/09/26/msg006459.html XXX need pullup to -8 branch
2017-02-20Apply deferred if_start to more driversozaki-r
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-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
2013-09-12Remove unused variablemartin
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.
2011-09-02Add support for some fxp devices from FreeBSD and OpenBSD.msaitoh
{Free,Open}BSD say that we have to do some work to make fxp stable.
2011-03-30IFF_PROMISC implys IFF_ALLMULTI.jakllsch
Should fix PR#43186.
2010-11-13Include sys/proc.h for tsleep, wakeup.uebayasi
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-03-22Check whether the fxp(4) actually attached before calling fxp_stop().dyoung
2010-03-22In fxp_detach(), fxp_stop(), first. fxp_stop() stops the callout.dyoung
Destroy the callout in fxp_detach().
2010-02-25Make fxp at cardbus detach during shutdown.dyoung
Stop calling (*cardbus_ctrl) to enable bus mastering, I/O and memory spaces on the CardBus bridge. cbb(4) always enables that stuff, anyway. In the process, avoid remembering what BAR we mapped by writing CARDBUS_{IO,MEM}_ENABLE to sc_cben or sc_cbenable, and record the BAR in use sc_bar, instead. Replace more CARDBUS_ constants with PCI_ constants. Compile-tested, only.
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.
2009-09-15Simplify activation routines: don't call mii_activate(), it's adyoung
no-op. Don't block interrupts, if_deactivate() does it. Compile-tested, only.
2009-03-16Pull a fix from hme.c rev 1.73 (to #if 0'ed out part):tsutsui
> Fix a bug in calculation of checksum deduction: > - To get 16 bit one's complement value from uint32_t variable, > higher 16 bits should be ignored. > - RFC 1624 describes methods to recalculate checksum field in headers, > i.e. one's complement of one's complement sum that could be 0x0000, > but we don't have to use the strategy to deduct one's complement sum > itself which won't be zero but should be 0xffff.
2009-03-15Tweak comments and conditionals about EXT_RFA and IPCB.tsutsui
2009-03-11u_intNN_t -> uintNN_ttsutsui
2009-03-09Computed checksum value by the FXPF_82559_RXCSUM feature includes datatsutsui
in IP headers, so we have to deduct not only IP option headers but all IP headers. But in TCP/UDP layer we can assume the IP header is valid and a sum of the IP header part should be 0xffff, so we don't have to bother to deduct it from the computed checksum.
2009-03-07Add TCPv4/UDPv4 RX hardware checksum support for i82559 and later chipstsutsui
which don't have EXT_RFA and IPCB support. From hme(4) driver and FreeBSD's fxp(4). Tested on i82559. XXX: Probably we should have a common function to parse RX packet headers XXX: to handle a raw checksum value and share it among hme(4) and gem(4) etc.
2009-03-04Use FXPF_EXT_RFA flag instead of FXPF_EXT_TXCB to see IPCB capabilitytsutsui
because EXT_RFA for RX cksum is always available with IPCB for TX cksum but i82558 and i82559 have only EXT_TXCB without IPCB. Tested on the following fxp cards: fxp0 at pci0 dev 14 function 0: Intel i82557 Ethernet, rev 2 fxp0 at pci0 dev 14 function 0: i82559 Ethernet, rev 8 fxp0 at pci0 dev 14 function 0: i82550 Ethernet, rev 12
2009-02-20- remove FXPF_IPCB flag. it should always/only be used with the codemrg
conditional on FXPF_EXT_TXCB, so, replace all uses with that - for the pci frontend, reestablish some flags lost the the prior changes and simplify one of the cases this fixes PR 40677 and may fix PR 40431.
2009-01-18The PCI revision numbers are unique to a PCI vendor/productmrg
ID pair. Misuse of the revision numbers was causing some of the chip features to be disabled on some integrated Intel chips. So, move the determination of the features into the bus frontend, where the vendor/product ID is known. (Note: sc_rev should be removed. The microcode patch stuff is also busted and needs to be fixed.) Also, poll the actual flow control status in inphy, rather than making assumptions. contributed anonymously.
2008-12-05Wrap long lines.tsutsui
2008-12-04Don't pass uint8_t values to le16toh() in fxp_rx_hwcksum().tsutsui
fxp(4)'s RX hwcksum results weren't used at all on big endian machines. Checked by i82550 and vmstat -ev on macppc GENERIC kernel with options INET_CSUM_COUNTERS,TCP_CSUM_COUNTERS,UDP_CSUM_COUNTERS.
2008-12-04Add a missed htole32() on the previous ip4csum-tx bug workaround.tsutsui
2008-12-04Sort Tx/Rx macro in previous.tsutsui
2008-12-03Add a workaround for hardware ip4csum-tx bug and enable it.tsutsui
Confirmed on i82550 rev 12 and UDP fragment packets by ttcp(1).
2008-12-03Call BUS_DMASYNC_PREREAD more strictly on polling DMA descriptors.tsutsui
2008-07-31Calling fxp_init within the interrupt handler results inws
a hang (continuous assertion of FXP_SCB_STATACK_RNR). Instead do it in the ioctl routine after receiving a signal from the interrupt handler.
2008-07-09- device/softc split for fxp(4)joerg
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-08use aprint_*_dev and device_xnamecegger
2008-02-07Start patching up the kernel so that a network driver always hasdyoung
the opportunity to handle an ioctl before generic ifioctl handling occurs. This will ease extending the kernel and sharing of code between drivers. First steps: Make the signature of ifioctl_common() match struct ifinet->if_ioctl. Convert SIOCSIFCAP and SIOCSIFMTU to the new ifioctl() regime, throughout the kernel.