aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-03-07 12:12:42 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:03:08 -0500
commit5371842b723dd04df57171f2c74660966901380c (patch)
treed94e2f9a128f736b6ee92c4c6a6d7819d06e4908
parent97bd9efa5a4d8a70b3bafe0d1e3e1a814fdac5bc (diff)
firewire: Implement ioctl to initiate bus reset.
Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r--drivers/firewire/fw-device-cdev.c15
-rw-r--r--drivers/firewire/fw-device-cdev.h16
2 files changed, 27 insertions, 4 deletions
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c
index 9f3c96c7af29..79e095ea552d 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -433,6 +433,19 @@ static int ioctl_send_response(struct client *client, void __user *arg)
433 return 0; 433 return 0;
434} 434}
435 435
436static int ioctl_initiate_bus_reset(struct client *client, void __user *arg)
437{
438 struct fw_cdev_initiate_bus_reset request;
439 int short_reset;
440
441 if (copy_from_user(&request, arg, sizeof request))
442 return -EFAULT;
443
444 short_reset = (request.type == FW_CDEV_SHORT_RESET);
445
446 return fw_core_initiate_bus_reset(client->device->card, short_reset);
447}
448
436static void 449static void
437iso_callback(struct fw_iso_context *context, u32 cycle, 450iso_callback(struct fw_iso_context *context, u32 cycle,
438 size_t header_length, void *header, void *data) 451 size_t header_length, void *header, void *data)
@@ -606,6 +619,8 @@ dispatch_ioctl(struct client *client, unsigned int cmd, void __user *arg)
606 return ioctl_allocate(client, arg); 619 return ioctl_allocate(client, arg);
607 case FW_CDEV_IOC_SEND_RESPONSE: 620 case FW_CDEV_IOC_SEND_RESPONSE:
608 return ioctl_send_response(client, arg); 621 return ioctl_send_response(client, arg);
622 case FW_CDEV_IOC_INITIATE_BUS_RESET:
623 return ioctl_initiate_bus_reset(client, arg);
609 case FW_CDEV_IOC_CREATE_ISO_CONTEXT: 624 case FW_CDEV_IOC_CREATE_ISO_CONTEXT:
610 return ioctl_create_iso_context(client, arg); 625 return ioctl_create_iso_context(client, arg);
611 case FW_CDEV_IOC_QUEUE_ISO: 626 case FW_CDEV_IOC_QUEUE_ISO:
diff --git a/drivers/firewire/fw-device-cdev.h b/drivers/firewire/fw-device-cdev.h
index 4f94471b8078..8a8b390d5996 100644
--- a/drivers/firewire/fw-device-cdev.h
+++ b/drivers/firewire/fw-device-cdev.h
@@ -108,10 +108,11 @@ struct fw_cdev_event_iso_interrupt {
108#define FW_CDEV_IOC_SEND_REQUEST _IO('#', 0x01) 108#define FW_CDEV_IOC_SEND_REQUEST _IO('#', 0x01)
109#define FW_CDEV_IOC_ALLOCATE _IO('#', 0x02) 109#define FW_CDEV_IOC_ALLOCATE _IO('#', 0x02)
110#define FW_CDEV_IOC_SEND_RESPONSE _IO('#', 0x03) 110#define FW_CDEV_IOC_SEND_RESPONSE _IO('#', 0x03)
111#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x04) 111#define FW_CDEV_IOC_INITIATE_BUS_RESET _IO('#', 0x04)
112#define FW_CDEV_IOC_QUEUE_ISO _IO('#', 0x05) 112#define FW_CDEV_IOC_CREATE_ISO_CONTEXT _IO('#', 0x05)
113#define FW_CDEV_IOC_START_ISO _IO('#', 0x06) 113#define FW_CDEV_IOC_QUEUE_ISO _IO('#', 0x06)
114#define FW_CDEV_IOC_STOP_ISO _IO('#', 0x07) 114#define FW_CDEV_IOC_START_ISO _IO('#', 0x07)
115#define FW_CDEV_IOC_STOP_ISO _IO('#', 0x08)
115 116
116struct fw_cdev_get_config_rom { 117struct fw_cdev_get_config_rom {
117 __u32 length; 118 __u32 length;
@@ -139,6 +140,13 @@ struct fw_cdev_allocate {
139 __u32 length; 140 __u32 length;
140}; 141};
141 142
143#define FW_CDEV_LONG_RESET 0
144#define FW_CDEV_SHORT_RESET 1
145
146struct fw_cdev_initiate_bus_reset {
147 __u32 type;
148};
149
142#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 150#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
143#define FW_CDEV_ISO_CONTEXT_RECEIVE 1 151#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
144 152