Project

General

Profile

0001-WIP.patch

pespin, 11/23/2018 05:01 PM

View differences:

include/osmo-bts/bts_model.h
60 60
void bts_model_phy_instance_set_defaults(struct phy_instance *pinst);
61 61

  
62 62
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts);
63
int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan);
63
void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan);
64 64

  
65 65
#endif
src/common/rsl.c
2157 2157
 * 1. call bts_model_ts_disconnect() to disconnect TCH/F;
2158 2158
 * 2. cb_ts_disconnected() is called when done;
2159 2159
 * 3. call bts_model_ts_connect() to connect as PDTCH;
2160
 * 4. cb_ts_connected() is called when done;
2160
 * 4. cb_ts_connected(rc) is called when done;
2161 2161
 * 5. instruct the PCU to enable PDTCH;
2162 2162
 * 6. the PCU will call back with an activation request;
2163 2163
 * 7. l1sap_info_act_cnf() will call ipacc_dyn_pdch_complete() when SAPI
......
2171 2171
 *    deactivations are done;
2172 2172
 * 4. cb_ts_disconnected() is called when done;
2173 2173
 * 5. call bts_model_ts_connect() to connect as TCH/F;
2174
 * 6. cb_ts_connected() is called when done;
2174
 * 6. cb_ts_connected(rc) is called when done;
2175 2175
 * 7. directly call ipacc_dyn_pdch_complete(), since no further action required
2176 2176
 *    for TCH/F;
2177 2177
 * 8. send a PDCH DEACT ACK.
......
2276 2276
	if (rc)
2277 2277
		goto error_nack;
2278 2278

  
2279
	rc = bts_model_ts_connect(ts, as_pchan);
2279
	bts_model_ts_connect(ts, as_pchan);
2280
	return;
2280 2281

  
2281 2282
error_nack:
2282 2283
	/* Error? then NACK right now. */
......
2322 2323
	}
2323 2324
}
2324 2325

  
2325
static void ipacc_dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts)
2326
static void ipacc_dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts, int rc)
2326 2327
{
2327
	int rc;
2328
	if (rc) {
2329
		LOGP(DRSL, LOGL_NOTICE, "%s PDCH ACT IPA operation failed (%d) in bts model\n",
2330
		     gsm_lchan_name(ts->lchan), rc);
2331
		ipacc_dyn_pdch_complete(ts, rc);
2332
		return;
2333
	}
2328 2334

  
2329 2335
	if (ts->flags & TS_F_PDCH_DEACT_PENDING) {
2330 2336
		if (ts->lchan[0].type != GSM_LCHAN_TCH_F)
......
2373 2379
	}
2374 2380
}
2375 2381

  
2376
static void osmo_dyn_ts_connected(struct gsm_bts_trx_ts *ts)
2382
static void osmo_dyn_ts_connected(struct gsm_bts_trx_ts *ts, int rc)
2377 2383
{
2378
	int rc;
2379 2384
	struct msgb *msg = ts->dyn.pending_chan_activ;
2380 2385
	ts->dyn.pending_chan_activ = NULL;
2381 2386

  
2387
	if (rc) {
2388
		LOGP(DRSL, LOGL_NOTICE, "%s PDCH ACT OSMO operation failed (%d) in bts model\n",
2389
		     gsm_lchan_name(ts->lchan), rc);
2390
		ipacc_dyn_pdch_complete(ts, rc);
2391
		return;
2392
	}
2393

  
2382 2394
	if (!msg) {
2383 2395
		LOGP(DRSL, LOGL_ERROR,
2384 2396
		     "%s TS re-connected, but no chan activ msg pending\n",
......
2395 2407
		msgb_free(msg);
2396 2408
}
2397 2409

  
2398
void cb_ts_connected(struct gsm_bts_trx_ts *ts)
2410
void cb_ts_connected(struct gsm_bts_trx_ts *ts, int rc)
2399 2411
{
2400 2412
	OSMO_ASSERT(ts);
2401 2413

  
2402 2414
	switch (ts->pchan) {
2403 2415
	case GSM_PCHAN_TCH_F_PDCH:
2404
		return ipacc_dyn_pdch_ts_connected(ts);
2416
		return ipacc_dyn_pdch_ts_connected(ts, rc);
2405 2417
	case GSM_PCHAN_TCH_F_TCH_H_PDCH:
2406
		return osmo_dyn_ts_connected(ts);
2418
		return osmo_dyn_ts_connected(ts, rc);
2407 2419
	default:
2408 2420
		return;
2409 2421
	}
src/osmo-bts-trx/l1_if.c
779 779
	     " calling cb_ts_connected()\n",
780 780
	     gsm_ts_name(ts), gsm_pchan_name(as_pchan));
781 781

  
782
	cb_ts_connected(ts);
782
	/* cb_ts_connected will be called once we receive RSP SETSLOT */
783 783
	return 0;
784 784
}
src/osmo-bts-trx/trx_if.c
437 437
	return true;
438 438
}
439 439

  
440
static int trx_ctrl_rx_rsp_setslot(struct trx_l1h *l1h, struct trx_ctrl_rsp *rsp)
441
{
442
	/*TODO: parse TS num from rsp and get ts pointer, call a function in l1_if.c which in turn will: */
443
		if (rsp->status) {
444
			LOG("SETSLOT failed with status XYZ");
445
		}
446
		if (ts->flags | TS_F_PDCH_ACT_PENDING)
447
			cb_ts_connected(ts, rsp->status)
448
		return rsp->status == 0 ? 0 : -EINVAL;
449
}
450

  
440 451
/* -EINVAL: unrecoverable error, exit BTS
441 452
 * N > 0: try sending originating command again after N seconds
442 453
 * 0: Done with response, get originating command out from send queue
......
459 470
				phy_link_state_set(pinst->phy_link, PHY_LINK_SHUTDOWN);
460 471
			return 5;
461 472
		}
473
	} else if (strcmp(rsp->cmd, "SETSLOT") == 0) {
474
		return trx_ctrl_rx_rsp_setslot(l1h, rsp);
462 475
	}
463 476

  
464 477
	if (rsp->status) {
tests/handover/handover_test.c
278 278
void trx_get_hlayer1(void) {}
279 279
int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { return 0; }
280 280
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { return 0; }
281
int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { return 0; }
281
void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { return; }
282 282
int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { return 0; }
283 283
int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) { return 0; }
tests/meas/meas_test.c
659 659
	return 0;
660 660
}
661 661

  
662
int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan)
662
void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan)
663 663
{
664
	return 0;
664
	return;
665 665
}
666 666

  
667 667
int bts_model_lchan_deactivate(struct gsm_lchan *lchan)
tests/stubs.c
54 54
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts)
55 55
{ return 0; }
56 56

  
57
int bts_model_ts_connect(struct gsm_bts_trx_ts *ts,
57
void bts_model_ts_connect(struct gsm_bts_trx_ts *ts,
58 58
			 enum gsm_phys_chan_config as_pchan)
59
{ return 0; }
59
{ return; }
60
- 
Add picture from clipboard (Maximum size: 48.8 MB)