lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250128141743.52031-1-subramanian.mohan@intel.com>
Date: Tue, 28 Jan 2025 19:47:43 +0530
From: subramanian.mohan@...el.com
To: linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org,
	greg@...ah.com,
	corbet@....net,
	christopher.s.hall@...el.com,
	subramanian.mohan@...el.com,
	tglx@...utronix.de,
	andriy.shevchenko@...ux.intel.com,
	eddie.dong@...el.com,
	pandith.n@...el.com,
	thejesh.reddy.t.r@...el.com,
	david.zage@...el.com,
	srinivasan.chinnadurai@...el.com,
	rdunlap@...radead.org,
	bagasdotme@...il.com,
	giometti@...eenne.com
Subject: [PATCH v2 1/1] pps: retrieve generator specific data from framework

From: Subramanian Mohan <subramanian.mohan@...el.com>

While adapting pps generator driver(tio generator as an example)to the new
generator framework, As part of driver registration the pps_gen_device
pointer is returned from framework. Due to which there is difficulty in
getting generator driver data back in enable function. we won’t be able
to use container_of macro as it results in static assert. we might end up
in using static pointer. To avoid the same and get back the generator
driver data back we are proposing generic approach to add drv_prv_data
pointer inside the struct pps_gen_source_info.

Example TIO structure wrapped with pps_gen_device and usage.

struct pps_tio {
	/* Framework Related * /
	struct pps_gen_source_info pps_tio_source_info
	struct pps_gen_device *pps_gen;

	/* TIO Specific Data */
};

static int pps_tio_enable(struct pps_gen_device *pps_gen, bool enable) {

    /* Getting TIO data back */
    /* Note: drv_prv_data will be initialized in our init routine */
    struct pps_tio *tio = pps_gen->info.drv_prv_data;

    /* Access tio members here to set some of the parameters */

    return 0;
}

V1 -> V2:
    * Updated reviewers.

Signed-off-by: Subramanian Mohan <subramanian.mohan@...el.com>
---
 include/linux/pps_gen_kernel.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/pps_gen_kernel.h b/include/linux/pps_gen_kernel.h
index 022ea0ac4440..8484bb2828ef 100644
--- a/include/linux/pps_gen_kernel.h
+++ b/include/linux/pps_gen_kernel.h
@@ -35,6 +35,7 @@ struct pps_gen_source_info {
 	int (*get_time)(struct pps_gen_device *pps_gen,
 					struct timespec64 *time);
 	int (*enable)(struct pps_gen_device *pps_gen, bool enable);
+	void *drv_prv_data;
 
 /* private: internal use only */
 	struct module *owner;
-- 
2.35.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ