Hi,
I am tring to find isochronous endpoints in an Interface and claim
the particular interface. I m using the following code. It does the same. But i
am not able to receive isochronous packets ... my kernel version 2.6.9.
i found difference in /proc/bus/usb/devices file when i m loading
hci_usb and my module seperatly..
The difference is, when hci_usb module is loaded, one hub device
shows like some bandwidth allocated .
T: Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 27/900 us ( 3%), #Int= 1, #Iso= 2
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 2.06
S: Manufacturer=Linux 2.6.9-1.667 uhci_hcd
S: Product=UHCI Host Controller
S: SerialNumber=0000:00:1d.3
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
But when i loaded my module, it is displaying as Alloc 0%
(Remaining all device are same). I think i am missing some thing. Any
suggestions ...
code snap:
isoc_iface = usb_ifnum_to_if(dev, isoc_ifnum);
if (isoc_iface)
{
info ("Total NUmber of Alt Settings in ISOC
%d",isoc_iface->num_altsetting);
for (a = 0; a < isoc_iface->num_altsetting; a++)
{
uif = &isoc_iface->altsetting[a];
err("Alternate setting Number %d",a);
for (e = 0; e < uif->desc.bNumEndpoints; e++)
{
endpoint = &uif->endpoint[e];
switch (endpoint->desc.bmAttributes &
USB_ENDPOINT_XFERTYPE_MASK)
{
case USB_ENDPOINT_XFER_ISOC:
if
(le16_to_cpu(endpoint->desc.wMaxPacketSize) < size ||
uif->desc.bAlternateSetting != isoc)
break;
size =
le16_to_cpu(endpoint->desc.wMaxPacketSize);
isoc_alts =
uif->desc.bAlternateSetting;
if
(endpoint->desc.bEndpointAddress & USB_DIR_IN)
{
isoc_in_ep = endpoint;
}
else
isoc_out_ep = endpoint;
break;
}
}
}
if (!isoc_in_ep || !isoc_out_ep)
err("Isoc endpoints not found");
else {
info("isoc ifnum %d alts %d", isoc_ifnum, isoc_alts);
if (usb_interface_claimed(isoc_iface))
err("Interface already Claimed !!");
else if
(usb_driver_claim_interface(&usb_bluetooth_driver, isoc_iface, bluetooth) != 0)
err("Can't claim isoc interface");
else
err("isoc interface claimed successfully");
if (usb_set_interface(bluetooth->dev, isoc_ifnum,
isoc_alts)) {
err("Can't set isoc interface settings");
bluetooth->isoc_iface = isoc_iface;
goto probe_error;
} else
bluetooth->isoc_out_endpointAddress=isoc_out_ep->desc.bEndpointAddress;
bluetooth->isoc_out_buffer_size=le16_to_cpu(isoc_out_ep->desc.wMaxPacketSize);
bluetooth->isoc_read_urb = usb_alloc_urb (1,
GFP_KERNEL);
if (!bluetooth->isoc_read_urb)
{
info("Couldnt Allocate isoc_read_urb ");
goto probe_error;
}
bluetooth->isoc_in_buffer_size=buffer_size=
le16_to_cpu(isoc_in_ep->desc.wMaxPacketSize);
bluetooth->isoc_in_endpointAddress =
isoc_in_ep->desc.bEndpointAddress;
bluetooth->isoc_in_interval =
isoc_in_ep->desc.bInterval;
bluetooth->isoc_iface = isoc_iface;
bluetooth->isoc_in_buffer= kmalloc(buffer_size * 10
,GFP_KERNEL);
if (!bluetooth->isoc_in_buffer)
{
err("Couldnt allocate Isoc_in_buffer");
goto probe_error;
}
usb_fill_isoc_urb (bluetooth->isoc_read_urb,
bluetooth->dev,
usb_rcvisocpipe(bluetooth->dev,131),
bluetooth->isoc_in_buffer,
bluetooth->isoc_in_buffer_size,
bluetooth_read_isoc_callback,
bluetooth,bluetooth->isoc_in_interval);
result = usb_submit_urb(bluetooth->isoc_read_urb,
GFP_KERNEL);
if (result < 0)
err("Error in isoc submit ");
-- Ivy
__________________________
Free 2500MB email. Stops spam 100%. No banner ads. No popup ads.
http://www.cashette.com
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel