diff options
Diffstat (limited to 'include/linux/firewire.h')
| -rw-r--r-- | include/linux/firewire.h | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 7e1d4dec83e7..4bd94bf5e739 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
| @@ -20,20 +20,6 @@ | |||
| 20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) | 20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) |
| 21 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) | 21 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) |
| 22 | 22 | ||
| 23 | static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size) | ||
| 24 | { | ||
| 25 | u32 *dst = _dst; | ||
| 26 | __be32 *src = _src; | ||
| 27 | int i; | ||
| 28 | |||
| 29 | for (i = 0; i < size / 4; i++) | ||
| 30 | dst[i] = be32_to_cpu(src[i]); | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size) | ||
| 34 | { | ||
| 35 | fw_memcpy_from_be32(_dst, _src, size); | ||
| 36 | } | ||
| 37 | #define CSR_REGISTER_BASE 0xfffff0000000ULL | 23 | #define CSR_REGISTER_BASE 0xfffff0000000ULL |
| 38 | 24 | ||
| 39 | /* register offsets are relative to CSR_REGISTER_BASE */ | 25 | /* register offsets are relative to CSR_REGISTER_BASE */ |
| @@ -79,12 +65,13 @@ static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size) | |||
| 79 | #define CSR_DIRECTORY_ID 0x20 | 65 | #define CSR_DIRECTORY_ID 0x20 |
| 80 | 66 | ||
| 81 | struct fw_csr_iterator { | 67 | struct fw_csr_iterator { |
| 82 | u32 *p; | 68 | const u32 *p; |
| 83 | u32 *end; | 69 | const u32 *end; |
| 84 | }; | 70 | }; |
| 85 | 71 | ||
| 86 | void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p); | 72 | void fw_csr_iterator_init(struct fw_csr_iterator *ci, const u32 *p); |
| 87 | int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value); | 73 | int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value); |
| 74 | int fw_csr_string(const u32 *directory, int key, char *buf, size_t size); | ||
| 88 | 75 | ||
| 89 | extern struct bus_type fw_bus_type; | 76 | extern struct bus_type fw_bus_type; |
| 90 | 77 | ||
| @@ -131,7 +118,7 @@ struct fw_card { | |||
| 131 | 118 | ||
| 132 | bool broadcast_channel_allocated; | 119 | bool broadcast_channel_allocated; |
| 133 | u32 broadcast_channel; | 120 | u32 broadcast_channel; |
| 134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | 121 | __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; |
| 135 | }; | 122 | }; |
| 136 | 123 | ||
| 137 | struct fw_attribute_group { | 124 | struct fw_attribute_group { |
| @@ -176,7 +163,7 @@ struct fw_device { | |||
| 176 | struct mutex client_list_mutex; | 163 | struct mutex client_list_mutex; |
| 177 | struct list_head client_list; | 164 | struct list_head client_list; |
| 178 | 165 | ||
| 179 | u32 *config_rom; | 166 | const u32 *config_rom; |
| 180 | size_t config_rom_length; | 167 | size_t config_rom_length; |
| 181 | int config_rom_retries; | 168 | int config_rom_retries; |
| 182 | unsigned is_local:1; | 169 | unsigned is_local:1; |
| @@ -218,7 +205,7 @@ int fw_device_enable_phys_dma(struct fw_device *device); | |||
| 218 | */ | 205 | */ |
| 219 | struct fw_unit { | 206 | struct fw_unit { |
| 220 | struct device device; | 207 | struct device device; |
| 221 | u32 *directory; | 208 | const u32 *directory; |
| 222 | struct fw_attribute_group attribute_group; | 209 | struct fw_attribute_group attribute_group; |
| 223 | }; | 210 | }; |
| 224 | 211 | ||
| @@ -262,8 +249,8 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | |||
| 262 | void *data, size_t length, | 249 | void *data, size_t length, |
| 263 | void *callback_data); | 250 | void *callback_data); |
| 264 | /* | 251 | /* |
| 265 | * Important note: The callback must guarantee that either fw_send_response() | 252 | * Important note: Except for the FCP registers, the callback must guarantee |
| 266 | * or kfree() is called on the @request. | 253 | * that either fw_send_response() or kfree() is called on the @request. |
| 267 | */ | 254 | */ |
| 268 | typedef void (*fw_address_callback_t)(struct fw_card *card, | 255 | typedef void (*fw_address_callback_t)(struct fw_card *card, |
| 269 | struct fw_request *request, | 256 | struct fw_request *request, |
| @@ -281,6 +268,7 @@ struct fw_packet { | |||
| 281 | void *payload; | 268 | void *payload; |
| 282 | size_t payload_length; | 269 | size_t payload_length; |
| 283 | dma_addr_t payload_bus; | 270 | dma_addr_t payload_bus; |
| 271 | bool payload_mapped; | ||
| 284 | u32 timestamp; | 272 | u32 timestamp; |
| 285 | 273 | ||
| 286 | /* | 274 | /* |
