Skip to content

Commit 2908d77

Browse files
James BottomleyJames Bottomley
authored andcommitted
[SCSI] aic94xx: new driver
This is the end point of the separate aic94xx driver based on the original driver and transport class from Luben Tuikov <ltuikov@yahoo.com> The log of the separate development is: Alexis Bruemmer: o aic94xx: fix hotplug/unplug for expanderless systems o aic94xx: disable split completion timer/setting by default o aic94xx: wide port off expander support o aic94xx: remove various inline functions o aic94xx: use bitops o aic94xx: remove queue comment o aic94xx: remove sas_common.c o aic94xx: sas remove depot's o aic94xx: use available list_for_each_entry_safe_reverse() o aic94xx: sas header file merge James Bottomley: o aic94xx: fix TF_TMF_NO_CTX processing o aic94xx: convert to request_firmware interface o aic94xx: fix hotplug/unplug o aic94xx: add link error counts to the expander phys o aic94xx: add transport class phy reset capability o aic94xx: remove local_attached flag o Remove README o Fixup Makefile variable for libsas rename o Rename sas->libsas o aic94xx: correct return code for sas_discover_event o aic94xx: use parent backlink port o aic94xx: remove channel abstraction o aic94xx: fix routing algorithms o aic94xx: add backlink port o aic94xx: fix cascaded expander properties o aic94xx: fix sleep under lock o aic94xx: fix panic on module removal in complex topology o aic94xx: make use of the new sas_port o rename sas_port to asd_sas_port o Fix for eh_strategy_handler move o aic94xx: move entirely over to correct transport class formulation o remove last vestages of sas_rphy_alloc() o update for eh_timed_out move o Preliminary expander support for aic94xx o sas: remove event thread o minor warning cleanups o remove last vestiges of id mapping arrays o Further updates o Convert aic94xx over entirely to the transport class end device and o update aic94xx/sas to use the new sas transport class end device o [PATCH] aic94xx: attaching to the sas transport class o Add missing completion removal from prior patch o [PATCH] aic94xx: attaching to the sas transport class o Build fixes from akpm Jeff Garzik: o [scsi aic94xx] Remove ->owner from PCI info table Luben Tuikov: o initial aic94xx driver Mike Anderson: o aic94xx: fix panic on module insertion o aic94xx: stub out SATA_DEV case o aic94xx: compile warning cleanups o aic94xx: sas_alloc_task o aic94xx: ref count update o aic94xx nexus loss time value o [PATCH] aic94xx: driver assertion in non-x86 BIOS env Randy Dunlap: o libsas: externs not needed Robert Tarte: o aic94xx: sequence patch - fixes SATA support Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1 parent f4ad7b5 commit 2908d77

37 files changed

+18866
-1
lines changed

Documentation/scsi/libsas.txt

Lines changed: 484 additions & 0 deletions
Large diffs are not rendered by default.

drivers/scsi/Kconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ config SCSI_LOGGING
209209
there should be no noticeable performance impact as long as you have
210210
logging turned off.
211211

212-
menu "SCSI Transport Attributes"
212+
menu "SCSI Transports"
213213
depends on SCSI
214214

215215
config SCSI_SPI_ATTRS
@@ -242,6 +242,8 @@ config SCSI_SAS_ATTRS
242242
If you wish to export transport-specific information about
243243
each attached SAS device to sysfs, say Y.
244244

245+
source "drivers/scsi/libsas/Kconfig"
246+
245247
endmenu
246248

247249
menu "SCSI low-level drivers"
@@ -431,6 +433,7 @@ config SCSI_AIC7XXX_OLD
431433
module will be called aic7xxx_old.
432434

433435
source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
436+
source "drivers/scsi/aic94xx/Kconfig"
434437

435438
# All the I2O code and drivers do not seem to be 64bit safe.
436439
config SCSI_DPT_I2O

drivers/scsi/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ obj-$(CONFIG_SCSI_SPI_ATTRS) += scsi_transport_spi.o
3232
obj-$(CONFIG_SCSI_FC_ATTRS) += scsi_transport_fc.o
3333
obj-$(CONFIG_SCSI_ISCSI_ATTRS) += scsi_transport_iscsi.o
3434
obj-$(CONFIG_SCSI_SAS_ATTRS) += scsi_transport_sas.o
35+
obj-$(CONFIG_SCSI_SAS_LIBSAS) += libsas/
3536

3637
obj-$(CONFIG_ISCSI_TCP) += libiscsi.o iscsi_tcp.o
3738
obj-$(CONFIG_INFINIBAND_ISER) += libiscsi.o
@@ -68,6 +69,7 @@ obj-$(CONFIG_SCSI_AIC7XXX) += aic7xxx/
6869
obj-$(CONFIG_SCSI_AIC79XX) += aic7xxx/
6970
obj-$(CONFIG_SCSI_AACRAID) += aacraid/
7071
obj-$(CONFIG_SCSI_AIC7XXX_OLD) += aic7xxx_old.o
72+
obj-$(CONFIG_SCSI_AIC94XX) += aic94xx/
7173
obj-$(CONFIG_SCSI_IPS) += ips.o
7274
obj-$(CONFIG_SCSI_FD_MCS) += fd_mcs.o
7375
obj-$(CONFIG_SCSI_FUTURE_DOMAIN)+= fdomain.o

drivers/scsi/aic94xx/Kconfig

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#
2+
# Kernel configuration file for aic94xx SAS/SATA driver.
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 Aic94xx Driver; if not, write to the Free Software
23+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24+
#
25+
#
26+
27+
config SCSI_AIC94XX
28+
tristate "Adaptec AIC94xx SAS/SATA support"
29+
depends on PCI
30+
select SCSI_SAS_LIBSAS
31+
help
32+
This driver supports Adaptec's SAS/SATA 3Gb/s 64 bit PCI-X
33+
AIC94xx chip based host adapters.
34+
35+
config AIC94XX_DEBUG
36+
bool "Compile in debug mode"
37+
default y
38+
depends on SCSI_AIC94XX
39+
help
40+
Compiles the aic94xx driver in debug mode. In debug mode,
41+
the driver prints some messages to the console.

drivers/scsi/aic94xx/Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Makefile for Adaptec aic94xx SAS/SATA driver.
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 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+
ifeq ($(CONFIG_AIC94XX_DEBUG),y)
26+
EXTRA_CFLAGS += -DASD_DEBUG -DASD_ENTER_EXIT
27+
endif
28+
29+
obj-$(CONFIG_SCSI_AIC94XX) += aic94xx.o
30+
aic94xx-y += aic94xx_init.o \
31+
aic94xx_hwi.o \
32+
aic94xx_reg.o \
33+
aic94xx_sds.o \
34+
aic94xx_seq.o \
35+
aic94xx_dump.o \
36+
aic94xx_scb.o \
37+
aic94xx_dev.o \
38+
aic94xx_tmf.o \
39+
aic94xx_task.o

drivers/scsi/aic94xx/aic94xx.h

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
28+
#ifndef _AIC94XX_H_
29+
#define _AIC94XX_H_
30+
31+
#include <linux/slab.h>
32+
#include <linux/ctype.h>
33+
#include <scsi/libsas.h>
34+
35+
#define ASD_DRIVER_NAME "aic94xx"
36+
#define ASD_DRIVER_DESCRIPTION "Adaptec aic94xx SAS/SATA driver"
37+
38+
#define asd_printk(fmt, ...) printk(KERN_NOTICE ASD_DRIVER_NAME ": " fmt, ## __VA_ARGS__)
39+
40+
#ifdef ASD_ENTER_EXIT
41+
#define ENTER printk(KERN_NOTICE "%s: ENTER %s\n", ASD_DRIVER_NAME, \
42+
__FUNCTION__)
43+
#define EXIT printk(KERN_NOTICE "%s: --EXIT %s\n", ASD_DRIVER_NAME, \
44+
__FUNCTION__)
45+
#else
46+
#define ENTER
47+
#define EXIT
48+
#endif
49+
50+
#ifdef ASD_DEBUG
51+
#define ASD_DPRINTK asd_printk
52+
#else
53+
#define ASD_DPRINTK(fmt, ...)
54+
#endif
55+
56+
/* 2*ITNL timeout + 1 second */
57+
#define AIC94XX_SCB_TIMEOUT (5*HZ)
58+
59+
extern kmem_cache_t *asd_dma_token_cache;
60+
extern kmem_cache_t *asd_ascb_cache;
61+
extern char sas_addr_str[2*SAS_ADDR_SIZE + 1];
62+
63+
static inline void asd_stringify_sas_addr(char *p, const u8 *sas_addr)
64+
{
65+
int i;
66+
for (i = 0; i < SAS_ADDR_SIZE; i++, p += 2)
67+
snprintf(p, 3, "%02X", sas_addr[i]);
68+
*p = '\0';
69+
}
70+
71+
static inline void asd_destringify_sas_addr(u8 *sas_addr, const char *p)
72+
{
73+
int i;
74+
for (i = 0; i < SAS_ADDR_SIZE; i++) {
75+
u8 h, l;
76+
if (!*p)
77+
break;
78+
h = isdigit(*p) ? *p-'0' : *p-'A'+10;
79+
p++;
80+
l = isdigit(*p) ? *p-'0' : *p-'A'+10;
81+
p++;
82+
sas_addr[i] = (h<<4) | l;
83+
}
84+
}
85+
86+
struct asd_ha_struct;
87+
struct asd_ascb;
88+
89+
int asd_read_ocm(struct asd_ha_struct *asd_ha);
90+
int asd_read_flash(struct asd_ha_struct *asd_ha);
91+
92+
int asd_dev_found(struct domain_device *dev);
93+
void asd_dev_gone(struct domain_device *dev);
94+
95+
void asd_invalidate_edb(struct asd_ascb *ascb, int edb_id);
96+
97+
int asd_execute_task(struct sas_task *, int num, unsigned long gfp_flags);
98+
99+
/* ---------- TMFs ---------- */
100+
int asd_abort_task(struct sas_task *);
101+
int asd_abort_task_set(struct domain_device *, u8 *lun);
102+
int asd_clear_aca(struct domain_device *, u8 *lun);
103+
int asd_clear_task_set(struct domain_device *, u8 *lun);
104+
int asd_lu_reset(struct domain_device *, u8 *lun);
105+
int asd_query_task(struct sas_task *);
106+
107+
/* ---------- Adapter and Port management ---------- */
108+
int asd_clear_nexus_port(struct asd_sas_port *port);
109+
int asd_clear_nexus_ha(struct sas_ha_struct *sas_ha);
110+
111+
/* ---------- Phy Management ---------- */
112+
int asd_control_phy(struct asd_sas_phy *phy, enum phy_func func);
113+
114+
#endif

0 commit comments

Comments
 (0)