usb mass storage ADSC cmd

2014-06-28 Thread Dave Tian
Hi there,

I am trying to implement a communication between the host and a usb mass 
storage device using ADSC cmd. The device is using the g_mass_storage gadget 
driver. So far, broken pipe (-32) from the host side is all what I have got. My 
questions are:

1. Could the device support ADSC cmd even it is using SCSI transport instead of 
CBI transport?
2. Is this composite correct for the host to retrieve 1 byte response from the 
device using ADSC?
usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0),
0,  // ADSC
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, // type
0,  // value
0,  // index
buf,// recv buf
1,  // size
10*HZ); // timeout

Thanks,

Dave Tian
dave.jing.t...@gmail.com
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Delay in Printk Messages.

2014-06-28 Thread mhornung . linux
Hello Arun Kumar,

On Sat, 28. Jun 23:03, Arun Kumar wrote:
> I am able to read my printk messages in the kernel buffer only after 
> unloading the module..
> Is there some reason or configuration behind this.
> 
> I used a simple kernel module with only init and exit functions, and 
> after loading the module i cannot see the message printed by the 
> "module_init" function in the output given by "dmesg -c" I can see them 
> only after i unload the module.
> 

Since you do not provide your code I have to guess that your print
statement looks like this:

  pr_debug("Hello World!");

Please notice that printk doesn't flush until a trailing newline is
provided (Linux Device Drivers Chapter 4). So maybe this is what you want:

  pr_debug("Hello World!\n");

> i wait for around 15-20 seconds for the init message but it only shows 
> up on removing the module.
> 
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

With best regards

Michael Hornung

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Delay in Printk Messages.

2014-06-28 Thread Aruna Hewapathirane
Try echo "7" > /proc/sys/kernel/printk to enable all console log levels.

The numbers are corresponding to below:

#define KERN_EMERG "<0>" /* system is unusable*/
#define KERN_ALERT "<1>" /* action must be taken immediately*/
#define KERN_CRIT "<2>" /* critical conditions*/
#define KERN_ERR "<3>" /* error conditions*/
#define KERN_WARNING "<4>" /* warning conditions*/
#define KERN_NOTICE "<5>" /* normal but significant condition*/
#define KERN_INFO "<6>" /* informational*/
#define KERN_DEBUG "<7>" /* debug-level messages*/

The default number is 4, which allows console to show messages only at
least in KERN_WARNING. That could be why you cannot see log in
KERN_INFO level.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Delay in Printk Messages.

2014-06-28 Thread Kristofer Hallin
Try 'sysctl kernel.printk=7' where 7 is one of the levels defined in
"include/linux/kern_levels.h".

On Sat, Jun 28, 2014 at 7:33 PM, Arun Kumar  wrote:
> I am able to read my printk messages in the kernel buffer only after
> unloading the module..
> Is there some reason or configuration behind this.
>
> I used a simple kernel module with only init and exit functions, and
> after loading the module i cannot see the message printed by the
> "module_init" function in the output given by "dmesg -c" I can see them
> only after i unload the module.
>
> i wait for around 15-20 seconds for the init message but it only shows
> up on removing the module.
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Delay in Printk Messages.

2014-06-28 Thread Arun Kumar
I am able to read my printk messages in the kernel buffer only after 
unloading the module..
Is there some reason or configuration behind this.

I used a simple kernel module with only init and exit functions, and 
after loading the module i cannot see the message printed by the 
"module_init" function in the output given by "dmesg -c" I can see them 
only after i unload the module.

i wait for around 15-20 seconds for the init message but it only shows 
up on removing the module.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula Challenge How To Prepare

2014-06-28 Thread karthik nayak
Read The LInux Device Drivers Book :)


On Sat, Jun 28, 2014 at 10:57 AM, me storage 
wrote:

> Hi
> I have been waiting for my Task 04 Result from last 3 days .I know so many
> people are waiting more than this.So can one please tell me How to prepare
> for the next Task i.e what are the concepts necessary topics for Task 05?
> Thanks
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Kernel memory leak

2014-06-28 Thread Anil Shashikumar Belur

On Saturday 28 June 2014 12:29 PM, Santhosh Kumar wrote:
>
> Is there a way to trace the allocations of memory from different buckets of
> kmalloc ?
You could try out kmemleak -
https://www.kernel.org/doc/Documentation/kmemleak.txt

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Kernel memory leak

2014-06-28 Thread Santhosh Kumar
I am suspecting a memory leak in a kernel module that does layer 2
switching of data packets.

In the vmstat -m output the Num and Total keeps going up for the
kmalloc-512..

kmalloc-512   15232  15264512 16

Is this a clear indication of leak in the kernel or can there be false
positives ?

Is there a way to trace the allocations of memory from different buckets of
kmalloc ?

-Santhosh.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies