block: get rid of elv_insert() interface
[linux-2.6.git] / include / linux / firewire.h
index 5acb5fc..c64f368 100644 (file)
 #define CSR_BROADCAST_CHANNEL          0x234
 #define CSR_CONFIG_ROM                 0x400
 #define CSR_CONFIG_ROM_END             0x800
+#define CSR_OMPR                       0x900
+#define CSR_OPCR(i)                    (0x904 + (i) * 4)
+#define CSR_IMPR                       0x980
+#define CSR_IPCR(i)                    (0x984 + (i) * 4)
 #define CSR_FCP_COMMAND                        0xB00
 #define CSR_FCP_RESPONSE               0xD00
 #define CSR_FCP_END                    0xF00
@@ -89,7 +93,7 @@ struct fw_card {
        int current_tlabel;
        u64 tlabel_mask;
        struct list_head transaction_list;
-       unsigned long reset_jiffies;
+       u64 reset_jiffies;
 
        u32 split_timeout_hi;
        u32 split_timeout_lo;
@@ -111,16 +115,19 @@ struct fw_card {
        bool beta_repeaters_present;
 
        int index;
-
        struct list_head link;
 
-       /* Work struct for BM duties. */
-       struct delayed_work work;
+       struct list_head phy_receiver_list;
+
+       struct delayed_work br_work; /* bus reset job */
+       bool br_short;
+
+       struct delayed_work bm_work; /* bus manager job */
        int bm_retries;
        int bm_generation;
        __be32 bm_transaction_data[2];
-       bool bm_abdicate; /* value of csr_abdicate before last bus reset */
-       bool csr_abdicate; /* visible in CSR STATE_CLEAR/SET registers */
+       int bm_node_id;
+       bool bm_abdicate;
 
        bool priority_budget_implemented;       /* controller feature */
        bool broadcast_channel_auto_allocated;  /* controller feature */
@@ -266,7 +273,7 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
 typedef void (*fw_address_callback_t)(struct fw_card *card,
                                      struct fw_request *request,
                                      int tcode, int destination, int source,
-                                     int generation, int speed,
+                                     int generation,
                                      unsigned long long offset,
                                      void *data, size_t length,
                                      void *callback_data);
@@ -283,10 +290,10 @@ struct fw_packet {
        u32 timestamp;
 
        /*
-        * This callback is called when the packet transmission has
-        * completed; for successful transmission, the status code is
-        * the ack received from the destination, otherwise it's a
-        * negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO.
+        * This callback is called when the packet transmission has completed.
+        * For successful transmission, the status code is the ack received
+        * from the destination.  Otherwise it is one of the juju-specific
+        * rcodes:  RCODE_SEND_ERROR, _CANCELLED, _BUSY, _GENERATION, _NO_ACK.
         * The callback can be called from tasklet context and thus
         * must never block.
         */
@@ -299,9 +306,9 @@ struct fw_packet {
 struct fw_transaction {
        int node_id; /* The generation is implied; it is always the current. */
        int tlabel;
-       int timestamp;
        struct list_head link;
        struct fw_card *card;
+       bool is_split_transaction;
        struct timer_list split_timeout_timer;
 
        struct fw_packet packet;
@@ -369,17 +376,19 @@ void fw_core_remove_descriptor(struct fw_descriptor *desc);
  * scatter-gather streaming (e.g. assembling video frame automatically).
  */
 struct fw_iso_packet {
-       u16 payload_length;     /* Length of indirect payload. */
-       u32 interrupt:1;        /* Generate interrupt on this packet */
-       u32 skip:1;             /* Set to not send packet at all. */
-       u32 tag:2;
-       u32 sy:4;
-       u32 header_length:8;    /* Length of immediate header. */
-       u32 header[0];
+       u16 payload_length;     /* Length of indirect payload           */
+       u32 interrupt:1;        /* Generate interrupt on this packet    */
+       u32 skip:1;             /* tx: Set to not send packet at all    */
+                               /* rx: Sync bit, wait for matching sy   */
+       u32 tag:2;              /* tx: Tag in packet header             */
+       u32 sy:4;               /* tx: Sy in packet header              */
+       u32 header_length:8;    /* Length of immediate header           */
+       u32 header[0];          /* tx: Top of 1394 isoch. data_block    */
 };
 
-#define FW_ISO_CONTEXT_TRANSMIT        0
-#define FW_ISO_CONTEXT_RECEIVE 1
+#define FW_ISO_CONTEXT_TRANSMIT                        0
+#define FW_ISO_CONTEXT_RECEIVE                 1
+#define FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL    2
 
 #define FW_ISO_CONTEXT_MATCH_TAG0       1
 #define FW_ISO_CONTEXT_MATCH_TAG1       2
@@ -403,24 +412,31 @@ struct fw_iso_buffer {
 int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
                       int page_count, enum dma_data_direction direction);
 void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
+size_t fw_iso_buffer_lookup(struct fw_iso_buffer *buffer, dma_addr_t completed);
 
 struct fw_iso_context;
 typedef void (*fw_iso_callback_t)(struct fw_iso_context *context,
                                  u32 cycle, size_t header_length,
                                  void *header, void *data);
+typedef void (*fw_iso_mc_callback_t)(struct fw_iso_context *context,
+                                    dma_addr_t completed, void *data);
 struct fw_iso_context {
        struct fw_card *card;
        int type;
        int channel;
        int speed;
        size_t header_size;
-       fw_iso_callback_t callback;
+       union {
+               fw_iso_callback_t sc;
+               fw_iso_mc_callback_t mc;
+       } callback;
        void *callback_data;
 };
 
 struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
                int type, int channel, int speed, size_t header_size,
                fw_iso_callback_t callback, void *callback_data);
+int fw_iso_context_set_channels(struct fw_iso_context *ctx, u64 *channels);
 int fw_iso_context_queue(struct fw_iso_context *ctx,
                         struct fw_iso_packet *packet,
                         struct fw_iso_buffer *buffer,
@@ -429,5 +445,8 @@ int fw_iso_context_start(struct fw_iso_context *ctx,
                         int cycle, int sync, int tags);
 int fw_iso_context_stop(struct fw_iso_context *ctx);
 void fw_iso_context_destroy(struct fw_iso_context *ctx);
+void fw_iso_resource_manage(struct fw_card *card, int generation,
+                           u64 channels_mask, int *channel, int *bandwidth,
+                           bool allocate, __be32 buffer[2]);
 
 #endif /* _LINUX_FIREWIRE_H */