Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135997
b: refs/heads/master
c: 53dca51
h: refs/heads/master
i:
  135995: b7a2214
v: v3
  • Loading branch information
Stefan Richter committed Mar 24, 2009
1 parent abcba2c commit 49ae054
Show file tree
Hide file tree
Showing 12 changed files with 250 additions and 378 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2dbd7d7e2327b0c2cc4e2de903e1cfa19980a504
refs/heads/master: 53dca51175cc2f66d21aeb1e70146cca65c53dad
68 changes: 25 additions & 43 deletions trunk/drivers/firewire/fw-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ static int descriptor_count;
#define BIB_CMC ((1) << 30)
#define BIB_IMC ((1) << 31)

static u32 *
generate_config_rom(struct fw_card *card, size_t *config_rom_length)
static u32 *generate_config_rom(struct fw_card *card, size_t *config_rom_length)
{
struct fw_descriptor *desc;
static u32 config_rom[256];
Expand Down Expand Up @@ -128,8 +127,7 @@ generate_config_rom(struct fw_card *card, size_t *config_rom_length)
return config_rom;
}

static void
update_config_roms(void)
static void update_config_roms(void)
{
struct fw_card *card;
u32 *config_rom;
Expand All @@ -141,8 +139,7 @@ update_config_roms(void)
}
}

int
fw_core_add_descriptor(struct fw_descriptor *desc)
int fw_core_add_descriptor(struct fw_descriptor *desc)
{
size_t i;

Expand Down Expand Up @@ -171,8 +168,7 @@ fw_core_add_descriptor(struct fw_descriptor *desc)
return 0;
}

void
fw_core_remove_descriptor(struct fw_descriptor *desc)
void fw_core_remove_descriptor(struct fw_descriptor *desc)
{
mutex_lock(&card_mutex);

Expand All @@ -189,8 +185,7 @@ static const char gap_count_table[] = {
63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40
};

void
fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
{
int scheduled;

Expand All @@ -200,8 +195,7 @@ fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
fw_card_put(card);
}

static void
fw_card_bm_work(struct work_struct *work)
static void fw_card_bm_work(struct work_struct *work)
{
struct fw_card *card = container_of(work, struct fw_card, work.work);
struct fw_device *root_device;
Expand Down Expand Up @@ -371,17 +365,16 @@ fw_card_bm_work(struct work_struct *work)
fw_card_put(card);
}

static void
flush_timer_callback(unsigned long data)
static void flush_timer_callback(unsigned long data)
{
struct fw_card *card = (struct fw_card *)data;

fw_flush_transactions(card);
}

void
fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
struct device *device)
void fw_card_initialize(struct fw_card *card,
const struct fw_card_driver *driver,
struct device *device)
{
static atomic_t index = ATOMIC_INIT(-1);

Expand All @@ -406,9 +399,8 @@ fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver,
}
EXPORT_SYMBOL(fw_card_initialize);

int
fw_card_add(struct fw_card *card,
u32 max_receive, u32 link_speed, u64 guid)
int fw_card_add(struct fw_card *card,
u32 max_receive, u32 link_speed, u64 guid)
{
u32 *config_rom;
size_t length;
Expand Down Expand Up @@ -442,23 +434,20 @@ EXPORT_SYMBOL(fw_card_add);
* dummy driver just fails all IO.
*/

static int
dummy_enable(struct fw_card *card, u32 *config_rom, size_t length)
static int dummy_enable(struct fw_card *card, u32 *config_rom, size_t length)
{
BUG();
return -1;
}

static int
dummy_update_phy_reg(struct fw_card *card, int address,
int clear_bits, int set_bits)
static int dummy_update_phy_reg(struct fw_card *card, int address,
int clear_bits, int set_bits)
{
return -ENODEV;
}

static int
dummy_set_config_rom(struct fw_card *card,
u32 *config_rom, size_t length)
static int dummy_set_config_rom(struct fw_card *card,
u32 *config_rom, size_t length)
{
/*
* We take the card out of card_list before setting the dummy
Expand All @@ -468,27 +457,23 @@ dummy_set_config_rom(struct fw_card *card,
return -1;
}

static void
dummy_send_request(struct fw_card *card, struct fw_packet *packet)
static void dummy_send_request(struct fw_card *card, struct fw_packet *packet)
{
packet->callback(packet, card, -ENODEV);
}

static void
dummy_send_response(struct fw_card *card, struct fw_packet *packet)
static void dummy_send_response(struct fw_card *card, struct fw_packet *packet)
{
packet->callback(packet, card, -ENODEV);
}

static int
dummy_cancel_packet(struct fw_card *card, struct fw_packet *packet)
static int dummy_cancel_packet(struct fw_card *card, struct fw_packet *packet)
{
return -ENOENT;
}

static int
dummy_enable_phys_dma(struct fw_card *card,
int node_id, int generation)
static int dummy_enable_phys_dma(struct fw_card *card,
int node_id, int generation)
{
return -ENODEV;
}
Expand All @@ -503,16 +488,14 @@ static struct fw_card_driver dummy_driver = {
.enable_phys_dma = dummy_enable_phys_dma,
};

void
fw_card_release(struct kref *kref)
void fw_card_release(struct kref *kref)
{
struct fw_card *card = container_of(kref, struct fw_card, kref);

complete(&card->done);
}

void
fw_core_remove_card(struct fw_card *card)
void fw_core_remove_card(struct fw_card *card)
{
card->driver->update_phy_reg(card, 4,
PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
Expand All @@ -536,8 +519,7 @@ fw_core_remove_card(struct fw_card *card)
}
EXPORT_SYMBOL(fw_core_remove_card);

int
fw_core_initiate_bus_reset(struct fw_card *card, int short_reset)
int fw_core_initiate_bus_reset(struct fw_card *card, int short_reset)
{
int reg = short_reset ? 5 : 1;
int bit = short_reset ? PHY_BUS_SHORT_RESET : PHY_BUS_RESET;
Expand Down
88 changes: 37 additions & 51 deletions trunk/drivers/firewire/fw-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ struct client {
struct list_head link;
};

static inline void __user *
u64_to_uptr(__u64 value)
static inline void __user *u64_to_uptr(__u64 value)
{
return (void __user *)(unsigned long)value;
}

static inline __u64
uptr_to_u64(void __user *ptr)
static inline __u64 uptr_to_u64(void __user *ptr)
{
return (__u64)(unsigned long)ptr;
}
Expand Down Expand Up @@ -163,8 +161,8 @@ static void queue_event(struct client *client, struct event *event,
wake_up_interruptible(&client->wait);
}

static int
dequeue_event(struct client *client, char __user *buffer, size_t count)
static int dequeue_event(struct client *client,
char __user *buffer, size_t count)
{
unsigned long flags;
struct event *event;
Expand Down Expand Up @@ -203,18 +201,16 @@ dequeue_event(struct client *client, char __user *buffer, size_t count)
return ret;
}

static ssize_t
fw_device_op_read(struct file *file,
char __user *buffer, size_t count, loff_t *offset)
static ssize_t fw_device_op_read(struct file *file, char __user *buffer,
size_t count, loff_t *offset)
{
struct client *client = file->private_data;

return dequeue_event(client, buffer, count);
}

static void
fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
struct client *client)
static void fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
struct client *client)
{
struct fw_card *card = client->device->card;
unsigned long flags;
Expand All @@ -233,9 +229,8 @@ fill_bus_reset_event(struct fw_cdev_event_bus_reset *event,
spin_unlock_irqrestore(&card->lock, flags);
}

static void
for_each_client(struct fw_device *device,
void (*callback)(struct client *client))
static void for_each_client(struct fw_device *device,
void (*callback)(struct client *client))
{
struct client *c;

Expand All @@ -245,8 +240,7 @@ for_each_client(struct fw_device *device,
mutex_unlock(&device->client_list_mutex);
}

static void
queue_bus_reset_event(struct client *client)
static void queue_bus_reset_event(struct client *client)
{
struct bus_reset *bus_reset;

Expand Down Expand Up @@ -316,9 +310,8 @@ static int ioctl_get_info(struct client *client, void *buffer)
return 0;
}

static int
add_client_resource(struct client *client, struct client_resource *resource,
gfp_t gfp_mask)
static int add_client_resource(struct client *client,
struct client_resource *resource, gfp_t gfp_mask)
{
unsigned long flags;
int ret;
Expand All @@ -341,10 +334,9 @@ add_client_resource(struct client *client, struct client_resource *resource,
return ret < 0 ? ret : 0;
}

static int
release_client_resource(struct client *client, u32 handle,
client_resource_release_fn_t release,
struct client_resource **resource)
static int release_client_resource(struct client *client, u32 handle,
client_resource_release_fn_t release,
struct client_resource **resource)
{
struct client_resource *r;
unsigned long flags;
Expand All @@ -369,18 +361,17 @@ release_client_resource(struct client *client, u32 handle,
return 0;
}

static void
release_transaction(struct client *client, struct client_resource *resource)
static void release_transaction(struct client *client,
struct client_resource *resource)
{
struct response *response =
container_of(resource, struct response, resource);

fw_cancel_transaction(client->device->card, &response->transaction);
}

static void
complete_transaction(struct fw_card *card, int rcode,
void *payload, size_t length, void *data)
static void complete_transaction(struct fw_card *card, int rcode,
void *payload, size_t length, void *data)
{
struct response *response = data;
struct client *client = response->client;
Expand Down Expand Up @@ -506,8 +497,8 @@ struct request_event {
struct fw_cdev_event_request request;
};

static void
release_request(struct client *client, struct client_resource *resource)
static void release_request(struct client *client,
struct client_resource *resource)
{
struct request *request =
container_of(resource, struct request, resource);
Expand All @@ -517,12 +508,11 @@ release_request(struct client *client, struct client_resource *resource)
kfree(request);
}

static void
handle_request(struct fw_card *card, struct fw_request *r,
int tcode, int destination, int source,
int generation, int speed,
unsigned long long offset,
void *payload, size_t length, void *callback_data)
static void handle_request(struct fw_card *card, struct fw_request *r,
int tcode, int destination, int source,
int generation, int speed,
unsigned long long offset,
void *payload, size_t length, void *callback_data)
{
struct address_handler *handler = callback_data;
struct request *request;
Expand Down Expand Up @@ -561,9 +551,8 @@ handle_request(struct fw_card *card, struct fw_request *r,
fw_send_response(card, r, RCODE_CONFLICT_ERROR);
}

static void
release_address_handler(struct client *client,
struct client_resource *resource)
static void release_address_handler(struct client *client,
struct client_resource *resource)
{
struct address_handler *handler =
container_of(resource, struct address_handler, resource);
Expand Down Expand Up @@ -716,9 +705,8 @@ static int ioctl_remove_descriptor(struct client *client, void *buffer)
release_descriptor, NULL);
}

static void
iso_callback(struct fw_iso_context *context, u32 cycle,
size_t header_length, void *header, void *data)
static void iso_callback(struct fw_iso_context *context, u32 cycle,
size_t header_length, void *header, void *data)
{
struct client *client = data;
struct iso_interrupt *irq;
Expand Down Expand Up @@ -954,8 +942,8 @@ static int (* const ioctl_handlers[])(struct client *client, void *buffer) = {
ioctl_get_cycle_timer,
};

static int
dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
static int dispatch_ioctl(struct client *client,
unsigned int cmd, void __user *arg)
{
char buffer[256];
int ret;
Expand Down Expand Up @@ -983,9 +971,8 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
return ret;
}

static long
fw_device_op_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
static long fw_device_op_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
struct client *client = file->private_data;

Expand All @@ -996,9 +983,8 @@ fw_device_op_ioctl(struct file *file,
}

#ifdef CONFIG_COMPAT
static long
fw_device_op_compat_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
static long fw_device_op_compat_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
struct client *client = file->private_data;

Expand Down
Loading

0 comments on commit 49ae054

Please sign in to comment.