Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
[safe/jmp/linux-2.6] / include / linux / firewire.h
index 7e1d4de..72e2b8a 100644 (file)
 #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args)
 #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args)
 
-static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size)
-{
-       u32    *dst = _dst;
-       __be32 *src = _src;
-       int i;
-
-       for (i = 0; i < size / 4; i++)
-               dst[i] = be32_to_cpu(src[i]);
-}
-
-static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size)
-{
-       fw_memcpy_from_be32(_dst, _src, size);
-}
 #define CSR_REGISTER_BASE              0xfffff0000000ULL
 
 /* register offsets are relative to CSR_REGISTER_BASE */
@@ -69,22 +55,21 @@ static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size)
 #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;
 
@@ -102,7 +87,6 @@ struct fw_card {
        int current_tlabel;
        u64 tlabel_mask;
        struct list_head transaction_list;
-       struct timer_list flush_timer;
        unsigned long reset_jiffies;
 
        unsigned long long guid;
@@ -131,7 +115,7 @@ struct fw_card {
 
        bool broadcast_channel_allocated;
        u32 broadcast_channel;
-       u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
+       __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
 };
 
 struct fw_attribute_group {
@@ -176,7 +160,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;
@@ -218,7 +202,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;
 };
 
@@ -262,8 +246,8 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode,
                                          void *data, size_t length,
                                          void *callback_data);
 /*
- * Important note:  The callback must guarantee that either fw_send_response()
- * or kfree() is called on the @request.
+ * Important note:  Except for the FCP registers, the callback must guarantee
+ * that either fw_send_response() or kfree() is called on the @request.
  */
 typedef void (*fw_address_callback_t)(struct fw_card *card,
                                      struct fw_request *request,
@@ -281,6 +265,7 @@ struct fw_packet {
        void *payload;
        size_t payload_length;
        dma_addr_t payload_bus;
+       bool payload_mapped;
        u32 timestamp;
 
        /*
@@ -302,6 +287,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;