Hello sir,
Here we are forewording the source code for that we have to make modification
in the command IPMI_REGISTER-FOR_CMD .This is uniplemented command so we want
to iplement it and want to print a message like IPMI REGISTER FOR CMD has
been called.
Thank U and Regards
Dhananjaya Hiremath
-
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar./*-
* Copyright (c) 2006 IronPort Systems Inc. [EMAIL PROTECTED]
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
*notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
*notice, this list of conditions and the following disclaimer in the
*documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include sys/cdefs.h
__FBSDID($FreeBSD: src/sys/dev/ipmi/ipmi.c,v 1.5 2006/09/26 15:48:13 jhb Exp
$);
#include sys/param.h
#include sys/systm.h
#include sys/bus.h
#include sys/condvar.h
#include sys/conf.h
#include sys/kernel.h
#include sys/malloc.h
#include sys/module.h
#include sys/poll.h
#include sys/rman.h
#include sys/selinfo.h
#include sys/sysctl.h
#include sys/watchdog.h
#ifdef LOCAL_MODULE
#include ipmi.h
#include ipmivars.h
#else
#include sys/ipmi.h
#include dev/ipmi/ipmivars.h
#endif
#ifdef IPMB
static int ipmi_ipmb_checksum(u_char, int);
static int ipmi_ipmb_send_message(device_t, u_char, u_char, u_char,
u_char, u_char, int)
#endif
static d_ioctl_t ipmi_ioctl;
static d_poll_t ipmi_poll;
static d_open_t ipmi_open;
static d_close_t ipmi_close;
int ipmi_attached = 0;
#define IPMI_MINOR 0
static int on = 1;
SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD, 0, IPMI driver parameters);
SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RW,
on, 0, );
static struct cdevsw ipmi_cdevsw = {
.d_version =D_VERSION,
.d_open = ipmi_open,
.d_close = ipmi_close,
.d_ioctl = ipmi_ioctl,
.d_poll = ipmi_poll,
.d_name = ipmi,
};
MALLOC_DEFINE(M_IPMI, ipmi, ipmi);
static int
ipmi_open(struct cdev *cdev, int flags, int fmt, struct thread *td)
{
struct ipmi_device *dev;
struct ipmi_softc *sc;
if (!on)
return (ENOENT);
dev = cdev-si_drv1;
sc = dev-ipmi_softc;
IPMI_LOCK(sc);
if (dev-ipmi_open) {
IPMI_UNLOCK(sc);
return (EBUSY);
}
dev-ipmi_open = 1;
IPMI_UNLOCK(sc);
return (0);
}
static int
ipmi_poll(struct cdev *cdev, int poll_events, struct thread *td)
{
struct ipmi_device *dev;
struct ipmi_softc *sc;
int revents = 0;
dev = cdev-si_drv1;
sc = dev-ipmi_softc;
IPMI_LOCK(sc);
if (poll_events (POLLIN | POLLRDNORM)) {
if (!TAILQ_EMPTY(dev-ipmi_completed_requests))
revents |= poll_events (POLLIN | POLLRDNORM);
if (dev-ipmi_requests == 0)
revents |= POLLERR;
}
if (revents == 0) {
if (poll_events (POLLIN | POLLRDNORM))
selrecord(td, dev-ipmi_select);
}
IPMI_UNLOCK(sc);
return (revents);
}
static void
ipmi_purge_completed_requests(struct ipmi_device *dev)
{
struct ipmi_request *req;
while (!TAILQ_EMPTY(dev-ipmi_completed_requests)) {
req = TAILQ_FIRST(dev-ipmi_completed_requests);
TAILQ_REMOVE(dev-ipmi_completed_requests, req, ir_link);
dev-ipmi_requests--;
ipmi_free_request(req);
}
}
static int
ipmi_close(struct cdev *cdev, int flags, int fmt, struct thread *td)
{
struct ipmi_request *req, *nreq;
struct ipmi_device *dev;
struct ipmi_softc *sc;
#ifdef CLONING
int bit;
#endif
dev = cdev-si_drv1;
sc = dev-ipmi_softc;
IPMI_LOCK(sc);
if (dev-ipmi_requests) {