firewire: core: integrate software-forced bus resets with bus management
[pandora-kernel.git] / drivers / firewire / core-transaction.c
index 495849e..5f5a785 100644 (file)
@@ -81,7 +81,7 @@ static int close_transaction(struct fw_transaction *transaction,
        spin_lock_irqsave(&card->lock, flags);
        list_for_each_entry(t, &card->transaction_list, link) {
                if (t == transaction) {
-                       list_del(&t->link);
+                       list_del_init(&t->link);
                        card->tlabel_mask &= ~(1ULL << t->tlabel);
                        break;
                }
@@ -89,6 +89,7 @@ static int close_transaction(struct fw_transaction *transaction,
        spin_unlock_irqrestore(&card->lock, flags);
 
        if (&t->link != &card->transaction_list) {
+               del_timer_sync(&t->split_timeout_timer);
                t->callback(card, rcode, NULL, 0, t->callback_data);
                return 0;
        }
@@ -121,6 +122,31 @@ int fw_cancel_transaction(struct fw_card *card,
 }
 EXPORT_SYMBOL(fw_cancel_transaction);
 
+static void split_transaction_timeout_callback(unsigned long data)
+{
+       struct fw_transaction *t = (struct fw_transaction *)data;
+       struct fw_card *card = t->card;
+       unsigned long flags;
+
+       spin_lock_irqsave(&card->lock, flags);
+       if (list_empty(&t->link)) {
+               spin_unlock_irqrestore(&card->lock, flags);
+               return;
+       }
+       list_del(&t->link);
+       card->tlabel_mask &= ~(1ULL << t->tlabel);
+       spin_unlock_irqrestore(&card->lock, flags);
+
+       card->driver->cancel_packet(card, &t->packet);
+
+       /*
+        * At this point cancel_packet will never call the transaction
+        * callback, since we just took the transaction out of the list.
+        * So do it here.
+        */
+       t->callback(card, RCODE_CANCELLED, NULL, 0, t->callback_data);
+}
+
 static void transmit_complete_callback(struct fw_packet *packet,
                                       struct fw_card *card, int status)
 {
@@ -220,7 +246,7 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
                break;
 
        default:
-               WARN(1, KERN_ERR "wrong tcode %d", tcode);
+               WARN(1, "wrong tcode %d", tcode);
        }
  common:
        packet->speed = speed;
@@ -229,44 +255,67 @@ static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
        packet->payload_mapped = false;
 }
 
+static int allocate_tlabel(struct fw_card *card)
+{
+       int tlabel;
+
+       tlabel = card->current_tlabel;
+       while (card->tlabel_mask & (1ULL << tlabel)) {
+               tlabel = (tlabel + 1) & 0x3f;
+               if (tlabel == card->current_tlabel)
+                       return -EBUSY;
+       }
+
+       card->current_tlabel = (tlabel + 1) & 0x3f;
+       card->tlabel_mask |= 1ULL << tlabel;
+
+       return tlabel;
+}
+
 /**
- * This function provides low-level access to the IEEE1394 transaction
- * logic.  Most C programs would use either fw_read(), fw_write() or
- * fw_lock() instead - those function are convenience wrappers for
- * this function.  The fw_send_request() function is primarily
- * provided as a flexible, one-stop entry point for languages bindings
- * and protocol bindings.
+ * fw_send_request() - submit a request packet for transmission
+ * @card:              interface to send the request at
+ * @t:                 transaction instance to which the request belongs
+ * @tcode:             transaction code
+ * @destination_id:    destination node ID, consisting of bus_ID and phy_ID
+ * @generation:                bus generation in which request and response are valid
+ * @speed:             transmission speed
+ * @offset:            48bit wide offset into destination's address space
+ * @payload:           data payload for the request subaction
+ * @length:            length of the payload, in bytes
+ * @callback:          function to be called when the transaction is completed
+ * @callback_data:     data to be passed to the transaction completion callback
  *
- * FIXME: Document this function further, in particular the possible
- * values for rcode in the callback.  In short, we map ACK_COMPLETE to
- * RCODE_COMPLETE, internal errors set errno and set rcode to
- * RCODE_SEND_ERROR (which is out of range for standard ieee1394
- * rcodes).  All other rcodes are forwarded unchanged.  For all
- * errors, payload is NULL, length is 0.
+ * Submit a request packet into the asynchronous request transmission queue.
+ * Can be called from atomic context.  If you prefer a blocking API, use
+ * fw_run_transaction() in a context that can sleep.
  *
- * Can not expect the callback to be called before the function
- * returns, though this does happen in some cases (ACK_COMPLETE and
- * errors).
+ * In case of lock requests, specify one of the firewire-core specific %TCODE_
+ * constants instead of %TCODE_LOCK_REQUEST in @tcode.
  *
- * The payload is only used for write requests and must not be freed
- * until the callback has been called.
+ * Make sure that the value in @destination_id is not older than the one in
+ * @generation.  Otherwise the request is in danger to be sent to a wrong node.
  *
- * @param card the card from which to send the request
- * @param tcode the tcode for this transaction.  Do not use
- *   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
- * @param speed the speed to use for sending the request
- * @param offset the 48 bit offset on the destination node
- * @param payload the data payload for the request subaction
- * @param length the length in bytes of the data to read
- * @param callback function to be called when the transaction is completed
- * @param callback_data pointer to arbitrary data, which will be
- *   passed to the callback
- *
- * In case of asynchronous stream packets i.e. TCODE_STREAM_DATA, the caller
+ * In case of asynchronous stream packets i.e. %TCODE_STREAM_DATA, the caller
  * needs to synthesize @destination_id with fw_stream_packet_destination_id().
+ * It will contain tag, channel, and sy data instead of a node ID then.
+ *
+ * The payload buffer at @data is going to be DMA-mapped except in case of
+ * quadlet-sized payload or of local (loopback) requests.  Hence make sure that
+ * the buffer complies with the restrictions for DMA-mapped memory.  The
+ * @payload must not be freed before the @callback is called.
+ *
+ * In case of request types without payload, @data is NULL and @length is 0.
+ *
+ * After the transaction is completed successfully or unsuccessfully, the
+ * @callback will be called.  Among its parameters is the response code which
+ * is either one of the rcodes per IEEE 1394 or, in case of internal errors,
+ * the firewire-core specific %RCODE_SEND_ERROR.
+ *
+ * Note some timing corner cases:  fw_send_request() may complete much earlier
+ * than when the request packet actually hits the wire.  On the other hand,
+ * transaction completion and hence execution of @callback may happen even
+ * before fw_send_request() returns.
  */
 void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
                     int destination_id, int generation, int speed,
@@ -276,13 +325,6 @@ void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
        unsigned long flags;
        int tlabel;
 
-       /*
-        * Bump the flush timer up 100ms first of all so we
-        * don't race with a flush timer callback.
-        */
-
-       mod_timer(&card->flush_timer, jiffies + DIV_ROUND_UP(HZ, 10));
-
        /*
         * Allocate tlabel from the bitmap and put the transaction on
         * the list while holding the card spinlock.
@@ -290,18 +332,21 @@ void fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
 
        spin_lock_irqsave(&card->lock, flags);
 
-       tlabel = card->current_tlabel;
-       if (card->tlabel_mask & (1ULL << tlabel)) {
+       tlabel = allocate_tlabel(card);
+       if (tlabel < 0) {
                spin_unlock_irqrestore(&card->lock, flags);
                callback(card, RCODE_SEND_ERROR, NULL, 0, callback_data);
                return;
        }
 
-       card->current_tlabel = (card->current_tlabel + 1) & 0x3f;
-       card->tlabel_mask |= (1ULL << tlabel);
-
        t->node_id = destination_id;
        t->tlabel = tlabel;
+       t->card = card;
+       setup_timer(&t->split_timeout_timer,
+                   split_transaction_timeout_callback, (unsigned long)t);
+       /* FIXME: start this timer later, relative to t->timestamp */
+       mod_timer(&t->split_timeout_timer,
+                 jiffies + card->split_timeout_jiffies);
        t->callback = callback;
        t->callback_data = callback_data;
 
@@ -336,9 +381,11 @@ static void transaction_callback(struct fw_card *card, int rcode,
 }
 
 /**
- * fw_run_transaction - send request and sleep until transaction is completed
+ * fw_run_transaction() - send request and sleep until transaction is completed
  *
- * Returns the RCODE.
+ * Returns the RCODE.  See fw_send_request() for parameter documentation.
+ * Unlike fw_send_request(), @data points to the payload of the request or/and
+ * to the payload of the response.
  */
 int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
                       int generation, int speed, unsigned long long offset,
@@ -347,11 +394,13 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
        struct transaction_callback_data d;
        struct fw_transaction t;
 
+       init_timer_on_stack(&t.split_timeout_timer);
        init_completion(&d.done);
        d.payload = payload;
        fw_send_request(card, &t, tcode, destination_id, generation, speed,
                        offset, payload, length, transaction_callback, &d);
        wait_for_completion(&d.done);
+       destroy_timer_on_stack(&t.split_timeout_timer);
 
        return d.rcode;
 }
@@ -377,9 +426,21 @@ void fw_send_phy_config(struct fw_card *card,
                        int node_id, int generation, int gap_count)
 {
        long timeout = DIV_ROUND_UP(HZ, 10);
-       u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG) |
-                  PHY_CONFIG_ROOT_ID(node_id) |
-                  PHY_CONFIG_GAP_COUNT(gap_count);
+       u32 data = PHY_IDENTIFIER(PHY_PACKET_CONFIG);
+
+       if (node_id != FW_PHY_CONFIG_NO_NODE_ID)
+               data |= PHY_CONFIG_ROOT_ID(node_id);
+
+       if (gap_count == FW_PHY_CONFIG_CURRENT_GAP_COUNT) {
+               gap_count = card->driver->read_phy_reg(card, 1);
+               if (gap_count < 0)
+                       return;
+
+               gap_count &= 63;
+               if (gap_count == 63)
+                       return;
+       }
+       data |= PHY_CONFIG_GAP_COUNT(gap_count);
 
        mutex_lock(&phy_config_mutex);
 
@@ -394,30 +455,6 @@ void fw_send_phy_config(struct fw_card *card,
        mutex_unlock(&phy_config_mutex);
 }
 
-void fw_flush_transactions(struct fw_card *card)
-{
-       struct fw_transaction *t, *next;
-       struct list_head list;
-       unsigned long flags;
-
-       INIT_LIST_HEAD(&list);
-       spin_lock_irqsave(&card->lock, flags);
-       list_splice_init(&card->transaction_list, &list);
-       card->tlabel_mask = 0;
-       spin_unlock_irqrestore(&card->lock, flags);
-
-       list_for_each_entry_safe(t, next, &list, link) {
-               card->driver->cancel_packet(card, &t->packet);
-
-               /*
-                * At this point cancel_packet will never call the
-                * transaction callback, since we just took all the
-                * transactions out of the list.  So do it here.
-                */
-               t->callback(card, RCODE_CANCELLED, NULL, 0, t->callback_data);
-       }
-}
-
 static struct fw_address_handler *lookup_overlapping_address_handler(
        struct list_head *list, unsigned long long offset, size_t length)
 {
@@ -478,9 +515,9 @@ static bool is_in_fcp_region(u64 offset, size_t length)
 }
 
 /**
- * fw_core_add_address_handler - register for incoming requests
- * @handler: callback
- * @region: region in the IEEE 1212 node space address range
+ * fw_core_add_address_handler() - register for incoming requests
+ * @handler:   callback
+ * @region:    region in the IEEE 1212 node space address range
  *
  * region->start, ->end, and handler->length have to be quadlet-aligned.
  *
@@ -535,7 +572,7 @@ int fw_core_add_address_handler(struct fw_address_handler *handler,
 EXPORT_SYMBOL(fw_core_add_address_handler);
 
 /**
- * fw_core_remove_address_handler - unregister an address handler
+ * fw_core_remove_address_handler() - unregister an address handler
  */
 void fw_core_remove_address_handler(struct fw_address_handler *handler)
 {
@@ -564,6 +601,41 @@ static void free_response_callback(struct fw_packet *packet,
        kfree(request);
 }
 
+int fw_get_response_length(struct fw_request *r)
+{
+       int tcode, ext_tcode, data_length;
+
+       tcode = HEADER_GET_TCODE(r->request_header[0]);
+
+       switch (tcode) {
+       case TCODE_WRITE_QUADLET_REQUEST:
+       case TCODE_WRITE_BLOCK_REQUEST:
+               return 0;
+
+       case TCODE_READ_QUADLET_REQUEST:
+               return 4;
+
+       case TCODE_READ_BLOCK_REQUEST:
+               data_length = HEADER_GET_DATA_LENGTH(r->request_header[3]);
+               return data_length;
+
+       case TCODE_LOCK_REQUEST:
+               ext_tcode = HEADER_GET_EXTENDED_TCODE(r->request_header[3]);
+               data_length = HEADER_GET_DATA_LENGTH(r->request_header[3]);
+               switch (ext_tcode) {
+               case EXTCODE_FETCH_ADD:
+               case EXTCODE_LITTLE_ADD:
+                       return data_length;
+               default:
+                       return data_length / 2;
+               }
+
+       default:
+               WARN(1, "wrong tcode %d", tcode);
+               return 0;
+       }
+}
+
 void fw_fill_response(struct fw_packet *response, u32 *request_header,
                      int rcode, void *payload, size_t length)
 {
@@ -615,18 +687,35 @@ void fw_fill_response(struct fw_packet *response, u32 *request_header,
                break;
 
        default:
-               WARN(1, KERN_ERR "wrong tcode %d", tcode);
+               WARN(1, "wrong tcode %d", tcode);
        }
 
        response->payload_mapped = false;
 }
 EXPORT_SYMBOL(fw_fill_response);
 
-static struct fw_request *allocate_request(struct fw_packet *p)
+static u32 compute_split_timeout_timestamp(struct fw_card *card,
+                                          u32 request_timestamp)
+{
+       unsigned int cycles;
+       u32 timestamp;
+
+       cycles = card->split_timeout_cycles;
+       cycles += request_timestamp & 0x1fff;
+
+       timestamp = request_timestamp & ~0x1fff;
+       timestamp += (cycles / 8000) << 13;
+       timestamp |= cycles % 8000;
+
+       return timestamp;
+}
+
+static struct fw_request *allocate_request(struct fw_card *card,
+                                          struct fw_packet *p)
 {
        struct fw_request *request;
        u32 *data, length;
-       int request_tcode, t;
+       int request_tcode;
 
        request_tcode = HEADER_GET_TCODE(p->header[0]);
        switch (request_tcode) {
@@ -661,14 +750,9 @@ static struct fw_request *allocate_request(struct fw_packet *p)
        if (request == NULL)
                return NULL;
 
-       t = (p->timestamp & 0x1fff) + 4000;
-       if (t >= 8000)
-               t = (p->timestamp & ~0x1fff) + 0x2000 + t - 8000;
-       else
-               t = (p->timestamp & ~0x1fff) + t;
-
        request->response.speed = p->speed;
-       request->response.timestamp = t;
+       request->response.timestamp =
+                       compute_split_timeout_timestamp(card, p->timestamp);
        request->response.generation = p->generation;
        request->response.ack = 0;
        request->response.callback = free_response_callback;
@@ -697,7 +781,8 @@ void fw_send_response(struct fw_card *card,
 
        if (rcode == RCODE_COMPLETE)
                fw_fill_response(&request->response, request->request_header,
-                                rcode, request->data, request->length);
+                                rcode, request->data,
+                                fw_get_response_length(request));
        else
                fw_fill_response(&request->response, request->request_header,
                                 rcode, NULL, 0);
@@ -715,9 +800,11 @@ static void handle_exclusive_region_request(struct fw_card *card,
        unsigned long flags;
        int tcode, destination, source;
 
-       tcode       = HEADER_GET_TCODE(p->header[0]);
        destination = HEADER_GET_DESTINATION(p->header[0]);
        source      = HEADER_GET_SOURCE(p->header[1]);
+       tcode       = HEADER_GET_TCODE(p->header[0]);
+       if (tcode == TCODE_LOCK_REQUEST)
+               tcode = 0x10 + HEADER_GET_EXTENDED_TCODE(p->header[3]);
 
        spin_lock_irqsave(&address_handler_lock, flags);
        handler = lookup_enclosing_address_handler(&address_handler_list,
@@ -737,7 +824,7 @@ static void handle_exclusive_region_request(struct fw_card *card,
        else
                handler->address_callback(card, request,
                                          tcode, destination, source,
-                                         p->generation, p->speed, offset,
+                                         p->generation, offset,
                                          request->data, request->length,
                                          handler->callback_data);
 }
@@ -775,8 +862,8 @@ static void handle_fcp_region_request(struct fw_card *card,
                if (is_enclosing_handler(handler, offset, request->length))
                        handler->address_callback(card, NULL, tcode,
                                                  destination, source,
-                                                 p->generation, p->speed,
-                                                 offset, request->data,
+                                                 p->generation, offset,
+                                                 request->data,
                                                  request->length,
                                                  handler->callback_data);
        }
@@ -793,7 +880,7 @@ void fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
        if (p->ack != ACK_PENDING && p->ack != ACK_COMPLETE)
                return;
 
-       request = allocate_request(p);
+       request = allocate_request(card, p);
        if (request == NULL) {
                /* FIXME: send statically allocated busy packet. */
                return;
@@ -816,19 +903,18 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
        unsigned long flags;
        u32 *data;
        size_t data_length;
-       int tcode, tlabel, destination, source, rcode;
+       int tcode, tlabel, source, rcode;
 
-       tcode       = HEADER_GET_TCODE(p->header[0]);
-       tlabel      = HEADER_GET_TLABEL(p->header[0]);
-       destination = HEADER_GET_DESTINATION(p->header[0]);
-       source      = HEADER_GET_SOURCE(p->header[1]);
-       rcode       = HEADER_GET_RCODE(p->header[1]);
+       tcode   = HEADER_GET_TCODE(p->header[0]);
+       tlabel  = HEADER_GET_TLABEL(p->header[0]);
+       source  = HEADER_GET_SOURCE(p->header[1]);
+       rcode   = HEADER_GET_RCODE(p->header[1]);
 
        spin_lock_irqsave(&card->lock, flags);
        list_for_each_entry(t, &card->transaction_list, link) {
                if (t->node_id == source && t->tlabel == tlabel) {
-                       list_del(&t->link);
-                       card->tlabel_mask &= ~(1 << t->tlabel);
+                       list_del_init(&t->link);
+                       card->tlabel_mask &= ~(1ULL << t->tlabel);
                        break;
                }
        }
@@ -869,6 +955,8 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
                break;
        }
 
+       del_timer_sync(&t->split_timeout_timer);
+
        /*
         * The response handler may be executed while the request handler
         * is still pending.  Cancel the request handler.
@@ -885,8 +973,8 @@ static const struct fw_address_region topology_map_region =
 
 static void handle_topology_map(struct fw_card *card, struct fw_request *request,
                int tcode, int destination, int source, int generation,
-               int speed, unsigned long long offset,
-               void *payload, size_t length, void *callback_data)
+               unsigned long long offset, void *payload, size_t length,
+               void *callback_data)
 {
        int start;
 
@@ -915,29 +1003,99 @@ static const struct fw_address_region registers_region =
        { .start = CSR_REGISTER_BASE,
          .end   = CSR_REGISTER_BASE | CSR_CONFIG_ROM, };
 
+static void update_split_timeout(struct fw_card *card)
+{
+       unsigned int cycles;
+
+       cycles = card->split_timeout_hi * 8000 + (card->split_timeout_lo >> 19);
+
+       cycles = max(cycles, 800u); /* minimum as per the spec */
+       cycles = min(cycles, 3u * 8000u); /* maximum OHCI timeout */
+
+       card->split_timeout_cycles = cycles;
+       card->split_timeout_jiffies = DIV_ROUND_UP(cycles * HZ, 8000);
+}
+
 static void handle_registers(struct fw_card *card, struct fw_request *request,
                int tcode, int destination, int source, int generation,
-               int speed, unsigned long long offset,
-               void *payload, size_t length, void *callback_data)
+               unsigned long long offset, void *payload, size_t length,
+               void *callback_data)
 {
        int reg = offset & ~CSR_REGISTER_BASE;
-       unsigned long long bus_time;
        __be32 *data = payload;
        int rcode = RCODE_COMPLETE;
+       unsigned long flags;
 
        switch (reg) {
+       case CSR_PRIORITY_BUDGET:
+               if (!card->priority_budget_implemented) {
+                       rcode = RCODE_ADDRESS_ERROR;
+                       break;
+               }
+               /* else fall through */
+
+       case CSR_NODE_IDS:
+               /*
+                * per IEEE 1394-2008 8.3.22.3, not IEEE 1394.1-2004 3.2.8
+                * and 9.6, but interoperable with IEEE 1394.1-2004 bridges
+                */
+               /* fall through */
+
+       case CSR_STATE_CLEAR:
+       case CSR_STATE_SET:
        case CSR_CYCLE_TIME:
        case CSR_BUS_TIME:
-               if (!TCODE_IS_READ_REQUEST(tcode) || length != 4) {
+       case CSR_BUSY_TIMEOUT:
+               if (tcode == TCODE_READ_QUADLET_REQUEST)
+                       *data = cpu_to_be32(card->driver->read_csr(card, reg));
+               else if (tcode == TCODE_WRITE_QUADLET_REQUEST)
+                       card->driver->write_csr(card, reg, be32_to_cpu(*data));
+               else
+                       rcode = RCODE_TYPE_ERROR;
+               break;
+
+       case CSR_RESET_START:
+               if (tcode == TCODE_WRITE_QUADLET_REQUEST)
+                       card->driver->write_csr(card, CSR_STATE_CLEAR,
+                                               CSR_STATE_BIT_ABDICATE);
+               else
+                       rcode = RCODE_TYPE_ERROR;
+               break;
+
+       case CSR_SPLIT_TIMEOUT_HI:
+               if (tcode == TCODE_READ_QUADLET_REQUEST) {
+                       *data = cpu_to_be32(card->split_timeout_hi);
+               } else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
+                       spin_lock_irqsave(&card->lock, flags);
+                       card->split_timeout_hi = be32_to_cpu(*data) & 7;
+                       update_split_timeout(card);
+                       spin_unlock_irqrestore(&card->lock, flags);
+               } else {
                        rcode = RCODE_TYPE_ERROR;
-                       break;
                }
+               break;
 
-               bus_time = card->driver->get_bus_time(card);
-               if (reg == CSR_CYCLE_TIME)
-                       *data = cpu_to_be32(bus_time);
+       case CSR_SPLIT_TIMEOUT_LO:
+               if (tcode == TCODE_READ_QUADLET_REQUEST) {
+                       *data = cpu_to_be32(card->split_timeout_lo);
+               } else if (tcode == TCODE_WRITE_QUADLET_REQUEST) {
+                       spin_lock_irqsave(&card->lock, flags);
+                       card->split_timeout_lo =
+                                       be32_to_cpu(*data) & 0xfff80000;
+                       update_split_timeout(card);
+                       spin_unlock_irqrestore(&card->lock, flags);
+               } else {
+                       rcode = RCODE_TYPE_ERROR;
+               }
+               break;
+
+       case CSR_MAINT_UTILITY:
+               if (tcode == TCODE_READ_QUADLET_REQUEST)
+                       *data = card->maint_utility_register;
+               else if (tcode == TCODE_WRITE_QUADLET_REQUEST)
+                       card->maint_utility_register = *data;
                else
-                       *data = cpu_to_be32(bus_time >> 25);
+                       rcode = RCODE_TYPE_ERROR;
                break;
 
        case CSR_BROADCAST_CHANNEL:
@@ -965,9 +1123,6 @@ static void handle_registers(struct fw_card *card, struct fw_request *request,
                BUG();
                break;
 
-       case CSR_BUSY_TIMEOUT:
-               /* FIXME: Implement this. */
-
        default:
                rcode = RCODE_ADDRESS_ERROR;
                break;