summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_alc.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* - Remove a redundant check within alc_mii_readreg_813x().kevlo2019-06-031-5/+1
| | | | | | | | The PHY address is already checked within alc_miibus_readreg(). - Remove redundant call to alc_stop_queue(). First thing alc_stop_mac() does is call alc_stop_queue(). From Brad
* Formatting fixes.kevlo2019-05-231-19/+20
| | | | From Brad
* Fix a logic error when configuring the driver to use msi.kevlo2019-05-061-2/+2
|
* Add AR8152 PCI ids to alc_phy_down(), based on FreeBSD r272730.kevlo2019-03-271-1/+3
| | | | From Brad
* - Formatting fixes and in some cases bringing things a bit closer to thekevlo2019-03-251-92/+88
| | | | | | | original code - Remove unusedd function decarations From Brad
* - Fix the AR816X_REV_B0 / default DMA channel selection to be thekevlo2019-03-221-13/+16
| | | | | | | | | | | | | same as the original code - Merge FreeBSD's r304574 Correct DMA channel number selection on AR816x family of controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x except L1D controller, use vendor recommended ASPM parameters. While here, increase alc_dma_burst array size. Broken H/W can return bogus value in theory From Brad.
* Mixmerge fixup.kevlo2019-03-221-11/+8
| | | | | | | Some of the flag and oactive handling bits and alc_stop_queue() were mismerged. Pointed out by Brad, thanks!
* Add support for QCA AR816x/AR817x for alc(4).kevlo2019-03-221-217/+954
| | | | | | Based on FreeBSD via Genadijus Paleckis on tech@, some modifications by me. Tested with Atheros Killer E2200.
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-4/+1
| | | | | | | this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
* m_free() and m_freem() test for NULL. Simplify callers which had their ownjsg2016-11-291-5/+3
| | | | | | NULL tests. ok mpi@
* G/C IFQ_SET_READY().mpi2016-04-131-2/+1
|
* Ethernet drivers no longer need to include if_vlan_var.h for the VLANnaddy2016-03-151-3/+1
| | | | definitions; ok mpi@
* replace IFF_OACTIVE manipulation with mpsafe operations.dlg2015-11-251-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | there are two things shared between the network stack and drivers in the send path: the send queue and the IFF_OACTIVE flag. the send queue is now protected by a mutex. this diff makes the oactive functionality mpsafe too. IFF_OACTIVE is part of if_flags. there are two problems with that. firstly, if_flags is a short and we dont have any MI atomic operations to manipulate a short. secondly, while we could make the IFF_OACTIVE operates mpsafe, all changes to other flags would have to be made safe at the same time, otherwise a read-modify-write cycle on their updates could clobber the oactive change. instead, this moves the oactive mark into struct ifqueue and provides an API for changing it. there's ifq_set_oactive, ifq_clr_oactive, and ifq_is_oactive. these are modelled on ifsq_set_oactive, ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd. this diff includes changes to all the drivers manipulating IFF_OACTIVE to now use the ifsq_{set,clr_is}_oactive API too. ok kettenis@ mpi@ jmatthew@ deraadt@
* rework the start routines to avoid IF_PREPEND.dlg2015-11-091-33/+19
| | | | | | | | | | | | IF_PREPEND assumes the underlying send queue is priq, while hfsc may be enabled on it. the previous code pattern to DEQUEUE, try and encap the mbuf on the ring, and if that failed cos there was no space it would PREPEND it. now it checks for space on the ring before it attempts to DEQUEUE. failure to encap means the mbuf is now unconditionally dropped.
* arp_ifinit() is no longer needed.mpi2015-10-251-4/+1
|
* Make room for media types of the future. Extend the ifmedia word to 64 bits.stsp2015-09-111-3/+3
| | | | | | | | | | | | | | | | This changes numbers of the SIOCSIFMEDIA and SIOCGIFMEDIA ioctls and grows struct ifmediareq. Old ifconfig and dhclient binaries can still assign addresses, however the 'media' subcommand stops working. Recompiling ifconfig and dhclient with new headers before a reboot should not be necessary unless in very special circumstances where non-default media settings must be used to get link and console access is not available. There may be some MD fallout but that will be cleared up later. ok deraadt miod with help and suggestions from several sharks attending l2k15
* Increment if_ipackets in if_input().mpi2015-06-241-3/+1
| | | | | | | Note that pseudo-drivers not using if_input() are not affected by this conversion. ok mikeb@, kettenis@, claudio@, dlg@
* Convert to if_input(), thanks to krw@ for testing.mpi2015-03-201-11/+5
|
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* unifdef INETtedu2014-12-221-5/+1
|
* Fix a long standing bug in MAC statistics register access. Onebrad2014-11-271-12/+4
| | | | | | | | | additional register was erroneously added in the MAC register set such that 7 TX statistics counters were wrong. From FreeBSD ok mikeb@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-3/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* Fewer <netinet/in_systm.h>mpi2014-07-221-3/+1
|
* The few network drivers that called their children's (ie. mii PHYderaadt2013-12-281-2/+1
| | | | | drivers) activate functions at DVACT_RESUME time do not need to do so, since their PHYs are repaired by IFF_UP.
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-061-4/+4
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* Remove unneeded include.mpi2013-11-211-2/+1
| | | | ok deraadt@
* Most network drivers include netinet/in_var.h, but apparently theybluhm2013-08-071-2/+1
| | | | | don't have to. Just remove these include lines. Compiled on amd64 i386 sparc64; OK henning@ mikeb@
* Remove setting an initial assumed baudrate upon driver attach which is notbrad2012-11-291-2/+1
| | | | | | necessarily correct, there might not even be a link when attaching. ok mikeb@ reyk@
* Add some missing bus_dmamap_sync()'s and sync the others withkevlo2011-10-191-12/+26
| | | | | | | | | the FreeBSD code. age(4) tested by Thomas Pfaff; alc(4) tested by Gabriel Linder; ale(4) tested by Johan Torin. From Brad
* Some minor clean up to the _start funtions to make the code read a littlekevlo2011-09-211-5/+5
| | | | | | better. No functional change. From Brad
* Fix up alc_encap() / alc_start():kevlo2011-09-131-34/+23
| | | | | | | | | | | | | | | | | | - Remove unnecessary nsegs variable from alc_encap() and use map->dm_nsegs. Also remove unnecessary FreeBSD check for 0 DMA segments check. - Remove printfs in alc_encap() failure paths that shouldn't be there. - Add missing IF_PREPEND() from failure path coming off of alc_encap() within alc_start(). - Fix error handling within alc_encap(). Previously alc_encap() was attempting to unload a DMA map upon failure from bus_dmamap_load_mbuf() even though one wasn't loaded at that point and then always forcing mbufs through the EFBIG path. Tested by Gabriel Linder. From Brad
* Disable PHY hibernation. The PHY will go into sleep state when itkevlo2011-09-031-7/+21
| | | | | | | | | | | | | | detects no established link and it will re-establish link when the cable is plugged in. Previously it failed to re-establish link when the cable was plugged in such that it required turning the interface down and then up to make it work. This was caused by incorrectly programmed hibernation parameters. Further details regarding PHY setup are necessary to be able to re-enable this feature. Tested by Matteo Filippetto and Gabriel Linder From FreeBSD via Brad
* Move the comment outside of the VLAN section of code and above thatkevlo2011-08-261-2/+2
| | | | | | chunk to where it should be. From Brad
* Help with the watchdog timeouts seen when unplugging the cable fromkevlo2011-08-211-11/+14
| | | | | | | the alc(4) NIC while running or the NIC not working if the cable is not plugged in upon boot up. From Brad; tested by matteo filippetto, Gabriel Linder and edd@
* Enable MSI support; tested by krw@, Mark Peoples, andkevlo2011-06-171-2/+2
| | | | | | Abel Abraham Camarillo Ojeda. From Brad
* Whitespace nits; from Bradkevlo2011-05-271-4/+4
|
* - For AR8132 fast ethernet controller, do not report 1000baseTkevlo2011-05-251-6/+23
| | | | | | | | | | | | | | | | capability to mii(4). - Limit DMA burst size to be less than or equal to 1024 bytes. Controller does not seem to support more than 1024 bytes DMA burst. - Do not touch CMB TX threshold register when CMB is not used. From FreeBSD via Brad - Properly initialize sc_product and alc_rev early enough in alc_attach() with the PCI product id and PCI revision. - Further sync if_alcvar.h changes from FreeBSD for L2C/L1D addition commit which in OpenBSD has been merged into if_alcreg.h From Brad; tested by Gabriel Linder and edd@.
* Support additional L2C variants and L1D (AR813x/AR815x chips).sthen2011-05-181-98/+345
| | | | | | Tested on L1C by Abel Abraham Camarillo Ojeda, thank you. From FreeBSD via kevlo@, ok jsg@
* mechanic rename M_{TCP|UDP}V4_CSUM_OUT -> M_{TCP|UDP}_CSUM_OUThenning2011-04-051-2/+2
| | | | ok claudio krw
* alc_newbuf is always called from the interrupt context so it can't sleep;mikeb2011-02-181-18/+8
| | | | tested by Gabriel Linder, ok kevlo, miod
* Fix two logic errors:kevlo2011-01-291-3/+3
| | | | | - "could not disable Rx/Tx MAC" from FreeBSD - "could not disable RxQ/TxQ" from Gabriel Linder
* Add DVACT_QUIECE support. This is called before splhigh() and beforederaadt2010-08-311-2/+5
| | | | | | | | DVACT_SUSPEND, therefore DVACT_QUIECE can do standard sleeping operations to get ready. Discussed quite a while back with kettenis and jakemsr, oga suddenly needed it as well and wrote half of it, so it was time to finish it. proofread by miod.
* remove the unused if_init callback in struct ifnetjsg2010-08-271-2/+1
| | | | ok deraadt@ henning@ claudio@
* ca_activate handler for suspend/resume. untested -- if someone testsderaadt2010-07-271-2/+26
| | | | this let me know.
* these files don't need to include proc.h anymore. ok oga for agptedu2010-04-081-2/+1
|
* Fix multicast handling. All Atheros controllers use big-endian formkevlo2010-02-271-2/+4
| | | | | | when computing multicast hash. From Brad via FreeBSD
* Rename _rxfilter functions to _iff for consistency. From Brad, ok kevlo@sthen2010-01-071-5/+6
|
* M_DUP_PKTHDR() define -> m_dup_pkthdr() function to properly dealkrw2009-09-131-27/+2
| | | | | | | | | | | | | with m_tag_copy_chain() failures. Use m_defrag() to eliminate hand rolled defragging of mbufs and some uses of M_DUP_PKTHDR(). Original diff from thib@, claudio@'s feedback integrated by me. Tests kevlo@ claudio@, "reads ok" blambert@ ok thib@ claudio@, "m_defrag() bits ok" kettenis@
* alc(4) is a driver for the Atheros AR8131/AR8132 ethernet chip.kevlo2009-08-081-0/+2404
this driver was written by Pyun YongHyeon from FreeBSD. "go ahead" deraadt@