Deleted Added
full compact
ipmi_ssif.c (167086) ipmi_ssif.c (172836)
1/*-
2 * Copyright (c) 2006 IronPort Systems Inc. <ambrisko@ironport.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 IronPort Systems Inc. <ambrisko@ironport.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/ipmi/ipmi_ssif.c 167086 2007-02-27 17:23:29Z jhb $");
28__FBSDID("$FreeBSD: head/sys/dev/ipmi/ipmi_ssif.c 172836 2007-10-20 23:23:23Z julian $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/condvar.h>
34#include <sys/eventhandler.h>
35#include <sys/kernel.h>
36#include <sys/kthread.h>

--- 306 unchanged lines hidden (view full) ---

343 IPMI_UNLOCK(sc);
344
345 /* Enforce 10ms between requests. */
346 pause("delay", hz / 100);
347
348 IPMI_LOCK(sc);
349 }
350 IPMI_UNLOCK(sc);
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/condvar.h>
34#include <sys/eventhandler.h>
35#include <sys/kernel.h>
36#include <sys/kthread.h>

--- 306 unchanged lines hidden (view full) ---

343 IPMI_UNLOCK(sc);
344
345 /* Enforce 10ms between requests. */
346 pause("delay", hz / 100);
347
348 IPMI_LOCK(sc);
349 }
350 IPMI_UNLOCK(sc);
351 kthread_exit(0);
351 kproc_exit(0);
352}
353
354static int
355ssif_startup(struct ipmi_softc *sc)
356{
357
352}
353
354static int
355ssif_startup(struct ipmi_softc *sc)
356{
357
358 return (kthread_create(ssif_loop, sc, &sc->ipmi_kthread, 0, 0,
358 return (kproc_create(ssif_loop, sc, &sc->ipmi_kthread, 0, 0,
359 "%s: ssif", device_get_nameunit(sc->ipmi_dev)));
360}
361
362int
363ipmi_ssif_attach(struct ipmi_softc *sc, device_t smbus, int smbus_address)
364{
365
366 /* Setup smbus address. */
367 sc->ipmi_ssif_smbus = smbus;
368 sc->ipmi_ssif_smbus_address = smbus_address;
369
370 /* Setup function pointers. */
371 sc->ipmi_startup = ssif_startup;
372 sc->ipmi_enqueue_request = ipmi_polled_enqueue_request;
373
374 return (0);
375}
359 "%s: ssif", device_get_nameunit(sc->ipmi_dev)));
360}
361
362int
363ipmi_ssif_attach(struct ipmi_softc *sc, device_t smbus, int smbus_address)
364{
365
366 /* Setup smbus address. */
367 sc->ipmi_ssif_smbus = smbus;
368 sc->ipmi_ssif_smbus_address = smbus_address;
369
370 /* Setup function pointers. */
371 sc->ipmi_startup = ssif_startup;
372 sc->ipmi_enqueue_request = ipmi_polled_enqueue_request;
373
374 return (0);
375}