summaryrefslogtreecommitdiffstats
path: root/sys/dev/iicbus
Commit message (Collapse)AuthorAgeFilesLines
* const poisonimp2006-12-053-3/+3
| | | | submitted by: john wehle
* More properly cleanup the iicbus child when deleting it.imp2006-12-051-6/+27
| | | | | | | These are from patches by John Wehle, but the commentary has been updated by me. Obtained from: ports/multimedia/pvr250, indirectly
* Reference Hauppage's cxm_iic bit-bang device here.imp2006-12-051-0/+5
| | | | | | | | Add a note that suggests a cleanup. Note: This patch was derived based on looking at the pvrxxx/pvr250 ports' Makefiles only, and may be incomplete. It is not derived from anything I saw from Hauppage.
* Add a fake flag for write. Many drivers have started to use it and itimp2006-11-281-1/+2
| | | | | | seems like a good idea. Submitted by: sam
* Remove unused leftovers.imp2006-11-281-9/+0
|
* MFp4: Add ixpiic bit-bang driver.imp2006-11-221-0/+1
| | | | Submitted by: sam@
* <blush> copyout on read, not write.imp2006-11-221-2/+2
| | | | Tweak a comment while I'm here.
* o define transfer methodsam2006-11-191-0/+4
| | | | | | o attach ds1672 and ad7418, to be cleaned up MFC after: 1 month
* i2c and clock driver for Dallas Semiconductor DS1672 RTCsam2006-11-191-0/+142
| | | | MFC after: 1 month
* i2c driver for Analog Devices AD7418sam2006-11-191-0/+234
| | | | MFC after: 1 month
* Minor overhaul of SMBus support:jhb2006-09-111-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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)
* jhb points out that these mallocs don't need to be checked becauseimp2006-09-061-16/+0
| | | | of M_WAITOK.
* MFp4: check the return value of malloc and report an error when invalid.imp2006-09-061-0/+16
|
* Minor style(9) treatment to make things a little more consistantimp2006-08-212-20/+33
| | | | within iicbus code.
* Allow iic bridges to support a generalized transfer, rather thanimp2006-07-147-12/+117
| | | | | | | | | forcing all transfers to do the start read/write stop by hand. Some smart bridges prefer this sort of operation, and this allows us to support their features more easily. When bridges don't support it, we fall back to using the old-style opertaions. Expand the ioctl interface to expose this function. Unlike the old-style interface, this interface is thread safe, even on old bridges.
* remove DRIVER_MODULE lines that are useless... pcf doesn't exist (onlyjmg2006-04-171-2/+0
| | | | | | | as pcf_ebus and pcf_isa, they should probably be fixed back to pcf), and bti2c doesn't exist, bktr has smbus or iicbb as children.. Brought to you by: http://people.FreeBSD.org/~jmg/driver.pdf
* newbus will zero softc, so no need to duplicate the zeroing here.imp2006-04-043-13/+1
| | | | Plus a minor formatting nit in nearby code.
* Turn a file that was mostly style(9) compliant to a file that's really closeimp2006-04-041-141/+115
| | | | | to being completely style(9). The odd-ball indentation in a few places was really distracting.
* Replace hard coded '0' with symbolic constant IIC_UNKNOWN to reflect whatimp2006-04-041-1/+1
| | | | we're actually doing.
* Remove public declarations of variables that were forgotten when they wereobrien2005-08-101-2/+0
| | | | made static.
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-5/+7
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* Fix some long standing bugs in writing to the BPF device attached todwmalone2005-06-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | a DLT_NULL interface. In particular: 1) Consistently use type u_int32_t for the header of a DLT_NULL device - it continues to represent the address family as always. 2) In the DLT_NULL case get bpf_movein to store the u_int32_t in a sockaddr rather than in the mbuf, to be consistent with all the DLT types. 3) Consequently fix a bug in bpf_movein/bpfwrite which only permitted packets up to 4 bytes less than the MTU to be written. 4) Fix all DLT_NULL devices to have the code required to allow writing to their bpf devices. 5) Move the code to allow writing to if_lo from if_simloop to looutput, because it only applies to DLT_NULL devices but was being applied to other devices that use if_simloop possibly incorrectly. PR: 82157 Submitted by: Matthew Luckie <mjl@luckie.org.nz> Approved by: re (scottl)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-14/+18
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-062-2/+2
|
* Since if_ic doesn't contain locking or run with INTR_MPSAFE, markrwatson2004-08-131-1/+2
| | | | the interface as IFF_NEEDSGIANT so if_start is run holding Giant.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-6/+6
| | | | Bump __FreeBSD_version accordingly.
* Make "envctrl" a known master driver for iicbus.joerg2004-05-271-0/+1
|
* Another candidate that didn't use copyin/copyout for user<->kerneljoerg2004-05-161-3/+23
| | | | | | transfers. MFC after: 1 month
* After successfully attaching an iicbus instance, instead of using ajoerg2004-05-161-1/+3
| | | | | | | | | NULL name in device_add_child(), explicitly name all of our known child drivers in order to give them a chance to attach to us. Otherwise, only the first one present would be probed and attached. Reviewed by: nsouch MFC after: 1 month
* Convert the #if 0 magic to #if SCAN_IICBUS, and make it actually compilejoerg2004-05-121-3/+10
| | | | | again. While it's not generally recommended anymore, it might still prove useful for debugging purposes.
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | Free approx 86 major numbers with a mostly automatically generated patch. A number of strategic drivers have been left behind by caution, and a few because they still (ab)use their major number.
* o eliminate widespread on-stack mbuf use for bpf by introducingsam2003-12-281-19/+3
| | | | | | | | | | | | | a new bpf_mtap2 routine that does the right thing for an mbuf and a variable-length chunk of data that should be prepended. o while we're sweeping the drivers, use u_int32_t uniformly when when prepending the address family (several places were assuming sizeof(int) was 4) o return M_ASSERTVALID to BPF_MTAP* now that all stack-allocated mbufs have been eliminated; this may better be moved to the bpf routines Reviewed by: arch@ and several others
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-4/+3
| | | | | | | | | | | | | 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)
* Use __FBSDID().obrien2003-08-244-11/+13
| | | | Also some minor style cleanups.
* Don't hardcode unit numer '0'.ticso2003-08-102-2/+2
| | | | We can have multiple instances.
* make iicbb_devclass and iicbb_driver globally visible. This will letjmg2003-06-192-2/+5
| | | | | | | | drivers that implemnt the i2c bit banging bus interface not have to recompile iicbb in order to add an attachment for it. This will mean the bktr and other definitions can go back to their respective drivers.
* Update netisr handling; Each SWI now registers its queue, and all queuejlemon2003-03-041-4/+2
| | | | | | | | | | drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+7
| | | | | | | | | | | | | 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)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* network interface driver changes:sam2002-11-141-3/+2
| | | | | | | | | | | | | | o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
* Fix misindentation.phk2002-10-161-2/+2
| | | | Spotted by: FlexeLint
* move <machine/iic.h> and <machine/smb.h> to <dev/iicbus/iic.h> andpeter2002-09-191-3/+1
| | | | <dev/smbus/smb.h> - there is nothing MD about these ioctl definitions.
* Major rework of the iicbus/smbus framework:nsouch2002-03-238-266/+283
| | | | | | | | - VIA chipset SMBus controllers added - alpm driver updated - Support for dynamic modules added - bktr FreeBSD smbus updated but not tested - cleanup
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-104-8/+8
| | | | also don't use ANSI string concatenation.
* KSE Milestone 2julian2001-09-121-3/+3
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
* Lock down the network interface queues. The queue mutex must be obtainedjlemon2000-11-251-7/+2
| | | | | | | | | | | | | | before adding/removing packets from the queue. Also, the if_obytes and if_omcasts fields should only be manipulated under protection of the mutex. IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on the queue. An IF_LOCK macro is provided, as well as the old (mutex-less) versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which needs them, but their use is discouraged. Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF, which takes care of locking/enqueue, and also statistics updating/start if necessary.
* Remove unneeded #include <sys/proc.h> lines.phk2000-10-291-1/+0
|
OpenPOWER on IntegriCloud