KolibriOS kernel
hub.inc File Reference

Classes

struct  usb_hub
 ============================================================================= More...
 
struct  usb_hub_descr
 Hub descriptor. More...
 

Functions

void usb_hub_init ()
 This procedure is called when new hub is detected. It initializes the device. Technically, initialization implies sending several USB queries, so it is split in several procedures. The first is usb_hub_init, other are callbacks which will be called at some time in the future, when the device will respond. edx = usb_interface_descr, ecx = length rest. More...
 
void usb_hub_got_config (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request for the hub descriptor initiated by usb_hub_init is finished, either successfully or unsuccessfully. More...
 
void usb_hub_port_powered (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request to power up some port is completed, either successfully or unsuccessfully. More...
 
void usb_hub_wait_change ()
 Requests notification about any changes in hub/ports configuration. Called when initial configuration is done and when a previous notification has been processed. More...
 
void usb_hub_changed (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when something has changed on the hub. More...
 
void usb_hub_status (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request of hub status is completed, either successfully or unsuccessfully. More...
 
void usb_hub_change_cleared (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request to clear hub change is completed, either successfully or unsuccessfully. More...
 
void usb_hub_port_status (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request of port status is completed, either successfully or unsuccessfully. More...
 
void usb_hub_store_connected_time ()
 Helper procedure to store current time in ConnectedTime, advancing -1 to zero if needed. More...
 
void usb_hub_clear_port_change ()
 Helper procedure for several parts of hub code. Sends a request to clear the given feature of the port. eax -> usb_hub, cl = feature; as is should be called from async code, sync code should set edx to ConfigBuffer and call usb_hub_clear_port_change.buffer; port number (1-based) should be filled in [edx+4] by previous requests. More...
 
void usb_hub_port_changed (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request to clear port change is completed, either successfully or unsuccessfully. More...
 
void usb_hub_process_deferred ()
 This procedure is called in the USB thread from usb_thread_proc, contains synchronous code which should be activated at certain time (e.g. reset a recently connected device after debounce interval 100ms). Returns the number of ticks when it should be called next time. More...
 
void usb_hub_reset_aborted ()
 Helper procedure for other code. Called when reset process is aborted. More...
 
void usb_hub_query_port_status ()
 Helper procedure for usb_hub_process_deferred. Sends a request to query port status. esi -> usb_hub, eax = callback, ecx = 1-based port. More...
 
void usb_hub_connect_port_status (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request to query port status initiated by usb_hub_process_deferred for testing connection is completed, either successfully or unsuccessfully. More...
 
void usb_hub_resetting_port_status (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request to query port status initiated by usb_hub_process_deferred for testing reset status is completed, either successfully or unsuccessfully. More...
 
void usb_hub_initiate_reset ()
 Helper procedure for usb_hub_process_deferred. Initiates reset signalling on the current port (given by 1-based value [ConfigBuffer+4]). esi -> usb_hub, eax -> usb_controller. More...
 
void usb_hub_reset_started (dword pipe, dword status, dword buffer, dword length, dword calldata)
 This procedure is called when the request to start reset signalling initiated by usb_hub_initiate_reset is completed, either successfully or unsuccessfully. More...
 
void usb_hub_disable_resetting_port ()
 This procedure is called by the protocol layer if something has failed during initial stages of the configuration process, so the device should be disabled at hub level. More...
 
void usb_hub_disconnect ()
 This procedure is called when the hub is disconnected. More...
 
void usb_get_tt_think_time ()
 Helper function for USB2 scheduler. in: eax -> usb_hub out: ecx = TT think time for the hub in FS-bytes. More...
 

Variables

label usb_hub_callbacks
 Implementation of struct USBFUNC for hubs. More...
 
label usb_hub_callbacks_end
 
dd usb_hub_pseudosrv
 
dd _pipe
 handle of the config pipe More...
 
dd _config
 pointer to usb_config_descr More...
 
dd _interface
 pointer to usb_interface_descr More...
 
dd _hubdata
 

Function Documentation

◆ usb_get_tt_think_time()

void usb_get_tt_think_time ( )

Helper function for USB2 scheduler. in: eax -> usb_hub out: ecx = TT think time for the hub in FS-bytes.

Source
bus/usb/hub.inc:1277

◆ usb_hub_change_cleared()

void usb_hub_change_cleared ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request to clear hub change is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:683

◆ usb_hub_changed()

void usb_hub_changed ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when something has changed on the hub.

Source
bus/usb/hub.inc:534

◆ usb_hub_clear_port_change()

void usb_hub_clear_port_change ( )

Helper procedure for several parts of hub code. Sends a request to clear the given feature of the port. eax -> usb_hub, cl = feature; as is should be called from async code, sync code should set edx to ConfigBuffer and call usb_hub_clear_port_change.buffer; port number (1-based) should be filled in [edx+4] by previous requests.

Source
bus/usb/hub.inc:827

◆ usb_hub_connect_port_status()

void usb_hub_connect_port_status ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request to query port status initiated by usb_hub_process_deferred for testing connection is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:1077

◆ usb_hub_disable_resetting_port()

void usb_hub_disable_resetting_port ( )

This procedure is called by the protocol layer if something has failed during initial stages of the configuration process, so the device should be disabled at hub level.

Source
bus/usb/hub.inc:1214

◆ usb_hub_disconnect()

void usb_hub_disconnect ( )

This procedure is called when the hub is disconnected.

Source
bus/usb/hub.inc:1225

◆ usb_hub_got_config()

void usb_hub_got_config ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request for the hub descriptor initiated by usb_hub_init is finished, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:345

◆ usb_hub_init()

void usb_hub_init ( )

This procedure is called when new hub is detected. It initializes the device. Technically, initialization implies sending several USB queries, so it is split in several procedures. The first is usb_hub_init, other are callbacks which will be called at some time in the future, when the device will respond. edx = usb_interface_descr, ecx = length rest.

Source
bus/usb/hub.inc:221

◆ usb_hub_initiate_reset()

void usb_hub_initiate_reset ( )

Helper procedure for usb_hub_process_deferred. Initiates reset signalling on the current port (given by 1-based value [ConfigBuffer+4]). esi -> usb_hub, eax -> usb_controller.

Source
bus/usb/hub.inc:1166

◆ usb_hub_port_changed()

void usb_hub_port_changed ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request to clear port change is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:845

◆ usb_hub_port_powered()

void usb_hub_port_powered ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request to power up some port is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:493

◆ usb_hub_port_status()

void usb_hub_port_status ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request of port status is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:702

◆ usb_hub_process_deferred()

void usb_hub_process_deferred ( )

This procedure is called in the USB thread from usb_thread_proc, contains synchronous code which should be activated at certain time (e.g. reset a recently connected device after debounce interval 100ms). Returns the number of ticks when it should be called next time.

Source
bus/usb/hub.inc:872

◆ usb_hub_query_port_status()

void usb_hub_query_port_status ( )

Helper procedure for usb_hub_process_deferred. Sends a request to query port status. esi -> usb_hub, eax = callback, ecx = 1-based port.

Source
bus/usb/hub.inc:1060

◆ usb_hub_reset_aborted()

void usb_hub_reset_aborted ( )

Helper procedure for other code. Called when reset process is aborted.

Source
bus/usb/hub.inc:1046

◆ usb_hub_reset_started()

void usb_hub_reset_started ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request to start reset signalling initiated by usb_hub_initiate_reset is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:1195

◆ usb_hub_resetting_port_status()

void usb_hub_resetting_port_status ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request to query port status initiated by usb_hub_process_deferred for testing reset status is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:1130

◆ usb_hub_status()

void usb_hub_status ( dword  pipe,
dword  status,
dword  buffer,
dword  length,
dword  calldata 
)

This procedure is called when the request of hub status is completed, either successfully or unsuccessfully.

Source
bus/usb/hub.inc:628

◆ usb_hub_store_connected_time()

void usb_hub_store_connected_time ( )

Helper procedure to store current time in ConnectedTime, advancing -1 to zero if needed.

Source
bus/usb/hub.inc:812

◆ usb_hub_wait_change()

void usb_hub_wait_change ( )

Requests notification about any changes in hub/ports configuration. Called when initial configuration is done and when a previous notification has been processed.

Source
bus/usb/hub.inc:527

Variable Documentation

◆ _config

dd _config

pointer to usb_config_descr

Initial value
?
Source
bus/usb/hub.inc:227

◆ _hubdata

dd _hubdata
Initial value
?
Source
bus/usb/hub.inc:1228

◆ _interface

dd _interface

pointer to usb_interface_descr

Initial value
?
Source
bus/usb/hub.inc:228

◆ _pipe

dd _pipe

handle of the config pipe

Initial value
?
Source
bus/usb/hub.inc:226
Initial value
?
Source
bus/usb/pipe.inc:637
Initial value
?
Source
bus/usb/pipe.inc:698

◆ usb_hub_callbacks

label usb_hub_callbacks

Implementation of struct USBFUNC for hubs.

Source
bus/usb/hub.inc:206

◆ usb_hub_callbacks_end

label usb_hub_callbacks_end

◆ usb_hub_pseudosrv

dd usb_hub_pseudosrv
Initial value
usb_hub_callbacks
Source
bus/usb/hub.inc:211