Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return kernel driver name -- New API #1225

Open
mcuee opened this issue Dec 31, 2022 · 11 comments
Open

Return kernel driver name -- New API #1225

mcuee opened this issue Dec 31, 2022 · 11 comments
Labels
enhancement New features

Comments

@mcuee
Copy link
Member

mcuee commented Dec 31, 2022

Right now we only provide the driver name (WinUSB, libusb0.sys or libusbk.sys) in debug messages. It will be good to provide this function. For other OS, we can returen a generic name.

Windows -- return WinUSB, libusbK or libusb-win32 accordingly.
Linux -- return usbfs
macOS -- return NIL --> IOKit
BSDs -- return ugen

@mcuee mcuee changed the title Return kernel driver name under Windows Return kernel driver name under Windows -- New API Dec 31, 2022
@mcuee mcuee added the enhancement New features label Dec 31, 2022
@mcuee
Copy link
Member Author

mcuee commented Dec 31, 2022

Reference issue from avrdude project.
avrdudes/avrdude#1244 (comment)

@mcuee mcuee changed the title Return kernel driver name under Windows -- New API Return kernel driver name -- New API Dec 31, 2022
@hjelmn
Copy link
Member

hjelmn commented Jan 10, 2023

Maybe IOKit for macOS. Not likely going to change but that is the actual driver we are using.

@sonatique
Copy link
Contributor

sonatique commented Oct 17, 2023

It will be good to provide this function. For other OS, we can returen a generic name.

Hello @mcuee : do you know if someone is working on this?

@mcuee
Copy link
Member Author

mcuee commented Oct 17, 2023

Hello @mcuee : do you know if someone is working on this?

As far as I know, nobody is working on this.

@fabiensanglard
Copy link

fabiensanglard commented Dec 8, 2023

I volunteer to implement it if it is still needed (It looks like it is given the diversity of windows_usb_api_backend). I could implement it by adding a method pointer in usbi_os_backend.

const char* (*get_driver_name)(); 

And expose that in libusb.h

const char* API_EXPORTED libusb_get_driver_name()
{
    return usbi_backend->get_driver_name();
}

And I would implement that method in all the backends. Would that work with libusb approvers (@mcuee ?) or there is a better to implement it?

@mcuee
Copy link
Member Author

mcuee commented Dec 9, 2023

Looks like a good plan. A PR will be welcome.

But before submitting a PR, let's hear from @hjelmn and @tormodvolden to see if they like the proposal or not.

@fabiensanglard
Copy link

Ping @hjelmn / @tormodvolden ?

@sonatique
Copy link
Contributor

@fabiensanglard : this looks good to me. I was wondering whether this information could be added to an existing structure returned by an function of the current API, but I didn't find a match, so I am OK with augmenting the API.

It would be even cooler to be able to retrieve the driver version alongside the driver name, but this is another completely different story and may not apply to all backend.

@tormodvolden
Copy link
Contributor

We are a bit busy with releasing 1.0.27 now. I will come back to this later.

fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Dec 26, 2023
@fabiensanglard
Copy link

Sorry about the presubmit spam. Next time, I will add the issue reference once all tests are passing to avoid it.

I still need to figure out the signing but #1404 is in reviewable state.

@sonatique
Copy link
Contributor

I still need to figure out the signing

Hello, thank you. Don't worry about / waste your time with signing your commit, it is actually not a requirement here (as opposed to what is said by the "Merge is blocked". See for instance this answer from an admin: #1397 (comment)

fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Jan 4, 2024
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Jan 6, 2024
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Jan 6, 2024
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Jan 6, 2024
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Jan 6, 2024
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Jan 8, 2024
fabiensanglard pushed a commit to fabiensanglard/libusb that referenced this issue Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants