struct ib_mad *mad, int solicited) 
struct ib_mad *mad) 
find_mad_agent(struct ib_mad_port_private *port_priv,	       struct ib_mad *mad,	       int solicited){	struct ib_mad_agent_private *mad_agent = NULL;	unsigned long flags;	spin_lock_irqsave(&port_priv->reg_lock, flags);	/*	 * Whether MAD was solicited determines type of routing to	 * MAD client.	 */	if (solicited) {		u32 hi_tid;		struct ib_mad_agent_private *entry;		/*		 * Routing is based on high 32 bits of transaction ID		 * of MAD.		 */		hi_tid = be64_to_cpu(mad->mad_hdr.tid) >> 32;		list_for_each_entry(entry, &port_priv->agent_list,				    agent_list) {			if (entry->agent.hi_tid == hi_tid) {				mad_agent = entry;				break;			}		}	} else {		struct ib_mad_mgmt_class_table *class;		struct ib_mad_mgmt_method_table *method;		struct ib_mad_mgmt_vendor_class_table *vendor;		struct ib_mad_mgmt_vendor_class *vendor_class;		struct ib_vendor_mad *vendor_mad;		int index;		/*		 * Routing is based on version, class, and method		 * For "newer" vendor MADs, also based on OUI		 */		if (mad->mad_hdr.class_version >= MAX_MGMT_VERSION)			goto out;		if (!is_vendor_class(mad->mad_hdr.mgmt_class)) {			class = port_priv->version[					mad->mad_hdr.class_version].class;			if (!class)				goto out;			method = class->method_table[convert_mgmt_class(							mad->mad_hdr.mgmt_class)];			if (method)				mad_agent = method->agent[mad->mad_hdr.method &							  ~IB_MGMT_METHOD_RESP];		} else {			vendor = port_priv->version[					mad->mad_hdr.class_version].vendor;			if (!vendor)				goto out;			vendor_class = vendor->vendor_class[vendor_class_index(						mad->mad_hdr.mgmt_class)];			if (!vendor_class)				goto out;			/* Find matching OUI */			vendor_mad = (struct ib_vendor_mad *)mad;			index = find_vendor_oui(vendor_class, vendor_mad->oui);			if (index == -1)				goto out;			method = vendor_class->method_table[index];			if (method) {				mad_agent = method->agent[mad->mad_hdr.method &							  ~IB_MGMT_METHOD_RESP];			}		}	}	if (mad_agent) {		if (mad_agent->agent.recv_handler)			atomic_inc(&mad_agent->refcount);		else {			printk(KERN_NOTICE PFX "No receive handler for client "			       "%p on port %d\n",			       &mad_agent->agent, port_priv->port_num);			mad_agent = NULL;		}	}out:	spin_unlock_irqrestore(&port_priv->reg_lock, flags);	return mad_agent;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4a0754fae8fb5162d1cf4f738d48bb1e8190c09f/mad.c/buggy/drivers/infiniband/core/mad.c