Browse Source

qcacmn: proc_create_data support for 5.6+ kernel

One parameter of proc_create_data is changed from struct
file_operations to struct proc_ops.
Add support for it under the kernel version compilation flag.

Change-Id: Ic87222f9c267debef56dcc66fc629854058ffabd
CRs-Fixed: 2666492
bings 5 years ago
parent
commit
e3fe6fc3c0
2 changed files with 16 additions and 1 deletions
  1. 7 0
      hif/src/ath_procfs.c
  2. 9 1
      utils/pktlog/linux_ac.c

+ 7 - 0
hif/src/ath_procfs.c

@@ -206,10 +206,17 @@ out:
 		return -EIO;
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops athdiag_fops = {
+	.proc_read = ath_procfs_diag_read,
+	.proc_write = ath_procfs_diag_write,
+};
+#else
 static const struct file_operations athdiag_fops = {
 	.read = ath_procfs_diag_read,
 	.write = ath_procfs_diag_write,
 };
+#endif
 
 /*
  * This function is called when the module is loaded

+ 9 - 1
utils/pktlog/linux_ac.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -76,11 +76,19 @@ static int pktlog_release(struct inode *i, struct file *f);
 static ssize_t pktlog_read(struct file *file, char *buf, size_t nbytes,
 			   loff_t *ppos);
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
+static const struct proc_ops pktlog_fops = {
+	.proc_open = pktlog_open,
+	.proc_release = pktlog_release,
+	.proc_read = pktlog_read,
+};
+#else
 static struct file_operations pktlog_fops = {
 	open:  pktlog_open,
 	release:pktlog_release,
 	read : pktlog_read,
 };
+#endif
 
 void pktlog_disable_adapter_logging(struct hif_opaque_softc *scn)
 {