diff --git a/qla_isp/linux/isp_cb_ops.c b/qla_isp/linux/isp_cb_ops.c index 19993f87f..641c77a97 100644 --- a/qla_isp/linux/isp_cb_ops.c +++ b/qla_isp/linux/isp_cb_ops.c @@ -350,7 +350,7 @@ static int isp_qlogic_ext_ioctl(struct inode *, struct file *, unsigned int, uns dev_t isp_dev; struct cdev isp_cdev = { - .kobj = { .name = ISP_NAME, } , + .kobj = { .k_name = ISP_NAME, } , .owner = THIS_MODULE }; ISP_CLASS *isp_class; diff --git a/qla_isp/linux/isp_linux.c b/qla_isp/linux/isp_linux.c index 7ab5c62bb..d2fc991d2 100644 --- a/qla_isp/linux/isp_linux.c +++ b/qla_isp/linux/isp_linux.c @@ -544,7 +544,7 @@ isplinux_scsi_probe_done(Scsi_Cmnd *Cmnd) } else { struct scatterlist *sg; sg = (struct scatterlist *) Cmnd->request_buffer; - iqd = page_address(sg->page) + sg->offset; + iqd = page_address(sg_page(sg)) + sg->offset; } sdp->isp_devparam[XS_TGT(Cmnd)].goal_flags &= ~(DPARM_TQING|DPARM_SYNC|DPARM_WIDE); if (iqd[7] & 0x2) { @@ -1826,7 +1826,7 @@ isp_lcl_respond(ispsoftc_t *isp, void *aep, tmd_cmd_t *tmd) xact = &isp->isp_osinfo.auxinfo[i].xact; dp = &isp->isp_osinfo.auxinfo[i].sg; MEMZERO(dp, sizeof (*dp)); - dp->page = virt_to_page(isp->isp_osinfo.inqdata); + sg_assign_page(dp, virt_to_page(isp->isp_osinfo.inqdata)); dp->offset = offset_in_page(isp->isp_osinfo.inqdata); dp->length = DEFAULT_INQSIZE; diff --git a/qla_isp/linux/isp_linux.h b/qla_isp/linux/isp_linux.h index 550d4465b..c58510131 100644 --- a/qla_isp/linux/isp_linux.h +++ b/qla_isp/linux/isp_linux.h @@ -183,6 +183,14 @@ typedef struct scsi_host_template Scsi_Host_Template; #undef max #endif +#ifndef DECLARE_MUTEX_LOCKED +#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#define sg_page(_sg) ((_sg)->page) +#define sg_assign_page(_sg, _pg) ((_sg)->page = (_pg)) +#endif /* * Normally this should be taken care of by typedefs, diff --git a/qla_isp/linux/isp_scst.c b/qla_isp/linux/isp_scst.c index d191add36..46d720cac 100644 --- a/qla_isp/linux/isp_scst.c +++ b/qla_isp/linux/isp_scst.c @@ -167,7 +167,7 @@ struct bus { ini_t * list[HASH_WIDTH]; /* hash list of known initiators */ struct scst_tgt * scst_tgt; hba_register_t * unreg_hp; /* help to synchronize low level and SCST unregistration */ - int enable; /* is target mode enabled in low level driver, one bit per channel */ + unsigned long enable; /* is target mode enabled in low level driver, one bit per channel */ int need_reg; /* before SCST registration */ struct tasklet_struct tasklet; spinlock_t tmds_lock; @@ -204,7 +204,7 @@ DECLARE_MUTEX_LOCKED(scsi_thread_entry_exit_semaphore); static spinlock_t scsi_target_lock = SPIN_LOCK_UNLOCKED; static int scsi_target_thread_exit = 0; -static int schedule_flags = 0; +static unsigned long schedule_flags = 0; #define SF_ADD_INITIATORS 0 #define SF_REGISTER_SCST 1 #define SF_UNREGISTER_SCST 2