Exemple #1
0
void handle_request(LIBBASETYPEPTR LIBBASE, struct IOSana2Req *request)
{
    BOOL complete;

    switch(request->ios2_Req.io_Command)
    {
        case CMD_READ:
            complete = CmdRead(LIBBASE, request);
            break;

        case CMD_WRITE:
        case S2_MULTICAST:
            complete = CmdWrite(LIBBASE, request);
            break;

        case CMD_FLUSH:
            complete = CmdFlush(LIBBASE, (struct IORequest *)request);
            break;

        case S2_DEVICEQUERY:
            complete = CmdS2DeviceQuery(LIBBASE, request);
            break;

        case S2_GETSTATIONADDRESS:
            complete = CmdGetStationAddress(LIBBASE, request);
            break;

        case S2_CONFIGINTERFACE:
            complete = CmdConfigInterface(LIBBASE, request);
            break;

        case S2_BROADCAST:
            complete = CmdBroadcast(LIBBASE, request);
            break;

        case S2_TRACKTYPE:
            complete = CmdTrackType(LIBBASE, request);
            break;

        case S2_UNTRACKTYPE:
            complete = CmdUntrackType(LIBBASE, request);
            break;

        case S2_GETTYPESTATS:
            complete = CmdGetTypeStats(LIBBASE, request);
            break;

        case S2_GETGLOBALSTATS:
            complete = CmdGetGlobalStats(LIBBASE, request);
            break;

        case S2_ONEVENT:
            complete = CmdOnEvent(LIBBASE, request);
            break;

        case S2_READORPHAN:
            complete = CmdReadOrphan(LIBBASE, request);
            break;

        case S2_ONLINE:
            complete = CmdOnline(LIBBASE, request);
            break;

        case S2_OFFLINE:
            complete = CmdOffline(LIBBASE, request);
            break;

        case S2_ADDMULTICASTADDRESS:
        case S2_ADDMULTICASTADDRESSES:
            complete = CmdAddMulticastAddresses(LIBBASE, request);
            break;

        case S2_DELMULTICASTADDRESS:
        case S2_DELMULTICASTADDRESSES:
            complete = CmdDelMulticastAddresses(LIBBASE, request);
            break;

        case NSCMD_DEVICEQUERY:
            complete = CmdDeviceQuery(LIBBASE, (struct IOStdReq *)request);
            break;

        default:
            complete = CmdInvalid(LIBBASE, request);
    }

    if(complete && (request->ios2_Req.io_Flags & IOF_QUICK) == 0)
        ReplyMsg((APTR)request);

    ReleaseSemaphore(&((struct SiS900Unit *)request->ios2_Req.io_Unit)->sis900u_unit_lock);
}
Exemple #2
0
VOID ServiceRequest(struct IOSana2Req *request, struct DevBase *base)
{
   BOOL complete;

   switch(request->ios2_Req.io_Command)
   {
   case CMD_READ:
      complete = CmdRead(request, base);
      break;
   case CMD_WRITE:
      complete = CmdWrite(request, base);
      break;
   case CMD_FLUSH:
      complete = CmdFlush((APTR)request, base);
      break;
   case S2_DEVICEQUERY:
      complete = CmdS2DeviceQuery(request, base);
      break;
   case S2_GETSTATIONADDRESS:
      complete = CmdGetStationAddress(request, base);
      break;
   case S2_CONFIGINTERFACE:
      complete = CmdConfigInterface(request, base);
      break;
   case S2_ADDMULTICASTADDRESS:
      complete = CmdAddMulticastAddresses(request, base);
      break;
   case S2_DELMULTICASTADDRESS:
      complete = CmdDelMulticastAddresses(request, base);
      break;
   case S2_MULTICAST:
      complete = CmdWrite(request, base);
      break;
   case S2_BROADCAST:
      complete = CmdBroadcast(request, base);
      break;
   case S2_TRACKTYPE:
      complete = CmdTrackType(request, base);
      break;
   case S2_UNTRACKTYPE:
      complete = CmdUntrackType(request, base);
      break;
   case S2_GETTYPESTATS:
      complete = CmdGetTypeStats(request, base);
      break;
   case S2_GETSPECIALSTATS:
      complete = CmdGetSpecialStats(request, base);
      break;
   case S2_GETGLOBALSTATS:
      complete = CmdGetGlobalStats(request, base);
      break;
   case S2_ONEVENT:
      complete = CmdOnEvent(request, base);
      break;
   case S2_READORPHAN:
      complete = CmdReadOrphan(request, base);
      break;
   case S2_ONLINE:
      complete = CmdOnline(request, base);
      break;
   case S2_OFFLINE:
      complete = CmdOffline(request, base);
      break;
   case NSCMD_DEVICEQUERY:
      complete = CmdDeviceQuery((APTR)request, base);
      break;
   case S2_ADDMULTICASTADDRESSES:
      complete = CmdAddMulticastAddresses(request, base);
      break;
   case S2_DELMULTICASTADDRESSES:
      complete = CmdDelMulticastAddresses(request, base);
      break;
   case P2_GETSIGNALQUALITY:
      complete = CmdGetSignalQuality(request, base);
      break;
   default:
      complete = CmdInvalid(request, base);
   }

   if(complete && ((request->ios2_Req.io_Flags & IOF_QUICK) == 0))
      ReplyMsg((APTR)request);

   ReleaseSemaphore(
      &((struct DevUnit *)request->ios2_Req.io_Unit)->access_lock);
   return;
}