Take MS power class into account to calculate appropiate MS Power level
osmo-bts.git loops.c ms_power_diff() currently contains:
// FIXME: to go above 1W, we need to know classmark of MS
* pespin trying to find out whether we already retrieve/calculate MS power class in some place <fixeria> pespin: AFAIR, MS Power Class is a part of the Mobile Station Classmark 1 <fixeria> pespin: so the MSC should know it <pespin> fixeria, yeah just found it has a "RF power capability" field in it <pespin> fixeria, in which message is that IE send? I was expecting to gather it in BTS <pespin> in order to know the maximum power level we can ask the MS to use in loops.c ms_power_diff() <fixeria> pespin: it is a part of Location Updating Request and CM Service Request messages <fixeria> pespin: most likely, a part of Paging Response too <pespin> ok many thanks <pespin> fixeria, maybe it should actually be parsed by BSC and taken into account when sending Chan ACT <fixeria> huh, now it's also interesting to me how to know the MS Power Class from the BTS <pespin> well if the BSC takes it into account in MS Power Level during CHAN ACT then the BTS doesn't need to know about it <pespin> it simply applies that power level as maximum <fixeria> pespin: as far as I can see, the BSC already does parsing of some messages <fixeria> there is handle_classmark_chg() <pespin> yeah, looks like that's the intended way <pespin> I'll check if there's a ticket to implement that and otherwise I'll create it <fixeria> pespin: the question is how to inform the BTS about the MS Power Class? is there any A-Bis IE for that? <pespin> fixeria, during CHAN ACT and during MS Power Control messages <pespin> the MS Power IE contains the maximum power level allowed on that chan <pespin> it is so far calculated based on "ms max power" param from VTY <pespin> but we can take into account the rf power capability from classmark1 there too so restrict more the maximum power level <fixeria> ok, so the MS Power IE coming from the BSC would contain the restricted power level (according to the band and MS Power Class), right? <pespin> that's my guess indeed <fixeria> makes sense <fixeria> pespin: FYI: https://git.osmocom.org/osmo-bsc/tree/src/osmo-bsc/gsm_04_08_rr.c#n922Useful links:
- TS 05.05 sec 4.1.1 "Mobile station" contains MS Power class and MS Power level <-> dBm tables: https://www.etsi.org/deliver/etsi_gts/05/0505/05.01.00_60/gsmts_0505v050100p.pdf
- TS 24.008 sec 10.5.1.5 "Mobile Station Classmark 1" is the IE containing "RF Power capability": https://www.etsi.org/deliver/etsi_ts/124000_124099/124008/13.07.00_60/ts_124008v130700p.pdf
- classmark1 is implemented in libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h, "struct gsm48_classmark1", the interesting field is named "uint8_t pwr_lev:3"
osmo-bsc.git contains "struct gsm_classmark" which in turn contains "struct gsm_classmark1", and it is already used in some places.
- Status changed from New to In Progress
- % Done changed from 0 to 50
I submitted several helpers I needed in libosmocore:
remote: https://gerrit.osmocom.org/c/libosmocore/+/15922 cosmetic: gsm_04_08.h: Fix trailing whitespace
remote: https://gerrit.osmocom.org/c/libosmocore/+/15923 gsm_04_08.h: Introduce API osmo_gsm48_rfpowercap2powerclass()
remote: https://gerrit.osmocom.org/c/libosmocore/+/15924 gsm: gsm_utils: Introduce API ms_max_pwr_dbm
And a WIP patch (needs to be tested) in https://gerrit.osmocom.org/c/osmo-bsc/+/15926
TODO1: Test patches (add TTCN3 test?)
TODO2: Compare power levels in osmo-bts (power_ctrl.c and loops.c) using dBm instead of Power Ctrl levels, in order to handle correctly DCS1800 power levels 29,30 and 31.
- % Done changed from 50 to 70
https://gerrit.osmocom.org/c/osmo-bts/+/15970 rsl: Assign recv pwr to lchan's max ms power
https://gerrit.osmocom.org/c/osmo-bts/+/15971 bts-trx: Implement MS Power control loop calculations using dBm instead of ctl levels
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15969 bts: TC_rsl_ms_pwr_dyn_down: Fix expected MS Power level
- osmo-bsc: Send MS Power Control if a new ms_power level is calculated as a result of power class change in lchan_update_ms_power_ctrl_level().
- Do similar fixed done in loops.c in power_control.c
In rsl.c rsl_rx_ms_pwr_ctrl(), Implement the FIXME: "FIXME: only set current to lchan->ms_power if actual value of current in dBm > value in dBm from lchan->ms_power, or if fixed=1."
- Status changed from In Progress to Feedback
- % Done changed from 70 to 90
More related patches:
remote: https://gerrit.osmocom.org/c/osmo-bsc/+/16053 comsetic: bs11_config: clean trailing whitespace
remote: https://gerrit.osmocom.org/c/osmo-bsc/+/16054 bsc: Send MS Power Control msg upon max MS power change
remote: https://gerrit.osmocom.org/c/osmo-bsc/+/15926 bsc: Adapt maximum MS Power Ctrl level based on band and MS Power class
TODO: Apply fixes done in loops.c into power_control.c, but that can be done as part of #1851, so marking this one as Feedback until patches are reviewed/merged.