LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Compiling 2.6.23: implicit declaration of function ‘scsi_device_cancel’ (https://www.linuxquestions.org/questions/debian-26/compiling-2-6-23-implicit-declaration-of-function-%91scsi_device_cancel%92-605626/)

fof3 12-09-2007 01:18 PM

Compiling 2.6.23: implicit declaration of function ‘scsi_device_cancel’
 
This is the end message that I get after 'make modules'

drivers/scsi/rr174x/os_linux.c: In function ‘os_sd_changed’:
drivers/scsi/rr174x/os_linux.c:315: error: implicit declaration of function ‘scsi_device_cancel’
make[3]: *** [drivers/scsi/rr174x/os_linux.o] Error 1
make[2]: *** [drivers/scsi/rr174x] Error 2
make[1]: *** [drivers/scsi] Error 2
make: *** [drivers] Error 2

and this is an excerpt from my config file

edhe@hebrews:~$ less /usr/local/linux-2.6.23/.config | grep DRIVER
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_WAN_ROUTER_DRIVERS=m
CONFIG_ATM_DRIVERS=y
CONFIG_RAW_DRIVER=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
CONFIG_V4L_USB_DRIVERS=y
CONFIG_DVB_CAPTURE_DRIVERS=y

edhe@hebrews:~$ less /usr/local/linux-2.6.23/.config | grep SCSI
CONFIG_CISS_SCSI_TAPE=y
# CONFIG_BLK_DEV_IDESCSI is not set
# SCSI device support
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_SCSI_TGT=m
CONFIG_SCSI_NETLINK=y
CONFIG_SCSI_PROC_FS=y
# SCSI support type (disk, tape, CD-ROM)
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
# CONFIG_SCSI_SCAN_ASYNC is not set
CONFIG_SCSI_WAIT_SCAN=m
# SCSI Transports
CONFIG_SCSI_SPI_ATTRS=m
CONFIG_SCSI_FC_ATTRS=m
CONFIG_SCSI_ISCSI_ATTRS=m
CONFIG_SCSI_SAS_ATTRS=m
# CONFIG_SCSI_SAS_LIBSAS is not set
CONFIG_SCSI_LOWLEVEL=y
CONFIG_SCSI_RR174X=m
# CONFIG_ISCSI_TCP is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_DMX3191D is not set
CONFIG_SCSI_EATA=m
# CONFIG_SCSI_EATA_TAGGED_QUEUE is not set
# CONFIG_SCSI_EATA_LINKED_COMMANDS is not set
CONFIG_SCSI_EATA_MAX_TAGS=16
# CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set
# CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INITIO is not set
# CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_IMM is not set
# CONFIG_SCSI_STEX is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_QLOGIC_1280 is not set
# CONFIG_SCSI_QLA_FC is not set
# CONFIG_SCSI_QLA_ISCSI is not set
# CONFIG_SCSI_LPFC is not set
# CONFIG_SCSI_DC395x is not set
CONFIG_SCSI_DC390T=m
# CONFIG_SCSI_DEBUG is not set
# CONFIG_SCSI_SRP is not set
CONFIG_I2O_SCSI=m
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'

HappyTux 12-09-2007 02:41 PM

If you do not need the RR174X module then set it to =n in your config and the error will go away plus why are you doing the compilation without the make-kpkg program it is an easy way to get a .deb file that you can install with dpkg -i linux-image-??????.deb.

fof3 12-09-2007 05:26 PM

I will look into the make-kpkg. Thank You. I however do need the RR174X module - this being the reason why I am working with the 2.6.23 kernel. My present kernel, 2.6.18, doesn't recognize the High Point RocketRaid Controller.

HappyTux 12-09-2007 06:34 PM

That sucks then its always the one you need that does not compile. BTW where are you getting that option for it from have you patched your kernel?? Because looking at my .config for a 64bit kernel it does not appear anywhere in it but looking at the section in menuconfig I see the CONFIG_SCSI_HPTIOP is for the Rocket Raid 3xxx series perhaps it may be worth looking at if you have similar. Other than this I would suggest email the author of the module his/her email should be in the comments of the module source file.

# CONFIG_SCSI_ISCSI_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
CONFIG_SCSI_LOWLEVEL=y
# CONFIG_ISCSI_TCP is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
# CONFIG_SCSI_3W_9XXX is not set
# CONFIG_SCSI_ACARD is not set
# CONFIG_SCSI_AACRAID is not set
# CONFIG_SCSI_AIC7XXX is not set
# CONFIG_SCSI_AIC7XXX_OLD is not set
# CONFIG_SCSI_AIC79XX is not set
# CONFIG_SCSI_AIC94XX is not set
# CONFIG_SCSI_ARCMSR is not set
# CONFIG_MEGARAID_NEWGEN is not set
# CONFIG_MEGARAID_LEGACY is not set
# CONFIG_MEGARAID_SAS is not set
# CONFIG_SCSI_HPTIOP is not set
# CONFIG_SCSI_BUSLOGIC is not set
# CONFIG_SCSI_DMX3191D is not set

Edit: The proper name for the make-kpkg program for installation if you want it is the kernel-package package.

osor 12-10-2007 02:16 PM

Quote:

Originally Posted by fof3 (Post 2985337)
I will look into the make-kpkg. Thank You. I however do need the RR174X module - this being the reason why I am working with the 2.6.23 kernel. My present kernel, 2.6.18, doesn't recognize the High Point RocketRaid Controller.

You’re not making any sense. No vanilla kernel has support for rr174x. In order to get that particular module, you have to download sources from here. With those patches, you can chose either to patch your kernel source, or compile an out-of-tree module. Regardless, there is nothing in the instructions about the using kernel 2.6.23 or greater.

Anyway, it seems you must use a kernel with a version less than 2.6.23 (unless you want to do more patching). The mentioned function has been removed from 2.6.22 to 2.6.23.

Solution:
  1. Use the patch on a kernel with version 2.6.22 or less.
  2. If you still want to use the 2.6.23, apply this patch in reverse to the kernel sources. Here is a copy-pastable (and forward) version:
    Code:

    diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
    index 64c8595..4c1e313 100644
    --- a/drivers/scsi/scsi.c
    +++ b/drivers/scsi/scsi.c
    @@ -1016,6 +1016,52 @@ struct scsi_device *scsi_device_lookup(struct Scsi_Host *shost,
     }
     EXPORT_SYMBOL(scsi_device_lookup);
     
    +/**
    + * scsi_device_cancel - cancel outstanding IO to this device
    + * @sdev:        Pointer to struct scsi_device
    + * @recovery:        Boolean instructing function to recover device or not.
    + *
    + **/
    +int scsi_device_cancel(struct scsi_device *sdev, int recovery)
    +{
    +        struct scsi_cmnd *scmd;
    +        LIST_HEAD(active_list);
    +        struct list_head *lh, *lh_sf;
    +        unsigned long flags;
    +
    +        scsi_device_set_state(sdev, SDEV_CANCEL);
    +
    +        spin_lock_irqsave(&sdev->list_lock, flags);
    +        list_for_each_entry(scmd, &sdev->cmd_list, list) {
    +                if (scmd->request) {
    +                        /*
    +                        * If we are unable to remove the timer, it means
    +                        * that the command has already timed out or
    +                        * finished.
    +                        */
    +                        if (!scsi_delete_timer(scmd))
    +                                continue;
    +                        list_add_tail(&scmd->eh_entry, &active_list);
    +                }
    +        }
    +        spin_unlock_irqrestore(&sdev->list_lock, flags);
    +
    +        if (!list_empty(&active_list)) {
    +                list_for_each_safe(lh, lh_sf, &active_list) {
    +                        scmd = list_entry(lh, struct scsi_cmnd, eh_entry);
    +                        list_del_init(lh);
    +                        if (recovery &&
    +                            !scsi_eh_scmd_add(scmd, SCSI_EH_CANCEL_CMD)) {
    +                                scmd->result = (DID_ABORT << 16);
    +                                scsi_finish_command(scmd);
    +                        }
    +                }
    +        }
    +
    +        return 0;
    +}
    +EXPORT_SYMBOL(scsi_device_cancel);
    +
     MODULE_DESCRIPTION("SCSI core");
     MODULE_LICENSE("GPL");
     
    diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
    index d5057bc..6fe1cf6 100644
    --- a/include/scsi/scsi_device.h
    +++ b/include/scsi/scsi_device.h
    @@ -209,6 +209,7 @@ extern struct scsi_device *__scsi_add_device(struct Scsi_Host *,
     extern int scsi_add_device(struct Scsi_Host *host, uint channel,
                                uint target, uint lun);
     extern void scsi_remove_device(struct scsi_device *);
    +extern int scsi_device_cancel(struct scsi_device *, int);
     
     extern int scsi_device_get(struct scsi_device *);
     extern void scsi_device_put(struct scsi_device *);

    Note that this is only a quick-fix and won’t necessarily work with newer kernels. The appropriate fix would be from the vendor.


All times are GMT -5. The time now is 03:37 PM.