aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
Commit message (Collapse)AuthorAgeFilesLines
* Fix yet another cut-and-paste bug.Maksim Yevmenkin2005-05-201-1/+1
| | | | | | | kbd was allocated from M_VKBD not from M_DEVBUF Notes: svn path=/head/; revision=146460
* Recognize the integrated (though not necessarily enabled) FireWireMarius Strobl2005-05-202-0/+14
| | | | | | | | | | | | | | | | | | controllers of Sun PCIO-2 chips which are used onboard in most of the newer PCI-based sun4u machines (cosmetic change as they were also already probed as generic FWOHCI without this). As with gem(4), hme(4) and ohci(4) detect whether their intpin register is valid and correct it if necessary, i.e. set the respective IVAR to the right value for allocating the IRQ resource, as some of them come up having it set to 0 (in fact in all machines I'm currently aware of the FireWire part being enabled). This fixes attaching affected controllers. Apporved by: simokawa Tested by: Michiel Boland <michiel@boland.org> MFC after: 1 month Notes: svn path=/head/; revision=146439
* If devclass_get_devices() returns success but a count of 0, free theNate Lawson2005-05-201-1/+4
| | | | | | | | | | | | pointer. If kernel malloc(0) returns a valid pointer, it needs to be freed. If it returns NULL, it's ok to free this also. Submitted by: pjd Reviewed by: imp, dfr Obtained from: Coverity Prevent Notes: svn path=/head/; revision=146431
* Deal with a few bootstrap issues:Bill Paul2005-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't call KeFlushQueuedDpcs() during bootstrap (cold == 1), since the flush operation sleeps to wait for completion, and we can't sleep here (clowns will eat us). On an i386 SMP system, if we're loaded/probed/attached during bootstrap, smp_rendezvous() won't run us anywhere except CPU 0 (since the other CPUs aren't launched until later), which means we won't be able to set up the GDTs anywhere except CPU 0. To deal with this case, ctxsw_utow() now checks to see if the TID for the current processor has been properly initialized and sets up the GTD for the current CPU if not. Lastly, in if_ndis.c:ndis_shutdown(), do an ndis_stop() to insure we really halt the NIC and stop interrupts from happening. Note that loading a driver during bootstrap is, unfortunately, kind of a hit or miss sort of proposition. In Windows, the expectation is that by the time a given driver's MiniportInitialize() method is called, the system is already in 'multiuser' state, i.e. it's up and running enough to support all the stuff specified in the NDIS API, which includes the underlying OS-supplied facilities it implicitly depends on, such as having all CPUs running, having the DPC queues initialized, WorkItem threads running, etc. But in UNIX, a lot of that stuff won't work during bootstrap. This causes a problem since we need to call MiniportInitialize() at least once during ndis_attach() in order to find out what kind of NIC we have and learn its station address. What this means is that some cards just plain won't work right if you try to pre-load the driver along with the kernel: they'll only be probed/attach correctly if the driver is kldloaded _after_ the system has reached multiuser. I can't really think of a way around this that would still preserve the ability to use an NDIS device for diskless booting. Notes: svn path=/head/; revision=146427
* In ndis_halt_nic(), invalidate the miniportadapterctx early to try andBill Paul2005-05-201-2/+0
| | | | | | | | | | | | prevent anything from making calls to the NIC while it's being shut down. This is yet another attempt to stop things like mdnsd from trying to poke at the card while it's not properly initialized and panicking the system. Also, remove unneeded debug message from if_ndis.c. Notes: svn path=/head/; revision=146424
* Recognize the integrated USB controllers of Sun PCIO-2 chips whichMarius Strobl2005-05-191-0/+14
| | | | | | | | | | | | | | | | | | | | | | | are used onboard in most of the newer PCI-based sun4u machines (cosmetic change as they were also already probed as generic OHCI without this). Detect whether their intpin register is valid and correct it if necessary, i.e. set the respective IVAR to the right value for allocating the IRQ resource, as some of them come up having it set to 0 (mainly those used in Blade 100 and the first one on AX1105 boards). This fixes attaching affected controllers. Correcting the intpin value might be better off in the PCI code via a quirk table but on the other hand gem(4) and hem(4) also correct it themselves and at least for the USB controller part the intpin register is truely hardwired to 0 and can't be changed. This means that we would have to hook up the quirk information in a lot of places in the PCI code (i.e. whenever the value of the intpin register is read from or written to the pci_devinfo of the respective device) in order to do it the right way. MFC after: 1 month Notes: svn path=/head/; revision=146420
* o mc146818(4):Marius Strobl2005-05-192-17/+31
| | | | | | | | | | | | | | | | | | | - Add locking. - Account for if the MC146818_NO_CENT_ADJUST flag is set we don't need to check wheter year < POSIX_BASE_YEAR. - Add some comments about mapping the day of week from the range the generic clock code uses to the range the chip uses and which I meant to add in the initial version. - Minor clean-up, use __func__ instead of hardcoded function names in error strings. o in the rtc(4) front-end additionally: - Don't leak resources in case mc146818_attach() fails. - Account for ebus(4) defaulting to SYS_RES_MEMORY for the memory resources since ebus.c rev. 1.22. Notes: svn path=/head/; revision=146417
* - Add locking.Marius Strobl2005-05-193-41/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add support for storing the century in MK48TXX_WDAY_CB on MK48Txx with extended registers when the MK48TXX_NO_CENT_ADJUST flag is set (and which is termed somewhat confusing as it actually means don't manually adjust the century in the driver). - Add the MI part of interfacing the watchdog functionality of MK48Txx with extended registers with watchdog(9). This is inspired by the SunOS/Solaris drivers for the 'eeprom' devices also having watchdog support. I actually expected this to work out of the box on Sun Exx00 machines with 'eeprom' devices which have a 'watchdog-enable' property. On terminal count of the the watchdog timer however only the MK48TXX_FLAGS_WDF bit rises but the reset signal and the interrupt respectively (depending on whether the MK48TXX_WDOG_WDS bit of the chip and the MK48TXX_WDOG_ENABLE_WDS flag of the driver respectively is set) goes nowhere. Apparently passing the reset signal on to the WDR line of the CPUs has to be enabled somewhere else but we don't have documentation for the Exx00 specific controllers. I decided to commit this nevertheless so it can be enabled in the eeprom(4) front-end later in e.g. 6.0-STABLE without breaking the API. Besides the Exx00 the watchdog part of the MK48Txx should also work on E250 and E450. Possibly also without extra fiddling on these machines but I haven't found someone willing to give it a try on such a machine so far. - Use uintXX_t instead of u_intXX_t, use __func__ instead of hardcoded function names in error strings. Notes: svn path=/head/; revision=146416
* Support the 5714CPaul Saab2005-05-194-0/+20
| | | | | | | Submitted by: John Cagle <john dot cagle at hp dot com> Notes: svn path=/head/; revision=146413
* Take advantage of ebus(4) having switched to SYS_RES_MEMORY for theMarius Strobl2005-05-191-5/+2
| | | | | | | | | | memory resources in ebus.c rev. 1.22 and treat both the EBus and SBus variants alike in this regard. Ok'ed by: yongari Notes: svn path=/head/; revision=146410
* Sync with openfirm(4) and check the return value of malloc() althoughMarius Strobl2005-05-191-2/+15
| | | | | | | this isn't exactly necessary with M_WAITOK. Notes: svn path=/head/; revision=146401
* Update the names of some member variables in comments to refect reality.Marius Strobl2005-05-191-2/+2
| | | | | | | | Apparently this was forgotten when this code was derived from the BSD openprom(4). Notes: svn path=/head/; revision=146400
* - Try to not leak resources in the attach functions of the esp(4) SBusMarius Strobl2005-05-194-127/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | front-end and the LSI64854 and NCR53C9x code in case one of these functions fails. Add detach functions to these parts and make esp(4) detachable. - Revert rev. 1.7 of esp_sbus.c, since rev. 1.34 of sbus.c the clockfreq IVAR defaults to the per-child values. - Merge ncr53c9x.c rev. 1.111 from NetBSD (partial): On reset, clear state flags and the msgout queue. In NetBSD code to notify the upper layer (i.e. CAM in FreeBSD) on reset was also added with this revision. This is believed to be not necessary in FreeBSD and was not merged. This makes ncr53c9x.c to be in sync with NetBSD up to rev. 1.114. - Conditionalize the LSI64854 support on sbus(4) only instead of sbus(4) and esp(4) as it's also required for the 'dma', 'espdma' and 'ledma' busses/devices as well as the 'SUNW,bpp' device (printer port) which all hang off of sbus(4). - Add a driver for the 'dma', 'espdma' and 'ledma' (pseudo-)busses/ devices. These busses and devices actually represent the LSI64854 DMA engines for the ESP SCSI and LANCE Ethernet controllers found on the SBus of Ultra 1 and SBus add-on cards. With 'espdma' and 'ledma' the 'esp' and 'le' devices hang off of the respective DMA bus instead of directly from the SBus. The 'dma' devices are either also used in this manner or on some add-on cards also as a companion device to an 'esp' device which also hangs off directly from the SBus. With the latter variant it's a bit tricky to glue the DMA engine to the core logic of the respective 'esp' device. With rev. 1.35 of sbus.c we are however guaranteed that such a 'dma' device is probed before the respective 'esp' device which simplifies things a lot. [1] - In the esp(4) SBus front-end read the part-unique ID code of Fast-SCSI capable chips the right way. This fixes erroneously detecting some chips as FAS366 when in fact they are not. Add explicit checks for the FAS100A, FAS216 and FAS236 variants instead treating all of these as ESP200. That way we can correctly set the respective Fast-SCSI config bits instead of driving them out of specs. This includes adding the FAS100A and FAS236 variants to the NCR53C9x core code. We probably still subsume some chip variants as ESP200 while in fact they are another variant which however shouldn't really matter as this will only happen when these chips are driven at 25MHz or less which implies not being able to run Fast-SCSI. [3] - Add a workaround to the NCR53C9x interrupt handler which ignores the stray interrupt generated by FAS100A when doing path inquiry during boot and which otherwiese would trigger a panic. - Add support for the 'esp' devices hanging off of a 'dma' or 'espdma' busses or which are companions of 'dma' devices to esp(4). In case of the variants that hang off of a DMA device this is a bit hackish as esp(4) then directly uses the softc of the respective parent to talk to the DMA engine. It might make sense to add an interface for this in order to implement this in a cleaner way however it's not yet clear how the requirements for the LANCE Ethernet controllers are and the hack works for now. [2] This effectively adds support for the onboard SCSI controller in Ultra 1 as well as most of the ESP-based SBus add-on cards to esp(4). With this the code for supporting the Performance Technologies SBS430 SBus SCSI add-on cards is also largely in place the remaining bits were however omitted as it's unclear from the NetBSD how to couple the DMA engine and the core logic together for these cards. Obtained from: OpenBSD [1] Obtained from: NetBSD [2] Clue from: BSD/OS [3] Reviewed by: scottl (earlier version) Tested with: FSBE/S add-on card (FAS236), SSHA add-on card (ESP100A), Ultra 1 (onboard FAS100A), Ultra 2 (onboard FAS366) Notes: svn path=/head/; revision=146392
* Use General definition for general notify.Takanori Watanabe2005-05-191-4/+2
| | | | Notes: svn path=/head/; revision=146373
* Convert to the faster bus_dmamap_load_mbuf_sg() interface.Alan Cox2005-05-182-34/+16
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=146339
* Support passthru ioctl commands from 32bit binaries.Paul Saab2005-05-182-1/+30
| | | | Notes: svn path=/head/; revision=146337
* Make certain the the 48bit flag is reset if we dont translate LBA.Søren Schmidt2005-05-171-2/+2
| | | | Notes: svn path=/head/; revision=146318
* Dont clear all flags in vkbd_clear_state_locked(). Clear only COMPOSE flag.Maksim Yevmenkin2005-05-161-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=146289
* Correct type for workitem routines.Bill Paul2005-05-161-3/+3
| | | | Notes: svn path=/head/; revision=146279
* longer used (contents added to sys/ata.h)Søren Schmidt2005-05-161-130/+0
| | | | Notes: svn path=/head/; revision=146268
* Change the way ioctls are issue to ATA.Søren Schmidt2005-05-1611-414/+387
| | | | | | | | | The most prominent part is that its now possible to issue ata_requests directly to say acd0, instead of going through the cumbersome /dev/ata device. Notes: svn path=/head/; revision=146266
* Add convenience functions to get port and interface.Warner Losh2005-05-161-0/+15
| | | | Notes: svn path=/head/; revision=146258
* Print a warning once when trying to bring up interface before firmware load.Warner Losh2005-05-152-0/+4
| | | | Notes: svn path=/head/; revision=146247
* Remove old epson note support.Yoshihiro Takahashi2005-05-151-21/+2
| | | | Notes: svn path=/head/; revision=146240
* - Add color tables for 16 colors mode and 8 colors mode, use a differentYoshihiro Takahashi2005-05-151-27/+16
| | | | | | | | table on the pc98 console. - Remove old epson note support. Notes: svn path=/head/; revision=146239
* - Mask an underline attribute on the pc98 console. It enables to use the sameYoshihiro Takahashi2005-05-151-49/+28
| | | | | | | | color on the pc98 and the others. - Remove old epson note support. Notes: svn path=/head/; revision=146238
* Remove the ADJUST_CLOCK ioctl on pc98. It's not used at all.Yoshihiro Takahashi2005-05-151-6/+0
| | | | Notes: svn path=/head/; revision=146235
* Add support for NdisMEthIndicateReceive() and MiniportTransferData().Bill Paul2005-05-152-0/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ralink RT2500 driver uses this API instead of NdisMIndicateReceivePacket(). Drivers use NdisMEthIndicateReceive() when they know they support 802.3 media and expect to hand their packets only protocols that want to deal with that particular media type. With this API, the driver does not manage its own NDIS_PACKET/NDIS_BUFFER structures. Instead, it lets bound protocols have a peek at the data, and then they supply an NDIS_PACKET/NDIS_BUFFER combo to the miniport driver, into which it copies the packet data. Drivers use NdisMIndicateReceivePacket() to allow their packets to be read by any protocol, not just those bound to 802.3 media devices. To make this work, we need an internal pool of NDIS_PACKETS for receives. Currently, we check to see if the driver exports a MiniportTransferData() method in its characteristics structure, and only allocate the pool for drivers that have this method. This should allow the RT2500 driver to work correctly, though I still have to fix ndiscvt(8) to parse its .inf file properly. Also, change kern_ndis.c:ndis_halt_nic() to reap timers before acquiring NDIS_LOCK(), since the reaping process might entail sleeping briefly (and we can't sleep with a lock held). Notes: svn path=/head/; revision=146230
* Fix my copyright.Yoshihiro Takahashi2005-05-141-1/+1
| | | | Notes: svn path=/head/; revision=146216
* cosmetic change.Yoshihiro Takahashi2005-05-141-1/+1
| | | | Notes: svn path=/head/; revision=146215
* - Move bus dependent defines to {isa,cbus}_dmareg.h.Yoshihiro Takahashi2005-05-141-23/+0
| | | | | | | | | - Use isa/isareg.h rather than <arch>/isa/isa.h. Tested on: i386, pc98 Notes: svn path=/head/; revision=146214
* - Move timerreg.h to <arch>/include and split i8253 specific defines intoYoshihiro Takahashi2005-05-142-35/+85
| | | | | | | | | | | | i8253reg.h, and add some defines to control a speaker. - Move PPI related defines from i386/isa/spkr.c into ppireg.h and use them. - Move IO_{PPI,TIMER} defines into ppireg.h and timerreg.h respectively. - Use isa/isareg.h rather than <arch>/isa/isa.h. Tested on: i386, pc98 Notes: svn path=/head/; revision=146211
* Cleanup commentsSøren Schmidt2005-05-135-22/+11
| | | | Notes: svn path=/head/; revision=146178
* Fix more ATAPI breakage.Søren Schmidt2005-05-131-3/+9
| | | | | | | Apparently some devices are very picky on details :) Notes: svn path=/head/; revision=146176
* If there is a problem during probe, be sure to free up any resourcesNate Lawson2005-05-121-2/+2
| | | | | | | | | | | allocated for it. The normal exit case handles this correctly so we use it as well for errors. Submitted by: pjd Obtained from: Coverity Prevent Notes: svn path=/head/; revision=146166
* Move the pc98 keymap define into pckbdtables.h because it should be usedYoshihiro Takahashi2005-05-121-142/+0
| | | | | | | only on the pckbd driver. Notes: svn path=/head/; revision=146138
* Plug a potential memory leak.Alexander Kabaev2005-05-111-1/+3
| | | | | | | Noticed by: Coverity Prevent analysis tool. Notes: svn path=/head/; revision=146114
* Add new Intel PCI ID's for the ICH7 chips (untested).Søren Schmidt2005-05-112-2/+13
| | | | Notes: svn path=/head/; revision=146112
* Add support for AHCI compliant ATA devices.Søren Schmidt2005-05-112-14/+463
| | | | | | | | | For now just support the Intel ICH6 as that the HW at hand. Sponsored by: pair.com Notes: svn path=/head/; revision=146106
* Take out Giant in uhub_child_* in giant. There's one place where weWarner Losh2005-05-111-9/+16
| | | | | | | | | | could sleep which I think can lead to races. However, there are fewer with this code than without it. Submitted by: Hans Petter Selasky Notes: svn path=/head/; revision=146101
* Add back one line that got deleted in the last commit.Søren Schmidt2005-05-111-2/+4
| | | | | | | | | Change the comment there so it better describes whats going on. This should fix the boot problems of late. Notes: svn path=/head/; revision=146100
* Fix ATAPI DMA. We need to set the proper flags for DMA modes.Søren Schmidt2005-05-111-1/+3
| | | | Notes: svn path=/head/; revision=146096
* Fix some incorrectly swapped fields in an ICB.Matt Jacob2005-05-112-17/+37
| | | | | | | | | Access a PCI register with correct width. Obtained from: Dmitry Valeryevich Trikoz Notes: svn path=/head/; revision=146080
* Refactor isp_prt declaration so that platformMatt Jacob2005-05-112-5/+9
| | | | | | | requirements can stay in platform files. Notes: svn path=/head/; revision=146073
* Change a directory layout for pc98.Yoshihiro Takahashi2005-05-103-3/+3
| | | | | | | | | | | | - Move MD files into <arch>/<arch>. - Move bus dependent files into <arch>/<bus>. Rename some files to more suitable names. Repo-copied by: peter Discussed with: imp Notes: svn path=/head/; revision=146049
* Sync with Linux acpi4asus, adding support for loads of new models.Philip Paeps2005-05-091-13/+144
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=146024
* Add support for Asus V6V[1] and W1N notebooks.Philip Paeps2005-05-091-0/+41
| | | | | | | | Submitted by: Jean-Sébastien Pédron <jspedron@club-internet.fr> [1] MFC after: 3 days Notes: svn path=/head/; revision=146022
* Simplify the ACPI taskqueue implementation. Use a thread queue type insteadMark Santcroos2005-05-093-113/+38
| | | | | | | | | | | of swi. This allows us to use the taskqueue_thread_* functions instead of rolling our own. It also avoids a double trip through the queue. Submitted by: njl Reviewed by: sam Notes: svn path=/head/; revision=146021
* Move if_wl_i82586.h into sys/dev/wl.Yoshihiro Takahashi2005-05-092-1/+267
| | | | Notes: svn path=/head/; revision=146019
* More fixes for multibus drivers. When calling out to the matchBill Paul2005-05-082-4/+14
| | | | | | | | function in if_ndis_pci.c and if_ndis_pccard.c, provide the bustype too so the stubs can ignore devlists that don't concern them. Notes: svn path=/head/; revision=146016