summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/support.c
diff options
context:
space:
mode:
authorAndreas.Eversberg <jolly@eversberg.eu>2011-03-16 08:52:01 +0000
committerSylvain Munaut <tnt@246tNt.com>2011-05-29 19:51:54 +0200
commit58ac7e0e98c448dcece8e7dfa53f484c982e96cf (patch)
tree9e81e18348a4b3cf76dc3b204a5493f1f9e6cca1 /src/host/layer23/src/mobile/support.c
parent16ec2358a014f290be47e87e3489f98769681979 (diff)
[layer23] Adding Quadband support and GSM 4x0 support
This makes it possible to use GSM 850 and PCS 1900 bands, as used in the US. The support relies on the phone hardware. Each band (900, DCS, 850, PCS, 480 and 450) can be enabled and disabled individually for each setting.
Diffstat (limited to 'src/host/layer23/src/mobile/support.c')
-rw-r--r--src/host/layer23/src/mobile/support.c109
1 files changed, 56 insertions, 53 deletions
diff --git a/src/host/layer23/src/mobile/support.c b/src/host/layer23/src/mobile/support.c
index 97306f52..d2947dc6 100644
--- a/src/host/layer23/src/mobile/support.c
+++ b/src/host/layer23/src/mobile/support.c
@@ -28,14 +28,10 @@
void gsm_support_init(struct osmocom_ms *ms)
{
struct gsm_support *sup = &ms->support;
- int i;
memset(sup, 0, sizeof(*sup));
sup->ms = ms;
- /* rf power capability */
- sup->class_900 = 4; /* CLASS 4: Handheld 2W */
- sup->class_dcs = 1; /* CLASS 1: Handheld 1W */
/* controlled early classmark sending */
sup->es_ind = 0; /* no */
/* revision level */
@@ -70,21 +66,16 @@ void gsm_support_init(struct osmocom_ms *ms)
sup->e_gsm = 1; /* E-GSM */
sup->r_gsm = 1; /* R-GSM */
sup->dcs = 1;
- /* set supported frequencies */
- if (sup->p_gsm)
- for(i = 1; i <= 124; i++)
- sup->freq_map[i >> 3] |= (1 << (i & 7));
- if (sup->dcs)
- for(i = 512; i <= 885; i++)
- sup->freq_map[i >> 3] |= (1 << (i & 7));
- if (sup->e_gsm) {
- for(i = 975; i <= 1023; i++)
- sup->freq_map[i >> 3] |= (1 << (i & 7));
- sup->freq_map[0] |= 1;
- }
- if (sup->r_gsm)
- for(i = 955; i <= 974; i++)
- sup->freq_map[i >> 3] |= (1 << (i & 7));
+ sup->gsm_850 = 1;
+ sup->pcs = 1;
+ sup->gsm_480 = 0;
+ sup->gsm_450 = 0;
+ /* rf power capability */
+ sup->class_900 = 4; /* CLASS 4: Handheld 2W */
+ sup->class_850 = 4;
+ sup->class_400 = 4;
+ sup->class_dcs = 1; /* CLASS 1: Handheld 1W */
+ sup->class_pcs = 1;
/* multi slot support */
sup->ms_sup = 0; /* no */
/* ucs2 treatment */
@@ -116,7 +107,7 @@ struct gsm_support_scan_max gsm_sup_smax[] = {
{ 259, 293, 15, 0 }, /* GSM 450 */
{ 306, 340, 15, 0 }, /* GSM 480 */
{ 438, 511, 25, 0 },
- { 128, 251, 30, 0 },
+ { 128, 251, 30, 0 }, /* GSM 850 */
{ 955, 124, 30, 0 }, /* P,E,R GSM */
{ 512, 885, 40, 0 }, /* DCS 1800 */
{ 0, 0, 0, 0 }
@@ -133,46 +124,58 @@ void gsm_support_dump(struct osmocom_ms *ms,
print(priv, "Supported features of MS '%s':\n", sup->ms->name);
print(priv, " Phase %d mobile station\n", sup->rev_lev + 1);
- print(priv, " R-GSM : %s\n", SUP_SET(r_gsm));
- print(priv, " E-GSM : %s\n", SUP_SET(e_gsm));
- print(priv, " P-GSM : %s\n", SUP_SET(p_gsm));
- print(priv, " GSM900 Class: %d\n", set->class_900);
- print(priv, " DCS 1800 : %s\n", SUP_SET(dcs));
- print(priv, " DCS Class : %d\n", set->class_dcs);
- print(priv, " CECS : %s\n", (sup->es_ind) ? "yes" : "no");
- print(priv, " VGCS : %s\n", (sup->vgcs) ? "yes" : "no");
- print(priv, " VBS : %s\n", (sup->vbs) ? "yes" : "no");
- print(priv, " SMS : %s\n", SUP_SET(sms_ptp));
- print(priv, " SS_IND : %s\n", (sup->ss_ind) ? "yes" : "no");
- print(priv, " PS_CAP : %s\n", (sup->ps_cap) ? "yes" : "no");
- print(priv, " CMSP : %s\n", (sup->cmsp) ? "yes" : "no");
- print(priv, " SoLSA : %s\n", (sup->solsa) ? "yes" : "no");
- print(priv, " LCSVA : %s\n", (sup->lcsva) ? "yes" : "no");
- print(priv, " LOC_SERV : %s\n", (sup->loc_serv) ? "yes" : "no");
- print(priv, " A5/1 : %s\n", SUP_SET(a5_1));
- print(priv, " A5/2 : %s\n", SUP_SET(a5_2));
- print(priv, " A5/3 : %s\n", SUP_SET(a5_3));
- print(priv, " A5/4 : %s\n", SUP_SET(a5_4));
- print(priv, " A5/5 : %s\n", SUP_SET(a5_5));
- print(priv, " A5/6 : %s\n", SUP_SET(a5_6));
- print(priv, " A5/7 : %s\n", SUP_SET(a5_7));
- print(priv, " A5/1 : %s\n", SUP_SET(a5_1));
+ print(priv, " R-GSM : %s\n", SUP_SET(r_gsm));
+ print(priv, " E-GSM : %s\n", SUP_SET(e_gsm));
+ print(priv, " P-GSM : %s\n", SUP_SET(p_gsm));
+ if (set->r_gsm || set->e_gsm || set->p_gsm)
+ print(priv, " GSM900 Class : %d\n", set->class_900);
+ print(priv, " DCS 1800 : %s\n", SUP_SET(dcs));
+ if (set->dcs)
+ print(priv, " DCS Class : %d\n", set->class_dcs);
+ print(priv, " GSM 850 : %s\n", SUP_SET(gsm_850));
+ if (set->gsm_850)
+ print(priv, " GSM 850 Class: %d\n", set->class_850);
+ print(priv, " PCS 1900 : %s\n", SUP_SET(pcs));
+ if (set->pcs)
+ print(priv, " PCS Class : %d\n", set->class_pcs);
+ print(priv, " GSM 480 : %s\n", SUP_SET(gsm_480));
+ print(priv, " GSM 450 : %s\n", SUP_SET(gsm_450));
+ if (set->gsm_480 | set->gsm_450)
+ print(priv, " GSM 400 Class: %d\n", set->class_400);
+ print(priv, " CECS : %s\n", (sup->es_ind) ? "yes" : "no");
+ print(priv, " VGCS : %s\n", (sup->vgcs) ? "yes" : "no");
+ print(priv, " VBS : %s\n", (sup->vbs) ? "yes" : "no");
+ print(priv, " SMS : %s\n", SUP_SET(sms_ptp));
+ print(priv, " SS_IND : %s\n", (sup->ss_ind) ? "yes" : "no");
+ print(priv, " PS_CAP : %s\n", (sup->ps_cap) ? "yes" : "no");
+ print(priv, " CMSP : %s\n", (sup->cmsp) ? "yes" : "no");
+ print(priv, " SoLSA : %s\n", (sup->solsa) ? "yes" : "no");
+ print(priv, " LCSVA : %s\n", (sup->lcsva) ? "yes" : "no");
+ print(priv, " LOC_SERV : %s\n", (sup->loc_serv) ? "yes" : "no");
+ print(priv, " A5/1 : %s\n", SUP_SET(a5_1));
+ print(priv, " A5/2 : %s\n", SUP_SET(a5_2));
+ print(priv, " A5/3 : %s\n", SUP_SET(a5_3));
+ print(priv, " A5/4 : %s\n", SUP_SET(a5_4));
+ print(priv, " A5/5 : %s\n", SUP_SET(a5_5));
+ print(priv, " A5/6 : %s\n", SUP_SET(a5_6));
+ print(priv, " A5/7 : %s\n", SUP_SET(a5_7));
+ print(priv, " A5/1 : %s\n", SUP_SET(a5_1));
switch (set->ch_cap) {
case GSM_CAP_SDCCH:
- print(priv, " Channels : SDCCH only\n");
+ print(priv, " Channels : SDCCH only\n");
break;
case GSM_CAP_SDCCH_TCHF:
- print(priv, " Channels : SDCCH + TCH/F\n");
+ print(priv, " Channels : SDCCH + TCH/F\n");
break;
case GSM_CAP_SDCCH_TCHF_TCHH:
- print(priv, " Channels : SDCCH + TCH/F + TCH/H\n");
+ print(priv, " Channels : SDCCH + TCH/F + TCH/H\n");
break;
}
- print(priv, " Full-Rate V1: %s\n", SUP_SET(full_v1));
- print(priv, " Full-Rate V2: %s\n", SUP_SET(full_v2));
- print(priv, " Full-Rate V3: %s\n", SUP_SET(full_v3));
- print(priv, " Half-Rate V1: %s\n", SUP_SET(half_v1));
- print(priv, " Half-Rate V3: %s\n", SUP_SET(half_v3));
- print(priv, " Min RXLEV : %d\n", set->min_rxlev_db);
+ print(priv, " Full-Rate V1 : %s\n", SUP_SET(full_v1));
+ print(priv, " Full-Rate V2 : %s\n", SUP_SET(full_v2));
+ print(priv, " Full-Rate V3 : %s\n", SUP_SET(full_v3));
+ print(priv, " Half-Rate V1 : %s\n", SUP_SET(half_v1));
+ print(priv, " Half-Rate V3 : %s\n", SUP_SET(half_v3));
+ print(priv, " Min RXLEV : %d\n", set->min_rxlev_db);
}