aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/firewire/core-transaction.c4
-rw-r--r--drivers/firewire/ohci.c9
-rw-r--r--include/linux/firewire.h1
3 files changed, 8 insertions, 6 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index 66789c3cc561..842739df23e2 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -226,7 +226,7 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
226 packet->speed = speed; 226 packet->speed = speed;
227 packet->generation = generation; 227 packet->generation = generation;
228 packet->ack = 0; 228 packet->ack = 0;
229 packet->payload_bus = 0; 229 packet->payload_mapped = false;
230} 230}
231 231
232/** 232/**
@@ -601,7 +601,7 @@ void fw_fill_response(struct fw_packet *response, u32 *request_header,
601 WARN(1, KERN_ERR "wrong tcode %d", tcode); 601 WARN(1, KERN_ERR "wrong tcode %d", tcode);
602 } 602 }
603 603
604 response->payload_bus = 0; 604 response->payload_mapped = false;
605} 605}
606EXPORT_SYMBOL(fw_fill_response); 606EXPORT_SYMBOL(fw_fill_response);
607 607
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 418415564791..a71477541dc7 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -995,7 +995,8 @@ static int at_context_queue_packet(struct context *ctx,
995 packet->ack = RCODE_SEND_ERROR; 995 packet->ack = RCODE_SEND_ERROR;
996 return -1; 996 return -1;
997 } 997 }
998 packet->payload_bus = payload_bus; 998 packet->payload_bus = payload_bus;
999 packet->payload_mapped = true;
999 1000
1000 d[2].req_count = cpu_to_le16(packet->payload_length); 1001 d[2].req_count = cpu_to_le16(packet->payload_length);
1001 d[2].data_address = cpu_to_le32(payload_bus); 1002 d[2].data_address = cpu_to_le32(payload_bus);
@@ -1023,7 +1024,7 @@ static int at_context_queue_packet(struct context *ctx,
1023 */ 1024 */
1024 if (ohci->generation != packet->generation || 1025 if (ohci->generation != packet->generation ||
1025 reg_read(ohci, OHCI1394_IntEventSet) & OHCI1394_busReset) { 1026 reg_read(ohci, OHCI1394_IntEventSet) & OHCI1394_busReset) {
1026 if (packet->payload_length > 0) 1027 if (packet->payload_mapped)
1027 dma_unmap_single(ohci->card.device, payload_bus, 1028 dma_unmap_single(ohci->card.device, payload_bus,
1028 packet->payload_length, DMA_TO_DEVICE); 1029 packet->payload_length, DMA_TO_DEVICE);
1029 packet->ack = RCODE_GENERATION; 1030 packet->ack = RCODE_GENERATION;
@@ -1059,7 +1060,7 @@ static int handle_at_packet(struct context *context,
1059 /* This packet was cancelled, just continue. */ 1060 /* This packet was cancelled, just continue. */
1060 return 1; 1061 return 1;
1061 1062
1062 if (packet->payload_bus) 1063 if (packet->payload_mapped)
1063 dma_unmap_single(ohci->card.device, packet->payload_bus, 1064 dma_unmap_single(ohci->card.device, packet->payload_bus,
1064 packet->payload_length, DMA_TO_DEVICE); 1065 packet->payload_length, DMA_TO_DEVICE);
1065 1066
@@ -1723,7 +1724,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
1723 if (packet->ack != 0) 1724 if (packet->ack != 0)
1724 goto out; 1725 goto out;
1725 1726
1726 if (packet->payload_bus) 1727 if (packet->payload_mapped)
1727 dma_unmap_single(ohci->card.device, packet->payload_bus, 1728 dma_unmap_single(ohci->card.device, packet->payload_bus,
1728 packet->payload_length, DMA_TO_DEVICE); 1729 packet->payload_length, DMA_TO_DEVICE);
1729 1730
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 211a5d7d87b3..9416a461b696 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -267,6 +267,7 @@ struct fw_packet {
267 void *payload; 267 void *payload;
268 size_t payload_length; 268 size_t payload_length;
269 dma_addr_t payload_bus; 269 dma_addr_t payload_bus;
270 bool payload_mapped;
270 u32 timestamp; 271 u32 timestamp;
271 272
272 /* 273 /*