Commit Graph

463 Commits

Author SHA1 Message Date
Harald Welte 7bc4cbc45c tlv_parser now operates on 'const' input buffer 2009-02-21 12:59:22 +00:00
Holger Freyther 3281f6e233 [build] Create a libbsc.a as noinst_LIBRARY, link bsc_hack and tests against it
Link the tests against the libbsc.a to avoid most of the breakage
when creating new symbols.
2009-02-20 18:33:00 +00:00
Harald Welte 11fa29c169 implement dynamic TRAU frame mapping 2009-02-19 17:24:39 +00:00
Harald Welte f325eb4e9f use new gsm_ts_name() funciton from debug statemens everywhere 2009-02-19 17:07:39 +00:00
Harald Welte dbd2ea8708 add debug statement when setting up trau mapping 2009-02-19 17:07:01 +00:00
Harald Welte 23a686347d add gst_ts_name() function to obtain human-readable channel name 2009-02-19 17:06:42 +00:00
Harald Welte f1e6f96654 don't pass subchannel data to the TRAU decoder if we're not synchronized yet 2009-02-19 17:05:13 +00:00
Harald Welte 26aa6a1166 trau mux updates
* add function to map two lchans to each other
* make sure to evic old trau mux mappings before creating a new one
2009-02-19 15:14:23 +00:00
Harald Welte ad2a12a4c3 we need tlv_parse.c in bs11_config now 2009-02-19 03:11:48 +00:00
Harald Welte f80b7d347c bs11_config: makes sure we disconnect properly before exiting 2009-02-19 03:11:13 +00:00
Harald Welte fb81ae9da2 restructure and enhance bs11_config
* add the concept of commands in addition to options
* add commands for querying essential configuration
* add command for explicit create/delete of TRX1
* software download is now an explicit operation
2009-02-19 02:59:17 +00:00
Harald Welte 78fc0d40a6 add various BS11 management related abis_nm functions 2009-02-19 02:50:57 +00:00
Harald Welte 0313394a88 * support BS11 specific IE types in abis_nm
* make bs11_config compile again 
* now that we have a proper TLV parser, use it to parse the status response on the serial port
2009-02-18 19:51:53 +00:00
Harald Welte 2c38aa8dcd * make sure we use the correct GSM48 encoding type
* modify the RSL channel mode (BTS) side) after the 04.08 (MS side) has acked MODIFY
2009-02-18 03:44:24 +00:00
Harald Welte 0b8348d397 fix the parsing of the 'normal' availability status 2009-02-18 03:43:01 +00:00
Harald Welte b110cee0a0 CONNECT TERRESTRIAL TRAFFIC needs to be in the CHANNEL object class in order to work 2009-02-18 03:42:35 +00:00
Harald Welte 7eb1f621e0 "the big fix", of the E1 subchannel [de]multiplexer. I don't even remember how
many bugs I fixed during the last couple of hours.  It was never working at
any time before.
2009-02-18 03:40:58 +00:00
Harald Welte f9227c7562 write 160byte to one E1 TS at any given time, since that is one TRAU Frame (40 bytes) per sub-channel 2009-02-18 03:39:00 +00:00
Harald Welte 23887b607f use official TCH/F for initial channel modes rather than BS-11 specific 0x09 2009-02-18 03:37:20 +00:00
Harald Welte 41e166884e if TRAU frame decoding doesn't work, we don't need to even try to re-encode and just send an idle frame instead 2009-02-18 03:34:55 +00:00
Harald Welte da78376396 * ensure TCH/F are activated signalling-only
* add function for RSL CHANNEL MODIFY REQUEST
* add missing channel activation function to header file
2009-02-18 03:29:53 +00:00
Harald Welte 93d3f37f6c * disable TS3 TRAU frame handling for now
* statically activate two sub-slots in TS2 (need to do this dynamic later)
2009-02-18 03:27:14 +00:00
Harald Welte bb8c4061eb * use DEBUGP in TRAU frame code
* make sure we actually set 'spare' bits to 1
2009-02-18 03:24:58 +00:00
Holger Freyther ce66896d1d [utils] Commit not working 7bit encoder...
No one is using it so far, so no one gets hurt...
2009-02-17 23:42:45 +00:00
Holger Freyther 62f47773ae [utils] Style change.. 2009-02-17 20:31:35 +00:00
Holger Freyther 76c9569021 [utils] Create gsm_utils for 7bit encoding and decoding... 2009-02-17 20:31:30 +00:00
Harald Welte 9e783318b0 strip mISDN hardware header before putting B-channel data into subchannel demuxer 2009-02-17 19:02:29 +00:00
Harald Welte 311d0cf245 don't reduce power quite as much to make sure we still get a singal (bs-11) and nanoBTS doesn't refuse the attribute at all 2009-02-17 17:45:59 +00:00
Harald Welte bfaf097905 in case pagign of the 'B-end' during call setup fails, transmit message to
correct lchan rather than crashing
2009-02-17 17:43:33 +00:00
Harald Welte 49dfa353e3 correctly print IPAC_CONNECT_ACK debug statement 2009-02-17 15:29:58 +00:00
Harald Welte 49f48b8b77 various CC updates:
* correctly lchan_put the second lchan of a call at teardown
* map the RTP streams of ip.access onto each other
* fix bug that prevented a CONNECt message to ever reach the 'B' side
2009-02-17 15:29:33 +00:00
Harald Welte 167df88aae * increased debug verbosity for ip.access BIDND_ACK processing
* emit a signel when the BIND is acknowledged
2009-02-17 14:35:45 +00:00
Harald Welte 4b45815b9d CC: send correct messages (too much copy+paste) and better debug printout 2009-02-17 13:23:06 +00:00
Harald Welte 677c21f4ab add parsing for ip.access vendor specific NM messages 2009-02-17 13:22:23 +00:00
Harald Welte 7ccf77810b slightly more complete GSM 04.08 CC, we can now
* initiate phone calls from one MS
* look-up the subscriber based on dialled extension
* page the called subscriber
* send the SETUP to the called subscriber, including CLIP/CLIR
* get ALERTING notification back to caller
* relay DISCONNECT from either side to the other
This is still far from being complete, but it at least works for the most common case
2009-02-17 01:43:01 +00:00
Harald Welte 75a1fa834c switch paging code to use a timer again, since not all BTS send reliable CCCH load indications 2009-02-17 01:39:41 +00:00
Harald Welte 09e38afbcc * introduce a callback function when paging completes (I know this is somewhat of an overlap
with the signals, but I think paging always has one reason and thus one caller wants to
  get notified about completion, including a caller-specific context, etc)
* introduce TLV parser definitions for GSM 04.08
* parse and generate BCD number IE's for 04.08 call control
2009-02-16 22:52:23 +00:00
Harald Welte 595ad7b762 modify the signal handler/dispatch code (sorry zecke, no offense, I just had some different ideas)
* introduce new notion of subsystem in addition to signal number
* no need for bitmasks of 'areas' (aka subsystems)
* pass subsystem/signal_nr/... per argument rather than by data structure
2009-02-16 22:05:44 +00:00
Harald Welte 7509926614 * introduce TLV parser definitions for RSL IE's
* introduce functions for ip.access specific RSL commands
2009-02-16 21:12:08 +00:00
Holger Freyther 9b177760bb [sms] Send a notification on incoming SMS
Further tests of the signal class. Send a notification
on incoming SMS.
2009-02-16 19:07:18 +00:00
Harald Welte d4c9bf3c5a * add bs_power and ms_power attributes to each channel and use them in channel activation 2009-02-15 16:56:18 +00:00
Harald Welte cd99387bd2 * use more constants to name the various BTS/TRX/... attributes
* set BS power reduction up to 30dB reduction.  we want to be quiet!
2009-02-15 16:16:28 +00:00
Harald Welte 940093296e support non-123 ARFCN on nonoBTS 2009-02-15 15:38:42 +00:00
Harald Welte 4f361fcb68 * add commond header file for ipaccess protocol
* query for more attributes during ipaccess-find
2009-02-15 15:32:53 +00:00
Harald Welte e1bd2412c2 * use the correct BCCH channel type for nanoBTS
* remove old code
* ensure that the default BTS type really is BS-11
* document the '-t' commandline argument in the --help message

With this commit, I can get the nanoBTS 900 working with OML and RSL, register
to the network from phones.  Paging is not tested yet, and voice traffic handling
is completely missing..
2009-02-15 14:40:09 +00:00
Harald Welte 362322ed81 For Phase2 and higher BTS, use the FULL IMMEDIATE ASSIGN INFO attribute, rather than IMMEDIATE ASSIGN INFO 2009-02-15 14:36:38 +00:00
Harald Welte 5c1e458376 Add support for ip.access RSL link on port 3003 2009-02-15 11:57:29 +00:00
Harald Welte 7782c14295 * generate virtual E1 TEI up/down events
* make debug printout a little less verbose
* introduce usleep to make things a bit slower for debugging
2009-02-15 03:39:51 +00:00
Harald Welte 8c1d0e41a7 * add bsc_hack commandline argument to select BTS type
* add event-based OML bring-up for nanoBTS
2009-02-15 03:38:12 +00:00
Harald Welte e0590df524 * extend TLV parser to use a list of TLV type descriptions
* implement TLV type descriptions for NM
* add operational/administrative/availability state keeping logic to abis_nm
* explicitly print all NACK's in abis_nm
* make sure we produce [not just for BS-11] valid channel attributes
2009-02-15 03:34:15 +00:00
Holger Freyther 49314f6080 [paging] Do not create a request when one is already pending...
This is removing a memleak, saving some mallocs and a crash
in the timer expired function that attempted to remove the
paging_request from a list it was not in....
2009-02-14 23:53:20 +00:00
Holger Freyther 2fa4cb5bc9 [paging] Assign the subscriber to the channel first...
Assign the GSM subscriber to the lchan and then inform
the paging layer and dispatch a signal. This makes sure
that lchan is updated with the right kind of information.
2009-02-14 23:53:15 +00:00
Holger Freyther 531c0deecb [paging] Fix crash, move_to_next can not be used....
move_to_next is using the last_request but we do not have
one... but we know the list is not empty so just pick the
first entry.
2009-02-14 23:35:09 +00:00
Holger Freyther 36b5d650b8 [signal] Fix misuse of llist_add_tail...
The to be added llist_head comes first.......
2009-02-14 23:35:06 +00:00
Holger Freyther 6b2d262888 [nm] Fix the ObjectClass for Set Channel Attribute
In r308 the enum for the object class was fixed and we
started to send the wrong (0x4) instead of the right (0x3)
object class. Fix that.
2009-02-14 23:16:59 +00:00
Holger Freyther 7aaf112ba7 [signal] Add consumer of the signal api, inform about paging
Use the new signaling API in the telnet interface to broadcast
a succeeded or failed paging request.
2009-02-14 22:51:13 +00:00
Holger Freyther e4b3fa3633 [signal] Move the area into the struct signal_data...
Remove the parameter and move the signal kind into the
signal struct. Make register/deregister fully symmetric.
2009-02-14 22:51:10 +00:00
Holger Freyther 053e09d102 [signal] dispatch the paging response...
Inform people about the successfull paging response and
provide access to the subscriber, lchan and bts...
2009-02-14 22:51:06 +00:00
Holger Freyther 4af2b48009 [signal] Dispatch the first signal... inform about paging timeout
When the paging request timed out, send a signal... lchan
is NULL in case of a failure.
2009-02-14 22:51:03 +00:00
Holger Freyther 2b2d2e350e [signal] Add generic signal registration and dispatch...
This will be used for generic registration and dispatching
of any kind of event. We will have different areas (like
with the debug interface) and each layer can define their
own struct for the event message... This is not tested yet
2009-02-14 22:51:00 +00:00
Harald Welte 09d38d3b61 add tlv_parser code to Makefile.am 2009-02-14 19:46:31 +00:00
Harald Welte 2fa79349aa implement type1TV or type 2 detection 2009-02-14 19:07:10 +00:00
Holger Freyther e36e15eb0a [paging] Send up to avaliable_slots paging requests...
Send up to available_slots paging requests but only
iterate over the list once. This was not tested on
a bts.
2009-02-14 18:05:03 +00:00
Holger Freyther 83e44b01e9 [paging] Initiliaze req in paging_T3113_expired 2009-02-14 18:04:59 +00:00
Harald Welte 22af0db588 * add comments for SET BTS ATTR and SET RADIO CARRIER ATTR
* use OPSTART on objects whose operational state is Disabled
2009-02-14 15:41:08 +00:00
Harald Welte 923a3bdbe5 add new program to use UDP broadcast packets to find ip.access BTS in the network 2009-02-14 12:51:36 +00:00
Harald Welte 5fd8a545c8 preliminary ip.access BTS support, as of now only OML singalling works 2009-02-13 02:43:36 +00:00
Harald Welte 34a9968baf * more extensive A-bis OML support 2009-02-13 02:41:40 +00:00
Harald Welte 7584aeac42 * add more GSM 04.08 IEIs
* implement function for CHANNEL MODE MODIFY
* don't use hard-coded SETUP message but construct it with tlv functions
2009-02-11 11:44:12 +00:00
Holger Freyther 334f236019 [paging] factor out list iteration... move to the next item 2009-02-11 03:00:20 +00:00
Holger Freyther b1ffbb62ee [paging] Send paging requests as response to the PAGING LOAD indicator
Kill the paging timer and send paging upon paging load notifications.
2009-02-11 01:49:15 +00:00
Holger Freyther ed2aea8ac1 [paging] Stop the timer when the paging was successful 2009-02-11 01:18:42 +00:00
Holger Freyther f6535bb444 [paging] Stop counting the requests... harald implemented sepc conform timer support
We do have a dispose timer, there is no need to discard the
paging request this way... remove the code.
2009-02-11 01:02:45 +00:00
Holger Freyther 3b91043cae [ccch load] Enable notifications for CCCH/PAGING LOAD again
Set the threshold to 0% for the load indication. The paging buffer
space will be used by the paging notifications and we will ignore
the racch usage notification for now.
2009-02-11 00:43:48 +00:00
Holger Freyther 5d7e5571d5 * make sure we start sending B channel data on channel activation 2009-02-10 18:40:45 +00:00
Harald Welte 8ffcfed9e0 mISDN doesn't support select-writefd's but rather sends PH_DATA_CNF
indications which should trigger us sending a new data packet on the
B channel
2009-02-10 18:18:50 +00:00
Harald Welte 51cce1e617 * decrease subscriber refcount when free()ing a paging request
* use a new timer that stops paging requests after some time, rather than
  sending them indefinitely
2009-02-10 17:35:04 +00:00
Harald Welte cd06bfbc9d * fill the e1_link member of every bts_trx_ts structure
* introduce new timer as part of every paging request
2009-02-10 17:33:56 +00:00
Harald Welte 39a1b7193c set up a static TRAU mux mapping between on-air TS1 and TS2 2009-02-10 17:17:09 +00:00
Holger Freyther 57dd7bf626 prettier debug prints in mISDN driver 2009-02-10 01:04:22 +00:00
Holger Freyther 392209cbb5 [paging] Introduce a variable containing the free paging slots
Start with a large number of available slots. It is guranteed
that we will - at some point - get a paging load and will properly
update the counter and keep it updated.
2009-02-10 00:06:19 +00:00
Holger Freyther 1fd34141c2 [paging] Cleanup page -> paging in function names 2009-02-09 23:42:03 +00:00
Holger Freyther 9c564b85e6 introduce lookup of subscribers based on their extension number 2009-02-09 23:39:20 +00:00
Holger Freyther cbc7b06534 some more primitive names for improved debug readability 2009-02-09 23:10:48 +00:00
Holger Freyther 59639e81e1 * always use bts->c0 as msg->trx for OML messages 2009-02-09 23:09:55 +00:00
Holger Freyther fb3f5190b4 * correctly initialize link->tei and link->sapi
* fix debug printf
2009-02-09 23:09:15 +00:00
Holger Freyther 3630eab572 fix segfault when trying to dequeue list head as list element 2009-02-09 21:05:56 +00:00
Harald Welte ce6efc295f remove old misdn driver; the code is now using e1_input.c in combination
with src/input/misdn.c
2009-02-09 18:14:24 +00:00
Harald Welte 1fa60c8ab0 * add trau_mux implementation to relay from one incoming TRAU
channel to another one (simple voice call switching)
* add a way more generic E1 input layer, abstracting out the misdn
  low-level interface. This also adds infrastructure for multiple TRX
  in one BTS, as well as multiple BTS on one E1 link
* add a E1 subchannel multiplexer for sending multiple 16kbit sub-channels
  one one 64kBps E1 channel
* add TRAU IDLE frame generation
* terminate bsc_hack in case there is a E1 / mISDN init error
* introduce 'e1_config.c' file with static configuration of our
  E1 setup (which TRX/BTS is configured for which TEI/SAPI/E1). This should
  later become a config file rather than a compiled C file.

WARNING: all this compiles but is not tested yet.  Expect fix-up committs over
the next hours or so
2009-02-09 18:13:26 +00:00
Harald Welte 0b4c34e3ca fix compiler warning about undeclared function by adding include file 2009-02-09 17:54:43 +00:00
Harald Welte 9383de3010 * remove excessive debug output during software load
* fix compiler warning about unused variable
2009-02-09 17:53:49 +00:00
Harald Welte e79769b926 make sure certain functions are per TRX, not per BTS, such as
* rsl_chan_activate()
* rsl_bcch_info()
* rsl_sacch_filling()
2009-02-07 00:48:17 +00:00
Holger Freyther 33ba752057 [paging] Move the code to send the command into a separate function
Mostly cosmetic and in preparation for proper page load indicator
handling.
2009-02-06 22:33:25 +00:00
Holger Freyther e64a7a3c3b [rr] Send a Channel Release before deactivating the channel
After auto releasing a channel the next paging request will
not be immediately answered. The hypothesis was that we do
not release the channel properly. Implementing Channel Release
of GSM 04.08 should have fixed it, but it didn't. According
to the wireshark dissectors the message is correct though.

- Add the RR cause values to gsm_04_08.
- Implement the Channel Release message
- Invoke the release channel function before deallocating
  the lchan.
2009-02-06 21:55:37 +00:00
Holger Freyther ceb59b72c2 [paging] Move the paging state into struct gsm_bts
There is a 1:1 relationship between gsm_bts and the paging
operation. Move the paging state into the gsm_bts which is
simplfying the code a lot. This was hinted by LaF0rge.

(I'm not happy with the names of the structs)
2009-02-06 18:54:00 +00:00
Holger Freyther 3d949240fe [paging] Use paging_request_remove to update last_request and free memory
Update the last_request when stopping the paging operation and also
free the associated memory of the request.
2009-02-06 18:08:18 +00:00
Holger Freyther 31338a16a5 [bs11-config] Really force the software upload
When we get a NM_MT_LOAD_END_NACK and we are supposed to
force the load we will just send data. This was already
done with NM_MT_LOAD_INIT_NACK.
2009-02-06 17:43:50 +00:00
Harald Welte 97ed1e7d43 * implement some simplistic OML EVENT STATE CHANGE REPORT parsing
* make sure we don't call a user_cb() function if it is NULL
2009-02-06 13:38:02 +00:00
Harald Welte 47150fbd20 stop paging a particular subscriber after we have received a PAGING RESPONSE 2009-02-06 12:52:47 +00:00
Harald Welte 763da00e97 add new routine to stop paging 2009-02-06 12:52:14 +00:00
Harald Welte 91b5b0d41d add some initial simplistic TLV parser 2009-02-06 12:51:39 +00:00
Harald Welte 0bbb8b2fd2 increase CCCH LOAD indication threshold to 50% to remove lots of noise 2009-02-06 12:49:11 +00:00
Harald Welte 6ddd1683b5 introduce new "DEBUGPC" macro for continuing on the same line without prefix of file/line/time 2009-02-06 12:38:29 +00:00
Harald Welte b60fa59276 add DMI and DMIB debug= commandline option parsing 2009-02-06 12:02:53 +00:00
Harald Welte 2d35ae6d3b implement parsing of PAGING RESPONSE 2009-02-06 12:02:13 +00:00
Harald Welte 1cbfaf508a * introduce a new '--restart' parameter to reboot BTS
* unconditionally create TRX1 objects
* wait for '3 Normal' before issuing disconnect
* MBCCU0/MBCCU1 state were accidentially switched
2009-02-05 19:30:22 +00:00
Harald Welte b8427970e2 introduce abis_nm_bs11_restart() function 2009-02-05 19:27:17 +00:00
Holger Freyther 152a14718a [paging] Use the number of different paging subchannels...
In our setup (1xCCCH combined, BS_AG_BLKS_RES=0,
BS_PA_MFRMS=0x3 -> 5) we have MAX(1,3-0) * 5 paging
sub-channels. Using this 15 I was able to successfully page
my phone/IMSI (934%15 -> 4).

My confusion is coming from the terms used for paging throughout
the documentation. GSM05.02 6.5.2 talks about "N = number of
paging blocks 'available' on one CCCH = (number of paging blocks
'available' in a 51-multiframe on one CCCH)xBS_PA_MFRMS" which
is already misguiding  and GSM04.08 is talking about number of
different paging subchannels on the CCCH and is providing a
formula.

I deduct that N == number of different paging subchannels on the CCCH
as of GSM04.08 and will simply test this with different IMSIs and
see if I can page them as well.
2009-02-04 13:38:26 +00:00
Holger Freyther 3aa8d6c46d [paging] This is paging my phone but it looks completely wrong...
- The paging block calculation is wrong but I have a hard time finding
  the right information. The table of 05.02 (Table 5 of 9) looks good
  but my phone is not happy with that group...
2009-02-04 02:14:45 +00:00
Holger Freyther 3b72a890c2 [paging] Implement the three Control Channel Descriptor methods...
This comes from GSM 05.02 and GSM 04.08
2009-02-04 00:31:39 +00:00
Holger Freyther 1adb4ff002 [paging] Keep a copy of the Control Channel Description in the bts struct
- Initialize Control Channel Description of SI3 
- Patch the table
- Setting ATT now is easy
- Paging can now extract all required information... to determine
  the right paging group.
2009-02-04 00:04:52 +00:00
Holger Freyther d4ec5287c2 [paging] some minor cleanups. put the current request into a temporary 2009-02-03 23:18:46 +00:00
Holger Freyther df892da697 [paging] Cosmetic changes on the timer handling and max requests 2009-02-03 21:05:49 +00:00
Holger Freyther f07768915d [telnet] use SO_REUSEADDR on the telnet socket 2009-02-03 20:49:51 +00:00
Holger Freyther 8c563cf4f9 [rsl] Decode RACH Load as well
Print the common field and ignore the Supplementary Information.
Initialize the fields to 0xffffffff in case the payload is malformed
2009-02-03 20:08:51 +00:00
Harald Welte bf5e8df424 cosmetic fixes / more comments 2009-02-03 12:59:45 +00:00
Harald Welte dc55db9d95 cosmetic fixes 2009-02-03 12:58:59 +00:00
Harald Welte 8f5e239388 cosmetic/coding style fixes 2009-02-03 12:57:37 +00:00
Harald Welte 6f14691c61 make bs11_config status lines shorter 2009-02-03 02:05:28 +00:00
Harald Welte ea280446bb add rudimentary code to debug-print the CCCH LOAD INDICATION 2009-02-02 22:29:56 +00:00
Harald Welte 5083b0b1f1 * fix warnings while compiling abis_nm.c 2009-02-02 19:20:52 +00:00
Harald Welte 5f6f149983 add limits.h for PATH_MAX 2009-02-02 14:50:29 +00:00
Harald Welte 7ed1a64d9d * exit program if we cannot set up the serial port
* leave the program if ctrl+c is pressed three times even without logoff from BTS
2009-02-02 14:45:49 +00:00
Harald Welte 44227dd62f typo 2009-02-01 22:25:58 +00:00
Harald Welte 3ffd1376b7 * add abis_nm_software_load_status() to header file
* new abis_nm_bs11_bsc_disconnect() function to disconnect BSC/BTS link
* add support for 'forced load' of BS-11 software to abis_nm.c and bs11_config
* remove lots of debug output
* print progress during software load
2009-02-01 22:15:49 +00:00
Harald Welte c12d52bae4 * improve parsing of status/phase response from BTS
* split rs232 support into separate file (like misdn.c)
2009-02-01 21:39:06 +00:00
Harald Welte 268bb40b35 * add more detailed status printout to bs11_config
* add support for real LMT logon time
* add support for abis external time
* move 'create_trx1_objects' to separate function
2009-02-01 19:11:56 +00:00
Harald Welte 832822961d Enable CCCH LOAD INDICATION always, from 0% upwards, and report it every second 2009-02-01 16:22:19 +00:00
Harald Welte 5e4d1b3663 * rename NM_MT_BS11_LOGOFF to NM_MT_BS11_LMT_LOGOFF
* add more BS11 specific attributes
* define all valid BS11 PA power classes
* add callback function to software load
* introduce SWL load function for BS-11 style SWL file lists
* separate activation of software from loading of software
* add function to obtain BS-11 serial number
2009-02-01 13:36:56 +00:00
Harald Welte 043d04a99a * Use new NM_ATT_BS11 definitions instead of magic numbers
* rename FECTORY_LOGON into LMT_LOGON since it's not always factory level
2009-01-29 23:15:30 +00:00
Harald Welte 623d53185b bs11_config:
* disable serial port POST processing
* default delay is 0
* make window size user-configurable (default: 8)
* add missing help line for the --delay option
* don't forget to create the CCLK object as part of minimal config
2009-01-29 21:14:05 +00:00
Harald Welte 1602ade492 Fix end-of-software_load detection (send segment with window number 0, wait for seg_ack) 2009-01-29 21:12:39 +00:00
Harald Welte 14f0934f0b * use select loop based rx/tx processing in bs11_config
* improve parsing/generation of fake lapd header
2009-01-29 19:28:38 +00:00
Harald Welte 3b8ba215b9 * Fix BS11 software download routines in abis_nm.c
* Introduce user-configurable delay when sending serial msgs from bs11_config
2009-01-29 12:27:58 +00:00
Harald Welte 071f34d7c6 bs11_config:
* fix serial port initialization
* add bs11_state enum and work accordingly
2009-01-29 09:24:38 +00:00
Harald Welte f186c46ff6 bs11_config: add setting of baud rate 2009-01-29 08:45:19 +00:00
Harald Welte bb15131847 fix off-by-one error in BS11 factory logon command 2009-01-28 20:42:07 +00:00
Holger Freyther 97cce476a2 [paging] Slightly increase the timeout to not overload the BTS... 2009-01-27 23:49:40 +00:00
Holger Freyther bf83481799 [paging] Discard paging requests after not completing them... 2009-01-27 23:46:19 +00:00
Holger Freyther 1525de0c8f [paging] memset and improve error message 2009-01-27 23:38:27 +00:00
Holger Freyther 342a2c67de [abis] Do not confuse me again.... 2009-01-27 22:49:48 +00:00
Harald Welte cfe6dce248 don't logon twice 2009-01-19 16:06:43 +00:00
Harald Welte 61e42ad7fd add bs11_config as LMT alternative 2009-01-18 19:10:46 +00:00
Harald Welte 7837489a6e abis_nm_reset_resource is a bs11 specific function 2009-01-18 19:09:22 +00:00
Harald Welte 4724f99d19 Implementation of GSM12.21 LOAD SOFTWARE (BS11 dialect thereof) 2009-01-18 18:01:49 +00:00
Harald Welte 978cb42911 add BTS TYPE field to facilitate future non-BS11 BTS support 2009-01-18 17:57:27 +00:00
Harald Welte 6f676a3541 abis_nm: use correct length in 08.59 OML header for all messages 2009-01-18 14:27:48 +00:00
Harald Welte 1bc0906436 abis_nm: more BS11 specific messages for configuration 2009-01-18 14:17:52 +00:00
Harald Welte 05188ee7a7 * prefix all BS11 specific OML functions with proper name
* add more BS11 specific OML commands (TRX power, logon, OML TEI, ...)
2009-01-18 11:39:08 +00:00
Harald Welte adaf08bec8 add some more BS11 specific OML definitions 2009-01-18 11:08:10 +00:00
Harald Welte d08de2f9e4 fix typo 2009-01-11 04:38:55 +00:00
Harald Welte 9bb7c70016 If there is already a subscriber and it does not equal to us -> moan
And unreference the gsm_subscriber object otherwise we would leak.
2009-01-10 03:21:41 +00:00
Harald Welte 4ed0e92464 Make mi_to_string parse the TMSI we generate, finish CM Service Request implementation
The TMSI encoding is up to us but generate_mid_from_tmsi and mi_to_string
did not agree on the encoding. Adjust mi_to_string to properly decode the
TMSI generated by generate_mid_from_tmsi. Check that the four bits are '1111'
and that the length is five. Memcpy the bytes to tmsi (to work with ARM or such)
and convert the number to host order...

Implement the CM Service Request. Try to get the subscriber from the TMSI and
assign it to the gsm_lchan. There is a small issue that will be fixed in the
next commit.

(done by z.)
2009-01-10 03:17:30 +00:00
Harald Welte ba4cf164b0 Start working on CM Service Request
Be able to send Accept/Reject the Service Request. Use mi_string
instead of the the msgb buffer (even if it is memsetted and such)...

The TMSI allocation seems to be a bit problematic and needs some
further checking. The rough idea is that we try to find the subscriber
for a CM Service Request and then decide based on the subscriber
if we want to handle the call.
2009-01-10 01:49:35 +00:00
Harald Welte c627afceaa Reset the use_count to zero in chan_free
It is possible that the BTS is closing the channel even when
our upper layers are doing work. Reset the use_count add a fixme
to call cancellations for pending operations. Cancellation of the
call state (state machines in general) and such come into mind...
2009-01-09 21:39:17 +00:00
Harald Welte 498b0bbd9b Use use_lchan/put_lchan for call handling to keep the channel up
Increase when the refcount of the lchan when we initiate a call,
get a SETUP message and put it when we want to release the call...

Once we have proper Q.931 support the use/put needs to be improved,
e.g. we currently do not allow to hangup from the network, and it
will ring until the end of time...
2009-01-09 21:27:43 +00:00
Harald Welte 626fe9c42b Print the refcount of the lchan as well 2009-01-09 21:24:53 +00:00
Harald Welte 2f1311b90e [paging] Page pagegroup one...
Currently we get OVERLOAD (8.6.3 of 08.58) and no CCCH LOAD INDICATION...
we will have to handle the OVERLOAD somehow...
2009-01-06 23:50:39 +00:00
Harald Welte 38c2f13098 Hook the paging code into bsc_hack.c and telnet_interface.c
Wrote and test code to add and remove paging requests... This
will be using the fact that the linux list is building a circle
on each tick we can send one/x paging requests and continue round
robin...
2009-01-06 23:10:57 +00:00
Harald Welte b68899d3e3 Start creating a paging layer...
You can request to open a channel to a MS and the paging layer
will call you once the channel is allocated. Internally the CCCH
Load Indication will be handled and retry to page a terminal.
2009-01-06 21:47:18 +00:00
Harald Welte 69b2af293e Handle TMSI reallocation complete by printing the subscriber
It looks like that certain phones that send their old TMSI from
a different network and we assign them a new one with LOCATION
UPDATING ACCEPT will send us a TMSI Reallocation Complete. Print out
the the imsi.
2009-01-06 19:47:00 +00:00
Harald Welte 9898188ca7 Allow to set a different ARFCN
Add the -f option to use a different channel. This is done
by patching the various tables before the OML and RSL is brought
up. It looks like it is working...


Patch by Harald, moving of the patch_tables invocation by zecke
2009-01-06 18:59:11 +00:00
Harald Welte 8965da4fde Tabs no Spaces... at least here 2009-01-06 18:09:02 +00:00
Harald Welte ce281c0772 add initializer function for subchan_demux 2009-01-05 20:14:14 +00:00
Harald Welte 418f5a4e25 * add function to change c-bits in TRAU frame from uplink to downlink
* add function to re-encode an exploded TRAU frame into a bit-per-byte stream
2009-01-05 20:12:47 +00:00
Harald Welte 38e04372e5 handle IDLE speech frames in trau_frame code 2009-01-05 19:42:46 +00:00
Harald Welte 196a366e30 make sure we build (even if not use) subchan_demux and trau_frame code 2009-01-05 19:01:56 +00:00
Harald Welte 2a8ee52ced add (untested) TRAU frame decoder with support for FR/EFR and AMR 2009-01-05 19:01:01 +00:00
Harald Welte 54bd94d8b7 add (untested) 16kbit E1 sub-channel demux with TRAU frame sync 2009-01-05 19:00:01 +00:00
Holger Freyther ca362a6028 Make gcc happy and remove a couple of warnings
Remove the callbacks from gsm_network for now. A set of different
callbacks will be back. E.g. when the paging is completed, when the
Q.931 like call handling is there...

Remove var's or move them into #if 0, remove unused stuff that looks
like we do not need it anytime soon or #if 0 them, move stuff around.
2009-01-04 21:05:01 +00:00
Holger Freyther 7448a53ddb Be able to initiate paging from the telnet interface
The actual paging by subscriber needs to be implemented
2009-01-04 20:18:23 +00:00
Holger Freyther 4c8f114976 Fix warning 2009-01-04 20:17:07 +00:00
Holger Freyther a553d098e7 Export the gsm0411 alloc and send function 2009-01-04 20:16:25 +00:00
Holger Freyther 5e76ce61ac Some simple size check. We would not overflow but would send garbage
Check the size
2009-01-04 20:15:12 +00:00
Harald Welte ca64da984b make use of new functions to print string chreq reason and lchan type 2009-01-04 16:54:12 +00:00
Harald Welte d4fc1b29ca use get_[lp]chan_name() functions for telnet interface 2009-01-04 16:11:31 +00:00
Harald Welte a72c98eb2f functions to convert lchan/pchan type into human-readable string 2009-01-04 16:10:38 +00:00
Harald Welte 47d88aecaf Add some functions to CREATE OBJECTs in the BS-11 internal database 2009-01-04 12:02:08 +00:00
Holger Freyther 868b8cdd58 Implement sending custm GSM 04.08 commands
First you would page the IMSI and then send GSM 04.08
commands to the MS. This should help when testing new
commands
2009-01-04 03:57:27 +00:00
Holger Freyther 3e2c32322e Make gsm48_sendmsg public as well 2009-01-04 03:55:31 +00:00
Holger Freyther 819dd205a9 Make gsm48_msgb_alloc public and usable for the telnet_interface 2009-01-04 03:52:50 +00:00
Holger Freyther 3ae8fd2acb Implement the call command...
Passing of an origin is missing this will need work in
gsm_04_08.
2009-01-04 03:50:40 +00:00
Holger Freyther f87573dc4e Implement put_channel/get_channel, save on which bts we currently operate
Allow to change the refcount for a given channel. Store which
bts is our primary bts. A command to switch the primary bts will
be added as well. This makes entering and parsing of commands more
easy.
2009-01-04 03:49:41 +00:00
Holger Freyther d0e38c3cad Add implementation to find a lchan by the struct gsm_subscriber
Really compare pointers to check if the one gsm_subscriber
is equal to the other... gsm_subscriber should be unique for
a given IMSI so comparing the pointers should be fine.
2009-01-04 03:48:30 +00:00
Holger Freyther a471a41680 Define the gsm_subscriber getter functions in the header 2009-01-04 03:47:05 +00:00
Holger Freyther ae61cae9b2 Add a show command to list the channel allocation
Example output

show
BTS #0 on link 0  LOC: 1 TRX: 1 CCCH0: arfcn:123,#0
  TRX: 0 ARFCN: 123
     TS: #0 pchan: 2 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #1 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #2 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #3 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #4 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #5 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #6 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
     TS: #7 pchan: 0 flags: 0
       LCHAN: #0 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #1 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #2 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #3 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #4 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #5 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #6 type: 0  subscriber: na/na/na use: 0 loc: (nil)
       LCHAN: #7 type: 0  subscriber: na/na/na use: 0 loc: (nil)
2009-01-04 03:46:01 +00:00
Harald Welte 4668fdaa26 define and use enum values for BS11 (or Siemens?) specific OML message types 2009-01-03 08:19:29 +00:00
Harald Welte 227d4073fb use NM_MT_* enum instead of hard-coded values 2009-01-03 08:16:25 +00:00
Holger Freyther 52aab5445d Make wireshark happy.
Removing the P Bit from the fake LAPD frame will make wireshark
run the data through the GSM RSL dissector with the right SAPI
and LAPD preference setting.
2009-01-03 05:49:22 +00:00
Harald Welte 1272aab1cd Go through del_timer otherwise in_list will not be reset leading to crashes... 2009-01-03 04:39:51 +00:00
Harald Welte 599639eaf9 Readd the dummy lapd header... this gives valid TEI/SAPI information
Besides that the header is spoofed, we lose the information about
the channel (we will have to add our own encap type)
2009-01-03 03:28:10 +00:00
Harald Welte 4e0d137a2c Dump something that can be read by wireshark
We need to append the Linux LAPD header for wireshark. This means
that we currently can not support B Channels or such. Maybe we will
need to add another LAPD header.
2009-01-03 03:04:07 +00:00
Harald Welte 62a923d46a Use the right network/link type, prepend the vISDN header...
Now only the LAPD header is invalid...
2009-01-03 01:32:00 +00:00
Harald Welte ca6bf7815a Write the pcap packet header first :) 2009-01-03 00:41:04 +00:00
Harald Welte b8f04ea5a9 Add new management function to struct timer_list
Make sure that del_timer succeeds and removes an entry from the list. Currently
sending the LOCATION UPDATING REJECT from within the timer will not remove the
list element as ->active gets set to 0 in the timer updating before calling the
callback. Fix the segfault and allow the timer to be removed from within its
own callback.
2009-01-02 23:57:22 +00:00
Holger Freyther 219518d064 Add simplistic telnet control interface
This might turn into a complete wire protocol with special
client software. For now it will be a simple client interface
that you can use with telnet to do certain things.

This is using flex to implement the parsing. Implementation
and more commands will follow.
2009-01-02 22:04:43 +00:00
Holger Freyther c6880a46ad Use the _safe variant as a bsc_unregister_fd might be called from within the callback 2009-01-02 21:53:34 +00:00
Holger Freyther 52af7d4284 Write only actual data into the pcap file
The current LAPD control field for indication/disconnect/etc
is wrong and currently we are only interested in the actual
A-Bis data spoken between the BTS and BSC and not on the indication
of the physical line (connection, disconnect, release..)
2009-01-02 01:18:28 +00:00
Holger Freyther 2139b246a0 Attempt to put the time into the pcap packet record 2009-01-02 01:17:48 +00:00
Holger Freyther 9a3ee0ff1b Add the option to write the communication on the D Channel to a pcap file
When using ISDN as network type and using a fake LAPD encapsulation
wireshark should be able to recognize some bits if dump.

Append a dummy LAPD header. It is not clear to me if the Control field
of the LAPD frame is part of the msg or if we need to add it as well.

TODO:
    - Do the same for the B Channel
    - Write out time
    - Check if more of the LAPD frame needs to be prepended. The
      information from the mISDNhead comes into mind. Maybe it makes
      sense to start a custom wireshark mISDN dissector.
2009-01-02 00:40:15 +00:00