view src/aci2/mfw/mfw_band.c @ 673:62a5285e014a

Lorekeeping: allow tpudrv-leonardo.lib on Leonardo/Tango Back in 2015 the Mother's idea was to produce a FreeCalypso development board that would be a clone of TI Leonardo, including the original quadband RFFE; one major additional stipulation was that this board needed to be able to run original unmodified TCS211-20070608 firmware with all blobs intact, with only minimal binary patches to main.lib and tpudrv.lib. The necessary patched libs were produced at that time in the tcs211-patches repository. That plan was changed and we produced FCDEV3B instead, with Openmoko's triband RFFE instead of Leonardo quadband, but when FC Magnetite started in 2016, a TPUDRV_blob= provision was still made, allowing the possibility of patching OM's tpudrv.lib for a restored Leonardo RFFE. Now in 2020 we have FC Tango which is essentially a verbatim clone of Leonardo core, including the original quadband RFFE. We have also deblobbed our firmware so much that we have absolutely no real need for a blob version of tpudrv.lib - but I thought it would be neat to put the ancient TPUDRV_blob= mechanism (classic config) to its originally intended use, just for the heck of it.
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 29 May 2020 03:55:36 +0000
parents d5bbfb9649d5
children
line wrap: on
line source

/*
+--------------------------------------------------------------------+
| PROJECT: GSM-MFW                   $Workfile:: Mfw_band.c           $|
| $Author:: MC/SH                          $Revision::  1              $|
| STATE  : code                                                       |
+--------------------------------------------------------------------+

   MODULE  : MFW_BAND

   PURPOSE : AT%BAND functionality for MFW


   $History: Mfw_band.c                                              $

*/


#define ENTITY_MFW


#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#include "typedefs.h"
#include "vsi.h"
#include "pei.h"
#include "custom.h"
#include "gsm.h"

#include "prim.h"
#ifndef PCM_2_FFS
#include "pcm.h"
#endif

/* BEGIN ADD: Sumit : Req ID: : 31-Mar-2005*/
#ifndef NEPTUNE_BOARD
/* END ADD: Sumit : Req ID: : 31-Mar-2005*/
#include "ffs/ffs.h"
/* BEGIN ADD: Sumit : Req ID: : 31-Mar-2005*/
#else
#include "ffs.h"
#endif
/* END ADD: Sumit : Req ID: : 31-Mar-2005*/


/* SPR#1470 - SH - these includes are now outside of
 * FAX_AND_DATA switch */
#include "message.h"
#include "prim.h"
#include "aci_cmh.h"

#if defined (FAX_AND_DATA)
/*#include "message.h"
#include "prim.h"
#include "aci_cmh.h"  SPR#1470 - SH */
#include "aci_fd.h"
#endif

#ifdef GPRS
#include "gprs.h"
#endif
#include "dti_conn_mng.h"

#include "phb.h"
#include "psa.h"
#include "cmh.h"
#include "cmh_phb.h"
#include "psa.h"
#include "psa_sim.h"
#include "cus_aci.h"
#include "cmh_mm.h"
#include "cmh_sim.h"

#include "Mfw_band.h"


/*
+--------------------------------------------------------------------+
| PROJECT: GSM-MFW (8417)               MODULE:  MFW_BAND          |
| STATE  : code                         ROUTINE: band_radio_mode_switch|
+--------------------------------------------------------------------+


   PURPOSE :   Set radio band and mode

*/

T_MFW_BAND_RET band_radio_mode_switch(T_MFW_BAND_MODE mode, UBYTE band)
{
	T_ACI_RETURN ret;

	TRACE_FUNCTION("band_radio_mode_switch");

	ret = sAT_PercentBAND(CMD_SRC_LCL, mode, band); /*radio mode set without errors*/

	TRACE_EVENT_P1("Band: %d", band);
	TRACE_EVENT_P1("Return val: %d", ret);

	switch(ret)
	{
		case (AT_BUSY):
			return MFW_BAND_Busy;
//			break;  // RAVI
		case (AT_FAIL):
			return MFW_BAND_Fail;
//			break;   // RAVI
		case (AT_CMPL):
			return MFW_BAND_OK;
//			break;  // RAVI
		case (AT_EXCT):
			return MFW_BAND_InProgress;
//			break;   // RAVI
		default:
			return MFW_BAND_Fail;
//			break;     // RAVI
	}
}


/*
+--------------------------------------------------------------------+
| PROJECT: GSM-MFW (8417)               MODULE:  MFW_BAND          |
| STATE  : code                         ROUTINE: band_get_radio_modes  |
+--------------------------------------------------------------------+


   PURPOSE :   Get list of possible bands

*/

T_MFW_BAND_RET band_get_radio_modes(T_MFW_BAND_MODE* maxMode, UBYTE *band)
{
	T_ACI_RETURN ret;

	ret = tAT_PercentBAND(CMD_SRC_LCL, (T_ACI_BAND_MODE*)maxMode, (UBYTE*)band);

	if (ret == AT_CMPL)
		return MFW_BAND_OK;
	else
		return MFW_BAND_Fail;
}

/*
+--------------------------------------------------------------------------+
| PROJECT: GSM-MFW (8417)               MODULE:  MFW_BAND                |
| STATE  : code                         ROUTINE: band_get_current_radio_mode  |
+---------------------------------------------------------------------------+


   PURPOSE :   Get current band setting

*/
T_MFW_BAND_RET band_get_current_radio_mode(T_MFW_BAND_MODE* mode, UBYTE* band)
{
	T_ACI_RETURN ret;

	ret = qAT_PercentBAND(CMD_SRC_LCL, (T_ACI_BAND_MODE*)mode, (UBYTE*)band);

	if (ret == AT_CMPL)
		return MFW_BAND_OK;
	else
		return MFW_BAND_Fail;

}