From: Leon l. <as...@ms...> - 2007-07-17 16:19:27
|
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 pci_set_drvdata(pci_dev, net_dev); 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 = { .function.pProbe = hifDeviceInserted, .function.pRemove = hifDeviceRemoved, } hifDeviceInserted(SDFUNCTION *function, SDDEVICE *handle) { device = addHifDevice(handle); <===== hifDevice[0] } hifDeviceRemoved(SDFUNCTION *function, SDDEVICE *handle) { device = getHifDevice(handle); <====== hifDevice[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 */ } static inline void pci_set_drvdata (struct pci_dev *pdev, void *data); Any suggestion ? Regards, Leon |