^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Aic94xx SAS/SATA driver header file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2005 Adaptec, Inc. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * $Id: //depot/aic94xx/aic94xx.h#31 $
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifndef _AIC94XX_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define _AIC94XX_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/slab.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/ctype.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <scsi/libsas.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define ASD_DRIVER_NAME "aic94xx"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define ASD_DRIVER_DESCRIPTION "Adaptec aic94xx SAS/SATA driver"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define asd_printk(fmt, ...) printk(KERN_NOTICE ASD_DRIVER_NAME ": " fmt, ## __VA_ARGS__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #ifdef ASD_ENTER_EXIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define ENTER printk(KERN_NOTICE "%s: ENTER %s\n", ASD_DRIVER_NAME, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) __func__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define EXIT printk(KERN_NOTICE "%s: --EXIT %s\n", ASD_DRIVER_NAME, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __func__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define ENTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define EXIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #ifdef ASD_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define ASD_DPRINTK asd_printk
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define ASD_DPRINTK(fmt, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) /* 2*ITNL timeout + 1 second */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define AIC94XX_SCB_TIMEOUT (5*HZ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern struct kmem_cache *asd_dma_token_cache;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) extern struct kmem_cache *asd_ascb_cache;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) struct asd_ha_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) struct asd_ascb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) int asd_read_ocm(struct asd_ha_struct *asd_ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) int asd_read_flash(struct asd_ha_struct *asd_ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) int asd_dev_found(struct domain_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) void asd_dev_gone(struct domain_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) void asd_invalidate_edb(struct asd_ascb *ascb, int edb_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) int asd_execute_task(struct sas_task *task, gfp_t gfp_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) void asd_set_dmamode(struct domain_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) /* ---------- TMFs ---------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) int asd_abort_task(struct sas_task *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) int asd_abort_task_set(struct domain_device *, u8 *lun);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) int asd_clear_aca(struct domain_device *, u8 *lun);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) int asd_clear_task_set(struct domain_device *, u8 *lun);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) int asd_lu_reset(struct domain_device *, u8 *lun);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) int asd_I_T_nexus_reset(struct domain_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) int asd_query_task(struct sas_task *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) /* ---------- Adapter and Port management ---------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) int asd_clear_nexus_port(struct asd_sas_port *port);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) /* ---------- Phy Management ---------- */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) int asd_control_phy(struct asd_sas_phy *phy, enum phy_func func, void *arg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif