In the function driver's PSDFUNCTION pFunction structure there is a
pContext member. You can use this for whatever the driver needs. The
samples in src/function use this.
=20
Regards
=20
Paul
_____ =20
From: Leon lee [mailto:as...@ms...]=20
Sent: Tuesday, July 17, 2007 9:19 AM
To: sdi...@li...
Subject: [Sdio-linux-devel] About device information
Hi,
I am porting our wireless product to Linux.
I think that the register/unregister functions of SDIO stack are similar
to those of PCI.
However, pci allows us to store private data=20
pci_set_drvdata(pci_dev, net_dev);=20
In other word, we need to use global variable to store our private data.
Check AR6000 :
function/wlan/ar6000/hif/hif.c
TARGET_FUNCTION_CONTEXT FunctionContext =3D {
.function.pProbe =3D hifDeviceInserted,=20
.function.pRemove =3D hifDeviceRemoved,
}
hifDeviceInserted(SDFUNCTION *function, SDDEVICE *handle)
{
device =3D addHifDevice(handle); <=3D=3D=3D=3D=3D hifDevice[=
0]
}
hifDeviceRemoved(SDFUNCTION *function, SDDEVICE *handle)=20
{
device =3D getHifDevice(handle); <=3D=3D=3D=3D=3D=3D hifDevi=
ce[0]
}
Therefore, I think that we can follow the method of PCI to store device
information
linux/pci.h
struct pci_dev {
struct device dev; /* Generic device interface */=20
}
static inline void pci_set_drvdata (struct pci_dev *pdev, void *data);
Any suggestion ?
Regards,
Leon
|