diff options
Diffstat (limited to 'drivers/firewire/core-cdev.c')
-rw-r--r-- | drivers/firewire/core-cdev.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 4799393247c8..22c6df5f136d 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c | |||
@@ -51,7 +51,7 @@ | |||
51 | /* | 51 | /* |
52 | * ABI version history is documented in linux/firewire-cdev.h. | 52 | * ABI version history is documented in linux/firewire-cdev.h. |
53 | */ | 53 | */ |
54 | #define FW_CDEV_KERNEL_VERSION 4 | 54 | #define FW_CDEV_KERNEL_VERSION 5 |
55 | #define FW_CDEV_VERSION_EVENT_REQUEST2 4 | 55 | #define FW_CDEV_VERSION_EVENT_REQUEST2 4 |
56 | #define FW_CDEV_VERSION_ALLOCATE_REGION_END 4 | 56 | #define FW_CDEV_VERSION_ALLOCATE_REGION_END 4 |
57 | 57 | ||
@@ -389,7 +389,7 @@ static void queue_bus_reset_event(struct client *client) | |||
389 | 389 | ||
390 | e = kzalloc(sizeof(*e), GFP_KERNEL); | 390 | e = kzalloc(sizeof(*e), GFP_KERNEL); |
391 | if (e == NULL) { | 391 | if (e == NULL) { |
392 | fw_notify("Out of memory when allocating event\n"); | 392 | fw_notice(client->device->card, "out of memory when allocating event\n"); |
393 | return; | 393 | return; |
394 | } | 394 | } |
395 | 395 | ||
@@ -438,6 +438,7 @@ union ioctl_arg { | |||
438 | struct fw_cdev_send_phy_packet send_phy_packet; | 438 | struct fw_cdev_send_phy_packet send_phy_packet; |
439 | struct fw_cdev_receive_phy_packets receive_phy_packets; | 439 | struct fw_cdev_receive_phy_packets receive_phy_packets; |
440 | struct fw_cdev_set_iso_channels set_iso_channels; | 440 | struct fw_cdev_set_iso_channels set_iso_channels; |
441 | struct fw_cdev_flush_iso flush_iso; | ||
441 | }; | 442 | }; |
442 | 443 | ||
443 | static int ioctl_get_info(struct client *client, union ioctl_arg *arg) | 444 | static int ioctl_get_info(struct client *client, union ioctl_arg *arg) |
@@ -691,7 +692,7 @@ static void handle_request(struct fw_card *card, struct fw_request *request, | |||
691 | r = kmalloc(sizeof(*r), GFP_ATOMIC); | 692 | r = kmalloc(sizeof(*r), GFP_ATOMIC); |
692 | e = kmalloc(sizeof(*e), GFP_ATOMIC); | 693 | e = kmalloc(sizeof(*e), GFP_ATOMIC); |
693 | if (r == NULL || e == NULL) { | 694 | if (r == NULL || e == NULL) { |
694 | fw_notify("Out of memory when allocating event\n"); | 695 | fw_notice(card, "out of memory when allocating event\n"); |
695 | goto failed; | 696 | goto failed; |
696 | } | 697 | } |
697 | r->card = card; | 698 | r->card = card; |
@@ -928,7 +929,7 @@ static void iso_callback(struct fw_iso_context *context, u32 cycle, | |||
928 | 929 | ||
929 | e = kmalloc(sizeof(*e) + header_length, GFP_ATOMIC); | 930 | e = kmalloc(sizeof(*e) + header_length, GFP_ATOMIC); |
930 | if (e == NULL) { | 931 | if (e == NULL) { |
931 | fw_notify("Out of memory when allocating event\n"); | 932 | fw_notice(context->card, "out of memory when allocating event\n"); |
932 | return; | 933 | return; |
933 | } | 934 | } |
934 | e->interrupt.type = FW_CDEV_EVENT_ISO_INTERRUPT; | 935 | e->interrupt.type = FW_CDEV_EVENT_ISO_INTERRUPT; |
@@ -948,7 +949,7 @@ static void iso_mc_callback(struct fw_iso_context *context, | |||
948 | 949 | ||
949 | e = kmalloc(sizeof(*e), GFP_ATOMIC); | 950 | e = kmalloc(sizeof(*e), GFP_ATOMIC); |
950 | if (e == NULL) { | 951 | if (e == NULL) { |
951 | fw_notify("Out of memory when allocating event\n"); | 952 | fw_notice(context->card, "out of memory when allocating event\n"); |
952 | return; | 953 | return; |
953 | } | 954 | } |
954 | e->interrupt.type = FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL; | 955 | e->interrupt.type = FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL; |
@@ -1168,6 +1169,16 @@ static int ioctl_stop_iso(struct client *client, union ioctl_arg *arg) | |||
1168 | return fw_iso_context_stop(client->iso_context); | 1169 | return fw_iso_context_stop(client->iso_context); |
1169 | } | 1170 | } |
1170 | 1171 | ||
1172 | static int ioctl_flush_iso(struct client *client, union ioctl_arg *arg) | ||
1173 | { | ||
1174 | struct fw_cdev_flush_iso *a = &arg->flush_iso; | ||
1175 | |||
1176 | if (client->iso_context == NULL || a->handle != 0) | ||
1177 | return -EINVAL; | ||
1178 | |||
1179 | return fw_iso_context_flush_completions(client->iso_context); | ||
1180 | } | ||
1181 | |||
1171 | static int ioctl_get_cycle_timer2(struct client *client, union ioctl_arg *arg) | 1182 | static int ioctl_get_cycle_timer2(struct client *client, union ioctl_arg *arg) |
1172 | { | 1183 | { |
1173 | struct fw_cdev_get_cycle_timer2 *a = &arg->get_cycle_timer2; | 1184 | struct fw_cdev_get_cycle_timer2 *a = &arg->get_cycle_timer2; |
@@ -1548,7 +1559,7 @@ void fw_cdev_handle_phy_packet(struct fw_card *card, struct fw_packet *p) | |||
1548 | list_for_each_entry(client, &card->phy_receiver_list, phy_receiver_link) { | 1559 | list_for_each_entry(client, &card->phy_receiver_list, phy_receiver_link) { |
1549 | e = kmalloc(sizeof(*e) + 8, GFP_ATOMIC); | 1560 | e = kmalloc(sizeof(*e) + 8, GFP_ATOMIC); |
1550 | if (e == NULL) { | 1561 | if (e == NULL) { |
1551 | fw_notify("Out of memory when allocating event\n"); | 1562 | fw_notice(card, "out of memory when allocating event\n"); |
1552 | break; | 1563 | break; |
1553 | } | 1564 | } |
1554 | e->phy_packet.closure = client->phy_receiver_closure; | 1565 | e->phy_packet.closure = client->phy_receiver_closure; |
@@ -1589,6 +1600,7 @@ static int (* const ioctl_handlers[])(struct client *, union ioctl_arg *) = { | |||
1589 | [0x15] = ioctl_send_phy_packet, | 1600 | [0x15] = ioctl_send_phy_packet, |
1590 | [0x16] = ioctl_receive_phy_packets, | 1601 | [0x16] = ioctl_receive_phy_packets, |
1591 | [0x17] = ioctl_set_iso_channels, | 1602 | [0x17] = ioctl_set_iso_channels, |
1603 | [0x18] = ioctl_flush_iso, | ||
1592 | }; | 1604 | }; |
1593 | 1605 | ||
1594 | static int dispatch_ioctl(struct client *client, | 1606 | static int dispatch_ioctl(struct client *client, |