Re: Ioctls for data transfer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sorry....the API is usb_read() etc  - essentially these are from libusb.so:

usb_bulk_read
usb_bulk_write
usb_busses
usb_claim_interface
usb_clear_halt
usb_close
usb_control_msg
usb_device
usb_find_busses
usb_find_devices
usb_get_busses
usb_get_descriptor
usb_get_descriptor_by_endpoint
usb_get_string
usb_get_string_simple
usb_init
usb_interrupt_read
usb_interrupt_write
usb_open
usb_release_interface
usb_reset
usb_resetep
usb_set_altinterface
usb_set_configuration
usb_set_debug
usb_strerror

On Fri, Sep 18, 2009 at 7:56 AM, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote:
> what kind of device is that?   USB/PCI etc based?   for many USB
> devices, u just need userspace tools.   For eg:
>
> 1.   libusb-devel (or libusb-dev....depending on the distros), or
> libpci etc....for writing userspace application to talk to the device.
> 2.   add udev rules.   (for eg, this url:
>
> http://wiki.lynxworks.eu/misc/e1550
>
> shows how to add a new device in different distro).   The application
> that issued the read() in this case is usb_modeswitch.   Download the
> sourcecode from:
>
> http://www.draisberghof.de/usb_modeswitch/
>
> and see how it uses libusb+read/write/open to talk to the device.
>
>
> On Thu, Sep 17, 2009 at 2:59 PM, Leonidas . <leonidas137@xxxxxxxxx> wrote:
>>
>>
>> Hi list,
>>
>> I know that introducing/using new ioctls is frawned upon by the community.
>> They might still be needed for controlling various hw parameters, Just
>> wanted
>> to understand the data transfer side of ioctls with a use case.
>>
>> E.g. My kernel module needs to pass a buffer of 1-2Mb to userspace
>> whenever user requests. The buffer will contain different kind of data
>> depending
>> on different commands i.e. assume that I maintain 3 types of buffers in my
>> module.
>>
>> Now, with ioctls it is much easiler to get the buffer to userspace simply by
>> issusing
>> different commands. But if I have to achive the same functionality using
>> read() call
>> how would I do it? Meaning ioctl kind of multiplexes the things which might
>> be
>> needed in some cases. How would I do this kind of stuff with read()? By
>> having 3
>> different minor devices and issuing read() on 3 devices for getting 3
>> buffers?
>>
>> I am not looking for anyother mechanism of trasnfering data to userspace as
>> of now
>> since this data would be really sporadic. I have to choose between ioctl and
>> read.
>>
>> -Leo.
>>
>
>
>
> --
> Regards,
> Peter Teoh
>



-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux