linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [linux-scsi-owner@vger.kernel.org: BOUNCElinux-scsi@vger.kernel.org:
@ 2007-10-30 11:36 jameshsu
  2007-10-30 15:19 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: jameshsu @ 2007-10-30 11:36 UTC (permalink / raw)
  To: linux-scsi; +Cc: James Bottomley

[-- Attachment #1: Type: text/plain, Size: 1861 bytes --]

Hello James Bottomley,

This driver has nothing changed since last time submit.
However recently we check the 2.6.23.1 kernel and found code is not
up-to-date (still remain @2005).
Resend this message to submit the same driver again. (.c diff file under
atp870u.c.diff.bz2 format)
Please help Acard to build in this modified SCSI driver with latest Linux
kernel.
If any code still volient the documentation, please let us know the reasons
and file path.
Thanks!

James Hsu
----- Original Message -----
From: jameshsu
To: postmaster@vger.kernel.org
Cc: 'David Miller' ; James Bottomley
Sent: Thursday, March 29, 2007 3:36 PM
Subject: Re: FW: [linux-scsi-owner@vger.kernel.org:
BOUNCElinux-scsi@vger.kernel.org: - - Completed


To whom can take care of this driver issues:

We, Acard, modified this driver again based on James Bottomley's input
3/16/2007.
In the mean time, I attach the source code with another email for James
Bottomley.

Those changes are:
1.Modify coding style.
 2.Add old copy right.
 3.CompString, ClearString, CopyString routine replaced with memcmp, memset
and memcpy.
 4.Remove adapters array form 2.6 kernel.
 5.Removed the scsi_data_direction() hack macro.Just pass the direction
directly into the functions
 6.Use defined values instead of bare numbers (REQUEST_SENSE instead of
0x03)
 7.Replace page_address() to get arbitrary userspace memory with
kmap_atomic()/kunmap_atomic().
 8.Use SAM_STAT_CHECK_CONDITION/GOOD instead of separate #define
 9.Removed home defined READ_6, WRITE_6 etc.
10.Return SCSI_MLQUEUE_HOST_BUSY on out of resources in queuecommand.

Please let me know if this submission is proper.
Again, relly appreciate for your help!

James Hsu,
Manager,QA Testing Dept.
ACARD TECHNOLOGY CORP.
Taipei Hsien,Taiwan
6F No78,Sec 1,Kwang Fu Road,Sang Chung,
(02)8512-2290 x 2311(O),(02)8512-2548(FAX)
0968-989-555 (mobile)

[-- Attachment #2: atp870u.c.diff.bz2 --]
[-- Type: application/octet-stream, Size: 26022 bytes --]

[-- Attachment #3: atp870u.h.diff --]
[-- Type: application/octet-stream, Size: 10599 bytes --]

--- ./atp870u.h	2007-03-27 09:47:24.000000000 +0800
+++ ./old/atp870u.h	2007-03-16 11:06:10.000000000 +0800
@@ -1,228 +1,67 @@
-#include <linux/types.h>
-#include <linux/kdev_t.h>
-#include <linux/version.h>
-#ifndef NULL
-#define NULL 0
-#endif
-
-#define ATP885_DEVID		0x808A
-#define ATP880_DEVID1		0x8080
-#define ATP880_DEVID2		0x8081
-#define DRIVER_NAME		"atp870u"
-#define ADAPTER_NAME		"atp870u"
-
-#define ADAPTER_INFORMATION	"ACARD AEC-671x/6716x PCI Ultra/W/LVD SCSI-3 Adapter Driver"
-#define PROC_INFORMATION	"ACARD AEC-671x/6716x Driver"
-
-#define PROC_NAME		"atp870u"	// folder name in /proc/scsi/
-#define DRV_VERSION_MAJOR	3
-#define DRV_VERSION_MINOR	0
-#define DRV_VERSION_BUILD	5
-#define MAX_QUEUE		32
-#define MAX_SCATTER		17
-#define MAX_CMDLUN		1
-#define MAX_XFER_SECTORS		128
-#define MAX_SCSI_CHANNEL		2
-#define	MAX_CHAIN_LEVEL		1
-#define BIOS_SUPPORT		0xFF
-#define TIMER_SCALE		(HZ/10)	// 100mS
-#define SCSI_DRV_TEMPLATE 					\
-{								\
-	.module			= THIS_MODULE,			\
-	.name			= ADAPTER_NAME		,	\
-	.proc_name		= PROC_NAME,			\
-	.proc_info		= adapter_proc_info,		\
-	.info			= adapter_info,			\
-	.bios_param		= adapter_biosparam,		\
-	.queuecommand		= adapter_queuecommand,		\
-	.eh_abort_handler		= NULL,				\
-	.eh_host_reset_handler	= adapter_reset,			\
-	.can_queue		= MAX_QUEUE,			\
-	.this_id			= 64,				\
-	.sg_tablesize		= MAX_SCATTER,			\
-	.cmd_per_lun		= MAX_CMDLUN,			\
-	.use_clustering		= ENABLE_CLUSTERING,		\
-	.max_sectors		= MAX_XFER_SECTORS		\
-}
-#define PCI_DEVICE_ID_TABLE 		\
-{					\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP885_DEVID)			},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP880_DEVID1)			},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP880_DEVID2)			},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7610)	},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612UW)	},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612U)	},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612S)	},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612D)	},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_AEC7612SUW)	},\
-	{ PCI_DEVICE(PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_8060)	},\
-}
-// above define is necessary,it can only chagne the value but name
-//=============================================================================
-#define MEM_4KB			(0x001000)
-#define MEM_8KB			(0x002000)
-#define MEM_16KB			(0x004000)
-#define MEM_32KB			(0x008000)
-#define MEM_64KB			(0x010000)
-#define MEM_128KB		(0x020000)
-#define MEM_256KB		(0x040000)
-#define MEM_512KB		(0x080000)
-#define MEM_1MB			(0x100000)
-#define MEM_2MB			(0x200000)
-//=============================================================================
-#define MEM_8KB_ORDER           1
-#define MEM_16KB_ORDER          2
-#define MEM_32KB_ORDER          3
-#define MEM_64KB_ORDER          4
-#define MEM_128KB_ORDER         5
-#define MEM_256KB_ORDER         6
-#define MEM_512KB_ORDER         7
-#define MEM_1MB_ORDER           8
-#define MEM_2MB_ORDER           9
-//==============================================================================
-#define EXTENSION_MEM		MEM_32KB_ORDER	//   8KB
-#define EXTENSION_MEM_LEN	MEM_32KB
-//==============================================================================
-#define STATUS_RESET		(DID_RESET << 16)
-#define STATUS_BUSY		(DID_BUS_BUSY << 16)
-#define STATUS_NO_DEVICE		(DID_BAD_TARGET << 16)
-#define STATUS_PENDING		0xFFF1
-//;===========================================================================
-typedef struct _MailBox {
-	unsigned int Address;
-	unsigned int ByteCount;
-} T_MailBox, *P_MailBox;
-//========================================================================
-typedef struct _WorkingTable {
-	T_MailBox MailBox[33];
-	void *pNextTable;
-	void *pPrevTable;
-	void *pScsiDevice;
-	P_MailBox pMailBox;
-	unsigned int LmailBox;
-	unsigned int IoTagID;
-	unsigned int RemainLen;
-	unsigned int TransferLen;
-	unsigned int CompleteLen;
-	unsigned int sg_num;
-	unsigned char *pDataBuffer;
-	struct scsi_cmnd *pWorkingScsiCmd;
-	dma_addr_t pDmaSingleMapAddr;
-	unsigned char PriorityLevel;
-	unsigned char FG_TableActive:1;
-	unsigned char FG_DmaToDevice:1;
-	unsigned char FG_Reserved:6;
-	unsigned char ResetCounter;
-	unsigned char Reserved0;
-	unsigned char Reserved1;
-	unsigned char Reserved2;
-} T_WorkingTable, *P_WorkingTable;	// this size should be equal to 4n bytes
-//========================================================================
-typedef struct _ScsiChannel {
-	P_WorkingTable pIoChain[MAX_CHAIN_LEVEL];
-	P_WorkingTable pCurRequest;
-	P_WorkingTable pTarRequest[16];
-	unsigned int ScsiIoPort;
-	unsigned int DmaIoPort;
-	unsigned int FifoPort;
-	unsigned int ChannelOrder;
-	unsigned int QueueCount;
-	unsigned char HostId;
-	unsigned char FG_LvdMode:1;
-	unsigned char FG_LowWide:1;
-	unsigned char FG_DisconnectSupport:1;
-	unsigned char FG_ChannelActive:1;
-	unsigned char FG_CheckCrc:1;
-	unsigned char FG_Cdb16Supported:1;
-	unsigned char FG_Reserved0:2;
-	unsigned char TimeOutInterval;
-	unsigned char FifoOrMask;
-	unsigned char FifoAndMask;
-	unsigned char Reg0F;
-	unsigned char Reg17;
-	unsigned char Reg10;
-	unsigned char Reg1F;
-	unsigned char Reserved0;
-	unsigned char Reserved1;
-	unsigned char Reserved2;
-} T_ScsiChannel, *P_ScsiChannel;
-//========================================================================
-typedef struct _ScsiDevice {
-	unsigned char FG_Install:1;
-	unsigned char FG_ScsiWide:1;
-	unsigned char FG_Removeable:1;
-	unsigned char FG_InternalError:1;
-	unsigned char FG_Reserved:4;
-	unsigned char ScsiSpeed;
-	unsigned char DeviceId;
-	unsigned char DeviceType;
-	unsigned char MaxScsiSpeed;
-	unsigned char SenseKey;
-	unsigned char SenseAsc;
-	unsigned char SenseAscQ;
-//      unsigned int            Capacity;
-	P_ScsiChannel pScsiChannel;
-	unsigned char Vendor[8];
-	unsigned char Model[16];
-	unsigned char Rev[4];
-} T_ScsiDevice, *P_ScsiDevice;
-//========================================================================
-typedef struct _HW_DEVICE_EXTENSION {
-	unsigned short VendorID;
-	unsigned short DeviceID;
-	unsigned short SubVendorID;
-	unsigned short SubDeviceID;
-	unsigned char ChipRevision;
-	unsigned char IrqNum;
-	unsigned int BaseIoPort;
-	spinlock_t spin_lock;
-	struct Scsi_Host *pScsiHost;
-	struct pci_dev *pPciDev;
-	struct timer_list AdapterTimer;
-	T_ScsiDevice ScsiDevice[MAX_SCSI_CHANNEL * 16];
-	T_ScsiChannel ScsiChannel[MAX_SCSI_CHANNEL];
-	dma_addr_t pPhysicalAddress;
-	unsigned char *pUncacheExtension;
-	unsigned char *pTestBufferR;
-	unsigned char *pTestBufferW;
-	P_WorkingTable pWorkingTablePool;
-	dma_addr_t pWorkingTableLmail;
-	unsigned int IoTagID;
-	unsigned int IoCounter;
-	unsigned char FG_TimerStop;
-	unsigned char Reserved1;
-	unsigned char Reserved2;
-	unsigned char Reserved3;
-} HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
-//========================================================================
-//========================================================================
-//========================================================================
-//========================================================================
-static unsigned char GetMessageIn(P_ScsiChannel pScsiChannel,
-				  unsigned char *message);
-static unsigned char SendMessageOut(P_ScsiChannel pScsiChannel,
-				    unsigned char *message, int len);
-static int ScsiTestUnitReady(P_ScsiDevice pScsiDevice);
-static int ScsiInquiry(P_ScsiDevice pScsiDevice, unsigned char *inquiry_buf);
-static void Ultra3Negotiation(P_ScsiDevice pScsiDevice,
-			      unsigned char *u3msgOut);
-static void WideNegotiation(P_ScsiDevice pScsiDevice,
-			    unsigned char *wide_msgOut);
-static void SyncNegotiation(P_ScsiDevice pScsiDevice,
-			    unsigned char *sync_msgOut);
-static void FindScsiDevice(PHW_DEVICE_EXTENSION DeviceExtension,
-			   P_ScsiDevice pScsiDevice);
-static P_WorkingTable AllocateWorkingTable(PHW_DEVICE_EXTENSION
-					   DeviceExtension);
-//static void ReleaseWorkingTable(P_WorkingTable pWorkingTable);
-static void ReleaseWorkingTable(PHW_DEVICE_EXTENSION DeviceExtension,
-				P_WorkingTable pWorkingTable);
-static int BuildPrdTable(PHW_DEVICE_EXTENSION DeviceExtension,
-			 P_WorkingTable pWorkingTable);
-static void ChannelIoHook(P_WorkingTable pWorkingTable);
-static void SendWorkingTableOut(PHW_DEVICE_EXTENSION DeviceExtension);
-static void SendWorkingTableOutChannel(PHW_DEVICE_EXTENSION DeviceExtension,
-				       P_ScsiChannel pScsiChannel);
-static int ExecuteIoSCSI(P_WorkingTable pWorkingTable);
-static void Debug80Port(unsigned char code, int delaytime);
-//========================================================================
+#ifndef _ATP870U_H
+#define _ATP870U_H
+
+#include <linux/types.h>
+#include <linux/kdev_t.h>
+
+/* I/O Port */
+
+#define MAX_CDB 	12
+#define MAX_SENSE 	14
+#define qcnt	       	32
+#define ATP870U_SCATTER 	128
+#define ATP870U_CMDLUN  	1
+
+#define MAX_ADAPTER	8
+#define MAX_SCSI_ID	16
+#define ATP870U_MAX_SECTORS 128
+
+#define ATP885_DEVID 0x808A
+#define ATP880_DEVID1 0x8080
+#define ATP880_DEVID2 0x8081
+
+//#define ED_DBGP
+
+struct atp_unit
+{
+	unsigned long baseport;
+	unsigned long ioport[2];
+	unsigned long pciport[2];
+	unsigned long irq;
+	unsigned char last_cmd[2];
+	unsigned char in_snd[2];
+	unsigned char in_int[2];
+	unsigned char quhd[2];
+	unsigned char quend[2];
+	unsigned char global_map[2];
+	unsigned char chip_ver;
+	unsigned char scam_on;
+	unsigned char host_id[2];
+	unsigned int working[2];
+	unsigned short wide_id[2];
+	unsigned short active_id[2];
+	unsigned short ultra_map[2];
+	unsigned short async[2];
+	unsigned short dev_id;
+	unsigned char sp[2][16];
+	unsigned char r1f[2][16];		
+	struct scsi_cmnd *quereq[2][qcnt];
+	struct atp_id
+	{
+		unsigned char dirct;
+		unsigned char devsp;
+		unsigned char devtype;
+		unsigned long tran_len;
+		unsigned long last_len;
+		unsigned char *prd_pos;
+		unsigned char *prd_table;	/* Kernel address of PRD table */
+		dma_addr_t prd_bus;		/* Bus address of PRD */
+		dma_addr_t prdaddr;		/* Dynamically updated in driver */
+		struct scsi_cmnd *curr_req;
+	} id[2][16];
+    	struct Scsi_Host *host;
+    	struct pci_dev *pdev;
+	unsigned int unit;
+};
+
+#endif

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-scsi-owner@vger.kernel.org: BOUNCElinux-scsi@vger.kernel.org:
  2007-10-30 11:36 [linux-scsi-owner@vger.kernel.org: BOUNCElinux-scsi@vger.kernel.org: jameshsu
@ 2007-10-30 15:19 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2007-10-30 15:19 UTC (permalink / raw)
  To: jameshsu; +Cc: linux-scsi, James Bottomley

On Tue, Oct 30, 2007 at 07:36:05PM +0800, jameshsu wrote:
> Hello James Bottomley,
> 
> This driver has nothing changed since last time submit.
> However recently we check the 2.6.23.1 kernel and found code is not
> up-to-date (still remain @2005).
> Resend this message to submit the same driver again. (.c diff file under
> atp870u.c.diff.bz2 format)
> Please help Acard to build in this modified SCSI driver with latest Linux
> kernel.
> If any code still volient the documentation, please let us know the reasons
> and file path.
> Thanks!

I tried applying both patches but none of them applies.  atp870u.h.diff reverse-applies
so we're at the state already after your patch, and atp870u.c.diff doesn't apply at all,
partially because the before version you have has dos line endings, while atp870u.c
in the kernel doesn't.

> 
> James Hsu
> ----- Original Message -----
> From: jameshsu
> To: postmaster@vger.kernel.org
> Cc: 'David Miller' ; James Bottomley
> Sent: Thursday, March 29, 2007 3:36 PM
> Subject: Re: FW: [linux-scsi-owner@vger.kernel.org:
> BOUNCElinux-scsi@vger.kernel.org: - - Completed
> 
> 
> To whom can take care of this driver issues:
> 
> We, Acard, modified this driver again based on James Bottomley's input
> 3/16/2007.
> In the mean time, I attach the source code with another email for James
> Bottomley.
> 
> Those changes are:
> 1.Modify coding style.
>  2.Add old copy right.
>  3.CompString, ClearString, CopyString routine replaced with memcmp, memset
> and memcpy.
>  4.Remove adapters array form 2.6 kernel.
>  5.Removed the scsi_data_direction() hack macro.Just pass the direction
> directly into the functions
>  6.Use defined values instead of bare numbers (REQUEST_SENSE instead of
> 0x03)
>  7.Replace page_address() to get arbitrary userspace memory with
> kmap_atomic()/kunmap_atomic().
>  8.Use SAM_STAT_CHECK_CONDITION/GOOD instead of separate #define
>  9.Removed home defined READ_6, WRITE_6 etc.
> 10.Return SCSI_MLQUEUE_HOST_BUSY on out of resources in queuecommand.
> 
> Please let me know if this submission is proper.
> Again, relly appreciate for your help!
> 
> James Hsu,
> Manager,QA Testing Dept.
> ACARD TECHNOLOGY CORP.
> Taipei Hsien,Taiwan
> 6F No78,Sec 1,Kwang Fu Road,Sang Chung,
> (02)8512-2290 x 2311(O),(02)8512-2548(FAX)
> 0968-989-555 (mobile)



---end quoted text---

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-30 15:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-30 11:36 [linux-scsi-owner@vger.kernel.org: BOUNCElinux-scsi@vger.kernel.org: jameshsu
2007-10-30 15:19 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).