HOWEVER, the current driver DOES query the device info periodically to determine if controller have been hot swapped. If a device doesn't respond to the query, it's detached from the device list. Then if it later responds to the query, it's reattached. You find this code in the devinfo callback:
Code: Select all
else if(resp->response == MAPLE_RESPONSE_DEVINFO) {
/* Device is present, check for connections */
if(!maple_state.ports[p].units[u].valid) {
#if MAPLE_IRQ_DEBUG
dbglog(DBG_KDEBUG, "maple: attach on device %c%c\n",
'A' + p, '0' + u);
#endif
if(maple_driver_attach(frm) >= 0) {
assert(maple_state.ports[p].units[u].valid);
}
}
Code: Select all
else if(resp->response == MAPLE_RESPONSE_DEVINFO) {
/* Device is present, check for connections */
if(!maple_state.ports[p].units[u].valid) {
#if MAPLE_IRQ_DEBUG
dbglog(DBG_KDEBUG, "maple: attach on device %c%c\n",
'A' + p, '0' + u);
#endif
if(maple_driver_attach(frm) >= 0) {
assert(maple_state.ports[p].units[u].valid);
}
}
else {
maple_devinfo_t *devinfo;
maple_device_t *dev;
/* Device already connected, copy function data in case of change */
devinfo = (maple_devinfo_t *)resp->data;
dev = &maple_state.ports[p].units[u];
dev->info.function_data[0] = devinfo->function_data[0];
dev->info.function_data[1] = devinfo->function_data[1];
dev->info.function_data[2] = devinfo->function_data[2];
}