Error Sending Control Message Broken Pipe
Contents |
Forum Software © phpBB Group Support Support main Company About Us Contact Us Announcements News & Updates Nu Tech Software Solutions, Inc. Copyright © All Rights Reserved
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why is my kernel module throwing “broken pipe” errors when I try to write to a device? up vote 3 down vote favorite https://www.alarmdecoder.com/forums/viewtopic.php?f=3&t=163 I am currently in the process of writing a Linux kernel module in C. The module provides an extremely basic driver for a USB light (the device consists of three colored LEDs). I have managed to get the driver to load and unload without problems and also create the device (/dev/wn0, /dev/wn1, etc.). However, I keep getting errors when attempting to write to the device: $ echo "1" >/dev/wn0 bash: echo: write error: Broken http://stackoverflow.com/questions/14312988/why-is-my-kernel-module-throwing-broken-pipe-errors-when-i-try-to-write-to-a-d pipe The entire code for the module is here. However, the interesting part is the wn_set_color() function: /* Create the data buffer to be sent to the device. */ u8 buf[8] = { red, green, blue, 0, 0, 0, 0x1F, 0x05 }; /* Send the data to the device. */ return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0, 0, 0, 0, buf, 8, 0); For some reason, it returns -32 instead of sending the data to the device. I am completely new to Linux kernel programming so I'm likely doing something silly. If you can shed some light on this at all, it would be greatly appreciated. Edit: here is some further information: lsusb -v output is here the bDescriptorType member of the usb_endpoint_descriptor class contains '5' for the single endpoint exposed by the device (bEndpointAddress is 129 - or 0x81 in hex) here is a screengrab of one of the control URBs sent to the device linux-kernel usb kernel-module share|improve this question edited Jan 15 '13 at 6:33 asked Jan 14 '13 at 3:26 Nathan Osman 23.4k39171281 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote usb_control_msg() eventually calls down to usb_submit_urb(). The Documentation/usb/error-codes.txt file describes the errors that this function can return: -EPIPE The pipe type specified in the URB doesn't match the endpoint's actual type. If usb_s
Member Registered: 2010-08-03 Posts: 17 avrdude not working[SOLVED] Hello,i made a usbasp avr programmer and it worked with avrdude without root.Today i want to use it, but i got error:avrdude: Warning: cannot query manufacturer for https://bbs.archlinux.org/viewtopic.php?id=103836 device: error sending control message: Operation not permittedavrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dcWith root it works. Tried in this page: http://blog.vmario.org/2008/10/22/progr … -linuksie/ but nothing happens... Last edited by ubituks (2010-08-30 05:22:16) Offline #2 2010-08-29 12:34:48 Cyrusm Member From: Bozeman, MT Registered: 2007-11-15 Posts: 1,052 Re: avrdude not working[SOLVED] seems to be a permissions issue.First do a lsusb as root. error sending Then you should be able to chmod the permissions on the corresponding /proc/bus/usb/