[openib-general] Proposed device enumeration & async event APIs
Roland Dreier
roland at topspin.com
Sun Sep 12 09:05:14 PDT 2004
Fab> Like Sean said, if the common case is going to be a single
Fab> device, then the gain is likely not worth the complication in
Fab> the code. I don't feel really strongly about it, it was just
Fab> a thought based on how the device related notifications
Fab> worked in IBAL, which I found to be useful. No biggie either
Fab> way, and it should be simple enough to change down the road
Fab> if we see a need.
OK, I thought about it some more and I decided that it's better to
have the API from the beginning so that more efficient implementations
can be added without changing the client code. However, I implemented
the following API:
void *ib_get_client_data(struct ib_device *device, struct ib_client *client);
int ib_set_client_data(struct ib_device *device, struct ib_client *client,
void *data);
I think this is equivalent to what you proposed but simpler to
implement and use. It also mimics the API in <linux/pci.h>:
void *pci_get_drvdata (struct pci_dev *pdev);
void pci_set_drvdata (struct pci_dev *pdev, void *data);
(my set function returns an int because it does an allocation, so it
can fail)
Comments?
- R.
More information about the general
mailing list