The len_routes field is used to tell the size of the routes array in struct v4l2_subdev_routing. This way the number of routes returned from S_ROUTING IOCTL may be larger than the number of routes provided, in case there are more routes returned by the driver. Note that this uAPI is still disabled in the code, so this change can safely be done. Anyone who manually patched the code to enable this uAPI must update their code. The patch also increases the number of reserved fields in struct v4l2_subdev_routing.
Showing the changes to include/uapi (1 of 5 files). Show all
Unified · Split
| @@ -228,15 +228,19 @@ struct v4l2_subdev_route { · 227 unmodified lines | ||
| 228 | 228 | * struct v4l2_subdev_routing - Subdev routing information |
| 229 | 229 | * |
| 230 | 230 | * @which: configuration type (from enum v4l2_subdev_format_whence) |
| 231 | − * @num_routes: the total number of routes in the routes array | |
| 231 | + * @len_routes: the length of the routes array, in routes; set by the user, not | |
| 232 | + * modified by the kernel | |
| 232 | 233 | * @routes: pointer to the routes array |
| 234 | + * @num_routes: the total number of routes, possibly more than fits in the | |
| 235 | + * routes array | |
| 233 | 236 | * @reserved: drivers and applications must zero this array |
| 234 | 237 | */ |
| 235 | 238 | struct v4l2_subdev_routing { |
| 236 | 239 | __u32 which; |
| 237 | − __u32 num_routes; | |
| 240 | + __u32 len_routes; | |
| 238 | 241 | __u64 routes; |
| 239 | − __u32 reserved[6]; | |
| 242 | + __u32 num_routes; | |
| 243 | + __u32 reserved[11]; | |
| 240 | 244 | }; |
| 241 | 245 | |
| 242 | 246 | /* |