summaryrefslogtreecommitdiffstats
path: root/sys/dev/puc/puc.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r307518:hselasky2016-11-071-2/+1
| | | | | | | | | | | | | | | | | | | | | Fix device delete child function. When detaching device trees parent devices must be detached prior to detaching its children. This is because parent devices can have pointers to the child devices in their softcs which are not invalidated by device_delete_child(). This can cause use after free issues and panic(). Device drivers implementing trees, must ensure its detach function detaches or deletes all its children before returning. While at it remove now redundant device_detach() calls before device_delete_child() and device_delete_children(), mostly in the USB controller drivers. Tested by: Jan Henrik Sylvester <me@janh.de> Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8070
* Replace some more default range checks with RMAN_IS_DEFAULT_RANGE().jhibbits2016-03-021-1/+1
| | | | This is a follow-on to r295832.
* Convert rman to use rman_res_t instead of u_longjhibbits2016-01-271-4/+4
| | | | | | | | | | | | | | | | | | | | Summary: Migrate to using the semi-opaque type rman_res_t to specify rman resources. For now, this is still compatible with u_long. This is step one in migrating rman to use uintmax_t for resources instead of u_long. Going forward, this could feasibly be used to specify architecture-specific definitions of resource ranges, rather than baking a specific integer type into the API. This change has been broken out to facilitate MFC'ing drivers back to 10 without breaking ABI. Reviewed By: jhb Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5075
* Add MSI support to puc(9)rstone2014-03-131-1/+3
| | | | | | | | | | | Add support for MSI interrupts in the puc(9) driver. By default the driver will prefer MSI interrupts to legacy interrupts. A tunable, hw.puc.msi_disable, has been added to force the allocation of legacy interrupts. Reviewed by: jhb@ MFC after: 2 weeks Sponsored by: Sandvine Inc.
* Do not require a filter-only interrupt handler for puc ports that are notjhb2013-01-151-1/+1
| | | | | | | | serial devices (such as printer ports). This allows ppc devices attached to puc to correctly setup an interrupt handler and work. Tested by: Andre Albsmeier Andre.Albsmeier@siemens.com MFC after: 1 week
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-1/+1
| | | | This means that their use is restricted to a single C file.
* Add location and pnpinfo strings for puc device ports. The location isjhb2011-06-141-0/+38
| | | | | | | | announced during boot and contains the port number. The pnpinfo string lists the port type (PUC_TYPE_* constants). Tested by: Boris Samorodov bsam ipt ru MFC after: 1 week
* Fix interrupt handling. It started off broken and grew worse over time.marcel2009-12-111-46/+62
| | | | | | | | | | | | | | | The rewrite of the interrupt handler includes: o loop until all pending interrupts are handled. This closes a race condition. o count the number of interrupt sources we handled so that we can properly return FILTER_HANDLED or FILTER_STRAY when we break out of the loop. o When matching the interrupt source to the devices that have that source pending, check only from the set of devices we found to have a pending interrupt. PR: kern/140947 MFC after: 3 days
* -axe p_ih from struct puc_port cause it was uselesspiso2007-06-061-8/+4
| | | | | | | -correctly check for filter only handler Reviewed by: marcel Tested by: marcel
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-10/+12
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* Fix building with GCC 4.2: ensure types are defined before refering to them.obrien2006-06-291-1/+1
|
* Rewrite of puc(4). Significant changes are:marcel2006-04-281-486/+583
| | | | | | | | | | | | | | | | | | | | o Properly use rman(9) to manage resources. This eliminates the need to puc-specific hacks to rman. It also allows devinfo(8) to be used to find out the specific assignment of resources to serial/parallel ports. o Compress the PCI device "database" by optimizing for the common case and to use a procedural interface to handle the exceptions. The procedural interface also generalizes the need to setup the hardware (program chipsets, program clock frequencies). o Eliminate the need for PUC_FASTINTR. Serdev devices are fast by default and non-serdev devices are handled by the bus. o Use the serdev I/F to collect interrupt status and to handle interrupts across ports in priority order. o Sync the PCI device configuration to include devices found in NetBSD and not yet merged to FreeBSD. o Add support for Quatech 2, 4 and 8 port UARTs. o Add support for a couple dozen Timedia serial cards as found in Linux.
* Use bus_setup_intr() rather than invoking BUS_SETUP_INTR() directly so thatjhb2006-02-221-4/+2
| | | | puc still prints out [FAST] on Peter's box.
* Don't enable PUC_FASTINTR by default in the source. Instead, enable itjhb2005-11-211-4/+0
| | | | | | | | | | | via the DEFAULTS kernel configs. This allows folks to turn it that option off in the kernel configs if desired without having to hack the source. This is especially useful since PUC_FASTINTR hangs the kernel boot on my ultra60 which has two uart(4) devices hung off of a puc(4) device. I did not enable PUC_FASTINTR by default on powerpc since powerpc does not currently allow sharing of INTR_FAST with non-INTR_FAST like the other archs.
* Eliminate tinderbox errors.rodrigc2005-11-071-3/+5
|
* Avoid trouble with PUC_FASTINTR if it is already defined.phk2005-11-061-0/+2
|
* Now that fast interrupts can be shared we can use them in puc.phk2005-11-051-0/+1
|
* puc(4) does strange things to resources in order to fool thephk2005-09-281-4/+3
| | | | | | | | | | subdrivers to hook up. It should probably be rewritten to implement a simple bus to which the sub drivers attach using some kind of hint. Until then, provide a couple of crutch functions with big warning signs so it can survive the recent changes to struct resource.
* __RMAN_RESOURCE_VISIBLE not needed.phk2005-09-251-1/+0
|
* - sparc64/fhc/fhc.c:marius2005-03-041-9/+0
| | | | | | | | | | | | | | | | | Change fhc(4) to use IRQ numbers instead of RIDs for allocating the IRQs of children. This works similar to e.g. sbus(4), i.e. add the IRQ resources as fully specified to the resource lists of the children, allocate them like normal. When establishing the interrupt search the interrupt maps of the children for a matching INO to determine which map we need to write the fully specified interrupt number to and to enable the mapping (before the RID was used to indicate which interrupt map to use). - dev/puc/puc.c: Revert rev. 1.38, with the above change fhc(4) no longer needs special treatment for allocating IRQs. Thanks to: joerg for providing access to an E3500
* Add a stopgap allowing puc(4) to allocate IRQs on fhc(4). Given thatmarius2005-02-261-0/+9
| | | | | | | | | | both a scc(4) is under way and fhc(4) will be change to use INOs this shouldn't stay in HEAD for too long but we need a MFC-able solution for FreeBSD 5.4. Discussed with: marcel Tested by: hrs, kris MFC after: 3 days
* fail gracefully rather than using an invalid array index if unablesam2005-02-251-2/+6
| | | | | | | to allocate a bar; it's unclear whether this can happen in practice Noticed by: Coverity Prevent analysis tool Discussed with: marcel
* Revert part of last commit that was unintentionalimp2005-01-111-1/+1
|
* Use the standard FreeBSD licenseimp2005-01-111-13/+13
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Remove duplicate FreeBSD idimp2004-07-011-3/+0
|
* While this file still needs __RMAN_RESOURCE_VISIBLE to get the size ofimp2004-07-011-6/+9
| | | | | the struct resource for a malloc, it no longer needs it for the r_ elements of struct resource with this commit.
* Remove extra RMAN_RESOURCE_VISISBLEimp2004-06-301-1/+0
|
* puc needs to peek into struct resource too.imp2004-06-301-0/+1
|
* This needs __RMAN_RESOURCE_VISIBLEphk2004-06-301-1/+1
|
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-3/+3
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Make the port number available to the sub-device with PUC_IVAR_PORT.marcel2003-09-261-3/+8
|
* Enhance puc(4) to support uart(4). This includes:marcel2003-09-061-69/+80
| | | | | | | | | | | | | | | | | | | | | | | | | o Introduce PUC_PORT_TYPE_UART so that we can attach to uart(4), o Introduce port sub-types (eg PUC_PORT_UART_NS8250, PUC_PORT_UART_Z8530) to handle different hardware and determine resource sizes. o Introduce two new IVARs: PUC_IVAR_SUBTYPE and PUC_IVAR_REGSHFT. Both are used by uart(4) to get sufficient information to talk to the HW. o Introduce PUC_FLAGS_ALTRES to tell puc(4) to try memory mapped I/O if I/O port space cannot be allocated, or vice versa. o Have ports of type PUC_PORT_TYPE_COM attach to uart(1) if attaching to sio(4) fails (due to not having the sio driver). o Put struct puc_device_description in struct puc_softc instead of having a pointer to a device description in the softc. This allows us to create device descriptions on the fly without having to use malloc() or otherwise have them staticly defined. o Move puc_find_description() from puc.c to puc_pci.c as it's specific to PCI. o Add EBUS and SBUS frontends for use on sparc64. Note that the P in puc stands for PCI, so we kinda mess things up here. It's too soon to worry about it though. We'll know what to do about it in time. NOTE: This commit changes the behaviour of puc(4) to not quieten the device probe and attach for child devices. The uart(4) driver provides additional device description that is valuable to have.
* Use __FBSDID().obrien2003-08-241-0/+3
| | | | Also some minor style cleanups.
* Add printer support to puc(4) driver.ambrisko2003-08-011-2/+15
| | | | | | | | | | | - Move isa/ppc* to sys/dev/ppc (repo-copy) - Add an attachment method to ppc for puc - In puc we need to walk the chain of parents. Still to do, is to make ppc(4) & puc(4) work on other platforms. Testers wanted. PR: 38372 (in spirit done differently) Verified by: Make universe (if I messed up a platform please fix)
* Add support for IC Book Ironclad Pro/Lite 8-port cards.sobomax2003-04-301-2/+2
| | | | | Sponsired by: IC Book Labs MFC After: 2 weeks
* - Add minimal support for TI16754 4xUART chip into sio(4) driver and removesobomax2003-03-151-6/+68
| | | | | | | | | | | | now unnecessary hack from the previous commit; - Add support for Interrupt Latch Register (ILR) into puc(4). So far only ILRs compatible with specifications from Digi International are supported. Support for other types of ILRs could be easily added later; - Correct clock frequency for IC Book Labs Dreadnought x16 Lite board; - Enable ILR detection/usage for IC Book Labs Dreadnought x16 boards. Sponsored by: IC Book Labs MFC after: 2 weeks
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* 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.
* MFp4: Add support for memory mapped UARTs, but don't add any devicesmarcel2003-01-181-9/+15
| | | | | | | yet that depend on it because sio(4) needs support for it before it can be used. There's no reason why zs(4) couldn't attach to puc(4) in the (near?) future (in principle), so don't make memory mapped I/O support in sio(4) a precondition for this change.
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* Add a field so we can specify flags per port to the underlying device driver.phk2002-09-271-0/+2
|
* Don't let children attach fast interrupts if the parent interrupt is normal.phk2002-09-041-2/+2
| | | | Submitted by: bde
* Bring back the PUC_FASTINTR option, and implement it correctly so thatphk2002-09-041-2/+12
| | | | | | child devices also know if they are fast or normal. Requested by: bde
* Fix interrupt registration:phk2002-09-031-10/+3
| | | | | | PUC devices live on pccard or pci so INTR_FAST is never really an option. Don't try to register the interrupt as fast and don't allow the children to do so either.
* Style: fix a function whitespace stuff-up. Remove a debugging printf.phk2002-09-031-2/+3
|
* Style: move a global variable up to the top of the file.phk2002-09-031-3/+2
|
* Stylistic fixes for the inclusion of the opt_puc.h header, so it comes from thejmallett2002-09-011-3/+2
| | | | | | | right places, and so it's sorted consistently with how all the other N-hundreds of files ding this do it. Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>
* More cleaning up and unhacking:phk2002-08-311-148/+33
| | | | | | | | | | | | | | | | | | | Don't expect all RIDs to be PCI rids. The previous code made at least 1 mistake, even for PCI. Give the card definitions a chance to specify a init function. Use this instead of the gross superio hack. Move the win877 init function to puc_pci.c where it belongs. RIDs can actually be zero, don't set badmuxed if so. Set a less incorrect end for the construct SYS_RES_IOPORT entries, I guess both sio and lpt happen to use 8 IO ports, but that shouldn't really be hardcoded this way. Fixup puc_pccard.c to match. We're getting closer.
* Don't enable PUC_DEBUG by accidentphk2002-08-311-1/+0
|
OpenPOWER on IntegriCloud