aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/firewire/fw-cdev.c10
-rw-r--r--include/linux/firewire-cdev.h10
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 08fe68d34f32..05ad2a8f286c 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -1220,6 +1220,15 @@ static int ioctl_deallocate_iso_resource_once(struct client *client, void *buffe
1220 return init_iso_resource(client, request, ISO_RES_DEALLOC_ONCE); 1220 return init_iso_resource(client, request, ISO_RES_DEALLOC_ONCE);
1221} 1221}
1222 1222
1223static int ioctl_get_speed(struct client *client, void *buffer)
1224{
1225 struct fw_cdev_get_speed *request = buffer;
1226
1227 request->max_speed = client->device->max_speed;
1228
1229 return 0;
1230}
1231
1223static int (* const ioctl_handlers[])(struct client *client, void *buffer) = { 1232static int (* const ioctl_handlers[])(struct client *client, void *buffer) = {
1224 ioctl_get_info, 1233 ioctl_get_info,
1225 ioctl_send_request, 1234 ioctl_send_request,
@@ -1238,6 +1247,7 @@ static int (* const ioctl_handlers[])(struct client *client, void *buffer) = {
1238 ioctl_deallocate_iso_resource, 1247 ioctl_deallocate_iso_resource,
1239 ioctl_allocate_iso_resource_once, 1248 ioctl_allocate_iso_resource_once,
1240 ioctl_deallocate_iso_resource_once, 1249 ioctl_deallocate_iso_resource_once,
1250 ioctl_get_speed,
1241}; 1251};
1242 1252
1243static int dispatch_ioctl(struct client *client, 1253static int dispatch_ioctl(struct client *client,
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 08ca838a727b..f819c1026958 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -229,6 +229,7 @@ union fw_cdev_event {
229#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate) 229#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE _IOW('#', 0x0e, struct fw_cdev_deallocate)
230#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource) 230#define FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x0f, struct fw_cdev_allocate_iso_resource)
231#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource) 231#define FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE_ONCE _IOW('#', 0x10, struct fw_cdev_allocate_iso_resource)
232#define FW_CDEV_IOC_GET_SPEED _IOR('#', 0x11, struct fw_cdev_get_speed)
232 233
233/* FW_CDEV_VERSION History 234/* FW_CDEV_VERSION History
234 * 235 *
@@ -575,4 +576,13 @@ struct fw_cdev_allocate_iso_resource {
575 __u32 handle; 576 __u32 handle;
576}; 577};
577 578
579/**
580 * struct fw_cdev_get_speed - Query maximum speed to or from this device
581 * @max_speed: Speed code; minimum of the device's link speed, the local node's
582 * link speed, and all PHY port speeds between the two links
583 */
584struct fw_cdev_get_speed {
585 __u32 max_speed;
586};
587
578#endif /* _LINUX_FIREWIRE_CDEV_H */ 588#endif /* _LINUX_FIREWIRE_CDEV_H */