最終更新:2017-06-01 (木) 15:58:45 (2520d)  

usb_device
Top / usb_device

linux/usb.h

  • kernel's representation of a USB device
  • http://lxr.onakasuita.org/ident?i=usb_device
    struct usb_device {
            int             devnum;
            char            devpath[16];
            u32             route;
            enum usb_device_state   state;
            enum usb_device_speed   speed;
    
            struct usb_tt   *tt;
            int             ttport;
    
            unsigned int toggle[2];
    
            struct usb_device *parent;
            struct usb_bus *bus;
            struct usb_host_endpoint ep0;
    
            struct device dev;
    
            struct usb_device_descriptor descriptor;
            struct usb_host_bos *bos;
            struct usb_host_config *config;
    
            struct usb_host_config *actconfig;
            struct usb_host_endpoint *ep_in[16];
            struct usb_host_endpoint *ep_out[16];
    
            char **rawdescriptors;
    
            unsigned short bus_mA;
            u8 portnum;
            u8 level;
    
            unsigned can_submit:1;
            unsigned persist_enabled:1;
            unsigned have_langid:1;
            unsigned authorized:1;
            unsigned authenticated:1;
            unsigned wusb:1;
            unsigned lpm_capable:1;
            unsigned usb2_hw_lpm_capable:1;
            unsigned usb2_hw_lpm_besl_capable:1;
            unsigned usb2_hw_lpm_enabled:1;
            unsigned usb2_hw_lpm_allowed:1;
            unsigned usb3_lpm_enabled:1;
            int string_langid;
    
            /* static strings from the device */
            char *product;
            char *manufacturer;
            char *serial;
    
            struct list_head filelist;
    
            int maxchild;
    
            u32 quirks;
            atomic_t urbnum;
    
            unsigned long active_duration;
    
    #ifdef CONFIG_PM
            unsigned long connect_time;
    
            unsigned do_remote_wakeup:1;
            unsigned reset_resume:1;
            unsigned port_is_suspended:1;
    #endif
            struct wusb_dev *wusb_dev;
            int slot_id;
            enum usb_device_removable removable;
            struct usb2_lpm_parameters l1_params;
            struct usb3_lpm_parameters u1_params;
            struct usb3_lpm_parameters u2_params;
            unsigned lpm_disable_count;
    };

メンバ

libusb-0.1

  • struct usb_device {
      struct usb_device *next, *prev;
    
      char filename[PATH_MAX + 1];
    
      struct usb_bus *bus;
    
      struct usb_device_descriptor descriptor;
      struct usb_config_descriptor *config;
    
      void *dev;		/* Darwin support */
    
      u_int8_t devnum;
    
      unsigned char num_children;
      struct usb_device **children;
    };

関連

  • usb_match_device?
  • usb_match_one_id_intf?