commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10069 - openbts/branches/developers/dburgess00/veryea


From: dburgess00
Subject: [Commit-gnuradio] r10069 - openbts/branches/developers/dburgess00/veryearly/Control
Date: Wed, 26 Nov 2008 11:22:25 -0700 (MST)

Author: dburgess00
Date: 2008-11-26 11:22:25 -0700 (Wed, 26 Nov 2008)
New Revision: 10069

Modified:
   openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp
Log:
Access grant controller now parses bits of RA to determined
the required channel type.  Previously, we just assumed
SDCCH.


Modified: 
openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp
===================================================================
--- openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp  
2008-11-26 18:08:54 UTC (rev 10068)
+++ openbts/branches/developers/dburgess00/veryearly/Control/RadioResource.cpp  
2008-11-26 18:22:25 UTC (rev 10069)
@@ -75,6 +75,52 @@
 //@}
 
 
+/**
+       Determine the channel type needed.
+       This is based on GSM 04.08 Table 9.3 and 9.3a.
+       The following is assumed about the global BTS capabilities:
+       - We do not support "new establishment causes" and NECI is 0.
+       - We do not support call reestablishment.
+       - We do not support GPRS.
+       @param RA The request reference from the channel request message.
+       @return channel type code, undefined if not a supported service
+*/
+ChannelType decodeChannelNeeded(unsigned RA)
+{
+       // These values assume NECI is 0.
+       // This code is formatted so that it lines up easily with GSM 04.08 
Table 9.9.
+       //
+       if ((RA>>5) == 0x05) return TCHFType;                   // emergency 
call
+       //
+       // skip re-establishment cases
+       //
+       // "Answer to paging"
+       if ((RA>>5) == 0x04) return SDCCHType;                  // answer to 
paging, any channel
+       if ((RA>>4) == 0x01) return SDCCHType;                  // answer to 
paging, SDCCH
+       if ((RA>>4) == 0x02) return TCHFType;                   // answer to 
paging, TCH/F
+       if ((RA>>4) == 0x03) return TCHFType;                   // answer to 
paging, TCH/F or TCH/H
+       //
+       if ((RA>>5) == 0x07) return SDCCHType;                  // SDCCH 
procedures
+       //
+       if ((RA>>4) == 0x04) return TCHFType;                   // originating 
speech call
+       //
+       // skip originating data call cases
+       //
+       if ((RA>>5) == 0x00) return SDCCHType;                  // location 
updating
+       //
+       if ((RA>>4) == 0x00) return SDCCHType;                  // location 
updating
+       //
+       // skip packet (GPRS) cases
+       //
+       // skip LMU case
+       //
+       // skip reserved cases
+       //
+       // Anything else falls through to here.
+       return UndefinedCHType;
+}
+
+
 void Control::AccessGrantResponder(unsigned RA, const GSM::Time& when)
 {
        // RR Establishment.
@@ -82,35 +128,31 @@
        // GSM 04.08 3.3.1.1.3.
        // Given a request reference, try to allocate a channel
        // and send the assignment to the handset on the CCCH.
+       // This GSM's version of medium access control.
        // Papa Legba, open that door...
 
        CLDCOUT("AccessGrantResponder RA=" << RA << " when=" << when);
 
        // FIXME -- Check "when" against current clock to see if we're too late.
 
-       // Check the request type to see if it's a service we don't even 
support.
+       // Determine the channel type needed.
+       ChannelType chanNeeded = decodeChannelNeeded(RA);
+
+       // Allocate the channel.
+       LogicalChannel *LCH = NULL;
+       if (chanNeeded==TCHFType) LCH = gBTS.getTCH();
+       if (chanNeeded==SDCCHType) LCH = gBTS.getSDCCH();
        // If we don't support it, ignore it.
-       if ((RA&0xe0)==0x70) return;    // GPRS
-       if ((RA&0xe0)==0x60) return;    // TCH/H reestablishment & some 
reserved codes
-       if (RA==0x67) return;                   // LMU
-       if (RA==0xef) return;                   // reserved
+       if (LCH==NULL) return;
 
        // Get an AGCH to send on.
        CCCHLogicalChannel *AGCH = gBTS.getAGCH();
        assert(AGCH);
 
-       // FIXME -- We are ASSUMING that SDCCH is OK.
-       // The truth is that we should decode according GSM 04.08 9.1.8, Table 
9.9a.
-
-       // Get an SDCCH to assign to.
-       SDCCHLogicalChannel *SDCCH = gBTS.getSDCCH();
-
        // Nothing available?
-       if (!SDCCH) {
+       if (!LCH) {
                // Rejection, GSM 04.08 3.3.1.1.3.2.
-               // Emergency calls are not subject to T3122 hold-off.
-               // They are not handled as a special case because the
-               // MS will ignore the T3122 setting.
+               // BTW, emergency calls are not subject to T3122 hold-off.
                CERR("NOTICE -- Access Grant CONGESTION");
                unsigned waitTime = curT3122()/1000;
                CLDCOUT("AccessGrantResponder: assginment reject, wait time " 
<< waitTime);
@@ -123,10 +165,10 @@
        // Assignment, GSM 04.08 3.3.1.1.3.1.
        // Create the ImmediateAssignment message.
        // For most of the message, default IE values are correct.
-       const L3ImmediateAssignment 
assign(L3RequestReference(RA,when),SDCCH->channelDescription());
+       const L3ImmediateAssignment 
assign(L3RequestReference(RA,when),LCH->channelDescription());
        CLDCOUT("AccessGrantResponder sending " << assign);
        AGCH->send(assign);
-       SDCCH->open();
+       // This was opened by the gBTS.getXXX() method.  LCH->open();
 
        // Reset exponential back-off upon successful allocation.
        restoreT3122();
@@ -146,6 +188,7 @@
        // if not a legitimate reason, need to release the channel.
 
        // FIXME -- Check the transaction table to see if the call is still 
valid.
+
 #ifndef PAGERTEST
        // For now, assume MTC.
        MTCStarter(resp, SDCCH);
@@ -210,8 +253,7 @@
        // Page remaining entries, two at a time if possible.
        list<PagingEntry>::iterator lp = mPageIDs.begin();
        while (lp != mPageIDs.end()) {
-               // HACK -- Just pick the minimum load channel.
-               // FIXME -- This completely ignores the paging goups, GSM 04.08 
10.5.2.11 and GSM 05.02 6.5.2.
+               // FIXME -- This completely ignores the paging groups, GSM 
04.08 10.5.2.11 and GSM 05.02 6.5.2.
                CCCHLogicalChannel *PCH = gBTS.getPCH();
                assert(PCH);
                const L3MobileIdentity& id1 = lp->ID();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]