aic94xx.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * Aic94xx SAS/SATA driver header file.
  3. *
  4. * Copyright (C) 2005 Adaptec, Inc. All rights reserved.
  5. * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
  6. *
  7. * This file is licensed under GPLv2.
  8. *
  9. * This file is part of the aic94xx driver.
  10. *
  11. * The aic94xx driver is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; version 2 of the
  14. * License.
  15. *
  16. * The aic94xx driver is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with the aic94xx driver; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  24. *
  25. * $Id: //depot/aic94xx/aic94xx.h#31 $
  26. */
  27. #ifndef _AIC94XX_H_
  28. #define _AIC94XX_H_
  29. #include <linux/slab.h>
  30. #include <linux/ctype.h>
  31. #include <scsi/libsas.h>
  32. #define ASD_DRIVER_NAME "aic94xx"
  33. #define ASD_DRIVER_DESCRIPTION "Adaptec aic94xx SAS/SATA driver"
  34. #define asd_printk(fmt, ...) printk(KERN_NOTICE ASD_DRIVER_NAME ": " fmt, ## __VA_ARGS__)
  35. #ifdef ASD_ENTER_EXIT
  36. #define ENTER printk(KERN_NOTICE "%s: ENTER %s\n", ASD_DRIVER_NAME, \
  37. __func__)
  38. #define EXIT printk(KERN_NOTICE "%s: --EXIT %s\n", ASD_DRIVER_NAME, \
  39. __func__)
  40. #else
  41. #define ENTER
  42. #define EXIT
  43. #endif
  44. #ifdef ASD_DEBUG
  45. #define ASD_DPRINTK asd_printk
  46. #else
  47. #define ASD_DPRINTK(fmt, ...)
  48. #endif
  49. /* 2*ITNL timeout + 1 second */
  50. #define AIC94XX_SCB_TIMEOUT (5*HZ)
  51. extern struct kmem_cache *asd_dma_token_cache;
  52. extern struct kmem_cache *asd_ascb_cache;
  53. static inline void asd_stringify_sas_addr(char *p, const u8 *sas_addr)
  54. {
  55. int i;
  56. for (i = 0; i < SAS_ADDR_SIZE; i++, p += 2)
  57. snprintf(p, 3, "%02X", sas_addr[i]);
  58. *p = '\0';
  59. }
  60. struct asd_ha_struct;
  61. struct asd_ascb;
  62. int asd_read_ocm(struct asd_ha_struct *asd_ha);
  63. int asd_read_flash(struct asd_ha_struct *asd_ha);
  64. int asd_dev_found(struct domain_device *dev);
  65. void asd_dev_gone(struct domain_device *dev);
  66. void asd_invalidate_edb(struct asd_ascb *ascb, int edb_id);
  67. int asd_execute_task(struct sas_task *task, gfp_t gfp_flags);
  68. void asd_set_dmamode(struct domain_device *dev);
  69. /* ---------- TMFs ---------- */
  70. int asd_abort_task(struct sas_task *);
  71. int asd_abort_task_set(struct domain_device *, u8 *lun);
  72. int asd_clear_aca(struct domain_device *, u8 *lun);
  73. int asd_clear_task_set(struct domain_device *, u8 *lun);
  74. int asd_lu_reset(struct domain_device *, u8 *lun);
  75. int asd_I_T_nexus_reset(struct domain_device *dev);
  76. int asd_query_task(struct sas_task *);
  77. /* ---------- Adapter and Port management ---------- */
  78. int asd_clear_nexus_port(struct asd_sas_port *port);
  79. int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha);
  80. /* ---------- Phy Management ---------- */
  81. int asd_control_phy(struct asd_sas_phy *phy, enum phy_func func, void *arg);
  82. #endif