summaryrefslogtreecommitdiffstats
path: root/sys/dev/dc
Commit message (Collapse)AuthorAgeFilesLines
* Minor correction to comment: PNIC and XIRCOM have eeprom, its justimp2003-02-121-1/+1
| | | | non-standard.
* Fix the breakage resulting from Rev. 1.80. Get the eeprom widthmbr2003-02-071-4/+5
| | | | | | | | | | | | | | | | | | | for all but two cards. This should fix broken cards like these: DM9102 (Davicom, DEVICE_ID: 0x9002) DM9009 (Davicom, DEVICE_ID: 0x9009) DM9100 (Davicom, DEVICE_ID: 0x9100) 98713/98713_CP (Macronix PMAC, DEVICE_ID: 0x0512) 98713_CP (Macronix PMAC, DEVICE_ID: 0x0512) 987x5 (Macronix PMAC, DEVICE_ID: 0x0531) 98727 (Macronix PMAC, DEVICE_ID: 0x0532) 82C115 (Lite-On PNIC II, DEVICE_ID: 0xc115) AX88140A (ASIX Dev_ID: DEVICE_ID: 0x1400) EN1217 (Accton EN1217, DEVICE_ID: 0x1217) Note that these cards sould still work in STABLE. Reviewed by: imp
* Add missing braces.mbr2003-02-071-1/+2
| | | | | Found by: FlexeLint (phk) Reviewed by: wpaul, phk
* Move the DC_SETBIT to the attach function.mbr2003-02-051-3/+7
| | | | Reviewed by: phk
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Remove miidevs.h and generate it from miidevs at compile time.obrien2003-01-192-2/+2
| | | | The devlist2h.awk tool to do this has been repocopied to sys/tools/.
* Remove bogus locking from dc(4). Instead, move interrupt allocationnjl2003-01-141-42/+34
| | | | | | | | and ether_ifattach() to end. This fixes a "could sleep" case and simplifies error exit cases as well. Also be sure to set errno and clean up resources in !mac error case. Tested by: Ryan Beasley
* Add preliminary support for the Hawking PN672TX CardBus cards.imp2003-01-102-0/+15
| | | | | # Preliminary because there are some subtle things the NetBSD driver does # that we don't do yet. My card works for me w/o them.
* Add support for the Davicom DM9009 chipset.trhodes2003-01-092-0/+4
| | | | | | PR: 46859 Submitted by: Boaz Haberman <boaz@ool-182f8b09.dyn.optonline.net> Approved by: rwatson
* Fix the missspelt letter in DC_CTYPE_PUP_AUTOSENSe define.semenu2002-12-181-1/+1
| | | | | Submitted by: marius@alchemy.franken.de MFC after: 3 days
* Xircom cards store the MAC address in the CIS, so get it from the newimp2002-11-271-2/+8
| | | | | | | | pci_get_ether accesor, which gets it from the CIS for cardbus cards (and from other pci-like buses via whatever mechanism is used there). Submitted by: sam Approved by: re (blanket)
* Fix handling of IFF_ALLMULTI. The same bug in various forms affectsluigi2002-11-251-9/+7
| | | | | | | | the following drivers: dc mn sf sk ste ti tl xl an bge em gem gx ie lge sr aue cue kue wi xe Approved by: re
* o track either_ifattach/ether_ifdetach API changessam2002-11-141-16/+6
| | | | | | | | | | | o use if_input for input packet processing o don't strip the Ethernet header for input packets o use BPF_* macros bpf tapping o call ether_ioctl to handle default ioctl case o track vlan changes Reviewed by: many Approved by: re
* Be consistent about functions being static.phk2002-10-161-6/+8
| | | | Spotted by: FlexeLint.
* Put function return types on a line by themselves.alfred2002-10-142-8/+12
| | | | | Cleanup my earlier de-__P sweep and remove whitespace between function names and paramters.
* Ooops. Need to free dc_srom on detach to not leak memory.imp2002-10-071-0/+1
| | | | Pointy Hat to: The Mad Redhead of Niwot
* Dynamically configure the width of the srom. This code comes fromimp2002-10-072-15/+106
| | | | | | | | | | | | | | OpenBSD who got the code (or the idea) from the NetBSD tlp driver. This gets some cardbus dc cards working (either completely or nearly so). It also appears to get additional pci cards working, without breaking working ones. # Maybe some additional work is needed here. Also, the cardbus attachment # might need to match on the CIS rather than on the vendor/device so we have # a finer level of detail as to what the card is. Technically, the # vendor/device fields are undefined for CardBus (even though most cards are # using common silicon with pci models).
* Fix the support for the AN985/983 chips, which do not set thembr2002-09-201-1/+2
| | | | | | | | | RXSTATE to STOPPED, but to WAIT. This should fix hangs which could only be solved by replugging the cable. Submitted by: jhb Reviewed by: phk MFC after: 2 weeks
* Enable the automatic TX underrun recovery for the ADMtek chips.mbr2002-09-202-0/+5
| | | | | | | | | This solves cvsup update on my laptop which aborts after a while without this patch. PR: 34236 Reviewed by: phk MFC after: 2 weeks
* Make consistent; turn spaces into tabs where there is a mixture.markm2002-09-041-21/+21
|
* style:alfred2002-08-231-58/+116
| | | | | put return values on a line by themselves. fix some paste issues where whitespace was used instead of tabs.
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidsobomax2002-08-181-3/+3
| | | | | | | breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's. Reviewed by: -hackers, -net
* Fix if_timer logic to make sure that there is always a timeoutluigi2002-06-301-6/+6
| | | | | | pending if there are packets queued for transmission. MFC after: 3 days
* Add suspend/resume code mostly merged from fxp/rl driver.iwasaki2002-05-062-0/+88
| | | | | | | This is temporary hack, better and generalized solution probably should be implemented at lower layer(MII or PCI?). Tested by: shoko.araki@soliton.co.jp MFC after: 1 week
* Clean up mii/phy drivers: Remove the MIIF_DOINGAUTO which doesn't reallyphk2002-05-041-45/+14
| | | | | do anything at the end of the day except bloat the drivers which has copy&pasted it.
* Don't grab the lock until somewhat later in attach to avoid a lockphk2002-05-031-6/+7
| | | | reversal.
* Make one generic mii_phy_detach() to replace 19 slightly different ones.phk2002-04-292-32/+2
| | | | | | | Rename mii_phy_auto_stop() mii_phy_down(). Introduce mii_down(), use it from nge. Do not indirect it to 19 identical case's in 19 switchstatements like NetBSD did.
* Move us yet closer to IFM_* definitions in NetBSD.phk2002-04-291-6/+6
|
* Don't pass three args when one will do just fine, and even preventphk2002-04-282-2/+2
| | | | mistakes like the one brgphy.c (now corrected).
* Improve an API by about 4 lines per driver.phk2002-04-282-8/+2
|
* Work around an Intel 21143 chip bug.mckay2002-04-181-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rev 1.56 of if_dc.c removed calls to mii_pollstat() from the dc_tick() routine. dc_tick() is called regularly to detect link up and link down status, especially when autonegotiating. The expectation was that mii_tick() (which is still called from dc_tick()) would update status information automatically in all cases where it would be sensible to do so. Unfortunately, with authentic 21143 chips this is not the case, and the driver never successfully autonegotiates. This is because (despite what it says in the 21143 manual) the chip always claims that link is not present while the autonegotiation enable bit is set. Autonegotation takes place and succeeds, but the driver tests the link bits before it switches off the autonegotiation enable bit, and success is not recognised. The simplest solution is to call dcphy_status() more often for MII_TICK calls by dropping out of the switch statement instead of exiting when we are autonegotiating and link appears to not be present. When autonegotiation succeeds, dcphy_status() will note the speed and fdx/hdx state and turn off the autonegotiation enable bit. The next call to dcphy_status() will notice that link is present, and the dc driver code will be notified. Macronix chips also use this code, but implement link detection as described in the manual, and hence don't need this patch. However, tests on a Macronix 98715AEC-C show that it does not adversely affect them. This could be done better but is the minimal effective change, and most closely mimics what was happening prior to rev 1.56 of if_dc.c. (Actually I also deleted a small amount of unnecessary code while I was in the area.) Reviewed by: wpaul
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Remove __P.alfred2002-03-203-79/+74
|
* Forgot one part of the VLAN support for the dc(4) driver.ambrisko2002-01-161-0/+2
| | | | Pointed out by: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
* Add VLAN for the dc(4) driver (ie long frame). The patch is 2 parts.ambrisko2002-01-161-12/+26
| | | | | | | | | | | | | | | | One to notify the system that the MTU for VLAN can be 1500 so the vlan will automatically be configured with a 1500 MTU the other is to ignore the error case if the received frame is to long. The frame size notification came from code in the SIS driver, and the support for long frames derived from the NetBSD Tulip driver. Tested on: 4 port D-Link adapter DFE-570TX 4 Intel 21143 Netgear card with 82c169 PNIC 10/100BaseTX Reviewed by: ru (manpage), wpaul (not objected to), archie Approved by: imp Obtained from: NetBSD
* Fix the "conexant chips don't work in full duplexmode" problem. Accordingwpaul2001-12-191-4/+8
| | | | | | | | | | | | | to Phil Kernick: "The problem is that in full duplex mode, the Conexant chip always reports a carrier lost error, even when the frame is successfully sent. So, if we have a Conexant chip, then ignore carrier lost when in full duplex mode." Since the Xircom chips seem to have the same issue and since we already have a workaround for this, just expand the workaround test to also check for DC_IS_CONEXANT().
* Fix compiler warning in dc_intr(): if the only code that does a "goto"wpaul2001-12-191-0/+3
| | | | | | to a label is inside an #ifdef block, then the label should *also* be inside an #ifdef block. Hide the "done:" label which is only used if DEVICE_POLLING is enabled under #ifdef DEVICE_POLLING.
* Patch up some existing style bugs and some that crept in with thepeter2001-12-151-7/+7
| | | | DEVICE_POLLING stuff.
* Device Polling code for -current.luigi2001-12-142-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Non-SMP, i386-only, no polling in the idle loop at the moment. To use this code you must compile a kernel with options DEVICE_POLLING and at runtime enable polling with sysctl kern.polling.enable=1 The percentage of CPU reserved to userland can be set with sysctl kern.polling.user_frac=NN (default is 50) while the remainder is used by polling device drivers and netisr's. These are the only two variables that you should need to touch. There are a few more parameters in kern.polling but the default values are adequate for all purposes. See the code in kern_poll.c for more details on them. Polling in the idle loop will be implemented shortly by introducing a kernel thread which does the job. Until then, the amount of CPU dedicated to polling will never exceed (100-user_frac). The equivalent (actually, better) code for -stable is at http://info.iet.unipi.it/~luigi/polling/ and also supports polling in the idle loop. NOTE to Alpha developers: There is really nothing in this code that is i386-specific. If you move the 2 lines supporting the new option from sys/conf/{files,options}.i386 to sys/conf/{files,options} I am pretty sure that this should work on the Alpha as well, just that I do not have a suitable test box to try it. If someone feels like trying it, I would appreciate it. NOTE to other developers: sure some things could be done better, and as always I am open to constructive criticism, which a few of you have already given and I greatly appreciated. However, before proposing radical architectural changes, please take some time to possibly try out this code, or at the very least read the comments in kern_poll.c, especially re. the reason why I am using a soft netisr and cannot (I believe) replace it with a simple timeout. Quick description of files touched by this commit: sys/conf/files.i386 new file kern/kern_poll.c sys/conf/options.i386 new option sys/i386/i386/trap.c poll in trap (disabled by default) sys/kern/kern_clock.c initialization and hardclock hooks. sys/kern/kern_intr.c minor swi_net changes sys/kern/kern_poll.c the bulk of the code. sys/net/if.h new flag sys/net/if_var.h declaration for functions used in device drivers. sys/net/netisr.h NETISR_POLL sys/dev/fxp/if_fxp.c sys/dev/fxp/if_fxpvar.h sys/pci/if_dc.c sys/pci/if_dcreg.h sys/pci/if_sis.c sys/pci/if_sisreg.h device driver modifications
* Avoid an unnecessary copy of a packet if it is already in a single mbuf.luigi2001-12-112-2/+7
| | | | | | | | Introduce an additional device flag for those NICs which require the transmit buffers to be aligned to 32-bit boundaries. (the equivalen fix for STABLE is slightly simpler because there are no supported chips which require this alignment there.)
* MFS (merge from stable): rev 1.9.2.28, fix ordering of IFF_RUNNING mods.peter2001-12-071-2/+2
| | | | | | The reason we are required to commit to -current first is so that later MFC's do not risk the loss of existing bug fixes. Even if this was not strictly required in -current, it should still be fixed there too.
* Remove error messages on mbuf allocation failures, nowluigi2001-12-041-10/+2
| | | | | | this is done more safely in kern/subr_mbuf.c Two-days'-delay-thanks-to: @home shutting down service
* Per jlemon request, reintroduce some printf() when anluigi2001-11-291-3/+8
| | | | | | | | | | | | | | mbuf allocation fails, and fix (i hope) a couple of style bugs. I believe these printf() are extremely dangerous because now they can occur on every incoming packet and are not rate limited. They were meant to warn the sysadmin about lack of resources, but now they can become a nice way to panic your system under load. Other drivers (e.g. the fxp driver) have nothing like this. There is a pending discussion on putting this kind of warnings elsewhere, and I hope we can fix this soon.
* For i386 architecture, remove an expensive m_devget() (and theluigi2001-11-291-31/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | underlying unaligned bcopy) on incoming packets that are already available (albeit unaligned) in a buffer. The performance improvement varies, depending on CPU and memory speed, but can be quite large especially on slow CPUs. I have seen over 50% increase on forwarding speed on the sis driver for the 486/133 (embedded systems), which does exactly the same thing. The behaviour is controlled by a sysctl variable, hw.dc_quick which defaults to 1. Set it to 0 to restore the old behaviour. After running a few experiments (in userland, though) I am convinced that doing the m_devget() is detrimental to performance in almost all cases. Even if your CPU has degraded performance with misaligned data, the bcopy() in the driver has the same overhead due to misaligment as the one that you save in the uiomove(), plus you do one extra copy and pollute the cache. But more often than not, you do not even have to touch the payload, e.g. when you are forwarding packets, and even in the often-cited case of NFS, you often end up passing a pointer to the payload to the disk controller. In any case, you can play with the sysctl variable to toggle between the two behaviours, and see if it makes a difference. MFC-after: 3 days
* Remove ifnet.if_mpsafe for now. If this is needed, it won't be neededjhb2001-11-141-1/+0
| | | | | | until much later when the network stack locking is farther along. Approved by: jlemon
* Enable round-robin arbitration between transmit and receive unitluigi2001-10-271-0/+5
| | | | | | | | in the 21143, instead of giving priority to the receive unit. This gives a 10-15% performance improvement in the forwarding rate under heavy load. Reviewed-by: Bill Paul
* Defs for three (unused so far) bits in PCI command/status registerluigi2001-10-251-3/+3
| | | | were off by one bit.
* Do not call mii_pollstat() from within device tick routines; the statusjlemon2001-09-291-8/+5
| | | | | | information is updated by mii_tick(). Pointed out by: wpaul (a while back)
* Cleanup pass for mii drivers.jlemon2001-09-292-31/+19
| | | | | | | . Make internal service routines static. . Use a consistent ordering of checks in MII_TICK. Do the work in the mii_phy_tick() subroutine if appropriate. . Call mii_phy_update() to trigger the callbacks.
* Add support for Conexant LANfinity miniPCI controllers. People who havewpaul2001-09-042-3/+49
| | | | | | | | | | laptops with this chip should test this and report back as I don't have access to this hardware myself. People with -stable systems should try the patch at: http://www.freebsd.org/~wpaul/conexant.patch.gz Submitted by: Phil Kernick <Phil@Kernick.org>
OpenPOWER on IntegriCloud