summaryrefslogtreecommitdiffstats
path: root/sys/dev/bktr
Commit message (Collapse)AuthorAgeFilesLines
* MFC r258779,r258780,r258787,r258822:eadler2014-02-041-1/+1
| | | | | | | | | | | | | Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this shifts into the sign bit. Instead use (1U << 31) which gets the expected result. Similar to the (1 << 31) case it is not defined to do (2 << 30). This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD.
* Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCIscottl2013-08-121-4/+1
| | | | | | | | | | | | | | | | | command register. The lazy BAR allocation code in FreeBSD sometimes disables this bit when it detects a range conflict, and will re-enable it on demand when a driver allocates the BAR. Thus, the bit is no longer a reliable indication of capability, and should not be checked. This results in the elimination of a lot of code from drivers, and also gives the opportunity to simplify a lot of drivers to use a helper API to set the busmaster enable bit. This changes fixes some recent reports of disk controllers and their associated drives/enclosures disappearing during boot. Submitted by: jhb Reviewed by: jfv, marius, achadd, achim MFC after: 1 day
* Replace kernel virtual address space allocation with vmem. This providesjeff2013-08-071-2/+5
| | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
* Pass a format string to kproc_create() [1] and thus fix the build withpluknet2013-04-301-10/+1
| | | | | | | | | -DBKTR_NEW_MSP34XX_DRIVER and -Wformat-security. This also allows to eliminates a superfluous malloc/snprintf/free on intermediate buffer. PR: kern/175546 MFC after: 1 week
* Fix white spaces.jkim2013-04-231-1/+1
|
* Make temp, temp1 the same type that they will later be used for.eadler2013-04-231-1/+1
| | | | | | | PR: kern/176712 Submitted by: Hiren Panchasara <hiren.panchasara@gmail.com> Reviewed by: jmg (earlier version) Approved by: cperciva (mentor)
* - Corrrect mispellings of word usefulgabor2013-04-172-2/+2
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
* Clean some 'svn:executable' properties in the tree.pfg2013-01-261-0/+0
| | | | | Submitted by: Christoph Mallon MFC after: 3 days
* Fix typo; s/ouput/outputkevlo2012-11-071-1/+1
|
* Revert previous commit...kevlo2012-10-101-1/+1
| | | | Pointyhat to: kevlo (myself)
* Prefer NULL over 0 for pointerskevlo2012-10-091-1/+1
|
* Remove a few bits of FreeBSD 2.x compatibility code.rmh2011-11-141-4/+0
| | | | Approved by: kib (mentor)
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+1
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* In order to maximize the re-usability of kernel code in user space thiskmacy2011-09-161-1/+1
| | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
* Fix typos - remove duplicate "the".brucec2011-02-211-1/+1
| | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days
* Fix build on architectures where PAGE_SIZE is a long (sparc64, powerpc).nwhitehorn2010-07-131-4/+3
|
* Use standard types in preference to BSD types so that these header filesgibbs2010-03-282-20/+20
| | | | | | can be used in applications compiled with only POSIX types visible. MFC after: 2 weeks
* Remove extraneous semicolons, no functional changes.mbr2010-01-071-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
* Update d_mmap() to accept vm_ooffset_t and vm_memattr_t.rnoland2009-12-291-1/+2
| | | | | | | | | | | | | This replaces d_mmap() with the d_mmap2() implementation and also changes the type of offset to vm_ooffset_t. Purge d_mmap2(). All driver modules will need to be rebuilt since D_VERSION is also bumped. Reviewed by: jhb@ MFC after: Not in this lifetime...
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-9/+2
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* Unbreak bktr(4).ed2009-05-261-1/+1
|
* Free the memory correctly in the error casebenjsc2009-05-261-1/+1
| | | | | | Submitted by: frtzkatz at yahoo.com Approved by: sam MFC after: 1 month
* Replace all calls to minor() with dev2unit().ed2008-09-271-14/+14
| | | | | | | | | | | | | | | After I removed all the unit2minor()/minor2unit() calls from the kernel yesterday, I realised calling minor() everywhere is quite confusing. Character devices now only have the ability to store a unit number, not a minor number. Remove the confusion by using dev2unit() everywhere. This commit could also be considered as a bug fix. A lot of drivers call minor(), while they should actually be calling dev2unit(). In -CURRENT this isn't a problem, but it turns out we never had any problem reports related to that issue in the past. I suspect not many people connect more than 256 pieces of the same hardware. Reviewed by: kib
* Add locking to the various iicbus(4) bridge drivers:jhb2008-08-041-0/+1
| | | | | | | | | | | | | | | | | | | | | - Just grab Giant in the ixp425_iic(4) driver since this driver uses a shared address/data register window pair to access the actual I2C registers. None of the other ixp425 drivers lock access to these shared address/data registers yet and that would need to be done before this could use any meaningful locking. - Add locking to the interrupt handler and 'iicbus_reset' methods of the at91_twi(4) driver. - Add locking to the pcf(4) driver. Other pcf(4) fixes include: - Don't needlessly zero the softc. - Use bus_foo rather than bus_space_foo and remove bus space tag and handle from softc. - The lpbb(4) driver just grabs Giant for now. This will be refined later when ppbus(4) is locked. - As was done with smbus earlier, move the DRIVER_MODULE() lines to match the bus driver (either iicbus or iicbb) to the bridge driver into the bridge drivers. Tested by: sam (arm/ixp425)
* Explicitly lock Giant in smbus_if methods in the bktr_i2c and iicsmbjhb2008-06-061-1/+26
| | | | | drivers for now. This can be replaced with driver locks when these drivers are locked.
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-4/+4
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | 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@
* remove delays that have been unnecessary since 2002... The iicbb driverjmg2006-12-311-7/+0
| | | | has the proper delays...
* Update prototype for smbus callback change.jhb2006-09-181-1/+1
| | | | Reported by: Ian FREISLICH <if at hetzner dot co dot za>
* Minor overhaul of SMBus support:jhb2006-09-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Change smbus_callback() to pass a void * rather than caddr_t. - Change smbus_bread() to pass a pointer to the count and have it be an in/out parameter. The input is the size of the buffer (same as before), but on return it will contain the actual amount of data read back from the bus. Note that this value may be larger than the input value. It is up to the caller to treat this as an error if desired. - Change the SMB_BREAD ioctl to write out the updated struct smbcmd which will contain the actual number of bytes read in the 'count' field. To preserve the previous ABI, the old ioctl value is mapped to SMB_OLD_BREAD which doesn't copy the updated smbcmd back out to userland. I doubt anyone actually used the old BREAD anyway as it was rediculous to do a bulk-read but not tell the using program how much data was actually read. - Make the smbus driver and devclass public in the smbus module and push all the DRIVER_MODULE()'s for attaching the smbus driver to various foosmb drivers out into the foosmb modules. This makes all the foosmb logic centralized and allows new foosmb modules to be self-contained w/o having to hack smbus.c everytime a new smbus driver is added. - Add a new SMB_EINVAL error bit and use it in place of EINVAL to return an error for bad arguments (such as invalid counts for bread and bwrite). - Map SMB bus error bits to EIO in smbus_error(). - Make the smbus driver call bus_generic_probe() and require child drivers such as smb(4) to create device_t's via identify routines. Previously, smbus just created one anonymous device during attach, and if you had multiple drivers that could attach it was just random chance as to which driver got to probe for the sole device_t first. - Add a mutex to the smbus(4) softc and use it in place of dummy splhigh() to protect the 'owner' field and perform necessary synchronization for smbus_request_bus() and smbus_release_bus(). - Change the bread() and bwrite() methods of alpm(4), amdpm(4), and viapm(4) to only perform a single transaction and not try to use a loop of multiple transactions for a large request. The framing and commands to use for a large transaction depend on the upper-layer protocol (such as SSIF for IPMI over SMBus) from what I can tell, and the smb(4) driver never allowed bulk read/writes of more than 32-bytes anyway. The other smb drivers only performed single transactions. - Fix buffer overflows in the bread() methods of ichsmb(4), alpm(4), amdpm(4), amdsmb(4), intpm(4), and nfsmb(4). - Use SMB_xxx errors in viapm(4). - Destroy ichsmb(4)'s mutex after bus_generic_detach() to avoid problems from child devices making smb upcalls that would use the mutex during their detach methods. MFC after: 1 week Reviewed by: jmg (mostly)
* Commit the results of the typo hunt by Darren Pilgrim.yar2006-08-041-1/+1
| | | | | | | | | | This change affects documentation and comments only, no real code involved. PR: misc/101245 Submitted by: Darren Pilgrim <darren pilgrim bitfreak org> Tested by: md5(1) MFC after: 1 week
* Housekeeping. Update for maintainers who have handed in their commit bitsmarkm2006-07-011-5/+0
| | | | or (in my case) no longer feel that oversight is necessary.
* don't require a buffer if all we are doing is manipulating the GPIO pins...jmg2006-05-261-0/+9
| | | | MFC after: 3 weeks
* if we are compiling with smbus support, properly depend upon the iic andjmg2006-01-271-0/+7
| | | | | | smbus modules, otherwise as a module you can't kldload bktr... MFC after: 3 days
* Fix -Wundef from compiling the amd64 LINT.ru2005-12-042-3/+3
|
* Add some cards:netchild2005-11-134-5/+67
| | | | | | | | | | | | | | - several TerraTec TValue [1] - PixelView PlayTV Pro REV-4C [2] In case you have the PixelView card, please tell us the "pciconf -v -l" output on multimedia@FreeBSD.org if it works. There are revisions out there which may not work and we need to know which ones work. PR: 53383 [1], 76002 [2] Submitted by: Tanja Wittke <tawi@gruft.de> [1], barner [1], Dan Angelescu <mrhsaacdoh@yahoo.com> [2] MFC after: 2 months
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-296-6/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Don't set the tuner type to TUNER_MT2032 if BKTR_OVERRIDE_TUNER is defined orcognet2005-05-241-1/+4
| | | | if hw.bt848.tuner has been set, so that we can force the tuner.
* Fix one more misuse of u_long when uint32_t is actually meant.cognet2005-05-241-1/+1
| | | | | Submitted by: oliver MFC after: 3 days
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-4/+4
|
* Remove lots of tab/space errors introduced by massive cut-n-paste action.julian2005-02-101-234/+234
| | | | | Noticed from: diffs of the last commit. MFC after: 1 week
* Take into account that Pinnacle screwed up their PCI ID in the beginning..julian2005-02-101-4/+5
| | | | | | | | | Older cards have it reversed. Also, use some already defined values instead of magic numbers. PR: 73324 Submitted by: arne_woerner@yahoo.com MFC after: 1 week
* Fix a few printf problems on ia64 (and other 64-bit platforms).imp2005-01-271-4/+4
|
* Add code to do better auto detection of tuner types etc.julian2005-01-233-53/+51
| | | | | | PR: kern/75831 Submitted by: Branko Lankester <branko@euro.net> MFC after: 1 week
* Use uint32_t instead of u_long when appropriate.cognet2005-01-091-64/+64
| | | | | | That's enough to make my bt848 work on amd64. MFC after: 1 week
* Remove support for FreeBSD < 4.recent from this driver.imp2005-01-087-35/+1
|
* Remove vnode.h and adjust includes to compensate for pollution.imp2005-01-085-6/+13
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-069-9/+9
|
* Add support for the Pixelview PlayTVjulian2005-01-022-1/+14
| | | | | | PR: 68362 Submitted by: Carl Makin <carl@stagecraft.cx> MFC after: 1 week
OpenPOWER on IntegriCloud