144 lines
4.1 KiB
Diff
144 lines
4.1 KiB
Diff
![]() |
From 120d28bad9890eca3a6451a83a7c71cb650dfef7 Mon Sep 17 00:00:00 2001
|
||
|
From: "Poddar, Siddarth" <siddpodd@codeaurora.org>
|
||
|
Date: Wed, 5 Jul 2017 12:31:03 +0530
|
||
|
Subject: [PATCH] qcacld-2.0: Remove code related to mmap functionality for
|
||
|
pktlog
|
||
|
|
||
|
Remove the code related to mmap functionality for pktlog
|
||
|
as it is no longer used/required.
|
||
|
|
||
|
Bug: 62084791
|
||
|
Change-Id: I06767f108c0ff6462a9e20e7b50d08bf4ac9555f
|
||
|
CRs-Fixed: 2064767
|
||
|
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
|
||
|
---
|
||
|
.../qcacld-2.0/CORE/UTILS/PKTLOG/linux_ac.c | 102 ---------------------
|
||
|
1 file changed, 102 deletions(-)
|
||
|
|
||
|
diff --git a/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/linux_ac.c b/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/linux_ac.c
|
||
|
index 173ed4e8eec1a..ec61b77e827cf 100644
|
||
|
--- a/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/linux_ac.c
|
||
|
+++ b/drivers/staging/qcacld-2.0/CORE/UTILS/PKTLOG/linux_ac.c
|
||
|
@@ -82,14 +82,12 @@ static int pktlog_attach(struct ol_softc *sc);
|
||
|
static void pktlog_detach(struct ol_softc *sc);
|
||
|
static int pktlog_open(struct inode *i, struct file *f);
|
||
|
static int pktlog_release(struct inode *i, struct file *f);
|
||
|
-static int pktlog_mmap(struct file *f, struct vm_area_struct *vma);
|
||
|
static ssize_t pktlog_read(struct file *file, char *buf, size_t nbytes,
|
||
|
loff_t * ppos);
|
||
|
|
||
|
static struct file_operations pktlog_fops = {
|
||
|
open:pktlog_open,
|
||
|
release:pktlog_release,
|
||
|
- mmap:pktlog_mmap,
|
||
|
read:pktlog_read,
|
||
|
};
|
||
|
|
||
|
@@ -921,106 +919,6 @@ static volatile void *pktlog_virt_to_logical(volatile void *addr)
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
-/* vma operations for mapping vmalloced area to user space */
|
||
|
-static void pktlog_vopen(struct vm_area_struct *vma)
|
||
|
-{
|
||
|
- PKTLOG_MOD_INC_USE_COUNT;
|
||
|
-}
|
||
|
-
|
||
|
-static void pktlog_vclose(struct vm_area_struct *vma)
|
||
|
-{
|
||
|
- PKTLOG_MOD_DEC_USE_COUNT;
|
||
|
-}
|
||
|
-
|
||
|
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
|
||
|
-int pktlog_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||
|
-{
|
||
|
- unsigned long address = (unsigned long)vmf->virtual_address;
|
||
|
-
|
||
|
- if (address == 0UL)
|
||
|
- return VM_FAULT_NOPAGE;
|
||
|
-
|
||
|
- if (vmf->pgoff > vma->vm_end)
|
||
|
- return VM_FAULT_SIGBUS;
|
||
|
-
|
||
|
- get_page(virt_to_page((void *)address));
|
||
|
- vmf->page = virt_to_page((void *)address);
|
||
|
- return VM_FAULT_MINOR;
|
||
|
-}
|
||
|
-#else
|
||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||
|
-struct page *pktlog_vmmap(struct vm_area_struct *vma, unsigned long addr,
|
||
|
- int *type)
|
||
|
-#else
|
||
|
-struct page *pktlog_vmmap(struct vm_area_struct *vma, unsigned long addr,
|
||
|
- int write_access)
|
||
|
-#endif
|
||
|
-{
|
||
|
- unsigned long offset, vaddr;
|
||
|
- struct proc_dir_entry *proc_entry;
|
||
|
- struct ath_pktlog_info *pl_info =
|
||
|
-
|
||
|
- proc_entry = PDE(vma->vm_file->f_dentry->d_inode);
|
||
|
- pl_info = (struct ath_pktlog_info *)proc_entry->data;
|
||
|
-
|
||
|
- offset = addr - vma->vm_start + (vma->vm_pgoff << PAGE_SHIFT);
|
||
|
- vaddr = (unsigned long) pktlog_virt_to_logical(
|
||
|
- (void *)(pl_info->buf) + offset);
|
||
|
-
|
||
|
- if (vaddr == 0UL) {
|
||
|
- printk(PKTLOG_TAG "%s: page fault out of range\n", __func__);
|
||
|
- return ((struct page *) 0UL);
|
||
|
- }
|
||
|
-
|
||
|
- /* increment the usage count of the page */
|
||
|
- get_page(virt_to_page((void*)vaddr));
|
||
|
-
|
||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
|
||
|
- if (type)
|
||
|
- *type = VM_FAULT_MINOR;
|
||
|
-#endif
|
||
|
-
|
||
|
- return virt_to_page((void *)vaddr);
|
||
|
-}
|
||
|
-#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) */
|
||
|
-
|
||
|
-static struct vm_operations_struct pktlog_vmops = {
|
||
|
- open:pktlog_vopen,
|
||
|
- close:pktlog_vclose,
|
||
|
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25)
|
||
|
- fault:pktlog_fault,
|
||
|
-#else
|
||
|
- nopage:pktlog_vmmap,
|
||
|
-#endif
|
||
|
-};
|
||
|
-
|
||
|
-static int pktlog_mmap(struct file *file, struct vm_area_struct *vma)
|
||
|
-{
|
||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
|
||
|
- struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *)
|
||
|
- PDE_DATA(file->f_path.dentry->d_inode);
|
||
|
-#else
|
||
|
- struct proc_dir_entry *proc_entry = PDE(file->f_dentry->d_inode);
|
||
|
- struct ath_pktlog_info *pl_info = (struct ath_pktlog_info *)
|
||
|
- proc_entry->data;
|
||
|
-#endif
|
||
|
-
|
||
|
- if (vma->vm_pgoff != 0) {
|
||
|
- /* Entire buffer should be mapped */
|
||
|
- return -EINVAL;
|
||
|
- }
|
||
|
-
|
||
|
- if (!pl_info->buf) {
|
||
|
- printk(PKTLOG_TAG "%s: Log buffer unavailable\n", __func__);
|
||
|
- return -ENOMEM;
|
||
|
- }
|
||
|
-
|
||
|
- vma->vm_flags |= VM_LOCKED;
|
||
|
- vma->vm_ops = &pktlog_vmops;
|
||
|
- pktlog_vopen(vma);
|
||
|
- return 0;
|
||
|
-}
|
||
|
-
|
||
|
int pktlogmod_init(void *context)
|
||
|
{
|
||
|
int ret;
|