summaryrefslogtreecommitdiffstats
path: root/sys/dev/hme
Commit message (Collapse)AuthorAgeFilesLines
* Some changes related to reading the MAC-address from the VPD on systemsmarius2004-12-121-19/+18
| | | | | | | | | | | | | | | | without Open Firmware: - The PCI data structure of some HME PROMs contains a non-zero interface revision in the class code. Thus remove the checks for matching class code and PCI data structure length and revsion. These were pretty much useless anyway as we only really need the pointer to the VPD which is located before the structure length and revision fields. - On Sun QFE (Quad FastEthernet) cards read the Nth MAC-address for the Nth HME controller instead of always the first one for all four HMEs. [1] - Improve the comment describing the used VPD format to better reflect reality. - Minor clean-up. Prodded by: joerg [1]
* Make hme(4) mpsafeyongari2004-11-224-29/+123
| | | | | | | | | | | | | - Let hme_start()/hme_init() acquire lock and then call hme_start_locked()/hme_init_locked() respectivly. - Teardown interrupt handler before hme_detach(). - Remove IFF_NEEDSGIANT flag and mark interrupt handler INTR_MPSAFE. - Set callout handler to CALLOUT_MPSAFE. - Add locks in hme MII interface. Reviewed by: jake Tested by: Julian C. Dunn <jdunn at opentrend dot net> MFC after: 2 weeks
* Make hme(4), i.e. the PCI-variant, MI by reading the MAC address on sytemsmarius2004-08-141-3/+152
| | | | | | | | | | | | | | | without Open Firmware directly instead of using OF_getetheraddr(). This is a bit painful though, as the MAC address is contained in the NA field of the VPD of the EBus bridge, which is is another function of the same chip. To make it worse, the VPD of the EBus bridge can't be accessed via the PCI capability pointer but has to be digged out from the Boot PROM and has a non-standard format. The PCI VPD struct and macros used here should be part of the FreeBSD PCI code nevertheless. Approved by: tmm Based on: NetBSD Tested with: Sun X1032A (hme(4)-isp(4)-combo card) on alpha and i386
* Since if_hme doesn't contain locking or run with INTR_MPSAFE, markrwatson2004-08-131-1/+2
| | | | the interface as IFF_NEEDSGIANT so if_start is run holding Giant.
* - Use bus_space_subregion() rather than arithmetic on bus_space_handle_t. [1]marius2004-08-124-28/+30
| | | | | | | | - Properly use the error variable and return it on failure in the attach- routines. Reviewed by: tmm Inspired by: NetBSD [1]
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and amarius2004-08-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit. Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386
* Implement TCP/UDP Transmit/Receive checksum offload.yongari2004-08-054-17/+174
| | | | | | | | | | | Since HME doesn't compensate the checksum for UDP datagram which can yield to 0x0, UDP transmit checksum offload is disabled by default. The UDP Transmit checksum offload can be reactivated by setting special link option link0 with ifconfig(8). Approved by: jake (mentor) Reviewed by: tmm Tested by: Herve Boulouis <amon@sockar.homeip.net>
* Second part of ALTQ driver modifications, covering:mlaier2004-08-011-3/+5
| | | | | | | | | | an(4), ath(4), hme(4), ndis(4), vr(4) and wi(4) Please help testing: http://people.freebsd.org/~mlaier/ALTQ_driver/ Tested by: Vaidas Damosevicius (an, ath, wi) Roman Divacky (vr) Submitted by: yongari (hme)
* Back out 1.23 until I figure out why it causes Netra t1 100 to no longermarius2004-06-121-1/+1
| | | | | | pass any traffic. Unfortunately this means no full-duplex link with auto- negotiation on hme(4) using DP83840A PHYs again. I really thought I had tested this also on a Netra t1 100...
* - Add a LLADDR() forgotten in the conversion to ether_crc32_le().marius2004-06-101-4/+2
| | | | | | - Remove a variable no longer used after the conversion. - While here, save on another one no longer really necessary after the conversion.
* Replace handrolled CRC calculation with ether_crc32_[lb]e().naddy2004-06-091-18/+2
|
* Add missing <sys/module.h> includes currently relying on nested includephk2004-06-033-0/+3
| | | | in <sys/kernel.h>
* In hme_init() call mii_mediachg() to make sure the current media is set.marius2004-05-291-1/+4
| | | | | | | | This is part 2/2 of fixing autonegotiation on hme(4) using DP83840A PHYs. It appears to also fix the occasional problems to establish a link on hme(4) using LU6612 PHYs and shouldn't hurt on those using QS6612 PHYs. Obtained from: NetBSD
* Remove a redundant include directivescottl2004-05-281-2/+0
|
* Mark the VLAN_MTU capability as initially enabled since it'syar2004-05-231-0/+1
| | | | hardcoded to "ON" for these interfaces.
* We don't need to initialize if_output, ether_ifattach() does itmux2004-05-231-1/+0
| | | | for us.
* Spelling and style fixes.marius2004-05-222-22/+22
| | | | Obtained from: NetBSD
* The Sun hme hardware supposedly supports Tx frames up to 65535 octets,joerg2004-05-061-3/+13
| | | | | | | | | and Rx frames up to 8191 octets, so it is perfectly capable of supporting vlan(4)-style VLAN natively. Thus, make it support VLAN `oversize' frames. Reviewed by: tmm
* Let ether_ifattach() announce our MAC address.mdodd2004-03-201-5/+0
| | | | Submitted by: Marius Strobl <marius@alchemy.franken.de>
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-172-16/+16
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+2
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* Preparatory commit to allow prototypes in ofw_machdep.h to containmarcel2003-09-022-0/+2
| | | | | | | both newbus types and OFW types. This involves either including <machine/bus.h> or <dev/ofw/openfirm.h>. Reviewed by: jake, jmg, tmm
* Use __FBSDID().obrien2003-08-243-7/+10
| | | | Also some minor style cleanups.
* s#<foo/bar.h>#<dev/foo/bar.h>#gmarcel2003-08-233-10/+10
|
* s=include <ofw/=include <dev/ofw/= to reflect removal of -I$S/devimp2003-08-231-1/+1
|
* Prefer new location of pci include files (which have only been in theimp2003-08-221-2/+2
| | | | | tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
* Mega busdma API commit.scottl2003-07-011-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg. Lockfunc allows a driver to provide a function for managing its locking semantics while using busdma. At the moment, this is used for the asynchronous busdma_swi and callback mechanism. Two lockfunc implementations are provided: busdma_lock_mutex() performs standard mutex operations on the mutex that is specified from lockfuncarg. dftl_lock() is a panic implementation and is defaulted to when NULL, NULL are passed to bus_dma_tag_create(). The only time that NULL, NULL should ever be used is when the driver ensures that bus_dmamap_load() will not be deferred. Drivers that do not provide their own locking can pass busdma_lock_mutex,&Giant args in order to preserve the former behaviour. sparc64 and powerpc do not provide real busdma_swi functions, so this is largely a noop on those platforms. The busdma_swi on is64 is not properly locked yet, so warnings will be emitted on this platform when busdma callback deferrals happen. If anyone gets panics or warnings from dflt_lock() being called, please let me know right away. Reviewed by: tmm, gibbs
* Some gem and hme hardware bogusly has the intpin register hardwired totmm2003-07-011-4/+6
| | | | | 0; detect this case and correct it. While being there, clean up nearby comments.
* - Don't call pci_enable_io() in drivers (unless needed for resume).mdodd2003-04-161-1/+0
| | | | | - Don't test memory/port status and emit an error message; the PCI bus code will do this now.
* - Express hard dependencies on bus (pci, isa, pccard) andmdodd2003-04-152-2/+5
| | | | | | | | network layer (ether). - Don't abuse module names to facilitate ifconfig module loading; such abuse isn't really needed. (And if we do need type information associated with a module then we should make it explicit and not use hacks.)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* bus_dmamap_sync() overhaul:tmm2003-01-211-21/+24
| | | | | | | | - Remove NetBSD-style or-ed together BUS_DMASYNC operations, in some cases relaxing the (intended) syncing operation a bit. - Add syncs before reading the descriptor rings. - Try to combine syncs where possible to avoid overhead. - Sync all maps before unloading them.
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Add detach, shutdown, suspend and resume methods.tmm2003-01-094-12/+142
| | | | Tested by: jake
* Fix module dependancy name.obrien2003-01-081-1/+1
| | | | | PR: 46871 Submitted by: Hartmut Brandt <brandt@fokus.gmd.de>
* Convert to use bus_dmamap_load_mbuf(); decouple software TX descriptorstmm2003-01-063-216/+149
| | | | | | | from the hardware descriptors to avoid the overhead of having a DMA map for each of them. Bump the number of hardware descriptors to 128, and use half as many software descriptors for now. Some minor cleanups.
* network interface driver changes:sam2002-11-141-13/+4
| | | | | | | | | | | | | | o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
* Call bpf_mtap() on output, to catch outgoing packets for e.g. tcpdump .fenner2002-07-301-1/+5
|
* Miscellaneous fixes:tmm2002-07-142-28/+47
| | | | | | | | | | - always reinitialize the rx descriptors, even if the mbuf is kept. This should fix the hangs on ifconfig that were observed - on an rx overflow, reinitialize the descriptor so that the interface will not hang - correct some bus_dmamap_sync() calls - correct some debug messages - some minor nits
* Don't treat statistics counter wrap-overs as errors.tmm2002-06-051-10/+3
|
* Move the new byte order function prototypes from <sys/param.h> tomike2002-04-261-0/+1
| | | | <sys/endian.h>. This puts us in line with NetBSD and OpenBSD.
* Assorted fixes:tmm2002-03-234-11/+3
| | | | | | | | | | | | - remove some useless code from the status change handler that was intended to enable the the MII drivers for external phys; this is already done during interface initialization, and the deleted code made some assumptions about phy addresses that do not seem to hold true on newer cards. This should get at least one of the two hmes of newer Netra t1 machines working. - correct the interrupt resource allocation - bump the number of RX descriptors, lower values cause promblems on some machines
* Use the pci_enable_* functions instead of manually fiddling with thetmm2002-03-111-6/+4
| | | | | | command register. Pointed out by: msmith
* Fix some bugs in the handling of the case of not enough tx descriptorstmm2002-03-091-12/+14
| | | | being free to send a packet.
* Add a driver for the Sun HME PCI/SBus ethernet adaptor, which is onboardtmm2002-02-275-0/+2455
in most machines of the Sun Ultra series. This is a port of the NetBSD driver which I enhanced to make use of the gather functionality and the configurable RX buffer offset to avoid copying all received/sent packet (instead, packets will be directly DMAd from mbuf chains and into mbuf clusters now).
OpenPOWER on IntegriCloud