read() via USB bus

8 messages, 3 authors, 2021-08-11 · open the first message on its own page

read() via USB bus

From: Muni Sekhar <hidden>
Date: 2021-08-09 07:58:40

Hi all,

PCIe memory mapped registers can be read via readb(), readw(), readl()
kernel API's. Similarly what are the kernel API to read the device
registers via USB bus

-- 
Thanks,
Sekhar

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: read() via USB bus

From: Oliver Neukum <oneukum@suse.com>
Date: 2021-08-09 08:15:40

On 09.08.21 09:58, Muni Sekhar wrote:
Hi all,

PCIe memory mapped registers can be read via readb(), readw(), readl()
kernel API's. Similarly what are the kernel API to read the device
registers via USB bus
Hi,

I am afraid this is based on a fundamental misunderstanding on how
USB works. It is based on passing messages, not reading and writing
registers.

USB devices are primarily based on endpoints, not registers. A literal
answer to your question would point you to the clear/set/get_feature
standard requests of chapter 9 of the specification, but that really
will not help you, as you are making assumption that fundamentally
do not apply.

I hope this list stays friendly to newcomers and we will answer
specific questions, but at this point I must advise you to first
read an introductory book.

    HTH
        Oliver



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: read() via USB bus

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-08-09 08:44:29

On Mon, Aug 09, 2021 at 10:15:29AM +0200, Oliver Neukum wrote:
On 09.08.21 09:58, Muni Sekhar wrote:
quoted
Hi all,

PCIe memory mapped registers can be read via readb(), readw(), readl()
kernel API's. Similarly what are the kernel API to read the device
registers via USB bus
Hi,

I am afraid this is based on a fundamental misunderstanding on how
USB works. It is based on passing messages, not reading and writing
registers.

USB devices are primarily based on endpoints, not registers. A literal
answer to your question would point you to the clear/set/get_feature
standard requests of chapter 9 of the specification, but that really
will not help you, as you are making assumption that fundamentally
do not apply.

I hope this list stays friendly to newcomers and we will answer
specific questions, but at this point I must advise you to first
read an introductory book.
Along these lines, take a look at the book, Linux Device Drivers, third
edition, which is free online, as it has a chapter about USB drivers and
how they work.  That should help you out to understand the issues
involved with USB devices.

If you have specific questions after looking at that, and reading the
basic usb-skeleton.c driver in the kernel source tree, please let us
know!

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: read() via USB bus

From: Muni Sekhar <hidden>
Date: 2021-08-09 16:20:51

On Mon, Aug 9, 2021 at 1:45 PM Oliver Neukum [off-list ref] wrote:

On 09.08.21 09:58, Muni Sekhar wrote:
quoted
Hi all,

PCIe memory mapped registers can be read via readb(), readw(), readl()
kernel API's. Similarly what are the kernel API to read the device
registers via USB bus
Hi,

I am afraid this is based on a fundamental misunderstanding on how
USB works. It is based on passing messages, not reading and writing
registers.

USB devices are primarily based on endpoints, not registers. A literal
answer to your question would point you to the clear/set/get_feature
standard requests of chapter 9 of the specification, but that really
will not help you, as you are making assumption that fundamentally
do not apply.

I hope this list stays friendly to newcomers and we will answer
specific questions, but at this point I must advise you to first
read an introductory book.
Thank you, I will check it out.
    HTH
        Oliver

-- 
Thanks,
Sekhar

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: read() via USB bus

From: Muni Sekhar <hidden>
Date: 2021-08-10 14:13:18

On Mon, Aug 9, 2021 at 1:45 PM Oliver Neukum [off-list ref] wrote:

On 09.08.21 09:58, Muni Sekhar wrote:
quoted
Hi all,

PCIe memory mapped registers can be read via readb(), readw(), readl()
kernel API's. Similarly what are the kernel API to read the device
registers via USB bus
Hi,

I am afraid this is based on a fundamental misunderstanding on how
USB works. It is based on passing messages, not reading and writing
registers.
I am referring to the code mentioned in
https://patchwork.kernel.org/project/linux-arm-msm/patch/1534464348-8227-3-git-send-email-pheragu@codeaurora.org/

As per this driver gets access to the Qcomm’s USB h/w device registers
via devm_extcon_dev_allocate(), devm_extcon_dev_register(),
platform_get_resource() and devm_ioremap_resource API’s.

What does the USB external connector EXTCON_USB \ EXTCON_USB_HOST
devices means? Are these different from normal USB devices?

USB devices are primarily based on endpoints, not registers. A literal
answer to your question would point you to the clear/set/get_feature
standard requests of chapter 9 of the specification, but that really
will not help you, as you are making assumption that fundamentally
do not apply.

I hope this list stays friendly to newcomers and we will answer
specific questions, but at this point I must advise you to first
read an introductory book.

    HTH
        Oliver

-- 
Thanks,
Sekhar

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: read() via USB bus

From: Oliver Neukum <oneukum@suse.com>
Date: 2021-08-10 14:25:53

On 10.08.21 16:13, Muni Sekhar wrote:
On Mon, Aug 9, 2021 at 1:45 PM Oliver Neukum [off-list ref] wrote:
quoted
On 09.08.21 09:58, Muni Sekhar wrote:
quoted
Hi all,

PCIe memory mapped registers can be read via readb(), readw(), readl()
kernel API's. Similarly what are the kernel API to read the device
registers via USB bus
Hi,

I am afraid this is based on a fundamental misunderstanding on how
USB works. It is based on passing messages, not reading and writing
registers.
I am referring to the code mentioned in
https://patchwork.kernel.org/project/linux-arm-msm/patch/1534464348-8227-3-git-send-email-pheragu@codeaurora.org/

As per this driver gets access to the Qcomm’s USB h/w device registers
via devm_extcon_dev_allocate(), devm_extcon_dev_register(),
platform_get_resource() and devm_ioremap_resource API’s.

What does the USB external connector EXTCON_USB \ EXTCON_USB_HOST
devices means? Are these different from normal USB devices?
Hi,

those are not USB devices. Those are devices associated with a USB bus
and are to be
found on the host's CPU's bus. This is like a graphics card is from the
driver's view
not a DisplayPort device or a SCSI controller is not a SCSI device for
its driver.

A host controller and associated devices can be on any bus. Such
controllers follow
their separate specifications and how they are to be driven is strictly
speaking
not part of USB:

    Regards
        Oliver



_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Re: read() via USB bus

From: Muni Sekhar <hidden>
Date: 2021-08-10 19:28:03

On Tue, 10 Aug, 2021, 7:50 pm Oliver Neukum, [off-list ref] wrote:
On 10.08.21 16:13, Muni Sekhar wrote:
quoted
On Mon, Aug 9, 2021 at 1:45 PM Oliver Neukum [off-list ref] wrote:
quoted
On 09.08.21 09:58, Muni Sekhar wrote:
quoted
Hi all,

PCIe memory mapped registers can be read via readb(), readw(), readl()
kernel API's. Similarly what are the kernel API to read the device
registers via USB bus
Hi,

I am afraid this is based on a fundamental misunderstanding on how
USB works. It is based on passing messages, not reading and writing
registers.
I am referring to the code mentioned in
https://patchwork.kernel.org/project/linux-arm-msm/patch/1534464348-8227-3-git-send-email-pheragu@codeaurora.org/
quoted
As per this driver gets access to the Qcomm’s USB h/w device registers
via devm_extcon_dev_allocate(), devm_extcon_dev_register(),
platform_get_resource() and devm_ioremap_resource API’s.

What does the USB external connector EXTCON_USB \ EXTCON_USB_HOST
devices means? Are these different from normal USB devices?
Hi,

those are not USB devices. Those are devices associated with a USB bus
and are to be
found on the host's CPU's bus. This is like a graphics card is from the
driver's view
not a DisplayPort device or a SCSI controller is not a SCSI device for
its driver.
Any other examples of devices associated with the USB bus? Do we have any
reference driver in the mainline kernel tree?
Does lsusb reports these devices?
A host controller and associated devices can be on any bus. Such
controllers follow
their separate specifications and how they are to be driven is strictly
speaking
not part of USB:

    Regards
        Oliver

Re: read() via USB bus

From: Oliver Neukum <oneukum@suse.com>
Date: 2021-08-11 10:04:55

On 10.08.21 21:27, Muni Sekhar wrote:
Any other examples of devices associated with the USB bus? Do we have
any reference driver in the mainline kernel tree?

No, not really. We have the debug serial drivers,
but they are associated with a host controller
as such.
Does lsusb reports these devices?
No.

    Regards
        Oliver


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help