* Only set the select hook on the device module if we actually got a select
hook from the legacy driver. * Add note explaining why it is set to an arbitrary invalid value (~0) and why it still works by redirecting in the virtual Select() of LegacyDevice. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26079 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1229,7 +1229,16 @@ LegacyDevice::SetHooks(device_hooks* hooks)
|
|||||||
// According to Be newsletter, vol II, issue 36,
|
// According to Be newsletter, vol II, issue 36,
|
||||||
// version 2 added readv/writev, which we don't support, but also
|
// version 2 added readv/writev, which we don't support, but also
|
||||||
// select/deselect.
|
// select/deselect.
|
||||||
|
if (hooks->select != NULL) {
|
||||||
|
// Note we set the module's select to a non-null value to indicate
|
||||||
|
// that we have select. HasSelect() will therefore return the
|
||||||
|
// correct answer. As Select() is virtual our compatibility
|
||||||
|
// version below is going to be called though, that redirects to
|
||||||
|
// the proper select hook, so it is ok to set it to an invalid
|
||||||
|
// address here.
|
||||||
fDeviceModule->select = (status_t (*)(void*, uint8, selectsync*))~0;
|
fDeviceModule->select = (status_t (*)(void*, uint8, selectsync*))~0;
|
||||||
|
}
|
||||||
|
|
||||||
fDeviceModule->deselect = hooks->deselect;
|
fDeviceModule->deselect = hooks->deselect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user