mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-14 06:35:12 +00:00
c9c13ba428
Code that iterates over all standard PCI BARs typically uses PCI_STD_RESOURCE_END. However, that requires the unusual test "i <= PCI_STD_RESOURCE_END" rather than something the typical "i < PCI_STD_NUM_BARS". Add a definition for PCI_STD_NUM_BARS and change loops to use the more idiomatic C style to help avoid fencepost errors. Link: https://lore.kernel.org/r/20190927234026.23342-1-efremov@linux.com Link: https://lore.kernel.org/r/20190927234308.23935-1-efremov@linux.com Link: https://lore.kernel.org/r/20190916204158.6889-3-efremov@linux.com Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Sebastian Ott <sebott@linux.ibm.com> # arch/s390/ Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> # video/fbdev/ Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com> # pci/controller/dwc/ Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com> # scsi/pm8001/ Acked-by: Martin K. Petersen <martin.petersen@oracle.com> # scsi/pm8001/ Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # memstick/
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright (C) 2018 Google, Inc. */
|
|
#ifndef __GASKET_CONSTANTS_H__
|
|
#define __GASKET_CONSTANTS_H__
|
|
|
|
#define GASKET_FRAMEWORK_VERSION "1.1.2"
|
|
|
|
/*
|
|
* The maximum number of simultaneous device types supported by the framework.
|
|
*/
|
|
#define GASKET_FRAMEWORK_DESC_MAX 2
|
|
|
|
/* The maximum devices per each type. */
|
|
#define GASKET_DEV_MAX 256
|
|
|
|
/* The number of supported Gasket page tables per device. */
|
|
#define GASKET_MAX_NUM_PAGE_TABLES 1
|
|
|
|
/* Maximum length of device names (driver name + minor number suffix + NULL). */
|
|
#define GASKET_NAME_MAX 32
|
|
|
|
/* Device status enumeration. */
|
|
enum gasket_status {
|
|
/*
|
|
* A device is DEAD if it has not been initialized or has had an error.
|
|
*/
|
|
GASKET_STATUS_DEAD = 0,
|
|
/*
|
|
* A device is LAMED if the hardware is healthy but the kernel was
|
|
* unable to enable some functionality (e.g. interrupts).
|
|
*/
|
|
GASKET_STATUS_LAMED,
|
|
|
|
/* A device is ALIVE if it is ready for operation. */
|
|
GASKET_STATUS_ALIVE,
|
|
|
|
/*
|
|
* This status is set when the driver is exiting and waiting for all
|
|
* handles to be closed.
|
|
*/
|
|
GASKET_STATUS_DRIVER_EXIT,
|
|
};
|
|
|
|
#endif
|