| 
 |  | 
#include <sys/types.h> #include <sys/stream.h> #include <sys/mdi.h> #include <sys/confmgr.h> #include <sys/ddi.h>int mdi_hw_suspended(queue_t *q, rm_key_t rmkey);
Driver-defined basic locks, read/write locks, and sleep locks may not be held across calls to this function.
The caller cannot have the stream frozen (see freezestr(D3str)) when calling this function.
``Hotplug devices'' in HDK Technical Reference
   int
   e3Dconfig(cfg_func_t func, void *idata, rm_key_t rmkey)
   {
      int ret;
      e3Ddev_t *dev=idata;
   
      switch(func) {
         case CFG_SUSPEND:
            /* tell whatever's above us (dlpi module, stream head) that
             * we're going to start dropping packets.  config(D2) says we
             * should queue frames but that's not reasonable for STREAMS --
             * we must drop.
             */
            ASSERT(dev->rmkey == rmkey);
            /* if we've issued a MAC_BIND_REQ then send a suspend notice
             * up stack.  We actually don't save the queue information in
             * our open routine so we don't have much of a choice here.
             * It also means that if we've opened up the card but not yet
             * issued the BIND_REQ then we'll fail any attempt at the
             * point we try to issue the BIND_REQ.
             */
            if (dev->ex_up_queue) {
               if ((ret=mdi_hw_suspended(dev->ex_up_queue, rmkey)) != 0) {
                  return(ret);
               }
            } else {
               /* suspending a driver that has been opened but
                * no BIND_REQ seen yet.  don't call mdi_hw_suspended.
                */
            }
      }
   }