Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Mac OS X vs Linux USB drivers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac OS X vs Linux USB drivers



I too have been trying to give the SE401 driver a go. I have been taking
a different approach to the problem: start simple and then tackle then
'harder stuff' - then again this approach suits me as this is the time
I deal with Darwin drivers and would love to get my camera working :).
In this case I have decided that simply getting the LED on the camera
to activate would be a first step, though I haven't had any luck yet.

In order to activate the LED the Linux code uses the following code:

/* SE401_REQ_LED_CONTROL = 0x57 */
se401_sndctrl(1, se401, SE401_REQ_LED_CONTROL, 1, NULL, 0);

where the implementation of the called function is as follows:

static int se401_sndctrl(int set, struct usb_se401 *se401, unsigned short req,
unsigned short value, unsigned char *cp, int size)
{
/* se401->dev refers to "struct usb_device" */
return usb_control_msg (
se401->dev,
set ? usb_sndctrlpipe(se401->dev, 0) : usb_rcvctrlpipe(se401->dev, 0),
req,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
0,
cp,
size,
HZ
);
}

I have been trying to take AnchorUSB sample code as a reference point in trying
to write my code and have tried the following:

IOUSBDevRequest request;

request.bmRequestType = USBmakebmRequestType(kUSBOut, kUSBVendor, kUSBDevice);
request.bRequest = SE401_REQ_LED_CONTROL;
request.wValue = 1;
request.wIndex = 0;
request.wLength = 0;
request.pData = NULL;

/* IOUSBDevice * fDevice */
fDevice->DeviceRequest(&request);

I have managed to create a kext that I then tried to load using "kextload"
. The
kext loads okay, as I see it using "kmodstat", but nothing happens. I am really
confused how I should be mapping the significant values. Is there any way I can
tell whether the driver is actually bound to a device? I don't see anything
appear in the System.log and the IOLog() calls don't seem to display anything
anywhere ( do I need to activate something ).

Regards

Andre

--
mailto:email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.