Path: blob/main/sys/dev/bnxt/bnxt_en/bnxt_auxbus_compat.h
39536 views
/*-1* Broadcom NetXtreme-C/E network driver.2*3* Copyright (c) 2024 Broadcom, All Rights Reserved.4* The term Broadcom refers to Broadcom Limited and/or its subsidiaries5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'16* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS19* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR20* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF21* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS22* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN23* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)24* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF25* THE POSSIBILITY OF SUCH DAMAGE.26*/2728#ifndef _BNXT_AUXILIARY_COMPAT_H_29#define _BNXT_AUXILIARY_COMPAT_H_3031#include <linux/device.h>32#include <linux/idr.h>3334#define KBUILD_MODNAME "if_bnxt"35#define AUXILIARY_NAME_SIZE 323637struct auxiliary_device_id {38char name[AUXILIARY_NAME_SIZE];39uint64_t driver_data;40};41#define MODULE_DEVICE_TABLE_BUS_auxiliary(_bus, _table)4243struct auxiliary_device {44struct device dev;45const char *name;46uint32_t id;47struct list_head list;48};4950struct auxiliary_driver {51int (*probe)(struct auxiliary_device *auxdev, const struct auxiliary_device_id *id);52void (*remove)(struct auxiliary_device *auxdev);53const char *name;54struct device_driver driver;55const struct auxiliary_device_id *id_table;56struct list_head list;57};5859int auxiliary_device_init(struct auxiliary_device *auxdev);60int auxiliary_device_add(struct auxiliary_device *auxdev);61void auxiliary_device_uninit(struct auxiliary_device *auxdev);62void auxiliary_device_delete(struct auxiliary_device *auxdev);63int auxiliary_driver_register(struct auxiliary_driver *auxdrv);64void auxiliary_driver_unregister(struct auxiliary_driver *auxdrv);6566static inline void *auxiliary_get_drvdata(struct auxiliary_device *auxdev)67{68return dev_get_drvdata(&auxdev->dev);69}7071static inline void auxiliary_set_drvdata(struct auxiliary_device *auxdev, void *data)72{73dev_set_drvdata(&auxdev->dev, data);74}75#endif /* _BNXT_AUXILIARY_COMPAT_H_ */767778