Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: convert usb.h struct usb_device to kernel-doc

Convert struct usb_device to use kernel-doc notation.
Please especially check the @filelist and @usb_classdev descriptions.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


authored by

Randy Dunlap and committed by
Greg Kroah-Hartman
f476fbab c27a4b71

+101 -61
+101 -61
include/linux/usb.h
··· 341 341 342 342 struct usb_tt; 343 343 344 - /* 344 + /** 345 345 * struct usb_device - kernel's representation of a USB device 346 + * @devnum: device number; address on a USB bus 347 + * @devpath: device ID string for use in messages (e.g., /port/...) 348 + * @state: device state: configured, not attached, etc. 349 + * @speed: device speed: high/full/low (or error) 350 + * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub 351 + * @ttport: device port on that tt hub 352 + * @toggle: one bit for each endpoint, with ([0] = IN, [1] = OUT) endpoints 353 + * @parent: our hub, unless we're the root 354 + * @bus: bus we're part of 355 + * @ep0: endpoint 0 data (default control pipe) 356 + * @dev: generic device interface 357 + * @descriptor: USB device descriptor 358 + * @config: all of the device's configs 359 + * @actconfig: the active configuration 360 + * @ep_in: array of IN endpoints 361 + * @ep_out: array of OUT endpoints 362 + * @rawdescriptors: raw descriptors for each config 363 + * @bus_mA: Current available from the bus 364 + * @portnum: parent port number (origin 1) 365 + * @level: number of USB hub ancestors 366 + * @can_submit: URBs may be submitted 367 + * @discon_suspended: disconnected while suspended 368 + * @persist_enabled: USB_PERSIST enabled for this device 369 + * @have_langid: whether string_langid is valid 370 + * @authorized: policy has said we can use it; 371 + * (user space) policy determines if we authorize this device to be 372 + * used or not. By default, wired USB devices are authorized. 373 + * WUSB devices are not, until we authorize them from user space. 374 + * FIXME -- complete doc 375 + * @wusb: device is Wireless USB 376 + * @string_langid: language ID for strings 377 + * @product: iProduct string, if present (static) 378 + * @manufacturer: iManufacturer string, if present (static) 379 + * @serial: iSerialNumber string, if present (static) 380 + * @filelist: usbfs files that are open to this device 381 + * @usb_classdev: USB class device that was created for usbfs device 382 + * access from userspace 383 + * @usbfs_dentry: usbfs dentry entry for the device 384 + * @maxchild: number of ports if hub 385 + * @children: child devices - USB devices that are attached to this hub 386 + * @pm_usage_cnt: usage counter for autosuspend 387 + * @quirks: quirks of the whole device 388 + * @urbnum: number of URBs submitted for the whole device 389 + * @active_duration: total time device is not suspended 390 + * @autosuspend: for delayed autosuspends 391 + * @pm_mutex: protects PM operations 392 + * @last_busy: time of last use 393 + * @autosuspend_delay: in jiffies 394 + * @connect_time: time device was first connected 395 + * @auto_pm: autosuspend/resume in progress 396 + * @do_remote_wakeup: remote wakeup should be enabled 397 + * @reset_resume: needs reset instead of resume 398 + * @autosuspend_disabled: autosuspend disabled by the user 399 + * @autoresume_disabled: autoresume disabled by the user 400 + * @skip_sys_resume: skip the next system resume 346 401 * 347 - * FIXME: Write the kerneldoc! 348 - * 402 + * Notes: 349 403 * Usbcore drivers should not set usbdev->state directly. Instead use 350 404 * usb_set_device_state(). 351 - * 352 - * @authorized: (user space) policy determines if we authorize this 353 - * device to be used or not. By default, wired USB 354 - * devices are authorized. WUSB devices are not, until we 355 - * authorize them from user space. FIXME -- complete doc 356 405 */ 357 406 struct usb_device { 358 - int devnum; /* Address on USB bus */ 359 - char devpath [16]; /* Use in messages: /port/port/... */ 360 - enum usb_device_state state; /* configured, not attached, etc */ 361 - enum usb_device_speed speed; /* high/full/low (or error) */ 407 + int devnum; 408 + char devpath [16]; 409 + enum usb_device_state state; 410 + enum usb_device_speed speed; 362 411 363 - struct usb_tt *tt; /* low/full speed dev, highspeed hub */ 364 - int ttport; /* device port on that tt hub */ 412 + struct usb_tt *tt; 413 + int ttport; 365 414 366 - unsigned int toggle[2]; /* one bit for each endpoint 367 - * ([0] = IN, [1] = OUT) */ 415 + unsigned int toggle[2]; 368 416 369 - struct usb_device *parent; /* our hub, unless we're the root */ 370 - struct usb_bus *bus; /* Bus we're part of */ 417 + struct usb_device *parent; 418 + struct usb_bus *bus; 371 419 struct usb_host_endpoint ep0; 372 420 373 - struct device dev; /* Generic device interface */ 421 + struct device dev; 374 422 375 - struct usb_device_descriptor descriptor;/* Descriptor */ 376 - struct usb_host_config *config; /* All of the configs */ 423 + struct usb_device_descriptor descriptor; 424 + struct usb_host_config *config; 377 425 378 - struct usb_host_config *actconfig;/* the active configuration */ 426 + struct usb_host_config *actconfig; 379 427 struct usb_host_endpoint *ep_in[16]; 380 428 struct usb_host_endpoint *ep_out[16]; 381 429 382 - char **rawdescriptors; /* Raw descriptors for each config */ 430 + char **rawdescriptors; 383 431 384 - unsigned short bus_mA; /* Current available from the bus */ 385 - u8 portnum; /* Parent port number (origin 1) */ 386 - u8 level; /* Number of USB hub ancestors */ 432 + unsigned short bus_mA; 433 + u8 portnum; 434 + u8 level; 387 435 388 - unsigned can_submit:1; /* URBs may be submitted */ 389 - unsigned discon_suspended:1; /* Disconnected while suspended */ 390 - unsigned persist_enabled:1; /* USB_PERSIST enabled for this dev */ 391 - unsigned have_langid:1; /* whether string_langid is valid */ 392 - unsigned authorized:1; /* Policy has said we can use it */ 393 - unsigned wusb:1; /* Device is Wireless USB */ 394 - int string_langid; /* language ID for strings */ 436 + unsigned can_submit:1; 437 + unsigned discon_suspended:1; 438 + unsigned persist_enabled:1; 439 + unsigned have_langid:1; 440 + unsigned authorized:1; 441 + unsigned wusb:1; 442 + int string_langid; 395 443 396 444 /* static strings from the device */ 397 - char *product; /* iProduct string, if present */ 398 - char *manufacturer; /* iManufacturer string, if present */ 399 - char *serial; /* iSerialNumber string, if present */ 445 + char *product; 446 + char *manufacturer; 447 + char *serial; 400 448 401 449 struct list_head filelist; 402 450 #ifdef CONFIG_USB_DEVICE_CLASS 403 451 struct device *usb_classdev; 404 452 #endif 405 453 #ifdef CONFIG_USB_DEVICEFS 406 - struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ 454 + struct dentry *usbfs_dentry; 407 455 #endif 408 - /* 409 - * Child devices - these can be either new devices 410 - * (if this is a hub device), or different instances 411 - * of this same device. 412 - * 413 - * Each instance needs its own set of data structures. 414 - */ 415 456 416 - int maxchild; /* Number of ports if hub */ 457 + int maxchild; 417 458 struct usb_device *children[USB_MAXCHILDREN]; 418 459 419 - int pm_usage_cnt; /* usage counter for autosuspend */ 420 - u32 quirks; /* quirks of the whole device */ 421 - atomic_t urbnum; /* number of URBs submitted for 422 - the whole device */ 460 + int pm_usage_cnt; 461 + u32 quirks; 462 + atomic_t urbnum; 423 463 424 - unsigned long active_duration; /* total time device is not suspended */ 464 + unsigned long active_duration; 425 465 426 466 #ifdef CONFIG_PM 427 - struct delayed_work autosuspend; /* for delayed autosuspends */ 428 - struct mutex pm_mutex; /* protects PM operations */ 467 + struct delayed_work autosuspend; 468 + struct mutex pm_mutex; 429 469 430 - unsigned long last_busy; /* time of last use */ 431 - int autosuspend_delay; /* in jiffies */ 432 - unsigned long connect_time; /* time device was first connected */ 470 + unsigned long last_busy; 471 + int autosuspend_delay; 472 + unsigned long connect_time; 433 473 434 - unsigned auto_pm:1; /* autosuspend/resume in progress */ 435 - unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ 436 - unsigned reset_resume:1; /* needs reset instead of resume */ 437 - unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ 438 - unsigned autoresume_disabled:1; /* disabled by the user */ 439 - unsigned skip_sys_resume:1; /* skip the next system resume */ 474 + unsigned auto_pm:1; 475 + unsigned do_remote_wakeup:1; 476 + unsigned reset_resume:1; 477 + unsigned autosuspend_disabled:1; 478 + unsigned autoresume_disabled:1; 479 + unsigned skip_sys_resume:1; 440 480 #endif 441 481 }; 442 482 #define to_usb_device(d) container_of(d, struct usb_device, dev)