summaryrefslogtreecommitdiffstats
path: root/sys/dev/dc/if_dc.c
Commit message (Collapse)AuthorAgeFilesLines
* Some integrated Davicom cards in sparc64 boxes have an all zerosmux2004-01-081-0/+18
| | | | | | | | | | MAC address in the EEPROM, and we need to get it from OpenFirmware. This isn't very pretty but time is lacking to do this in a better way this near 5.2-RELEASE. This is a RELENG_5_2 candidate. Original version by: Marius Strobl <marius@alchemy.franken.de> Tested by: Pete Bentley <pete@sorted.org> Reviewed by: jake
* The transmit frame status is stored in the last transmit descriptor for thetruckman2004-01-081-3/+4
| | | | | | | | | | | | | | | | | | | | | frame, not the first. It is probably also not safe to free the mbuf chain as soon as the OWN bit is cleared on the first descriptor since the chip may not be done copying the frame into the transmit FIFO. Revert the part of of busdma conversion (if_dc.c rev 1.115) which changed dc_txeof() to look for the status in the first descriptor and free the mbuf chain when processing the first descriptor for the frame, and revert the matching changes elsewhere in the driver. This part of the busdma change caused the driver to report spurious collisions and output errors, even when running in full-duplex mode. Reverting the mbuf chain handling slightly complicates dc_dma_map_txbuf(), since it is responsible for setting the OWN bits on the descriptors, but does not normally have direct access to the mbuf chain. Tested by: Dejan Lesjak <dejan.lesjak at ijs.si> alpha/<Intel 21143 10/100BaseTX> "Xin LI" <delphij at frontfree.net> i386/<Macronix 98713 10/100BaseTX> Wiktor Niesiobedzki <bsd at w.evip.pl> i386/<3Com OfficeConnect 10/100B> Reviewed by: mux
* Add support for ELECOM/Laneed CardBus FastEtherner Card(LD-CBL/TXA)sanpei2003-12-061-0/+2
| | | | | Submitted by: Masahiro Yamagishi <night@pluto.dti.ne.jp> Approved by: re (scottl)
* Sometimes cardbus attachments don't attach, so while we track downimp2003-11-281-0/+1
| | | | | | | | this problem put these lines back in. While they should be unnecessary, they appear to be sometimes necessary. Reviewed in concept: dfr Approved by: re (scottl@)
* Drop the driver lock around calls to if_input to avoid a LOR whensam2003-11-141-1/+9
| | | | | | | | the packets are immediately returned for sending (e.g. when bridging or packet forwarding). There are more efficient ways to do this but for now use the least intrusive approach. Reviewed by: imp, rwatson
* Remove duplicate FBSDID's, move others to their right place.obrien2003-11-141-4/+3
|
* reconst poisonimp2003-11-141-10/+10
| | | | re-de u_intXX_t
* Try to create some sort of consistency in how the routings to find theobrien2003-11-131-20/+23
| | | | | | | multicast hash are written. There are still two distinct algorithms used, and there actually isn't any reason each driver should have its own copy of this function as they could all share one copy of it (if it grew an additional argument).
* Remove explicit cardbus attachments from drivers where this is identicaldfr2003-11-031-1/+0
| | | | | | | to the pci attachment. Cardbus is a derived class of pci so all pci drivers are automatically available for matching against cardbus devices. Reviewed by: imp
* Correct the spelling of m_devget() in the sysctl variable description.ru2003-11-021-1/+1
|
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+1
| | | | | | | | | | | | | 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)
* Const poison crc routines (why these aren't centralized, I'm not sure).imp2003-10-231-9/+9
|
* Fix a problem where m_defrag would allocate a new mbuf to replace thesilby2003-10-191-8/+8
| | | | | | | chain passed into dc_encap, which dc_start was unaware of. This caused the old (now invalid) mbuf to be passed to BPF_MTAP. Spotted by: Kenjiro Cho <kjc@csl.sony.co.jp>
* Ignore CSR13, CSR14, CSR15 'Media Specific Data' registersmbr2003-10-051-9/+26
| | | | | | | | | | | | | | | for 21143 based cards which use SIA mode. This fixes 10mbit mode for ZNYX ZX346Q cards and other 21143 based cards. PR: 32118 Submitted by: Rene de Vries <rene@tunix.nl> Geert Jan de Groot <GeertJan.deGroot@tunix.nl> Obtained from: BSDI MFC after: 2 weeks
* Don't read the MAC address from a copy of the EEPROM in the softcmbr2003-09-161-4/+3
| | | | | | | | | | | | | | | that has been recorded earlier and overwrite it again later by reading it directly from the EEPROM again. Read the MAC address from the PAR0/PAR1 registers instead, which are autoloaded on reboot. Tested on AN985, AN983B. According to the datasheets, it should also work for the AL981 (I don't have such a chip on a card at home) PR: 52988 Submitted by: Andrew Gordon <arg-bsd@arg.me.uk> MFC after: 2 weeks
* Use PCIR_BAR(x) instead of PCIR_MAPS.jhb2003-09-021-2/+2
| | | | | Glanced over by: imp, gibbs Tested by: i386 LINT
* All davicom cards seem to need DC_TX_ALIGN.mbr2003-08-271-2/+1
|
* Make TX on davicom 9102A working again. This chip needsmbr2003-08-241-0/+2
| | | | | | | its mbufs aligned on TX. PR: 53656, 42714 MFC after: 3 days
* 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.
* Change instances of callout_init that specify MPSAFE behaviour tosam2003-08-191-1/+1
| | | | | use CALLOUT_MPSAFE instead of "1" for the second parameter. This does not change the behaviour; it just makes the intent more clear.
* Use the BUS_DMA_ZERO flag.mux2003-07-271-2/+1
|
* Add support for FA-511; Submitted by: Kenneth P. Stox; Pr 42858imp2003-07-191-0/+4
|
* Add support for a bunch of Microsoft networking products:wpaul2003-07-101-0/+20
| | | | | | | | - MN-110 10/100 USB ethernet (ADMtek Pegasus II, if_aue) - MN-120 10/100 cardbus (ADMtek Centaur-C, if_dc) - MN-130 10/100 PCI (ADMtek Centaur-P, if_dc) Also update dc(4) man page to mention support for MN-120 and MN-130.
* Make the dc(4) driver endian-clean, so to that it works on sparc64.mux2003-07-091-45/+50
| | | | | | | There are such cards in Netra X1 boxes, which should thus be fully supported now. Tested by: jake
* Convert the dc(4) driver to the busdma API. This is a necessary stepmux2003-07-061-109/+282
| | | | | | | | | | | | | | | to have this driver working on sparc64. It still needs to be made endian-clean before it can work there. Special thanks to dragonk@evilcode.net for sending me a dc(4) card so that I was able to do this work. Many cheers to all the people that tested this change, thanks to them, this change shouldn't break anything :-). Tested by: marcel (i386 and ia64), ru (i386), wilko (alpha), mbr (i386), wpaul (i386) and Will Saxon <WillS@housing.ufl.edu> (i386)
* Fix a bug that could cause dc(4) to m_freem() an already freedmux2003-07-061-1/+2
| | | | | | mbuf or something that isn't an mbuf. MFC after: 3 days
* Various style(9) and readability fixes.mux2003-07-061-14/+22
|
* Due to extreme bogusness in the pci bus layer, these drivers wereimp2003-07-031-4/+8
| | | | | | | | | forced to do slightly bogus power state manipulation. However, this is one of those features that is preventing further progress, so mark them as BURN_BIRDGES like I did for the drivers in sys/dev/... This, like the other change, are a no-op unless you have BURN_BRIDGES in your kernel.
* 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
OpenPOWER on IntegriCloud