firewire: core: integrate software-forced bus resets with bus management
[pandora-kernel.git] / include / linux / firewire.h
index a0e6715..adc5b55 100644 (file)
 #define CSR_CYCLE_TIME                 0x200
 #define CSR_BUS_TIME                   0x204
 #define CSR_BUSY_TIMEOUT               0x210
+#define CSR_PRIORITY_BUDGET            0x218
 #define CSR_BUS_MANAGER_ID             0x21c
 #define CSR_BANDWIDTH_AVAILABLE                0x220
 #define CSR_CHANNELS_AVAILABLE         0x224
 #define CSR_CHANNELS_AVAILABLE_HI      0x224
 #define CSR_CHANNELS_AVAILABLE_LO      0x228
+#define CSR_MAINT_UTILITY              0x230
 #define CSR_BROADCAST_CHANNEL          0x234
 #define CSR_CONFIG_ROM                 0x400
 #define CSR_CONFIG_ROM_END             0x800
 #define CSR_DESCRIPTOR         0x01
 #define CSR_VENDOR             0x03
 #define CSR_HARDWARE_VERSION   0x04
-#define CSR_NODE_CAPABILITIES  0x0c
 #define CSR_UNIT               0x11
 #define CSR_SPECIFIER_ID       0x12
 #define CSR_VERSION            0x13
 #define CSR_DEPENDENT_INFO     0x14
 #define CSR_MODEL              0x17
-#define CSR_INSTANCE           0x18
 #define CSR_DIRECTORY_ID       0x20
 
 struct fw_csr_iterator {
-       u32 *p;
-       u32 *end;
+       const u32 *p;
+       const u32 *end;
 };
 
-void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p);
+void fw_csr_iterator_init(struct fw_csr_iterator *ci, const u32 *p);
 int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value);
+int fw_csr_string(const u32 *directory, int key, char *buf, size_t size);
 
 extern struct bus_type fw_bus_type;
 
@@ -88,9 +89,13 @@ struct fw_card {
        int current_tlabel;
        u64 tlabel_mask;
        struct list_head transaction_list;
-       struct timer_list flush_timer;
        unsigned long reset_jiffies;
 
+       u32 split_timeout_hi;
+       u32 split_timeout_lo;
+       unsigned int split_timeout_cycles;
+       unsigned int split_timeout_jiffies;
+
        unsigned long long guid;
        unsigned max_receive;
        int link_speed;
@@ -109,15 +114,24 @@ struct fw_card {
 
        struct list_head link;
 
-       /* Work struct for BM duties. */
-       struct delayed_work work;
+       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];
+       int bm_node_id;
+       bool bm_abdicate;
+
+       bool priority_budget_implemented;       /* controller feature */
+       bool broadcast_channel_auto_allocated;  /* controller feature */
 
        bool broadcast_channel_allocated;
        u32 broadcast_channel;
        __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
+
+       __be32 maint_utility_register;
 };
 
 struct fw_attribute_group {
@@ -162,7 +176,7 @@ struct fw_device {
        struct mutex client_list_mutex;
        struct list_head client_list;
 
-       u32 *config_rom;
+       const u32 *config_rom;
        size_t config_rom_length;
        int config_rom_retries;
        unsigned is_local:1;
@@ -204,7 +218,7 @@ int fw_device_enable_phys_dma(struct fw_device *device);
  */
 struct fw_unit {
        struct device device;
-       u32 *directory;
+       const u32 *directory;
        struct fw_attribute_group attribute_group;
 };
 
@@ -254,7 +268,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);
@@ -289,6 +303,8 @@ struct fw_transaction {
        int tlabel;
        int timestamp;
        struct list_head link;
+       struct fw_card *card;
+       struct timer_list split_timeout_timer;
 
        struct fw_packet packet;