Sponsored Content
Full Discussion: Entry Points Routine
Top Forums Programming Entry Points Routine Post 30343 by S.P.Prasad on Monday 21st of October 2002 08:49:33 AM
Old 10-21-2002
As originally posted by Perderabo
"No there no exception for streams-based character drivers. "

Following is the cdevsw structure that we are using for developing stream device drivers in Sun and Sco unix Servers.
strcut cdevsw {
int (*d_open)( );
int (*d_close)( );
int (*d_read)( );
int (*d_write)( );
int (*d_ioctl)( );
struct tty *d_ttys ;
strcut streamtab *d_str;
char *d_name ;
};
Streams drivers have some similarites with character device drivers. A Stream driver may include init, start , halt and intr entry points.They must include open and close entry points.In addition, there are entry points that are specific to Streams driver: read and write queue service (xxsrv) read and write queue put functions.The put entry points are required with exception of the read side of a driver.The service entry points are optional.The put and service entry points are associated with each queue, and since each module and driver has two queues, each module and driver may have two put and two service entry points.The put routine is called to place a message on a queue and perform any processing that must be done immediately.The Stream head converts a write system call into a message and invokes the put routine for downstream module's write queue.This routine examines the message, performs any processing and either passes the message downstream or places it on its own queue for later processing.The Stream Device driver on the write side must provide a put entry point that may be called by the upstream module to pass message message down the stream.It may provide a write side service routine.On the read side the interrupt or poll takes the data from device and passes it to the driver's read queue or any module upstream.
.....
.....
int xxopen(),xxclose(),...... ;
static struct qinit rinit = { NULL , NULL , xxopen,xxclose,.......} ;
static struct qinit winit = { xxput, xxsrv,NULL,.......};
strcut streamtab xxinfo = {&rinit,&winit,.......};
The qinit structure contians the info for read and write queues.

I do hope I justify my stand quiet clear and sound now.The read and write queue need to be intialized.But I need a bit more of explanation.As in reference to ioctl , I think the context in which it is called is blockable but in case of streams the ioctls are transparent.That's all I know.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sub routine call

in windows machine... C:\2\test>perl -version This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) ------------------------------------------ what is the difference b\w subroutine calls: sub_routine_name("-----"); and ... (2 Replies)
Discussion started by: sekar sundaram
2 Replies

2. UNIX and Linux Applications

Gnuplot question: how to plot 3D points as colored points in map view?

I have a simple gnuplot question. I have a set of points (list of x,y,z values; irregularly spaced, i.e. no grid) that I want to plot. I want the plot to look like this: - points in map view (no 3D view) - color of each point should depend on its z-value. - I want to define my own color scale -... (0 Replies)
Discussion started by: karman
0 Replies

3. UNIX for Advanced & Expert Users

how to cp files to dir,using routine?

hi all, I wanted to know how we can copy files to dirs, through a routine and when the file and the dir are specified as parameters for that routine and explicitly called? Eg: suppose i want to copy file1 to /tmp then myproc() { . . } myproc /path/file1 /tmp/ These parameters when... (1 Reply)
Discussion started by: wrapster
1 Replies

4. Shell Programming and Scripting

how to cp files to dir,using routine?

hi all, I wanted to know how we can copy files to dirs, through a routine and when the file and the dir are specified as parameters for that routine and explicitly called? Eg: suppose i want to copy file1 to /tmp then myproc() { . . } myproc /path/file1 /tmp/ These parameters when... (4 Replies)
Discussion started by: wrapster
4 Replies

5. Shell Programming and Scripting

File exists routine

Hello experts, I need some help here.. I've written the following routine to check for existence of files. The routine does the following. It will look for a compressed ( .Z ) file and if it exists, then it will uncompress it, if it is already uncompressed, then it will just diplay a message... (9 Replies)
Discussion started by: kamathg
9 Replies

6. Shell Programming and Scripting

awk routine help

Hi, I use awk but not as a programming language. Just generally in piplelines to split things out by fields. I am trying to accomplish this one thing that I think a short awk routine would do great for, but can't figure it out. Lets say I have a file that contains database columns. The file... (25 Replies)
Discussion started by: fwellers
25 Replies

7. Shell Programming and Scripting

Do not find the mistake in a small routine!!!

Have a textfile (regular updated) with informations about datafiles . Each line is describing a datafile. Now I am trying to delete several specific lines in this textfile, which are defined before in a kind of removal list. Can not find the mistake I have done in the script because in the... (5 Replies)
Discussion started by: jurgen
5 Replies

8. How to Post in the The UNIX and Linux Forums

Help me, write a bash script to delete parent entry with all their child entry in LDAP UNIX server

Hi All, Please help me and guide me to write a bash/shell script on Linux box to delete parent entry with all their child entries. example: Parent is : ---------- dn: email=yogesh.kumar@wipro.com, o=wipro, o=in child is: ---------- dn: cn: yogesh kumar, email=yogesh.kumar@wipro.com,... (1 Reply)
Discussion started by: Chand
1 Replies

9. Shell Programming and Scripting

Trying to Parse An Inherited Command/Routine

I am am one of these people that it isn't good enough just to say, "Here, try this...". it is important for me to understand how and why something works (or doesn't work.) All that being said, I am trying to parse out a command that we use that was handed down to me by someone I can no longer... (3 Replies)
Discussion started by: he204035
3 Replies

10. Shell Programming and Scripting

How to replace multiple "&nbsp;" entry with in <td> tag into single entry using sed?

I have the input file like this. Input file: 12.txt 1) There are one or more than one <tr> tags in same line. 2) Some tr tags may have one <td> or more tna one <td> tags within it. 3) Few <td> tags having "<td> &nbsp; </td>". Few having more than one "&nbsp;" entry in it. <tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies
strmod_del(2)							System Calls Manual						     strmod_del(2)

NAME
strmod_del - Deletes STREAMS modules and drivers SYNOPSIS
#include <sys/stream.h> int strmod_del ( dev_t devno, struct streamtab *streamtab, struct streamadm *streamadm); PARAMETERS
The device number (cdevsw slot) to use when removing a STREAMS driver. This parameter is ignored for modules. A pointer to the streamtab structure that contains the entry points. The actual streamtab structure has to be allocated permanently in the driver's data space (as specified by System V Release 3.2). A pointer to the streamadm structure that contains the administration parameters for the STREAMS mod- ule or driver. The actual streamadm structure is needed only for the duration of the call. It does not have to be allocated permanently by the caller. The sa_version field must be either OSF_STREAMS_10 or OSF_STREAMS_11, and the sa_flags field must be either STR_IS_DEVICE or STR_IS_MODULE. DESCRIPTION
The strmod_del() interface is used to remove configured STREAMS modules and drivers from the kernel. Specifically, it allows STREAMS driv- ers to remove entry points in character device switch tables. Modules are removed from the STREAMS modules switch. When removing a driver only, strmod_del() takes a device number, which is used to determine the device switch slot for the entry points. The streamtab parameter is a pointer to a traditional (System V Release 3.2) streamtab structure. The structure contains pointers to entry points for the module's read and write queue routines. The streamadm parameter points to a streamadm structure. The streamadm structure provides additional information that is required under Tru64 UNIX. NOTES
The device number can be constructed from the major number through the makedev macro, which is defined in /usr/include/sys/types.h. RETURN VALUES
Upon successful completion, strmod_del() returns 0. Otherwise, it returns one of the following values: The sa_version or sa_flags fields in the streamadm structure are not set correctly. The entry is in use and cannot be removed. The entry to be removed is not found. The devno is out of range, or the devsw entry was not in use. RELATED INFORMATION
Data Structures: streamadm(4). Routines: strmod_add(2). delim off strmod_del(2)
All times are GMT -4. The time now is 09:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy