summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_dc.c
Commit message (Collapse)AuthorAgeFilesLines
* Add ADMtek ADM9511 and ADM9513 device ID's.mbr2003-06-081-0/+6
| | | | | | | PR: PR51823 Submitted by: Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp> Reviewed by: phk MFC after: 2 days
* Change a :mux2003-06-011-1/+1
| | | | | | | | | | | bzero(ptr, sizeof(DC_RXLEN * 5)); which should obviously be: bzero(ptr, DC_RXLEN * 5); Looks like this bug may have reduced the effectiveness of the workaround for the hardware bug in the PNIC chips. MFC after: 1 week
* - Style(9) fixes, most notably :mux2003-06-011-535/+365
| | | | | | | | | | | | | o Remove register keyword o ANSIfy prototypes o Remove "return;" at the end of void functions o Remove trailing spaces o Don't align local variables with tabs and reorder them o Don't use /* FOO */ at the end of a #ifdef FOO block if it's a small block - Other non-functional changes : o 6 -> ETHER_ADDR_LEN o Don't initialize if_output; ether_ifattach() does it for us
* Only use a SIA/SYM media info block if no MII block is detected.mbr2003-05-151-2/+26
| | | | | | | | | The submitter of PR 32118 told me that this patch also fixes autoselecting for znyx 4 port cards (10baseT, 100baseTX did work already). PR: 32118 Reviewed by: imp Approved by: rwatson (re)
* Add support for 3Com OfficeConnect 10/100B.mbr2003-05-121-0/+4
| | | | | | | | PR: 49059, 50747 Submitted by: Dax Eckenberg <daxbert@dweebsoft.com> Reviewed by: imp, jhb Approved by: jhb MFC after: 2 weeks
* Use only a 64bit hash filter table for ADM-Centaur cards like thembr2003-05-011-1/+5
| | | | | | | | | Accton EN2242 and the ADMtek AN985 cards. PR: 32699 Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr> Reviewed by: phk MFC after: 2 weeks
* Use newly minted device_is_attached rather than device_is_alive to seeimp2003-04-211-1/+1
| | | | | | | | | if attach succeeded. device_is_alive just tells us that probe succeeded. Since we were using it to do things like detach net interfaces, this caused problems when there were errors in the attach routine. Symptoms of problem reported by: martin blapp
* Add support for Planex FNW-3602-T(CardBus 100M/10M).sanpei2003-04-181-0/+2
| | | | | Submitted by: kazz <kazz@v001.vaio.ne.jp> Obtained from: [bsd-nomads:16637]
* Revise attach/detach resource cleanupnjl2003-04-171-2/+12
| | | | | | | | | | | | | | | - Unconditionally call *_stop() if device is in the tree. This is to prevent callouts from happening after the device is gone. Checks for bus_child_present() should be added in the future to keep from touching potentially non-existent hardware in *_detach(). Found by iedowse@. - Always check for and free miibus children, even if the device is not in the tree since some failure cases could have gotten here. - Call ether_ifdetach() in the irq setup failure case - ti(4), xl(4): move ifmedia_init() calls to the beginning of attach so that ifmedia_removeall() can be unconditionally called on detach. There is no way to detect whether ifmedia has been initialized without using a separate variable (as tl(4) does). - Add comments to indicate assumptions of code path
* Revert part of revision 1.97 by calling dc_stop() unconditionallyiedowse2003-04-171-2/+1
| | | | | | | | | | | in dc_detach() instead of only calling it if the hardware is preset. This is a workaround for page faults in softclock() after a `dc' device was detached, caused by not disabling a timer before freeing its memory. The bus_child_present() checks should probably be re-added later, but only to avoid the hardware accesses and not the other resource cleanups in dc_stop(). Approved by: njl
* - Don't call pci_enable_io() in drivers (unless needed for resume).mdodd2003-04-161-17/+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-151-2/+4
| | | | | | | | 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.)
* Use __FBSDID rather than rcsid[].obrien2003-04-031-7/+3
|
* Add missing ()'s so that these drivers all compile again.jhb2003-03-311-1/+1
| | | | | Noticed by: jake Tested on: i386 (compile)
* Clean up locking and resource management for pci/if_*njl2003-03-311-33/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove locking of the softc in the attach method, instead depending on bus_setup_intr being at the end of attach (delaying interrupt enable until after ether_ifattach is called) - Call *_detach directly in the error case of attach, depending on checking in detach to only free resources that were allocated. This puts all resource freeing in one place, avoiding thinkos that lead to memory leaks. - Add bus_child_present check to calls to *_stop in the detach method to be sure hw is present before touching its registers. - Remove bzero softc calls since device_t should do this for us. - dc: move interrupt allocation back where it was before. It was unnecessary to move it. This reverts part of 1.88 - rl: move irq allocation before ether_ifattach. Problems might have been caused by allocating the irq after enabling interrupts on the card. - rl: call rl_stop before ether_ifdetach - sf: call sf_stop before ether_ifdetach - sis: add missed free of sis_tag - sis: check errors from tag creation - sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation - sk: remove duplicate initialization of sk_dev - ste: add missed bus_generic_detach - ti: call ti_stop before ether_ifdetach - ti: add missed error setting in ti_rdata alloc failure - vr: add missed error setting in I/O, memory mapping cases - xl: add missed error setting in I/O, memory mapping cases - xl: remove multi-level goto on attach failure - xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation - Calls to free(9) are unconditional because it is valid to call free with a null pointer. Reviewed by: imp, mdodd
* Update if_dc to use m_defrag, removing the semi-duplicate dc_coalsilby2003-03-291-35/+30
| | | | | | | | | | | function. Also, use m_defrag where appropriate to defrag long mbuf chains in the same fashion as was done in if_sis.c. Before this change, if_dc would blow up and take down the interface if fed a really long mbuf chain. MFC after: 2 weeks
* - Use if_broadcastaddr from struct ifnet rather than relying onmdodd2003-03-211-2/+2
| | | | | | | extern 'etherbroadcastaddr'. - Make 'etherbroadcastaddr' static. Reviewed by: imp
* Back out M_* changes, per decision of the TRB.imp2003-02-191-4/+4
| | | | Approved by: trb
* 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 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-101-0/+3
| | | | | # 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-091-0/+3
| | | | | | PR: 46859 Submitted by: Boaz Haberman <boaz@ool-182f8b09.dyn.optonline.net> Approved by: rwatson
* 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.
* 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-071-14/+104
| | | | | | | | | | | | | | 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-201-0/+3
| | | | | | | | | 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-061-0/+81
| | | | | | | 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
* Don't grab the lock until somewhat later in attach to avoid a lockphk2002-05-031-6/+7
| | | | reversal.
* Move us yet closer to IFM_* definitions in NetBSD.phk2002-04-291-6/+6
|
* 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-201-67/+62
|
* 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-141-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-111-2/+6
| | | | | | | | 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.
OpenPOWER on IntegriCloud