1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2d6159c17SJames Bottomley #ifndef _SCSI_SAS_INTERNAL_H
3d6159c17SJames Bottomley #define _SCSI_SAS_INTERNAL_H
4d6159c17SJames Bottomley 
5d6159c17SJames Bottomley #define SAS_HOST_ATTRS		0
665c92b09SJames Bottomley #define SAS_PHY_ATTRS		17
765c92b09SJames Bottomley #define SAS_PORT_ATTRS		1
8cdc43ae3SHannes Reinecke #define SAS_RPORT_ATTRS		8
90f88009dSJames Bottomley #define SAS_END_DEV_ATTRS	5
10d6159c17SJames Bottomley #define SAS_EXPANDER_ATTRS	7
11d6159c17SJames Bottomley 
12d6159c17SJames Bottomley struct sas_internal {
13d6159c17SJames Bottomley 	struct scsi_transport_template t;
14d6159c17SJames Bottomley 	struct sas_function_template *f;
15d6159c17SJames Bottomley 	struct sas_domain_function_template *dft;
16d6159c17SJames Bottomley 
17ee959b00STony Jones 	struct device_attribute private_host_attrs[SAS_HOST_ATTRS];
18ee959b00STony Jones 	struct device_attribute private_phy_attrs[SAS_PHY_ATTRS];
19ee959b00STony Jones 	struct device_attribute private_port_attrs[SAS_PORT_ATTRS];
20ee959b00STony Jones 	struct device_attribute private_rphy_attrs[SAS_RPORT_ATTRS];
21ee959b00STony Jones 	struct device_attribute private_end_dev_attrs[SAS_END_DEV_ATTRS];
22ee959b00STony Jones 	struct device_attribute private_expander_attrs[SAS_EXPANDER_ATTRS];
23d6159c17SJames Bottomley 
24d6159c17SJames Bottomley 	struct transport_container phy_attr_cont;
2565c92b09SJames Bottomley 	struct transport_container port_attr_cont;
26d6159c17SJames Bottomley 	struct transport_container rphy_attr_cont;
27d6159c17SJames Bottomley 	struct transport_container end_dev_attr_cont;
28d6159c17SJames Bottomley 	struct transport_container expander_attr_cont;
29d6159c17SJames Bottomley 
30d6159c17SJames Bottomley 	/*
31d6159c17SJames Bottomley 	 * The array of null terminated pointers to attributes
32d6159c17SJames Bottomley 	 * needed by scsi_sysfs.c
33d6159c17SJames Bottomley 	 */
34ee959b00STony Jones 	struct device_attribute *host_attrs[SAS_HOST_ATTRS + 1];
35ee959b00STony Jones 	struct device_attribute *phy_attrs[SAS_PHY_ATTRS + 1];
36ee959b00STony Jones 	struct device_attribute *port_attrs[SAS_PORT_ATTRS + 1];
37ee959b00STony Jones 	struct device_attribute *rphy_attrs[SAS_RPORT_ATTRS + 1];
38ee959b00STony Jones 	struct device_attribute *end_dev_attrs[SAS_END_DEV_ATTRS + 1];
39ee959b00STony Jones 	struct device_attribute *expander_attrs[SAS_EXPANDER_ATTRS + 1];
40d6159c17SJames Bottomley };
41d6159c17SJames Bottomley #define to_sas_internal(tmpl)	container_of(tmpl, struct sas_internal, t)
42d6159c17SJames Bottomley 
43d6159c17SJames Bottomley #endif
44