Gary Schumacher
2006-01-31 20:10:40 UTC
First of all I want to thank everybody that responded to my question
last Fri. I implement
your suggestions this weekend and how have a clone driver up and
running!
The next problem that I am trying to solve is a failure of a putmsg on
this clone driver.
I can open and do an ioctl to the driver but when I try to do a putmsg I
get a "Function
not implemented" error message. Using the debugging capabilities in
streams did not
help me find the cause. Being new to streams I would appreciate some
suggestions before I
have pulled all of my hair out ;)
The code slice:
fd1 = open ("/dev/swi", O_RDWR);
if (fd1 < 0) {
perror("/dev/swi");
close (fd1);
}
/*---------------------
* Set up stats request
*---------------------*/
(void) memset ((char *) &req, '\0', sizeof (req));
req.dl_primitive = DL_GET_STATISTICS_REQ;
ctlbuf.maxlen = 0;
ctlbuf.len = sizeof (req);
ctlbuf.buf = (char *) &req;
if (putmsg (fd1, &ctlbuf, NULL, 0) < 0) {
perror("putmsg");
exit (-1);
}
The resulti (with my debug messages):
PLSM3:/sw <mailto:***@PLSM3:/sw> # ./swi_stats
swiopen entered: rq=0xc33bb200, devp=0xc33bfde4, dev_t=0xfb00000
flag=0x2, sflag=0x2, credp=0xc33bfdb0
swiopen: major=251, minor=0
swiopen: minor dev = 0
swiopen: major=231, minor=0
swiopen: Device open
swiwput: db_type = 0x86 wq=0xc33bb2dc, mp=0xc3bf38e0
swiwput1 : db_type = 0x86 wq=0xc33bb2dc, mp=0xc3bf38e0
asw.c #1799: Queue pointer is NULL
NULL q, mp or q_next in putnext: called from file sw.c #1799
sswiclose: entered
swiclose: successful close cp= 0xc3ccd5a0
swi_stats: put failed
putmsg: Function not implemented
The "queue pointer is NULL" is the result of a FLUSH and I think that it
is not a problem. I am trying
to find the cause of the "putmsg: Function not implemented" message.
Any ideas?
Thanks
Gary
static struct module_info swiminfo = {
0, /* mi_idnum */
SWINAME, /* mi_idname */
SWIMINPSZ, /* mi_minpsz */
SWIMAXPSZ, /* mi_maxpsz */
SWIHIWAT, /* mi_hiwat */
SWILOWAT, /* mi_lowat */
};
static struct qinit swirinit = {
swirput, /* qi_putp */
swirsrv, /* qi_srvp */
swiopen, /* qi_qopen */
swiclose, /* qi_qclose */
NULL, /* qi_qadmin */
&swiminfo, /* qi_minfo */
NULL, /* qi_mstat */
};
static struct qinit swiwinit = {
swiwput, /* qi_putp */
swiwsrv, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
NULL, /* qi_qadmin */
&swiminfo, /* qi_minfo */
NULL, /* qi_mstat */
};
static struct streamtab swiinfo = {
&swirinit, /* st_rdinit */
&swiwinit, /* st_wrinit */
NULL, /* st_muxrinit */
NULL, /* st_muxwrinit */
};
SPECIAL NOTICE
All information transmitted hereby is intended only for the use of the
addressee(s) named above and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution
of confidential and privileged information is prohibited. If the reader
of this message is not the intended recipient(s) or the employee or agent
responsible for delivering the message to the intended recipient, you are
hereby notified that you must not read this transmission and that disclosure,
copying, printing, distribution or use of any of the information contained
in or attached to this transmission is STRICTLY PROHIBITED.
Anyone who receives confidential and privileged information in error should
notify us immediately by telephone and mail the original message to us at
the above address and destroy all copies. To the extent any portion of this
communication contains public information, no such restrictions apply to that
information. (gate02)
last Fri. I implement
your suggestions this weekend and how have a clone driver up and
running!
The next problem that I am trying to solve is a failure of a putmsg on
this clone driver.
I can open and do an ioctl to the driver but when I try to do a putmsg I
get a "Function
not implemented" error message. Using the debugging capabilities in
streams did not
help me find the cause. Being new to streams I would appreciate some
suggestions before I
have pulled all of my hair out ;)
The code slice:
fd1 = open ("/dev/swi", O_RDWR);
if (fd1 < 0) {
perror("/dev/swi");
close (fd1);
}
/*---------------------
* Set up stats request
*---------------------*/
(void) memset ((char *) &req, '\0', sizeof (req));
req.dl_primitive = DL_GET_STATISTICS_REQ;
ctlbuf.maxlen = 0;
ctlbuf.len = sizeof (req);
ctlbuf.buf = (char *) &req;
if (putmsg (fd1, &ctlbuf, NULL, 0) < 0) {
perror("putmsg");
exit (-1);
}
The resulti (with my debug messages):
PLSM3:/sw <mailto:***@PLSM3:/sw> # ./swi_stats
swiopen entered: rq=0xc33bb200, devp=0xc33bfde4, dev_t=0xfb00000
flag=0x2, sflag=0x2, credp=0xc33bfdb0
swiopen: major=251, minor=0
swiopen: minor dev = 0
swiopen: major=231, minor=0
swiopen: Device open
swiwput: db_type = 0x86 wq=0xc33bb2dc, mp=0xc3bf38e0
swiwput1 : db_type = 0x86 wq=0xc33bb2dc, mp=0xc3bf38e0
asw.c #1799: Queue pointer is NULL
NULL q, mp or q_next in putnext: called from file sw.c #1799
sswiclose: entered
swiclose: successful close cp= 0xc3ccd5a0
swi_stats: put failed
putmsg: Function not implemented
The "queue pointer is NULL" is the result of a FLUSH and I think that it
is not a problem. I am trying
to find the cause of the "putmsg: Function not implemented" message.
Any ideas?
Thanks
Gary
static struct module_info swiminfo = {
0, /* mi_idnum */
SWINAME, /* mi_idname */
SWIMINPSZ, /* mi_minpsz */
SWIMAXPSZ, /* mi_maxpsz */
SWIHIWAT, /* mi_hiwat */
SWILOWAT, /* mi_lowat */
};
static struct qinit swirinit = {
swirput, /* qi_putp */
swirsrv, /* qi_srvp */
swiopen, /* qi_qopen */
swiclose, /* qi_qclose */
NULL, /* qi_qadmin */
&swiminfo, /* qi_minfo */
NULL, /* qi_mstat */
};
static struct qinit swiwinit = {
swiwput, /* qi_putp */
swiwsrv, /* qi_srvp */
NULL, /* qi_qopen */
NULL, /* qi_qclose */
NULL, /* qi_qadmin */
&swiminfo, /* qi_minfo */
NULL, /* qi_mstat */
};
static struct streamtab swiinfo = {
&swirinit, /* st_rdinit */
&swiwinit, /* st_wrinit */
NULL, /* st_muxrinit */
NULL, /* st_muxwrinit */
};
SPECIAL NOTICE
All information transmitted hereby is intended only for the use of the
addressee(s) named above and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution
of confidential and privileged information is prohibited. If the reader
of this message is not the intended recipient(s) or the employee or agent
responsible for delivering the message to the intended recipient, you are
hereby notified that you must not read this transmission and that disclosure,
copying, printing, distribution or use of any of the information contained
in or attached to this transmission is STRICTLY PROHIBITED.
Anyone who receives confidential and privileged information in error should
notify us immediately by telephone and mail the original message to us at
the above address and destroy all copies. To the extent any portion of this
communication contains public information, no such restrictions apply to that
information. (gate02)