summaryrefslogtreecommitdiffstats
path: root/sys/dev/le
Commit message (Collapse)AuthorAgeFilesLines
* - Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) etcmarius2008-09-245-173/+140
| | | | | | and take advantage of rman_get_rid(9) in order to save some softc members. - Provide and consume module dependency information for lebuffer(4).
* o Move the MODULE_DEPEND() for cam(4) from the esp_sbus.c front-end tomarius2008-09-081-26/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the ncr53c9x.c core where it actually belongs so future front-ends don't need to add it. o Use the correct OFW property when looking for the initiator ID of the SBus device. o Don't specify an alignment when creating the parent DMA tag for SUNW,fas; their DMA engine doesn't require an alignment constraint and it's no inherited by the child DMA tags anyway (which probably is a bug though). o Drop the superfluous sc_maxsync and use sc_minsync instead. The former apparently was added due to a confusion with the maximum frequency used in cam(4), which basically corresponds to the inverse of minimum sync period. o Merge ncr53c9x.c from NetBSD: 1.116: NCRDMA_SETUP() should be called before NCR_SET_COUNT() and NCRCMD_DMA command in ncr53c9x_select(). 1.125: free allocated resources on detach. o Static'ize ncr53c9x_action(), ncr53c9x_init() and ncr53c9x_reset() as these are not required outside of ncr53c9x.c. o In ncr53c9x_attach() don't leak the device mutex in case attaching fails. o Register an asynchronous notification handler so in case cam(4) reports a lost device we can cancel outstanding commands and restore the default parameters for the target in question. o For FAS366 correctly support 16-bit target IDs and let it know that we use 32-bit transfers. o Overhaul the negotiation of transfer settings. This includes distinguishing between current and goal transfer settings of the target so we can renegotiate their goal settings when necessary and correcting the order in which tagged, wide and synchronous transfers are negotiated. o If we are requesting sense, force a renegotiation if we are currently using anything different from asynchronous at 8 bit as the target might have lost our transfer negotiations. o In case of an XPT_RESET_BUS just directly call ncr53c9x_init() instead of issuing a NCRCMD_RSTSCSI, which in turn will issue an interrupt that is treated as an unexpected SCSI bus reset by ncr53c9x_intr() and thus calls ncr53c9x_init(). Remove the now no longer used ncr53c9x_scsi_reset(). o Correct an off-by-one error when setting cpi->max_lun. o In replace printf(9) with device_printf(9) calls where appropriate and in ncr53c9x_action() remove some unnecessarily verbose messages. o In ncr53c9x_sched() use TAILQ_FOREACH() instead of reimplementing it and consolidate two tagging-related target info checks into one. o In ncr53c9x_done() set the CAM status to CAM_SCSI_STATUS_ERROR when appropriate, respect CAM_DIS_AUTOSENSE and teach it to return SCSI status information. o In ncr53c9x_dequeue() ensure the tags are cleared. o Use ulmin() instead of min() where appropriate. o In ncr53c9x_msgout() consistently use the reset label. o When we're interrupted during a data phase and the DMA engine is still active, don't panic but reset the core and the DMA engine as this should be sufficient. Also, the typical problem for triggering this was the lack of renegotiation when requesting sense. o Correctly handle DEVICE RESETs. o Adapt the locking of esp(4) to MPSAFE cam(4). This includes moving the calls of lsi64854_attach() to the bus front-ends so it can pass the esp(4) mutex to bus_dma_tag_create(9). o Change the LSI64854 driver to not create a DMA tag and map for the Ethernet channel as le(4) will handle these on its own as well as sync and unload the DMA maps for the SCSI and parallel port channel after a DMA transfer. o Cam(4)'ify some NetBSD-centric comments. o Use bus_{read,write}_*(9) instead of bus_space_{read,write}_*(9) and take advantage of rman_get_rid(9) in order to save some softc members. Reviewed by: scottl MFC after: 1 month
* Correct the comments in am7990_intr() and am79900_intr(); it's notmarius2007-12-302-8/+6
| | | | | | | | | | | | possible to end up in the interrupt handler again while processing the previous RX interrupt in ifp->if_input() because the MD interrupt code disables the delivery of the respective interrupt until all associated handlers were called (in the INTR_FILTER case the MI code supposedly does the same). Toggling the NIC interrupt enable bit in these handlers still is necessary though as some chips (f.e. the VMware emulated one) require this to be done in order to keep issuing interrupts. MFC after: 1 month
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-235-5/+5
| | | | | | | | | | | | | 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 BUS_DMA_WAITOK from bus_dma_tag_create() invocations as it'smarius2007-01-204-7/+7
| | | | no valid flag there.
* Add front-ends for the 'lebuffer' variants found on some SBus cards.marius2007-01-202-0/+708
| | | | | | | | | These are shared-memory variants based on Am79C90-compatible chips that apart from the missing DMA engine are similar to the 'ledma' variant including using a (pseudo-)bus/device for the buffer that the actual LANCE device hangs off from. The performance of these is close to that of the 'ledma' one, like expected at a few times the CPU load though.
* For setting the port PCnet chips must be powered down or stopped andmarius2007-01-201-7/+15
| | | | | | | | | | unlike documented may not take effect without an initialization. So don't invoke (*sc_mediachange) directly in lance_mediachange() but go through lance_init_locked(). It's suboptimal to impose this for all chips but given that besides the affected PCI bus front-end the only other front-end which supports media selection is and likely ever will be the 'ledma' front-end I see not enough reason to break the in-driver API for this (though one could argue both ways here).
* Use bus_get_dma_tag() to obtain the parent DMA tag so le(4) works onmarius2007-01-203-3/+3
| | | | platforms requiring this.
* Use our own callout instead of if_slowtimo() for driving lance_watchdog()marius2006-12-064-12/+25
| | | | in order to avoid races accessing if_timer.
* Revert the part of rev. 1.3 which changed the software style to bemarius2006-06-051-2/+10
| | | | | | | | set to ILACC rather than PCnet-PCI as VMware doesn't implement ILACC compatibility, resulting in the VMware virtual machine to crash if enabled. Add a comment regarding usage of ILACC vs. PCnet-PCI mode. Reported and tested by: gnn, wsalamon
* - Fix the busname in the DRIVER_MODULE.nyan2006-05-221-1/+8
| | | | | | | | | - Skip PnP devices as some wedge when trying to probe them as C-NET(98)S. This fix makes le(4) actually work with the C-NET(98)S. Reviewed by: marius Tested by: Watanabe Kazuhiro < CQG00620 at nifty dot ne dot jp >
* - Add C-bus and ISA front-ends for le(4) so it can actually replacemarius2006-05-172-0/+953
| | | | | | | | | | | | lnc(4) on PC98 and i386. The ISA front-end supports the same non-PNP network cards as lnc(4) did and additionally a couple of PNP ones. Like lnc(4), the C-bus front-end of le(4) only supports C-NET(98)S and is untested due to lack of such hardware, but given that's it's based on the respective lnc(4) and not too different from the ISA front-end it should be highly likely to work. - Remove the descriptions of le(4), which where converted from lnc(4), from sys/i386/conf/NOTES and sys/pc98/conf/NOTES as there's a common one in sys/conf/NOTES.
* - Revert if_le_pci.c rev. 1.2; although lnc(4) is now gone, le_pci_probe()marius2006-05-167-215/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | still should return BUS_PROBE_LOW_PRIORITY instead of BUS_PROBE_DEFAULT in order to give pcn(4) a chance to attach in case it probes after le(4). - Rearrange the code related to RX interrupt handling so that ownership of RX descriptors is immediately returned to the NIC after we have copied the data of the hardware, allowing the NIC to already reuse the descriptor while we are processing the data in ifp->if_input(). This results in a small but measurable increase in RX throughput. As a side-effect, this moves the workaround for the LANCE revision C bug to am7900.c (still off by default as I doubt we will actually encounter such an old chip in a machine running FreeBSD) and the workaround for the bug in the VMware PCnet-PCI emulation to am79000.c, which is now also only compiled on i386 (resulting in a small increase in RX throughput on the other platforms). - Change the RX interrupt handlers so that the descriptor error bits are only check once in case there was no error instead of twice (inspired by the NetBSD pcn(4), which additionally predicts the error branch as false). - Fix the debugging output of the RX and TX interrupt handlers; while looping through the descriptors print info about the currently processed one instead of always the previously last used one; remove pointless printing of info about the RX descriptor bits after their values were reset. - Create the DMA tags used to allocate the memory for the init block, descriptors and packet buffers with the alignment the respective NIC actually requires rather than using PAGE_SIZE unconditionally. This might as well fix the alignment of the memory as it seems we do not inherit the alignment constraint from the parent DMA tag. - For the PCI variants double the number of RX descriptors and buffers from 8 to 16 as this minimizes the number of RX overflows im seeing with one NIC-mainboard combination. Nevertheless move reporting of overflows under debugging as they seem unavoidable with some crappy hardware. - Set the software style of the PCI variants to ILACC rather than PCnet-PCI as the former is was am79000.c actually implements. Should not make a difference for this driver though. - Fix the driver name part in the MODULE_DEPEND of the PCI front-end for ether. - Use different device descriptions for PCnet-Home and PCnet-PCI. - Fix some 0/NULL confusion in lance_get(). - Use bus_addr_t for sc_addr and bus_size_t for sc_memsize as these are more appropriate than u_long for these. - Remove the unused LE_DRIVER_NAME macro. - Add a comment describing why we are taking the LE_HTOLE* etc approach instead of using byteorder(9) functions directly. - Improve some comments and fix some wording. MFC after: 2 weeks
* Kill more references to lnc(4).ru2006-05-161-2/+1
| | | | Submitted by: grep(1)
* - In the interrupt handler clear the interrupt source flags beforemarius2006-02-212-34/+48
| | | | | | | | | | | | | | | | | | | processing the interrupt events. If we clear them afterwards we can completely miss some events as the NIC can change the source flags while we're in the handler. In order to not get another interrupt while we're in ifp->if_input() with the driver lock dropped we now turn off NIC interrupts while in the interrupt handler. Previously this was meant to be achieved by clearing the interrupt source flags after processing the interrupt events but didn't really work as clearing these flags doesn't actually acknowledge and re-enable the events. This fixes the device timeouts seen with the VMware LANCE. - Relax the watchdog timer somewhat; don't enable it until the last packet is enqueued and if there is a TX interrupt but there are still outstanding ones reload the timer. Reported and tested by: Morten Rodal <morten@rodal.no> MFC after: 3 days
* Add le(4), a driver for AMD Am7900 LANCE and Am79C9xx PCnet NICs portedmarius2006-01-3111-0/+4374
from NetBSD. This driver actually can replace lnc(4). Advantages over lnc(4) are: - Cleaner and more flexible regarding MD needs. - Endian-clean and MPSAFE. - Supports ALTQ, VLAN_MTU, ifmedia. - Uses 32bit DMA for the PCI variants. This commit includes front-ends for the dma(4) pseudo-bus found on SBus- based sparc64 machines (thus supports the on-board LANCE in Sun Ultra 1) and PCI. In order to actually replace lnc(4), the front-ends for ISA and the PC98 CBUS would have to be added but for which I don't have hardware to test. Reviewed and some improvements by: yongari Tested on: i386, sparc64
OpenPOWER on IntegriCloud