MCPcopy Create free account
hub / github.com/F-Stack/f-stack / opae_adapter_data_alloc

Function opae_adapter_data_alloc

dpdk/drivers/raw/ifpga/base/opae_hw_api.c:271–295  ·  view source on GitHub ↗

* opae_adapter_data_alloc - alloc opae_adapter_data data structure * @type: opae_adapter_type. * * Return: opae_adapter_data on success, otherwise NULL. */

Source from the content-addressed store, hash-verified

269 * Return: opae_adapter_data on success, otherwise NULL.
270 */
271void *opae_adapter_data_alloc(enum opae_adapter_type type)
272{
273 struct opae_adapter_data *data;
274 int size;
275
276 switch (type) {
277 case OPAE_FPGA_PCI:
278 size = sizeof(struct opae_adapter_data_pci);
279 break;
280 case OPAE_FPGA_NET:
281 size = sizeof(struct opae_adapter_data_net);
282 break;
283 default:
284 size = sizeof(struct opae_adapter_data);
285 break;
286 }
287
288 data = opae_zmalloc(size);
289 if (!data)
290 return NULL;
291
292 data->type = type;
293
294 return data;
295}
296
297static struct opae_adapter_ops *match_ops(struct opae_adapter *adapter)
298{

Callers 1

ifpga_rawdev_createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected