Introduce CONFIG_TX_ENABLE and disable Tx support by default
authorHarald Welte <laforge@gnumonks.org>
Tue, 2 Mar 2010 19:42:39 +0000 (20:42 +0100)
committerHarald Welte <laforge@gnumonks.org>
Tue, 2 Mar 2010 19:42:39 +0000 (20:42 +0100)
Tx support is considered experimental and potentially dangerous.

Thus, the default build of the firmware does not have Tx support
enabled.

If you want Tx support, compile with -DCONFIG_TX_ENABLE by uncommenting
the apropriate line in Makefile.inc

src/target/firmware/Makefile.inc
src/target/firmware/board/common/rffe_compal_dualband.c
src/target/firmware/layer1/init.c
src/target/firmware/layer1/tpu_window.c
src/target/firmware/rf/trf6151.c

index ff29340..a130cd7 100644 (file)
@@ -14,6 +14,9 @@ CFLAGS += -Wa,-adhlns=$(subst $(suffix $<),.lst,$<)
 CFLAGS += -Os -ffunction-sections
 CFLAGS += -g$(DEBUGF)
 
+# Uncomment this line if you want to enable Tx (Transmit) Support.
+#CFLAGS += -DCONFIG_TX_ENABLE
+
 # some older toolchains don't support this, ignore it for now
 #ASFLAGS=-Wa,-adhlns=$(<:.S=.lst),--g$(DEBUGF) $(INCLUDES) -D__ASSEMBLY__
 ASFLAGS=-Wa,-adhlns=$(<:.S=.lst) $(INCLUDES) -D__ASSEMBLY__
index ddf7f93..0c1b20f 100644 (file)
@@ -26,6 +26,7 @@ void rffe_mode(enum gsm_band band, int tx)
        tspact &= ~PA_ENABLE;
        tspact |= TRENA | GSM_TXEN;     /* low-active */
 
+#ifdef CONFIG_TX_ENABLE
        /* Then we selectively set the bits on, if required */
        if (tx) {
                tspact &= ~TRENA;
@@ -33,6 +34,7 @@ void rffe_mode(enum gsm_band band, int tx)
                        tspact &= ~GSM_TXEN;
                tspact |= PA_ENABLE;    /* Dieter: TODO */
        }
+#endif /* TRANSMIT_SUPPORT */
 
        tsp_act_update(tspact);
 }
index 601b1a2..cad94f2 100644 (file)
@@ -40,6 +40,10 @@ void layer1_init(void)
 {
        struct msgb *msg;
 
+#ifndef CONFIG_TX_ENABLE
+       printf("\n\nTHIS FIRMWARE WAS COMPILED WITHOUT TX SUPPORT!!!\n\n");
+#endif
+
        /* initialize asynchronous part of L1 */
        l1a_init();
        /* initialize TDMA Frame IRQ driven synchronous L1 */
index 5a4595e..c36fd82 100644 (file)
@@ -101,9 +101,11 @@ void l1s_tx_win_ctrl(uint16_t arfcn, enum l1_txwin_type wtype, uint8_t pwr)
        /* uplink is three TS after downlink ( "+ 32" gives a TA of 1) */
        uint16_t offset = (L1_BURST_LENGTH_Q * 3) + 28;
 
+#ifdef CONFIG_TX_ENABLE
        /* window open for TRF6151 and RFFE */
        rffe_mode(gsm_arfcn2band(arfcn), 1);
        trf6151_tx_window(offset, arfcn);
+#endif
 
        /* Window open for ABB */
        twl3025_uplink(1, offset);
index a95fa9a..de80ba9 100644 (file)
@@ -446,6 +446,7 @@ void trf6151_rx_window(int16_t start_qbits, uint16_t arfcn, uint8_t vga_dbm, int
 /* prepare a Tx window with the TRF6151 finished at time 'start' (in qbits) */
 void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn)
 {
+#ifdef CONFIG_TX_ENABLE
        int16_t start_pll_qbits;
 
        /* power up at the right time _before_ the 'start_qbits' point in time */
@@ -456,4 +457,5 @@ void trf6151_tx_window(int16_t start_qbits, uint16_t arfcn)
        trf6151_set_mode(TRF6151_TX);
 
        /* FIXME: power down at the right time again */
+#endif
 }