#include <linux/bug.h>
#include <linux/completion.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/idr.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/rculist.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/types.h>
#include <linux/workqueue.h>
#include <asm/byteorder.h>
#include "core.h"
#include "packet-header-definitions.h"
#include "phy-packet-definitions.h"
#include <trace/events/firewire.h>
#define HEADER_DESTINATION_IS_BROADCAST(header) …
static int try_cancel_split_timeout(struct fw_transaction *t)
{ … }
static int close_transaction(struct fw_transaction *transaction, struct fw_card *card, int rcode,
u32 response_tstamp)
{ … }
int fw_cancel_transaction(struct fw_card *card,
struct fw_transaction *transaction)
{ … }
EXPORT_SYMBOL(…);
static void split_transaction_timeout_callback(struct timer_list *timer)
{ … }
static void start_split_transaction_timeout(struct fw_transaction *t,
struct fw_card *card)
{ … }
static u32 compute_split_timeout_timestamp(struct fw_card *card, u32 request_timestamp);
static void transmit_complete_callback(struct fw_packet *packet,
struct fw_card *card, int status)
{ … }
static void fw_fill_request(struct fw_packet *packet, int tcode, int tlabel,
int destination_id, int source_id, int generation, int speed,
unsigned long long offset, void *payload, size_t length)
{ … }
static int allocate_tlabel(struct fw_card *card)
{ … }
void __fw_send_request(struct fw_card *card, struct fw_transaction *t, int tcode,
int destination_id, int generation, int speed, unsigned long long offset,
void *payload, size_t length, union fw_transaction_callback callback,
bool with_tstamp, void *callback_data)
{ … }
EXPORT_SYMBOL_GPL(…);
struct transaction_callback_data { … };
static void transaction_callback(struct fw_card *card, int rcode,
void *payload, size_t length, void *data)
{ … }
int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
int generation, int speed, unsigned long long offset,
void *payload, size_t length)
{ … }
EXPORT_SYMBOL(…);
static DEFINE_MUTEX(phy_config_mutex);
static DECLARE_COMPLETION(phy_config_done);
static void transmit_phy_packet_callback(struct fw_packet *packet,
struct fw_card *card, int status)
{ … }
static struct fw_packet phy_config_packet = …;
void fw_send_phy_config(struct fw_card *card,
int node_id, int generation, int gap_count)
{ … }
static struct fw_address_handler *lookup_overlapping_address_handler(
struct list_head *list, unsigned long long offset, size_t length)
{ … }
static bool is_enclosing_handler(struct fw_address_handler *handler,
unsigned long long offset, size_t length)
{ … }
static struct fw_address_handler *lookup_enclosing_address_handler(
struct list_head *list, unsigned long long offset, size_t length)
{ … }
static DEFINE_SPINLOCK(address_handler_list_lock);
static LIST_HEAD(address_handler_list);
const struct fw_address_region fw_high_memory_region = …;
EXPORT_SYMBOL(…);
static const struct fw_address_region low_memory_region = …;
#if 0
const struct fw_address_region fw_private_region =
{ .start = 0xffffe0000000ULL, .end = 0xfffff0000000ULL, };
const struct fw_address_region fw_csr_region =
{ .start = CSR_REGISTER_BASE,
.end = CSR_REGISTER_BASE | CSR_CONFIG_ROM_END, };
const struct fw_address_region fw_unit_space_region =
{ .start = 0xfffff0000900ULL, .end = 0x1000000000000ULL, };
#endif
int fw_core_add_address_handler(struct fw_address_handler *handler,
const struct fw_address_region *region)
{ … }
EXPORT_SYMBOL(…);
void fw_core_remove_address_handler(struct fw_address_handler *handler)
{ … }
EXPORT_SYMBOL(…);
struct fw_request { … };
void fw_request_get(struct fw_request *request)
{ … }
static void release_request(struct kref *kref)
{ … }
void fw_request_put(struct fw_request *request)
{ … }
static void free_response_callback(struct fw_packet *packet,
struct fw_card *card, int status)
{ … }
int fw_get_response_length(struct fw_request *r)
{ … }
void fw_fill_response(struct fw_packet *response, u32 *request_header,
int rcode, void *payload, size_t length)
{ … }
EXPORT_SYMBOL(…);
static u32 compute_split_timeout_timestamp(struct fw_card *card,
u32 request_timestamp)
{ … }
static struct fw_request *allocate_request(struct fw_card *card,
struct fw_packet *p)
{ … }
void fw_send_response(struct fw_card *card,
struct fw_request *request, int rcode)
{ … }
EXPORT_SYMBOL(…);
int fw_get_request_speed(struct fw_request *request)
{ … }
EXPORT_SYMBOL(…);
u32 fw_request_get_timestamp(const struct fw_request *request)
{ … }
EXPORT_SYMBOL_GPL(…);
static void handle_exclusive_region_request(struct fw_card *card,
struct fw_packet *p,
struct fw_request *request,
unsigned long long offset)
{ … }
static void handle_fcp_region_request(struct fw_card *card,
struct fw_packet *p,
struct fw_request *request,
unsigned long long offset)
{ … }
void fw_core_handle_request(struct fw_card *card, struct fw_packet *p)
{ … }
EXPORT_SYMBOL(…);
void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
{ … }
EXPORT_SYMBOL(…);
const char *fw_rcode_string(int rcode)
{ … }
EXPORT_SYMBOL(…);
static const struct fw_address_region topology_map_region = …;
static void handle_topology_map(struct fw_card *card, struct fw_request *request,
int tcode, int destination, int source, int generation,
unsigned long long offset, void *payload, size_t length,
void *callback_data)
{ … }
static struct fw_address_handler topology_map = …;
static const struct fw_address_region registers_region = …;
static void update_split_timeout(struct fw_card *card)
{ … }
static void handle_registers(struct fw_card *card, struct fw_request *request,
int tcode, int destination, int source, int generation,
unsigned long long offset, void *payload, size_t length,
void *callback_data)
{ … }
static struct fw_address_handler registers = …;
static void handle_low_memory(struct fw_card *card, struct fw_request *request,
int tcode, int destination, int source, int generation,
unsigned long long offset, void *payload, size_t length,
void *callback_data)
{ … }
static struct fw_address_handler low_memory = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static const u32 vendor_textual_descriptor[] = …;
static const u32 model_textual_descriptor[] = …;
static struct fw_descriptor vendor_id_descriptor = …;
static struct fw_descriptor model_id_descriptor = …;
static int __init fw_core_init(void)
{ … }
static void __exit fw_core_cleanup(void)
{ … }
module_init(…) …;
module_exit(fw_core_cleanup);