struct cmd_rcvr       *rcvr; int                   rv = 0; unsigned char         netfn; unsigned char         cmd; ipmi_user_t           user = NULL; struct ipmi_lan_addr  *lan_addr; struct ipmi_recv_msg  *recv_msg; unsigned long         flags; 
struct cmd_rcvr          *rcvr; int                      rv = 0; unsigned char            netfn; unsigned char            cmd; ipmi_user_t              user = NULL; struct ipmi_lan_addr     *lan_addr; struct ipmi_recv_msg     *recv_msg; unsigned long            flags; 
static int handle_lan_get_msg_cmd(ipmi_smi_t          intf,				  struct ipmi_smi_msg *msg){	struct cmd_rcvr       *rcvr;	int                   rv = 0;	unsigned char         netfn;	unsigned char         cmd;	ipmi_user_t           user = NULL;	struct ipmi_lan_addr  *lan_addr;	struct ipmi_recv_msg  *recv_msg;	unsigned long         flags;	if (msg->rsp_size < 12) {		/* Message not big enough, just ignore it. */		spin_lock_irqsave(&intf->counter_lock, flags);		intf->invalid_commands++;		spin_unlock_irqrestore(&intf->counter_lock, flags);		return 0;	}	if (msg->rsp[2] != 0) {		/* An error getting the response, just ignore it. */		return 0;	}	netfn = msg->rsp[6] >> 2;	cmd = msg->rsp[10];	read_lock(&(intf->cmd_rcvr_lock));	/* Find the command/netfn. */	list_for_each_entry(rcvr, &(intf->cmd_rcvrs), link) {		if ((rcvr->netfn == netfn) && (rcvr->cmd == cmd)) {			user = rcvr->user;			break;		}	}	read_unlock(&(intf->cmd_rcvr_lock));	if (user == NULL) {		/* We didn't find a user, deliver an error response. */		spin_lock_irqsave(&intf->counter_lock, flags);		intf->unhandled_commands++;		spin_unlock_irqrestore(&intf->counter_lock, flags);		rv = 0; /* Don't do anything with these messages, just			   allow them to be freed. */	} else {		/* Deliver the message to the user. */		spin_lock_irqsave(&intf->counter_lock, flags);		intf->handled_commands++;		spin_unlock_irqrestore(&intf->counter_lock, flags);		recv_msg = ipmi_alloc_recv_msg();		if (! recv_msg) {			/* We couldn't allocate memory for the                           message, so requeue it for handling                           later. */			rv = 1;		} else {			/* Extract the source address from the data. */			lan_addr = (struct ipmi_lan_addr *) &recv_msg->addr;			lan_addr->addr_type = IPMI_LAN_ADDR_TYPE;			lan_addr->session_handle = msg->rsp[4];			lan_addr->remote_SWID = msg->rsp[8];			lan_addr->local_SWID = msg->rsp[5];			lan_addr->lun = msg->rsp[9] & 3;			lan_addr->channel = msg->rsp[3] & 0xf;			lan_addr->privilege = msg->rsp[3] >> 4;			/* Extract the rest of the message information			   from the IPMB header.*/			recv_msg->user = user;			recv_msg->recv_type = IPMI_CMD_RECV_TYPE;			recv_msg->msgid = msg->rsp[9] >> 2;			recv_msg->msg.netfn = msg->rsp[6] >> 2;			recv_msg->msg.cmd = msg->rsp[10];			recv_msg->msg.data = recv_msg->msg_data;			/* We chop off 12, not 11 bytes because the checksum			   at the end also needs to be removed. */			recv_msg->msg.data_len = msg->rsp_size - 12;			memcpy(recv_msg->msg_data,			       &(msg->rsp[11]),			       msg->rsp_size - 12);			deliver_response(recv_msg);		}	}	return rv;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/393d2cc354d150b8b4bb888a9da7db4c935e12bd/ipmi_msghandler.c/clean/drivers/char/ipmi/ipmi_msghandler.c