usb_get_string

Name

usb_get_string --  gets a string descriptor

Synopsis

int usb_get_string (struct usb_device * dev, unsigned short langid, unsigned char index, void * buf, int size);

Arguments

dev

the device whose string descriptor is being retrieved

langid

code for language chosen (from string descriptor zero)

index

the number of the descriptor

buf

where to put the string

size

how big is "buf"?

Context

!in_interrupt ()

Description

Retrieves a string, encoded using UTF-16LE (Unicode, 16 bits per character, in little-endian byte order). The usb_string function will often be a convenient way to turn these strings into kernel-printable form.

Strings may be referenced in device, configuration, interface, or other descriptors, and could also be used in vendor-specific ways.

This call is synchronous, and may not be used in an interrupt context.

Returns the number of bytes received on success, or else the status code returned by the underlying usb_control_msg call.