aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/sa_query.c
diff options
context:
space:
mode:
author <jgarzik@pretzel.yyz.us>2005-06-04 00:40:40 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-04 00:40:40 -0400
commitae20ea8525a80a863f70d332cf47b71bd9f54c1f (patch)
tree9d3cedeb65db521a8436b545bd91641549a18d24 /drivers/infiniband/core/sa_query.c
parentf497ba735fc9ff4e35a19641143708b3be1c7061 (diff)
parent8be3de3fd8469154a2b3e18a4712032dac5b4a53 (diff)
Automatic merge of /spare/repo/linux-2.6/.git branch HEAD
Diffstat (limited to 'drivers/infiniband/core/sa_query.c')
-rw-r--r--drivers/infiniband/core/sa_query.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
index d4233ee61c35..276e1a53010d 100644
--- a/drivers/infiniband/core/sa_query.c
+++ b/drivers/infiniband/core/sa_query.c
@@ -587,7 +587,7 @@ int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
587 587
588 init_mad(query->sa_query.mad, agent); 588 init_mad(query->sa_query.mad, agent);
589 589
590 query->sa_query.callback = ib_sa_path_rec_callback; 590 query->sa_query.callback = callback ? ib_sa_path_rec_callback : NULL;
591 query->sa_query.release = ib_sa_path_rec_release; 591 query->sa_query.release = ib_sa_path_rec_release;
592 query->sa_query.port = port; 592 query->sa_query.port = port;
593 query->sa_query.mad->mad_hdr.method = IB_MGMT_METHOD_GET; 593 query->sa_query.mad->mad_hdr.method = IB_MGMT_METHOD_GET;
@@ -663,7 +663,7 @@ int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
663 663
664 init_mad(query->sa_query.mad, agent); 664 init_mad(query->sa_query.mad, agent);
665 665
666 query->sa_query.callback = ib_sa_mcmember_rec_callback; 666 query->sa_query.callback = callback ? ib_sa_mcmember_rec_callback : NULL;
667 query->sa_query.release = ib_sa_mcmember_rec_release; 667 query->sa_query.release = ib_sa_mcmember_rec_release;
668 query->sa_query.port = port; 668 query->sa_query.port = port;
669 query->sa_query.mad->mad_hdr.method = method; 669 query->sa_query.mad->mad_hdr.method = method;
@@ -698,20 +698,21 @@ static void send_handler(struct ib_mad_agent *agent,
698 if (!query) 698 if (!query)
699 return; 699 return;
700 700
701 switch (mad_send_wc->status) { 701 if (query->callback)
702 case IB_WC_SUCCESS: 702 switch (mad_send_wc->status) {
703 /* No callback -- already got recv */ 703 case IB_WC_SUCCESS:
704 break; 704 /* No callback -- already got recv */
705 case IB_WC_RESP_TIMEOUT_ERR: 705 break;
706 query->callback(query, -ETIMEDOUT, NULL); 706 case IB_WC_RESP_TIMEOUT_ERR:
707 break; 707 query->callback(query, -ETIMEDOUT, NULL);
708 case IB_WC_WR_FLUSH_ERR: 708 break;
709 query->callback(query, -EINTR, NULL); 709 case IB_WC_WR_FLUSH_ERR:
710 break; 710 query->callback(query, -EINTR, NULL);
711 default: 711 break;
712 query->callback(query, -EIO, NULL); 712 default:
713 break; 713 query->callback(query, -EIO, NULL);
714 } 714 break;
715 }
715 716
716 dma_unmap_single(agent->device->dma_device, 717 dma_unmap_single(agent->device->dma_device,
717 pci_unmap_addr(query, mapping), 718 pci_unmap_addr(query, mapping),
@@ -736,7 +737,7 @@ static void recv_handler(struct ib_mad_agent *mad_agent,
736 query = idr_find(&query_idr, mad_recv_wc->wc->wr_id); 737 query = idr_find(&query_idr, mad_recv_wc->wc->wr_id);
737 spin_unlock_irqrestore(&idr_lock, flags); 738 spin_unlock_irqrestore(&idr_lock, flags);
738 739
739 if (query) { 740 if (query && query->callback) {
740 if (mad_recv_wc->wc->status == IB_WC_SUCCESS) 741 if (mad_recv_wc->wc->status == IB_WC_SUCCESS)
741 query->callback(query, 742 query->callback(query,
742 mad_recv_wc->recv_buf.mad->mad_hdr.status ? 743 mad_recv_wc->recv_buf.mad->mad_hdr.status ?