diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2011-03-16 08:52:01 +0000 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2011-05-29 19:51:54 +0200 |
commit | 58ac7e0e98c448dcece8e7dfa53f484c982e96cf (patch) | |
tree | 9e81e18348a4b3cf76dc3b204a5493f1f9e6cca1 /src/host/layer23/src/mobile/settings.c | |
parent | 16ec2358a014f290be47e87e3489f98769681979 (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/settings.c')
-rw-r--r-- | src/host/layer23/src/mobile/settings.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c index db22fd9f..15397fa6 100644 --- a/src/host/layer23/src/mobile/settings.c +++ b/src/host/layer23/src/mobile/settings.c @@ -68,6 +68,9 @@ int gsm_settings_init(struct osmocom_ms *ms) set->dcs = sup->dcs; set->class_900 = sup->class_900; set->class_dcs = sup->class_dcs; + set->class_850 = sup->class_850; + set->class_pcs = sup->class_pcs; + set->class_400 = sup->class_400; set->full_v1 = sup->full_v1; set->full_v2 = sup->full_v2; set->full_v3 = sup->full_v3; @@ -80,6 +83,7 @@ int gsm_settings_init(struct osmocom_ms *ms) if (sup->half_v1 || sup->half_v3) set->half = 1; + /* software features */ set->cc_dtmf = 1; @@ -88,6 +92,43 @@ int gsm_settings_init(struct osmocom_ms *ms) return 0; } +int gsm_settings_arfcn(struct osmocom_ms *ms) +{ + int i; + struct gsm_settings *set = &ms->settings; + + /* set supported frequencies */ + memset(set->freq_map, 0, sizeof(set->freq_map)); + if (set->p_gsm) + for(i = 1; i <= 124; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + if (set->gsm_850) + for(i = 128; i <= 251; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + if (set->gsm_450) + for(i = 259; i <= 293; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + if (set->gsm_480) + for(i = 306; i <= 340; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + if (set->dcs) + for(i = 512; i <= 885; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + if (set->pcs) + for(i = 1024; i <= 1024-512+810; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + if (set->e_gsm) { + for(i = 975; i <= 1023; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + set->freq_map[0] |= 1; + } + if (set->r_gsm) + for(i = 955; i <= 974; i++) + set->freq_map[i >> 3] |= (1 << (i & 7)); + + return 0; +} + int gsm_settings_exit(struct osmocom_ms *ms) { struct gsm_settings *set = &ms->settings; |