LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-20-2006, 11:37 AM   #1
joshuas
LQ Newbie
 
Registered: May 2006
Posts: 2

Rep: Reputation: 0
RocketRaid 133 hpt372 driver compile errors on FC4


Hello,

I've bought a RocketRaid 133 card from Highpoint.
On the pc there is Fedora Core 4 as OS with kernel 2.6.16-1.2108_FC4.
While booting it gets a kernel panic. I downloaded the Opensource driver v2.0 but I cant compile it on the machine.
The kernel-devel package is installed (in /usr/src/kernels/2.6.16-1.2108_FC4/) I made a symbolic link to it with
'ln -s /usr/src/kernels/2.6.16-1.2108_FC4 /usr/src/linux'.
The the driver is unpacked in the tmp dir. Going there and do the make results in a lot of errors.
'make KERNELDIR=/usr/src/linux'
Results in:
cp -f raid.o raid.obj
make -C /usr/src/linux SUBDIRS=`pwd` modules
make[1]: Entering directory `/usr/src/linux'
CC [M] /tmp/hpt.o
/tmp/hpt.c:45:18: error: scsi.h: No such file or directory
/tmp/hpt.c:49:19: error: hosts.h: No such file or directory
/tmp/hpt.c:61: warning: âstruct Scsi_Hostâ declared inside parameter list
/tmp/hpt.c:61: warning: its scope is only this definition or declaration, which is probably not what you want
/tmp/hpt.c: In function âget_bdevâ:
/tmp/hpt.c:63: error: âSCSI_DISK0_MAJORâ undeclared (first use in this function)
/tmp/hpt.c:63: error: (Each undeclared identifier is reported only once
/tmp/hpt.c:63: error: for each function it appears in.)
/tmp/hpt.c:63: error: âSCSI_DISK1_MAJORâ undeclared (first use in this function
........
........
.......
......
/tmp/idevice.c: In function âfDeScanDeviceâ:
/tmp/idevice.c:128: error: âFALSEâ undeclared (first use in this function)
/tmp/idevice.c:128: warning: comparison between pointer and integer
make[2]: *** [/tmp/hpt.o] Error 1
make[1]: *** [_module_/tmp/hpt37x] Error 2
make[1]: Leaving directory `/usr/src/linux'
make: *** [default] Error 2

I don’t know what to do now, I tried several options but no results.

Can someone help me please?

Joshua
 
Old 05-21-2006, 05:16 AM   #2
joshuas
LQ Newbie
 
Registered: May 2006
Posts: 2

Original Poster
Rep: Reputation: 0
I found the solution. I patched some files and its working now.
Download hpt3xx-opensource-v2.0.tgz from Highpoint,and apply this patch:

diff -r -N hpt3xx-opensource-v2.0/array.h hpt3xx_patched/array.h
239c239
-#if SUPPORT_RAID5
---
+#ifdef SUPPORT_RAID5
diff -r -N hpt3xx-opensource-v2.0/entry.c hpt3xx_patched/entry.c
10c10
-#if DBG
---
+#ifdef DBG
38c38
-#if CONFIG_SMP && defined(SUPPORT_ARRAY) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
---
+#if defined(CONFIG_SMP) && defined(SUPPORT_ARRAY) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
533c533,535
- scsi_set_pci_device(hpt_vhost, pPciDev);
---
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
+scsi_set_pci_device(hpt_vhost, pPciDev);
+#endif
564,567c566,574
- scsi_set_pci_device(hpt_vhost, pPciDev);
-#endif
- i++;
- }
---
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
+ scsi_set_pci_device(hpt_vhost, pPciDev);
+ #endif
+#endif
+ i++;
+ }
+
+
596c603,606
- scsi_set_pci_device(hpt_vhost, pPciDev);
---
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
+scsi_set_pci_device(hpt_vhost, pPciDev);
+#endif
+
737,739c747,749
- hpt_printk(("Abort called pid:%ld target: %x lun: %x flags: %x"
- " reason %x\n", SCpnt->pid, sc_target(SCpnt), sc_lun(SCpnt),
- sc_flags(SCpnt), SCpnt->abort_reason));
---
+ hpt_printk(("Abort called pid:%ld target: %x lun: %x flags: %x",
+ SCpnt->pid, sc_target(SCpnt), sc_lun(SCpnt),
+ sc_flags(SCpnt)));
903,904c913,914
- sgList, SCpnt->use_sg, scsi_to_pci_dma_dir(SCpnt->sc_data_direction));
- for (idx = 0; idx < sgcnt; idx++) {
---
+ sgList, SCpnt->use_sg, SCpnt->sc_data_direction);
+ for (idx = 0; idx < sgcnt; idx++) {
diff -r -N hpt3xx-opensource-v2.0/gui_lib.c hpt3xx_patched/gui_lib.c
149a150
+ pInfo->u.array.Flags =0x0;
270,271d270
-#ifdef ARRAY_V2_ONLY
- PVDevice pvdev1;
273,285d271
- if ((pVDevice->VDeviceType == VD_RAID_1)&&(pVDevice->vf_format_v2) && (pInfo->u.array.nDisk == 2)) {
- for(pvdev1 = pVDevStart; pvdev1 < pVDevEnd; pvdev1++) {
- if ((pvdev1->VDeviceType==VD_SPARE)
- &&(pvdev1->vf_format_v2 == 1)
- &&(pvdev1->u.disk.pChannel->pChipInstance==pVDevice->u.array.pMember[0]->u.disk.pChannel->pChipInstance)
- &&(pvdev1->u.disk.df_on_line == 1)) {
-
- pInfo->u.array.Members[pInfo->u.array.nDisk] = VDEV_TO_ID(pvdev1);
- pInfo->u.array.nDisk++;
- }
- }
- }
-#endif
404c390
-#if SUPPORT_RAID5
---
+#ifdef SUPPORT_RAID5
630,647d615
-/*
- if ((pVDev->VDeviceType==VD_RAID_0) && (pArray->VDeviceType==VD_RAID_1))
- {
- pArray->u.array.bArnMember = pParam->nDisk;
- pArray->u.array.bArRealnMember = pParam->nDisk;
- pArray->u.array.bArBlockSizeShift = pVDev->u.array.bArBlockSizeShift;
- pArray->u.array.bStripeWitch = (1 << pVDev->u.array.bArBlockSizeShift);
- pArray->u.array.dArStamp = Stamp;
- for (i=0;i<pParam->nDisk ;i++ )
- (ID_TO_VDEV(pParam->Members[i]))->u.array.dArStamp = Stamp;
- pArray->u.array.rf_need_sync = 1;
- pArray->u.array.rf_newly_created = 1;
- pArray->u.array.RebuildSectors = pArray->u.array.rf_need_rebuild? 0 : MAX_LBA_T;
- memcpy(pArray->u.array.ArrayName, pParam->ArrayName, MAX_ARRAY_NAME);
-
- }
- else {
-*/
657a626,630
+
+
+
+
+
782,784c755
-#ifdef ARRAY_V2_ONLY
- pArray->vf_format_v2 = 1;
-#endif
---
+
787a759,760
+
+
diff -r -N hpt3xx-opensource-v2.0/hpt.c hpt3xx_patched/hpt.c
45,48c45,55
-#include "scsi.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#include "sd.h"
-#endif
---
+#include <linux/stat.h>
+#include <linux/types.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/genhd.h>
+#include <linux/fs.h>
+#include <linux/highmem.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_cmnd.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4)
49a57,60
+#else
+#include <scsi/scsi_host.h>
+#endif
+
60a72,82
+typedef struct scsi_cmnd Scsi_Cmnd;
+typedef struct scsi_device Scsi_Device;
+typedef struct scsi_host_template Scsi_Host_Template;
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+#define scsi_to_pci_dma_dir(x) (x)
+
116,117c138,141
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#define scsi_set_pci_device(pshost, pcidev) scsi_set_device(pshost, &pcidev->dev)
---
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+#define scsi_set_pci_device(pshost, pcidev) do { ;} while (0)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#define scsi_set_pci_device(pshost, pcidev) scsi_set_device(pshost, &pcidev->dev)
119c143
-#define scsi_set_pci_device(pshost, pcidev) do { ;} while (0)
---
+#define scsi_set_pci_device(pshost, pcidev) do { ;} while (0)
diff -r -N hpt3xx-opensource-v2.0/hptproc.c hpt3xx_patched/hptproc.c
182c182
-#if DBG
---
+#ifdef DBG
230c230
- if (verify_area(VERIFY_READ, (void *)(ULONG_PTR)piop->lpInBuffer, piop->nInBufferSize)) {
---
+ if (!access_ok(VERIFY_READ, (void *)(ULONG_PTR)piop->lpInBuffer, piop->nInBufferSize)) {
236c236
- if (verify_area(VERIFY_WRITE, (void *)(ULONG_PTR)piop->lpOutBuffer, piop->nOutBufferSize)) {
---
+ if (!access_ok(VERIFY_WRITE, (void *)(ULONG_PTR)piop->lpOutBuffer, piop->nOutBufferSize)) {
242c242
- if (verify_area(VERIFY_WRITE, (void *)(ULONG_PTR)piop->lpBytesReturned, sizeof(DWORD))) {
---
+ if (!access_ok(VERIFY_WRITE, (void *)(ULONG_PTR)piop->lpBytesReturned, sizeof(DWORD))) {
260c260,270
- copy_from_user(ke_area, (void *)(ULONG_PTR)piop->lpInBuffer, piop->nInBufferSize);
---
+
+ if (copy_from_user(ke_area, (void *)(ULONG_PTR)piop->lpInBuffer, piop->nInBufferSize)) {
+
+ kfree(ke_area);
+
+ KdPrintE(("copy_from_user error\n"));
+
+ return -EINVAL;
+
+ }
+
268c278,280
- copy_to_user((void *)(ULONG_PTR)piop->lpOutBuffer,
---
+
+ if (copy_to_user((void *)(ULONG_PTR)piop->lpOutBuffer,
+
270c282,292
- piop->nOutBufferSize);
---
+
+ piop->nOutBufferSize)) {
+
+ kfree(ke_area);
+
+ KdPrintE(("copy_to_user 1 error\n"));
+
+ return -EINVAL;
+
+ }
+
272c294,304
- copy_to_user((void *)(ULONG_PTR)piop->lpBytesReturned, &dwRet, sizeof(DWORD));
---
+
+ if (copy_to_user((void*)(ULONG_PTR)piop->lpBytesReturned, &dwRet, sizeof(DWORD))) {
+
+ kfree(ke_area);
+
+ KdPrintE(("copy_to_user 2 error\n"));
+
+ return -EINVAL;
+
+ }
+
352a385
+ UINT chan = 0;
376,377c409,413
-
-
---
+
+ chan++;
+
+ chan &= ~4;
+
diff -r -N hpt3xx-opensource-v2.0/osheader.h hpt3xx_patched/osheader.h
111c111
-#if DBG
---
+#ifdef DBG
diff -r -N hpt3xx-opensource-v2.0/scsi_module.c hpt3xx_patched/scsi_module.c
0a1,65
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+#include <scsi/scsi_host.h>
+
+
+static int __init init_this_scsi_driver(void)
+{
+struct scsi_host_template *sht = &driver_template;
+struct Scsi_Host *shost;
+struct list_head *l;
+int error;
+
+if (!sht->release) {
+printk(KERN_ERR
+"scsi HBA driver %s didn't set a release method.\n",
+sht->name);
+return -EINVAL;
+}
+
+sht->module = THIS_MODULE;
+INIT_LIST_HEAD(&sht->legacy_hosts);
+
+sht->detect(sht);
+if (list_empty(&sht->legacy_hosts))
+return -ENODEV;
+
+list_for_each_entry(shost, &sht->legacy_hosts, sht_legacy_list) {
+error = scsi_add_host(shost, NULL);
+if (error)
+goto fail;
+scsi_scan_host(shost);
+}
+return 0;
+fail:
+l = &shost->sht_legacy_list;
+while ((l = l->prev) != &sht->legacy_hosts)
+scsi_remove_host(list_entry(l, struct Scsi_Host, sht_legacy_list));
+return error;
+}
+
+static void __exit exit_this_scsi_driver(void)
+{
+struct scsi_host_template *sht = &driver_template;
+struct Scsi_Host *shost, *s;
+
+list_for_each_entry(shost, &sht->legacy_hosts, sht_legacy_list)
+scsi_remove_host(shost);
+list_for_each_entry_safe(shost, s, &sht->legacy_hosts, sht_legacy_list)
+sht->release(shost);
+
+if (list_empty(&sht->legacy_hosts))
+return;
+
+printk(KERN_WARNING "%s did not call scsi_unregister\n", sht->name);
+dump_stack();
+
+list_for_each_entry_safe(shost, s, &sht->legacy_hosts, sht_legacy_list)
+scsi_unregister(shost);
+}
+
+module_init(init_this_scsi_driver);
+module_exit(exit_this_scsi_driver);
+

Last edited by joshuas; 05-23-2006 at 03:35 AM.
 
Old 06-17-2006, 08:46 AM   #3
Woatstobbler
LQ Newbie
 
Registered: Jun 2006
Distribution: SuSE
Posts: 1

Rep: Reputation: 0
OK, looks good. But how do you apply the patch? I've C&Ped the above into a txt file (Patch-2.6.16), but patch ain't having none of it. Viz...

andy@BlueBox:/usr/local/src/HPT10.1/hpt3xx-opensource-v2.0> patch -p1 <Patch-2.6.16
patch: **** Only garbage was found in the patch input.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless driver won't compile in FC4 litlmary Fedora 3 02-01-2006 01:55 AM
Highpoint rocketraid 133 with mandrake linux 9.2 plz help havnet slept in 3 days micro_sucks Linux - Hardware 4 06-05-2004 10:37 PM
errors when trying to compile hsf driver cornfed Linux - Software 2 05-02-2004 10:31 AM
Slackware 9.0 and Highpoint RocketRaid 133 MadRabbit Slackware 25 07-23-2003 09:00 PM
Nvidia driver compile errors acidream Linux - General 8 02-19-2003 09:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration