@@ -112,20 +112,7 @@ void bce_vhci_stop(struct usb_hcd *hcd)
112112
113113static int bce_vhci_hub_status_data (struct usb_hcd * hcd , char * buf )
114114{
115- struct bce_vhci * vhci = bce_vhci_from_hcd (hcd );
116- unsigned long mask = READ_ONCE (vhci -> port_resume_mask );
117- int i , ret_len ;
118-
119- if (!mask )
120- return 0 ;
121-
122- ret_len = (vhci -> port_count + 8 ) / 8 ;
123- memset (buf , 0 , ret_len );
124- for (i = 1 ; i <= vhci -> port_count ; i ++ ) {
125- if (test_bit (i , & vhci -> port_resume_mask ))
126- buf [i / 8 ] |= BIT (i % 8 );
127- }
128- return ret_len ;
115+ return 0 ;
129116}
130117
131118static int bce_vhci_reset_device (struct bce_vhci * vhci , int index , u16 timeout );
@@ -182,8 +169,6 @@ static int bce_vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u1
182169
183170 if (port_status & 0x40000 )
184171 ps -> wPortChange |= USB_PORT_STAT_C_CONNECTION ;
185- if (test_bit (wIndex , & vhci -> port_resume_mask ))
186- ps -> wPortChange |= USB_PORT_STAT_C_CONNECTION ;
187172
188173 pr_debug ("bce-vhci: Translated status %x to %x:%x\n" , port_status , ps -> wPortStatus , ps -> wPortChange );
189174 return 0 ;
@@ -212,10 +197,8 @@ static int bce_vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u1
212197 vhci -> port_power_mask &= ~BIT (wIndex );
213198 return status ;
214199 }
215- if (wValue == USB_PORT_FEAT_C_CONNECTION ) {
216- clear_bit (wIndex , & vhci -> port_resume_mask );
200+ if (wValue == USB_PORT_FEAT_C_CONNECTION )
217201 return bce_vhci_cmd_port_status (& vhci -> cq , (u8 ) wIndex , 0x40000 , & port_status );
218- }
219202 if (wValue == USB_PORT_FEAT_C_RESET ) { /* I don't think I can transfer it in any way */
220203 return 0 ;
221204 }
@@ -384,7 +367,6 @@ static int bce_vhci_bus_suspend(struct usb_hcd *hcd)
384367 pr_info ("bce_vhci: suspend started\n" );
385368
386369 bce_vhci_debug_port_status (vhci , "pre-suspend" );
387- WRITE_ONCE (vhci -> port_resume_mask , 0 );
388370
389371 for (i = 0 ; i < 16 ; i ++ ) {
390372 if (!vhci -> port_to_device [i ])
@@ -735,44 +717,11 @@ static void bce_vhci_firmware_event_completion(struct bce_queue_sq *sq)
735717
736718static void bce_vhci_handle_system_event (struct bce_vhci_event_queue * q , struct bce_vhci_message * msg )
737719{
738- struct usb_hcd * hcd = q -> vhci -> hcd ;
739- u8 port ;
740-
741720 if (msg -> cmd & 0x8000 ) {
742721 bce_vhci_command_queue_deliver_completion (& q -> vhci -> cq , msg );
743- return ;
744- }
745-
746- switch (msg -> cmd ) {
747- case BCE_VHCI_CMD_PORT_CONNECT :
748- /*
749- * T2 notifies us that a port connection state changed.
750- * This happens during boot and resume. Mark the port as changed
751- * so hub_status_data reports it, then notify USB core to poll.
752- */
753- port = (u8 )(msg -> param1 & 0xff );
754- pr_info ("bce-vhci: port %d connect notification (status=0x%llx)\n" , port , msg -> param2 );
755- set_bit (port , & q -> vhci -> port_resume_mask );
756- if (hcd )
757- usb_hcd_poll_rh_status (hcd );
758- break ;
759-
760- case BCE_VHCI_CMD_PORT_RESUME :
761- port = (u8 )(msg -> param1 & 0xff );
762- pr_info ("bce-vhci: T2 initiated port %d resume (status=0x%llx)\n" , port , msg -> param2 );
763- if (hcd )
764- usb_hcd_poll_rh_status (hcd );
765- break ;
766-
767- case BCE_VHCI_CMD_PORT_SUSPEND :
768- port = (u8 )(msg -> param1 & 0xff );
769- pr_info ("bce-vhci: T2 initiated port %d suspend (status=0x%llx)\n" , port , msg -> param2 );
770- break ;
771-
772- default :
722+ } else {
773723 pr_warn ("bce-vhci: Unhandled system event: %x s=%x p1=%x p2=%llx\n" ,
774724 msg -> cmd , msg -> status , msg -> param1 , msg -> param2 );
775- break ;
776725 }
777726}
778727
0 commit comments