Oh here's the function from my driver to implement this:
/* $Id: h830.c,v 1.14 1995/06/30 21:04:44 skay Exp skay $ */
/*
* h830 Driver derived from the psli Solaris Multithreaded STREAMS DLPI Driver
*
* Developed by Scott Kay - copyright TASC 1994.
*
*/
/*******************************************************************************
*
******************************************************************************/
static void h830setStreamHead(struct h830 *h830p)
{
mblk_t *mp;
int size;
struct stroptions *sopts;
struct h830str *slp;
if (h830debug)
h830comment("h830setStreamHead called.");
/* Try this later ****
freezestr();
strqset();
unfreezestr();
*/
/*
NOT NEEDED for HIPPI - address is not in data.
mp->b_rptr += sizeof (struct medium_header);
*/
/*
* Allocate an M_PROTO mblk for the DL_UNITDATA_IND.
*/
size = sizeof(struct stroptions);
if ((mp = allocb(size, BPRI_LO)) == NULL)
{
#ifdef KSTAT
h830p->h830_allocbfail++;
#endif /* KSTAT */
if (h830debug)
h830error(h830p->h830_dip, "allocb failed");
freemsg(mp);
return;
}
DB_TYPE(mp) = M_SETOPTS;
mp->b_wptr = mp->b_datap->db_lim;
mp->b_rptr = mp->b_wptr - size;
/*
* Construct a M_SETOPTS message for stream head.
*/
sopts = (struct stroptions *) mp->b_rptr;
sopts->so_flags = SO_HIWAT | SO_LOWAT;
sopts->so_hiwat = 4 * H830MAXPSZ;
sopts->so_lowat = 1 * H830MAXPSZ;
/* Set this on all the open stream heads */
for (slp = h830strup; slp; slp = slp->sl_nextp)
{
putq(slp->sl_rq, mp);
}
Quote:}
-Scott
--
*******************************************************************************
Scott Kay
TASC, Inc.
55 Walkers Brook Drive
Reading, MA
*******************************************************************************