home *** CD-ROM | disk | FTP | other *** search
/ ftp.sustworks.com 2018 / ftp.sustworks.com.zip / ftp.sustworks.com / USBAx8817x_101.dmg / src / Source / AxOutputQueue.h < prev    next >
C/C++ Source or Header  |  2005-10-08  |  2KB  |  62 lines

  1. #include "IOMbufQueue.h"
  2.  
  3. extern "C" {
  4. #include <sys/param.h>
  5. #if TIGER
  6.         #include <sys/kpi_mbuf.h>
  7. #else
  8.         #include "mbufPanther.h"
  9. #endif
  10. }
  11.  
  12. class AxOutputQueue : public IOOutputQueue {
  13.   OSDeclareDefaultStructors( AxOutputQueue )
  14. private:
  15.   IOLock *cmdLock;
  16.   IOLock *qLock;
  17.   UInt32 qState;
  18.   UInt32 qCmd;
  19.   IOThread qThread;
  20.   bool cmdActive;
  21.   UInt32 requestedCapacity;
  22.   OSObject *_target;
  23.   IOOutputAction _action;
  24.   IOMbufQueue *inQueue;
  25.   int blockingCount;
  26.   UInt32 stallCount;
  27.   UInt32 outputCount;
  28.   UInt32 dropCount;
  29.   UInt32 retryCount;
  30.   void *wakeConsumer;
  31.  
  32.   static void qThreadEntry(void *ob);
  33.   void threadGo();
  34.   inline void ackCmdSync();
  35.   bool sendCmdSync(UInt32 cmd);
  36.  
  37. public:
  38.   virtual bool init(OSObject *     target,
  39.                     IOOutputAction action,
  40.                     UInt32         capacity = 0);
  41.  
  42.   static AxOutputQueue * withTarget(IONetworkController * target,
  43.                                     UInt32 capacity = 0);
  44.   static AxOutputQueue * withTarget(OSObject *     target,
  45.                                     IOOutputAction action,
  46.                                     UInt32         capacity = 0);
  47.   virtual UInt32 enqueue(mbuf_t m, void * param);
  48.   virtual bool start();
  49.   virtual bool stop();
  50.   virtual void free();
  51.   virtual bool service(IOOptionBits options = 0);
  52.   virtual UInt32 flush();
  53.   virtual bool setCapacity(UInt32 capacity);
  54.   virtual UInt32 getCapacity() const;
  55.   virtual UInt32 getSize() const;
  56.   virtual UInt32 getDropCount();
  57.   virtual UInt32 getOutputCount();
  58.   virtual UInt32 getRetryCount();
  59.   virtual UInt32 getStallCount();
  60.   virtual UInt32 getState() const;
  61. };
  62.