72 unsigned int tag_busdev;
73 unsigned int tag_offset;
79 tag_direction = ( (
setting->
tag & ( 1 << 31 ) ) ? +1 : -1 );
80 tag_busdev = ( (
setting->
tag >> 16 ) & 0x7fff );
107 if ( ( tag_len == 0 ) && ( tag_offset == 0 ) ) {
108 tag_len =
sizeof ( usb->
device );
109 tag_direction = -tag_direction;
110 }
else if ( ( tag_len == 0 ) || ( tag_offset == 0 ) ) {
112 if ( ( !
index ) && ( tag_offset <
sizeof ( usb->
device ) ) )
124 if ( tag_offset >
sizeof ( usb->
device ) ) {
126 }
else if ( ( tag_offset + tag_len ) >
sizeof ( usb->
device ) ) {
127 tag_len = (
sizeof ( usb->
device ) - tag_offset );
133 if ( tag_direction < 0 )
134 src += ( tag_len - 1 );
137 for ( ;
len-- ;
src += tag_direction, dst++ )
167 DBG (
"USB could not register settings: %s\n",
#define USB_BUS(busdev)
Extract USB bus address.
struct arbelprm_rc_send_wqe rc
struct usb_bus * find_usb_bus(unsigned int address)
Find USB bus by address.
uint64_t desc
Microcode descriptor list physical address.
struct usb_device * find_usb(struct usb_bus *bus, unsigned int address)
Find USB device by address.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint64_t tag
Setting tag, if applicable.
#define INIT_NORMAL
Normal initialisation.
An initialisation function.
struct init_fn usb_settings_init_fn __init_fn(INIT_NORMAL)
USB device settings initialiser.
#define __unused
Declare a variable or data structure as unused.
const struct setting_type * type
Setting type.
char * strerror(int errno)
Retrieve string representation of error number.
#define ENODEV
No such device.
Settings block operations.
struct usb_device_descriptor device
Device descriptor.
struct list_head siblings
Sibling settings blocks.
static void usb_settings_init(void)
Initialise USB device settings.
Universal Serial Bus (USB)
static int usb_settings_applies(struct settings *settings __unused, const struct setting *setting)
Check applicability of USB device setting.
static int usb_settings_fetch(struct settings *settings __unused, struct setting *setting, void *data, size_t len)
Fetch value of USB device setting.
uint8_t data[48]
Additional event data.
static struct settings_operations usb_settings_operations
USB device settings operations.
int(* applies)(struct settings *settings, const struct setting *setting)
Check applicability of setting.
struct list_head children
Child settings blocks.
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
#define DBG(...)
Print a debugging message.
#define LIST_HEAD_INIT(list)
Initialise a static list head.
const struct settings_scope * scope
Setting scope (or NULL)
static const struct settings_scope usb_settings_scope
USB device settings scope.
#define NULL
NULL pointer (VOID *)
static struct settings usb_settings
USB device settings.
struct refcnt * refcnt
Reference counter.
int usb_get_string_descriptor(struct usb_device *usb, unsigned int index, unsigned int language, char *buf, size_t len)
Get USB string descriptor.
#define USB_DEV(busdev)
Extract USB device address.