From: Alexis Bruemmer <alexisb@us.ibm.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH 2/8] aic94xx: remove the sas_common.c file
Date: Tue, 09 May 2006 14:25:07 -0700 [thread overview]
Message-ID: <1147209907.11847.44.camel@localhost.localdomain> (raw)
In-Reply-To: <1147209211.11847.33.camel@localhost.localdomain>
Remove the sas_common.c file which only included redundant code
Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
Signed-off-by: Mike Anderson <andmike@us.ibm.com>
---
drivers/scsi/sas/sas_common.c | 115 ------------------------------------------
drivers/scsi/sas/Makefile | 1
drivers/scsi/sas/sas_init.c | 25 +++++++++
3 files changed, 25 insertions(+), 116 deletions(-)
Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_common.c
===================================================================
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_common.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Serial Attached SCSI (SAS) class common functions
- *
- * Copyright (C) 2005 Adaptec, Inc. All rights reserved.
- * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
- *
- * This file is licensed under GPLv2.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
- *
- * $Id: //depot/sas-class/sas_common.c#9 $
- */
-
-#include <scsi/sas/sas_class.h>
-#include "sas_internal.h"
-
-int sas_show_class(enum sas_class class, char *buf)
-{
- static const char *class_str[] = {
- [SAS] = "SAS",
- [EXPANDER] = "EXPANDER",
- };
- return sprintf(buf, "%s\n", class_str[class]);
-}
-
-int sas_show_proto(enum sas_proto proto, char *page)
-{
- static const char *proto_str[] = {
- [SATA_PROTO] = "SATA",
- [SAS_PROTO_SMP] = "SMP",
- [SAS_PROTO_STP] = "STP",
- [SAS_PROTO_SSP] = "SSP",
- };
- int v;
- char *buf = page;
-
- for (v = 1; proto != 0 && v <= SAS_PROTO_SSP; v <<= 1) {
- if (v & proto) {
- buf += sprintf(buf, "%s", proto_str[v]);
-
- if (proto & ~((v<<1)-1))
- buf += sprintf(buf, "|");
- else
- buf += sprintf(buf, "\n");
- }
- }
- return buf-page;
-}
-
-int sas_show_linkrate(enum sas_phy_linkrate linkrate, char *page)
-{
- static const char *phy_linkrate_str[] = {
- [PHY_LINKRATE_NONE] = "",
- [PHY_DISABLED] = "disabled",
- [PHY_RESET_PROBLEM] = "phy reset problem",
- [PHY_SPINUP_HOLD] = "phy spinup hold",
- [PHY_PORT_SELECTOR] = "phy port selector",
- [PHY_LINKRATE_1_5] = "1,5 GB/s",
- [PHY_LINKRATE_3] = "3,0 GB/s",
- [PHY_LINKRATE_6] = "6,0 GB/s",
- };
- return sprintf(page, "%s\n", phy_linkrate_str[linkrate]);
-}
-
-int sas_show_oob_mode(enum sas_oob_mode oob_mode, char *buf)
-{
- switch (oob_mode) {
- case OOB_NOT_CONNECTED:
- return sprintf(buf, "%s", "");
- break;
- case SATA_OOB_MODE:
- return sprintf(buf, "%s\n", "SATA");
- break;
- case SAS_OOB_MODE:
- return sprintf(buf, "%s\n", "SAS");
- break;
- }
- return 0;
-}
-
-void sas_hash_addr(u8 *hashed, const u8 *sas_addr)
-{
- const u32 poly = 0x00DB2777;
- u32 r = 0;
- int i;
-
- for (i = 0; i < 8; i++) {
- int b;
- for (b = 7; b >= 0; b--) {
- r <<= 1;
- if ((1 << b) & sas_addr[i]) {
- if (!(r & 0x01000000))
- r ^= poly;
- } else if (r & 0x01000000)
- r ^= poly;
- }
- }
-
- hashed[0] = (r >> 16) & 0xFF;
- hashed[1] = (r >> 8) & 0xFF ;
- hashed[2] = r & 0xFF;
-}
Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/Makefile
===================================================================
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/Makefile
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/Makefile
@@ -32,7 +32,6 @@ clean-files += expander_conf
obj-$(CONFIG_SCSI_SAS_DOMAIN_ATTRS) += scsi_transport_sas_domain.o
scsi_transport_sas_domain-y += sas_init.o \
- sas_common.o \
sas_phy.o \
sas_port.o \
sas_event.o \
Index: aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_init.c
===================================================================
--- aic94xx-sas-2.6-patched.orig/drivers/scsi/sas/sas_init.c
+++ aic94xx-sas-2.6-patched/drivers/scsi/sas/sas_init.c
@@ -40,6 +40,31 @@
kmem_cache_t *sas_task_cache;
+/*------------ SAS addr hash -----------*/
+void sas_hash_addr(u8 *hashed, const u8 *sas_addr)
+{
+ const u32 poly = 0x00DB2777;
+ u32 r = 0;
+ int i;
+
+ for (i = 0; i < 8; i++) {
+ int b;
+ for (b = 7; b >= 0; b--) {
+ r <<= 1;
+ if ((1 << b) & sas_addr[i]) {
+ if (!(r & 0x01000000))
+ r ^= poly;
+ } else if (r & 0x01000000)
+ r ^= poly;
+ }
+ }
+
+ hashed[0] = (r >> 16) & 0xFF;
+ hashed[1] = (r >> 8) & 0xFF ;
+ hashed[2] = r & 0xFF;
+}
+
+
/* ---------- HA events ---------- */
void sas_hae_reset(void *data)
next prev parent reply other threads:[~2006-05-09 21:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-09 21:13 [PATCH 0/8] aic94xx: sas code clean-up Alexis Bruemmer
2006-05-09 21:20 ` [PATCH 1/8] aic94xx: move sas README Alexis Bruemmer
2006-05-09 21:25 ` Alexis Bruemmer [this message]
2006-05-09 21:27 ` [PATCH 3/8] aic94xx: remove the //depot SCM comments Alexis Bruemmer
2006-05-09 21:31 ` [PATCH 4/8] aic94xx: remove expander_conf.c Alexis Bruemmer
2006-05-10 6:56 ` Luben Tuikov
2006-05-09 21:33 ` [PATCH 5/8] aic94xx: remove inline functions Alexis Bruemmer
2006-05-09 21:37 ` [PATCH 6/8] aic94xx: move list_each_entry_reverse_safe from sas_discover.h to list.h Alexis Bruemmer
2006-05-10 7:01 ` Luben Tuikov
2006-05-10 7:07 ` Luben Tuikov
2006-05-09 21:39 ` [PATCH 7/8] aic94xx: remove queue implementation comment Alexis Bruemmer
2006-05-10 7:09 ` Luben Tuikov
2006-05-09 21:42 ` [PATCH 8/8] aic94xx: use bitops for testing, setting and clearing bits Alexis Bruemmer
2006-05-09 21:53 ` Rolf Eike Beer
2006-05-10 6:53 ` [PATCH 0/8] aic94xx: sas code clean-up Luben Tuikov
2006-05-10 7:21 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1147209907.11847.44.camel@localhost.localdomain \
--to=alexisb@us.ibm.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox