diff options
Diffstat (limited to 'target/linux/generic/files/crypto/ocf')
4 files changed, 28 insertions, 22 deletions
diff --git a/target/linux/generic/files/crypto/ocf/ocf-compat.h b/target/linux/generic/files/crypto/ocf/ocf-compat.h index 4ad12232b..831927e88 100644 --- a/target/linux/generic/files/crypto/ocf/ocf-compat.h +++ b/target/linux/generic/files/crypto/ocf/ocf-compat.h @@ -161,7 +161,13 @@ struct ocf_device {  	sigemptyset(¤t->blocked); \  	recalc_sigpending(current); \  	spin_unlock_irq(¤t->sigmask_lock); \ -	sprintf(current->comm, str); +	sprintf(current->comm, str); \ +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) \ +	spin_lock_irq(¤t->sigmask_lock); \ +	sigemptyset(¤t->blocked); \ +	recalc_sigpending(current); \ +	spin_unlock_irq(¤t->sigmask_lock); \ +	sprintf(current->comm, str); \  #else  #define ocf_daemonize(str) daemonize(str);  #endif diff --git a/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c b/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c index 1b4333cdd..7bb62bc53 100644 --- a/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c +++ b/target/linux/generic/files/crypto/ocf/pasemi/pasemi.c @@ -38,7 +38,7 @@  #define TIMER_INTERVAL 1000 -static void __devexit pasemi_dma_remove(struct pci_dev *pdev); +static void pasemi_dma_remove(struct pci_dev *pdev);  static struct pasdma_status volatile * dma_status;  static int debug; @@ -790,7 +790,7 @@ static device_method_t pasemi_methods = {  /* Set up the crypto device structure, private data,   * and anything else we need before we start */ -static int __devinit +static int  pasemi_dma_probe(struct pci_dev *pdev, const struct pci_device_id *ent)  {  	struct pasemi_softc *sc; @@ -943,7 +943,7 @@ static void pasemi_free_tx_resources(struct pasemi_softc *sc, int chan)  	del_timer(&ring->crypto_timer);  } -static void __devexit pasemi_dma_remove(struct pci_dev *pdev) +static void pasemi_dma_remove(struct pci_dev *pdev)  {  	struct pasemi_softc *sc = pci_get_drvdata(pdev);  	int i; @@ -984,7 +984,7 @@ static struct pci_driver pasemi_dma_driver = {  	.name		= "pasemi_dma",  	.id_table	= pasemi_dma_pci_tbl,  	.probe		= pasemi_dma_probe, -	.remove		= __devexit_p(pasemi_dma_remove), +	.remove		= pasemi_dma_remove,  };  static void __exit pasemi_dma_cleanup_module(void) diff --git a/target/linux/generic/files/crypto/ocf/random.c b/target/linux/generic/files/crypto/ocf/random.c index 4bb773ffb..9fc070ed4 100644 --- a/target/linux/generic/files/crypto/ocf/random.c +++ b/target/linux/generic/files/crypto/ocf/random.c @@ -49,6 +49,7 @@  #include <linux/unistd.h>  #include <linux/poll.h>  #include <linux/random.h> +#include <linux/kthread.h>  #include <cryptodev.h>  #ifdef CONFIG_OCF_FIPS @@ -79,9 +80,9 @@ struct random_op {  	void *arg;  }; +static struct task_struct *random_thread;  static int random_proc(void *arg); -static pid_t		randomproc = (pid_t) -1;  static spinlock_t	random_lock;  /* @@ -141,12 +142,10 @@ crypto_rregister(  	spin_lock_irqsave(&random_lock, flags);  	list_add_tail(&rops->random_list, &random_ops);  	if (!started) { -		randomproc = kernel_thread(random_proc, NULL, CLONE_FS|CLONE_FILES); -		if (randomproc < 0) { -			ret = randomproc; -			printk("crypto: crypto_rregister cannot start random thread; " -					"error %d", ret); -		} else +		random_thread = kthread_run(random_proc, NULL, "ocf-random"); +		if (IS_ERR(random_thread)) +			ret = PTR_ERR(random_thread); +		else  			started = 1;  	}  	spin_unlock_irqrestore(&random_lock, flags); @@ -172,7 +171,7 @@ crypto_runregister_all(u_int32_t driverid)  	spin_lock_irqsave(&random_lock, flags);  	if (list_empty(&random_ops) && started) -		kill_proc(randomproc, SIGKILL, 1); +		kthread_stop(random_thread);  	spin_unlock_irqrestore(&random_lock, flags);  	return(0);  } @@ -198,9 +197,11 @@ random_proc(void *arg)  	recalc_sigpending(current);  	spin_unlock_irq(¤t->sigmask_lock);  	sprintf(current->comm, "ocf-random"); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) +	recalc_sigpending(); +	sprintf(current->comm, "ocf-random");  #else  	daemonize("ocf-random"); -	allow_signal(SIGKILL);  #endif  	(void) get_fs(); @@ -303,12 +304,11 @@ random_proc(void *arg)  #endif  		}  	} -	 +  	kfree(buf);  bad_alloc:  	spin_lock_irq(&random_lock); -	randomproc = (pid_t) -1;  	started = 0;  	spin_unlock_irq(&random_lock); diff --git a/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c b/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c index f5d776236..3f3f5135c 100644 --- a/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c +++ b/target/linux/generic/files/crypto/ocf/ubsec_ssb/ubsec_ssb.c @@ -104,9 +104,9 @@   * Prototypes    */  static irqreturn_t ubsec_ssb_isr(int, void *, struct pt_regs *); -static int __devinit ubsec_ssb_probe(struct ssb_device *sdev, +static int ubsec_ssb_probe(struct ssb_device *sdev,      const struct ssb_device_id *ent); -static void __devexit ubsec_ssb_remove(struct ssb_device *sdev); +static void ubsec_ssb_remove(struct ssb_device *sdev);  int ubsec_attach(struct ssb_device *sdev, const struct ssb_device_id *ent,       struct device *self);  static void ubsec_setup_mackey(struct ubsec_session *ses, int algo,  @@ -185,7 +185,7 @@ static struct ssb_driver ubsec_ssb_driver = {      .name       = DRV_MODULE_NAME,      .id_table   = ubsec_ssb_tbl,      .probe      = ubsec_ssb_probe, -    .remove     = __devexit_p(ubsec_ssb_remove), +    .remove     = ubsec_ssb_remove,       /*      .suspend    = ubsec_ssb_suspend,      .resume     = ubsec_ssb_resume @@ -482,8 +482,8 @@ ubsec_setup_mackey(struct ubsec_session *ses, int algo, caddr_t key, int klen)  }  #undef N -static int  -__devinit ubsec_ssb_probe(struct ssb_device *sdev,  +static int +ubsec_ssb_probe(struct ssb_device *sdev,       const struct ssb_device_id *ent)   {      int err; @@ -553,7 +553,7 @@ err_out:      return err;  } -static void __devexit ubsec_ssb_remove(struct ssb_device *sdev) { +static void ubsec_ssb_remove(struct ssb_device *sdev) {      struct ubsec_softc *sc;      unsigned int ctrlflgs;  | 
