EmbLogic's Blog

Initialization, registeration of device driver by using cdev_add() and remove the connection successfully

RCS file: header.h,v
Working file: header.h
head: 1.5
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;	selected revisions: 5
description:
----------------------------
revision 1.5
date: 2015/04/26 15:51:54;  author: root; 
state: Exp;  lines: +1 -0
removed the struct of cdev.
----------------------------
revision 1.4
date: 2015/04/26 14:41:40;  author: root; 
state: Exp;  lines: +1 -1
introduced the stucture for mapping
stuct Qset, struct dev where our devices node
information is stored.
in struct dev struct cdev is declared
internally.
also declared the extern struct dev *sdev
pointer for mapping
,
----------------------------
revision 1.3
date: 2015/04/26 13:28:55;  author: root; 
state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.2
date: 2015/04/26 13:18:47;  author: root; 
state: Exp;  lines: +3 -0
*** empty log message ***
----------------------------
revision 1.1
date: 2015/04/26 13:12:11;  author: root; 
state: Exp;
Initial revision
=============================================================================

RCS file: declaration.h,v
Working file: declaration.h
head: 1.5
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;	selected revisions: 5
description:
----------------------------
revision 1.5
date: 2015/04/26 17:35:00;  author: root; 
state: Exp;  lines: +1 -0
introduced extern file operations variable.
----------------------------
revision 1.4
date: 2015/04/26 15:52:20;  author: root; 
state: Exp;  lines: +2 -2
include the linux/cdev.h in header.h
----------------------------
revision 1.3
date: 2015/04/26 14:45:32;  author: root; 
state: Exp;  lines: +19 -0
*** empty log message ***
----------------------------
revision 1.2
date: 2015/04/26 13:18:47;  author: root; 
state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.1
date: 2015/04/26 13:12:11;  author: root; 
state: Exp;
Initial revision
=============================================================================

RCS file: new_initialization.c,v
Working file: new_initialization.c
head: 1.8
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 8;	selected revisions: 8
description:
----------------------------
revision 1.8
date: 2015/04/26 17:23:35;  author: root; 
state: Exp;  lines: +16 -2
initialize cdev_init and pass the 1st arguement
which is address of cdev which is pointed by object of struct dev.
2nd arguement is address of file_operations.
after cdev_init also initialized owner field and
file_operations *ops field which is actually defined in cdev.h.
after initialization of cdev_init, we need to
make the connection by using cdev_add().
In cdev_add(),mentioned the address pointed by
dev to cdev, 2nd arguement is dev and 3rd one is no. of devices we
added which is nod.
successfully cdev_add() is done, the driver
initilization is complete.
----------------------------
revision 1.7
date: 2015/04/26 16:11:06;  author: root; 
state: Exp;  lines: +4 -3
add the if statement in kmalloc error checking.
----------------------------
revision 1.6
date: 2015/04/26 15:51:07;  author: root; 
state: Exp;  lines: +2 -1
correct the mistake done is kmalloc of FLAG.
----------------------------
revision 1.5
date: 2015/04/26 14:40:00;  author: root; 
state: Exp;  lines: +8 -0
declared kmalloc and provide space into the
kernel.
after that memset flushed the memory.
----------------------------
revision 1.4
date: 2015/04/26 13:30:58;  author: root; 
state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.3
date: 2015/04/26 13:28:53;  author: root; 
state: Exp;  lines: +3 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2015/04/26 13:18:42;  author: root; 
state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.1
date: 2015/04/26 13:12:11;  author: root; 
state: Exp;
Initial revision
=============================================================================

RCS file: new_clean.c,v
Working file: new_clean.c
head: 1.6
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 6;	selected revisions: 6
description:
----------------------------
revision 1.6
date: 2015/04/26 17:33:01;  author: root; 
state: Exp;  lines: +1 -1
The device represented stucture cdev must be
removed from the device table by using cdev_del by giving the
arguement which is address pointed dev to cdev.
----------------------------
revision 1.5
date: 2015/04/26 15:37:52;  author: root; 
state: Exp;  lines: +1 -1
change the kfree arguement i.e address of struct
dev.
----------------------------
revision 1.4
date: 2015/04/26 14:41:00;  author: root; 
state: Exp;  lines: +1 -0
kfree() is used before unregistered the driver.
----------------------------
revision 1.3
date: 2015/04/26 13:28:55;  author: root; 
state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2015/04/26 13:18:44;  author: root; 
state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.1
date: 2015/04/26 13:12:11;  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>