MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / macAddChannel

Method macAddChannel

GPRS/MAC.cpp:549–580  ·  view source on GitHub ↗

Channel allocation for GPRS. If GPRS is enabled, we need at least one channel to handle GPRS registration activity, and it will be used often so it should be on the first ARFCN, CN0. That channel used for registration does not need to be completely dedicated; it can also be used for multislot assignments on adjacent channels. So the rule is that GPRS.Channels.Min channels will be allocated at star

Source from the content-addressed store, hash-verified

547// Allocate another GSM channel for GPRS use.
548// TODO: We would prefer adjacent channels for multislot use.
549bool L2MAC::macAddChannel()
550{
551 ChIdleCounter = ChCongestionCounter = 0;
552 // BEGINCONFIG
553 // 'GPRS.Channels.Max',4,0,0,'Maximum number of channels allocated for GPRS service.'
554 // 'GPRS.Channels.Min',0,0,0,'Minimum number of channels allocated for GPRS service once it starts.'
555 // ENDCONFIG
556 macCheckChannels();
557
558 // TODO: Dynamic channel assignment.
559#if GPRS_CHANNELS_MAX_SUPPORTED
560 if (macActiveChannels() >= configGprsChannelsMax()) {
561 return false;
562 }
563#endif
564
565 if (! macActiveChannels()) {
566 // When you first start the BTS you will not be able to allocate until some
567 // timer expires, which I measured as 4 seconds.
568 // So dont bother reporting until after 5 seconds.
569 time_t now; time(&now);
570 if (now - macStartTime < 5) { return false; }
571 // And dont print this message any more often than 10 seconds.
572 static time_t lastMessageTime = 0;
573 if (now - lastMessageTime < 10) { return false; }
574 GLOG(INFO) << "GPRS: Unable to allocate channel, all are busy";
575 time(&lastMessageTime);
576 return false;
577 }
578
579 return true;
580}
581
582// Try to free a GPRS channel, returning it to GSM RR use.
583// 5-24-2012: We must not free the channel that is our PACCH.

Callers 1

gprsStartFunction · 0.80

Calls 1

configGprsChannelsMaxFunction · 0.85

Tested by

no test coverage detected