EmbLogic's Blog

Module code to show how to pass parameters to a module when using insmod using module_param() macro.

RCS file: header.h,v
Working file: header.h
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
Header file:<linux/init.h> is included to support module_init() and module_exit() macros.
—————————-
revision 1.4    locked by: root;
date: 2014/02/18 16:10:55;  author: root;  state: Exp;  lines: +1 -0
Header file:<moduleparam.h> is included to support module_param() macro.
—————————-
revision 1.3
date: 2014/02/18 15:51:35;  author: root;  state: Exp;  lines: +4 -0
A macro called DEBUG is defined using #define.
—————————-
revision 1.2
date: 2014/02/18 15:49:52;  author: root;  state: Exp;  lines: +4 -0
Header file:<linux/module.h> is included to support MODULE_LICENSE and MODULE_AUTHOR macros.
—————————-
revision 1.1
date: 2014/02/18 15:33:03;  author: root;  state: Exp;
Initial revision
=============================================================================
RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
Code that will run when the module is removed using the rmmod.
—————————-
revision 1.2    locked by: root;
date: 2014/02/18 16:04:27;  author: root;  state: Exp;  lines: +12 -0
Two debug statements are added inside the cleanup function that indicates the start and end of the cleanup function.
—————————-
revision 1.1
date: 2014/02/18 15:28:40;  author: root;  state: Exp;
Initial revision
=============================================================================
RCS file: initial.c,v
Working file: initial.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
Code to demonstrate how parameters can be passed to a module while loading it using insmod by a macro called module_param defined in moduleparam.h.
—————————-
revision 1.3    locked by: root;
date: 2014/02/18 16:17:36;  author: root;  state: Exp;  lines: +5 -2
Included module_param() macro that takes three arguments:name of the variable,its type and permission mask.
Checking…..
—————————-
revision 1.2
date: 2014/02/18 15:54:52;  author: root;  state: Exp;  lines: +20 -0
Two statements that indicates the start and end of the initialization function are added.
—————————-
revision 1.1
date: 2014/02/18 15:24:36;  author: root;  state: Exp;
Initial revision
=============================================================================

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>