]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/firewire/fw-transaction.c
fix typo "insted" -> "instead"
[mirror_ubuntu-artful-kernel.git] / drivers / firewire / fw-transaction.c
index 80d0121463d0d7fee8b0a49b6e56a3aab53b20f3..c00d4a9b39e5861980d884823e9d46d41c18a61f 100644 (file)
@@ -228,7 +228,7 @@ fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
  *
  * @param card the card from which to send the request
  * @param tcode the tcode for this transaction.  Do not use
- *   TCODE_LOCK_REQUEST directly, insted use TCODE_LOCK_MASK_SWAP
+ *   TCODE_LOCK_REQUEST directly, instead use TCODE_LOCK_MASK_SWAP
  *   etc. to specify tcode and ext_tcode.
  * @param node_id the destination node ID (bus ID and PHY ID concatenated)
  * @param generation the generation for which node_id is valid
@@ -410,7 +410,12 @@ EXPORT_SYMBOL(fw_unit_space_region);
  * controller.  When a request is received that falls within the
  * specified address range, the specified callback is invoked.  The
  * parameters passed to the callback give the details of the
- * particular request
+ * particular request.
+ *
+ * Return value:  0 on success, non-zero otherwise.
+ * The start offset of the handler's address region is determined by
+ * fw_core_add_address_handler() and is returned in handler->offset.
+ * The offset is quadlet-aligned.
  */
 int
 fw_core_add_address_handler(struct fw_address_handler *handler,
@@ -422,14 +427,15 @@ fw_core_add_address_handler(struct fw_address_handler *handler,
 
        spin_lock_irqsave(&address_handler_lock, flags);
 
-       handler->offset = region->start;
+       handler->offset = roundup(region->start, 4);
        while (handler->offset + handler->length <= region->end) {
                other =
                    lookup_overlapping_address_handler(&address_handler_list,
                                                       handler->offset,
                                                       handler->length);
                if (other != NULL) {
-                       handler->offset += other->length;
+                       handler->offset =
+                           roundup(other->offset + other->length, 4);
                } else {
                        list_add_tail(&handler->link, &address_handler_list);
                        ret = 0;
@@ -605,8 +611,10 @@ fw_send_response(struct fw_card *card, struct fw_request *request, int rcode)
         * check is sufficient to ensure we don't send response to
         * broadcast packets or posted writes.
         */
-       if (request->ack != ACK_PENDING)
+       if (request->ack != ACK_PENDING) {
+               kfree(request);
                return;
+       }
 
        if (rcode == RCODE_COMPLETE)
                fw_fill_response(&request->response, request->request_header,
@@ -628,11 +636,6 @@ fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
        unsigned long flags;
        int tcode, destination, source;
 
-       if (p->payload_length > 2048) {
-               /* FIXME: send error response. */
-               return;
-       }
-
        if (p->ack != ACK_PENDING && p->ack != ACK_COMPLETE)
                return;
 
@@ -737,7 +740,7 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
 }
 EXPORT_SYMBOL(fw_core_handle_response);
 
-const struct fw_address_region topology_map_region =
+static const struct fw_address_region topology_map_region =
        { .start = 0xfffff0001000ull, .end = 0xfffff0001400ull, };
 
 static void
@@ -775,7 +778,7 @@ static struct fw_address_handler topology_map = {
        .address_callback       = handle_topology_map,
 };
 
-const struct fw_address_region registers_region =
+static const struct fw_address_region registers_region =
        { .start = 0xfffff0000000ull, .end = 0xfffff0000400ull, };
 
 static void