diff options
Diffstat (limited to 'drivers/firewire/core.h')
| -rw-r--r-- | drivers/firewire/core.h | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h index b45be576752..e1480ff683d 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h @@ -1,6 +1,9 @@ #ifndef _FIREWIRE_CORE_H #define _FIREWIRE_CORE_H +#include <linux/compiler.h> +#include <linux/device.h> +#include <linux/dma-mapping.h> #include <linux/fs.h> #include <linux/list.h> #include <linux/idr.h> @@ -23,6 +26,11 @@ struct fw_packet; /* -card */ +extern __printf(2, 3) +void fw_err(const struct fw_card *card, const char *fmt, ...); +extern __printf(2, 3) +void fw_notice(const struct fw_card *card, const char *fmt, ...); + /* bitfields within the PHY registers */ #define PHY_LINK_ACTIVE 0x80 #define PHY_CONTENDER 0x40 @@ -99,6 +107,8 @@ struct fw_card_driver { void (*flush_queue_iso)(struct fw_iso_context *ctx); + int (*flush_iso_completions)(struct fw_iso_context *ctx); + int (*stop_iso)(struct fw_iso_context *ctx); }; @@ -108,24 +118,8 @@ int fw_card_add(struct fw_card *card, u32 max_receive, u32 link_speed, u64 guid); void fw_core_remove_card(struct fw_card *card); int fw_compute_block_crc(__be32 *block); -void fw_schedule_bus_reset(struct fw_card *card, bool delayed, bool short_reset); void fw_schedule_bm_work(struct fw_card *card, unsigned long delay); -static inline struct fw_card *fw_card_get(struct fw_card *card) -{ - kref_get(&card->kref); - - return card; -} - -void fw_card_release(struct kref *kref); - -static inline void fw_card_put(struct fw_card *card) -{ - kref_put(&card->kref, fw_card_release); -} - - /* -cdev */ extern const struct file_operations fw_device_ops; @@ -141,6 +135,18 @@ extern struct rw_semaphore fw_device_rwsem; extern struct idr fw_device_idr; extern int fw_cdev_major; +static inline struct fw_device *fw_device_get(struct fw_device *device) +{ + get_device(&device->device); + + return device; +} + +static inline void fw_device_put(struct fw_device *device) +{ + put_device(&device->device); +} + struct fw_device *fw_device_get_by_devt(dev_t devt); int fw_device_set_broadcast_channel(struct device *dev, void *gen); void fw_node_event(struct fw_card *card, struct fw_node *node, int event); @@ -148,7 +154,11 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event); /* -iso */ -int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma); +int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, int page_count); +int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *card, + enum dma_data_direction direction); +int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer, + struct vm_area_struct *vma); /* -topology */ @@ -226,6 +236,9 @@ static inline bool is_next_generation(int new_generation, int old_generation) #define LOCAL_BUS 0xffc0 +/* OHCI-1394's default upper bound for physical DMA: 4 GB */ +#define FW_MAX_PHYSICAL_RANGE (1ULL << 32) + void fw_core_handle_request(struct fw_card *card, struct fw_packet *request); void fw_core_handle_response(struct fw_card *card, struct fw_packet *packet); int fw_get_response_length(struct fw_request *request); |
