summaryrefslogtreecommitdiffstats
path: root/sys/dev/em/if_em.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge of the source for igb and em into dev/e1000, thisjfv2008-07-301-5317/+0
| | | | | | | | | | | proved to be necessary to make the static drivers work in EITHER/OR or BOTH configurations. Modules will still build in sys/modules/igb or em as before. This also updates the igb driver for support for the 82576 adapter, adds shared code fixes, and etc.... MFC after: ASAP
* Thanks to report from Neil Hoggarth I found a missing UNLOCK injfv2008-05-211-2/+13
| | | | | | | the watchdog code. This delta also incorporates some missing PCI IDs that got added. PR 122928 - might be fixed by this, no verification at this point.
* This small change will allow this driver in HEAD to buildjfv2008-05-191-1/+14
| | | | on 6.3 as well as 7 :)
* This delta has a few important items:jfv2008-04-251-94/+376
| | | | | | | | | | | | | | | | | | | | | | | | PR 122839 is fixed in both em and in igb Second, the issue on building modules since the static kernel build changes is now resolved. I was not able to get the fancier directory hierarchy working, but this works, both em and igb build as modules now. Third, there is now support in em for two new NICs, Hartwell (or 82574) is a low cost PCIE dual port adapter that has MSIX, for this release it uses 3 vectors only, RX, TX, and LINK. In the next release I will add a second TX and RX queue. Also, there is support here for ICH10, the followon to ICH9. Both of these are early releases, general availability will follow soon. Fourth: On Hartwell and ICH10 we now have IEEE 1588 PTP support, I have implemented this in a provisional way so that early adopters may try and comment on the functionality. The IOCTL structure may change. This feature is off by default, you need to edit the Makefile and add the EM_TIMESYNC define to get the code. Enjoy all!!
* This update primarily addresses the ability to have both the emjfv2008-04-021-180/+124
| | | | | | and the igb driver static in the kernel. But it also reflects some other bug fixes in my development stream at Intel. PR 122373 is also fixed in this code.
* This change introduces a split to the Intel E1000 driver, now rather thanjfv2008-02-291-657/+411
| | | | | | | | | | | | | | just em, there is an igb driver (this follows behavior with our Linux drivers). All adapters up to the 82575 are supported in em, and new client/desktop support will continue to be in that adapter. The igb driver is for new server NICs like the 82575 and its followons. Advanced features for virtualization and performance will be in this driver. Also, both drivers now have shared code that is up to the latest we have released. Some stylistic changes as well. Enjoy :)
* Add COHERENT to descriptor mem allocation for thejfv2007-11-281-1/+1
| | | | | | benefit of ARM (request from Olivier Houchard), its a noop on most architectures and goodness on those that use it.
* Fix for a reported panic in certain circumstances. Whenjfv2007-11-261-2/+17
| | | | | calling em_stop() now make sure the TX lock is held as well as CORE.
* Take out em_poll() prototype from under EM_FAST_IRQ control.ru2007-11-211-3/+4
| | | | Reported by: tindebox compiling a LINT kernel
* One nit, FAST handling is now in #ifdef's for compatibilityjfv2007-11-201-3/+0
| | | | | | between RELEASES, but we want it on by default in 7 and later, add that define, and take out a fragment left from a workaround being removed.
* Driver version 6.7.3jfv2007-11-201-327/+582
| | | | | | | | | - Bring HEAD up to the latest shared code - Fix TSO problem using limited MSS and forwarding - Dual lock implementation - New device support - For my ease, this code can compile in either 6.x or later - brings this driver in sync with the 6.3
* A number of small fixes:jfv2007-09-101-5/+5
| | | | | | | | | | - duplicate #define in header, thanks to Kevin Lo for pointing out. - incorrect BUSMASTER enable logic, thanks Patrick Oeschger - 82543 fails due to bogus IO BAR logic - Allow 82571 to use MSI interrupts - Checksum Offload for UDP not working on 82575 Approved by:re
* Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, whichrwatson2007-08-061-2/+0
| | | | | | | | | | | | | | | previously conditionally acquired Giant based on debug.mpsafenet. As that has now been removed, they are no longer required. Removing them significantly simplifies error-handling in the socket layer, eliminated quite a bit of unwinding of locking in error cases. While here clean up the now unneeded opt_net.h, which previously was used for the NET_WITH_GIANT kernel option. Clean up some related gotos for consistency. Reviewed by: bz, csjp Tested by: kris Approved by: re (kensmith)
* Use coherent mapping for DMA on arm. This is propably suitable for thecognet2007-07-271-0/+5
| | | | | | | other archs, but I can't test it so I made it conditionnal on __arm__ for now. Approved by: re (blanket)
* Couple of the fixes needed revising. The ICH8 autoneg was still broken,jfv2007-05-311-15/+14
| | | | | | | this change both simplifies the code and plugs a hole where the devise was reset without keeping the management controller at bay :) Second, the 82571 LAA reset problem was incomplete, this addition is necessary. Just one of those days :)
* A few small but significant fixes:jfv2007-05-301-20/+23
| | | | | | | | - Coverity Prevent(tm) CID 1906 a bogus use of bzero where unneeded. - ICH8 systems autoneg to 100 rather than 1000, this can also be seen in 82573, the logic was backwards. - On new 82575 quadports half duplex tx speed is slow... this was due to overwriting TCTL reg rather than adding bits.
* Fix for PR 112937, thanks to Ruslan Ermilov. I am stilljfv2007-05-241-1/+0
| | | | | | a bit confused how the 'link flap' was connected to the 'get' rather than 'set' address, but this seems the right thing to do here.
* Two minor fixes, keep old 82542 from using jumbo frames, and addjfv2007-05-231-2/+3
| | | | | | | missing htole64 in encap code. Reviewed by:Pdeuskar Approved by:Pdeuskar
* Couple of changes, back down on last TSO change, instead make oldjfv2007-05-171-8/+29
| | | | | | | | | | | adapter list still capable, but only PCI-E adapters are now enabled. The user can enable older PCI-X or PCI adapters using ifconfig. Secondly, Arthur Hartwig pointed out my MSI change was not working correctly, changed to something that now does. Thanks Arthur. There was also a fundamental bug in the 82575 MSIX code, the MSIX registers had to be mapped, opps :) Rubber-stamped by: Pdeuskar
* This delta adds two bug fixes: one that makes HW Offload logic injfv2007-05-161-20/+15
| | | | | | | | | | legacy codepath match the 82575, without this we were seeing bridging fail on 82546 adapters. Secondly, I have limited TSO to PCI Express adapters, I meant to do this and it got dropped in the earlier delta. Next, I am dropping in the latest shared code from our development team, consensus was that this should be done frequently, so I am :) Approved by: pdeuskar
* Mistake in the logic deciding what adapters needjfv2007-05-111-1/+2
| | | | | | | | to map the IO BAR. Causing the driver to fail on th 82542. Reviewed by:pdeuskar Approved by:pdeuskar
* A couple bug fixes that I've had internally at Intel. First is a longjfv2007-05-091-21/+31
| | | | | | | | | | | | | | | time workaround for problems with 82571 adapters and LAAs, one port getting reset can cause the other to have its RAR[0] also reset, thus overwriting an LAA. This fix works around it by also keeping the address in the last array member. The other bug is specific to the new 575 adapter, its transmit code logic in handling hwassists was too crude, it broken when doing bridges. I am much happier with the new logic,we may want to change the legacy path at some point to something similar. Reviewed by: pdeuskar Approved by: pdeuskar
* $FreeBSD$ tags are not compilable C code; wrap in either __FBSDID() orrwatson2007-05-041-1/+2
| | | | | | in comments for .c and .h files respectively. Jack may want to clean up style or other aspects once he's up and about again, but this gets the kernel compiling.
* Merge in the new driver (6.5.0) of Intel. This has a newjfv2007-05-041-801/+1614
| | | | | | | | | | | | | | | | shared code infrastructure that is family specific and modular. There is also support for our latest gigabit nic, the 82575 that is MSI/X and multiqueue capable. The new shared code changes some interfaces to the core code but testing at Intel has been going on for months, it is fairly stable. I have attempted to be careful in retaining any fixes that CURRENT had and we did not, I apologize in advance if any thing gets clobbered, I'm sure I'll hear about it :) Approved by pdeuskar
* Revert previous change and take back a pointy hat.ru2007-02-281-1/+1
|
* Fix panic on boot caused by setting up a NULL interrupt handler.ru2007-02-281-1/+1
| | | | | Submitted by: Goran Gajic Pointy hat to: piso
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-8/+9
| | | | | | | | | | | | | 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@
* remove no longer correct comment above em_read_pcie_cap_regkmacy2006-11-231-4/+0
|
* Move magic PCIe workaround constant to header - add appropriate commentkmacy2006-11-231-1/+1
| | | | Suggested by: jfvogel
* Fix TSO support on sun4vkmacy2006-11-231-8/+25
| | | | | | | | - incorporate csjp's fix for a mishandled endian conversion - convert PAGE_SIZE to 4096 for PCIe adapter workaround (my page size is not 4k) - implement em_read_pcie_cap_reg where we set the max read size on pcie to 4k (taken from mxge) Reviewed by: scottl and jfvogel
* Implement new ETHER_BPF_MTAP macro. Roll back the various changescsjp2006-11-181-70/+3
| | | | | | | | | made to accommodate the chip being in promiscuous mode while offloading VLAN tag processing to the hardware. We can now properly handle the absence of VLAN tags from hardware stripping. Reviewed by: rwatson, andre MFC after: 1 month
* Add MSI support to em(4), bce(4), and mpt(4). For now, we only supportjhb2006-11-151-2/+11
| | | | | devices that support a maximum of 1 message, and we use that 1 message instead of the INTx rid 0 IRQ with the same interrupt handler, etc.
* Instead of using the legacy if_timer/if_watchdog interface createglebius2006-11-091-26/+29
| | | | | | | | | | | our own watchdog that piggybacks on the em_local_timer() routine. We suppose that the if_timer/if_watchdog interface should be obsoleted, since it doesn't fit the modern SMP network stack. NIC drivers should create their own watchdogs, that check and clear the timers always holding driver's lock. In collaboration with: jfv, scottl
* Fix compile botch in the last panic botch fix. :(jhb2006-11-011-1/+0
| | | | | Pointy hat: jhb Reported by: brueffer
* Fix botch in last commit (I tested on 6.x which doesn't have TSO):jhb2006-11-011-5/+2
| | | | | | | | - Test the mac_type rather than if_hwassist (since ifp doesn't exist yet) to determine if the adapter supports TSO and thus to change the sizes for the bus_dma tag. Reviewed by: glebius
* Allocate receive and transmit data structures during attach() and free themjhb2006-10-311-47/+82
| | | | | | | | | | | | | during detach() similar to other NIC drivers rather than allocating them during init() and freeing them during stop(): - Move creation of tx bus_dma tag amd maps and tx_buffer_area from em_setup_transmit_structures() to em_allocate_transmit_structures(). - Call em_allocate_xxx_structures() in em_attach(). - Only call em_free_xxx_structures() in em_detach(). - Change em_setup_xxx_structures() to free any existing tx or rx buffers and in the case of rx repopulate the ring with newer buffers. Reviewed by: jfv
* - Use callout_init_mtx() to close various callout-related races.jhb2006-10-311-18/+13
| | | | | | | | - Drain the two timers in detach. - Check IFF_DRV_RUNNING in the link task and bail w/o doing anything if it is clear. Reviewed by: jfv, scottl
* Rework the transmit register handling. In em_encap() store index ofglebius2006-10-311-32/+77
| | | | | | | | | | | the EOP descriptor in the first descriptor of the packet. And then in em_txeof() search for DD bits set only in the EOP descriptors, embedding the cleanup of all packet's descriptors into inner loop. This change is important for future chips, where DD bit is going to be set only on the EOP descriptors. Submitted by: jfv
* Merge new vendor release - 6.2.9.glebius2006-10-311-27/+34
| | | | | | | | | | | | | | | | | | Details: o if_em.c changes: - Added several new PCI ids. - Check em_check_phy_reset_block() before doing SIOCSIFMEDIA ioctl. - Don't touch TARC registers, they are now handled in shared code in if_em_hw.c. - Move RDH and RDT setting to the end of em_initialize_receive_unit(). - Declare em_read_pcie_cap_reg(), now empty. o if_em_hw.c dropped in from vendor, then restored rev. 1.15. o if_em_hw.h dropped in from vendor, then modified: - Added RX overrun interrupt flag to interrupt enable mask. - Remove declarations of em_io_read(), em_io_write(). Approved by: jfv
* Backout bogus checkin to HEADjfv2006-10-281-661/+870
| | | | Approved by: scottl
* This is the merge of the Intel 6.2.9 driver. It provides all new shared code,jfv2006-10-281-870/+661
| | | | | new device support, and it is hoped a more stable driver for 6.2. RELEASE. This checkin was discussed and approved today by RE, scottl, jhb, and pdeuskar
* Back out rev. 1.152 as it was breaking vlan tag insertion when vlan tagandre2006-09-291-0/+39
| | | | | | | | stripping was disabled due to being in promisc mode. This is a hardware bug. Update comment to explicitly state the reason the manual vlan tag insertion in this case. See rev. 1.53 for further information as well. Noticed by: jhb
* Small style and comment adjustments.andre2006-09-291-4/+6
| | | | Reviewed by: jfv
* Remove manual vlan header insertion in em_encap(). It is unnecessary as theandre2006-09-291-36/+5
| | | | | | | | | generic vlan_start() takes care of it when vlan hardware insertion is disabled. In em_set_promisc() add a note that BPF may also be enabled without going into promisc mode. Reviewed by: jfv
* Change em_transmit_checksum_setup() to deal with already inserted vlan headers,andre2006-09-291-47/+107
| | | | | | | IP options and add skeleton IPv6 support. The new code structure can also be easily enhanced to support new/more protocols (SCTP) in the future. Reviewed by: jfv
* Change em_tso_setup() to deal with already inserted vlan headers, IP optionsandre2006-09-291-36/+120
| | | | | | | | | | and add skeleton IPv6 support. The new code structure can also be easily enhanced to support new/more protocols (SCTP) and IP fragmentation in the future. In em_encap() only try to do TSO if 'dotso' is true. Reviewed by: jfv
* Only advertize IFCAP_TSO4 capabilities. IPv6 is not yet supported.andre2006-09-291-4/+4
| | | | Reviewed by: jfv
* Handle all error cases from bus_dmamap_load_mbuf_sg(). Those are:andre2006-09-291-5/+21
| | | | | | | | | | | | | | | | - EFBIG means the mbuf chain was too long and bus_dma ran out of segments. Defragment the mbuf chain and try again. (Already existed, not changed.) - ENOMEM means bus_dma could not obtain enough bounce buffers at this point in time. Defer sending and try again later. - All other errors, in particular EINVAL, are fatal and prevent the mbuf chain from ever going through. Drop it and report error. - Checking (nsegs == 0) is unnecessary as bus_dmamap_load_mbuf_sg() always reports an error if it is < 1. This prevents broken packets from clogging the interface queue indefinately. Discussed with: scottl Reviewed by: jfv
* Move the initialization of the hardware capabilities in em_init_locked()andre2006-09-211-8/+12
| | | | | | | before em_setup_transmit_structures() as it needs this information to properly set up TSO parameters. Reviewed by: jfv
* Don't forget to add curly braces when doing more than one line of actionsandre2006-09-181-1/+2
| | | | | | after a 'if' statement. Pointy hat to: andre
OpenPOWER on IntegriCloud