first time to fill the URB and send off: 1. fill URB1 2. send off URB1 then 3. fill the same URB, ie. URB1(violate previous URB1 if URB1 does not complete) 4. send off URB1 again.(Even use spin-lock to protect URB1, the URB1 has violated at step 3).
So I think the sequece is: 1. acquire spin-lock to protect URB1 2. fill URB1 3. send off URB1 4. if URB1 complete, release spin-lock Is my idea right? -james ----- Original Message ----- From: "Duncan Sands" <[EMAIL PROTECTED]> To: "James_chen(陳彥宏)" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, January 02, 2004 4:14 PM Subject: Re: [linux-usb-devel] [help]FILL_CONTROL_URB( ) macro > > This is the first time I write the usb driver under linux. For macro > > FILL_CONTROL_URB( ), I have one question: > > URB do not protect by spinlock. FILL_CONTROL_URB( ) just initialize spin > > lock and do not use it. > > > > Do I make some mistake? Anyone can give me some suggestion. Thank you in > > advance. > > FILL_CONTROL_URB just initializes the urb. The spinlock is one of the structures > it initializes. To use the urb you need to call usb_submit_urb. The code in there > (actually in the hcd IIRC) uses the spinlock. > > Ciao, > > Duncan. > ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
