History log of /freebsd-10.0-release/sys/dev/iicbus/ad7418.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 246128 30-Jan-2013 sbz

Use DEVMETHOD_END macro defined in sys/bus.h instead of {0, 0} sentinel on device_method_t arrays

Reviewed by: cognet
Approved by: cognet


# 186833 06-Jan-2009 nwhitehorn

Change the way I2C bus attachment works to allow firmware-assisted bus
subclasses as are available with PCI. Changes I2C device drivers without
real probe logic to return BUS_PROBE_NOWILDWARD to avoid interference with
firmware bus enumeration, and reduces the probe priority of the iicbus
base driver to allow subclass attachment at higher priority.

Discussed on: freebsd-arch


# 181682 13-Aug-2008 ed

Fix compilation of arm's AVILA.

Compilation of the AVILA kernel failed because of two reasons:

- It needed curthread, which is defined through <sys/pcpu.h>.

- It still referred the softc's sc_mtx field, which has been replaced by
sc_lock three weeks ago.

To solve the first problem, I decided to include <sys/pcpu.h> in
<sys/sx.h>, which also seems to be done by <sys/mutex.h> and
<sys/rwlock.h>. Those header files also require curthread.

Approved by: jhb


# 181305 04-Aug-2008 jhb

Lock the consumers of the iicbus(4) infrastructure:
- ad7418(4) uses an sx lock instead of a mtx since the iicbus(4) stuff it
calls can sleep (request_bus()). Also, I expanded the locking slightly
to serialize writes to data stored in the softc.
- Similarly, the icee(4) driver now uses an sx lock instead of a mutex.
I also removed the pointless OPENED flag and flags field from the softc.
- The locking for the ic(4) driver was a bit trickier:
- Add a mutex to the softc to protect softc data.
- The driver uses malloc'd buffers that are the size of the interface
MTU to send and receive packets. Previously, these were allocated
every time the interface was brought up and anytime the MTU was
changed, with various races that could result in memory leaks. I
changed this to be a bit simpler and more like other NIC drivers in
that we allocate buffers during attach for the default MTU size and
only reallocate them on MTU changes. The reallocation procedure
goes to some lengths with various flags to not replace either the
the receive or transmit buffers while the driver is busy receiving
or transmitting a packet.
- Store the device_t of the driver in the softc instead of detours into
new-bus using if_dunit from the ifnet and an even more bizarre detour
to get the softc instead of using if_softc.
- Drop the driver mutex when invoking netisr_dispatch() to pass the
packet up to IP.
- Use if_printf().


# 164419 19-Nov-2006 sam

i2c driver for Analog Devices AD7418

MFC after: 1 month