@@ -612,13 +612,37 @@ static int bos_desc(struct usb_composite_dev *cdev)
612
612
struct usb_ext_cap_descriptor * usb_ext ;
613
613
struct usb_dcd_config_params dcd_config_params ;
614
614
struct usb_bos_descriptor * bos = cdev -> req -> buf ;
615
+ unsigned int besl = 0 ;
615
616
616
617
bos -> bLength = USB_DT_BOS_SIZE ;
617
618
bos -> bDescriptorType = USB_DT_BOS ;
618
619
619
620
bos -> wTotalLength = cpu_to_le16 (USB_DT_BOS_SIZE );
620
621
bos -> bNumDeviceCaps = 0 ;
621
622
623
+ /* Get Controller configuration */
624
+ if (cdev -> gadget -> ops -> get_config_params ) {
625
+ cdev -> gadget -> ops -> get_config_params (cdev -> gadget ,
626
+ & dcd_config_params );
627
+ } else {
628
+ dcd_config_params .besl_baseline =
629
+ USB_DEFAULT_BESL_UNSPECIFIED ;
630
+ dcd_config_params .besl_deep =
631
+ USB_DEFAULT_BESL_UNSPECIFIED ;
632
+ dcd_config_params .bU1devExitLat =
633
+ USB_DEFAULT_U1_DEV_EXIT_LAT ;
634
+ dcd_config_params .bU2DevExitLat =
635
+ cpu_to_le16 (USB_DEFAULT_U2_DEV_EXIT_LAT );
636
+ }
637
+
638
+ if (dcd_config_params .besl_baseline != USB_DEFAULT_BESL_UNSPECIFIED )
639
+ besl = USB_BESL_BASELINE_VALID |
640
+ USB_SET_BESL_BASELINE (dcd_config_params .besl_baseline );
641
+
642
+ if (dcd_config_params .besl_deep != USB_DEFAULT_BESL_UNSPECIFIED )
643
+ besl |= USB_BESL_DEEP_VALID |
644
+ USB_SET_BESL_DEEP (dcd_config_params .besl_deep );
645
+
622
646
/*
623
647
* A SuperSpeed device shall include the USB2.0 extension descriptor
624
648
* and shall support LPM when operating in USB2.0 HS mode.
@@ -629,7 +653,8 @@ static int bos_desc(struct usb_composite_dev *cdev)
629
653
usb_ext -> bLength = USB_DT_USB_EXT_CAP_SIZE ;
630
654
usb_ext -> bDescriptorType = USB_DT_DEVICE_CAPABILITY ;
631
655
usb_ext -> bDevCapabilityType = USB_CAP_TYPE_EXT ;
632
- usb_ext -> bmAttributes = cpu_to_le32 (USB_LPM_SUPPORT | USB_BESL_SUPPORT );
656
+ usb_ext -> bmAttributes = cpu_to_le32 (USB_LPM_SUPPORT |
657
+ USB_BESL_SUPPORT | besl );
633
658
634
659
/*
635
660
* The Superspeed USB Capability descriptor shall be implemented by all
@@ -650,17 +675,6 @@ static int bos_desc(struct usb_composite_dev *cdev)
650
675
USB_HIGH_SPEED_OPERATION |
651
676
USB_5GBPS_OPERATION );
652
677
ss_cap -> bFunctionalitySupport = USB_LOW_SPEED_OPERATION ;
653
-
654
- /* Get Controller configuration */
655
- if (cdev -> gadget -> ops -> get_config_params ) {
656
- cdev -> gadget -> ops -> get_config_params (cdev -> gadget ,
657
- & dcd_config_params );
658
- } else {
659
- dcd_config_params .bU1devExitLat =
660
- USB_DEFAULT_U1_DEV_EXIT_LAT ;
661
- dcd_config_params .bU2DevExitLat =
662
- cpu_to_le16 (USB_DEFAULT_U2_DEV_EXIT_LAT );
663
- }
664
678
ss_cap -> bU1devExitLat = dcd_config_params .bU1devExitLat ;
665
679
ss_cap -> bU2DevExitLat = dcd_config_params .bU2DevExitLat ;
666
680
}
0 commit comments