struct ib_agent_port_private	*port_priv; struct ib_agent_send_wr		*agent_send_wr; unsigned long			flags;  /* Find matching MAD agent */ port_priv = ib_get_agent_port(NULL, 0, mad_agent); if (!port_priv) { printk(KERN_ERR SPFX "agent_send_handler: no matching MAD " "agent %p\n", mad_agent); return; }  agent_send_wr = (struct ib_agent_send_wr *)(unsigned long)mad_send_wc->wr_id; spin_lock_irqsave(&port_priv->send_list_lock, flags); /* Remove completed send from posted send MAD list */ list_del(&agent_send_wr->send_list); spin_unlock_irqrestore(&port_priv->send_list_lock, flags);  dma_unmap_single(mad_agent->device->dma_device, pci_unmap_addr(agent_send_wr, mapping), sizeof(agent_send_wr->mad->mad), DMA_TO_DEVICE);  ib_destroy_ah(agent_send_wr->ah);  /* Release allocated memory */ kmem_cache_free(ib_mad_cache, agent_send_wr->mad); kfree(agent_send_wr); 
ib_destroy_ah(mad_send_wc->send_buf->ah); ib_free_send_mad(mad_send_wc->send_buf); 
static void agent_send_handler(struct ib_mad_agent *mad_agent,			       struct ib_mad_send_wc *mad_send_wc){	struct ib_agent_port_private	*port_priv;	struct ib_agent_send_wr		*agent_send_wr;	unsigned long			flags;	/* Find matching MAD agent */	port_priv = ib_get_agent_port(NULL, 0, mad_agent);	if (!port_priv) {		printk(KERN_ERR SPFX "agent_send_handler: no matching MAD "		       "agent %p\n", mad_agent);		return;	}	agent_send_wr = (struct ib_agent_send_wr *)(unsigned long)mad_send_wc->wr_id;	spin_lock_irqsave(&port_priv->send_list_lock, flags);	/* Remove completed send from posted send MAD list */	list_del(&agent_send_wr->send_list);	spin_unlock_irqrestore(&port_priv->send_list_lock, flags);	dma_unmap_single(mad_agent->device->dma_device,			 pci_unmap_addr(agent_send_wr, mapping),			 sizeof(agent_send_wr->mad->mad),			 DMA_TO_DEVICE);	ib_destroy_ah(agent_send_wr->ah);	/* Release allocated memory */	kmem_cache_free(ib_mad_cache, agent_send_wr->mad);	kfree(agent_send_wr);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/34816ad98efe4d47ffd858a0345321f9d85d9420/agent.c/clean/drivers/infiniband/core/agent.c