summaryrefslogtreecommitdiffstats
path: root/sys/pci
Commit message (Collapse)AuthorAgeFilesLines
* Fix KASSERT syntax error.phk2003-04-011-1/+1
|
* Fix KASSERT syntax errors.phk2003-04-011-2/+2
| | | | Please compile LINT before commiting.
* Add missing ()'s so that these drivers all compile again.jhb2003-03-3110-10/+10
| | | | | Noticed by: jake Tested on: i386 (compile)
* If we fail to find our PCI ID in attach (this should never happen), thenjhb2003-03-311-2/+1
| | | | | just return ENXIO directly instead of calling tl_detach() since that would panic since the softc mutex isn't initialized until after this check.
* Clean up locking and resource management for pci/if_*njl2003-03-3112-583/+533
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Switch rl_encap over to using m_defrag.silby2003-03-301-11/+1
| | | | | | | No functional change, the previous rl_encap was correct wrt long mbuf chains; this just reduces code duplication. MFC after: 2 weeks
* Switch vr_encap over to using m_defrag instead of its own versionsilby2003-03-291-14/+2
| | | | | | | | | of the function. No functional change, this driver already handled long mbuf chains correctly. MFC after: 2 weeks
* 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
* Have sis_encap use m_defrag if:silby2003-03-291-1/+25
| | | | | | | | | | | | | | | 1. The chain passed in is > 31 fragments long or 2. The chain will not fit in the remaining descriptors without defragmentation. This is slightly less clear than other network drivers because the sis chips share one descriptor list for all packets, it seems. Before this change, a > 127 fragment chain would get stuck in the IFQUEUE permanently, bringing all network traffic to a halt. MFC after: 2 weeks
* Fix up the long mbuf chain recovery code to use m_defrag; the oldsilby2003-03-291-19/+8
| | | | | | | code messed up on B & C chipsets because it lost the packet header and therefore the flag indicating the need for hardware checksums. MFC after: 2 weeks
* - Add vm_paddr_t, a physical address type. This is required for systemsjake2003-03-253-3/+3
| | | | | | | | | | | | | | | where physical addresses larger than virtual addresses, such as i386s with PAE. - Use this to represent physical addresses in the MI vm system and in the i386 pmap code. This also changes the paddr parameter to d_mmap_t. - Fix printf formats to handle physical addresses >4G in the i386 memory detection code, and due to kvtop returning vm_paddr_t instead of u_long. Note that this is a name change only; vm_paddr_t is still the same as vm_offset_t on all currently supported platforms. Sponsored by: DARPA, Network Associates Laboratories Discussed with: re, phk (cdevsw change)
* - Use if_broadcastaddr from struct ifnet rather than relying onmdodd2003-03-212-3/+3
| | | | | | | extern 'etherbroadcastaddr'. - Make 'etherbroadcastaddr' static. Reviewed by: imp
* Make sure to free the correct resources when the card fails to attachsilby2003-03-191-0/+8
| | | | | | properly. (Broken in the previous commit.) Noticed by: "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
* Add support for Planex FNW-3800-TX(CardBus 100M/10M).sanpei2003-03-182-1/+14
| | | | | Submitted by: Kunihiro Arai <araik@attglobal.net> Obtained from: [bsd-nomads:16625]
* Instead of relying on a compile time define to determine whether the xlsilby2003-03-182-37/+34
| | | | | | | | | driver should use port or memory based IO, determine it dynamically at runtime, preferring MMIO where possible. This helps us support newer arches which dislike port based access better. Tested on i386 & sparc64, with 3c900, 905, 905b, and 905C cards. (in varying combinations by both jake and myself)
* Add pci id# for the sis648sos2003-03-131-0/+2
|
* Fix bug introduced in 1.130. For the < MHLEN case, we shouldbmilekic2003-03-041-1/+1
| | | | | | | be doing a m_gethdr(), not an m_get(). Pointed out by: Hiten Pandya <hiten@unixdaemons.com> Pointy hat to: Me
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-034-52/+26
| | | | | | | | | | | | | branches: Initialize struct cdevsw using C99 sparse initializtion and remove all initializations to default values. This patch is automatically generated and has been tested by compiling LINT with all the fields in struct cdevsw in reverse order on alpha, sparc64 and i386. Approved by: re(scottl)
* Spell noread() and nowrite() correctly (ie: not "NULL")phk2003-03-021-2/+2
|
* More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).des2003-03-021-6/+6
|
* Use rman_get_start() to get start address of the resource.nyan2003-02-261-2/+2
|
* Cleanup of the d_mmap_t interface.mux2003-02-253-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | - Get rid of the useless atop() / pmap_phys_address() detour. The device mmap handlers must now give back the physical address without atop()'ing it. - Don't borrow the physical address of the mapping in the returned int. Now we properly pass a vm_offset_t * and expect it to be filled by the mmap handler when the mapping was successful. The mmap handler must now return 0 when successful, any other value is considered as an error. Previously, returning -1 was the only way to fail. This change thus accidentally fixes some devices which were bogusly returning errno constants which would have been considered as addresses by the device pager. - Garbage collect the poorly named pmap_phys_address() now that it's no longer used. - Convert all the d_mmap_t consumers to the new API. I'm still not sure wheter we need a __FreeBSD_version bump for this, since and we didn't guarantee API/ABI stability until 5.1-RELEASE. Discussed with: alc, phk, jake Reviewed by: peter Compile-tested on: LINT (i386), GENERIC (alpha and sparc64) Runtime-tested on: i386
* Remove support for running in SimOS. The support has rotted overmarcel2003-02-252-431/+0
| | | | | | | | time and there's no indication that it will improve anytime soon. By removing support for SimOS it is possible to build LINT on Alpha, which is considered more important at the moment. Not objected to on: alpha@
* Add support for Peppercon ROL-F Card.dan2003-02-232-0/+10
| | | | | Submitted by: Sascha Holzeiter <sascha@root-login.org> PR: 48559
* Make xl use m_getcl() to allocate an mbuf and a cluster in one shot,bmilekic2003-02-221-19/+5
| | | | | | | | | | | | as opposed to one after the other. This is faster in both -CURRENT and -STABLE. Additionally, there is less code duplication for error-checking. One thing to note is that this code seems to return(1) when no buffers are available; perhaps ENOBUFS should be the correct return value? Partially submitted & tested by: Hiten Pandya <hiten@unixdaemons.com> MFC after: 1 week
* Fix panic on sparc64 introduced in my last commit. I reallymux2003-02-191-5/+6
| | | | | | | | | | | wish the busdma APIs were more consistent accross architectures. We should probably move all the other DMA map creations in xl_attach() where we can really handle them failing, since xl_init() is void and shouldn't fail. Pointy hat to: mux Tested by: Anders Andersson <anders@hack.org>
* Back out M_* changes, per decision of the TRB.imp2003-02-1919-65/+65
| | | | Approved by: trb
* - Fix mbuf leak when we successfully allocate a new mbuf but fail tomux2003-02-182-6/+18
| | | | | | | | | bus_dmamap_load() it. - Make it so reusing mbufs when we can't allocate (or map) new ones actually works. We were previously trying to reuse a mbuf which was already bus_dmamap_unload()'ed. Reviewed by: silby
* Split the arch-specific AGP files into the appropriate files.* and do the sameanholt2003-02-141-0/+6
| | | | | | for the agp module, and add agp to the list of modules to compile for alpha. Add an alpha_mb() to agp_flush_cache for alpha -- it's not correct but may improve the situation, and it's what linux and NetBSD do.
* Remove an extra agp_flush_cache(). The i810 case that needs it already has it.anholt2003-02-141-5/+0
|
* Add agpreg.h missed in commit to agp_i810 (adding i85x/i86x AGP support).anholt2003-02-131-0/+26
|
* Add Intel 85x/86x AGP support.anholt2003-02-131-16/+88
| | | | Submitted by: David Dawes <dawes@xfree86.org>
* Minor correction to comment: PNIC and XIRCOM have eeprom, its justimp2003-02-121-1/+1
| | | | non-standard.
* Clean up exit path from rl_attach() to remove multiple returnsnjl2003-02-091-3/+3
|
* Fix an oversight in some code I added to the last commit.mdodd2003-02-081-1/+1
|
* - Remove duplicate call to callout_handle_init() in pcn_attach().mdodd2003-02-081-2/+5
| | | | | | | - Conditionalize mtx_destroy() in pcn_attach(). - Assert driver lock in pcn_intr(). Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* 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
* Turn off interrupts in pcn_stop().mdodd2003-02-071-0/+4
|
* Consolidate resource release code on error condition.mdodd2003-02-061-9/+8
|
* Move the DC_SETBIT to the attach function.mbr2003-02-051-3/+7
| | | | Reviewed by: phk
* Add deviceids for 6105 and 6105M chips. Further changes will be necessarysilby2003-02-012-0/+6
| | | | | | | to fully support these new chips, but preliminary evidence suggests that they work acceptable with our present driver. MFC after: 1 week
* Switch the if_vr driver from using our generic MII routines over tosilby2003-02-012-0/+93
| | | | | | | | | | | | | using the Rhine's internal shift registers which are designed for the job. This reduces the amount of time we wait around shifting bits, and seems to work better with some chips. Also, provide a workaround for some newer cards which report fake PHYs at multiple addresses. (As more cards are ID'd, I'm sure this part of the code will have to be expanded to cover more cases.) Submitted by: Thomas Nystrom <thn@saeab.se> MFC after: 1 week
* Fixes from Thomas Nystrom to fix hanging problems experienced by vr cardssilby2003-01-312-34/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | under load. This patch has been tested by Thomas and other for more than a month now, and all (known) hangs seem to be solved. Thomas's explanation of the patch: * Fix the problem with the printing of the RX-error. * Code from if_fet do better deal with the RX-recovery including a timeout of the RX-turnoff. * The call to vr_rxeof before vr_rxeoc have been moved to a point where the RX-part of the chip is turned off. Otherwise there is a window where new data could have been written to the buffer chain before the RX-part is turned off. If this happens the chip will see a busy rx-buffer. I have no evidence that this have occured but god knows what the chip will do in this case! * I have added a timeout of the TX-turnoff. I have checked and in my 900 MHz system the flags for turnoff (both RX & TX) is seen at the first check in the loop. * I could see that I got the VR_ISR_DROPPED interrupt sometimes and started to thinking about this. I then realized that no recovery is needed for this case and therefore I only count it as an rxerror (which was not done before). * Finally I have changed the FIFO RX threshhold to 128 bytes. When I did this the VR_ISR_DROPPED interrupt went away. Theory: The chip will receive a complete frame before it tries to write it out to memory then the RX threshold is set to store'n'forward. IF the frame is large AND the next rx frame also is large AND the bus is busy transfering a TX frame to the TX fifo THEN the second received frame wont fit in the FIFO and is then dropped. By having the RX threshold set to 128 the RX fifo is emptied faster. MFC after: 5 days
* Fix typo in an unused macro.mux2003-01-291-1/+1
|
* Migrate the PCI bus logic for ohci and uhci from sys/pci to sys/dev/usb.joe2003-01-292-707/+0
|
* Add PCI revision number for 630A and 900B. Enable parity error detectionmbr2003-01-282-19/+86
| | | | | | | | | | on 900B and 635(A). Re-add the enhanced PHY access register method again for older chipsets, they do not seem to work with all old chips. Reviewed by: phk MFC after: 7 days
* Remove the now unused sys/malloc.h header.mux2003-01-241-1/+0
|
* Correctly identify the 3C920B chipset; although it may ship with some Nforce2silby2003-01-222-5/+5
| | | | | | boards, it's definitely not an Nvidia chip. Info from: Nvidia's Linux Network driver & pciids.sourceforge.net
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-2119-65/+65
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
OpenPOWER on IntegriCloud